/* Design System - Finanxas Yo */

/* Theme Variables */
:root {
    /* Primary Colors */
    --blue-50: #f0f5ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-500: #3b82f6;     /* Electric Blue */
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;     /* Royal Blue */
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;     /* Dark Blue */
    
    /* Semantic Colors */
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --neutral-500: #6b7280;

    /* Transition */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(30, 64, 175, 0.12);
}

/* Light Mode Tokens */
body.theme-light {
    --bg-app: #f4f6fc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a; /* Dark sidebar for premium look even in light mode */
    --bg-sidebar-hover: #1e293b;
    --text-sidebar: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(226, 232, 240, 0.8);
    --input-bg: #ffffff;
    --input-focus: #eff6ff;
    --card-hover-shadow: 0 12px 30px rgba(30, 64, 175, 0.15);
}

/* Dark Mode Tokens */
body.theme-dark {
    --bg-app: #090d16;
    --bg-card: #131b2e;
    --bg-sidebar: #0b1120;
    --bg-sidebar-hover: #1e293b;
    --text-sidebar: #f8fafc;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #1e293b;
    --glass-bg: rgba(19, 27, 46, 0.75);
    --glass-border: rgba(30, 41, 59, 0.8);
    --input-bg: #1e293b;
    --input-focus: #172554;
    --card-hover-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--blue-500);
}

/* Base Utility Classes */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Toast System */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: calc(100% - 48px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background-color: var(--bg-card);
    border-left: 4px solid var(--blue-500);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-weight: 500;
    transform: translateX(120%);
    animation: slideIn 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
    transition: all var(--transition-normal);
}

.toast.toast-success {
    border-left-color: var(--success);
}

.toast.toast-error {
    border-left-color: var(--danger);
}

.toast.toast-warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

.toast.fade-out {
    transform: translateX(120%);
    opacity: 0;
}

/* Authentication Page layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 460px;
    padding: 40px;
    transition: transform var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--blue-500);
    background-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input:focus + i {
    color: var(--blue-500);
}

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.auth-link {
    color: var(--blue-600);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

body.theme-dark .auth-link {
    color: var(--blue-500);
}

.auth-link:hover {
    color: var(--blue-800);
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-600) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-700) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

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

.btn-secondary:hover {
    background-color: var(--border);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

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

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider:not(:empty)::before {
    margin-right: 10px;
}

.auth-divider:not(:empty)::after {
    margin-left: 10px;
}

/* Dashboard App Layout */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 30px;
}

.brand-logo-svg {
    width: 38px;
    height: 38px;
}

.brand-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--blue-200) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: rgba(248, 250, 252, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all var(--transition-fast);
}

.menu-item-link:hover {
    color: #ffffff;
    background-color: var(--bg-sidebar-hover);
}

.menu-item-link.active {
    color: #ffffff;
    background-color: var(--blue-600);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-md);
}

.user-avatar-initial {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-profile-info {
    flex: 1;
    overflow: hidden;
}

.user-profile-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-profile-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.theme-mode-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-sidebar-hover);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logout-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

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

/* Bottom Navigation (Mobile Only) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-sidebar);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    grid-template-columns: repeat(6, 1fr);
    padding: 6px 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(248, 250, 252, 0.6);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
}

.bottom-nav-item i {
    font-size: 18px;
}

.bottom-nav-item.active {
    color: var(--blue-500);
}

/* App Header */
.app-header {
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-title-section h1 {
    font-size: 22px;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Dashboard Views and Panels */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.view-container {
    flex: 1;
    padding: 24px;
    padding-bottom: 80px; /* Space for mobile bottom nav */
}

/* Cards & Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.icon-blue { background-color: var(--blue-50); color: var(--blue-600); }
.icon-success { background-color: var(--success-light); color: var(--success); }
.icon-warning { background-color: var(--warning-light); color: var(--warning); }
.icon-danger { background-color: var(--danger-light); color: var(--danger); }

body.theme-dark .icon-blue { background-color: rgba(59, 130, 246, 0.1); color: var(--blue-500); }
body.theme-dark .icon-success { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
body.theme-dark .icon-warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
body.theme-dark .icon-danger { background-color: rgba(239, 104, 104, 0.1); color: var(--danger); }

.stat-card-val {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.stat-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    min-height: 340px;
}

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

.chart-title {
    font-size: 16px;
    font-weight: 700;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 260px;
}

/* Content Sections */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

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

.content-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.app-table th {
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
}

.app-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-income { background-color: var(--success-light); color: var(--success); }
.badge-expense { background-color: var(--danger-light); color: var(--danger); }

body.theme-dark .badge-income { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
body.theme-dark .badge-expense { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); }

.badge-neutral { background-color: var(--border); color: var(--text-secondary); }

/* Table Action Buttons */
.table-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background-color: var(--border);
    color: var(--blue-500);
}

.btn-icon-danger:hover {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Wallets Management styles */
.wallets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.wallet-card {
    background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-900) 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.wallet-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(30, 64, 175, 0.3);
}

.wallet-card::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    top: -50px;
    right: -50px;
    border-radius: var(--radius-full);
}

.wallet-name {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-val {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 24px;
}

.wallet-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.wallet-type-badge {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
    font-weight: 500;
}

.wallet-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    position: absolute;
    top: 16px;
    right: 16px;
    transition: opacity var(--transition-fast);
}

.wallet-card:hover .wallet-actions {
    opacity: 1;
}

.wallet-btn-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: background var(--transition-fast);
}

.wallet-btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

/* Create Wallet Dotted Card */
.wallet-card-dotted {
    background-color: transparent;
    border: 2px dashed var(--border);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.wallet-card-dotted:hover {
    border-color: var(--blue-500);
    color: var(--blue-500);
    background-color: var(--input-focus);
}

.wallet-card-dotted i {
    font-size: 24px;
    margin-bottom: 12px;
}

.wallet-card-dotted span {
    font-weight: 600;
    font-size: 14px;
}

/* Budget Modules Styles */
.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.budget-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

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

.budget-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.budget-category {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.budget-limit {
    font-size: 13px;
    color: var(--text-secondary);
}

.budget-progress-container {
    height: 8px;
    background-color: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 12px;
}

.budget-progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1), background-color var(--transition-normal);
}

.progress-green {
    background-color: var(--success);
}
.progress-yellow {
    background-color: var(--warning);
}
.progress-red {
    background-color: var(--danger);
}

.budget-summary {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
}

.budget-spent {
    color: var(--text-primary);
}

.budget-remaining {
    color: var(--success);
}

.budget-remaining.overlimit {
    color: var(--danger);
}

/* Emergency Fund Calculator Styles */
.calculator-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .calculator-box {
        grid-template-columns: 1fr;
    }
}

.calculator-results {
    background-color: var(--blue-50);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--blue-100);
}

body.theme-dark .calculator-results {
    background-color: rgba(30, 58, 138, 0.15);
    border-color: rgba(30, 58, 138, 0.3);
}

.calc-title {
    font-size: 14px;
    color: var(--blue-800);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

body.theme-dark .calc-title {
    color: var(--blue-200);
}

.calc-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--blue-900);
    margin-bottom: 20px;
}

body.theme-dark .calc-amount {
    color: #ffffff;
}

.progress-circular-gauge {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

/* Debts tracking styles */
.debts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.debt-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-normal);
}

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

.debt-type-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.debt-to-pay .debt-type-bar { background-color: var(--danger); }
.debt-to-collect .debt-type-bar { background-color: var(--success); }

.debt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.debt-name {
    font-weight: 700;
    font-size: 16px;
}

.debt-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.debt-to-pay .debt-badge { background-color: var(--danger-light); color: var(--danger); }
.debt-to-collect .debt-badge { background-color: var(--success-light); color: var(--success); }

body.theme-dark .debt-to-pay .debt-badge { background-color: rgba(239, 68, 68, 0.15); }
body.theme-dark .debt-to-collect .debt-badge { background-color: rgba(16, 185, 129, 0.15); }

.debt-amounts {
    margin-bottom: 16px;
}

.debt-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.debt-val-highlight {
    font-weight: 700;
    color: var(--text-primary);
}

.debt-progress-wrapper {
    margin-bottom: 16px;
}

.debt-date {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.debt-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}

/* Filters UI */
.filter-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-select, .filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--blue-500);
}

/* PDF Print Template (hidden from viewport) */
#pdf-template-wrapper {
    display: none;
}

.pdf-report-container {
    padding: 30px;
    font-family: 'Outfit', sans-serif;
    color: #0f172a;
    background-color: #ffffff;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.pdf-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    color: #1e40af;
}

.pdf-meta {
    text-align: right;
    font-size: 12px;
    color: #64748b;
}

.pdf-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.pdf-summary-card {
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    background-color: #f8fafc;
}

.pdf-summary-card h4 {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.pdf-summary-card p {
    font-size: 20px;
    font-weight: 700;
}

.pdf-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 6px;
    color: #1e3a8a;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 12px;
}

.pdf-table th {
    background-color: #f1f5f9;
    padding: 8px;
    border-bottom: 2px solid #cbd5e1;
    font-weight: 600;
}

.pdf-table td {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.pdf-amount-income {
    color: #059669;
    font-weight: 600;
}

.pdf-amount-expense {
    color: #dc2626;
    font-weight: 600;
}

/* Responsiveness adjustments */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .app-sidebar {
        display: none;
    }
    
    .bottom-nav {
        display: grid;
    }
    
    .view-container {
        padding: 16px;
        padding-bottom: 90px;
    }
    
    .app-header {
        padding: 12px 16px;
    }
}

/* Animations for interactions */
.scale-on-hover {
    transition: transform var(--transition-fast);
}
.scale-on-hover:hover {
    transform: scale(1.02);
}

.shake-on-error {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}
