/* Personal Finances — Visual 3: Híbrido Premium.
   Folha isolada: nenhuma regra afeta os Visuais Clássico, 1 ou 2. */
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) {
    --pf-v3-panel: #131c29;
    --pf-v3-card: #1d2836;
    --pf-v3-border: #354a63;
    --pf-v3-text: #e9f2ff;
    --pf-v3-muted: #99aec6;
}
/* Acoes de lancamentos na mesma barra direita dos demais visuais;
   nao duplicar comandos abaixo das contas. */
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #rightSidebar {
    display: flex !important;
    flex-direction: column;
    flex-shrink: 0;
    gap: 10px;
    background: #121b28 !important;
    border-left: 1px solid #354a63 !important;
}
/* Barra superior com os mesmos controles de Indicadores e Principais gastos
   utilizados na Linha do Tempo, com preferencias independentes para o Visual 3. */
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #subBar .pf-v2-toolbar-flag {
    display: flex !important;
    align-items: center;
    gap: 6px;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #pfV3SidebarPanel[hidden] {
    display: none !important;
    min-height: 0 !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #subBar .pf-v2-unified-flag {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    gap: 6px !important;
    margin: 0 0 0 8px !important;
    padding: 0 0 0 12px !important;
    border: 0 !important;
    border-left: 1px solid #475569 !important;
    white-space: nowrap !important;
}

body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #subBar .pf-v2-unified-flag label {
    margin: 0 !important;
    font: inherit !important;
    font-weight: 600 !important;
    cursor: pointer;
}
body.pf-home-v3:not(.dark):not(.pro-mode):has(#viewLancamentos:not(.hidden)) #rightSidebar {
    background: #edf3fa !important;
    border-left-color: #cbd8e8 !important;
    color: #203b5b !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #sidebarPanel {
    flex: 0 0 clamp(290px, 20.5vw, 342px) !important;
    width: clamp(290px, 20.5vw, 342px) !important;
    min-width: 275px !important;
    max-width: 350px !important;
    min-height: 0;
    padding: 10px 9px !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    gap: 9px;
    border-right: 1px solid var(--pf-v3-border);
    background: #0d1622 !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #sidebarPanel > div:nth-child(2) {
    display: none !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #accountsListTree {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column;
    min-height: 110px !important;
    overflow-y: auto !important;
    padding: 3px 3px 0 !important;
    gap: 8px;
    scrollbar-width: thin;
}
body.pf-home-v3 #accountsListTree > div {
    margin: 0 !important;
    padding: 8px !important;
    background: #152130 !important;
    border: 1px solid #3a5573 !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 10px #0002;
}
body.pf-home-v3 #accountsListTree > div > div:first-child {
    background: linear-gradient(100deg, #21344b, #1b2b40) !important;
    border: 1px solid #2f609b !important;
    border-radius: 9px !important;
    padding: 8px 9px !important;
    color: #f2f7ff;
    margin-bottom: 6px !important;
    gap: 5px;
}
body.pf-home-v3 #accountsListTree > div > div:first-child span {
    font-size: 13px !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
body.pf-home-v3 #accountsListTree > div > div:nth-child(2) {
    padding-left: 2px !important;
}
body.pf-home-v3 #accountsListTree > div > div:nth-child(2) > div {
    margin: 2px 0;
    background: #101824 !important;
    min-height: 31px;
    border-bottom: 1px solid #2d3947;
    color: #e8f1ff;
    gap: 5px;
}
body.pf-home-v3 #accountsListTree > div > div:nth-child(2) > div > span {
    font-size: 11px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
body.pf-home-v3 #accountsListTree input[type="checkbox"] {
    accent-color: #2686f7;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #pfV3SidebarPanel {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 auto;
    padding: 0;
    max-height: min(40vh, 360px);
    min-height: 200px;
    overflow: hidden;
    background: #141f2d;
    border: 1px solid #344b66;
    border-radius: 13px;
}
body.pf-home-v3 #pfV3SidebarPanel > #pfHomeInsights {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-home-insight {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-v3-expenses-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #354861;
    font-weight: 700;
    font-size: 14px;
    color: #eaf4ff;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-v3-expenses-heading span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-v3-expenses-heading label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b8c8da;
    font-size: 12px;
    font-weight: 600;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-v3-expenses-heading select {
    min-width: 74px;
    padding: 4px 8px;
    background: #0f1723;
    color: #eff6ff;
    border: 1px solid #425974;
    border-radius: 9px;
    font-size: 12px;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-home-category {
    margin: 0 10px 8px !important;
    padding: 10px 11px !important;
    background: #1b2a3c !important;
    border: 1px solid #33485f !important;
    border-radius: 10px !important;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-home-category:first-of-type {
    margin-top: 10px !important;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-home-category span,
body.pf-home-v3 #pfV3SidebarPanel .pf-home-category strong {
    color: #e8f1ff !important;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-home-category strong {
    font-size: 11px;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-home-progress {
    background: #0e1824 !important;
}
body.pf-home-v3 #pfV3SidebarPanel .pf-home-empty {
    margin: 12px;
    color: #b8c8da;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #centralMainView {
    min-width: 0;
    background: #0b111b !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #subBar {
    flex: 0 0 auto;
    margin: 6px 14px 7px;
    padding: 8px 13px;
    min-height: 48px;
    border: 1px solid #364961;
    border-radius: 10px;
    background: #141b27 !important;
    color: #edf6ff;
    gap: 8px;
}
body.pf-home-v3 #subBar > div:last-child {
    display: none;
}
body.pf-home-v3 #subBar > div:first-child {
    gap: 8px;
}
body.pf-home-v3 #viewLancamentos:not(.hidden) {
    padding: 0 14px 12px !important;
    gap: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
}
body.pf-home-v3 #viewLancamentos > #pfModernOverview:not([hidden]) {
    display: contents !important;
}
body.pf-home-v3 #pfModernOverview > .pf-home-overview-toolbar,
body.pf-home-v3 #pfModernOverview > .pf-home-list-title,
body.pf-home-v3 #pfModernOverview > #pfHomeInsights,
body.pf-home-v3 #pfModernOverview > .pf-timeline-kpi-toggle {
    display: none !important;
}
body.pf-home-v3 #pfModernOverview > .pf-home-kpis:not([hidden]) {
    display: grid !important;
    grid-template-columns: minmax(0, 1.16fr) repeat(3, minmax(0, 1fr)) !important;
    flex: 0 0 auto;
    gap: 10px !important;
    width: 100% !important;
    margin: 2px 0 10px !important;
    min-width: 0;
}
body.pf-home-v3 #pfModernOverview .pf-home-kpi.pf-kpi-ref {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 24% !important;
    column-gap: 4px !important;
    align-items: center;
    width: 100%;
    min-width: 0 !important;
    height: 93px !important;
    min-height: 93px !important;
    margin: 0 !important;
    padding: 10px 11px !important;
    border-radius: 13px;
    overflow: hidden !important;
    container-type: inline-size;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-ref-text {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-ref-text span {
    font-size: clamp(10px, 4.1cqw, 13px);
    font-weight: 700;
    color: #e4eefb;
    white-space: nowrap;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-ref-text strong {
    font-size: clamp(16px, 7.4cqw, 24px);
    line-height: 1.14;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    letter-spacing: -0.4px;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-ref-text small {
    font-size: 10px;
    color: #aebfd3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-mini-chart {
    display: block !important;
    width: 100%;
    height: 47px;
    align-self: center;
    overflow: hidden;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-mini-chart svg {
    display: block;
    width: 100%;
    height: 100%;
}
body.pf-home-v3 #pfModernOverview .pf-home-balance {
    background: linear-gradient(110deg, #125ac4, #0b3467) !important;
    border: 1px solid #207fea !important;
    color: #fff !important;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-income {
    background: linear-gradient(115deg, #0a392b, #0a2a24) !important;
    border: 1px solid #1c714b !important;
    color: #22d888;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-expense {
    background: linear-gradient(110deg, #252534, #151b2a) !important;
    border: 1px solid #503d53 !important;
    color: #ff6b78;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-result {
    background: linear-gradient(110deg, #20374e, #142639) !important;
    border: 1px solid #3a5873 !important;
    color: #edf4ff;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-income .pf-kpi-ref-text strong,
body.pf-home-v3 #pfModernOverview .pf-kpi-income .pf-kpi-ref-text i {
    color: #21c977;
}
body.pf-home-v3 #pfModernOverview .pf-kpi-expense .pf-kpi-ref-text strong,
body.pf-home-v3 #pfModernOverview .pf-kpi-expense .pf-kpi-ref-text i {
    color: #ff5b69;
}
body.pf-home-v3 #pfModernTransactionCards:not([hidden]) {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 2px 12px !important;
    margin: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border: 1px solid #283a4e;
    border-radius: 12px;
    background: #0c1421;
    scrollbar-width: thin;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 49px;
    margin: 0 4px 6px;
    padding: 6px 6px;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #f0f6ff;
}
body.pf-home-v3 .pf-premium-heading {
    display: grid !important;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 2px 7px !important;
    min-width: 0;
}
body.pf-home-v3 .pf-premium-heading > i {
    color: #9ecbff;
    grid-row: 1 / 3;
    font-size: 15px;
}
body.pf-home-v3 .pf-premium-heading > strong {
    font-size: 13px !important;
}
body.pf-home-v3 .pf-premium-heading > strong small {
    font-size: 11px;
    color: #bdc8d9;
}
body.pf-home-v3 .pf-premium-heading > small {
    grid-column: 2;
    width: auto !important;
    margin: 0 !important;
    color: #9eafc5;
    font-size: 10px;
}
body.pf-home-v3 .pf-v3-sr-hint {
    position: absolute !important;
    clip-path: inset(50%);
    width: 1px !important;
    height: 1px !important;
    overflow: hidden;
    white-space: nowrap;
}
body.pf-home-v3 .pf-v3-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}
body.pf-home-v3 .pf-v3-toolbar button {
    display: inline-grid;
    place-items: center;
    height: 30px;
    min-width: 32px;
    padding: 4px;
    background: #1d3047;
    color: #a8d1ff;
    border: 1px solid #3a5571;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
body.pf-home-v3 .pf-v3-toolbar button.pf-v3-action-primary {
    background: #195bbf;
    border-color: #3575d6;
    color: #fff;
}
body.pf-home-v3 .pf-v3-toolbar button.danger {
    color: #fb6977;
}
body.pf-home-v3 .pf-v3-toolbar button:hover,
body.pf-home-v3 .pf-v3-toolbar button:focus-visible {
    background: #315b89;
    outline: 1px solid #7db6ff;
}
/* Uma única definição de colunas para cabeçalho e lançamentos. */
body.pf-home-v3 {
    --pf-v3-cols: 25px minmax(90px, 2.1fr) 91px minmax(95px, 1.3fr) 76px minmax(88px, 0.92fr) minmax(82px, 0.93fr) 38px
        99px;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head,
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row {
    display: grid !important;
    grid-template-columns: var(--pf-v3-cols) !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 5px 5px;
    width: calc(100% - 10px) !important;
    padding: 9px 10px;
    border-radius: 9px;
    color: #cedced;
    font-size: 11px;
    background: #1b2a3a;
    border: 1px solid #394d62;
    box-shadow: 0 3px 8px #0003;
}
body.pf-home-v3 .pf-premium-table-head > span:nth-child(6),
body.pf-home-v3 .pf-premium-table-head > span:nth-child(7) {
    text-align: right;
}
body.pf-home-v3 .pf-premium-table-head > span:nth-child(8),
body.pf-home-v3 .pf-premium-table-head > span:nth-child(9) {
    text-align: center;
}
body.pf-home-v3 .pf-v3-head-select,
body.pf-home-v3 .pf-v3-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.pf-home-v3 .pf-v3-head-select input,
body.pf-home-v3 .pf-v3-select input {
    width: 16px;
    height: 16px;
    accent-color: #2387ff;
    cursor: pointer;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-section {
    min-width: 0 !important;
    margin: 6px 5px 9px;
    width: calc(100% - 10px) !important;
    background: #0e1825;
    border: 1px solid #293e54;
    border-radius: 11px;
    overflow: hidden;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-type-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    width: 100%;
    min-height: 38px;
    padding: 7px 14px;
    border: none;
    border-bottom: 1px solid #28744e;
    border-radius: 9px;
    text-align: left;
    cursor: pointer;
    background: linear-gradient(95deg, #075333, #064125) !important;
    color: #d6ffeb !important;
    font-size: 13px;
    font-weight: 750;
}
body.pf-home-v3 .pf-premium-type-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
body.pf-home-v3 .pf-premium-type-heading > strong {
    font-size: 12px;
    white-space: nowrap;
}
body.pf-home-v3 .pf-premium-type-heading.expense {
    background: linear-gradient(95deg, #65252f, #4b1f27) !important;
    color: #ffe2e6 !important;
    border-color: #a04552 !important;
}
body.pf-home-v3 .pf-premium-type-heading.transfer {
    background: linear-gradient(95deg, #1d5498, #133b73) !important;
    color: #e7f1ff !important;
    border-color: #387ab9 !important;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-group {
    margin: 2px 8px 5px !important;
    width: calc(100% - 16px);
    border: 0;
    background: transparent;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-group-heading {
    width: 100%;
    min-height: 36px;
    margin: 3px 0 0;
    padding: 7px 10px;
    background: linear-gradient(90deg, #26394f, #1f3042) !important;
    border: 1px solid #3d5975 !important;
    border-radius: 9px !important;
    text-align: left;
    color: #f0f6ff;
    font-size: 12px;
    cursor: pointer;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-group-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
body.pf-home-v3 .pf-v3-category-icon {
    color: #76b5ff;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-group-heading > strong {
    color: #e1efff;
    white-space: nowrap;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row {
    min-height: 36px;
    margin: 0;
    padding: 5px 10px;
    border: 0;
    border-bottom: 1px solid #314358;
    border-radius: 0;
    background: #172332;
    color: #edf4fc;
    font-size: 11px;
    cursor: pointer;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row:nth-child(odd) {
    background: #1c2b3b;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row:hover {
    background: #2a4664;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row.selected {
    background: #1c416a;
    outline: 1px solid #65adff;
    outline-offset: -1px;
}
body.pf-home-v3 .pf-premium-description {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
body.pf-home-v3 .pf-premium-description strong {
    font-size: 11px;
    font-weight: 570;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.pf-home-v3 .pf-v3-type-dot {
    font-size: 10px;
    color: #60a5fa;
}
body.pf-home-v3 .pf-premium-row.income .pf-v3-type-dot {
    color: #22d58a;
}
body.pf-home-v3 .pf-premium-row.expense .pf-v3-type-dot {
    color: #fc596c;
}
body.pf-home-v3 .pf-premium-date,
body.pf-home-v3 .pf-premium-account {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #cedded;
}
body.pf-home-v3 .pf-premium-date i,
body.pf-home-v3 .pf-premium-account i {
    color: #83c4ff;
}
body.pf-home-v3 .pf-premium-kind {
    border-radius: 7px;
    width: fit-content;
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
}
body.pf-home-v3 .pf-premium-row .pf-home-tx-amount,
body.pf-home-v3 .pf-v3-daily-balance {
    min-width: 0;
    font-size: 11px;
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
body.pf-home-v3 .pf-v3-daily-balance {
    color: #cfdaeb;
}
body.pf-home-v3 .pf-premium-row .pf-home-tx-consider {
    display: flex !important;
    justify-content: center;
}
body.pf-home-v3 .pf-premium-row .pf-home-tx-consider input {
    width: 15px;
    height: 15px;
    accent-color: #2789ff;
}
body.pf-home-v3 .pf-premium-row .pf-visual-row-actions {
    display: inline-flex;
    gap: 2px;
    justify-content: flex-end;
}
body.pf-home-v3 .pf-premium-row .pf-visual-row-actions button {
    width: 29px;
    height: 27px;
    border: 0;
    background: transparent;
    font-size: 12px;
}
body.pf-home-v3 .pf-premium-row .pf-visual-row-actions button:hover {
    background: #325d89;
}
body.pf-home-v3 .pf-premium-row .pf-visual-row-actions button.danger {
    color: #ff6474;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row:focus-visible,
body.pf-home-v3 #pfModernTransactionCards button:focus-visible {
    outline: 2px solid #72b7ff;
    outline-offset: -2px;
}
/* Mesmo conteúdo no modo claro, sem letras invisíveis nem fundos escuros residuais. */
body.pf-home-v3:not(.dark):not(.pro-mode):has(#viewLancamentos:not(.hidden)) {
    --pf-v3-panel: #f3f6fb;
    --pf-v3-card: #fff;
    --pf-v3-border: #cbd8e7;
    --pf-v3-text: #14253e;
    --pf-v3-muted: #475569;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #centralMainView {
    background: #edf3fa !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #sidebarPanel {
    background: #e6eef8 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #accountsListTree > div,
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel {
    background: #fff !important;
    border-color: #c7d8ec !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #accountsListTree > div > div:first-child {
    background: #e7effb !important;
    color: #152b4c !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #accountsListTree > div > div:nth-child(2) > div {
    color: #1e314d !important;
    background: #f8fbff !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel .pf-v3-expenses-heading {
    color: #1e314d;
    border-color: #cfdeeb;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel .pf-v3-expenses-heading label {
    color: #51677f;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel .pf-v3-expenses-heading select {
    color: #233b57;
    background: #edf4fb;
    border-color: #cfdeeb;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel .pf-home-category {
    background: #edf4fb !important;
    border-color: #cfdeeb !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel .pf-home-category span,
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel .pf-home-category strong,
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel .pf-home-empty {
    color: #233b57 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfV3SidebarPanel .pf-home-progress {
    background: #d9e5f1 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #subBar {
    color: #17304e !important;
    background: #fff !important;
    border-color: #cad9e9 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards:not([hidden]) {
    background: #f5f8fd;
    border-color: #cedbea;
}
body.pf-home-v3:not(.dark):not(.pro-mode) .pf-premium-header {
    color: #183151 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) .pf-premium-heading > small,
body.pf-home-v3:not(.dark):not(.pro-mode) .pf-premium-heading > strong small {
    color: #536882 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) .pf-premium-table-head {
    background: #e6eef8 !important;
    color: #1b3553 !important;
    border-color: #b9cee5 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards .pf-premium-section {
    background: #eaf1fa;
    border-color: #cbd9e8;
}
body.pf-home-v3:not(.dark):not(.pro-mode) .pf-premium-group-heading {
    background: #e3edf9 !important;
    color: #173452 !important;
    border-color: #afcae7 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards .pf-premium-group-heading > strong {
    color: #203955 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards .pf-premium-row,
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards .pf-premium-row:nth-child(odd) {
    background: #fff !important;
    color: #1c2d42 !important;
    border-color: #d7e3f0 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards .pf-premium-row:hover {
    background: #e8f2ff !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards .pf-premium-row.selected {
    background: #ddecff !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) .pf-premium-account,
body.pf-home-v3:not(.dark):not(.pro-mode) .pf-premium-date,
body.pf-home-v3:not(.dark):not(.pro-mode) .pf-v3-daily-balance {
    color: #374d65 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernOverview .pf-kpi-ref:not(.pf-home-balance) {
    background: #fff !important;
    color: #1b3553 !important;
    border-color: #ccd9e6 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernOverview .pf-kpi-ref-text span {
    color: #344962;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernOverview .pf-kpi-ref-text small {
    color: #52677b;
}
@media (max-width: 1330px) {
    body.pf-home-v3 {
        --pf-v3-cols: 23px minmax(75px, 2fr) 83px minmax(76px, 1fr) 62px minmax(74px, 0.8fr) minmax(70px, 0.8fr) 32px
            83px;
    }
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head,
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-row {
        gap: 4px !important;
        padding-inline: 6px;
    }
    body.pf-home-v3 .pf-premium-row .pf-visual-row-actions button {
        width: 25px;
    }
    body.pf-home-v3 #pfModernOverview .pf-home-kpi.pf-kpi-ref {
        grid-template-columns: minmax(0, 1fr) 19% !important;
        padding: 8px !important;
    }
}
@media (max-width: 1100px) {
    body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #sidebarPanel {
        flex-basis: 255px !important;
        width: 255px !important;
        min-width: 245px !important;
    }
    body.pf-home-v3 {
        --pf-v3-cols: 23px minmax(75px, 2fr) 80px minmax(65px, 1fr) 62px minmax(75px, 0.85fr) 30px 78px;
    }
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head > span:nth-child(7),
    body.pf-home-v3 #pfModernTransactionCards .pf-v3-daily-balance {
        display: none;
    }
    body.pf-home-v3 #pfModernOverview > .pf-home-kpis:not([hidden]) {
        gap: 6px !important;
    }
}
@media (max-width: 900px) {
    body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #sidebarPanel {
        flex: 0 0 215px !important;
        width: 215px !important;
        min-width: 205px !important;
    }
    body.pf-home-v3 #viewLancamentos > #pfModernTransactionCards:not([hidden]) {
        overflow-x: auto !important;
    }
    body.pf-home-v3 #pfModernOverview > .pf-home-kpis:not([hidden]) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head,
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-row {
        min-width: 675px !important;
    }
}

/* Precedência correta das cores sem afetar outros modos. */
body.pf-home-v3 #pfModernTransactionCards .pf-premium-type-heading.expense {
    background: linear-gradient(95deg, #682830, #4d2029) !important;
    border-bottom-color: #ad4650 !important;
    color: #ffe1e6 !important;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-type-heading.transfer {
    background: linear-gradient(95deg, #205bb0, #163e7f) !important;
    border-bottom-color: #4a8bd6 !important;
    color: #e9f3ff !important;
}
body.pf-home-v3 #subBar > div:first-child {
    display: flex !important;
    visibility: visible !important;
}
body.pf-home-v3 #subBar label {
    color: inherit;
}
/* Contraste efetivo nas skins claras: regras com a mesma especificidade da
   composição escura, sem deixar fundos escuros com texto escuro. */
body.pf-home-v3:not(.dark):not(.pro-mode):has(#viewLancamentos:not(.hidden)) #sidebarPanel {
    background: #e7eef8 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode):has(#viewLancamentos:not(.hidden)) #centralMainView {
    background: #edf3fa !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode):has(#viewLancamentos:not(.hidden)) #subBar {
    background: #fff !important;
    border-color: #c6d5e6 !important;
    color: #203c5d !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #subBar label,
body.pf-home-v3:not(.dark):not(.pro-mode) #subBar span,
body.pf-home-v3:not(.dark):not(.pro-mode) #subBar i {
    color: #203c5d !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards .pf-premium-group-heading {
    background: linear-gradient(90deg, #dbe9f8, #eaf2fa) !important;
    color: #213952 !important;
    border-color: #b2c9e2 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernTransactionCards .pf-premium-group-heading strong {
    color: #233b59 !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernOverview .pf-kpi-ref.pf-home-balance .pf-kpi-ref-text span,
body.pf-home-v3:not(.dark):not(.pro-mode) #pfModernOverview .pf-kpi-ref.pf-home-balance .pf-kpi-ref-text small {
    color: #e9f4ff !important;
}

/* Visual 3: contas exclusivamente na coluna esquerda.
   Principais gastos ficam na coluna de conteúdo, ao lado dos lançamentos. */
body.pf-home-v3 #pfV3SidebarPanel {
    display: none !important;
}
body.pf-home-v3 #viewLancamentos > #pfTimelineContentLayout {
    display: grid !important;
    grid-template-columns: minmax(235px, 25%) minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
body.pf-home-v3 #pfTimelineContentLayout > #pfTimelineInsightsPanel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--pf-v3-border, #354a63);
    border-radius: 12px;
    background: var(--pf-v3-panel, #131c29);
}
body.pf-home-v3 #pfTimelineContentLayout > #pfModernTransactionCards {
    min-width: 0;
    min-height: 0;
    overflow: auto;
}
body.pf-home-v3 #pfTimelineInsightsPanel .pf-timeline-insights-heading {
    padding: 11px 12px;
    font-weight: 700;
    border-bottom: 1px solid var(--pf-v3-border, #354a63);
}
body.pf-home-v3 #pfTimelineInsightsPanel #pfTimelineInsightsToggle {
    display: none;
}
body.pf-home-v3 #pfTimelineInsightsPanel .pf-timeline-insights-body {
    min-height: 0;
    overflow: auto;
    padding: 10px;
}
body.pf-home-v3 #pfTimelineInsightsPanel #pfHomeInsights {
    display: block !important;
}
body.pf-home-v3 #pfTimelineInsightsPanel .pf-v3-top-expenses {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    border: 0;
    padding: 0;
}
body.pf-home-v3 #pfTimelineInsightsPanel .pf-v3-expenses-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-weight: 700;
}
body.pf-home-v3 #pfTimelineInsightsPanel .pf-v3-expenses-heading label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}
body.pf-home-v3 #pfTimelineInsightsPanel .pf-v3-expenses-heading select {
    color: inherit;
    background: var(--pf-v3-card, #1d2836);
    border: 1px solid var(--pf-v3-border, #354a63);
    border-radius: 6px;
    padding: 3px 6px;
}
body.pf-home-v3 #pfTimelineContentLayout.pf-timeline-insights-hidden {
    grid-template-columns: minmax(0, 1fr);
}
body.pf-home-v3 #pfTimelineContentLayout.pf-timeline-insights-hidden > #pfTimelineInsightsPanel {
    display: none !important;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfTimelineContentLayout > #pfTimelineInsightsPanel {
    background: #fff;
    color: #203b5b;
    border-color: #cbd8e8;
}
body.pf-home-v3:not(.dark):not(.pro-mode) #pfTimelineInsightsPanel .pf-v3-expenses-heading select {
    background: #fff;
    color: #203b5b;
    border-color: #cbd8e8;
}
@media (max-width: 900px) {
    body.pf-home-v3 #viewLancamentos > #pfTimelineContentLayout {
        grid-template-columns: minmax(0, 1fr);
        overflow: auto;
    }
    body.pf-home-v3 #pfTimelineContentLayout > #pfTimelineInsightsPanel {
        max-height: 260px;
    }
}

/* Visual 3 — rolagem com a coluna Principais gastos visível ou oculta.
   Uma única área de altura limitada; as duas colunas não determinam a
   altura da grade. O painel de lançamentos é o próprio scroll container. */
body.pf-home-v3 #viewLancamentos:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
body.pf-home-v3 #viewLancamentos > #pfTimelineContentLayout {
    display: grid !important;
    grid-template-columns: minmax(220px, 25%) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    flex: 1 1 0px !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
    align-items: stretch !important;
}
body.pf-home-v3 #pfTimelineContentLayout > #pfTimelineInsightsPanel {
    grid-column: 1;
    grid-row: 1;
    min-height: 0 !important;
    min-width: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}
body.pf-home-v3 #pfTimelineContentLayout > #pfModernTransactionCards {
    grid-column: 2;
    grid-row: 1;
    display: block !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
}
body.pf-home-v3 #pfTimelineContentLayout.pf-timeline-insights-hidden {
    grid-template-columns: minmax(0, 1fr) !important;
}
body.pf-home-v3 #pfTimelineContentLayout.pf-timeline-insights-hidden > #pfTimelineInsightsPanel {
    display: none !important;
}
body.pf-home-v3 #pfTimelineContentLayout.pf-timeline-insights-hidden > #pfModernTransactionCards {
    grid-column: 1;
    width: 100% !important;
}
@media (max-width: 900px) {
    body.pf-home-v3 #viewLancamentos > #pfTimelineContentLayout:not(.pf-timeline-insights-hidden) {
        grid-template-columns: minmax(180px, 30%) minmax(0, 1fr) !important;
    }
}

/* Visual 3: comandos compactos e redimensionamento da coluna de contas. */
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #rightSidebar {
    flex: 0 0 54px !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    padding: 10px 5px !important;
    align-items: center !important;
    gap: 9px !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #rightSidebar > button {
    display: flex !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 44px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #rightSidebar .pf-right-action-label,
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #rightSidebarResizer {
    display: none !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #rightSidebar > button i {
    font-size: 19px !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #sidebarPanel {
    flex: 0 0 var(--pf-v3-sidebar-width, 310px) !important;
    width: var(--pf-v3-sidebar-width, 310px) !important;
    min-width: 150px !important;
    max-width: 500px !important;
}
body.pf-home-v3:has(#viewLancamentos:not(.hidden)) #sidebarResizer {
    display: block !important;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: 8px !important;
    height: 100% !important;
    z-index: 70 !important;
    cursor: col-resize !important;
    pointer-events: auto !important;
}

/* Visual 3 — colunas responsivas à largura real da grade, inclusive com
   zoom de 100% e painel Principais gastos aberto. Evita que ações vazem
   para fora da linha; mantém cabeçalho e cartões sincronizados. */
body.pf-home-v3 #pfModernTransactionCards {
    container-type: inline-size;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row,
body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head {
    min-width: 0 !important;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row > *,
body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head > * {
    min-width: 0;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row .pf-visual-row-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    justify-self: end;
}
body.pf-home-v3 #pfModernTransactionCards .pf-premium-row .pf-visual-row-actions button {
    flex: 0 0 25px;
    width: 25px;
    min-width: 25px;
    padding: 0;
}
@container (max-width: 900px) {
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head,
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-row {
        grid-template-columns: 23px minmax(95px,2fr) 77px minmax(72px,1fr) 64px minmax(76px,1fr) 28px 83px !important;
        gap: 4px !important;
        padding-inline: 6px !important;
    }
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head > span:nth-child(7),
    body.pf-home-v3 #pfModernTransactionCards .pf-v3-daily-balance {
        display: none !important;
    }
}
@container (max-width: 720px) {
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head,
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-row {
        grid-template-columns: 23px minmax(85px,2fr) 75px minmax(70px,1fr) minmax(76px,1fr) 25px 80px !important;
        gap: 3px !important;
    }
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head > span:nth-child(5),
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-kind {
        display: none !important;
    }
}
@container (max-width: 560px) {
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head,
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-row {
        grid-template-columns: 22px minmax(75px,1fr) 69px minmax(73px,auto) 23px 79px !important;
        gap: 3px !important;
    }
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-table-head > span:nth-child(4),
    body.pf-home-v3 #pfModernTransactionCards .pf-premium-account {
        display: none !important;
    }
}
