/* === THEME VARIABLES === */
/* Font restored to system default as requested */

/* ===========================
   RESET / BASE
   =========================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

/* ===========================
   THEME PALETTE (MIDNIGHT GREEN / APP BROTHERS STYLE)
   =========================== */
:root {
    /* LIGHT MODE (Clean & Professional) */
    --rz-bg: #f3f4f6;
    --rz-bg-soft: #e5e7eb;
    --rz-bg-card: #ffffff;

    --rz-border-subtle: #e5e7eb;
    --rz-text: #1f2937;
    --rz-text-muted: #6b7280;

    /* Primary Accent - Emerald Green to match screenshot */
    --rz-primary: #10b981;
    --rz-primary-soft: #ecfdf5;

    --rz-green: #10b981;
    --rz-green-soft: #d1fae5;

    --rz-red: #ef4444;
    --rz-red-soft: #fee2e2;

    --rz-yellow: #f59e0b;
    --rz-yellow-soft: #fef3c7;

    /* UI Elements */
    --rz-radius-sm: 8px;
    --rz-radius-md: 12px;
    /* Slightly tighter radius */
    --rz-radius-lg: 16px;

    --rz-shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.03);
    --rz-shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.02), 0 1px 2px 0 rgba(0, 0, 0, 0.01);
}

body.dark {
    /* DARK MODE (DEEP MIDNIGHT - MATCHING SCREENSHOT) */
    --rz-bg: #0f1218;
    /* Very deep navy/black */
    --rz-bg-soft: #1a1e26;
    --rz-bg-card: #1c2128;
    /* Dark gray/blue card */

    --rz-border-subtle: #2d333b;
    /* Subtle borders */
    --rz-text: #f0f6fc;
    /* Off-white text */
    --rz-text-muted: #8b949e;
    /* Muted gray text */

    /* Accents */
    --rz-primary: #2ea043;
    /* GitHub-like green or Emerald */
    --rz-primary-soft: rgba(46, 160, 67, 0.15);

    --rz-shadow-soft: none;
    --rz-shadow-card: none;
    /* Flat look for dark mode */
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--rz-text);
    background: var(--rz-bg);
    /* Subtle mesh gradient overlay */
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Quando um modal estiver aberto, trava o scroll do fundo */
body.rz-modal-open {
    overflow: hidden;
}

body.rz-modal-open {
    overflow: hidden;
    touch-action: none;
}

@keyframes bgShift {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

a {
    color: var(--rz-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.small-muted {
    font-size: 13px;
    color: var(--rz-text-muted);
}

/* ===========================
   TOPBAR (sempre centralizado)
   =========================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rz-border-subtle);
}

@media (max-width: 768px) {
    .topbar {
        /* Restore topbar on mobile */
        display: block;
    }

    .topbar-nav {
        /* Hide desktop nav on mobile */
        display: none !important;
    }
}



.topbar-inner {
    width: 95%;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 0;

    /* CSS GRID FOR ALIGNMENT */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* Left (Logo), Center (Nav), Right (User) */
    align-items: center;
    gap: 12px;
}

.topbar-title {
    justify-self: start;
    /* Force Logo Left */
}

/* Nav is Center by default in grid middle column */
.topbar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    gap: 4px;
    flex-wrap: wrap;
}


.topbar-user {
    display: flex;
    align-items: center;
    justify-self: end;
    /* Force User/Theme Right */
    gap: 12px;
}

/* Mobile specific adjustments for header alignment */
@media (max-width: 768px) {
    .topbar-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        gap: 8px;
    }

    .topbar-title {
        order: 1;
        flex: 0 0 auto;
    }

    .topbar-logo {
        height: 28px;
        width: auto;
    }

    .topbar-user {
        order: 2;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .topbar-greeting {
        font-size: 11px;
        white-space: nowrap;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .theme-btn {
        font-size: 16px;
        padding: 4px;
    }

    /* Ensure desktop nav is hidden */
    .topbar-nav {
        display: none !important;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 400px) {
    .topbar-inner {
        padding: 6px 10px;
    }

    .topbar-logo {
        height: 24px;
    }

    .topbar-greeting {
        font-size: 10px;
        max-width: 140px;
    }

    .theme-btn {
        font-size: 14px;
    }
}


/* Container do dropdown na topbar */
.topbar-dropdown {
    position: relative;
    display: inline-block;
}

/* Botão que usa o mesmo estilo de link da topbar,
   mas SEM o "pill" azul quando estiver inativo */
.topbar-link-dropdown {
    border: none;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 6px 14px;
    color: #111827;
    /* texto escuro, igual aos outros links */
}

/* Quando alguma página de config estiver ativa,
   aí sim ele vira o "pill" azul igual Lançamentos */
.topbar-dropdown-active .topbar-link-dropdown {
    background: #4f46e5 !important;
    /* usa o mesmo tom do seu ativo */
    color: #ffffff !important;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.35);
    border-radius: 999px;
}

/* Caixinha do menu que abre */
.topbar-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 220px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    padding: 6px 0;
    z-index: 999;
    display: none;
}

.topbar-dropdown:hover .topbar-dropdown-menu {
    display: block;
}

/* --- MOBILE SIDEBAR STYLES --- */
.mobile-menu-btn {
    display: none;
    /* Hide on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-btn span {
    width: 24px;
    height: 3px;
    background: var(--rz-primary);
    border-radius: 2px;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    /* Hidden off-screen right */
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 2200;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.mobile-sidebar.active {
    right: 0;
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mobile-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--rz-text);
}

.mobile-sidebar-close {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}

.mobile-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-sidebar-nav a {
    color: #334155;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
}

.mobile-sidebar-nav a.active,
.mobile-sidebar-nav a:hover {
    background: var(--rz-primary-soft);
    color: var(--rz-primary);
    text-decoration: none;
}

.mobile-sidebar-subtitle {
    font-size: 12px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    margin-top: 10px;
    padding-left: 12px;
}

/* Mostra no hover (desktop) */
.topbar-dropdown:hover .topbar-dropdown-menu {
    display: block;
}

/* Links internos do dropdown */
.topbar-sublink {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    text-decoration: none;
    color: #111827;
}

.topbar-sublink:hover {
    background: #f3f4f6;
}

.topbar-sublink-active {
    font-weight: 600;
    background: #eef2ff;
}

/* ===== Ajustes finos do header / navegação ===== */

.topbar-title {
    font-weight: 800;
    letter-spacing: 0.16em;
    font-size: 15px;
    text-transform: uppercase;
    color: var(--rz-primary);
}

.theme-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text);
    margin-right: 10px;
}

/* container com saudação + menu */
.topbar-user {
    font-size: 13px;
    color: var(--rz-text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Saudação com uma barrinha separando do menu */
.topbar-greeting {
    padding-right: 10px;
    margin-right: 2px;
    border-right: 1px solid rgba(148, 163, 184, 0.5);
    white-space: nowrap;
}

/* Navegação */
/* Navegação */
.topbar-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    /* Occupy remaining space */
    justify-content: center;
    /* Center the links */
}

/* links de navegação “pill” */
.topbar-link {
    font-weight: 500;
    font-size: 0.9rem;
    /* Standardized size */
    color: var(--rz-text);
    padding: 5px 12px;
    border-radius: 999px;
    transition:
        background 0.2s,
        color 0.2s,
        transform 0.1s;
}

.topbar-link:hover {
    background: var(--rz-primary-soft);
    color: var(--rz-primary);
    text-decoration: none;
    transform: translateY(-1px);
}

/* aba ativa */
.topbar-link-active {
    background: var(--rz-primary);
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(90, 104, 255, 0.35);
}

/* ===========================
   TOPBAR IPAD/TABLET ADJUSTMENTS
   =========================== */
@media (min-width: 769px) and (max-width: 1200px) {
    .topbar-nav {
        gap: 0;
    }

    .topbar-link {
        font-size: 0.72rem;
        padding: 3px 6px;
    }

    .topbar-link-dropdown {
        font-size: 0.72rem;
        padding: 3px 6px;
    }

    .topbar-divider {
        display: none;
    }

    .topbar-greeting {
        display: none !important;
    }

    .topbar-logo {
        height: 45px;
    }

    .topbar-inner {
        padding: 4px 0;
        gap: 8px;
    }
}

/* opcional: no mobile, empilhar saudação + menu bonitinho */


/* ===========================
   TOPBAR DROPDOWN (CONFIGURAÇÕES)
   =========================== */

/* Container do dropdown na topbar */
.topbar-dropdown {
    position: relative;
    display: inline-block;
}

/* Botão que usa o mesmo estilo de link da topbar,
   mas SEM o "pill" azul quando estiver inativo */
.topbar-link-dropdown {
    border: none;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    font-size: 0.9rem;
    /* Standardized size */
    padding: 6px 14px;
    color: #111827;
    /* texto escuro, igual aos outros links */
}

/* ===========================
   CONTAINER PRINCIPAL
   =========================== */

.dashboard-page {
    width: 95%;
    /* Wider */
    margin: 0 auto;
    padding: 20px 0 80px;
    /* Extra bottom padding for footer */
    animation: fadeIn 0.4s ease;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.topbar-logo {
    height: 70px;
    /* ajusta se quiser maior/menor */
    display: block;
}

/* ===========================
   CABEÇALHO DA PÁGINA
   (título + subtítulo + régua de meses)
   =========================== */

.page-header {
    text-align: center;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 6px 0 4px 0;
    font-size: 22px;
    font-weight: 650;
}

.page-header .page-subtitle {
    max-width: 520px;
    margin: 0 auto;
}

/* === RÉGUA DE MESES / MONTH STRIP === */

/* === RÉGUA DE MESES / MONTH STRIP (Modernized) === */

.month-strip-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 0 auto 20px;
    width: 100%;
}

.month-strip {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping again for centering */
    overflow-x: visible;
    justify-content: center;
    /* Center visuals */
    gap: 8px;
    padding: 8px 14px;
    /* More padding for wrapped look */
    background: var(--rz-bg-soft);
    border-radius: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
}

.month-strip::-webkit-scrollbar {
    display: none;
}

.month-chip {
    flex: 0 0 auto;
    min-width: 64px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    text-align: center;
    font-size: 13px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--rz-text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.month-chip-label {
    font-weight: 600;
    margin-bottom: 2px;
}

.month-chip-amount {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.8;
}

/* Status colors */
.month-chip-pos .month-chip-amount {
    color: var(--rz-green);
}

.month-chip-neg .month-chip-amount {
    color: var(--rz-red);
}

.month-chip-neutral .month-chip-amount {
    color: var(--rz-text-muted);
}

/* Future months (projections) - Gray/Muted */
.month-chip-future .month-chip-amount {
    color: #94a3b8;
}

/* Hover / Active */
.month-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    /* Subtle on hover */
    color: var(--rz-text);
    transform: translateY(-1px);
}

.month-chip.is-active {
    background: var(--rz-bg-card);
    /* Pop out from the inset strip */
    color: var(--rz-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--rz-border-subtle);
    border-left: 3px solid var(--rz-primary);
    /* Accent indicator */
}

/* In dark mode, 'active' needs to pop against 'bg-soft' */
/* We can use primary color for active bg? */
.month-chip.is-active {
    background: var(--rz-primary);
    /* Solid Primary */
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    /* Colored shadow */
}

.month-chip.is-active .month-chip-amount {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Year Selector */
.month-strip-year {
    margin-top: 0;
}

.month-strip-year select {
    background: var(--rz-bg-soft);
    color: var(--rz-text);
    border: 1px solid var(--rz-border-subtle);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.month-strip-year select:hover {
    border-color: var(--rz-primary);
}

.month-strip-year select {
    min-width: 120px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d4dbe8;
    background: #ffffff;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

/* ===========================
   CARDS
   =========================== */

/* ===========================
   CARDS
   =========================== */

.card {
    background: var(--rz-bg-card);
    border-radius: var(--rz-radius-lg);
    /* Subtle border or none? Let's use subtle shadow instead of border for cleaner look */
    border: 1px solid var(--rz-border-subtle);
    box-shadow: var(--rz-shadow-card);
    padding: 24px;
    /* More padding */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    /* Slight lift on hover */
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.dashboard-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rz-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

/* ===========================
   GRID DASHBOARD / FORM + LISTA
   =========================== */

.dashboard-grid {
    display: grid;
    /* Auto-fit: scales items to fill space. Ideally 2 cols for management pages */
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

/* Sidebar Grid: Fixed narrow column for form, rest for list */
.dashboard-sidebar-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    margin-top: 12px;
    align-items: start;
}

@media (max-width: 900px) {
    .dashboard-sidebar-grid {
        grid-template-columns: 1fr;
    }
}

/* Specific 3-column grid for the Main Dashboard */
.dashboard-home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 12px;
}

@media (max-width: 820px) {

    .dashboard-grid,
    .dashboard-home-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* iPad / Tablet Layout (768px - 1200px) - Inclui iPad horizontal */
@media (min-width: 768px) and (max-width: 1200px) {
    .dashboard-home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /* Resumo do Mês ocupa a linha inteira no iPad */
    .dashboard-home-grid>.card:first-child {
        grid-column: 1 / -1;
    }

    /* Summary grids em 2 colunas no iPad */
    .summary-grid-top {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .summary-grid-bottom {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .summary-pill {
        min-width: unset;
        padding: 10px 12px;
        font-size: 13px;
    }

    .summary-pill-label {
        font-size: 12px;
        white-space: nowrap;
    }

    .summary-pill-value {
        font-size: 15px;
    }

    .summary-pill .small-muted {
        font-size: 10px;
        line-height: 1.2;
    }
}

/* Small Tablet / Large Phone (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .dashboard-home-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .summary-grid-top {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .summary-grid-bottom {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Filtros da lista de lançamentos */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    margin: 8px 0 12px;
    font-size: 13px;
}

.filter-row label {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-reset {
    font-size: 12px;
    color: var(--rz-text-muted);
    text-decoration: none;
}

.filter-reset:hover {
    text-decoration: underline;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mark-all-form {
    margin-left: 12px;
    align-items: flex-end;
}

.btn-mark-all-paid {
    padding: 6px 10px;
    font-size: 13px;
}

.btn-mark-all {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.btn-mark-all-paid {
    background-color: #2e7d32;
    /* verde */
    color: #fff;
}

.btn-mark-all-unpaid {
    background-color: #c62828;
    /* vermelho */
    color: #fff;
}

.btn-mark-all:hover {
    opacity: 0.9;
}

.btn-install {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 999;

    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    background: #0a7c49;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-install:hover {
    opacity: 0.9;
}

/* ===========================
   RESUMO DO MÊS
   =========================== */

.dashboard-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.dashboard-summary-item strong {
    font-weight: 600;
}

/* ===========================
   LISTAS (contas, lançamentos, etc.)
   =========================== */

.accounts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accounts-list li {
    background: var(--rz-bg-card);
    /* Card-like background */
    border: 1px solid var(--rz-border-subtle);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: default;
}

/* Used inside modals where bg might be transparent */
#modal-ajax-body .accounts-list li {
    background: var(--rz-bg-soft);
    /* Distinct from modal bg */
    border-color: transparent;
}

.accounts-list li:hover {
    transform: translateX(2px);
    border-color: var(--rz-primary);
    background: var(--rz-bg-card);
    /* Brighten on hover */
}

/* Typography info */
.accounts-list li strong {
    color: var(--rz-text);
    font-size: 14px;
    font-weight: 600;
}

.accounts-list li .small-muted {
    font-size: 0.85rem;
    margin-top: 2px;
    display: inline-block;
}

/* ===========================
   HUB / LANDING PAGE INTERNA
   =========================== */

.hub-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    /* Animação de entrada suave */
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hub-header {
    text-align: center;
    margin-bottom: 40px;
}

.hub-header h1 {
    font-size: 2.5rem;
    margin: 0 0 10px;
    color: var(--rz-text);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hub-subtitle {
    font-size: 1.1rem;
    color: var(--rz-text-muted);
    font-weight: 500;
}

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

.module-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 24px;
    text-decoration: none;
    color: var(--rz-text);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

body.dark .module-card {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--rz-primary-soft);
}

body.dark .module-card:hover {
    background: rgba(30, 41, 59, 0.9);
}

.module-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.module-card:hover .module-icon {
    transform: scale(1.1);
}

.module-content h2 {
    font-size: 1.25rem;
    margin: 0 0 8px;
    font-weight: 700;
    color: var(--rz-text);
}

.module-content p {
    font-size: 0.95rem;
    color: var(--rz-text-muted);
    line-height: 1.5;
    margin: 0 0 20px;
    flex-grow: 1;
}

.module-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--rz-primary);
    margin-top: auto;
    transition: color 0.2s;
}

.module-card:hover .module-link {
    color: var(--rz-primary-dark, #4338ca);
    /* Um tom mais escuro se desejar */
    text-decoration: underline;
}


.accounts-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 9px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    gap: 10px;
}

.accounts-list li:last-child {
    border-bottom: none;
}

.accounts-list li span:first-child {
    font-size: 14px;
}

/* Valor positivo / negativo */

.pos {
    color: var(--rz-green);
    font-weight: 600;
}

.neg {
    color: var(--rz-red);
    font-weight: 600;
}

/* ===========================
   BOTÕES / INPUTS
   =========================== */

button,
input[type="submit"] {
    background: var(--rz-primary);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(90, 104, 255, 0.4);
    transition:
        transform 0.1s,
        box-shadow 0.1s,
        background 0.15s;
}

button:hover,
input[type="submit"]:hover {
    background: #4c58e3;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(90, 104, 255, 0.55);
}

button:active,
input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 5px 12px rgba(90, 104, 255, 0.3);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--rz-radius-sm);
    border: 1px solid var(--rz-border-subtle);
    font-size: 16px;
    /* Prevent iOS zoom */
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--rz-primary);
    box-shadow: 0 0 0 2px rgba(90, 104, 255, 0.2);
    background: #ffffff;
}

/* ===========================
   BADGES
   =========================== */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge-paid {
    background: var(--rz-green-soft);
    color: var(--rz-green);
}

.badge-open {
    background: var(--rz-yellow-soft);
    color: #b7791f;
}

.badge-income {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.badge-expense {
    background: var(--rz-red-soft);
    color: var(--rz-red);
}

/* ===========================
   MENSAGENS OK / ERRO
   =========================== */

.ok {
    color: var(--rz-green);
    font-size: 14px;
}

.err {
    color: var(--rz-red);
    font-size: 14px;
}

/* ===========================
   TABELA DE PROJEÇÃO
   =========================== */

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

.projection-table th,
.projection-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
    font-size: 13px;
}

.projection-table th:first-child,
.projection-table td:first-child {
    text-align: left;
}

.projection-table thead th {
    font-weight: 600;
    color: var(--rz-text-muted);
    background: rgba(255, 255, 255, 0.95);
}

.projection-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

/* ===========================
   LABELS
   =========================== */

label {
    font-size: 13px;
    color: var(--rz-text-muted);
}

/* Labels e textos suaves em modo dark */
body.dark label,
body.dark .small-muted {
    color: #e5e7eb;
    /* ou use #cbd5f5 se quiser um pouco mais claro */
}

/* ===========================
   MOBILE AJUSTES
   =========================== */

@media (max-width: 600px) {
    .accounts-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 19px;
    }

    /* Account balance group - keep side by side but compact on mobile */
    .account-balance-group {
        gap: 12px !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
    }

    .account-balance-group>div {
        min-width: 0;
    }

    /* Smaller font sizes for mobile */
    .account-item div[style*="font-size:15px"] {
        font-size: 12px !important;
    }

    .account-item div[style*="font-size:11px"] {
        font-size: 9px !important;
    }

    /* Keep account items horizontal */
    .account-item {
        flex-direction: row !important;
        padding: 10px 12px !important;
        gap: 8px !important;
    }
}

/* ===========================
   RESUMO DO MÊS - CARDS COLORIDOS
   =========================== */

/* GRID BASE */
.summary-grid {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

/* Linha de cima (2 colunas) */
.summary-grid-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Linha de baixo (3 colunas) */
.summary-grid-bottom {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* iPad/Tablet: 2 colunas na grid de cima, 3 na de baixo */
@media (min-width: 600px) and (max-width: 1024px) {
    .summary-grid-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-grid-bottom {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .summary-pill {
        font-size: 12px;
        padding: 8px 10px;
    }

    .summary-pill-value {
        font-size: 14px;
    }
}

/* Mobile: 1 coluna */
@media (max-width: 599px) {

    .summary-grid-top,
    .summary-grid-bottom {
        grid-template-columns: 1fr;
    }
}


.summary-pill {
    border-radius: 16px;
    padding: 10px 12px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.summary-pill-label {
    font-weight: 500;
    margin-bottom: 4px;
}

.summary-pill-month {
    background: #d9f8e5;
    /* verde claro pro saldo do mês */
}

.summary-pill-accum {
    background: #c3f0d2;
    /* verde um pouquinho diferente pro acumulado */
}

.summary-pill-value {
    font-size: 16px;
    font-weight: 650;
}

/* Entradas = verde */
.summary-pill-income {
    background: var(--rz-green-soft);
    color: var(--rz-green);
}

/* Saídas = vermelho */
.summary-pill-expense {
    background: var(--rz-red-soft);
    color: var(--rz-red);
}

/* Saldo = neutro, mas muda conforme positivo/negativo */
.summary-pill-net {
    grid-column: 1 / -1;
    background: #fee2e2;
    /* vermelho claro padrão, se quiser */
    color: #991b1b;
}

.summary-pill-net.pos {
    background: #dcfce7;
    color: #166534;
}

.summary-pill-net.neutral {
    background: #e5e7eb;
    color: #374151;
}

/* Mês com mais/menos gastos embaixo, alinhado bonitinho */
.month-stats-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    font-size: 13px;
}

/* ===== GRÁFICO POR CATEGORIA: gráfico em cima, ranking embaixo ===== */

.category-chart-wrapper {
    display: flex;
    flex-direction: column;
    /* empilha gráfico e lista */
    align-items: stretch;
    gap: 12px;
    margin-top: 12px;
}

/* gráfico ocupa toda a largura do card */
.category-chart-canvas {
    flex: none;
    max-width: 100%;
    min-height: 280px;
}

/* garante que o canvas preencha bem o bloco do gráfico */
.category-chart-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ranking vira um bloco embaixo do gráfico */
.category-ranking {
    flex: none;
    max-width: 100%;
}

/* mantém o estilo da lista bonitinho */
.category-ranking ol {
    list-style: decimal;
    margin: 0;
    padding-left: 20px;
}

.category-ranking li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.04);
}

.category-ranking li:last-child {
    border-bottom: none;
}

.category-ranking .label {
    color: #333;
}

.category-ranking .value {
    font-weight: 600;
}

/* ===== DETALHAMENTO POR SUBCATEGORIA: gráfico em cima, lista embaixo ===== */

.subcat-layout {
    display: flex;
    flex-direction: column;
    /* empilha */
    gap: 12px;
    margin-top: 12px;
}

.subcat-chart {
    min-height: 260px;
}

.subcat-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* bloco da lateral (agora embaixo) */
.subcat-sidebar {
    padding-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* cabeçalho do filtro + botão "Todas" */
.subcat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

/* botão "Todas" */
.subcat-reset-btn {
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    background: #eef4ff;
    color: #084c7d;
}

/* lista de categorias + subcategorias */
.subcategory-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.subcategory-category-item {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.subcategory-category-item:last-child {
    border-bottom: none;
}

.subcategory-category-item.is-active .subcat-cat-name {
    color: var(--accent);
}

/* linha da categoria (nome + total) */
.subcat-cat-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* lista das subcategorias */
.subcategory-list {
    list-style: none;
    margin: 4px 0 0 0;
    padding: 0;
    font-size: 13px;
}

.subcategory-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}


/* ===========================
   GRÁFICO POR CATEGORIA (PIE + RANKING)
   =========================== */

.category-chart-wrapper {
    display: flex;
    align-items: stretch;
    gap: 24px;
    margin-top: 12px;
}

/* área do gráfico: maior que a tabela */
.category-chart-canvas {
    flex: 3;
    /* aumenta o gráfico */
    min-height: 280px;
    /* garante altura boa */
}

/* faz o canvas ocupar todo o espaço do container */
.category-chart-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ranking mais estreito à direita */
.category-ranking {
    flex: 1;
    /* bem menor que o gráfico */
    max-width: 260px;
    font-size: 13px;
    overflow-y: auto;
}

/* estilo da listinha do ranking */
.category-ranking ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-ranking li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}

.category-ranking li:last-child {
    border-bottom: none;
}

.category-ranking .label {
    color: #4f4f4f;
}

.category-ranking .value {
    font-weight: 600;
    color: #333;
}

/* === LANDING / INDEX === */

.landing-body {
    min-height: 100vh;
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Text",
        sans-serif;
    color: #1a2b3c;
    position: relative;
    overflow: hidden;
}

/* Fundo com gradiente animado */
.landing-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(120deg, #fdf2ff, #e3f2ff, #ffe8e0, #e9f7f1);
    background-size: 300% 300%;
    animation: landingGradient 18s ease infinite;
    z-index: -1;
}

@keyframes landingGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Centraliza o conteúdo */
.landing-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Card principal */
.landing-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    padding: 28px 26px 24px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(14px);
}

/* Logo / título */
.landing-logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3256ff;
    margin-bottom: 4px;
}

.landing-logo span {
    color: #111827;
}

/* Subtítulo */
.landing-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
}

/* Ações principais */
.landing-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 10px;
}

.landing-actions a {
    flex: 1;
    text-align: center;
}

/* Botão principal */
.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #3256ff, #5b8bff);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.42);
    filter: brightness(1.04);
}

/* Botão secundário */
.btn-ghost {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(255, 255, 255, 0.85);
    color: #111827;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        transform 0.12s ease;
}

.btn-ghost:hover {
    background: rgba(249, 250, 251, 0.95);
    border-color: #94a3b8;
    transform: translateY(-1px);
}

/* Rodapé do card */
.landing-footnote {
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

.landing-footnote a {
    color: #3256ff;
    text-decoration: none;
    font-weight: 500;
}

.landing-footnote a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 480px) {
    .landing-card {
        padding: 22px 18px 18px;
        border-radius: 18px;
    }

    .landing-logo {
        font-size: 20px;
    }
}

/* ===== PÁGINA DE LOGIN ===== */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 24px;
    padding: 28px 24px 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.auth-card h1 {
    font-size: 24px;
    margin: 0 0 12px;
}

.auth-card p {
    margin: 0 0 20px;
    font-size: 14px;
    color: #6b7280;
}

.auth-card form label {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    margin-bottom: 12px;
}

.auth-card button[type="submit"] {
    width: 100%;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 15px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.45);
}

.auth-card button[type="submit"]:hover {
    filter: brightness(1.05);
}

.auth-footer {
    margin-top: 16px;
    font-size: 13px;
    color: #6b7280;
}

.auth-footer a {
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== LOGIN ===== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.login-card {
    width: 100%;
    max-width: 420px;

    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    padding: 28px 24px 24px;

    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.login-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: #6b7280;
}

.login-card form label {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.login-card input[type="email"],
.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.login-card button[type="submit"],
.login-card input[type="submit"] {
    width: 100%;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 15px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.45);
}

.login-card button[type="submit"]:hover,
.login-card input[type="submit"]:hover {
    filter: brightness(1.05);
}

.login-footer {
    margin-top: 16px;
    font-size: 13px;
    color: #6b7280;
}

.login-footer a {
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-error {
    margin-bottom: 12px;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

/* Logo */
.logo-box {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.logo {
    width: 160px;
    height: auto;
}

/* Texto todo branco */
.auth-container,
.auth-container label,
.auth-container input,
.auth-container .counter,
.auth-container .message-box div,
.tabs button {
    color: #fff !important;
}

.auth-container input {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Placeholder branco */
.auth-container input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Botões */
button {
    color: #fff;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 15px;
}

.auth-form input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.auth-form button {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #0a7c49;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

/* Ajusta o checkbox "manter conectado" */
.auth-form input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin: 0;
}

/* Linha do "manter conectado" */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 13px;
    margin-top: 8px;
}

/* ===========================
   MODAL GENÉRICO (dashboard)
   =========================== */

.rz-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2100;
}

.rz-modal.is-open {
    display: flex;
}

.rz-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.rz-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}


.rz-modal-dialog {
    position: relative;
    max-width: 720px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 80px);
    background: var(--rz-bg-card);
    border-radius: var(--rz-radius-lg);
    box-shadow: var(--rz-shadow-soft);
    padding: 16px 18px 18px;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.rz-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.rz-modal-header h2 {
    margin: 0;
    font-size: 16px;
}

.rz-modal-close {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--rz-text-muted);
    font-size: 20px;
    padding: 0 4px;
    cursor: pointer;
}

.rz-modal-close:hover {
    color: var(--rz-text);
}

.rz-modal-body {
    overflow: auto;
    font-size: 14px;
}

/* === DARK MODE OVERRIDES (no final do arquivo) === */

body.dark {
    /* Variáveis do tema em dark */
    --rz-bg: #020617;
    --rz-bg-soft: #020617;
    --rz-bg-card: rgba(15, 23, 42, 0.96);
    --rz-border-subtle: rgba(55, 65, 81, 0.85);

    --rz-primary: #6366f1;
    --rz-primary-soft: rgba(99, 102, 241, 0.18);

    --rz-green: #22c55e;
    --rz-green-soft: rgba(34, 197, 94, 0.15);

    --rz-red: #fb7185;
    --rz-red-soft: rgba(248, 113, 113, 0.18);

    --rz-yellow: #facc15;
    --rz-yellow-soft: rgba(250, 204, 21, 0.18);

    --rz-text: #e5e7eb;
    --rz-text-muted: #9ca3af;

    /* Fundo geral escuro */
    background: radial-gradient(circle at top left,
            #020617 0,
            #020617 35%,
            #0b1120 70%,
            #020617 100%);
    color: #e5e7eb;
}

/* Topbar em dark */
body.dark .topbar {
    background: rgba(15, 23, 42, 0.96);
    border-bottom-color: rgba(30, 64, 175, 0.7);
}

/* Cartões em dark */
body.dark .card {
    background: var(--rz-bg-card);
    border-color: var(--rz-border-subtle);
}

/* Textos / labels suaves em dark */
body.dark .small-muted,
body.dark label,
body.dark .dashboard-card-title {
    color: var(--rz-text-muted);
}

/* Título / textos principais */
body.dark .dashboard-page {
    color: var(--rz-text);
}

/* Links da topbar em dark */
body.dark .topbar-link {
    color: var(--rz-text);
}

body.dark .topbar-link:hover {
    background: rgba(148, 163, 184, 0.18);
    color: #e5e7eb;
}

body.dark .topbar-link-active {
    background: #4f46e5;
    color: #e5e7eb !important;
}

/* Dropdown de Configurações em dark */
body.dark .topbar-dropdown-menu {
    background: #020617;
    border-color: rgba(55, 65, 81, 0.9);
}

body.dark .topbar-sublink {
    color: #e5e7eb;
}

body.dark .topbar-sublink:hover {
    background: rgba(30, 64, 175, 0.55);
}

/* Month strip em dark */
body.dark .month-strip {
    background: linear-gradient(90deg, #020617, #020617);
}

body.dark .month-chip {
    background: #020617;
    border-color: rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
}

body.dark .month-chip-amount {
    color: var(--rz-text-muted);
}

/* Tabelas de projeção em dark */
body.dark .projection-table thead th {
    background: #020617;
    color: var(--rz-text-muted);
}

body.dark .projection-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.9);
}

/* Lista de lançamentos / contas em dark */
body.dark .accounts-list li {
    border-bottom-color: rgba(55, 65, 81, 0.7);
}

/* === CAMPOS EM MODO DARK === */
body.dark input[type="text"],
body.dark input[type="number"],
body.dark input[type="date"],
body.dark input[type="password"],
body.dark input[type="email"],
body.dark select,
body.dark textarea {
    background: #020617;
    /* fundo bem escuro */
    color: #e5e7eb;
    /* texto claro */
    border-color: rgba(75, 85, 99, 0.9);
}

/* placeholder mais discreto em dark */
body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #6b7280;
}

/* Linhas da lista em dark (inclusive as que vinham claras inline) */
body.dark .accounts-list li {
    background: rgba(15, 23, 42, 0.96) !important;
    color: #e5e7eb;
}

/* === RANKING DE CATEGORIAS EM MODO DARK === */
body.dark .category-ranking .label,
body.dark .category-ranking .value {
    color: #e5e7eb;
    /* texto clarinho */
}

/* borda das linhas do ranking em dark */
body.dark .category-ranking li {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.3);
}

/* ===========================
   Dark mode – projeção (tabela / hover / modal)
   =========================== */

/* borda das linhas da tabela de projeção */
body.dark .projection-table th,
body.dark .projection-table td {
    border-bottom-color: rgba(148, 163, 184, 0.28);
}

/* cabeçalho da tabela */
body.dark .projection-table thead th {
    background: rgba(15, 23, 42, 0.96);
    color: var(--rz-text-muted);
}

/* linhas pares do corpo */
body.dark .projection-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.7);
}

/* efeito de hover na linha da projeção */
body.dark .projection-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.22);
}

/* modal em dark (backdrop um pouco mais forte) */
body.dark .rz-modal-backdrop {
    background: rgba(0, 0, 0, 0.65);
}

body.dark .rz-modal-dialog {
    background: var(--rz-bg-card);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

/* ===========================
   AJUSTES TOPBAR NO DARK MODE
   =========================== */

body.dark .topbar {
    background: #020617;
    /* topo bem escuro */
    color: #f9fafb;
}

body.dark .topbar-link,
body.dark .topbar-link-dropdown,
body.dark .topbar-sublink {
    color: #e5e7eb;
    /* texto claro para todos os links/botão */
}

/* estado "ativo" (página atual ou dropdown aberto) */
body.dark .topbar-link-active,
body.dark .topbar-dropdown-active .topbar-link-dropdown {
    background: #111827;
    color: #ffffff;
}

/* dropdown aberto em dark */
body.dark .topbar-dropdown-menu {
    background: #020617;
    border: 1px solid #1f2937;
}

/* item selecionado dentro do dropdown */
body.dark .topbar-sublink-active {
    background: #0b1120;
    color: #ffffff;
}

/* === APP FOOTER EM DARK MODE === */
body.dark .app-footer {
    background: #0f172a;
    border-top-color: #1e293b;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

body.dark .footer-item {
    color: #94a3b8;
}

body.dark .footer-item.active,
body.dark .footer-item:hover {
    color: white;
    /* ou var(--rz-primary) se preferir */
}

/* A bola do botão + */
body.dark .footer-btn-plus {
    background: var(--rz-primary);
    border-color: #0f172a;
    /* borda combina com fundo do footer */
    color: #fff !important;
}

/* === Widget flutuante de saldos das contas === */

.rz-floating-accounts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 350px;
    max-height: 50vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    padding: 10px 12px;
    font-size: 13px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.rz-floating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.rz-floating-close {
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    color: #94a3b8;
}

.rz-floating-close:hover {
    color: #0f172a;
}

.rz-floating-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

.rz-floating-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.rz-floating-list li:last-child {
    border-bottom: none;
}

.rz-floating-name {
    flex: 1;
    margin-right: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.rz-floating-balance {
    font-weight: 600;
}

/* === Widget flutuante de saldos das contas === */

.rz-floating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.rz-floating-close {
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    color: #94a3b8;
}

.rz-floating-close:hover {
    color: #0f172a;
}

.rz-floating-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

.rz-floating-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.rz-floating-list li:last-child {
    border-bottom: none;
}

.rz-floating-name {
    flex: 1;
    margin-right: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.rz-floating-balance {
    font-weight: 600;
}


/* Floating widgets em Dark Mode */
body.dark .rz-floating-accounts {
    background: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

body.dark .rz-floating-close {
    color: #94a3b8;
}

body.dark .rz-floating-close:hover {
    color: #fff;
}

body.dark .rz-floating-list li {
    border-bottom-color: #334155;
}

/* Botão de carteira para reabrir */
.rz-floating-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: #084c7d;
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
    cursor: pointer;
    z-index: 9998;
}

.rz-floating-toggle:hover {
    filter: brightness(1.1);
}

/* Se quiser esconder tudo no mobile */
@media (max-width: 768px) {

    .rz-floating-accounts,
    .rz-floating-toggle {
        display: none !important;
    }
}

/* Botão flutuante para novo lançamento (Dashboard) */
.rz-floating-add-transaction {
    position: fixed;
    /* FICA FIXO NA JANELA */
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: none;
    background: #4361ee;
    /* azulzinho, muda se quiser */
    color: #fff;
    font-size: 30px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
    cursor: pointer;
    z-index: 9998;
}

.rz-floating-add-transaction:hover {
    filter: brightness(1.1);
}

@media (max-width: 768px) {
    .rz-floating-add-transaction {
        right: 16px;
        bottom: 16px;
        width: 52px;
        height: 52px;
    }
}

/* Lançamento de cartão "fake" (preview) na lista de lançamentos */
.tx-cc-preview {
    background: #f3f4f6;
    /* cinza clarinho */
    color: #6b7280;
    /* cinza médio no texto */
}

.tx-cc-preview strong {
    color: #4b5563;
    /* título um pouco mais escuro, mas não preto */
}

.tx-cc-preview .small-muted {
    color: #9ca3af;
}

body.dark .tx-cc-preview {
    background: #1e293b;
    /* cinza mais escuro do que o card */
    color: #94a3b8;
}

body.dark .tx-cc-preview strong {
    color: #e2e8f0;
}

/* ===========================
   DETALHAMENTO POR SUBCATEGORIA
   =========================== */

.subcat-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-top: 10px;
}

.subcat-chart {
    flex: 3;
    min-height: 280px;
}

.subcat-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.subcat-sidebar {
    flex: 2;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.subcat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.subcat-reset-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 999px;
    background: var(--rz-primary-soft);
    color: var(--rz-primary);
    box-shadow: none;
}

.subcat-reset-btn:hover {
    background: var(--rz-primary);
    color: #fff;
}

.subcategory-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.subcategory-category-item {
    padding: 6px 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.06s ease;
}

.subcategory-category-item:hover {
    background: rgba(148, 163, 184, 0.12);
}

.subcategory-category-item.is-active {
    background: var(--rz-primary-soft);
    transform: translateY(-1px);
}

.subcat-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.subcat-cat-name {
    font-weight: 600;
}

.subcat-cat-total {
    white-space: nowrap;
}

.subcategory-list {
    list-style: none;
    margin: 4px 0 0 0;
    padding-left: 10px;
}

.subcategory-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.subcategory-list li:last-child {
    border-bottom: none;
}

@media (max-width: 900px) {
    .subcat-layout {
        flex-direction: column;
    }

    .subcat-sidebar {
        max-width: 100%;
    }
}

/* Row com os dois gráficos (categoria e subcategoria) lado a lado */
.charts-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* deixo os cards um pouco mais “compactos” dentro dessa linha */
.charts-row .card-wide {
    padding: 18px 18px 16px;
}

/* No mobile continua empilhado */
@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Tabelas dos gráficos ocupando toda a largura do card */

.category-chart-wrapper,
.subcat-layout {
    align-items: stretch;
}

/* ranking de categorias embaixo do gráfico: 100% */
.category-ranking {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* bloco de filtro + lista de subcategorias: 100% também */
.subcat-sidebar {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* garante que a UL não fique estreita */
.subcategory-category-list {
    width: 100%;
}

/* Destaque para lançamentos em aberto nos modais de saldo */
.projection-table tr.row-open td {
    background-color: #fff7e6 !important;
}

.danger-button {
    background: #c0392b;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.danger-button:hover {
    background: #e74c3c;
}

/* === PIN/STICKY FIELDS === */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.pin-btn {
    position: absolute;
    left: 2px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    /* Vertical center fallback */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    color: var(--rz-text-muted);
    z-index: 5;
    transition: all 0.2s ease;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 32px;
    padding: 0;
    outline: none;
}

.pin-btn:hover {
    opacity: 1;
    color: var(--rz-primary);
    transform: scale(1.1);
}

/* ===========================
   CATEGORIES GRID & KEBAB MENU
   =========================== */
.category-list-grid {
    display: grid;
    /* Reduced min-width to 240px to fit 3 columns */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    list-style: none !important;
    /* Force remove bullets */
    padding: 0;
    margin: 0;
}

.category-card-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid var(--rz-border-subtle);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    /* Ensure no leftovers from basic lists */
    list-style-type: none !important;
}

/* Styling the generic container inside card to prevent overflow */
.category-card-item>div:first-child {
    flex: 1;
    margin-right: 32px;
    /* Space for kebab */
}

/* Kebab Menu Container - Absolute top right or Flex?
   Let's use absolute to keep it out of flow */
.dropdown-kebab {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

/* Kebab Button - Reset generic button styles */
.btn-kebab {
    appearance: none;
    -webkit-appearance: none;
    background: transparent !important;
    /* Override potential .btn styles */
    border: none !important;
    box-shadow: none !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 20px !important;
    line-height: 1 !important;
    color: #94a3b8 !important;
    cursor: pointer;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

.btn-kebab:hover {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
}

/* Dropdown styling */
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    z-index: 50;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.dropdown-menu a.action-danger {
    color: #ef4444;
}

.dropdown-menu a.action-danger:hover {
    background-color: #fef2f2;
}

/* Compatibility rule for inconsistent naming in existing CSS */
.dropdown-kebab.active .dropdown-menu,
.kebab-dropdown.active .dropdown-menu {
    display: block;
}

/* Fix visibility issues */
.transaction-list li,
.accounts-list li {
    overflow: visible !important;
}

/* Ensure dropdown is above everything */
.dropdown-menu {
    z-index: 100 !important;
    right: 0;
    margin-right: -10px;
    /* Slight adjustment */
}

/* ===========================
   APP FOOTER & MODALS
   =========================== */

/* Footer Fixo */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    /* Stronger shadow */
}

.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #64748b;
    font-size: 11px;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.footer-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.footer-item.active,
.footer-item:hover {
    color: var(--rz-primary);
}

.footer-btn-plus {
    background: var(--rz-primary);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    margin-top: -24px;
    /* Sobe um pouco */
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
    border: 3px solid #fff;
}

.footer-btn-plus:hover {
    color: #fff;
    transform: scale(1.05);
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: flex-end;
    /* Mobile: slide up */
}

.modal-overlay.active {
    display: flex;
}

/* Hide footer when modal is active */
.modal-overlay.active~.app-footer,
body:has(.modal-overlay.active) .app-footer {
    display: none !important;
}

/* Editable fields in Projection */
.rz-editable-field {
    background-color: rgba(16, 185, 129, 0.05) !important;
    /* Slight Green tint for "money" */
    border: 1px solid var(--rz-border-subtle) !important;
    border-bottom: 2px solid var(--rz-green) !important;
    /* Explicit indicator */
    border-radius: 4px !important;
    padding: 6px 8px !important;
    font-weight: 600;
    color: var(--rz-text);
    transition: all 0.2s;
}

.rz-editable-field:focus {
    border-color: var(--rz-green) !important;
    background-color: var(--rz-bg-card) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    outline: none;
}

/* Modal Content (Full/Sheet for Mobile) */
.modal-wrapper {
    background: var(--rz-bg-card);
    /* Use theme variable */
    width: 100%;
    max-width: 600px;
    /* Desktop limit */
    height: 90vh;
    /* Quase full height */
    border-radius: 20px 20px 0 0;
    padding: 20px;
    padding-bottom: 80px;
    /* Extra padding to clear the fixed footer */
    overflow-y: auto;
    position: relative;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

/* Mobile specific modal adjustments (Bottom Sheet) */
@media (max-width: 768px) {
    .modal-wrapper {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 92vh;
        /* More space on mobile */
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
        /* Extra padding to clear the fixed footer */
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--rz-text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
}

/* Ajustes Desktop: Centralizar modal */
@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }

    .modal-wrapper {
        border-radius: 12px;
        height: auto;
        max-height: 90vh;
    }

    .footer-btn-plus {
        margin-top: 0;
        /* No desktop não precisa subir tanto se o footer for diferente */
    }
}

/* Auth Tabs Styles - Refined */
.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    border-bottom: 2px solid #f1f5f9;
    padding: 0 10px;
}

.auth-tab {
    flex: 1;
    max-width: 140px;
    /* limiter width */
    text-align: center;
    padding: 12px 16px;
    background: transparent !important;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b !important;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 4px 4px 0 0 !important;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    /* overlap border */
    box-shadow: none !important;
}

.auth-tab:hover {
    color: #334155 !important;
    background: #f8fafc !important;
}

.auth-tab.active {
    border-bottom-color: #0a7c49;
    color: #0f172a !important;
    /* dark slate/black */
}

/* --- Compact Transaction List Styles --- */

.tx-item {
    border-bottom: 1px solid var(--rz-border-subtle);
    padding: 12px 14px;
    list-style: none;
    transition: background-color 0.2s;
}

.tx-item:last-child {
    border-bottom: none;
}

.tx-item:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

.tx-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

/* LEFT SIDE */
.tx-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tx-desc {
    font-weight: 600;
    font-size: 15px;
    color: var(--rz-text);
}

.tx-meta {
    font-size: 12px;
    color: var(--rz-text-muted);
    line-height: 1.3;
}

/* RIGHT SIDE */
.tx-actions-col {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: auto;
}

.tx-amount {
    font-weight: 700;
    font-size: 15px;
    color: var(--rz-text);
    white-space: nowrap;
}

.tx-bottom-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.tx-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* Re-using badge-paid / badge-open from existing CSS if available, otherwise defining */
.badge-paid {
    background: #dcfce7;
    color: #166534;
}

.badge-open {
    background: #fef9c3;
    color: #854d0e;
}


/* COMPACT MOBILE VIEW */
@media (max-width: 480px) {
    .tx-item {
        padding: 10px 12px;
    }

    .tx-body {
        gap: 8px;
    }

    .tx-desc {
        font-size: 14px;
    }

    .tx-amount {
        font-size: 14px;
    }

    .tx-meta {
        font-size: 11px;
    }

    .kebab-btn.compact {
        width: 20px;
        height: 20px;
        line-height: 18px;
        font-size: 14px;
        padding: 0;
    }
}

/* === MODAL AJAX OVERRIDES === */
#modal-ajax-body .dashboard-grid,
#modal-ajax-body .dashboard-sidebar-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    /* Space between Form and List */
}

/* Remove grid columns dentro do modal */
#modal-ajax-body .dashboard-sidebar-grid {
    grid-template-columns: 1fr !important;
}

#modal-ajax-body .card {
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: 1px solid var(--rz-border-subtle) !important;
    background: var(--rz-bg-soft) !important;
    padding: 16px !important;
    margin: 0 !important;
    border-radius: 12px !important;
}

#modal-ajax-body .dashboard-card-title {
    font-size: 1.1rem !important;
    margin-bottom: 16px !important;
    color: var(--rz-primary);
}

/* Formulário e lista ocupam 100% da largura */
#modal-ajax-body form {
    width: 100% !important;
}

/* Ajuste para listas dentro do modal */
#modal-ajax-body .category-list-grid,
#modal-ajax-body .accounts-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Melhor espaçamento no modal */
#modal-ajax-body>.dashboard-page {
    padding: 0 !important;
}

/* Coluna empilhada: Parcelas + Metas */
.dashboard-col-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Conteúdo com scroll para widgets menores */
.scrolling-widget-content {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    /* evitar que scroll cubra conteúdo */
}

/* Estilização suave da barra de rolagem (webkit) */
.scrolling-widget-content::-webkit-scrollbar {
    width: 6px;
}

.scrolling-widget-content::-webkit-scrollbar-track {
    background: transparent;
}

.scrolling-widget-content::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.4);
    border-radius: 99px;
}

/* ===========================
   DARK MODE - ESTILOS COMPLETOS
   =========================== */

/* === FORMULÁRIOS E INPUTS === */
body.dark input[type="text"],
body.dark input[type="number"],
body.dark input[type="date"],
body.dark input[type="password"],
body.dark input[type="email"],
body.dark input[type="tel"],
body.dark input[type="search"],
body.dark input[type="url"],
body.dark select,
body.dark textarea {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #64748b !important;
}

body.dark input:focus,
body.dark select:focus,
body.dark textarea:focus {
    border-color: var(--rz-primary) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}

body.dark label {
    color: #e2e8f0 !important;
}

/* === MODAIS === */
body.dark .modal-wrapper {
    background-color: #1c2128 !important;
    color: #f1f5f9;
}

body.dark .modal-title {
    color: #f1f5f9 !important;
}

body.dark .modal-close {
    color: #94a3b8;
}

body.dark .modal-close:hover {
    color: #f1f5f9;
}

body.dark .modal-header {
    border-bottom-color: #334155;
}

/* === CARDS DE CATEGORIA === */
body.dark .category-card-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9;
}

body.dark .category-card-item:hover {
    background-color: #273549 !important;
}

/* === DROPDOWNS === */
body.dark .dropdown-menu {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark .dropdown-menu a {
    color: #e2e8f0 !important;
    border-bottom-color: #334155 !important;
}

body.dark .dropdown-menu a:hover {
    background-color: #273549 !important;
    color: #f1f5f9 !important;
}

body.dark .dropdown-menu a.action-danger {
    color: #f87171 !important;
}

body.dark .dropdown-menu a.action-danger:hover {
    background-color: #7f1d1d !important;
}

/* === BOTÕES === */
body.dark .btn,
body.dark button:not(.footer-btn-plus):not(.modal-close):not(.pin-btn) {
    color: #f1f5f9;
}

body.dark .btn-secondary,
body.dark .btn-outline {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

body.dark .btn-secondary:hover,
body.dark .btn-outline:hover {
    background-color: #475569 !important;
}

/* === TABELAS === */
body.dark table {
    color: #f1f5f9;
}

body.dark th {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-bottom-color: #334155 !important;
}

body.dark td {
    border-bottom-color: #334155 !important;
    color: #e2e8f0;
}

body.dark tbody tr:nth-child(even) {
    background-color: rgba(30, 41, 59, 0.5);
}

body.dark tbody tr:hover {
    background-color: rgba(51, 65, 85, 0.5);
}

/* === LISTAS === */
body.dark .transaction-list li,
body.dark .accounts-list li,
body.dark ul li {
    color: #e2e8f0;
}

body.dark .tx-item {
    border-bottom-color: #334155 !important;
}

body.dark .tx-desc {
    color: #f1f5f9 !important;
}

body.dark .tx-meta {
    color: #94a3b8 !important;
}

body.dark .tx-amount {
    color: #f1f5f9 !important;
}

/* === TEXTOS E TIPOGRAFIA === */
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark h6 {
    color: #f1f5f9 !important;
}

body.dark p,
body.dark span:not(.badge-paid):not(.badge-open):not(.tx-badge) {
    color: #e2e8f0;
}

body.dark .text-muted,
body.dark .small-muted {
    color: #94a3b8 !important;
}

body.dark .dashboard-card-title {
    color: #f1f5f9 !important;
}

/* === BADGES === */
body.dark .badge-paid {
    background-color: #166534 !important;
    color: #bbf7d0 !important;
}

body.dark .badge-open {
    background-color: #854d0e !important;
    color: #fef08a !important;
}

/* === CARDS GENÉRICOS === */
body.dark .card,
body.dark .card-wide {
    background-color: #1c2128 !important;
    border-color: #2d333b !important;
    color: #f1f5f9;
}

/* === SUBCATEGORIA/RANKING === */
body.dark .subcategory-category-item:hover {
    background-color: rgba(51, 65, 85, 0.5) !important;
}

body.dark .subcategory-category-item.is-active {
    background-color: rgba(16, 185, 129, 0.2) !important;
}

body.dark .subcat-cat-name {
    color: #f1f5f9;
}

body.dark .subcategory-list li {
    border-bottom-color: rgba(51, 65, 85, 0.5) !important;
    color: #e2e8f0;
}

/* === AUTH TABS (LOGIN/REGISTRO) === */
body.dark .auth-tabs {
    border-bottom-color: #334155;
}

body.dark .auth-tab {
    color: #94a3b8 !important;
}

body.dark .auth-tab:hover {
    color: #e2e8f0 !important;
    background-color: #1e293b !important;
}

body.dark .auth-tab.active {
    color: #f1f5f9 !important;
    border-bottom-color: var(--rz-primary);
}

/* === KEBAB BUTTONS === */
body.dark .btn-kebab {
    color: #94a3b8 !important;
}

body.dark .btn-kebab:hover {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* === EDITABLE FIELDS === */
body.dark .rz-editable-field {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body.dark .rz-editable-field:focus {
    background-color: #1e293b !important;
}

/* === SCROLLBAR === */
body.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

body.dark ::-webkit-scrollbar-thumb {
    background-color: #475569;
    border-radius: 4px;
}

body.dark ::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}

/* === MONTH STRIP === */
body.dark .month-chip {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark .month-chip-label {
    color: #e2e8f0 !important;
}

body.dark .month-chip.active,
body.dark .month-chip.is-active {
    background-color: var(--rz-primary) !important;
    color: #fff !important;
}

body.dark .month-chip:hover:not(.is-active) {
    background-color: #334155 !important;
}

/* Manter cores positivas/negativas no dark mode */
body.dark .month-chip-pos .month-chip-amount {
    color: #34d399 !important;
}

body.dark .month-chip-neg .month-chip-amount {
    color: #f87171 !important;
}

body.dark .month-chip-neutral .month-chip-amount {
    color: #94a3b8 !important;
}

body.dark .month-chip-amount {
    color: #94a3b8 !important;
}

/* === PIN BUTTONS === */
body.dark .pin-btn {
    color: #64748b !important;
}

body.dark .pin-btn:hover {
    color: var(--rz-primary) !important;
}

body.dark .pin-btn.active {
    color: var(--rz-primary) !important;
}

/* === MODAL AJAX === */
body.dark #modal-ajax-body .card {
    background-color: transparent !important;
}

body.dark #modal-ajax-body {
    color: #f1f5f9;
}

/* === PROJECTION TABLE ROW OPEN === */
body.dark .projection-table tr.row-open td {
    background-color: rgba(234, 179, 8, 0.15) !important;
}

/* ===========================
   DARK MODE - DASHBOARD ESPECÍFICOS
   =========================== */

/* === SUMMARY PILLS (Cards de resumo da dashboard) === */
body.dark .summary-pill {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark .summary-pill-label {
    color: #94a3b8 !important;
}

body.dark .summary-pill-value {
    color: #f1f5f9 !important;
}

body.dark .summary-pill .small-muted {
    color: #64748b !important;
}

/* Manter cores específicas para estados positivos/negativos */
body.dark .summary-pill-income .summary-pill-value {
    color: #34d399 !important;
}

body.dark .summary-pill-expense .summary-pill-value {
    color: #f87171 !important;
}

/* === DASHBOARD SUMMARY ITEMS === */
body.dark .dashboard-summary-item {
    color: #e2e8f0 !important;
}

body.dark .dashboard-summary-item strong {
    color: #f1f5f9 !important;
}

/* === ACCOUNT LIST ITEMS === */
body.dark .accounts-list li {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9;
}

body.dark .accounts-list li strong {
    color: #f1f5f9 !important;
}

body.dark .accounts-list li .small-muted {
    color: #94a3b8 !important;
}

/* === CHARTS WRAPPER === */
body.dark .charts-row .card-wide {
    background-color: #1c2128 !important;
}

/* === CATEGORY RANKING === */
body.dark .category-ranking li {
    color: #e2e8f0;
}

body.dark .category-ranking .label {
    color: #e2e8f0 !important;
}

body.dark .category-ranking .value {
    color: #f1f5f9 !important;
}

/* === PARCELAS (INSTALLMENTS) === */
body.dark .installment-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9;
}

body.dark .installment-title {
    color: #f1f5f9 !important;
}

/* === GOALS WIDGET === */
body.dark .goal-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9;
}

body.dark .goal-name {
    color: #f1f5f9 !important;
}

body.dark .goal-progress {
    color: #94a3b8 !important;
}

/* === STRONG e textos importantes genéricos === */
body.dark strong {
    color: #f1f5f9;
}

/* === Links === */
body.dark a {
    color: #34d399;
}

body.dark a:hover {
    color: #6ee7b7;
}

/* === Estilos para cores inline nos summary pills === */
body.dark [style*="color:#059669"],
body.dark [style*="color: #059669"],
body.dark [style*="color:#047857"],
body.dark [style*="color: #047857"] {
    color: #34d399 !important;
}

body.dark [style*="color:#b91c1c"],
body.dark [style*="color: #b91c1c"],
body.dark [style*="color:#991b1b"],
body.dark [style*="color: #991b1b"] {
    color: #f87171 !important;
}

body.dark [style*="color:#d97706"],
body.dark [style*="color: #d97706"],
body.dark [style*="color:#b45309"],
body.dark [style*="color: #b45309"] {
    color: #fbbf24 !important;
}

body.dark [style*="color:#64748b"],
body.dark [style*="color: #64748b"] {
    color: #94a3b8 !important;
}

/* === Dashboard-page background overlay === */
body.dark .dashboard-page {
    background-color: transparent !important;
}

/* === Widget de contas flutuante === */
body.dark .rz-floating-accounts {
    background-color: #1e293b !important;
    border-color: #334155;
}

body.dark .rz-floating-name {
    color: #e2e8f0 !important;
}

body.dark .rz-floating-balance {
    color: #f1f5f9 !important;
}

/* === Textos dentro de divs com opacity === */
body.dark [style*="opacity:0.7"],
body.dark [style*="opacity: 0.7"] {
    color: #94a3b8 !important;
}

/* === Account Balance Colors === */
body.dark .pos {
    color: #34d399 !important;
}

body.dark .neg {
    color: #f87171 !important;
}

body.dark .neutral {
    color: #94a3b8 !important;
}

/* === COLOR DOTS PARA LEGENDAS DE GRÁFICOS === */
.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
    vertical-align: middle;
}

.category-ranking li {
    display: flex;
    align-items: center;
}

.category-ranking .label {
    flex: 1;
    text-align: left;
}

.category-ranking .value {
    white-space: nowrap;
    margin-left: 8px;
    text-align: right;
}

.subcat-cat-row {
    display: flex;
    align-items: center;
}

.subcat-cat-name {
    flex: 1;
    text-align: left;
}

/* ===========================
   DARK MODE - FIXES PARA INLINE STYLES
   =========================== */

/* === Account Item com inline styles === */
body.dark .account-item,
body.dark .accounts-list li {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Nomes de contas com cor inline #1e293b */
body.dark [style*="color:#1e293b"],
body.dark [style*="color: #1e293b"] {
    color: #f1f5f9 !important;
}

/* Labels cinza #64748b */
body.dark [style*="color:#64748b"],
body.dark [style*="color: #64748b"] {
    color: #94a3b8 !important;
}

/* Background branco inline */
body.dark [style*="background:#fff"],
body.dark [style*="background: #fff"],
body.dark [style*="background-color:#fff"],
body.dark [style*="background-color: #fff"],
body.dark [style*="background: white"],
body.dark [style*="background:#ffffff"],
body.dark [style*="background: #ffffff"] {
    background: #1e293b !important;
    background-color: #1e293b !important;
}

/* === Chart.js / Gráficos === */
body.dark canvas {
    filter: none !important;
}

/* Legendas dos gráficos */
body.dark .chart-legend,
body.dark .chartjs-legend,
body.dark [class*="legend"] {
    color: #e2e8f0 !important;
}

/* === Divs com font-size pequeno que são labels === */
body.dark div[style*="font-size:11px"],
body.dark div[style*="font-size: 11px"],
body.dark div[style*="font-size:12px"],
body.dark div[style*="font-size: 12px"] {
    color: #94a3b8 !important;
}

/* === Acc Balance classes === */
body.dark .acc-balance,
body.dark .acc-future {
    color: #f1f5f9 !important;
}

body.dark .acc-balance.pos,
body.dark .acc-future.pos {
    color: #34d399 !important;
}

body.dark .acc-balance.neg,
body.dark .acc-future.neg {
    color: #f87171 !important;
}

/* === Cards gerais dentro da dashboard === */
body.dark .dashboard-page .card,
body.dark .dashboard-home-grid .card,
body.dark .dashboard-grid .card {
    background-color: #1c2128 !important;
    border-color: #2d333b !important;
}

/* === Card headers/titles === */
body.dark .card-header,
body.dark .card-title {
    color: #f1f5f9 !important;
}

/* === Textos genéricos dentro de cards === */
body.dark .card p,
body.dark .card div,
body.dark .card span {
    color: #e2e8f0;
}

/* === Divisores e separadores === */
body.dark hr {
    border-color: #334155;
}

/* === Override para todos textos inline cinza escuro === */
body.dark [style*="color:#334155"],
body.dark [style*="color: #334155"],
body.dark [style*="color:#475569"],
body.dark [style*="color: #475569"],
body.dark [style*="color:#4b5563"],
body.dark [style*="color: #4b5563"] {
    color: #cbd5e1 !important;
}

/* === Verde escuro para claro === */
body.dark [style*="color:#0a7c49"],
body.dark [style*="color: #0a7c49"] {
    color: #34d399 !important;
}

/* === Vermelho escuro para claro === */
body.dark [style*="color:#dc2626"],
body.dark [style*="color: #dc2626"] {
    color: #f87171 !important;
}

/* === Scrolling widget === */
body.dark .scrolling-widget-content {
    color: #e2e8f0;
}

/* === Chart containers === */
body.dark .category-chart-wrapper,
body.dark .subcat-layout {
    color: #e2e8f0;
}

/* === Dashboard card title override com !important === */
body.dark .dashboard-card-title {
    color: #f1f5f9 !important;
}

/* === Font weight 600/700 elements (usually important text) === */
body.dark [style*="font-weight:600"],
body.dark [style*="font-weight: 600"],
body.dark [style*="font-weight:700"],
body.dark [style*="font-weight: 700"] {
    color: #f1f5f9 !important;
}

/* Exceção: manter cores de status (verde/vermelho) */
body.dark .pos[style*="font-weight:700"],
body.dark .pos[style*="font-weight: 700"] {
    color: #34d399 !important;
}

body.dark .neg[style*="font-weight:700"],
body.dark .neg[style*="font-weight: 700"] {
    color: #f87171 !important;
}

/* ===========================
   DARK MODE - CHART.JS LEGENDS
   =========================== */

/* Legendas do Chart.js - texto principal */
body.dark .chartjs-legend,
body.dark [class*="chartjs-legend"] {
    color: #e2e8f0 !important;
}

/* Container das legendas */
body.dark .chart-legend-inline,
body.dark .category-chart-legend,
body.dark .subcategory-chart-legend {
    color: #e2e8f0 !important;
}

/* Legendas geradas pelo Chart.js - texto das labels */
body.dark .chart-legend-item,
body.dark .legend-item,
body.dark [class*="legend-item"] {
    color: #e2e8f0 !important;
}

/* Forçar cor branca em TODAS as legendas dentro de canvas wrappers */
body.dark div[style*="height: 250px"] span,
body.dark div[style*="height:250px"] span,
body.dark .category-chart-wrapper span,
body.dark .subcat-chart span {
    color: #e2e8f0 !important;
}

/* ===========================
   DARK MODE - TEXTOS DE APOIO COM OPACITY
   =========================== */

/* Forçar cor clara nos textos com opacity */
body.dark .small-muted[style*="opacity"],
body.dark div.small-muted[style*="opacity"] {
    color: #94a3b8 !important;
}

/* Textos de apoio específicos nos summary-pills */
body.dark .summary-pill>.small-muted,
body.dark .summary-pill div.small-muted {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* Forçar em todos os divs com font-size 11px dentro de summary-pill */
body.dark .summary-pill div[style*="font-size:11px"],
body.dark .summary-pill div[style*="font-size: 11px"] {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* ===========================
   DARK MODE - RANKING E LISTAS DE CATEGORIAS
   =========================== */

/* Texto do ranking de categorias (Cartão de Crédito, Moradia, etc.) */
body.dark .category-ranking,
body.dark .category-ranking li,
body.dark .category-ranking span,
body.dark .category-ranking div {
    color: #e2e8f0 !important;
}

body.dark .category-ranking strong {
    color: #f1f5f9 !important;
}

/* Subcategoria chart sidebar */
body.dark .subcat-sidebar,
body.dark .subcat-sidebar span,
body.dark .subcat-sidebar div {
    color: #e2e8f0 !important;
}

body.dark .subcat-cat-name {
    color: #f1f5f9 !important;
}

body.dark .subcat-cat-total {
    color: #94a3b8 !important;
}

/* Lista de subcategorias */
body.dark .subcategory-category-list li {
    color: #e2e8f0 !important;
}

body.dark .subcategory-category-item {
    color: #e2e8f0 !important;
}

/* ===========================
   DARK MODE - OVERRIDE AGRESSIVO PARA LEGENDAS
   =========================== */

/* Qualquer texto dentro de cards de gráfico */
body.dark .charts-row span,
body.dark .charts-row div,
body.dark .charts-row li {
    color: #e2e8f0 !important;
}

/* Card wide (gráficos) */
body.dark .card-wide span,
body.dark .card-wide div:not(.dashboard-card-title),
body.dark .card-wide li {
    color: #e2e8f0;
}

/* Valores numéricos do ranking */
body.dark .category-ranking .value,
body.dark span[style*="font-weight:600"],
body.dark span[style*="font-weight: 600"] {
    color: #f1f5f9 !important;
}

/* Filtrar button */
body.dark .subcat-reset-btn {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
}

body.dark .subcat-reset-btn:hover {
    background-color: var(--rz-primary) !important;
    color: #fff !important;
}

/* ===========================
   MOBILE DASHBOARD - MELHORIAS v2
   =========================== */

@media (max-width: 480px) {

    /* === HEADER E TÍTULO === */
    .dashboard-page {
        padding: 12px 10px 100px !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .page-header h1 {
        font-size: 18px;
        margin: 0;
    }

    /* === TOGGLE INVESTIMENTO === */
    .investment-toggle {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* === CARDS DE RESUMO === */
    .summary-grid {
        gap: 8px;
    }

    .summary-pill {
        padding: 10px 12px;
        border-radius: 12px;
    }

    .summary-pill-label {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .summary-pill-value {
        font-size: 15px;
    }

    .summary-pill .small-muted {
        font-size: 9px !important;
    }

    /* Grid 2x2 em mobile para cards de resumo */
    .summary-grid-top {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .summary-grid-bottom {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
    }

    /* === SELETOR DE MÊS === */
    .month-selector-wrapper {
        margin: 12px 0;
        padding: 0;
    }

    .month-selector {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        padding: 8px 4px;
    }

    .month-chip {
        padding: 6px 10px;
        font-size: 11px;
        min-width: auto;
    }

    /* === CARDS GERAIS === */
    .card,
    .dashboard-card {
        padding: 12px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .dashboard-card-title {
        font-size: 13px;
        margin-bottom: 8px;
    }

    /* === LISTA DE CONTAS === */
    .accounts-sumary-list {
        gap: 8px;
    }

    .account-card {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .account-card-name {
        font-size: 13px;
    }

    .account-card-balance {
        font-size: 14px;
    }

    .account-card-future {
        font-size: 11px;
    }

    /* === GRÁFICOS === */
    .charts-row {
        flex-direction: column;
        gap: 12px;
    }

    .chart-container {
        min-height: 200px;
    }

    .card-wide {
        padding: 12px;
    }

    /* === PARCELAS E METAS === */
    .installment-item,
    .goal-item {
        padding: 10px;
        margin-bottom: 8px;
    }

    .installment-desc,
    .goal-name {
        font-size: 12px;
    }

    .installment-value,
    .goal-value {
        font-size: 13px;
    }

    /* === BOTÕES ENTRADAS/SAÍDAS/SALDO === */
    .quick-stats-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .quick-stat-btn {
        padding: 10px 6px;
        font-size: 11px;
        border-radius: 10px;
    }

    .quick-stat-value {
        font-size: 13px;
        display: block;
        margin-top: 4px;
    }

    /* === SIDEBAR DE CONTAS (QUANDO VISÍVEL) === */
    .dashboard-sidebar-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* === TABELAS === */
    .transactions-table {
        font-size: 12px;
    }

    .transactions-table th,
    .transactions-table td {
        padding: 8px 6px;
    }

    /* === MODAIS === */
    .modal-content {
        margin: 10px;
        max-height: 85vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 12px 16px;
    }

    /* === FOOTER FIXO === */
    .footer-nav {
        padding: 8px 0;
    }

    .footer-nav-item {
        font-size: 10px;
    }

    .footer-nav-item svg {
        width: 20px;
        height: 20px;
    }
}

/* === MELHORIAS PARA TELAS MUITO PEQUENAS (320px-360px) === */
@media (max-width: 360px) {
    .summary-grid-top {
        grid-template-columns: 1fr !important;
    }

    .summary-grid-bottom {
        grid-template-columns: 1fr !important;
    }

    .summary-pill {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .summary-pill-label {
        margin-bottom: 0;
    }

    .page-header h1 {
        font-size: 16px;
    }

    .quick-stats-row {
        grid-template-columns: 1fr;
    }

    .month-chip {
        padding: 5px 8px;
        font-size: 10px;
    }
}