:root {
    /* Clean Light Theme Palette */
    --bg-dark: #f5f6fa;
    /* Light gray background */
    --bg-card: #ffffff;
    /* White cards */
    --bg-card-hover: #f8f9fc;
    --bg-sidebar: #1a2238;
    /* Dark navy sidebar */
    --primary: #f97316;
    /* Signal Orange */
    --primary-hover: #ea580c;
    --success: #10b981;
    --danger: #ef4444;
    --text-main: #2d3436;
    /* Dark text */
    --text-muted: #636e72;
    /* Gray text */
    --text-light: #ffffff;
    /* White text for dark backgrounds */
    --border: #e0e6ed;
    /* Light border */
    --border-light: #f0f3f7;

    /* Soft Geometry */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Spacing */
    --sidebar-width: 64px;
    --header-height: 72px;

    /* Soft Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --glow: 0 0 15px rgba(249, 115, 22, 0.15);

    --chart-text: #636e72;
    --chart-grid: rgba(0, 0, 0, 0.06);

    --card-subtle: #f5f7fb;
}

body.dark-theme {
    --bg-dark: #0b1220;
    --bg-card: #151b26;
    --bg-card-hover: #1d2533;
    --bg-sidebar: #0b1324;
    --primary: #f97316;
    --primary-hover: #ea580c;
    --success: #22c55e;
    --danger: #ef4444;
    --text-main: #e5e7eb;
    --text-muted: #9aa4b2;
    --text-light: #ffffff;
    --border: #263042;
    --border-light: #1f2733;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.45);
    --glow: 0 0 18px rgba(249, 115, 22, 0.25);

    --chart-text: #cbd5e1;
    --chart-grid: rgba(255, 255, 255, 0.08);

    --card-subtle: rgba(15, 23, 42, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Global - Prevent horizontal scroll on main containers */
.view,
.chart-card,
.stats-grid,
.charts-grid {
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    letter-spacing: -0.02em;
    height: 100vh;
    overflow: hidden;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 1fr;
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar */
/* Sidebar - Expandable */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: none;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    height: 100vh;
}

/* Sidebar Expanded State */
.sidebar.expanded {
    width: 220px;
}

/* Sidebar Toggle Button - bolinha laranja com seta unicode */
.sidebar-toggle {
    position: absolute;
    right: -14px;
    top: 72px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, #ea580c);
    border: 2px solid var(--bg-sidebar, #0f172a);
    color: #fff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    z-index: 101;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.sidebar-toggle .sidebar-toggle-icon {
    display: inline-block;
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
    color: #fff;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: -2px;
}

.sidebar-toggle:hover {
    background: #c2410c;
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.6);
}

.sidebar-toggle:hover .sidebar-toggle-icon {
    transform: scale(1.15);
}

/* Quando sidebar está expandida (220px), seta vira para esquerda (recolher) */
.sidebar.expanded .sidebar-toggle .sidebar-toggle-icon {
    transform: rotate(180deg);
}

.sidebar.expanded .sidebar-toggle:hover .sidebar-toggle-icon {
    transform: rotate(180deg) scale(1.15);
}

/* Logo Text */
.logo-text {
    display: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.expanded .logo {
    justify-content: flex-start;
    padding-left: 1rem;
    gap: 0.75rem;
}

.sidebar.expanded .logo-text {
    display: block;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--header-height);
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-action {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
    position: relative;
    padding: 0 0.5rem;
    transition: all 0.3s ease;
}

.sidebar.expanded .sidebar-action {
    padding: 0 0.75rem;
}

.btn-add-quick {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #ea580c 100%);
    color: #fff;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    flex-shrink: 0;
    font-weight: 600;
    overflow: hidden;
}

.btn-add-quick i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-add-quick:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.btn-add-quick:hover i {
    transform: rotate(90deg);
}

.btn-add-quick:active {
    transform: scale(0.95);
}

/* Text hidden by default */
.btn-add-text {
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Expanded sidebar - pill button with text */
.sidebar.expanded .btn-add-quick {
    width: 100%;
    height: 44px;
    border-radius: 25px;
    padding: 0 1.25rem;
    justify-content: center;
}

.sidebar.expanded .btn-add-quick:hover i {
    transform: rotate(0deg);
}

.sidebar.expanded .btn-add-text {
    display: block;
}

/* Action Menu Popover */
.action-menu {
    position: absolute;
    left: calc(100% + 1rem);
    top: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    min-width: 180px;
    z-index: 1000;
}

.action-menu.active {
    display: flex;
    animation: menuFadeIn 0.2s steps(4);
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }

    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-menu-item:hover {
    background-color: var(--bg-card-hover);
    color: var(--primary);
}

.action-menu-item i {
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
}

.item-expense i {
    color: #ef4444;
}

.item-income i {
    color: #10b981;
}

.item-transfer i {
    color: #3b82f6;
}

.logo span {
    display: none;
    /* Hide text in minimal mode */
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    padding: 0 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-item span {
    display: none;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Expanded sidebar nav items */
.sidebar.expanded .nav-item {
    width: 100%;
    justify-content: flex-start;
    padding: 0 1rem;
    gap: 0.85rem;
}

.sidebar.expanded .nav-item span {
    display: block;
}

.sidebar.expanded .nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--primary);
}

.nav-item i {
    font-size: 1.1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: center;
    position: relative;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0 0.75rem 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.alpha-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.4rem;
    border-radius: 999px;
    color: #111827;
    background: #f97316;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
}

.sidebar:not(.expanded) .alpha-badge {
    display: none;
}

.daily-visitors {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.daily-visitors i {
    color: var(--primary);
    font-size: 0.8rem;
}

.sidebar:not(.expanded) .daily-visitors span {
    display: none;
}

.daily-visitors-popover {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(100% + 0.5rem);
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.9rem;
    padding: 0.6rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 230;
    min-width: 320px;
    max-width: 420px;
}

.daily-visitors-popover.open {
    display: block;
}

.daily-visitors-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.daily-visitors-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
}

.daily-visitors-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.4rem 0.2rem;
}

.daily-visitor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.04);
}

.daily-visitor-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.daily-visitor-name {
    font-size: 0.8rem;
    color: #e5e7eb;
}

.daily-visitor-email {
    font-size: 0.7rem;
    color: var(--text-muted);
    word-break: break-word;
}

.daily-visitor-last {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.daily-visitor-actions {
    display: flex;
    gap: 0.35rem;
}

.daily-visitor-actions button {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    padding: 0.25rem 0.4rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
}

.daily-visitor-actions .admin-badge {
    background: #f97316;
    color: #ffffff;
    border: none;
    font-weight: 600;
    cursor: default;
    opacity: 1;
}

.daily-visitor-actions button.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.daily-visitor-actions button.active {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

.admin-ban-section {
    margin: 0.75rem 0.75rem 0;
    padding: 0.75rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

/* Failsafe: esconder áreas exclusivas de admin para usuários comuns.
   #dailyVisitors (contador) é PÚBLICO; só o popover detalhado é admin-only. */
body:not(.is-admin) .admin-ban-section,
body:not(.is-admin) #dailyVisitorsPopover {
    display: none !important;
}

.admin-ban-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.admin-ban-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 220px;
    overflow-y: auto;
}

.admin-ban-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.04);
}

.admin-ban-item span {
    font-size: 0.75rem;
    color: #e5e7eb;
}

.admin-ban-item button {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    padding: 0.2rem 0.4rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
}

.admin-ban-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar:not(.expanded) .admin-ban-section {
    display: none !important;
}

.theme-toggle {
    position: relative;
    width: 52px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08), var(--shadow-sm);
    transition: background 0.45s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    overflow: hidden;
    isolation: isolate;
}

.theme-toggle:hover {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.theme-toggle:active .theme-thumb {
    width: 22px;
}

.theme-toggle.dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #1e293b;
}

.theme-toggle .theme-icon {
    position: relative;
    z-index: 1;
    width: 13px;
    height: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle .theme-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.theme-toggle .theme-icon.sun {
    color: #f59e0b;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .theme-icon.sun .sun-rays {
    transform-origin: 12px 12px;
    animation: sun-spin 14s linear infinite;
}

.theme-toggle .theme-icon.moon {
    color: #cbd5e1;
    opacity: 0.3;
    transform: rotate(-90deg) scale(0.6);
}

.theme-toggle.dark .theme-icon.sun {
    opacity: 0.3;
    transform: rotate(90deg) scale(0.6);
    color: #475569;
}

.theme-toggle.dark .theme-icon.sun .sun-rays {
    animation: none;
}

.theme-toggle.dark .theme-icon.moon {
    color: #f1f5f9;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .theme-thumb {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff8e1, #fbbf24 60%, #f59e0b);
    left: 3px;
    top: 50%;
    transform: translateY(-50%) translateX(26px);
    transition: transform 0.55s cubic-bezier(0.68, -0.35, 0.32, 1.35),
                background 0.45s ease,
                box-shadow 0.35s ease,
                width 0.18s ease;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.55),
                0 0 3px rgba(251, 191, 36, 0.4),
                inset 0 -2px 3px rgba(217, 119, 6, 0.35);
    z-index: 2;
}

.theme-toggle.dark .theme-thumb {
    transform: translateY(-50%) translateX(0);
    background: radial-gradient(circle at 35% 35%, #f8fafc, #cbd5e1 55%, #94a3b8);
    box-shadow: 0 0 10px rgba(203, 213, 225, 0.35),
                0 0 3px rgba(148, 163, 184, 0.3),
                inset -2px -1px 3px rgba(71, 85, 105, 0.4),
                inset 1px 1px 2px rgba(248, 250, 252, 0.5);
}

.theme-toggle .theme-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.theme-toggle.dark .theme-stars {
    opacity: 1;
}

.theme-toggle .theme-star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #f8fafc;
    box-shadow: 0 0 3px rgba(248, 250, 252, 0.8);
    animation: star-twinkle 2.2s ease-in-out infinite;
}

.theme-toggle .theme-star--1 {
    top: 6px;
    right: 10px;
    animation-delay: 0s;
}

.theme-toggle .theme-star--2 {
    top: 15px;
    right: 17px;
    width: 1.5px;
    height: 1.5px;
    animation-delay: 0.7s;
}

.theme-toggle .theme-star--3 {
    top: 10px;
    right: 22px;
    width: 1px;
    height: 1px;
    animation-delay: 1.3s;
}

@keyframes sun-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle .theme-icon.sun .sun-rays,
    .theme-toggle .theme-star {
        animation: none;
    }
    .theme-toggle .theme-thumb,
    .theme-toggle .theme-icon {
        transition-duration: 0.15s;
    }
}

.sidebar.expanded .user-profile {
    justify-content: flex-start;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.user-avatar-btn {
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem;
    width: 100%;
    cursor: pointer;
    color: inherit;
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-menu-caret {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-profile.open .user-menu-caret {
    transform: rotate(180deg);
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 140px;
}

.user-info .name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(100% + 0.5rem);
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.9rem;
    padding: 0.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 220;
}

.user-profile.open .user-menu {
    display: block;
}

.user-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-menu-item i {
    width: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-menu-item.danger {
    color: #f87171;
}

.user-menu-item.danger i {
    color: #f87171;
}

.user-menu-divider {
    height: 1px;
    margin: 0.35rem 0.2rem;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar:not(.expanded) .user-info,
.sidebar:not(.expanded) .user-menu-caret {
    display: none;
}

.sidebar:not(.expanded) .user-avatar-btn {
    justify-content: center;
}

.sidebar:not(.expanded) .sidebar-footer {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: var(--bg-dark);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    grid-column: 2;
    grid-row: 1;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary {
    background-color: var(--bg-dark);
    border-color: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Stats Grid - HUD Cluster */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 100%;
}

.stat-card {
    background-color: var(--bg-card);
    border: none;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.stat-card::before {
    display: none;
}

.stat-card.balance {
    grid-column: span 1;
}

.stat-card .icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: none;
    margin-bottom: 0.5rem;
}

.balance .icon-wrapper {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
}

.income .icon-wrapper {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.expense .icon-wrapper {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.invested .icon-wrapper {
    background: rgba(99, 110, 114, 0.1);
    color: var(--text-muted);
}

.interest .icon-wrapper {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.rate .icon-wrapper {
    background: rgba(99, 110, 114, 0.1);
    color: var(--text-muted);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-info h3 {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
}

.stat-info .value {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
}

.balance .value {
    color: var(--text-main);
}

/* Notification Banner */
.notification-banner {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

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

.notification-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-content i {
    font-size: 1.2rem;
}

.notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Investments */
.investments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.investments-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.accounts-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1.75rem;
    align-items: start;
}

.accounts-layout > .accounts-grid {
    min-width: 0;
}

.accounts-summary-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: sticky;
    top: 1.5rem;
}

.summary-pill {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.summary-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-pill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 1rem;
    flex-shrink: 0;
}

.summary-pill-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.summary-pill-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-pill-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
}

.summary-pill--fixed {
    border-left-color: #10b981;
}
.summary-pill--fixed .summary-pill-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.summary-pill--variable {
    border-left-color: #3b82f6;
}
.summary-pill--variable .summary-pill-icon {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.summary-pill--total {
    border-left-color: var(--primary, #6366f1);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02));
}
.summary-pill--total .summary-pill-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary, #6366f1);
}
.summary-pill--total .summary-pill-value {
    font-size: 1.2rem;
}

@media (max-width: 1100px) {
    .accounts-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .accounts-summary-panel {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .accounts-summary-panel .summary-pill {
        flex: 1 1 200px;
    }
}

.account-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.account-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.account-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.account-info {
    flex: 1;
}

.account-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.account-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-subtle);
    border-radius: 0.75rem;
}

.account-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    white-space: normal;          /* permite quebrar em valores longos como "+R$ 3.396,17 (+8.28%)" */
    overflow-wrap: break-word;
    word-break: keep-all;         /* não quebra dentro de "R$ 3.396,17" */
    line-height: 1.3;
}
.stat-value small {
    display: inline-block;
    margin-top: 0.1rem;
}

.interest-rate {
    color: var(--success);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-icon-small {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-icon-small:hover {
    background: rgba(239, 68, 68, 0.2);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
    font-size: 1.1rem;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
}

.charts-grid.triple-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.charts-grid.single {
    grid-template-columns: 1fr;
}

.full-width {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
}

.chart-card {
    background-color: var(--bg-card);
    border: none;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    min-height: 320px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 100%;
    box-shadow: var(--shadow-sm);
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.chart-card-clickable {
    cursor: pointer;
}

.chart-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
}

.chart-period-badge {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Chart Period Selector Dropdown */
.chart-period-selector {
    position: relative;
}

.period-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.period-dropdown-btn:hover {
    background: rgba(249, 115, 22, 0.2);
    transform: scale(1.02);
}

.period-dropdown-btn i {
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.period-dropdown-btn.active i {
    transform: rotate(180deg);
}

.period-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.period-dropdown-menu.show {
    display: block;
    animation: fadeInDown 0.2s ease;
}

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

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

.period-option {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border);
}

.period-option:last-child {
    border-bottom: none;
}

.period-option:hover {
    background: var(--bg-dark);
}

.period-option.active {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.chart-card h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
}

/* Chart Content Wrapper */
.chart-content-wrapper {
    display: flex;
    gap: 1rem;
    flex: 1;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.chart-container-donut {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    position: relative;
    min-width: 120px;
}

.donut-center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-total-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}

.donut-total-value.expense {
    color: #ef4444;
}

.donut-total-value.income {
    color: #22c55e;
}

.donut-total-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.donut-percent-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Clean Chart Card - Centered donut without legend */
.chart-card-clean {
    min-height: auto;
}

.chart-content-centered {
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.chart-donut-large {
    width: 200px;
    height: 200px;
}

.chart-donut-large .donut-total-value {
    font-size: 1.1rem;
}

.chart-donut-large .donut-total-label {
    font-size: 0.7rem;
    margin-top: 2px;
}

.chart-donut-large .donut-percent-label {
    font-size: 0.75rem;
}

.chart-container-line,
.chart-container-bar {
    flex: 1;
    height: 180px;
    min-width: 0;
    max-width: 100%;
}

/* Chart Legend List */
.chart-legend-list {
    flex: 1;
    max-height: 200px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-info {
    flex: 1;
    min-width: 0;
}

.legend-name {
    font-size: 0.8rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-value {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.legend-percent {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

/* Chart Footer */
.chart-footer {
    margin-top: auto;
    padding-top: 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.ver-mais {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ver-mais:hover {
    opacity: 0.8;
}

/* Balance Summary Card */
.balance-summary-card {
    min-height: auto;
}

.balance-summary-content {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding: 1rem 0;
}

.balance-bars {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    height: 120px;
}

.balance-bar {
    width: 30px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.balance-bar.income-bar {
    background: linear-gradient(to top, #22c55e, #4ade80);
    height: 100%;
}

.balance-bar.expense-bar {
    background: linear-gradient(to top, #ef4444, #f87171);
    height: 80%;
}

.balance-details {
    flex: 1;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.balance-row:last-child {
    border-bottom: none;
}

.balance-row.total {
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border);
}

.balance-label {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.balance-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
}

.balance-value.income {
    color: #22c55e;
}

.balance-value.expense {
    color: #ef4444;
}

/* Savings Gauge */
.savings-gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    flex: 1;
}

.savings-gauge {
    position: relative;
    width: 200px;
    height: 120px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-bg {
    stroke-dasharray: 251;
}

.gauge-fill {
    stroke-dasharray: 251;
    stroke-dashoffset: 251;
    transition: stroke-dashoffset 1s ease-out;
}

.gauge-value {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
}

.savings-info {
    text-align: center;
    margin-top: 1rem;
}

.savings-message {
    font-size: 0.9rem;
    color: var(--text-main);
    margin: 0;
}

.savings-tip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-sm);
    margin-top: auto;
}

.savings-tip i {
    color: #8b5cf6;
}

.savings-tip span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Category Detail Modal */
.category-detail-content {
    padding: 1rem 0;
}

.month-navigator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.month-navigator .current-month {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    min-width: 150px;
    text-align: center;
    background: var(--bg-card);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.category-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.category-chart-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.category-total {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.category-total .total-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
}

.category-total .total-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.category-list-container h4 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.category-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.category-detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.category-detail-item:hover {
    background: var(--bg-card-hover);
}

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

.category-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.category-item-info {
    flex: 1;
}

.category-item-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.category-item-percent {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.category-item-value {
    text-align: right;
}

.category-item-amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #ef4444;
}

.category-item-amount.income {
    color: #22c55e;
}

.category-item-percentage {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dashboard Customizer Button */
/* Botão "Personalizar" — pílula laranja com a cara do site (web + mobile).
   Substitui o estilo branco/feio por um outline laranja na linguagem
   visual do app. */
.btn-customize {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: transparent;
    border: 1.5px solid var(--primary, #f97316);
    border-radius: 999px;
    color: var(--primary, #f97316);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-customize:hover {
    background: rgba(249, 115, 22, 0.08);
}

.btn-customize:active {
    background: rgba(249, 115, 22, 0.18);
}

.btn-customize i {
    font-size: 0.85rem;
    line-height: 1;
}

/* Esconde o título "Dashboard" — visualmente desnecessário, sobrava espaço */
#dashboard .top-bar h1 {
    display: none;
}
#dashboard .top-bar {
    justify-content: flex-end;
}

/* Dashboard Customizer Modal */
.customizer-modal {
    max-width: 550px !important;
    padding: 0 !important;
}

.customizer-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.customizer-modal .customizer-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0 1.5rem;
    margin-bottom: 0;
}

.customizer-list-container {
    max-height: 50vh;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.customizer-sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.customizer-sortable-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.customizer-sortable-item:hover {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.05);
}

.customizer-sortable-item:active {
    cursor: grabbing;
}

.customizer-sortable-item.dragging {
    opacity: 0.5;
    background: var(--bg-card);
    border-color: var(--primary);
}

.customizer-sortable-item.drag-over {
    border-color: var(--primary);
    border-style: dashed;
}

.widget-drag-handle {
    color: var(--text-muted);
    cursor: grab;
    padding: 0.25rem;
}

.widget-drag-handle:active {
    cursor: grabbing;
}

.widget-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

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

.widget-info {
    flex: 1;
    min-width: 0;
}

.widget-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.widget-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.widget-order-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.customizer-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.customizer-actions .btn-outline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Legacy - keeping for backwards compatibility */
.customizer-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.customizer-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.customizer-section {
    margin-bottom: 1.5rem;
}

.customizer-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.customizer-section h4 i {
    font-size: 0.85rem;
}

.customizer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.customizer-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.customizer-item:hover {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.05);
}

.customizer-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.customizer-item input[type="checkbox"]:checked+.customizer-label {
    color: var(--text-main);
}

.customizer-item input[type="checkbox"]:not(:checked)+.customizer-label {
    color: var(--text-muted);
    opacity: 0.7;
}

.customizer-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.customizer-label i {
    width: 16px;
    text-align: center;
    font-size: 0.8rem;
}

/* Widget Hidden State */
[data-widget].widget-hidden {
    display: none !important;
}

/* Top Bar Adjustments */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Analytics Page Styles */
.analytics-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.analytics-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.analytics-filters .filter-group label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.projection-period-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.period-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.period-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.period-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.custom-period-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.custom-period-input input {
    width: 100px;
    padding: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.custom-period-input input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Main Analytics Chart */
.analytics-main-chart {
    margin-bottom: 2rem;
    min-height: auto;
}

.analytics-main-chart .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analytics-main-chart .chart-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Analytics Timeline Charts */
.analytics-timeline-card .chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.analytics-timeline-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.timeline-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.25rem 0.5rem;
}

.timeline-label {
    min-width: 120px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 0.25rem 0.5rem;
    border-radius: 16px;
}

.timeline-chart-container {
    height: 260px;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .analytics-timeline-card .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-label {
        min-width: 100px;
    }
}

.projection-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.projection-period-label {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.projection-chart-container {
    height: 350px;
    margin: 1rem 0;
}

.projection-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.projection-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
}

.projection-summary-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.projection-summary-item .value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.projection-summary-item .value.positive {
    color: #22c55e;
}

.projection-summary-item .value.negative {
    color: #ef4444;
}

.projection-summary-item.scenario-pessimistic {
    border-left: 3px solid #ef4444;
}
.projection-summary-item.scenario-realistic {
    border-left: 3px solid #f97316;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), transparent);
}
.projection-summary-item.scenario-optimistic {
    border-left: 3px solid #10b981;
}

.projection-baseline-label {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Performance Panel */
.performance-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.perf-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 2.5rem 1rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.perf-card .tooltip-trigger {
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    font-size: 0.6rem;
}

.perf-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.perf-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.1rem;
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    flex-shrink: 0;
}

.perf-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.perf-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.perf-card-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
}

.perf-card-value.positive { color: #22c55e; }
.perf-card-value.negative { color: #ef4444; }

.perf-card-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.perf-card--status.status-good .perf-card-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
.perf-card--status.status-good {
    border-left: 3px solid #22c55e;
}

.perf-card--status.status-bad .perf-card-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.perf-card--status.status-bad {
    border-left: 3px solid #ef4444;
}

.perf-card--status.status-neutral .perf-card-icon {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}
.perf-card--status.status-neutral {
    border-left: 3px solid #94a3b8;
}

/* SELIC history timeline */
.selic-history-panel {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

#selicHistoryList {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.selic-history-row {
    display: grid;
    grid-template-columns: 1.5fr 1.4fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.selic-history-row.active {
    border-left: 3px solid var(--primary, #f97316);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), transparent);
}

.selic-history-period {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.selic-history-range {
    color: var(--text-main);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.rate-badge-active {
    font-size: 0.6rem;
    background: #22c55e;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.selic-history-value {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.selic-history-rate {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text-main);
}

.selic-history-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.selic-history-change {
    text-align: right;
}

.selic-history-delta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.selic-history-delta.positive { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.selic-history-delta.negative { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.selic-history-delta.neutral  { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.rate-history-empty {
    padding: 0.85rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
}

/* Rate health summary card */
.rate-health-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-dark);
}

.rate-health-card i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.rate-health-card strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}

.rate-health-card span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rate-health-card.health-ok {
    border-left: 3px solid #22c55e;
}
.rate-health-card.health-ok i {
    color: #22c55e;
}

.rate-health-card.health-warn {
    border-left: 3px solid #f59e0b;
}
.rate-health-card.health-warn i {
    color: #f59e0b;
}


/* Account Card Menu */
.account-menu-container {
    position: relative;
}

.account-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.account-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0.5rem;
}

.account-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.account-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.account-menu-item.danger {
    color: #ef4444;
}

.account-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.account-menu-item i {
    width: 16px;
    text-align: center;
}


.projection-summary-item .subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Planning Card Styles */
.planning-card {
    padding: 1.5rem;
}

/* Simple Planning Card for Dashboard */
.planning-card-simple {
    padding: 1.5rem;
}

.planning-card-simple .chart-header h3 {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
}

.planning-simple-content {
    padding: 1.25rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.planning-simple-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.planning-simple-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #8b5cf6;
}

.planning-simple-info {
    flex: 1;
}

.planning-simple-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.planning-simple-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
}

.planning-simple-value.over-budget {
    color: #f59e0b;
}

.planning-simple-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.planning-simple-previsto {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.planning-simple-previsto span {
    font-weight: 600;
    color: var(--text-main);
}

.planning-simple-bar {
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.planning-simple-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.planning-simple-bar-fill.over-budget {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.planning-simple-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.planning-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.planning-summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.planning-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.planning-info {
    flex: 1;
}

.planning-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.planning-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
}

.planning-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.planning-progress-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.planning-progress-bar {
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.planning-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.planning-progress-fill.over-budget {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.planning-progress-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.budget-status {
    font-weight: 600;
}

.budget-status.under {
    color: #22c55e;
}

.budget-status.over {
    color: #ef4444;
}

/* Budget Categories List */
.budget-categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.budget-category-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    border-left: 4px solid #64748b;
}

.budget-category-item.over {
    border-left-color: #ef4444;
}

.budget-category-item.under {
    border-left-color: #22c55e;
}

.budget-cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.budget-cat-info {
    flex: 1;
    min-width: 0;
}

.budget-cat-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.budget-cat-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.budget-cat-bar {
    flex: 1;
    height: 6px;
    background: #1e293b;
    border-radius: 3px;
    overflow: hidden;
}

.budget-cat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.budget-cat-percent {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    min-width: 45px;
    text-align: right;
}

.budget-cat-values {
    text-align: right;
}

.budget-cat-spent {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.9rem;
}

.budget-cat-limit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.budget-cat-status {
    font-size: 0.7rem;
    font-weight: 600;
}

.budget-cat-status.over {
    color: #ef4444;
}

.budget-cat-status.under {
    color: #22c55e;
}

.budget-cat-actions {
    display: flex;
    gap: 0.5rem;
}

.budget-cat-actions button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.budget-cat-actions button:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.budget-cat-actions button.delete:hover {
    color: #ef4444;
}

/* Planning View Styles */
.planning-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.planning-current-month {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    min-width: 150px;
    text-align: center;
    background: var(--bg-card);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.planning-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
}

.planning-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.planning-overview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.planning-overview-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.overview-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.overview-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.overview-value.positive {
    color: #22c55e;
}

.overview-value.negative {
    color: #ef4444;
}

.overview-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.planning-overview-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar-container {
    height: 12px;
    background: #1e293b;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f87171);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-legend {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.progress-legend .dot.used {
    background: #ef4444;
}

.progress-legend .dot.remaining {
    background: #64748b;
}

/* Budgets Table */
.budgets-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

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

.budgets-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.budgets-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

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

/* Planning Empty State */
.planning-empty-state {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.planning-empty-illustration {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.planning-empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.planning-empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 420px;
}

.planning-empty-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.planning-empty-actions .btn {
    min-width: 220px;
}

.budget-table-category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.budget-table-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.budget-table-icon.remaining {
    background: var(--bg-dark);
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

.budget-table-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.budget-table-progress-bar {
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.budget-table-progress-fill {
    height: 100%;
    border-radius: 4px;
}

.budget-table-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.budget-table-status {
    font-weight: 600;
}

.budget-table-status.over {
    color: #ef4444;
}

.budget-table-status.under {
    color: #22c55e;
}

.budget-table-actions {
    display: flex;
    gap: 0.5rem;
}

.budget-table-actions button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
}

.budget-table-actions button:hover {
    background: var(--bg-dark);
    color: var(--text-main);
}

.budget-remaining-row {
    cursor: pointer;
}

.budget-remaining-row:hover {
    background: var(--bg-card-hover);
}

/* Planning Sidebar */
.planning-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.planning-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.planning-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.planning-stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.planning-stat-card i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    opacity: 0.2;
}

.planning-stat-card.income .stat-value {
    color: #22c55e;
}

.planning-stat-card.income i {
    color: #22c55e;
}

.planning-stat-card.expense .stat-value {
    color: #ef4444;
}

.planning-stat-card.expense i {
    color: #ef4444;
}

.planning-stat-card.balance .stat-value {
    color: #8b5cf6;
}

.planning-stat-card.balance i {
    color: #8b5cf6;
}

.planning-stat-card.savings .stat-value {
    color: #f59e0b;
}

.planning-stat-card.savings i {
    color: #f59e0b;
}

/* Budget Modal Styles */
.selected-category-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.budget-category-dropdown {
    position: relative;
}

.budget-category-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
}

.budget-category-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 1002;
}

.budget-category-menu.show {
    display: block;
}

.holdings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.holding-row {
    display: grid;
    grid-template-columns: 90px 65px 75px 1fr 32px;
    gap: 0.5rem;
    align-items: center;
}

.holding-row input {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 0.85rem;
    min-width: 0;
    width: 100%;
}

.holding-row input:nth-child(4) {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.holding-row button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--bg-card-hover);
    color: var(--text-muted);
    cursor: pointer;
}

.holding-row button:hover {
    color: #ef4444;
}

.holding-row-total {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-main) !important;
    background: transparent !important;
}

.holdings-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.75rem;
    margin-top: 0.75rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.holdings-total strong {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
}

.budget-category-trigger:hover {
    border-color: var(--text-muted);
}

.budget-category-trigger i {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.selected-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #000;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-remove-category {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.budget-total-display {
    background: var(--bg-dark);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    text-align: center;
}

.budget-total-display .total-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.budget-total-display .total-values {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.75rem;
}

.budget-total-display .current-total {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
}

.budget-total-display .total-change {
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

.budget-total-display .total-change.positive {
    color: #ef4444;
}

.budget-total-display .total-change.negative {
    color: #22c55e;
}

.budget-input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
}

.budget-category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #334155;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.budget-category-info {
    flex: 1;
}

.budget-category-name {
    display: block;
    font-weight: 600;
    color: var(--text-main);
}

.budget-previous-expense {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.budget-amount-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.25rem;
}

.budget-amount-input .currency-prefix {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}

.budget-amount-input input {
    width: 120px;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
    text-align: right;
}

.budget-amount-input input:focus {
    outline: none;
}

.remaining-categories-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.remaining-categories-info .remaining-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.remaining-categories-info span {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.remaining-categories-info .remaining-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-main);
}

/* Responsive Planning */
@media (max-width: 1100px) {
    .planning-layout {
        grid-template-columns: 1fr;
    }

    .planning-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .planning-stat-card {
        flex: 1;
        min-width: 200px;
    }
}

/* Categories Clean Design */
.categories-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
}

.category-type-dropdown {
    position: relative;
}

.category-type-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: #ef4444;
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.category-type-btn.expense {
    background: #ef4444;
}

.category-type-btn.expense:hover {
    background: #dc2626;
}

.category-type-btn.income {
    background: #10b981;
}

.category-type-btn.income:hover {
    background: #059669;
    cursor: pointer;
    transition: all 0.2s;
}

.category-type-btn:hover {
    background: #dc2626;
}

.category-type-btn i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.category-type-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.category-type-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.category-type-menu button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.category-type-menu button:hover {
    background: var(--bg-dark);
}

.category-type-menu button i {
    width: 20px;
    color: var(--text-muted);
}

.categories-header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-clean {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-clean:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.btn-icon-clean.btn-clear-filter {
    color: var(--primary);
    background: rgba(249, 115, 22, 0.1);
}

.btn-icon-clean.btn-clear-filter:hover {
    background: var(--primary);
    color: white;
}

/* Categories Table Clean */
.categories-table-clean {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.categories-table-header {
    display: grid;
    grid-template-columns: 1fr 70px 70px 90px;
    padding: 1rem 1.5rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.categories-table-header span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.cat-col-icon,
.cat-col-color {
    text-align: center;
}

.cat-col-actions {
    text-align: right;
}

.categories-table-body {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.category-row-clean {
    display: grid;
    grid-template-columns: 1fr 70px 70px 90px;
    padding: 1rem 1.5rem;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.category-row-clean:last-child {
    border-bottom: none;
}

.category-row-clean:hover {
    background: var(--bg-card-hover);
}

.category-name-text {
    font-weight: 500;
    color: var(--text-main);
}

.cat-col-icon i {
    opacity: 0.7;
}

.color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.cat-col-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

.cat-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-action-btn:hover {
    background: var(--bg-dark);
    color: var(--text-main);
}

.cat-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Hide extra buttons - keep only edit and delete */
.cat-action-btn.view-trans,
.cat-action-btn.duplicate,
.cat-action-btn.add-budget {
    display: none;
}

.category-row-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    text-align: center;
}

.category-row-empty i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.category-row-empty p {
    margin-bottom: 1.5rem;
}

/* Transactions View Redesign */
.transactions-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    height: calc(100vh - 120px);
}

.transactions-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transactions-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.transactions-type-filter {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.type-filter-btn {
    border: none;
    background: transparent;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.type-filter-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.type-filter-btn.active {
    background: var(--bg-dark);
    color: var(--text-main);
}

.type-filter-btn.expense.active {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.type-filter-btn.income.active {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-nav:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.current-month-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-card);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--primary);
    min-width: 150px;
    text-align: center;
}

.transactions-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Transactions Table Clean */
.transactions-table-container {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.transactions-table-clean {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table-clean thead {
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    z-index: 10;
}

.transactions-table-clean th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.transactions-table-clean td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.transactions-table-clean tr:last-child td {
    border-bottom: none;
}

.transactions-table-clean tbody tr:hover {
    background: var(--bg-card-hover);
}

.col-status {
    width: 60px;
    text-align: center;
}

.col-date {
    width: 100px;
}

.col-desc {
    min-width: 150px;
}

.col-cat {
    width: 140px;
}

.col-account {
    width: 120px;
}

.col-value {
    width: 120px;
    text-align: right;
}

.col-actions {
    width: 100px;
    text-align: center;
}

/* Status Icon */
.status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-icon.paid {
    background: #22c55e;
    color: white;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-icon.paid:hover {
    background: #16a34a;
    transform: scale(1.1);
}

.status-icon.pending {
    background: transparent;
    color: #64748b;
    border: 2px solid #64748b;
}

.status-icon.pending i {
    font-size: 0.5rem;
}

.status-icon.pending:hover {
    border-color: #22c55e;
    color: #22c55e;
    transform: scale(1.1);
}

/* Category Tag in Table */
.category-tag-table {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.category-tag-table i {
    font-size: 0.75rem;
}

/* Transaction Actions */
.trans-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.trans-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.trans-action-btn:hover {
    background: var(--bg-dark);
    color: var(--text-main);
}

.trans-action-btn.delete:hover {
    color: #ef4444;
}

/* Transactions Sidebar */
.transactions-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-card-trans {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card-trans:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.summary-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.summary-value.income {
    color: #22c55e;
}

.summary-value.expense {
    color: #ef4444;
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Filter Panel */
.filter-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--bg-card);
    border-left: none;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.filter-panel.active {
    right: 0;
}

.filter-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.filter-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.filter-panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-panel-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.filter-category-dropdown {
    position: relative;
}

.filter-category-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
}

.filter-category-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 1002;
}

.filter-category-menu.show {
    display: block;
}

.filter-category-option {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.4rem 0.2rem;
    cursor: pointer;
}

.filter-category-option:hover .category-tag-pill {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.filter-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-panel-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.filter-panel-actions .btn-text {
    color: var(--primary);
    background: transparent;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.filter-panel-actions .btn-primary {
    flex: 1;
}

/* Day Separator in Transactions */
.day-separator {
    background: var(--bg-dark);
}

.day-separator td {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Transactions */
@media (max-width: 1100px) {
    .transactions-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .transactions-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .summary-card-trans {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .filter-panel {
        width: 100%;
        right: -100%;
    }

    .col-account {
        display: none;
    }
}

/* Delete Transaction Modal */
.delete-transaction-modal {
    max-width: 500px !important;
    padding: 0 !important;
}

.delete-transaction-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.delete-transaction-modal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.delete-transaction-info {
    padding: 1.5rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.delete-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.delete-info-row:last-child {
    margin-bottom: 0;
}

.delete-info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.delete-info-value {
    font-weight: 600;
    color: var(--text-main);
}

.delete-warning {
    padding: 1.5rem;
}

.warning-text {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.warning-text strong {
    color: #f59e0b;
}

.delete-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.delete-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.delete-option:hover {
    background: var(--bg-dark);
}

.delete-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    position: relative;
    transition: all 0.2s;
}

.delete-option input[type="radio"]:checked+.radio-custom {
    border-color: #ef4444;
}

.delete-option input[type="radio"]:checked+.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
}

.option-text {
    font-size: 0.95rem;
    color: var(--text-main);
}

.delete-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-actions .btn-text {
    color: #ef4444;
    background: transparent;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
}

.delete-actions .btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.delete-actions .btn-danger:hover {
    background: #dc2626;
}

/* Edit Transaction Modal */
.edit-transaction-modal {
    max-width: 480px !important;
    padding: 0 !important;
    overflow: hidden;
}

.edit-transaction-modal .modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: none;
}

.edit-transaction-modal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

#editTransactionForm {
    padding: 0 1.5rem 1.5rem;
}

.edit-field {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.edit-field:last-of-type {
    border-bottom: none;
}

.edit-field-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
}

.edit-field-content {
    flex: 1;
    display: flex;
    align-items: center;
}

.edit-field-content.amount-field {
    gap: 0.5rem;
}

.edit-field-content .currency-label {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.edit-field-content input[type="number"] {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    color: #ef4444;
    width: 100%;
    padding: 0;
}

.edit-field-content input[type="number"]:focus {
    outline: none;
}

.edit-field-content input[type="number"].income-amount {
    color: #22c55e;
}

.edit-field-content input[type="text"],
.edit-field-content input[type="date"] {
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-main);
    width: 100%;
    padding: 0;
}

.edit-field-content input[type="text"]:focus,
.edit-field-content input[type="date"]:focus {
    outline: none;
}

.edit-field-content select {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    width: 100%;
    cursor: pointer;
}

.edit-field-content select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #ef4444;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

/* Expandable Notes */
.edit-field-expandable {
    padding: 1rem 0;
}

.expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.expand-btn:hover {
    color: var(--primary);
}

.expand-btn i {
    transition: transform 0.3s;
}

.expand-btn i.expanded {
    transform: rotate(90deg);
}

.edit-notes-container {
    margin-top: 1rem;
}

.edit-notes-container textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-main);
    resize: vertical;
    font-family: inherit;
}

.edit-notes-container textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Save Button */
.edit-form-actions {
    margin-top: 1.5rem;
}

.btn-save {
    width: 100%;
    padding: 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Categories */
@media (max-width: 768px) {
    .categories-header-clean {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .categories-table-header {
        grid-template-columns: 1fr 50px 50px 70px;
        padding: 0.75rem 1rem;
    }

    .category-row-clean {
        grid-template-columns: 1fr 50px 50px 70px;
        padding: 0.75rem 1rem;
    }

    .cat-action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .cat-action-btn.add-budget {
        width: 26px;
        height: 26px;
    }
}

/* Recent Transactions */
.recent-transactions {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.recent-transactions-clickable {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.recent-transactions-clickable:hover {
    border-color: var(--primary);
}

.recent-transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1rem;
}

.recent-transactions-header:hover h3 {
    color: var(--primary);
}

.recent-transactions-header h3 {
    margin-bottom: 0;
    transition: color 0.2s ease;
}

.view-all-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 50%;
    color: var(--primary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.recent-transactions-header:hover .view-all-btn {
    background: var(--primary);
    color: #fff;
    transform: translateX(3px);
}

.recent-transactions-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.recent-transactions-footer .ver-mais {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.recent-transactions-footer .ver-mais:hover {
    opacity: 0.8;
}

.recent-transactions h3 {
    margin-bottom: 1rem;
}

.transaction-list {
    list-style: none;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.transaction-item:hover {
    background: rgba(59, 130, 246, 0.05);
    margin: 0 -0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 0.5rem;
}

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

.t-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.t-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.t-details h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.t-details span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.t-amount {
    font-weight: 600;
}

.t-amount.income {
    color: var(--success);
}

.t-amount.expense {
    color: var(--danger);
}

.t-amount.transfer {
    color: #8b5cf6;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

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

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: none;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    align-items: start;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Tight layout for the transaction modal — keeps the two-column form fully
   visible at any reasonable zoom so the user never gets a scrollbar on it. */
#transactionModal .modal-content {
    padding: 1.75rem 2rem;
    max-height: 95vh;
}

#transactionModal .modal-header {
    margin-bottom: 1rem;
}

#transactionModal .form-group {
    margin-bottom: 0;
}

#transactionModal .form-group label {
    margin-bottom: 0.35rem;
}

#transactionModal .form-group input,
#transactionModal .form-group select,
#transactionModal .custom-select-trigger {
    padding: 0.7rem 0.875rem;
}


/* Inside a flex form-column, gap already controls vertical rhythm — zero out the
   legacy margin-bottom on .form-group so spacing doesn't double up. */
.form-column > .form-group {
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .modal-form-grid {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group .custom-select-trigger:focus {
    outline: none;
    border-color: var(--primary);
}

/* Date Segments */
.date-selector {
    display: flex;
    gap: 0.5rem;
}

.date-segment {
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.date-segment.active {
    background: var(--success);
    color: #000;
    border-color: var(--success);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-card-hover);
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--success);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Visual Select (Category) */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.selected-category-view {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.category-tag-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
    font-size: 0.85rem;
}

.type-selector {
    display: flex;
    gap: 1rem;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.radio-label input:checked+.radio-custom.income {
    background: rgba(16, 185, 129, 0.05);
    border-color: var(--success);
    color: var(--success);
}

.radio-label input:checked+.radio-custom.expense {
    background: rgba(239, 68, 68, 0.05);
    border-color: var(--danger);
    color: var(--danger);
}

.radio-label input:checked+.radio-custom.transfer {
    background: rgba(249, 115, 22, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

.hud-content {
    animation: hudEnter 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.3), 0 20px 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

@keyframes hudEnter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
        filter: blur(10px);
    }

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

.hud-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--primary);
    border-left: 2px solid var(--primary);
}

.hud-content::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
}

/* Tables */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Tables */
.transactions-table-wrapper {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

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

.transactions-table th,
.transactions-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.transactions-table th {
    background: var(--bg-dark);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.transactions-table tr:hover {
    background: rgba(249, 115, 22, 0.015);
}

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

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
}

.filter-select {
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
}

/* Category Type Selector */
.category-type-selector {
    display: flex;
    gap: 1rem;
}

.category-type-selector .type-option {
    flex: 1;
    cursor: pointer;
}

.category-type-selector .type-option input[type="radio"] {
    display: none;
}

.category-type-selector .type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-muted);
}

.category-type-selector .type-btn.expense i {
    color: #ef4444;
}

.category-type-selector .type-btn.income i {
    color: #10b981;
}

.category-type-selector .type-option input[type="radio"]:checked+.type-btn.expense {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.category-type-selector .type-option input[type="radio"]:checked+.type-btn.expense i {
    color: #ef4444;
}

.category-type-selector .type-option input[type="radio"]:checked+.type-btn.income {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.category-type-selector .type-option input[type="radio"]:checked+.type-btn.income i {
    color: #10b981;
}

.category-type-selector .type-btn:hover {
    border-color: var(--text-muted);
}

/* Category Modal Redesign */
.color-grid-modern .color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.color-grid-modern .color-btn.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 0.8rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Color Picker Modal - iro.js */
.color-picker-modal {
    max-width: 380px !important;
    padding: 0 !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
}

.color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.color-picker-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.btn-close-modal {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: var(--bg-dark);
    color: var(--text-main);
}

.color-picker-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.iro-container {
    display: flex;
    justify-content: center;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.color-preview-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.hex-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 1rem;
    transition: border-color 0.2s;
}

.hex-input-wrapper:focus-within {
    border-color: var(--primary);
}

.hex-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hex-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--text-main);
    text-transform: uppercase;
    outline: none;
}

.preset-colors {
    width: 100%;
}

.preset-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.preset-color-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.5rem;
}

.preset-color {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.preset-color:hover {
    transform: scale(1.15);
}

.preset-color.active {
    border-color: var(--text-main);
    box-shadow: 0 0 0 2px var(--bg-card);
}

.color-picker-actions {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
}

.color-picker-actions .btn {
    flex: 1;
}

.icon-selector-grid .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: white;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.icon-selector-grid .icon-btn:hover {
    transform: scale(1.1);
}

.icon-selector-grid .icon-btn.active {
    border-color: var(--text-main);
    box-shadow: 0 0 0 3px var(--bg-card);
}

.btn-outline-pill {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* Icon Selector Styles */
.icon-selector-container {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    margin-bottom: 0.5rem;
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}

.icon-search-input {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 100%;
    color: var(--text-main);
}

.icon-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.icon-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    max-width: 100%;
    overflow: hidden;
}

.icon-cat-tab {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.icon-cat-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.icon-cat-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

.icon-grid-container {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
}

.icon-category-header {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.75rem 0 0.5rem;
    margin-top: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icon-category-header:first-child {
    margin-top: 0;
}

.icon-category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

#expandedIconGrid .icon-item,
.icon-category-grid .icon-item {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.95rem;
    /* Default styling - will be overridden by inline styles */
    background: #10b981;
    color: white;
}

#expandedIconGrid .icon-item:hover,
.icon-category-grid .icon-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.no-icons-found {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.85rem;
}

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

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

/* HUD Categories Styles */
.segmented-control-hud {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 2px;
    border-radius: var(--radius-sm);
}

.seg-item {
    background: transparent;
    border: none;
    padding: 0.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.seg-item:hover {
    color: var(--text-main);
}

.seg-item.active {
    background: white;
    color: black;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-add-modern-hud {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--primary);
    border: none;
    padding: 0.75rem 1.5rem;
    color: black;
    font-weight: 900;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.btn-add-modern-hud:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
    background: #fb923c;
}

.action-btn-minimal {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn-minimal:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.action-btn-minimal i {
    font-size: 0.9rem;
}

.settings-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.settings-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.settings-card h3 {
    margin-bottom: 1rem;
}

/* Account Menu Dropdown */
.account-menu-wrapper {
    position: relative;
}

.btn-menu-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-menu-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.account-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 180px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.account-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.875rem;
    font-weight: 500;
}

.account-dropdown-menu .dropdown-item:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.account-dropdown-menu .dropdown-item:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.account-dropdown-menu .dropdown-item:hover {
    background: var(--bg-card-hover);
}

.account-dropdown-menu .dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.account-dropdown-menu .dropdown-item:hover i {
    color: var(--primary);
}

.account-dropdown-menu .dropdown-item.danger {
    color: var(--danger);
}

.account-dropdown-menu .dropdown-item.danger i {
    color: var(--danger);
}

.account-dropdown-menu .dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Rate History Modal Styles */
.rate-history-list {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.rate-history-item {
    transition: background 0.2s;
}

.rate-history-item:hover {
    background: var(--bg-card-hover);
}

.rate-history-item.active {
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid var(--success);
}

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

.rate-badge-active {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Rate Update Container */
.rate-update-container {
    padding: 1rem 0;
}

.rate-account-info {
    position: relative;
    overflow: hidden;
}

.rate-account-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--success));
}

/* Earnings Summary Cards */
.earnings-summary>div {
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    transition: transform 0.2s, background 0.2s;
}

.earnings-summary>div:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* Bank Logo Selector Styles */
.bank-logo-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.bank-logo-option {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    padding: 3px;
    border: 2px solid transparent;
}

.bank-logo-option:hover {
    transform: scale(1.1);
}

.bank-logo-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.bank-logo-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Inter', sans-serif;
    text-align: center;
    overflow: hidden;
}

.bank-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bank Logo in Cards */
.bank-logo-display {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Inter', sans-serif;
    text-align: center;
    overflow: hidden;
    flex-shrink: 0;
}

.bank-logo-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Target Account — custom dropdown (Nova Receita/Despesa "Conta de Destino") */
.custom-select.target-account-select {
    position: relative;
}

.target-account-view {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 32px;
    min-width: 0;
}

.target-account-placeholder {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.target-account-selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

.target-account-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.2;
    min-width: 0;
    flex: 1;
}

.target-account-name {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.target-account-balance {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

.target-account-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    z-index: 10;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.target-account-options[hidden] {
    display: none;
}

.target-account-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #1e293b;
    transition: background 0.12s;
}

.target-account-option:last-child {
    border-bottom: none;
}

.target-account-option:hover {
    background: rgba(249, 115, 22, 0.08);
}

.target-account-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive - Medium Screens */
@media (max-width: 1400px) {
    .charts-grid.triple-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    }

    .chart-card {
        min-height: 280px;
    }

    .chart-container-donut {
        width: 130px;
        height: 130px;
    }

    .chart-donut-large {
        width: 180px;
        height: 180px;
    }

    .chart-container-line,
    .chart-container-bar {
        height: 160px;
    }
}

@media (max-width: 1100px) {

    .charts-grid,
    .charts-grid.triple-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    }

    .balance-summary-content {
        flex-direction: column;
        gap: 1rem;
    }

    .balance-bars {
        flex-direction: row;
        height: 80px;
        width: 100%;
        justify-content: center;
    }
}

/* Responsive - Small Screens (Base) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        display: flex;
    }

    .sidebar {
        width: var(--sidebar-width);
        height: 100vh;
        padding: 0;
    }

    /* Hide desktop sidebar toggle on mobile */
    .sidebar-toggle {
        display: none;
    }

    /* Main content takes full width */
    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 1rem;
    }

    /* Header adjustments */
    .header {
        padding-left: 50px;
    }

    /* View adjustments */
    .view {
        padding: 1rem;
    }

    /* Stats Grid - 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Charts Grid - 1 column for full width charts */
    .charts-grid,
    .charts-grid.triple-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Stat cards */
    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .stat-card .stat-value {
        font-size: 1rem;
    }

    /* Chart cards - Full width */
    .chart-card {
        min-height: 280px;
        padding: 1.25rem;
    }

    .chart-card h3 {
        font-size: 1rem;
    }

    /* Top bar */
    .top-bar {
        margin-bottom: 1rem;
        padding-left: 40px;
    }

    .top-bar h1 {
        font-size: 1.25rem;
    }
}

/* Ensure sidebar stays left on desktop */
@media (min-width: 769px) {
    .app-container {
        flex-direction: row;
    }

    .sidebar {
        width: var(--sidebar-width);
        flex: 0 0 var(--sidebar-width);
    }

    .main-content {
        flex: 1 1 auto;
        width: auto;
    }
}

/* Modal Styles (Global) */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.type-selector {
    display: flex;
    gap: 1rem;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
}

.radio-label input:checked+.radio-custom.income {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.radio-label input:checked+.radio-custom.expense {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Tables */
.transactions-table-wrapper {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border);
}

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

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

.transactions-table th {
    background: var(--bg-card-hover);
    color: var(--text-muted);
    font-weight: 600;
}

.transactions-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

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

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
}

.filter-select {
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
}

.settings-card h3 {
    margin-bottom: 1rem;
}

/* Transfer Styles */
.radio-label input:checked+.radio-custom.transfer {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.balance-info {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-size: 0.9rem;
}

.balance-info i {
    font-size: 1rem;
}

.error-message {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger);
    font-size: 0.9rem;
}

.error-message i {
    font-size: 1rem;
}

.type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

/* Date Selector Styles */
.date-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.date-btn {
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    border: 2px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.date-btn i {
    font-size: 1.25rem;
    transition: transform 0.25s;
}

.date-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.date-btn:hover i {
    transform: scale(1.1);
}

.date-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.selected-date {
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.625rem;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.selected-date::before {
    content: '📅';
    font-size: 1.1rem;
}

/* Accounts Summary in Sidebar */
.accounts-summary {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    flex: 1;
    overflow-y: auto;
}

.summary-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.account-summary-card {
    margin-bottom: 0.75rem;
    background: var(--bg-card-hover);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s;
}

.account-summary-card:hover {
    background: rgba(51, 65, 85, 0.8);
}

.summary-card-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.summary-rate {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

.expand-icon {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.summary-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.summary-details.expanded {
    max-height: 500px;
}

.summary-details-item {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.summary-details-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.summary-details-item .item-name {
    color: var(--text-main);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-details-item .item-value {
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Transfer Radio Button Style */
.radio-label input:checked+.radio-custom.transfer {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Category Management Styles */
.toggle-group {
    display: flex;
    background: var(--bg-dark);
    padding: 2px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.toggle-group .btn-outline {
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--radius-sm);
}

.toggle-group .btn-outline.active {
    background: var(--primary);
    color: #000;
    box-shadow: none;
}

.color-picker-grid,
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.color-option,
.icon-option {
    cursor: pointer;
    position: relative;
}

.color-option input,
.icon-option input {
    display: none;
}

.color-option span {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: transform 0.1s;
}

.color-option input:checked+span {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
}

.icon-option input:checked+.icon-box {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================ */
/* AUTHENTICATION SCREENS */
/* ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(249, 115, 22, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

.auth-overlay.hidden {
    display: none;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1100px;
    width: 100%;
    min-height: 650px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Auth Branding (Left Side) */
.auth-branding {
    background: linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 2rem;
}

.auth-logo i {
    color: var(--primary);
    font-size: 1.75rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 2rem;
}

.auth-illustration {
    width: 100%;
    max-width: 350px;
    margin: 1rem 0;
}

.auth-illustration svg {
    width: 100%;
    height: auto;
}

.auth-tagline {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.7;
    max-width: 400px;
}

.auth-slogan {
    margin-top: 0.75rem;
    font-weight: 600;
    color: #1e293b;
}

.auth-tagline .highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Auth Form (Right Side) */
.auth-form-container {
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.auth-tab.active {
    color: #1e293b;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.auth-tab:hover:not(.active) {
    color: #64748b;
}

/* Auth Forms */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.auth-form.active {
    display: flex;
}

/* Social Buttons */
.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google {
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-apple {
    background: #1e293b;
    border: 1px solid #1e293b;
    color: white;
}

.btn-apple:hover {
    background: #0f172a;
}

.btn-apple i {
    font-size: 1.25rem;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Input Groups */
.auth-input-group {
    position: relative;
    padding-top: 0.85rem;
}

.auth-input-group input {
    width: 100%;
    padding: 0.7rem 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    background: transparent;
    font-size: 1rem;
    color: #1e293b;
    transition: border-color 0.2s;
}

.auth-input-group input:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.auth-input-group input::placeholder {
    color: #94a3b8;
}

.auth-input-group label {
    position: absolute;
    top: 0;
    left: 0;
    transform: none;
    font-size: 0.75rem;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.2s;
    opacity: 1;
    background: #ffffff;
    padding: 0 0.25rem;
}

.auth-input-group.invalid input {
    border-color: #ef4444;
}

.auth-input-group.invalid label {
    color: #ef4444;
}

.auth-field-hint {
    display: none;
    font-size: 0.7rem;
    color: #ef4444;
    position: absolute;
    right: 0;
    top: 0;
    background: #ffffff;
    padding: 0 0.25rem;
}

.auth-input-group.invalid .auth-field-hint {
    display: block;
}

.auth-input-group input:focus+label,
.auth-input-group input:not(:placeholder-shown)+label {
    color: var(--primary);
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
}

.toggle-password:hover {
    color: #64748b;
}

/* Checkbox */
.auth-remember {
    margin: 0.5rem 0;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
}

.auth-checkbox input {
    display: none;
}

.auth-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.auth-checkbox input:checked+.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.auth-checkbox input:checked+.checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Submit Button */
.btn-auth-submit {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary);
    border: none;
    border-radius: 100px;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.btn-auth-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Forgot Password Link */
.auth-forgot-link {
    display: block;
    text-align: center;
    color: var(--primary);
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: 1rem;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

/* Terms */
.auth-terms {
    margin-top: auto;
    padding-top: 1.5rem;
    text-align: center;
}

.auth-terms p {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.6;
}

.auth-terms a {
    color: var(--primary);
    text-decoration: none;
}

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

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.strength-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: #ef4444;
    transition: all 0.3s;
}

.password-strength.weak .strength-bar::after {
    width: 33%;
    background: #ef4444;
}

.password-strength.medium .strength-bar::after {
    width: 66%;
    background: #f59e0b;
}

.password-strength.strong .strength-bar::after {
    width: 100%;
    background: #22c55e;
}

.strength-text {
    font-size: 0.75rem;
    color: #94a3b8;
}

.password-strength.weak .strength-text {
    color: #ef4444;
}

.password-strength.medium .strength-text {
    color: #f59e0b;
}

.password-strength.strong .strength-text {
    color: #22c55e;
}

/* Forgot Password Form */
.forgot-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.back-to-login {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.back-to-login:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.forgot-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.forgot-description {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .auth-branding {
        display: none;
    }

    .auth-form-container {
        padding: 2rem;
    }
}

@media (max-width: 500px) {
    .auth-overlay {
        padding: 0;
    }

    .auth-container {
        border-radius: 0;
        min-height: 100vh;
    }

    .auth-form-container {
        padding: 1.5rem;
    }

    .btn-social {
        padding: 0.75rem 1rem;
    }

    .btn-auth-submit {
        padding: 0.875rem 1.5rem;
    }
}

/* ============================================ */
/* RESPONSIVE DEVICE DETECTION STYLES          */
/* ============================================ */

/* === SMARTPHONE (até 768px) === */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        --header-height: 56px;
    }

    body.device-smartphone {
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Top Bar - Mobile adjustments */
    body.device-smartphone .top-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        margin-bottom: 1rem;
        padding-left: 40px; /* Space for hamburger */
    }

    body.device-smartphone .top-bar h1 {
        font-size: 1.35rem;
    }

    body.device-smartphone .top-bar .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* App Container - Mobile Layout */
    body.device-smartphone .app-container {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        width: 100vw;
        overflow: hidden;
    }

    /* Sidebar - Hidden by default on mobile */
    body.device-smartphone .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: none;
    }

    body.device-smartphone .sidebar.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    /* Sidebar Toggle - Always visible on mobile */
    body.device-smartphone .sidebar-toggle {
        position: fixed;
        left: 12px;
        top: 12px;
        right: auto;
        z-index: 1001;
        width: 40px;
        height: 40px;
        font-size: 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-md);
    }

    body.device-smartphone .sidebar.mobile-open + .sidebar-toggle,
    body.device-smartphone .sidebar.mobile-open .sidebar-toggle {
        left: 248px;
    }

    /* Main Content - Full Width on Mobile */
    body.device-smartphone .main-content {
        width: 100vw;
        padding: 0;
        margin-left: 0;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Header adjustments for mobile */
    body.device-smartphone .header {
        padding: 0.75rem 1rem;
        padding-left: 50px; /* Space for hamburger menu */
        height: auto;
        min-height: 56px;
    }

    body.device-smartphone .header h1 {
        font-size: 1.25rem;
    }

    /* View padding on mobile */
    body.device-smartphone .view {
        padding: 1rem;
        padding-bottom: 2rem;
    }

    /* Stats Grid - 2 columns on mobile */
    body.device-smartphone .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Stat cards - Proper sizing */
    body.device-smartphone .stat-card {
        padding: 1rem;
        min-height: auto;
    }

    body.device-smartphone .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    body.device-smartphone .stat-card .stat-label {
        font-size: 0.7rem;
        margin-bottom: 0.35rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    body.device-smartphone .stat-card .stat-value {
        font-size: 1.1rem;
        font-weight: 600;
    }

    /* Charts Grid - 1 column on mobile for better visibility */
    body.device-smartphone .charts-grid,
    body.device-smartphone .charts-grid.triple-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Chart cards - Full width with proper sizing */
    body.device-smartphone .chart-card {
        min-height: 280px;
        padding: 1.25rem;
    }

    body.device-smartphone .chart-card h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    /* Donut charts - Larger and readable */
    body.device-smartphone .chart-container-donut {
        width: 140px;
        height: 140px;
    }

    body.device-smartphone .chart-donut-large {
        width: 160px;
        height: 160px;
    }

    /* Line/Bar charts - Taller for better visibility */
    body.device-smartphone .chart-container-line,
    body.device-smartphone .chart-container-bar {
        height: 150px;
    }

    /* Chart header */
    body.device-smartphone .chart-header {
        margin-bottom: 1rem;
    }

    body.device-smartphone .chart-header h3 {
        font-size: 1rem;
    }

    /* Ver mais links */
    body.device-smartphone .ver-mais {
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }

    /* Total display in donut charts */
    body.device-smartphone .donut-total {
        font-size: 0.85rem;
    }

    body.device-smartphone .donut-total-value {
        font-size: 1.1rem;
    }

    /* Period selector */
    body.device-smartphone .period-selector {
        gap: 0.5rem;
    }

    body.device-smartphone .period-selector button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* No hover effect on mobile */
    body.device-smartphone .chart-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    /* Buttons - Touch-friendly */
    body.device-smartphone .btn,
    body.device-smartphone button {
        min-height: 40px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Forms - Better spacing */
    body.device-smartphone .form-group input,
    body.device-smartphone .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
    }

    /* Modals - Full screen on mobile */
    body.device-smartphone .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }

    /* Mobile overlay for sidebar */
    body.device-smartphone .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    body.device-smartphone .mobile-overlay.active {
        display: block;
    }

    /* Navigation items */
    body.device-smartphone .nav-item {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    /* Tables - Horizontal scroll */
    body.device-smartphone .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.device-smartphone table {
        min-width: 500px;
        font-size: 0.85rem;
    }

    /* Transactions layout */
    body.device-smartphone .transactions-layout {
        grid-template-columns: 1fr;
    }

    /* Planning layout */
    body.device-smartphone .planning-layout {
        grid-template-columns: 1fr;
    }

    /* Balance bars */
    body.device-smartphone .balance-bars {
        flex-direction: row;
        height: 60px;
        width: 100%;
    }

    /* Balance summary */
    body.device-smartphone .balance-summary-content {
        gap: 0.75rem;
    }

    /* Hide expanded sidebar text on mobile initially */
    body.device-smartphone .sidebar:not(.mobile-open) .nav-text,
    body.device-smartphone .sidebar:not(.mobile-open) .logo-text {
        display: none;
    }

    body.device-smartphone .sidebar.mobile-open .nav-text,
    body.device-smartphone .sidebar.mobile-open .logo-text {
        display: block;
    }
}

/* === TABLET (769px - 1024px) === */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 64px;
    }

    body.device-tablet .app-container {
        display: grid;
        grid-template-columns: var(--sidebar-width) 1fr;
        height: 100vh;
    }

    body.device-tablet .sidebar {
        width: var(--sidebar-width);
        position: relative;
    }

    body.device-tablet .sidebar.expanded {
        position: fixed;
        width: 220px;
        z-index: 1000;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    body.device-tablet .main-content {
        padding: 1rem;
        overflow-y: auto;
    }

    /* Stats Grid - 2 columns on tablet */
    body.device-tablet .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Charts Grid - 2 columns on tablet */
    body.device-tablet .charts-grid,
    body.device-tablet .charts-grid.triple-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Modals - Centered but smaller */
    body.device-tablet .modal-content {
        max-width: 90%;
        max-height: 90%;
    }

    /* View padding */
    body.device-tablet .view {
        padding: 1rem;
    }

    /* Better touch targets */
    body.device-tablet .btn,
    body.device-tablet button {
        min-height: 44px;
    }

    body.device-tablet .form-group input,
    body.device-tablet .form-group select {
        font-size: 16px;
        padding: 0.75rem;
    }
}

/* === DESKTOP (1025px+) === */
@media (min-width: 1025px) {
    body.device-desktop .app-container {
        display: grid;
        grid-template-columns: auto 1fr;
        height: 100vh;
    }

    body.device-desktop .sidebar {
        width: var(--sidebar-width);
        transition: width 0.3s ease;
    }

    body.device-desktop .sidebar.expanded {
        width: 220px;
    }

    body.device-desktop .main-content {
        overflow-y: auto;
        padding: 1.5rem;
    }

    /* Stats Grid - 4 columns on desktop */
    body.device-desktop .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Charts Grid - Auto-fit on desktop */
    body.device-desktop .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    body.device-desktop .charts-grid.triple-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* === TOUCH DEVICE SPECIFIC === */
body.is-touch-device {
    /* Larger touch targets */
    -webkit-tap-highlight-color: transparent;
}

body.is-touch-device .btn,
body.is-touch-device button,
body.is-touch-device .nav-item,
body.is-touch-device .clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(249, 115, 22, 0.1);
}

body.is-touch-device::-webkit-scrollbar {
    display: none;
}

body.is-touch-device {
    scrollbar-width: none;
}

/* === MOBILE HAMBURGER MENU BUTTON === */
.mobile-menu-btn {
    display: none;
    position: fixed;
    left: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 1001;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

body.device-smartphone .mobile-menu-btn {
    display: flex;
}

/* === MOBILE OVERLAY === */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.device-smartphone .mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* === ORIENTATION SPECIFIC === */
@media (max-width: 768px) and (orientation: landscape) {
    body.device-smartphone .view {
        padding: 0.75rem;
    }

    body.device-smartphone .header {
        padding: 0.5rem 1rem;
        padding-left: 50px;
    }

    /* Landscape can fit more columns */
    body.device-smartphone .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    body.device-smartphone .charts-grid,
    body.device-smartphone .charts-grid.triple-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* === SAFE AREA INSETS (for notched devices) === */
@supports (padding: env(safe-area-inset-top)) {
    body.device-smartphone .header {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }

    body.device-smartphone .sidebar {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
    }

    body.device-smartphone .view {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* === PREVENT TEXT SIZE ADJUSTMENT === */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ============================================ */
/* TOOLTIP SYSTEM - Explanatory Popups         */
/* ============================================ */

/* Tooltip trigger button */
.tooltip-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.2);
    border: 1.5px solid var(--primary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 50;
}

.tooltip-trigger:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.5);
}

/* Tooltip content box
   Parked off-screen (top/left: -9999px) when hidden so it never causes layout shift.
   Always display:block and position:fixed — JS reparents to <body> to escape
   any ancestor transforms that would otherwise turn fixed into absolute. */
.tooltip-content {
    display: block;
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 280px;
    max-width: calc(100vw - 24px);
    padding: 1rem;
    background: #151b28;
    border: 1.5px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(249, 115, 22, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0s linear 0.15s;
    z-index: 999999;
    --arrow-left: 240px;
    will-change: opacity;
}

.tooltip-content.tooltip-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.15s ease, visibility 0s linear 0s;
}

/* Arrow pointing up (default - tooltip below trigger) */
.tooltip-content::before {
    content: '';
    position: absolute;
    top: -9px;
    left: var(--arrow-left);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid var(--primary);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: -6px;
    left: calc(var(--arrow-left) + 2px);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #151b28;
}

/* Arrow pointing down (tooltip above trigger) */
.tooltip-content.tooltip-above::before {
    top: auto;
    bottom: -9px;
    border-bottom: none;
    border-top: 9px solid var(--primary);
}

.tooltip-content.tooltip-above::after {
    top: auto;
    bottom: -6px;
    border-bottom: none;
    border-top: 7px solid #151b28;
}

/* Tooltip header */
.tooltip-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(249, 115, 22, 0.3);
}

.tooltip-title i {
    font-size: 1rem;
    opacity: 0.9;
}

/* Tooltip body text */
.tooltip-text {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* Tooltip formula box */
.tooltip-formula {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--primary);
    letter-spacing: -0.02em;
}

/* Position adjustment for cards */
.stat-card,
.chart-card {
    position: relative;
    overflow: visible;
}

/* Prevent hover transform when tooltip is open (keeps alignment stable) */
.stat-card.tooltip-open,
.chart-card.tooltip-open {
    transform: none !important;
    box-shadow: var(--shadow-md);
    z-index: 5;
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .tooltip-content {
        width: 260px;
        padding: 0.875rem;
    }

    .tooltip-trigger {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }

    .tooltip-title {
        font-size: 0.9rem;
    }

    .tooltip-text {
        font-size: 0.8rem;
    }
}

/* Light theme - keep dark tooltip for contrast */
body:not(.dark-theme) .tooltip-content {
    background: #1e293b;
}

body:not(.dark-theme) .tooltip-content::after {
    border-bottom-color: #1e293b;
}

body:not(.dark-theme) .tooltip-content.tooltip-above::after {
    border-top-color: #1e293b;
}

/* === FIX IOS INPUT ZOOM === */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ==========================================================================
   CLARITY PASS — financial-data readability
   Pequenos ajustes que melhoram hierarquia, alinhamento de números e a11y
   sem mudar o layout existente.
   ========================================================================== */

/* 1. Tabular numerals — alinha algarismos em colunas (R$ 1.234,56). */
.stat-info .value,
.stat-value,
.balance-value,
.donut-total-value,
.planning-stat-card .stat-value,
.projection-summary-item .value,
.category-total .total-value,
.budget-total-display .total-values,
.amount-field,
.money,
[data-money],
.account-balance,
.transaction-amount {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "lnum";
    font-kerning: none;
    letter-spacing: -0.01em;
}

/* 2. Hierarquia mais clara nos cards principais do dashboard. */
.stat-info .value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
}

.stat-info .label,
.stat-card .label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    opacity: 0.82;
}

/* 3. Semântica consistente income/expense via variáveis do tema. */
.value.income,
.stat-value.income,
.balance-value.income,
.amount.income,
.transaction-amount.income,
[data-direction="income"] {
    color: var(--success);
}

.value.expense,
.stat-value.expense,
.balance-value.expense,
.amount.expense,
.transaction-amount.expense,
[data-direction="expense"] {
    color: var(--danger);
}

/* 4. Cards com respiração um pouco maior e sombra mais sutil. */
.stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
}

/* 5. Acessibilidade — foco visível consistente. */
:is(button, a, input, select, textarea, [role="button"]):focus-visible {
    outline: 2px solid var(--primary, #f97316);
    outline-offset: 2px;
    border-radius: 6px;
}

/* 6. Respeito a prefers-reduced-motion. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* 7. Touch-targets mínimos (WCAG 2.5.5). */
@media (pointer: coarse) {
    button,
    .btn,
    .btn-icon,
    .account-menu-item,
    [role="button"] {
        min-height: 44px;
    }
}

/* 8. Linhas financeiras sem overflow — dá espaço ao R$ milhares sem cortar. */
.balance-row,
.projection-summary-item,
.transaction-row {
    gap: 0.75rem;
}

.balance-value,
.transaction-amount {
    white-space: nowrap;
}
/* .stat-value pode quebrar — valores como "+R$ 3.396,17 (+8.28%)" precisam
   wrap pra não cortar. word-break: keep-all evita quebrar dentro de "R$ 3.396,17". */
.stat-value {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: keep-all;
}

/* ============================================================
   COTAÇÕES AO VIVO — linha do ticker dentro do modal
   ============================================================ */
.holding-row {
    position: relative;
}
.holding-quote {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.25rem 0 0.25rem;
    font-size: 0.75rem;
    min-height: 1.1rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "lnum";
}
.holding-quote[data-variant="up"] .hq-delta { color: var(--success, #22c55e); }
.holding-quote[data-variant="down"] .hq-delta { color: var(--danger, #ef4444); }
.holding-quote[data-variant="muted"] { color: var(--text-muted); font-style: italic; }
.holding-quote .hq-price {
    font-weight: 700;
    color: var(--text-main);
}
.holding-quote .hq-delta {
    font-weight: 600;
}
.holding-quote .hq-name {
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

/* ============================================================
   BREAKDOWN POR AÇÃO — card de investimento variável
   ============================================================ */
.holdings-breakdown {
    margin-top: 0.25rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm, 8px);
}
.hb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.hb-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hb-refresh:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-main);
}
.hb-refresh.spinning i {
    animation: hb-spin 0.8s linear infinite;
}
@keyframes hb-spin {
    to { transform: rotate(360deg); }
}
.hb-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.hb-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 0.75rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "lnum";
}
.hb-row:last-child { border-bottom: 0; }
.hb-cell {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.hb-ticker strong {
    font-size: 0.9rem;
    color: var(--text-main);
    letter-spacing: 0.5px;
}
.hb-ticker .hb-qty {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.hb-price {
    text-align: right;
    align-items: flex-end;
}
.hb-price span:first-child {
    font-weight: 600;
    color: var(--text-main);
}
.hb-change {
    font-size: 0.7rem;
    font-weight: 600;
}
.hb-change.up { color: var(--success, #22c55e); }
.hb-change.down { color: var(--danger, #ef4444); }
.hb-row--offline { opacity: 0.88; }
.hb-row--offline .hb-price > span:first-child {
    color: var(--text-muted, #94a3b8);
    font-style: italic;
}
.hb-offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.hb-offline-badge i { font-size: 0.65rem; }
.hb-pnl {
    text-align: right;
    align-items: flex-end;
}
.hb-pnl span:first-child {
    font-weight: 700;
    color: var(--text-main);
}
.hb-pnl-delta {
    font-size: 0.72rem;
    font-weight: 600;
}
.hb-pnl.up .hb-pnl-delta,
.hb-pnl.up span:first-child { color: var(--success, #22c55e); }
.hb-pnl.down .hb-pnl-delta,
.hb-pnl.down span:first-child { color: var(--danger, #ef4444); }

/* Dot pulsante indicando cotação ao vivo */
.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success, #22c55e);
    margin-left: 0.25rem;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .live-dot { animation: none; }
    .hb-refresh.spinning i { animation: none; }
}

/* Em telas estreitas, empilha as 3 colunas */
@media (max-width: 540px) {
    .hb-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    .hb-price, .hb-pnl {
        text-align: left;
        align-items: flex-start;
        flex-direction: row;
        gap: 0.5rem;
    }
}

/* =========================================================================
   PRIMARY ACCOUNT — badge + card accent
   Shown on the card marked as "principal" so the user can recognize it while
   navigating between bank / investment tabs.
   ========================================================================= */
.primary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.45);
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 0.5rem;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.4;
}

.primary-badge i {
    font-size: 0.6rem;
}

.account-card.is-primary {
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.45), var(--shadow-md);
}

.account-card.is-primary .account-info h4 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* =========================================================================
   DESCRIPTION AUTOCOMPLETE — custom dropdown with category icon preview
   Replaces the native <datalist> so we can render an icon + description +
   category label, and so clicking a row always applies the historical
   category to the form.
   ========================================================================= */
.description-autocomplete {
    position: relative;
}

.description-suggestions-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: #0a1120;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 120;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.description-suggestions-list[hidden] {
    display: none;
}

.desc-sugg-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: background 0.12s ease;
}

.desc-sugg-row:hover,
.desc-sugg-row:focus-visible {
    background: rgba(249, 115, 22, 0.10);
    outline: none;
}

.desc-sugg-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.desc-sugg-icon.muted {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.desc-sugg-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.desc-sugg-title {
    font-size: 0.92rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desc-sugg-cat {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.85;
}

/* ============================================================
   PROFILE MODAL — Avatar circular + botão alterar senha
   Aplica em web + mobile.
   ============================================================ */
.profile-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.profile-avatar-btn {
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
}
.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.12);
    color: var(--primary, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
    border: 2px solid rgba(249, 115, 22, 0.3);
    transition: border-color 0.15s, transform 0.15s;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-avatar-btn:hover .profile-avatar {
    border-color: var(--primary, #f97316);
}
.profile-avatar-btn:active .profile-avatar {
    transform: scale(0.96);
}
.profile-avatar-edit-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, #f97316);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 3px solid var(--bg-card, #1a1a1a);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}
.profile-avatar-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.profile-avatar-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* Botão "Alterar senha" — abre modal separado */
.profile-change-password-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 0.95rem !important;
    margin: 0.75rem 0 !important;
    font-size: 0.85rem !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text) !important;
    border-radius: 8px !important;
}
.profile-change-password-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
    color: var(--primary, #f97316) !important;
}
.profile-change-password-btn i {
    font-size: 0.85rem;
}

/* Subtle scrollbar for the dropdown so it doesn't shove content around. */
.description-suggestions-list::-webkit-scrollbar {
    width: 8px;
}
.description-suggestions-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
}

/* ============================================================
   MOBILE BOTTOM NAV (Etapa 2) — barra inferior estilo Mobills
   Esconde o sidebar no mobile e mostra navegação fixa em baixo.
   ============================================================ */
.mobile-bottom-nav {
    display: none;
}
.mobile-more-sheet[hidden] {
    display: none;
}
.mobile-quick-add[hidden] {
    display: none;
}
.mobile-profile-btn {
    display: none;
}

@media (max-width: 768px) {
    /* Esconde o sidebar e seu toggle inteiramente no mobile */
    .sidebar,
    .sidebar.expanded,
    .sidebar.mobile-open {
        display: none !important;
    }
    .sidebar-toggle {
        display: none !important;
    }

    /* App container ocupa tudo (sem coluna do sidebar) e abre espaço inferior pro nav */
    .app-container {
        grid-template-columns: 1fr !important;
    }
    .main-content,
    .view {
        padding-bottom: 5.5rem !important;
    }

    /* Bottom nav container */
    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: 1fr 1fr 88px 1fr 1fr;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 68px;
        background: var(--bg-card, #1a1a1a);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 100;
        padding: 0 0.25rem;
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .mobile-nav-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.25rem !important;
        background: transparent !important;
        border: none !important;
        color: var(--text-muted, #94a3b8) !important;
        font-size: 0.7rem !important;
        font-weight: 500 !important;
        cursor: pointer;
        height: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        transition: color 0.15s;
    }
    .mobile-nav-item i {
        font-size: 1.25rem !important;
        line-height: 1;
    }
    /* Garantir que o label apareça (sobrescreve o .nav-item span { display: none } do sidebar) */
    .mobile-nav-item span,
    .mobile-bottom-nav .nav-item span {
        display: inline-block !important;
        white-space: nowrap !important;
        overflow: visible !important;
        font-size: 0.7rem !important;
        font-weight: 500 !important;
        line-height: 1.1 !important;
    }
    .mobile-nav-item.active {
        color: var(--primary, #f97316) !important;
    }
    .mobile-nav-item:active {
        opacity: 0.6;
    }

    /* FAB central laranja — clean, sem borda, só sombra dando o efeito flutuante */
    .mobile-nav-fab {
        width: 56px;
        height: 56px;
        margin: 0 auto;
        margin-top: -24px;
        border-radius: 50%;
        background: var(--primary, #f97316);
        color: #fff;
        border: none;
        outline: none;
        font-size: 1.4rem;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.15s, box-shadow 0.15s;
        padding: 0;
    }
    .mobile-nav-fab:focus-visible {
        box-shadow: 0 4px 12px rgba(249, 115, 22, 0.5), 0 0 0 3px rgba(249, 115, 22, 0.25);
    }
    .mobile-nav-fab:active {
        transform: scale(0.92);
    }
    .mobile-nav-fab.open {
        transform: rotate(45deg);
        background: #6b7280;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    }
    .mobile-nav-fab.open:active {
        transform: rotate(45deg) scale(0.92);
    }

    /* Quick Add Menu — 3 balões saem do FAB */
    .mobile-quick-add {
        position: fixed;
        inset: 0;
        z-index: 99;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        pointer-events: none;
    }
    .mobile-quick-add-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        transition: opacity 0.2s;
        pointer-events: auto;
    }
    .mobile-quick-add.open .mobile-quick-add-backdrop {
        opacity: 1;
    }
    .mobile-quick-add-options {
        position: relative;
        display: flex;
        gap: 1.25rem;
        padding-bottom: 100px; /* sobe acima do FAB (que tem ~32px de altura visível + margem) */
        pointer-events: none;
    }
    .quick-add-option {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.45rem;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        opacity: 0;
        transform: translateY(30px) scale(0.7);
        transition: opacity 0.2s ease-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        pointer-events: none;
    }
    .mobile-quick-add.open .quick-add-option {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }
    /* Stagger: receita primeiro, transferência meio, despesa por último */
    .mobile-quick-add.open .quick-add-option:nth-child(1) { transition-delay: 0.04s; }
    .mobile-quick-add.open .quick-add-option:nth-child(2) { transition-delay: 0.09s; }
    .mobile-quick-add.open .quick-add-option:nth-child(3) { transition-delay: 0.14s; }

    .quick-add-circle {
        width: 54px;
        height: 54px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        color: #fff;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }
    .quick-add-option.income .quick-add-circle {
        background: #22c55e;
    }
    .quick-add-option.expense .quick-add-circle {
        background: #ef4444;
    }
    .quick-add-option.transfer .quick-add-circle {
        background: #3b82f6;
    }
    .quick-add-label {
        font-size: 0.72rem;
        font-weight: 600;
        color: #fff;
        background: rgba(0, 0, 0, 0.55);
        padding: 0.22rem 0.65rem;
        border-radius: 999px;
        white-space: nowrap;
    }

    /* === Histórico SELIC: layout reorganizado pra mobile === */
    .selic-history-row {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "period change"
            "value  value"
            "meta   meta" !important;
        gap: 0.25rem 0.5rem !important;
        padding: 0.7rem 0.85rem !important;
        align-items: center !important;
    }
    .selic-history-period {
        grid-area: period;
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
        flex-wrap: wrap;
        min-width: 0;
    }
    .selic-history-range {
        font-size: 0.78rem !important;
        font-weight: 600;
    }
    .selic-history-period .rate-badge-active,
    .rate-badge-active {
        font-size: 0.55rem !important;
        padding: 0.12rem 0.4rem !important;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    .selic-history-value {
        grid-area: value;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        min-width: 0;
    }
    .selic-history-rate {
        font-size: 1.05rem !important;
        font-weight: 700;
        line-height: 1.2;
        color: var(--primary, #f97316);
    }
    .selic-history-meta {
        grid-area: meta;
        font-size: 0.7rem !important;
        opacity: 0.7;
        line-height: 1.3;
        margin-top: 0.1rem;
    }
    .selic-history-change {
        grid-area: change;
        align-self: start;
    }
    .selic-history-delta {
        font-size: 0.65rem !important;
        padding: 0.18rem 0.55rem !important;
    }

    /* === FIX K — Tela de Configurações compacta no mobile === */
    #settings .top-bar {
        margin-bottom: 0.75rem !important;
    }
    #settings .top-bar h1 {
        font-size: 1.2rem !important;
        margin: 0 !important;
        padding-left: 3rem !important;
    }
    #settings .settings-card {
        padding: 1rem !important;
        margin-top: 0.85rem !important;
        border-radius: 12px !important;
    }
    #settings .settings-card:first-of-type {
        margin-top: 0 !important;
    }
    #settings .settings-card h3 {
        font-size: 1rem !important;
        margin-bottom: 0.65rem !important;
    }
    #settings .settings-card p {
        font-size: 0.82rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.65rem !important;
    }
    /* Botões de backup/export compactos */
    #settings .settings-card .backup-actions {
        gap: 0.6rem !important;
        margin-top: 0.75rem !important;
    }
    #settings .settings-card .backup-actions .btn {
        padding: 0.65rem 0.85rem !important;
        font-size: 0.78rem !important;
        flex: 1 1 100%;
        min-width: 0;
        white-space: normal;
        line-height: 1.2;
    }
    #settings .settings-card .backup-actions .btn i {
        font-size: 0.85rem !important;
    }
    /* SELIC: input + botão lado a lado */
    #settings input[type="number"],
    #settings input[type="text"] {
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    #settings .btn-primary {
        padding: 0.55rem 0.9rem !important;
        font-size: 0.78rem !important;
    }
    /* Histórico SELIC card */
    #settings .selic-history-card,
    #settings [id*="selicHistory"] {
        padding: 0.85rem !important;
        font-size: 0.82rem !important;
    }
    /* Mensagens informativas (Histórico íntegro etc.) */
    #settings .info-message,
    #settings [class*="info"] {
        font-size: 0.78rem !important;
        padding: 0.65rem 0.85rem !important;
    }
    /* Zona de perigo — botões vermelhos compactos */
    #settings .settings-card[style*="rgba(239, 68, 68"] .btn,
    #settings .danger-zone .btn,
    #settings button[onclick*="clearData"],
    #settings button[onclick*="deleteAccount"] {
        padding: 0.65rem 0.85rem !important;
        font-size: 0.78rem !important;
        line-height: 1.2;
        white-space: normal;
    }
    /* Sub-cards dentro da zona de perigo */
    #settings .danger-zone-item {
        padding: 0.85rem !important;
    }
    #settings .danger-zone-item h4 {
        font-size: 0.92rem !important;
        margin-bottom: 0.4rem !important;
    }
    #settings .danger-zone-item p {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    /* Texto descritivo da SELIC */
    #settings .settings-card[id*="selic"] h3,
    #settings h3:has(+ p) {
        font-size: 1rem !important;
    }

    /* Botão "Personalizar" no mobile — só ícone, compacto, redondo */
    .btn-customize {
        padding: 0 !important;
        width: 36px !important;
        height: 36px !important;
        gap: 0 !important;
        border-width: 1.5px !important;
    }
    .btn-customize span {
        display: none !important;
    }
    .btn-customize i {
        font-size: 0.9rem !important;
        margin: 0 !important;
    }

    /* === Mobile Profile Button (avatar circular no canto superior esquerdo) === */
    .mobile-profile-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0.7rem;
        left: 0.7rem;
        width: 38px;
        height: 38px;
        background: var(--bg-card, #1a1a1a);
        border: 1.5px solid rgba(148, 163, 184, 0.3);
        border-radius: 50%;
        color: var(--text-muted, #94a3b8);
        cursor: pointer;
        z-index: 50;
        font-size: 0.95rem;
        padding: 0;
        transition: border-color 0.15s, background 0.15s;
    }
    .mobile-profile-btn:active {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--primary, #f97316);
    }
    /* Empurra os títulos das views pra direita pra não colidir com o avatar */
    .view .top-bar h1,
    .investments-header h1,
    #planning .top-bar h1 {
        padding-left: 3rem !important;
    }
    /* Header da página de transações também precisa do espaço */
    .transactions-header-bar .transactions-type-filter {
        padding-left: 3rem !important;
    }

    /* === Profile Sheet (compartilha estilos com .mobile-more-sheet) === */
    .mobile-profile-sheet[hidden] {
        display: none;
    }
    .mobile-profile-header {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.25rem 0.5rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        margin-bottom: 0.5rem;
    }
    .mobile-profile-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(249, 115, 22, 0.15);
        color: var(--primary, #f97316);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        flex-shrink: 0;
    }
    .mobile-profile-info {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        min-width: 0;
        flex: 1;
    }
    .mobile-profile-name {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-profile-email {
        font-size: 0.72rem;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-profile-signout {
        color: #ef4444 !important;
        margin-top: 0.25rem !important;
        padding-top: 0.85rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    }
    .mobile-profile-signout i {
        color: #ef4444 !important;
    }

    /* "Mais" bottom sheet */
    .mobile-more-sheet {
        position: fixed;
        inset: 0;
        z-index: 1100;
        display: flex;
        align-items: flex-end;
    }
    .mobile-more-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        transition: opacity 0.2s;
    }
    .mobile-more-sheet.open .mobile-more-backdrop {
        opacity: 1;
    }
    .mobile-more-panel {
        position: relative;
        width: 100%;
        background: var(--bg-card, #1a1a1a);
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
        padding: 0.75rem 1rem 1.5rem;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
        transform: translateY(100%);
        transition: transform 0.25s ease-out;
        max-height: 80vh;
        overflow-y: auto;
    }
    .mobile-more-sheet.open .mobile-more-panel {
        transform: translateY(0);
    }
    .mobile-more-handle {
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
        margin: 0 auto 0.75rem;
    }
    .mobile-more-title {
        font-size: 0.95rem;
        font-weight: 600;
        margin: 0 0 0.75rem;
        color: var(--text);
        text-align: center;
    }
    .mobile-more-item {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        width: 100%;
        padding: 0.85rem 0.5rem;
        background: transparent;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        color: var(--text);
        font-size: 0.95rem;
        cursor: pointer;
        text-align: left;
    }
    .mobile-more-item i {
        width: 24px;
        font-size: 1rem;
        color: var(--primary, #f97316);
        text-align: center;
    }
    .mobile-more-item:last-of-type {
        border-bottom: none;
    }
    .mobile-more-item:active {
        background: rgba(255, 255, 255, 0.05);
    }

    /* Toggle de tema (último item do "Mais opções") */
    .mobile-theme-toggle {
        margin-top: 0.25rem;
        padding-top: 1rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        position: relative;
    }
    .mobile-theme-switch {
        margin-left: auto;
        width: 38px;
        height: 22px;
        background: rgba(148, 163, 184, 0.3);
        border-radius: 999px;
        position: relative;
        flex-shrink: 0;
        transition: background 0.2s;
    }
    .mobile-theme-knob {
        position: absolute;
        top: 2px;
        left: 2px;
        width: 18px;
        height: 18px;
        background: #fff;
        border-radius: 50%;
        transition: transform 0.2s;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    .mobile-theme-switch.on {
        background: var(--primary, #f97316);
    }
    .mobile-theme-switch.on .mobile-theme-knob {
        transform: translateX(16px);
    }
}

/* ============================================================
   MOBILE TRANSACTIONS LIST — cards estilo Mobills (mobile only)
   No desktop fica escondido; o usuário continua vendo a tabela.
   ============================================================ */
.mobile-transactions-list {
    display: none;
    flex-direction: column;
    padding: 0 0.25rem;
}

.mobile-tx-group-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    padding: 1rem 0.25rem 0.5rem;
    letter-spacing: 0.01em;
}

.mobile-tx-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.15s;
}
.mobile-tx-card:active {
    background: rgba(255, 255, 255, 0.04);
}

.mobile-tx-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.mobile-tx-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.mobile-tx-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-tx-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-tx-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}
.mobile-tx-amount {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}
.mobile-tx-status {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    cursor: pointer;
    border: none;
}
.mobile-tx-status.paid {
    background: rgba(34, 197, 94, 0.18);
    color: #22c55e;
}
.mobile-tx-status.pending {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

.mobile-tx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.mobile-tx-empty i {
    font-size: 2rem;
    opacity: 0.3;
}

/* No mobile, esconde a tabela e mostra os cards */
@media (max-width: 768px) {
    .transactions-table-container {
        display: none !important;
    }
    .mobile-transactions-list {
        display: flex;
    }
}

/* ============================================================
   MOBILE FIXES — corrige bugs visuais em smartphones (Android/iOS)
   Adicionado para encaixar logo, donut, tooltips e tabelas em telas estreitas.
   ============================================================ */
@media (max-width: 768px) {

    /* === BUG 1 — Logo do sidebar muito grande sobrepondo o botão fechar === */
    .logo svg,
    .sidebar .logo svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    .sidebar.expanded .logo {
        padding-left: 3.5rem;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    .sidebar.expanded .logo-text {
        font-size: 1rem;
        white-space: nowrap;
    }

    /* === BUG 2 — Texto do donut chart transbordando do círculo interno === */
    body.device-smartphone .donut-total-value,
    .donut-total-value {
        font-size: 0.72rem !important;
        line-height: 1.1;
        white-space: nowrap;
        letter-spacing: -0.02em;
    }
    body.device-smartphone .donut-total-label,
    .donut-total-label {
        font-size: 0.58rem !important;
    }
    body.device-smartphone .chart-donut-large .donut-total-value,
    .chart-donut-large .donut-total-value {
        font-size: 0.82rem !important;
    }
    body.device-smartphone .chart-donut-large .donut-total-label,
    .chart-donut-large .donut-total-label {
        font-size: 0.62rem !important;
    }
    .donut-center-label {
        max-width: 70%;
        text-align: center;
        padding: 0 4px;
    }
    body.device-smartphone .donut-percent-label,
    .donut-percent-label {
        font-size: 0.62rem !important;
    }

    /* === Tirar a linha cinza acima do "VER MAIS" === */
    .chart-footer {
        border-top: none !important;
        padding-top: 0.75rem !important;
    }

    /* ============================================================
       FIX F — Investimentos / Contas Bancárias estilo Mobills
       Header compacto, summary em pills horizontais, cards 1 coluna.
       Aplica nas duas views (#investments e #bank-accounts) que
       compartilham as mesmas classes (.investments-header, .accounts-layout).
       ============================================================ */

    /* Header: H1 pequeno + botão compacto na mesma linha */
    .investments-header {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 0.5rem !important;
        margin-bottom: 0.85rem !important;
        align-items: center;
        padding: 0 0.25rem;
    }
    .investments-header h1 {
        font-size: 1.15rem !important;
        margin: 0 !important;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .investments-header .btn-primary {
        padding: 0.5rem 0.95rem !important;
        font-size: 0 !important; /* esconde o texto longo "Nova Conta de Investimento" */
        white-space: nowrap;
        line-height: 1 !important;
        min-width: 38px;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.4rem !important;
        height: auto;
    }
    .investments-header .btn-primary i {
        font-size: 0.85rem !important;
        line-height: 1 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    /* Mostra um label curto via pseudo-elemento — mesma baseline do ícone */
    .investments-header .btn-primary::after {
        content: "Nova";
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    /* Layout vira coluna única — summary em cima, cards embaixo.
       Importante: align-items: stretch faz os filhos esticarem na largura
       toda (sem isso, .accounts-grid encolhe pra ~80% da largura,
       desalinhando os cards de conta com as pílulas de summary). */
    .accounts-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        grid-template-columns: 1fr !important;
        width: 100%;
    }
    .accounts-grid,
    .accounts-summary-panel {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Summary panel: 3 pills horizontais empilhadas, mais compactas */
    .accounts-summary-panel {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        position: static !important;
        order: -1; /* aparece antes da grid de cards */
        width: 100%;
        padding: 0 !important;
    }
    .summary-pill {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.85rem !important;
        padding: 0.7rem 0.85rem !important;
        text-align: left !important;
        border-left: 3px solid transparent;
        /* Sobrescreve flex: 1 1 200px de @media query de tablets que joga
           o basis pra 200px no eixo principal (height em flex-column) */
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 0 !important;
    }
    .summary-pill--fixed {
        border-left-color: #f97316 !important;
    }
    .summary-pill--variable {
        border-left-color: #22c55e !important;
    }
    .summary-pill--total {
        border-left-color: #3b82f6 !important;
    }
    .summary-pill-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.95rem !important;
        flex-shrink: 0;
    }
    .summary-pill-body {
        flex: 1;
        display: flex !important;
        flex-direction: row !important;
        align-items: baseline;
        justify-content: space-between !important;
        gap: 0.5rem;
        min-width: 0;
    }
    .summary-pill-label {
        font-size: 0.78rem !important;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .summary-pill-value {
        font-size: 0.95rem !important;
        font-weight: 700;
        font-family: 'JetBrains Mono', monospace;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Cards de conta — coluna única, padding reduzido, ícone menor */
    .accounts-grid {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    /* Layout em GRID 2 COLUNAS:
       - Linha 1: HEADER (logo+nome)            STATS (Saldo, CDB, Taxa)
       - Linha 2: EARNINGS (rendimento)         STATS continua
       O menu (3 pontinhos) fica absolute no canto superior direito do card.
       --------------------------------------------------------------- */
    .account-card {
        display: grid !important;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        grid-template-areas:
            "header   stats"
            "earnings stats" !important;
        gap: 0.85rem 1rem !important;
        padding: 1rem 0.85rem 1rem 1rem !important;
        border-radius: 14px !important;
        position: relative;
        align-items: start;
    }

    .account-card .account-header {
        grid-area: header;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.65rem !important;
        margin: 0 !important;
        padding: 0 !important;
        padding-right: 1.75rem !important; /* reserva pro menu absolute */
    }
    .account-icon {
        width: 42px !important;
        height: 42px !important;
        font-size: 1rem !important;
        flex-shrink: 0;
        border-radius: 50% !important;
    }
    .account-info {
        flex: 1;
        min-width: 0;
    }
    .account-info h4 {
        font-size: 0.95rem !important;
        line-height: 1.2;
        margin: 0 !important;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .account-info .account-type {
        font-size: 0.7rem !important;
        opacity: 0.75;
    }
    .account-info .primary-badge {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.35rem !important;
    }

    /* Menu (3 pontinhos) absolute no canto superior direito — não ocupa espaço */
    .account-card .account-menu-container {
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        z-index: 2;
    }
    .account-menu-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.85rem !important;
        flex-shrink: 0;
        opacity: 0.6;
    }
    .account-menu-btn:active {
        opacity: 1;
    }

    /* Stats: 3 linhas empilhadas à direita, alinhadas à direita */
    .account-card .account-stats {
        grid-area: stats;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.55rem !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }
    .account-card .account-stat {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        text-align: right !important;
        gap: 0.05rem !important;
        width: 100%;
    }
    .account-card .account-stat .stat-label {
        font-size: 0.62rem !important;
        opacity: 0.65;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        font-weight: 600;
        line-height: 1;
    }
    .account-card .account-stat .stat-value {
        font-size: 0.95rem !important;
        font-weight: 700;
        font-family: 'JetBrains Mono', monospace;
        line-height: 1.15;
        white-space: nowrap;
    }

    /* Rendimento embaixo do logo — card destacado verde, simples */
    .account-card .account-earnings {
        grid-area: earnings;
        margin: 0 !important;
        padding: 0.65rem 0.85rem !important;
        background: rgba(34, 197, 94, 0.08) !important;
        border: 1px solid rgba(34, 197, 94, 0.22) !important;
        border-radius: 10px !important;
        align-self: start;
    }
    .account-card .account-earnings > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.15rem !important;
        justify-content: flex-start !important;
    }
    .account-card .account-earnings .rendimento-label,
    .account-card .account-earnings > div > span:first-child {
        font-size: 0.62rem !important;
        line-height: 1;
        letter-spacing: 0.02em;
    }
    .account-card .account-earnings > div > span:last-child {
        font-size: 1rem !important;
        line-height: 1.15;
        font-weight: 700;
        white-space: nowrap;
    }

    /* Holdings breakdown (renda variável) — full width abaixo, COLAPSADO por padrão.
       Toca no header pra expandir/recolher. Chevron rotaciona indicando estado. */
    .account-card .holdings-breakdown,
    .account-card .hb-table-wrapper {
        grid-column: 1 / -1;
    }
    .account-card .holdings-breakdown {
        position: relative;
    }
    .account-card .holdings-breakdown .hb-header {
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    /* Chevron à direita do label (depois do contador) */
    .account-card .holdings-breakdown .hb-header-label::after {
        content: '\f078'; /* fa-chevron-down */
        font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 0.65rem;
        margin-left: 0.45rem;
        opacity: 0.55;
        display: inline-block;
        transition: transform 0.25s ease;
    }
    .account-card .holdings-breakdown.expanded .hb-header-label::after {
        transform: rotate(180deg);
        opacity: 0.8;
    }
    /* Contador de itens "(3)" sutil */
    .account-card .holdings-breakdown .hb-count {
        opacity: 0.6;
        font-weight: 500;
        font-size: 0.85em;
    }
    /* Lista escondida por padrão no mobile */
    .account-card .holdings-breakdown .hb-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease;
        opacity: 0;
    }
    .account-card .holdings-breakdown.expanded .hb-list {
        max-height: 3000px;
        opacity: 1;
        transition: max-height 0.45s ease, opacity 0.25s ease 0.05s;
    }

    /* Empty state mais comportado */
    .accounts-grid .empty-state {
        padding: 2rem 1rem;
        font-size: 0.9rem;
        text-align: center;
        grid-column: 1 / -1;
    }

    /* ============================================================
       FIX G — Análises (cards de performance + projeção)
       Reduz perf-cards pra caberem na tela e esconde o gráfico
       gigante de Projeção de Patrimônio que não funciona em mobile.
       ============================================================ */

    /* Perf cards: STATUS DO MÊS, POUPANÇA, MÉDIA HISTÓRICA, etc. */
    .perf-card {
        padding: 0.75rem 2rem 0.75rem 0.85rem !important;
        gap: 0.7rem !important;
        border-radius: 12px;
    }
    .perf-card-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
        flex-shrink: 0;
    }
    .perf-card-label {
        font-size: 0.65rem !important;
        letter-spacing: 0.03em;
        line-height: 1.1;
    }
    .perf-card-value {
        font-size: 0.98rem !important;
        line-height: 1.15;
    }
    .perf-card-sub {
        font-size: 0.65rem !important;
        margin-top: 0.05rem !important;
        line-height: 1.2;
    }
    .perf-card .tooltip-trigger {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.55rem !important;
    }

    /* Reduz espaçamento entre os perf-cards */
    .performance-cards,
    .perf-cards-grid,
    .stats-grid {
        gap: 0.5rem !important;
    }

    /* Esconde a Projeção de Patrimônio no mobile — chart muito complexo
       (4 séries, 30+ pontos no eixo X, legenda larga) que vira mush em
       tela estreita. Permanece visível normalmente no web/desktop. */
    .chart-card.analytics-main-chart {
        display: none !important;
    }

    /* === FIX I — Balanço Mensal: barras à ESQUERDA, números à DIREITA ===
       Existe uma media query em 6532+ que joga isso pra coluna no mobile,
       fazendo as barras ficarem em cima dos números. Aqui forço de volta
       pra row com barras verticais à esquerda (yellow box) e detalhes
       à direita (numbers stack). */
    .balance-summary-card .balance-summary-content,
    body.device-smartphone .balance-summary-content {
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 1rem !important;
        padding: 0.75rem 0 !important;
    }
    .balance-summary-card .balance-bars,
    body.device-smartphone .balance-bars {
        flex-direction: row !important;
        align-items: flex-end !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        width: 70px !important;
        flex-shrink: 0 !important;
        height: 110px !important;
    }
    .balance-summary-card .balance-bar {
        width: 22px !important;
    }
    .balance-summary-card .balance-details {
        flex: 1 !important;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .balance-summary-card .balance-row {
        padding: 0.4rem 0 !important;
    }
    .balance-summary-card .balance-row.total {
        padding-top: 0.55rem !important;
        margin-top: 0.25rem !important;
    }
    .balance-summary-card .balance-label {
        font-size: 0.85rem !important;
    }
    .balance-summary-card .balance-value {
        font-size: 0.95rem !important;
    }

    /* === FIX J — Otimização das janelas da Dashboard (fontes menores, espaços reduzidos) === */

    /* Títulos de chart-card menores (Economia, Planejamento, Transações Recentes…) */
    .chart-card .chart-header h3,
    .chart-card-clean .chart-header h3,
    .chart-card h3 {
        font-size: 0.95rem !important;
        line-height: 1.2 !important;
    }
    .chart-card,
    .chart-card-clean {
        padding: 0.85rem !important;
    }
    .chart-card .chart-header,
    .chart-card-clean .chart-header {
        margin-bottom: 0.65rem !important;
    }

    /* === Economia Mensal — Layout horizontal: gauge esquerda + info direita === */
    .chart-card[data-widget="economia-mensal"] .savings-gauge-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        padding: 0.5rem 0 !important;
    }
    .chart-card[data-widget="economia-mensal"] .savings-gauge,
    .savings-gauge {
        width: 130px !important;
        height: 78px !important;
        flex-shrink: 0 !important;
    }
    .savings-gauge .gauge-value,
    .savings-gauge .gauge-percent,
    .savings-gauge-text,
    .savings-percent {
        font-size: 1.4rem !important;
        font-weight: 800 !important;
        bottom: 0 !important;
    }
    .chart-card[data-widget="economia-mensal"] .savings-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .savings-message {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
        text-align: left !important;
        color: var(--text-muted) !important;
        margin: 0 !important;
    }
    /* "Parabéns!" em destaque — fonte maior, peso bold, cor verde */
    .savings-message strong,
    .chart-card[data-widget="economia-mensal"] .savings-message strong {
        font-size: 1.15rem !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
        display: block !important;
        margin-bottom: 0.4rem !important;
        letter-spacing: -0.01em;
    }
    /* Linha decorativa abaixo do "Parabéns!" pra dar peso visual */
    .chart-card[data-widget="economia-mensal"] .savings-message strong::after {
        content: '';
        display: block;
        width: 28px;
        height: 2px;
        background: currentColor;
        opacity: 0.4;
        margin-top: 0.35rem;
        border-radius: 2px;
    }
    /* Tip abaixo, full width, mais sutil */
    .savings-tip,
    .savings-quote,
    .tip-card {
        padding: 0.55rem 0.75rem !important;
        font-size: 0.7rem !important;
        gap: 0.5rem !important;
        margin-top: 0.5rem !important;
        line-height: 1.3 !important;
    }
    .savings-tip i,
    .tip-card i {
        font-size: 0.85rem !important;
        flex-shrink: 0;
    }

    /* Planejamento mensal (card no dashboard) — ícone menor + valor menor */
    .planning-card-simple {
        padding: 0.85rem !important;
    }
    .planning-simple-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.95rem !important;
        flex-shrink: 0;
    }
    .planning-card-simple .planning-budget-value,
    .planning-card-simple .planning-total-value,
    .planning-card-simple .value {
        font-size: 1.1rem !important;
    }
    .planning-card-simple .planning-label,
    .planning-card-simple .label {
        font-size: 0.65rem !important;
    }
    .planning-card-simple .planning-progress-text,
    .planning-card-simple .planning-spent-info {
        font-size: 0.75rem !important;
    }

    /* Transações Recentes — itens compactos */
    .recent-transactions {
        padding: 0.85rem !important;
    }
    .recent-transactions-header h3 {
        font-size: 0.95rem !important;
    }
    .recent-transactions .transaction-list {
        gap: 0 !important;
    }
    .transaction-list li,
    .recent-transactions .transaction-list > li {
        padding: 0.55rem 0 !important;
        gap: 0.65rem !important;
    }
    .recent-transactions .transaction-list .transaction-icon,
    .recent-transactions .transaction-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
        flex-shrink: 0;
    }
    .recent-transactions .transaction-info .transaction-title,
    .recent-transactions .transaction-name,
    .recent-transactions .transaction-list strong {
        font-size: 0.85rem !important;
        font-weight: 600 !important;
    }
    .recent-transactions .transaction-info .transaction-meta,
    .recent-transactions .transaction-date,
    .recent-transactions .transaction-list small,
    .recent-transactions .transaction-subtitle {
        font-size: 0.68rem !important;
        line-height: 1.2;
    }
    .recent-transactions .transaction-amount,
    .recent-transactions .transaction-list .amount {
        font-size: 0.88rem !important;
        white-space: nowrap;
    }
    .recent-transactions-footer .ver-mais {
        font-size: 0.72rem !important;
    }
    .recent-transactions-header .view-all-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }

    /* "VER MAIS" geral — sutil */
    .ver-mais {
        font-size: 0.72rem !important;
        letter-spacing: 0.5px !important;
    }

    /* Charts (canvas) maxima altura compactada — pq containers ficaram mais
       baixos os charts não precisam ser tão altos */
    .chart-card canvas,
    .chart-card-clean canvas {
        max-height: 180px !important;
    }
    /* Donut charts tem outra altura controlada por classe específica */
    .chart-container-donut canvas,
    .chart-donut-large canvas {
        max-height: none !important;
    }
    /* Os controles de período de projeção (6m / 1ano / 2anos / etc. + período
       personalizado) só fazem sentido com o chart de projeção. Como ele tá
       escondido no mobile, esconde os controles também — sem função ali. */
    #analytics .analytics-filters {
        display: none !important;
    }

    /* === BUG 3 — "?" colidindo com seletor de período === */
    .chart-card,
    .stat-card {
        position: relative;
    }
    .chart-header {
        padding-right: 2.5rem !important;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }
    .chart-header h3 {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.95rem;
    }
    .chart-period-selector {
        max-width: 100%;
        flex-shrink: 1;
    }
    .period-dropdown-btn {
        font-size: 0.72rem;
        padding: 0.35rem 0.65rem;
    }
    .tooltip-trigger {
        z-index: 5;
    }

    /* === BUG 4/5 — Tabela de transações cortada e sem scroll horizontal === */
    .transactions-table-container {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .transactions-table-clean {
        min-width: 760px;
    }
    .transactions-table-clean th,
    .transactions-table-clean td {
        white-space: nowrap;
    }
    .transactions-table-clean .col-desc,
    .transactions-table-clean td:nth-child(3) {
        white-space: normal;
        min-width: 160px;
    }
    /* Indicação visual que dá pra rolar pra direita */
    .transactions-table-container::-webkit-scrollbar {
        height: 4px;
    }
    .transactions-table-container::-webkit-scrollbar-track {
        background: transparent;
    }
    .transactions-table-container::-webkit-scrollbar-thumb {
        background: rgba(249, 115, 22, 0.5);
        border-radius: 2px;
    }
}

/* ============================================================
   CATEGORY DETAIL MODAL — estilo Mobills (mobile)
   Conserta título sobreposto, layout em coluna única, ícones redondos.
   ============================================================ */
@media (max-width: 768px) {
    /* === Modal header — título não esmaga o X === */
    #categoryDetailModal .modal-header {
        gap: 0.75rem;
        align-items: flex-start;
    }
    #categoryDetailModal .modal-header h2,
    #categoryDetailTitle {
        font-size: 1.15rem !important;
        line-height: 1.3;
        flex: 1 1 auto;
        min-width: 0;
        word-break: normal;
        margin: 0;
    }
    #categoryDetailModal .close-btn {
        flex-shrink: 0;
        font-size: 1.4rem;
        padding: 0;
        margin: 0;
        line-height: 1;
    }

    /* === Grid vira coluna única no mobile (chart em cima, lista embaixo) === */
    .category-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .category-chart-container {
        max-width: 240px !important;
        margin: 0.5rem auto 0 !important;
    }
    .category-total .total-value {
        font-size: 1.15rem !important;
    }
    .category-total .total-label {
        font-size: 0.7rem !important;
    }
    .category-list-container h4 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        margin-top: 0.5rem;
    }
    .category-detail-list {
        max-height: none !important;
    }

    /* === Ícones de categoria redondos com cor sólida (estilo Mobills) === */
    .category-icon-wrapper {
        border-radius: 50% !important;
        width: 42px !important;
        height: 42px !important;
        font-size: 1rem !important;
        background: var(--cat-color, #64748b) !important;
        color: #fff !important;
    }
    .category-detail-item {
        padding: 0.75rem 0.5rem !important;
        gap: 0.85rem !important;
    }
    .category-item-name {
        font-size: 0.95rem;
    }

    /* === Tooltip "?" mais discreto (Mobills usa "?" menor sem borda chamativa) === */
    .tooltip-trigger {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.55rem !important;
        border-width: 1px !important;
        background: transparent !important;
        opacity: 0.35;
        top: 6px !important;
        right: 6px !important;
    }
    .tooltip-trigger:active {
        opacity: 1;
    }

    /* === FIX H — Stat cards do Dashboard mais compactos === */
    .stats-grid {
        gap: 0.5rem !important;
        margin-bottom: 1rem !important;
    }
    .stat-card {
        padding: 0.75rem 0.85rem !important;
        gap: 0.5rem !important;
        border-radius: 12px !important;
    }
    .stat-card .icon-wrapper {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
        border-radius: 8px !important;
    }
    .stat-card .stat-info {
        gap: 0.1rem !important;
    }
    .stat-card .stat-info h3 {
        font-size: 0.58rem !important;
        letter-spacing: 0.08em !important;
        line-height: 1.1;
        font-weight: 700;
    }
    .stat-card .stat-info .value {
        font-size: 0.92rem !important;
        line-height: 1.2;
        font-weight: 700;
    }
    /* Sub-info dos stat-cards (ex: "Última atualização", trends) menor */
    .stat-card .stat-trend,
    .stat-card .trend,
    .stat-card .stat-sub {
        font-size: 0.62rem !important;
    }

    /* === Month navigator dentro do modal — mais compacto === */
    #categoryDetailModal .month-navigator {
        margin-bottom: 0.75rem;
    }
    #categoryDetailModal .current-month {
        font-size: 0.95rem;
    }

    /* === Padding interno do modal mais enxuto no celular === */
    #categoryDetailModal .modal-content,
    body.device-smartphone #categoryDetailModal .modal-content {
        padding: 1.25rem 1rem !important;
        overflow-y: auto !important;
    }
    #categoryDetailModal .modal-header {
        margin-bottom: 1rem;
    }

    /* ============================================================
       FIX D — Header da página de Transações estilo Mobills
       Linha 1: [Transações ▾]  →  [🔍 🔻 ⋮]
       Linha 2:        < Abril >
       ============================================================ */
    .transactions-header-bar {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "title actions"
            "month month" !important;
        gap: 0.5rem 0.75rem !important;
        padding: 0.6rem 0.5rem !important;
        align-items: center;
    }
    .transactions-type-filter {
        grid-area: title;
        display: flex;
        align-items: center;
        position: relative;
        gap: 0;
        /* Reset do estilo desktop (pílula segmentada branca) — no mobile só tem o
           dropdown, então o wrapper precisa ser invisível pra não criar uma
           "faixa branca" feia atrás do select */
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    /* Esconde os 3 pill buttons no mobile (sobra só o dropdown) */
    .transactions-type-filter .type-filter-btn {
        display: none !important;
    }
    .transactions-header-actions {
        grid-area: actions;
        display: flex !important;
        align-items: center;
        gap: 0.25rem;
    }
    .transactions-header-actions .btn-icon-clean {
        width: 38px;
        height: 38px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }
    .month-nav {
        grid-area: month;
        justify-content: center !important;
    }
    .month-nav .current-month-label {
        font-size: 1rem;
    }

    /* ============================================================
       FIX E — Página Planejamento estilo Mobills (mobile)
       Header compacto, mês centralizado, tabela vira cards verticais.
       ============================================================ */
    #planning .top-bar {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        align-items: center !important;
        margin-bottom: 0.5rem !important;
    }
    #planning .top-bar h1 {
        font-size: 1.1rem !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #planning .top-bar .btn-primary {
        padding: 0.5rem 0.95rem !important;
        font-size: 0 !important; /* esconde "Novo Orçamento" longo */
        white-space: nowrap;
        line-height: 1 !important;
        min-width: 38px;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.4rem !important;
        height: auto;
    }
    #planning .top-bar .btn-primary i {
        font-size: 0.85rem !important;
        line-height: 1 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    #planning .top-bar .btn-primary::after {
        content: "Novo";
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    /* Month navigator centralizado */
    #planning .planning-month-nav {
        justify-content: center !important;
        margin: 0.25rem 0 1rem !important;
        gap: 1rem;
    }
    #planning .planning-current-month {
        font-size: 1rem;
        font-weight: 600;
    }

    /* Summary card "Restam" — fonte do valor mais comportada */
    #planning .planning-overview-card {
        padding: 1rem 0.75rem !important;
    }
    #planning .planning-overview-card .overview-value {
        font-size: 1.35rem !important;
        word-break: break-word;
    }
    #planning .planning-overview-card .overview-label {
        font-size: 0.85rem;
    }
    #planning .planning-overview-card .overview-detail {
        font-size: 0.72rem;
    }
    /* Progress legend (1388.7% / 0.0%) menor */
    #planning .planning-overview-progress .progress-legend {
        font-size: 0.7rem !important;
        gap: 0.85rem !important;
    }

    /* Layout do planning: força a coluna do grid a aceitar shrink (sem isso,
       a coluna 1fr sizing-to-content fica 500px porque algum child interno
       tem min-content largo, e empurra tudo pra fora da viewport) */
    #planning .planning-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: 100% !important;
    }
    #planning .planning-main,
    #planning .planning-main > * {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    #planning .planning-overview-card {
        width: auto !important;
    }

    /* Sidebar com 4 stats — 2 colunas iguais, sem overflow horizontal.
       A regra @media 1100px joga em row com min-width 200px → 4×200=800px
       não cabe em 414px. Aqui forço grid 2×2 sem min-width. */
    #planning .planning-sidebar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        flex-direction: unset !important;
    }
    #planning .planning-stat-card {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        padding: 0.7rem 0.85rem !important;
        position: relative;
    }
    #planning .planning-stat-card .stat-label {
        font-size: 0.65rem !important;
        line-height: 1.2;
    }
    #planning .planning-stat-card .stat-value {
        font-size: 0.95rem !important;
        line-height: 1.2;
        word-break: break-word;
    }
    #planning .planning-stat-card i {
        font-size: 0.8rem !important;
        opacity: 0.6;
    }

    /* Tabela de orçamentos vira stack vertical (estilo cards) */
    #planning .budgets-table-container {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        overflow: visible !important; /* override do overflow:hidden que cortava as ações */
    }
    /* Override do min-width: 500px da regra `body.device-smartphone table`
       (linha 8022 do style.css) que era pra tabelas roláveis e estava
       forçando a budgets-table a 500px de largura, jogando ações pra
       fora da viewport. */
    #planning .budgets-table,
    body.device-smartphone #planning .budgets-table {
        min-width: 0 !important;
    }
    #planning .budgets-table,
    #planning .budgets-table tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    #planning .budgets-table thead {
        display: none !important;
    }
    #planning .budgets-table tr {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem 0.5rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        box-sizing: border-box !important;
    }
    #planning .budgets-table td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.2rem 0 !important;
        border: none !important;
        box-sizing: border-box !important;
    }
    /* Categoria (icon + nome) — primeiro */
    #planning .budgets-table td:nth-child(1) {
        margin-bottom: 0.5rem !important;
    }
    /* Esconde colunas redundantes (Meta, Pago, Total — info já tá no progresso) */
    #planning .budgets-table td:nth-child(2),
    #planning .budgets-table td:nth-child(3),
    #planning .budgets-table td:nth-child(4) {
        display: none !important;
    }
    /* Progresso ocupa toda largura */
    #planning .budgets-table td:nth-child(5) {
        margin-top: 0.25rem !important;
    }
    /* Actions (Editar/Excluir) — posicionadas no canto SUPERIOR DIREITO
       do card (próximo ao nome da categoria), em tamanho compacto. */
    #planning .budgets-table tr {
        position: relative !important; /* anchor pros botões absolute */
    }
    #planning .budgets-table td:nth-child(6) {
        position: absolute !important;
        top: 0.85rem !important;
        right: 0.5rem !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 2;
    }
    #planning .budget-table-actions {
        display: flex !important;
        justify-content: flex-end !important;
        gap: 0.4rem !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    #planning .budget-table-actions button {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 0.75rem !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 6px !important;
        color: var(--text) !important;
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
    }
    #planning .budget-table-actions button:active {
        background: rgba(255, 255, 255, 0.12) !important;
    }
    /* Reserva espaço no header da categoria pra não cobrir o nome longo */
    #planning .budgets-table td:nth-child(1) {
        padding-right: 75px !important;
    }
    /* Botão de excluir com leve tint vermelho pra destacar perigo */
    #planning .budget-table-actions button[onclick*="delete"] {
        color: #ef4444 !important;
        background: rgba(239, 68, 68, 0.08) !important;
        border-color: rgba(239, 68, 68, 0.18) !important;
    }
    #planning .budget-table-actions button[onclick*="delete"]:active {
        background: rgba(239, 68, 68, 0.18) !important;
    }
    /* Botão editar com tint laranja sutil */
    #planning .budget-table-actions button[onclick*="openBudget"] {
        color: var(--primary, #f97316) !important;
        background: rgba(249, 115, 22, 0.08) !important;
        border-color: rgba(249, 115, 22, 0.18) !important;
    }
    #planning .budget-table-actions button[onclick*="openBudget"]:active {
        background: rgba(249, 115, 22, 0.18) !important;
    }

    /* Ícone da categoria — círculo (estilo Mobills) */
    #planning .budget-table-icon {
        border-radius: 50% !important;
        width: 42px !important;
        height: 42px !important;
        flex-shrink: 0;
    }
    #planning .budget-table-category {
        gap: 0.85rem !important;
        align-items: center !important;
    }
    #planning .budget-table-category > span {
        font-size: 1rem !important;
        font-weight: 600 !important;
    }

    /* Texto de progresso (Restam R$X | X%) */
    #planning .budget-table-progress-text {
        font-size: 0.85rem !important;
        margin-top: 0.4rem;
    }
    #planning .budget-table-progress-bar {
        height: 8px !important;
    }

    /* Sub-linha "R$gasto de R$limite" — só aparece no mobile */
    .budget-mobile-amounts {
        display: block !important;
        font-size: 0.72rem !important;
        color: var(--text-muted) !important;
        margin-top: 0.25rem !important;
    }

    /* Pill estilo Clyro — borda laranja, texto laranja, chevron laranja
       (mesma linguagem visual da pílula "Abril de 2026" abaixo) */
    .mobile-type-select {
        display: block !important;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-color: transparent;
        border: 1.5px solid var(--primary, #f97316);
        border-radius: 999px;
        padding: 0.45rem 2.2rem 0.45rem 1rem;
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--primary, #f97316);
        cursor: pointer;
        font-family: inherit;
        outline: none;
        max-width: 100%;
        line-height: 1.2;
        letter-spacing: 0.01em;
        background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23f97316' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.7rem center;
        background-size: 12px 12px;
        transition: background-color 0.15s, border-color 0.15s;
    }
    .mobile-type-select:hover,
    .mobile-type-select:focus {
        background-color: rgba(249, 115, 22, 0.08);
    }
    .mobile-type-select:active {
        background-color: rgba(249, 115, 22, 0.15);
    }
    .mobile-type-select option {
        background: #1a1a1a;
        color: #fff;
        font-size: 0.95rem;
        font-weight: 500;
    }
}

/* No desktop o dropdown mobile fica escondido — sai da camada visual */
.mobile-type-select {
    display: none;
}

/* No desktop, a sub-linha mobile "R$gasto de R$limite" fica oculta (a tabela já mostra) */
.budget-mobile-amounts {
    display: none;
}

    /* ============================================================
       FIX A — esconder TODOS os botões de menu hambúrguer no mobile
       Existem 2 botões diferentes:
         - .sidebar-toggle (id #sidebarToggle, dentro do sidebar)
         - .mobile-menu-btn (id #mobileMenuBtn, fora do sidebar — esse era
           o que continuava aparecendo no Dashboard).
       Como agora a barra inferior (.mobile-bottom-nav) é a navegação
       principal, ambos os hambúrgueres ficam inúteis no mobile.
       ============================================================ */
    .sidebar-toggle,
    .mobile-menu-btn,
    #sidebarToggle,
    #mobileMenuBtn,
    body.device-smartphone .sidebar-toggle,
    body.device-smartphone .mobile-menu-btn,
    body.device-smartphone .sidebar.mobile-open + .sidebar-toggle,
    body.device-smartphone .sidebar.mobile-open .sidebar-toggle {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    /* Overlay que escurece a tela quando o sidebar mobile abria — também desliga */
    .mobile-sidebar-overlay,
    #mobileSidebarOverlay {
        display: none !important;
        pointer-events: none !important;
    }

    /* ============================================================
       FIX B — Modal de Nova Despesa/Receita compacto no mobile
       Reduz padding, margins, fonts e gap pra caber sem rolar tanto.
       ============================================================ */
    #transactionModal .modal-content,
    body.device-smartphone #transactionModal .modal-content {
        padding: 1rem 0.875rem !important;
    }
    #transactionModal .modal-header {
        margin-bottom: 0.5rem !important;
    }
    #transactionModal .modal-header h2 {
        font-size: 1.15rem !important;
    }
    #transactionModal .modal-form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }
    #transactionModal .form-column {
        gap: 0.55rem !important;
    }
    #transactionModal .form-group {
        margin-bottom: 0.5rem !important;
    }
    #transactionModal .form-group label {
        font-size: 0.78rem !important;
        margin-bottom: 0.2rem !important;
    }
    #transactionModal .form-group input,
    #transactionModal .form-group select,
    #transactionModal .form-group textarea,
    #transactionModal .custom-select-trigger {
        padding: 0.55rem 0.75rem !important;
        font-size: 0.95rem !important;
    }
    /* Botões de data (Hoje/Ontem/Outros…) mais compactos */
    #transactionModal .date-quick-buttons,
    #transactionModal .quick-date-options {
        gap: 0.4rem !important;
    }
    #transactionModal .date-quick-buttons button,
    #transactionModal .quick-date-btn {
        padding: 0.5rem 0.9rem !important;
        font-size: 0.85rem !important;
    }
    /* Observação não precisa ser tão alta */
    #transactionModal textarea {
        min-height: 50px !important;
    }
    /* Toggles de "Foi paga", "Despesa fixa", "Repetir" */
    #transactionModal .toggle-row,
    #transactionModal .toggle-group,
    #transactionModal label.toggle-label {
        margin-bottom: 0.35rem !important;
        padding: 0.35rem 0 !important;
    }
    /* Valor input grande */
    #transactionModal .value-input,
    #transactionModal #transactionAmount {
        font-size: 1.5rem !important;
    }

    /* ============================================================
       FIX C — "Mais opções": ícone à esquerda + nome ao lado
       O .mobile-more-item herda nav-item (que esconde span e centraliza).
       Reverte aqui pra ficar com layout horizontal label-visible.
       ============================================================ */
    .mobile-more-item {
        justify-content: flex-start !important;
        width: 100% !important;
        text-align: left !important;
    }
    .mobile-more-item span {
        display: inline !important;
        white-space: normal !important;
        overflow: visible !important;
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        color: var(--text) !important;
    }
    .mobile-more-item i {
        flex-shrink: 0;
        width: 28px !important;
        text-align: center;
    }
}


