:root {
    --bg-main: #0b1108;
    --bg-surface: #263e30;
    --bg-card: #1c2118;
    --bg-list-item: #181c15;

    --text-primary: #ffffff;
    --text-secondary: #8b998d;
    --text-light-green: #9ae2b8;

    --accent-red: #ea4335;
    --accent-yellow: #fbbc05;
    --accent-blue: #4285f4;
    --accent-green: #34a853;
    --neon-green: #39ff14;
    --neon-green-light: #6aff5c;

    --fab-color: #fabf15;

    --font-family: 'Inter', sans-serif;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100vw;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

button {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.icon-btn.small {
    font-size: 1.25rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning i {
    animation: spin 1s linear infinite;
}


/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background-color: var(--bg-surface);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.5);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 2.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h2 {
    font-size: 1.15rem;
    font-weight: 500;
}

.user-info p {
    font-size: 0.9rem;
    color: #a4b4ab;
    margin-top: 0.3rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.9rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.nav-item i {
    font-size: 1.3rem;
    color: #a4b4ab;
    width: 24px;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.sidebar-footer {
    padding: 1.5rem;
    font-size: 0.85rem;
    color: #a4b4ab;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--bg-surface);
    overflow: hidden;
    min-height: 0;
    min-width: 0;
}

/* Top Header */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1rem 1rem;
}

.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.total-amount {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 0.3rem;
}

/* Main Tabs */
.main-tabs {
    display: flex;
    justify-content: space-around;
    padding: 0;
}

.tab-btn {
    flex: 1;
    padding: 1rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s;
}

.tab-btn.active {
    color: var(--text-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    right: 10%;
    height: 3px;
    background-color: var(--text-light-green);
    border-radius: 3px 3px 0 0;
}

/* Content Area */
.content-area,
#accounts-area,
#categories-area,
#regular-payments-area,
#charts-area,
#fechamento-area,
#seguranca-area,
#goals-area {
    flex: 1 1 0%;
    background-color: var(--bg-main);
    border-radius: 20px 20px 0 0;
    padding: 1rem 1.2rem;
    padding-bottom: 80px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    display: block;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
}

.content-area > *,
#accounts-area > *,
#categories-area > *,
#regular-payments-area > *,
#charts-area > *,
#fechamento-area > *,
#seguranca-area > *,
#goals-area > * {
    margin-bottom: 1.2rem;
}

.content-area > *:last-child,
#accounts-area > *:last-child,
#categories-area > *:last-child,
#regular-payments-area > *:last-child,
#charts-area > *:last-child,
#fechamento-area > *:last-child,
#seguranca-area > *:last-child,
#goals-area > *:last-child {
    margin-bottom: 0;
}

/* Period Tabs */
.period-tabs {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem 0.5rem;
    color: var(--text-secondary);
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding-bottom: 0.2rem;
    cursor: pointer;
}

.period-btn.active {
    color: var(--text-light-green);
}

/* Date Selector */
.date-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
}

.current-date {
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 4px;
    flex: 1;
    text-align: center;
}

.date-right-controls {
    display: flex;
    gap: 0.5rem;
}

/* Horizontal Progress Bar Section */
.chart-section-horizontal {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

.progress-bar-container {
    display: flex;
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.progress-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.chart-bottom-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chart-total-value {
    font-size: 1.4rem;
    font-weight: 600;
}

/* FAB */
.fab-btn {
    position: absolute;
    bottom: -20px;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: var(--fab-color);
    color: #263e30;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(250, 191, 21, 0.5);
    transition: transform 0.2s;
    z-index: 10;
}

.fab-btn:hover {
    transform: scale(1.05);
}

.fab-btn-inline {
    position: absolute;
    right: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(250, 191, 21, 0.3);
    transition: transform 0.2s;
}

.fab-btn-inline:active {
    transform: scale(0.95);
}

/* List Section */
.list-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-bottom: 30px;
}

.list-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-list-item);
    padding: 1rem;
    border-radius: 12px;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Accounts Area */
.account-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary);
    transition: transform 0.2s;
}

.account-card:hover {
    transform: translateY(-2px);
}

.account-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.account-info p {
    margin: 0;
    margin-top: 5px;
    font-size: 1.2rem;
    font-weight: 700;
}

.account-actions {
    display: flex;
    gap: 8px;
}

.modal-acc-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.modal-acc-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-acc-item .acc-color-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.item-left {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

/* Icon Selector Grid */
.icon-option {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.icon-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-option.active {
    border-color: var(--primary);
    background: rgba(250, 191, 21, 0.1);
    color: var(--primary);
}

/* Checkbox Label in Modals */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.item-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.item-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    text-align: right;
}

.item-percentage {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.item-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.item-value {
    font-size: 1rem;
    font-weight: 600;
}

.item-subvalue {
    font-size: 0.75rem;
    color: var(--accent-red);
    margin-top: 2px;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================= */
/* MODAL ADICIONAR TRANSAÇÃO (FUTURISTA AI)  */
/* ========================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    pointer-events: none;
}

.modal.active {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: radial-gradient(circle at 50% 0%, #152b1e 0%, var(--bg-main) 70%);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.neon-glow {
    color: var(--text-light-green);
    text-shadow: 0 0 8px rgba(154, 226, 184, 0.6);
}

.neon-text {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #fff;
}

/* Neon Tabs */
.neon-tabs {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.3rem;
    margin-bottom: 0.5rem;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.neon-tabs .tab-btn {
    border-radius: 8px;
    padding: 0.8rem 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.neon-tabs .tab-btn.active {
    background: var(--bg-surface);
    color: var(--text-light-green);
    text-shadow: 0 0 10px rgba(154, 226, 184, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.neon-tabs .tab-btn.active::after {
    display: none;
}

/* Cyber Inputs */
.cyber-input-group {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(154, 226, 184, 0.2);
}

.cyber-input {
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-family: var(--font-family);
}

.amount-input {
    font-size: 3rem;
    font-weight: 700;
    text-align: right;
    width: 60%;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.amount-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.currency-label {
    font-size: 1.2rem;
    font-weight: 600;
}

.neon-green-text {
    color: var(--text-light-green);
    text-shadow: 0 0 8px rgba(154, 226, 184, 0.4);
}

.cyber-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cyber-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cursor-pointer {
    cursor: pointer;
}

/* Categories Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    text-align: center;
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.cat-item:hover {
    transform: scale(1.05);
}

.cat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
}

.cat-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cat-item.active .cat-icon {
    border-color: #fff;
    box-shadow: 0 0 15px currentColor;
}

.cat-item.active span {
    color: #fff;
    font-weight: 600;
}

.uploader-style {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: var(--text-secondary);
}

/* Date Boxes */
.date-boxes {
    display: flex;
    gap: 0.8rem;
}

.date-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.date-box span:first-child {
    font-weight: 600;
    font-size: 1rem;
}

.date-box span:last-child {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.date-box.active {
    background: rgba(154, 226, 184, 0.1);
    border-color: var(--text-light-green);
    color: var(--text-light-green);
    text-shadow: 0 0 5px rgba(154, 226, 184, 0.5);
}

.date-section {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* Input Line */
.line-input {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.line-input:focus {
    border-color: var(--text-light-green);
    box-shadow: 0 1px 0 var(--text-light-green);
}

/* Photo Upload */
.photo-upload-grid {
    display: flex;
    gap: 1rem;
}

.photo-box {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.photo-box:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Action Footer */
.action-footer {
    margin-top: auto;
    padding-top: 1.5rem;
}

.cyber-btn {
    width: 100%;
    padding: 1.2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-glow {
    background: var(--fab-color);
    color: var(--bg-main);
    box-shadow: 0 0 20px rgba(250, 191, 21, 0.4);
    transition: all 0.3s;
}

.primary-glow:active {
    transform: scale(0.98);
    box-shadow: 0 0 30px rgba(250, 191, 21, 0.6);
}

/* Date Input (Native) Styling */
.neon-date {
    color: var(--text-light-green);
    font-size: 1.1rem;
    padding: 0.8rem 0;
    text-transform: uppercase;
    font-weight: 600;
}

.neon-date::-webkit-calendar-picker-indicator {
    filter: invert(0.8) sepia(1) saturate(5) hue-rotate(90deg);
    cursor: pointer;
}

/* Sub-Modal (Category Creator) */
.sub-modal {
    z-index: 2000;
    background-color: rgba(11, 17, 8, 0.95);
    backdrop-filter: blur(10px);
}

.color-picker-input {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-input::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* Custom Period Date Pickers */
.custom-period-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-top: -0.5rem;
    animation: fadeIn 0.3s ease;
}

.small-date {
    font-size: 0.9rem;
    padding: 0.4rem;
    border-bottom: 1px solid var(--text-secondary);
    width: 35%;
}

.small-date::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   KPI DASHBOARD CARDS
   ========================================== */
.kpi-dashboard {
    padding: 0 1rem 0.5rem;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.kpi-period-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 4px;
    gap: 8px;
}

.kpi-period-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 3px;
}

.kpi-period-btn {
    padding: 4px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-period-btn.active {
    background: var(--neon-green);
    color: #0b1120;
}

.kpi-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-period-label {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
}

.kpi-title {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-cards-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    padding-top: 70px;
    margin-top: -70px;
    scrollbar-width: none;
}

.kpi-cards-scroll::-webkit-scrollbar {
    display: none;
}

.kpi-card {
    min-width: 170px;
    max-width: 170px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.02);
    scroll-snap-align: start;
    position: relative;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: kpiSlideIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.kpi-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 150, 255, 0.15), inset 0 0 10px rgba(255, 255, 255, 0.05);
    /* Added slight neon blue tint on hover */
    border-color: rgba(255, 255, 255, 0.3);
}

.kpi-card .kpi-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
    z-index: 2;
}

.kpi-sparkline-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 25px;
    width: 45px;
    margin-bottom: 2px;
}

.kpi-spark-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    animation: sparkPulse 2s infinite alternate ease-in-out;
}

@keyframes sparkPulse {
    0% {
        transform: scaleY(0.7);
    }

    100% {
        transform: scaleY(1.1);
    }
}

.kpi-card .kpi-icon {
    font-size: 1.1rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.kpi-card .kpi-label {
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-card .kpi-value {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 50px);
}

.kpi-card .kpi-sub {
    color: var(--text-secondary);
    font-size: 0.65rem;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-card .kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.kpi-badge.up {
    background: rgba(52, 168, 83, 0.15);
    color: #34a853;
}

.kpi-badge.down {
    background: rgba(234, 67, 53, 0.15);
    color: #ea4335;
}

.kpi-badge.neutral {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

@keyframes kpiSlideIn {
    from {
        opacity: 0;
        transform: translateX(15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* KPI Config Toggle Items */
.kpi-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
}

.kpi-toggle-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.kpi-toggle-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kpi-toggle-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
}

.kpi-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-toggle-name {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
}

.kpi-toggle-desc {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

/* Mini Toggle Switch */
.kpi-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.kpi-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.kpi-switch .kpi-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: 0.3s;
}

.kpi-switch .kpi-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #555;
    border-radius: 50%;
    transition: 0.3s;
}

.kpi-switch input:checked+.kpi-slider {
    background: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
}

.kpi-switch input:checked+.kpi-slider:before {
    transform: translateX(20px);
    background: #0b1120;
}

/* KPI Tooltip */
.kpi-info-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.kpi-info-btn:hover {
    opacity: 1;
}

.kpi-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2333;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    min-width: 180px;
    max-width: 220px;
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
    pointer-events: none;
}

.kpi-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #1a2333;
}

.kpi-card:hover .kpi-tooltip,
.kpi-card.tooltip-active .kpi-tooltip {
    display: block;
}

/* ==========================================
   CATEGORY GROUP ACCORDION
   ========================================== */
.cat-group {
    margin-bottom: 2px;
}

.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.cat-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cat-header-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cat-header-name {
    color: var(--text-light);
    font-size: 0.92rem;
    font-weight: 600;
}

.cat-header-count {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.cat-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-header-total {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 700;
}

.cat-chevron {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.cat-items {
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    margin-left: 32px;
    padding-left: 4px;
}

.cat-child {
    padding: 8px 12px 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cat-child:last-child {
    border-bottom: none;
}

/* ========================================= */
/* TOAST NOTIFICATIONS (SNACKBARS)          */
/* ========================================= */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.cyber-toast {
    min-width: 250px;
    max-width: 350px;
    padding: 16px 20px;
    border-radius: 8px;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-left: 4px solid var(--text-secondary);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.cyber-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.cyber-toast.toast-success {
    border-left-color: var(--neon-green);
    box-shadow: 0 5px 15px rgba(0, 255, 102, 0.15);
}

.cyber-toast.toast-error {
    border-left-color: #ff3366;
    box-shadow: 0 5px 15px rgba(255, 51, 102, 0.15);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 1.3rem;
}

.toast-success .toast-icon {
    color: var(--neon-green);
}

.toast-error .toast-icon {
    color: #ff3366;
}

/* Global FAB Button */
.fab-global, .fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--neon-green);
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4), 0 0 40px rgba(57, 255, 20, 0.2);
    z-index: 1000;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

.fab-global:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--neon-green-light);
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.6), 0 0 60px rgba(57, 255, 20, 0.3);
}

/* ========================================= */
/* ÁREA DE FECHAMENTO MENSAL                 */
/* ========================================= */

#fechamento-area {
    animation: fadeIn 0.4s ease-out;
}

.fechamento-panel {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.kpi-box {
    transition: transform 0.2s ease;
}

.kpi-box:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05) !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#fechamento-month-label {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    min-width: 160px;
}

.fechamento-forecast h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

/* ========================================= */
/* ANIMATIONS & TRANSITIONS (Fase 6, Item 3) */
/* ========================================= */

@keyframes sectionFadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.section-animate {
    animation: sectionFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    /* overflow: hidden removed - was blocking scroll on content areas */
}

/* scanline effect during transition */
.section-animate::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, var(--neon-green), transparent);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: scanline 0.5s linear forwards;
}

@keyframes scanline {
    0% { top: 0; opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ========================================= */
/* SISTEMA DE METAS & OBJETIVOS              */
/* ========================================= */

#nav-metas i {
    color: var(--neon-cyan);
}

.goal-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.goal-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 243, 255, 0.3);
    transform: translateY(-2px);
}

.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.goal-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.badge-expense { background: rgba(234, 67, 53, 0.2); color: #ea4335; border: 1px solid rgba(234, 67, 53, 0.3); }
.badge-savings { background: rgba(0, 243, 255, 0.2); color: #00f3ff; border: 1px solid rgba(0, 243, 255, 0.3); }

.goal-progress-container {
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-neon {
    height: 100%;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.bar-safe { background: var(--neon-green); box-shadow: 0 0 10px var(--neon-green); }
.bar-warning { background: #fbbc05; box-shadow: 0 0 10px #fbbc05; }
.bar-danger { background: #ea4335; box-shadow: 0 0 10px #ea4335; }
.bar-savings { background: #00f3ff; box-shadow: 0 0 10px #00f3ff; }

.goal-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Featured Mini Card for Dashboard */
.goal-mini-card {
    min-width: 140px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    flex-shrink: 0;
}

/* Glitch Effect */
.glitch-effect {
    animation: glitch-color 0.4s infinite;
}

@keyframes glitch-color {
    0% { border-color: #ea4335; box-shadow: 2px 0 0 #ff00ff, -2px 0 0 #00ffff; }
    25% { border-color: #ff00ff; box-shadow: -2px 0 0 #ff00ff, 2px 0 0 #00ffff; }
    50% { border-color: #ea4335; box-shadow: 1px 0 0 #ff00ff, -1px 0 0 #00ffff; }
    75% { border-color: #ff00ff; box-shadow: -1px 0 0 #ff00ff, 1px 0 0 #00ffff; }
    100% { border-color: #ea4335; box-shadow: 2px 0 0 #ff00ff, -2px 0 0 #00ffff; }
}

.glitch-text {
    animation: glitch-text 2s infinite;
    position: relative;
    display: inline-block;
}

@keyframes glitch-text {
    0% { transform: translate(0); }
    1% { transform: translate(-2px, 2px); }
    2% { transform: translate(2px, -2px); }
    3% { transform: translate(0); }
    100% { transform: translate(0); }
}

#global-integrity-bar {
    transition: width 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
}
/* ========================================= */
/* LOGIN OVERLAY STYLING (PREMIUM MESH)      */
/* ========================================= */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: #050505;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

.login-bg-container {
    position: absolute;
    top: -15%;
    left: -15%;
    width: 130%;
    height: 130%;
    background-image: url('login-bg.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.9) saturate(1.1);
    z-index: -1;
    animation: meshMovement 120s infinite alternate linear;
    will-change: transform;
}

@keyframes meshMovement {
    0% { transform: scale(1) translate(0, 0) rotate(0deg); }
    100% { transform: scale(1.15) translate(-2%, -2%) rotate(2deg); }
}

.login-card.premium {
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(40px) saturate(160%);
    -webkit-backdrop-filter: blur(40px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 44px;
    padding: 4.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 480px;
    width: 92%;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(255, 255, 255, 0.02);
    animation: premiumFadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    z-index: 10;
}

@keyframes premiumFadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-logo {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-txt {
    position: relative;
    z-index: 2;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, var(--neon-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.logo-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--neon-green);
    filter: blur(40px);
    opacity: 0.15;
    animation: logoPulse 5s infinite ease-in-out;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.3); opacity: 0.25; }
}

.premium-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 0.8rem;
    color: #fff;
    text-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.premium-subtitle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.05rem;
    margin-bottom: 3.5rem;
    line-height: 1.5;
}

.login-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.google-login-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 0.8rem;
    display: flex;
    justify-content: center;
    transition: all 0.3s ease;
}

.google-login-container:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.divider {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0.5rem 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.premium-btn.offline {
    background: linear-gradient(135deg, rgba(251, 188, 5, 0.08), rgba(251, 188, 5, 0.02));
    border: 1px solid rgba(251, 188, 5, 0.25);
    color: var(--accent-yellow);
    padding: 1.3rem;
    border-radius: 22px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.premium-btn.offline:hover {
    background: var(--accent-yellow);
    color: #000;
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(251, 188, 5, 0.3);
}

.premium-btn.offline i {
    font-size: 1.3rem;
}

.login-footer {
    margin-top: 4rem;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.78rem;
    letter-spacing: 0.8px;
}

/* ========================================= */
/* ANIMATIONS QUE ESTAVAM FALTANDO           */
/* ========================================= */
@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================= */
/* EFEITOS CYBER DINHEIRO (PAGAMENTOS)       */
/* ========================================= */
.rp-card-smart {
    position: relative;
    z-index: 1;
}
.rp-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}
.rp-card-smart::after {
    content: '';
    position: absolute;
    top: -100%; left: 0; right: 0; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(57,255,20,0.08), transparent);
    pointer-events: none;
    z-index: -1;
    transition: none;
}
.rp-card-smart:hover {
    box-shadow: 0 8px 25px rgba(57, 255, 20, 0.15) !important;
    border-color: rgba(57, 255, 20, 0.4) !important;
    transform: translateY(-3px) scale(1.01);
}
.rp-card-smart:hover::before {
    opacity: 1;
}
.rp-card-smart:hover::after {
    animation: hologramScan 2s linear infinite;
}
@keyframes hologramScan {
    0% { top: -100%; }
    100% { top: 100%; }
}

/* Partículas Neon CSS */
.money-particle {
    position: fixed;
    pointer-events: none;
    color: var(--neon-green);
    font-family: 'Courier New', monospace;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
    z-index: 9999;
    animation: floatUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}