:root {
    --bg-main: #f1f5f9;
    --bg-card: #FFFFFF;
    --border-color: #E8ECF1;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.11);
    --radius-card: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-income: #10b981;
    --primary-expense: #f43f5e;
    --primary-budget: #6366F1;
    --primary-balance: #8b5cf6;
    --primary-cash: #10b981;
    --primary-receivable: #3b82f6;
    --primary-payable: #f43f5e;
    --primary-projected: #8b5cf6;
    --text-main: #1A202C;
    --text-muted: #94a3b8;
    --status-pending: #f59e0b;
    --status-confirmed: #10b981;
    --progress-good: #10b981;
    --progress-warning: #f59e0b;
    --progress-danger: #ef4444;
    --bg-card-border: var(--border-color);
    --glass-shadow: var(--shadow-card);
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* BI Sidebar Professional Style */
.sidebar {
    width: 250px;
    height: 100vh;
    background-color: #f8fafc;
    /* Slate 50 */
    border-right: 1px solid #e2e8f0;
    /* Slate 200 */
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    padding: 2.25rem 1.2rem 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.5rem;
}

.sidebar-logo {
    height: 34px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    /* Slate 800 */
    letter-spacing: -0.025em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.2rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #64748b;
    /* Slate 500 */
    font-size: 0.925rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
}

.sidebar-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.sidebar-item:hover {
    background-color: #f1f5f9;
    /* Slate 100 */
    color: var(--primary);
}

.sidebar-item.active {
    background-color: #eff6ff;
    /* Blue 50 */
    color: var(--primary);
    font-weight: 600;
}

/* Calendar Month Grid */
.sidebar-calendar-widget {
    margin: auto 1.2rem 2rem 1.2rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-calendar-widget.collapsed {
    padding-bottom: 0.8rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: margin-bottom 0.3s ease;
}

.sidebar-calendar-widget:not(.collapsed) .calendar-header {
    margin-bottom: 0.8rem;
}

.btn-cal-year {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-cal-year:hover {
    color: var(--primary);
    background: #f1f5f9;
}

.cal-year-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    flex: 1;
    cursor: pointer;
    padding: 0.4rem 0.2rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.cal-year-center:hover {
    background-color: #f1f5f9;
}

.cal-year-label {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    pointer-events: none;
}

.cal-toggle-icon {
    font-size: 0.8rem;
    color: #64748b;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sidebar-calendar-widget:not(.collapsed) .cal-toggle-icon {
    transform: rotate(180deg);
}

.cal-hint-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-grid-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-calendar-widget.collapsed .calendar-grid-wrapper {
    grid-template-rows: 0fr;
}

.calendar-months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    overflow: hidden;
}

.btn-cal-month {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cal-month:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-cal-month.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Main Content Area Refinement */
.app-container {
    flex: 1;
    margin-left: 250px;
    /* Precise sidebar offset */
    padding: 1rem 1.5rem 4.5rem 1.5rem;
    /* Increased bottom padding specifically to prevent scroll cut-off on the annual chart legend */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: none;
    /* Occupy full width next to sidebar */
    background-color: transparent;
}

/* Sidebar View Switching */
.view-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.view-hidden {
    display: none;
}

/* Donut Charts */
.donut-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.donut-chart-panel {
    display: flex;
    flex-direction: column;
}

.donut-wrapper {
    position: relative;
    height: 280px;
    padding: 1rem;
}

.donut-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Utils */
.hidden {
    display: none !important;
}

.btn-icon,
.btn-primary,
.btn-small,
.btn-close {
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

/* Layout Cleaned (Duplicate .app-container removed) */

/* Header */
.app-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
}

.app-logo {
    height: 90px !important;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    filter: contrast(1.1) brightness(1.05);
}

.logo i {
    display: none;
    /* Hide icon as it's replaced by img */
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
    margin: 0;
}

.tagline {
    display: block;
    font-size: 0.82rem;
    font-weight: 400;
    color: #64748b;
    line-height: 1.2;
    margin: 0;
}



/* Month Selector */
.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: 0;
}

.month-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    min-width: 180px;
    text-align: center;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.btn-month-nav {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.8rem;
    box-shadow: var(--shadow-card);
}

.btn-month-nav:hover {
    background: #F3F4F6;
}

/* Carryover hint */
.carryover-hint {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 0.2rem;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.75rem;
}

@media(min-width:600px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media(min-width:1024px) {
    .dashboard-grid {
        gap: 1.25rem;
    }
}

.card {
    border-radius: var(--radius-card);
    padding: 0.8rem 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.card h3 {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.card .amount {
    font-size: 1.45rem;
    color: #fff;
    font-weight: 800;
    line-height: 1.15;
}

.card .icon-bg {
    position: absolute;
    right: -8px;
    bottom: -10px;
    font-size: 4.5rem;
    opacity: 0.12;
    color: #fff;
    transform: rotate(-15deg);
}

.card-cash {
    background: linear-gradient(135deg, #059669, #10b981);
}

.card-receivable {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.card-payable {
    background: linear-gradient(135deg, #be185d, #ec4899);
}

.card-projected {
    background: linear-gradient(135deg, #4c1d95, #8b5cf6);
}

/* Unused legacy card classes — kept for compat */
.card-income .amount,
.card-income .icon-bg {
    color: var(--primary-income);
}

.card-expense .amount,
.card-expense .icon-bg {
    color: var(--primary-expense);
}

.card-budget .amount,
.card-budget .icon-bg {
    color: var(--primary-budget);
}

.card-balance .amount,
.card-balance .icon-bg {
    color: var(--primary-balance);
}

/* Glass Panel → White Card */
.glass-panel {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-card);
    padding: 1.15rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.glass-panel h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: #1e293b;
}

.glass-panel h2 i {
    color: var(--primary);
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.panel-header h2 {
    margin-bottom: 0;
}

.info-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.7rem;
    background: rgba(99, 102, 241, 0.09);
    color: var(--primary);
    border-radius: 20px;
    font-weight: 600;
}

/* Chart */
.chart-section {
    padding: var(--spacing-md);
}

.chart-wrapper {
    position: relative;
    height: 150px;
}

@media(min-width:1024px) {
    .chart-wrapper {
        height: 180px;
    }
}

.chart-alert {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.08);
    border-radius: var(--radius-xs);
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.chart-alert::before {
    content: '\26a0';
    font-size: 0.9rem;
}

/* Main Grid */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

@media(min-width:900px) {
    .main-content {
        display: grid;
        grid-template-columns: 1.4fr 1.4fr 1.2fr;
        gap: 1.2rem;
        align-items: start;
    }
}

@media(max-width:899px) {
    .section-transactions {
        grid-column: auto;
    }
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-row {
    display: flex;
    gap: var(--spacing-sm);
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

input,
select {
    width: 100%;
    padding: 0.72rem 1rem;
    background: #F8F9FB;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Number inputs: restore spinners and ensure visibility */
input[type="number"] {
    -moz-appearance: textfield;
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 70px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    line-height: normal;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
    height: 28px;
}

/* Ensure form panel expands to fit all fields */
.section-forms .glass-panel {
    height: auto;
    min-height: 100%;
    overflow: visible;
    padding-bottom: 24px;
}

.btn-primary {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-balance));
    color: white;
    font-weight: 600;
    border-radius: 14px;
    margin-top: var(--spacing-xs);
    font-size: 1rem;
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: scale(1.01);
}

.btn-shortcut-pulse {
    animation: flash-pulse 0.4s ease-out;
}

@keyframes flash-pulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(0.96);
        filter: brightness(1.3);
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.45);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Category Progress */
.category-item {
    margin-bottom: var(--spacing-md);
}

.cat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    color: var(--text-main);
    font-weight: 500;
}

.cat-percentage-wrapper {
    position: relative;
    display: inline-block;
}

.cat-percentage {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 4px;
    display: inline-block;
    vertical-align: middle;
    cursor: help;
}

.custom-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--text-main);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.73rem;
    white-space: nowrap;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-main) transparent transparent transparent;
}

.cat-percentage-wrapper:hover .custom-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.heat-low {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.heat-medium {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.heat-high {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.cat-progress-bg {
    height: 7px;
    background: #F1F5F9;
    border-radius: 4px;
    overflow: hidden;
}

.cat-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--progress-good);
    transition: width 0.5s ease, background-color 0.3s;
}

.cat-progress-bar.warning {
    background: var(--progress-warning);
}

.cat-progress-bar.danger {
    background: var(--progress-danger);
}

.limit-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 2px;
}

/* Statement Summary */
.statement-summary {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-card {
    flex: 1;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-card.received {
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    color: #ffffff;
}

.summary-card.paid {
    background: linear-gradient(135deg, #be185d, #ec4899);
    border: none;
    color: #ffffff;
}

.summary-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.summary-card.received .summary-label,
.summary-card.paid .summary-label {
    color: rgba(255, 255, 255, 0.9);
}

.summary-card.received .summary-value,
.summary-card.paid .summary-value {
    color: #ffffff;
}

.summary-card.paid .summary-label {
    color: #e11d48;
}

.summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Search */
.search-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.search-input-group {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input-group input {
    padding-left: 2.4rem;
    border-radius: 10px;
}

.search-date-group input {
    border-radius: 10px;
    width: auto;
}

.btn-clear {
    height: 40px;
    width: 40px;
    border-radius: 10px;
    background: #F1F5F9;
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    font-size: 0.9rem;
}

.btn-clear:hover {
    background: #E2E8F0;
    color: var(--primary-expense);
}

/* Filter Row */
.filter-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.filter-row select {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 10px;
    height: 36px;
    width: auto;
    flex: 1;
}

.status-filter-group {
    display: flex;
    gap: 0.35rem;
}

.filter-status-btn {
    background: #F1F5F9;
    border: 1.5px solid transparent;
    color: var(--text-muted);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.82rem;
    transition: 0.2s;
    white-space: nowrap;
}

.filter-status-btn.active {
    background: var(--primary);
    color: #FFF;
}

.filter-status-btn:hover:not(.active) {
    background: #E2E8F0;
}

/* Transactions List */
.transactions-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 2px;
}

.transactions-list::-webkit-scrollbar {
    width: 4px;
}

.transactions-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.trans-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    padding: 0.7rem 0.75rem;
    border-radius: 14px;
    gap: 0.65rem;
    margin-bottom: 0.4rem;
    background: #FAFBFC;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}

.trans-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.trans-item:last-child {
    margin-bottom: 0;
}

/* Circular category indicator */
.trans-item::before {
    content: '';
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EDE9FE, #C7D2FE);
    display: block;
    align-self: center;
    justify-self: center;
}

.trans-item:nth-child(3n+1)::before {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
}

.trans-item:nth-child(3n+2)::before {
    background: linear-gradient(135deg, #FFE4E6, #FECDD3);
}

.trans-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
    gap: 1px;
    margin-right: 12px;
}

.trans-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
    display: block;
}

.trans-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.edit-icon {
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
    margin-left: 6px;
    opacity: 0.9;
    transition: transform 0.2s;
}

.edit-icon:hover {
    transform: scale(1.2);
    color: var(--primary);
}

.edit-row input,
.edit-row select {
    flex: 1;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.edit-row input:focus,
.edit-row select:focus {
    border-color: var(--primary);
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-save-inline,
.btn-cancel-inline {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: 0.2s;
}

.btn-save-inline {
    background: var(--primary);
    color: #fff;
}

.btn-cancel-inline {
    background: #f1f5f9;
    color: #64748b;
}

.btn-save-inline:hover {
    background: #4f46e5;
}

.btn-cancel-inline:hover {
    background: #e2e8f0;
}

.trans-item.editing-item::before {
    opacity: 0.3;
    /* Desfoca o círculo durante a edição */
}

.inline-cat-select {
    background: #fff;
    color: var(--text-main);
    border: 1.5px solid var(--primary);
    border-radius: 6px;
    font-size: 0.82rem;
    padding: 4px;
    outline: none;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.15);
}

.trans-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.trans-amount {
    font-weight: 700;
    white-space: nowrap;
    font-size: 0.9rem;
}

.trans-amount.expense {
    color: var(--primary-expense);
}

.trans-amount.income {
    color: var(--primary-income);
}

/* Status Badges */
.btn-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    border: none;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s;
    white-space: nowrap;
}

.btn-status:hover {
    transform: scale(1.05);
}

.btn-status:active {
    animation: pulse-status 0.3s ease;
}

.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.status-confirmed {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

@keyframes pulse-status {
    0% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.15)
    }

    100% {
        transform: scale(1)
    }
}

.btn-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.btn-delete:hover {
    color: var(--primary-expense);
    background: rgba(244, 63, 94, 0.08);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    font-style: italic;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-content.modal-small {
    max-width: 360px;
}

.modal-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.btn-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: var(--spacing-md);
    overflow-y: auto;
}

.modal-body h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: var(--spacing-md);
}

.modal-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.modal-actions {
    margin-top: var(--spacing-sm);
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.add-category-row {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.btn-small {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-small:hover {
    background: var(--primary-hover);
}

.settings-list {
    list-style: none;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.4rem;
    background: #F8F9FB;
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    font-weight: 500;
}

.settings-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--spacing-md) 0;
}

/* Backup */
.backup-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.backup-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-backup {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn-backup:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.btn-backup i {
    font-size: 0.95rem;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 90px;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    animation: slideIn 0.3s ease, fadeOut 0.5s ease 4.5s forwards;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    min-width: 240px;
}

.toast.success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.toast.warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.toast.danger {
    background: #FFF1F2;
    color: #9F1239;
    border: 1px solid #FECDD3;
}

.toast.info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

@keyframes slideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Focus Navigation */
.foco-ativo {
    outline: 2.5px solid var(--primary);
    outline-offset: -2px;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
    transition: all 0.2s ease;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0.5rem max(0.5rem, env(safe-area-inset-bottom));
    z-index: 500;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 10px;
    transition: 0.2s;
    min-width: 48px;
}

.nav-item i {
    font-size: 1.15rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.nav-add {
    background: var(--primary);
    color: white;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    padding: 0;
    min-width: auto;
}

.nav-item.nav-add:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);
}

.nav-item.nav-add span {
    display: none;
}