/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Apple-inspired Color Palette */
    --system-blue: #007AFF;
    --system-green: #34C759;
    --system-red: #FF3B30;
    --system-orange: #FF9500;
    --system-gray: #8E8E93;
    --system-gray2: #AEAEB2;
    --system-gray3: #C7C7CC;
    --system-gray4: #D1D1D6;
    --system-gray5: #E5E5EA;
    --system-gray6: #F2F2F7;
    
    /* Typography */
    --font-sf: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

body {
    font-family: var(--font-sf);
    background-color: var(--system-gray6);
    color: #1D1D1F;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation - Apple Style */
.apple-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* Left: Brand */
.nav-left {
    flex: 0 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1D1D1F;
    font-size: 20px;
    font-weight: 600;
    padding: 8px 0;
}

.nav-brand i {
    color: var(--system-blue);
    font-size: 22px;
}

/* Center: Navigation Links */
.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--system-gray);
    font-size: 15px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--system-gray6);
    color: #1D1D1F;
}

.nav-link.active {
    background: var(--system-blue);
    color: white;
}

.nav-link.active:hover {
    background: #0056CC;
}

/* Right: User Actions */
.nav-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--system-gray6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--system-gray);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.nav-action-btn:hover {
    background: var(--system-gray5);
    color: #1D1D1F;
}


.nav-action-btn.logout {
    background-color: red; 
}
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--system-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    transition: background-color 0.2s ease;
}

.user-profile:hover {
    background: var(--system-gray6);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--system-blue);
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1D1D1F;
}

.mobile-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--system-gray6);
    color: var(--system-gray);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
    background: var(--system-gray5);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 60px);
    padding: 32px 24px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1D1D1F;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 17px;
    color: var(--system-gray);
    font-weight: 400;
}

.page-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--system-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-icon.income {
    background: var(--system-green);
}

.stat-icon.expense {
    background: var(--system-red);
}

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 15px;
    color: var(--system-gray);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1D1D1F;
    letter-spacing: -0.5px;
}

.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.stat-badge {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.stat-badge:hover {
    transform: translateY(-1px);
}

.stat-badge-label {
    font-size: 13px;
    color: var(--system-gray);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-badge-value {
    font-size: 24px;
    font-weight: 700;
    color: #1D1D1F;
    letter-spacing: -0.5px;
}

.stat-badge-value.income {
    color: var(--system-green);
}

.stat-badge-value.expense {
    color: var(--system-red);
}

/* Sections */
.section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.section-title {
    font-size: 22px;
    font-weight: 600;
    color: #1D1D1F;
    letter-spacing: -0.3px;
}

.text-link {
    color: var(--system-blue);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-link:hover {
    opacity: 0.8;
}

.text-link::after {
    content: '→';
    font-size: 14px;
}

/* Transactions List */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--system-gray6);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.transaction-item:hover {
    background: var(--system-gray5);
    border-color: var(--system-gray4);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.transaction-icon.income {
    background: linear-gradient(135deg, var(--system-green), #2da94f);
}

.transaction-icon.expense {
    background: linear-gradient(135deg, var(--system-red), #e53530);
}

.transaction-icon.transfer {
    background: linear-gradient(135deg, var(--system-blue), #0e4bc5);
}

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

.transaction-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1D1D1F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-meta {
    font-size: 14px;
    color: var(--system-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-amount {
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.transaction-amount.income {
    color: var(--system-green);
}

.transaction-amount.expense {
    color: var(--system-red);
}

.transaction-amount.transfer {
    color: var(--system-blue);
}

/* Table */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr 1fr 0.5fr;
    gap: 20px;
    padding: 20px 24px;
    background: var(--system-gray6);
    font-size: 13px;
    font-weight: 600;
    color: var(--system-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--system-gray5);
}

.table-body {
    display: flex;
    flex-direction: column;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr 1fr 0.5fr;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--system-gray5);
    transition: background-color 0.2s ease;
    align-items: center;
}

.table-row:hover {
    background: var(--system-gray6);
}

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

.date-cell {
    font-size: 15px;
    font-weight: 500;
    color: #1D1D1F;
}

.category-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.category-badge.income {
    background: rgba(52, 199, 89, 0.1);
    color: var(--system-green);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.category-badge.expense {
    background: rgba(255, 59, 48, 0.1);
    color: var(--system-red);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.category-badge.transfer {
    background: rgba(10, 39, 166, 0.1);
    color: var(--system-blue);
    border: 1px solid rgba(10, 39, 166, 0.2);
}

.amount {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.amount.income {
    color: var(--system-green);
}

.amount.expense {
    color: var(--system-red);
}

.amount.transfer {
    color: #0e4bc5;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--system-gray6);
    color: var(--system-gray);
}

.action-btn:hover {
    background: var(--system-gray5);
}

.edit-btn:hover {
    color: var(--system-blue);
    background: rgba(0, 122, 255, 0.1);
}

.delete-btn:hover {
    color: var(--system-red);
    background: rgba(255, 59, 48, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--font-sf);
    white-space: nowrap;
}

.btn-primary {
    background: var(--system-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.btn-secondary {
    background: var(--system-gray5);
    color: #1D1D1F;
}

.btn-secondary:hover {
    background: var(--system-gray4);
    transform: translateY(-1px);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #1D1D1F;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--system-gray4);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: var(--font-sf);
    background: white;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--system-blue);
    box-shadow: 0 0 0 3px #007aff1a;
}

.form-textarea {
    resize: vertical;
    height: 52px;
    min-height: unset;
    padding: 12px 16px;
}

/* Amount Input */
.amount-input {
    position: relative;
}

.amount-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--system-gray);
    pointer-events: none;
    font-weight: 500;
}

.amount-input .form-input {
    padding-left: 40px;
}

/* Modal */
.modal-header {
    padding: 28px 28px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #1D1D1F;
    letter-spacing: -0.3px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--system-gray6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--system-gray);
}

.modal-close:hover {
    background: var(--system-gray5);
    color: #1D1D1F;
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 0 28px 28px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--system-gray5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--system-gray);
    font-size: 24px;
}

.empty-state h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1D1D1F;
}

.empty-state p {
    font-size: 16px;
    color: var(--system-gray);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: white;
    animation: slideIn 0.3s ease;
}

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

.mobile-nav-header {
    padding: 32px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--system-gray5);
}

.mobile-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--system-blue);
}

.mobile-user-profile h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 4px;
}

.mobile-user-profile p {
    font-size: 14px;
    color: var(--system-gray);
}

.close-mobile-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--system-gray6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--system-gray);
    transition: all 0.2s ease;
}

.close-mobile-nav:hover {
    background: var(--system-gray5);
    color: #1D1D1F;
}

.mobile-nav-links {
    padding: 24px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: #1D1D1F;
    font-size: 17px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    margin-bottom: 4px;
}

.mobile-nav-link:hover {
    background: var(--system-gray6);
}

.mobile-nav-link.active {
    background: var(--system-blue);
    color: white;
}

.mobile-nav-link i {
    width: 24px;
    color: inherit;
}

.mobile-nav-divider {
    height: 1px;
    background: var(--system-gray5);
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-center {
        gap: 4px;
    }
    
    .nav-link {
        padding: 10px 12px;
    }
}

@media (max-width: 900px) {
    .nav-center {
        display: none;
    }
    
    .mobile-nav-toggle {
        display: flex;
    }
    
    .user-name {
        display: none;
    }
    
    .nav-container {
        padding: 0 20px;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 24px 16px;
    }

    .nav-action-btn.logout {
        display: none;
    }
    
    .container {
        padding: 0;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .page-header-with-action {
        flex-direction: column;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-badge {
        min-width: calc(50% - 8px);
    }
    
    .section {
        padding: 20px;
    }
    
    .table-header {
        display: none;
    }
    
    .table-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        background: var(--system-gray6);
        border: 1px solid var(--system-gray5);
    }
    
    .table-row:hover {
        background: var(--system-gray5);
    }
    
    .table-col-1,
    .table-col-2,
    .table-col-3,
    .table-col-4,
    .table-col-5,
    .table-col-6 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
    }
    
    .table-col-1::before {
        content: "Date:";
        color: var(--system-gray);
        font-weight: 500;
        margin-right: 12px;
    }
    
    .table-col-2::before {
        content: "Description:";
        color: var(--system-gray);
        font-weight: 500;
        margin-right: 12px;
    }
    
    .table-col-3::before {
        content: "Category:";
        color: var(--system-gray);
        font-weight: 500;
        margin-right: 12px;
    }
    
    .table-col-4::before {
        content: "Bank:";
        color: var(--system-gray);
        font-weight: 500;
        margin-right: 12px;
    }
    
    .table-col-5::before {
        content: "Amount:";
        color: var(--system-gray);
        font-weight: 500;
        margin-right: 12px;
    }
    
    .table-col-6::before {
        content: "Actions:";
        color: var(--system-gray);
        font-weight: 500;
        margin-right: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-content {
        margin: 16px;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .stat-badge {
        min-width: 100%;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .mobile-nav-content {
        width: 280px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}


.text-blue {
    color: #2563eb;
}

.text-red {
    color: #dc2626;
}











.timeframe-selector label {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    letter-spacing: -0.24px;
}

#timeframe {
    font-size: 14px;
    font-weight: 400;
    color: #1d1d1f;
    background-color: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    min-width: 140px;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
}

#timeframe:hover {
    border-color: #8e8e93;
    background-color: #f5f5f7;
}

#timeframe:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

#timeframe:active {
    background-color: #ebebed;
    transform: scale(0.98);
}






/* charts.css */
.charts-section {
    margin: 2rem 0;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #333;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: #666;
}

.stat-icon.networth {
    background-color: #4CAF50;
    color: white;
}

.stat-icon.investment {
    background-color: #2196F3;
    color: white;
}