/* FinVue - Financial Dashboard UI */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary: #4361EE;
    --primary-dark: #3A56D4;
    --primary-light: #758BFF;
    --secondary: #F72585;
    --secondary-dark: #D01B6F;
    --secondary-light: #FF5DA8;
    --success: #10B981;
    --warning: #FBBF24;
    --danger: #EF4444;
    --info: #3B82F6;
    --dark: #1F2937;
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --card-padding: 24px;
    --content-padding: 24px;
}

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

html, body {
    font-family: var(--font-primary);
    font-size: 16px;
    color: var(--gray-800);
    background-color: var(--gray-50);
    line-height: 1.5;
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    transition: all var(--transition-fast);
}

input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Back to Portfolio Button */
.back-to-portfolio {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: var(--transition);
}

.back-to-portfolio:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: width var(--transition);
    box-shadow: var(--shadow);
    z-index: 10;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--gray-200);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.5rem;
}

.menu-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition-fast);
}

.menu-toggle:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}

.sidebar-menu ul {
    padding: 20px 0;
}

.sidebar-menu li {
    padding: 0 20px;
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--gray-600);
    transition: var(--transition-fast);
    font-weight: 500;
}

.sidebar-menu a i {
    font-size: 1.25rem;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar-menu li.active a {
    background-color: var(--primary);
    color: var(--white);
}

.sidebar-menu a:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

.sidebar-menu li.active a:hover {
    background-color: var(--primary);
    color: var(--white);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background-color: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    color: var(--gray-600);
    transition: var(--transition-fast);
    font-weight: 500;
}

.sidebar-footer a i {
    font-size: 1.25rem;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar-footer a:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--content-padding);
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    z-index: 5;
}

.header-search {
    position: relative;
    width: 400px;
}

.header-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
}

.header-search input {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    background-color: var(--gray-50);
    padding: 0 15px 0 45px;
    color: var(--gray-800);
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.header-search input::placeholder {
    color: var(--gray-400);
}

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

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    background-color: var(--gray-50);
    transition: var(--transition-fast);
    position: relative;
    font-size: 1.25rem;
}

.btn-icon.small {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.btn-icon:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

.btn-icon .badge {
    position: absolute;
    top: -6px;
    right: -6px;
}

.profile-dropdown {
    position: relative;
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 10px;
    color: var(--gray-800);
    transition: var(--transition-fast);
    font-weight: 500;
}

.profile-toggle img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-toggle i {
    font-size: 0.875rem;
    color: var(--gray-400);
    transition: var(--transition-fast);
}

.profile-toggle:hover {
    background-color: var(--gray-100);
}

.profile-toggle:hover i {
    color: var(--gray-600);
}

/* Content */
.content {
    flex: 1;
    overflow-y: auto;
    padding: var(--content-padding);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background-color: var(--gray-300);
    border-radius: 4px;
}

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

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.text-muted {
    color: var(--gray-500);
}

.date-filter {
    display: flex;
    gap: 8px;
}

.btn-outline {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-600);
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    transition: var(--transition-fast);
}

.btn-outline:hover, .btn-outline.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-text {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: var(--transition-fast);
}

.btn-text:hover, .btn-text.active {
    background-color: var(--gray-100);
    color: var(--primary);
}

.btn-text.active {
    color: var(--primary);
    font-weight: 600;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: var(--card-padding);
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    margin-bottom: 0;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.stat-icon.total-balance {
    background-color: var(--primary);
}

.stat-icon.income {
    background-color: var(--success);
}

.stat-icon.expenses {
    background-color: var(--danger);
}

.stat-icon.savings {
    background-color: var(--info);
}

.stat-details {
    flex: 1;
}

.stat-details h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 5px;
}

.stat-value {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.stat-change .period {
    color: var(--gray-500);
    font-weight: 400;
    margin-left: 5px;
}

/* Grid Layout */
.row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.col-1-2 {
    flex: 0 0 calc(50% - 12px);
}

.col-1-3 {
    flex: 0 0 calc(33.333% - 16px);
}

.col-2-3 {
    flex: 0 0 calc(66.666% - 8px);
}

/* Charts */
canvas {
    width: 100% !important;
    height: auto !important;
}

.chart-legend {
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    margin-right: 10px;
}

.legend-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.legend-value {
    font-weight: 600;
    color: var(--gray-800);
}

/* Credit Cards */
.credit-card {
    background: linear-gradient(135deg, #4361EE 0%, #3A0CA3 100%);
    border-radius: 16px;
    padding: 24px;
    color: var(--white);
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-bounce);
}

.credit-card:hover {
    transform: translateY(-5px);
}

.credit-card.mastercard {
    background: linear-gradient(135deg, #F72585 0%, #7209B7 100%);
}

.credit-card .card-type {
    font-size: 2rem;
    margin-bottom: 20px;
}

.credit-card .card-number {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.credit-card .card-details {
    display: flex;
    justify-content: space-between;
}

.credit-card .card-holder span,
.credit-card .card-expiry span {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.card-actions.center {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

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

.transaction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    transition: var(--transition-fast);
}

.transaction-item:hover {
    background-color: var(--gray-50);
}

.transaction-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--white);
    flex-shrink: 0;
}

.transaction-icon.groceries {
    background-color: #10B981;
}

.transaction-icon.salary {
    background-color: #3B82F6;
}

.transaction-icon.entertainment {
    background-color: #F72585;
}

.transaction-icon.restaurant {
    background-color: #F59E0B;
}

.transaction-icon.transport {
    background-color: #4338CA;
}

.transaction-details {
    flex: 1;
}

.transaction-details h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.transaction-date {
    font-size: 0.875rem;
    white-space: nowrap;
}

.transaction-amount {
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

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

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

/* Bills List */
.bills-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bill-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    transition: var(--transition-fast);
}

.bill-item:hover {
    background-color: var(--gray-50);
}

.bill-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--white);
    flex-shrink: 0;
}

.bill-icon.housing {
    background-color: #3B82F6;
}

.bill-icon.utilities {
    background-color: #F59E0B;
}

.bill-icon.phone {
    background-color: #10B981;
}

.bill-details {
    flex: 1;
}

.bill-details h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.bill-amount {
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
}

.bill-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 15px;
}

.bill-date .due {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--danger);
}

/* Goals List */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.goal-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.goal-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--white);
    flex-shrink: 0;
}

.goal-icon.vacation {
    background-color: #4361EE;
}

.goal-icon.car {
    background-color: #F72585;
}

.goal-icon.education {
    background-color: #10B981;
}

.goal-info {
    flex: 1;
}

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

.goal-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.goal-amount {
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.goal-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 4px;
}

.goal-percentage {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    min-width: 40px;
    text-align: right;
}

.goal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-eta {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--success);
}

.goal-eta.warning {
    color: var(--warning);
}

.goal-eta.success {
    color: var(--success);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .row {
        flex-wrap: wrap;
    }
    
    .col-1-3, .col-2-3 {
        flex: 0 0 100%;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header-search {
        width: 300px;
    }
    
    .col-1-2 {
        flex: 0 0 100%;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 15px var(--content-padding);
        gap: 15px;
    }
    
    .header-search {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .date-filter {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .content {
        padding: 15px;
    }
    
    .card-header, .card-body {
        padding: 15px;
    }
    
    .transaction-date {
        display: none;
    }
}

@media (max-width: 576px) {
    .profile-toggle span {
        display: none;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .bill-item, .transaction-item {
        flex-wrap: wrap;
    }
    
    .bill-date {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        margin: 10px 0 0 65px;
    }
    
    .bill-item .btn-outline {
        margin-left: 65px;
        margin-top: 10px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease forwards;
}