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

:root {
    /* Main Colors - Soft Pastel Palette */
    --primary: #ffb4d4;
    --primary-light: #ffd6ea;
    --primary-dark: #ff8ab8;
    --secondary: #d4b5ff;
    --accent: #a8daff;
    
    /* Neutrals - Softer Background */
    --bg-main: #fff5f9;
    --bg-card: #fff5f9;
    --bg-soft: #fff0f6;
    --text-primary: #5a4a5e;
    --text-secondary: #8b7a8f;
    --text-muted: #b4a5b8;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-success: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    --shadow-colored: 0 10px 30px -10px rgba(255, 107, 157, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl);
}

/* Header Styles */
.header {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: var(--gradient-warm);
    opacity: 0.05;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    position: relative;
}

.header p {
    color: var(--text-secondary);
    font-size: 1rem;
    position: relative;
}

.header p strong {
    color: var(--primary);
    font-weight: 600;
}

.user-menu {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    background: var(--bg-card);
    padding: var(--space-md);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
}

.tab-btn i {
    font-size: 1rem;
    transition: transform var(--transition-base);
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--bg-soft);
}

.tab-btn:hover i {
    transform: scale(1.1);
}

.tab-btn.active {
    background: var(--gradient-warm);
    color: white;
    box-shadow: var(--shadow-colored);
}

.tab-btn.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: var(--gradient-warm);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Alert Messages */
.alert {
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-weight: 500;
    animation: slideInDown var(--transition-base);
    position: relative;
    overflow: hidden;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-success::before {
    background: var(--success);
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
}

.alert-error::before {
    background: var(--danger);
}

.alert i {
    font-size: 1.2rem;
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--bg-soft);
}

.card-title i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--gradient-warm);
    color: white;
    font-size: 1.1rem;
}

/* Button Styles */
.btn {
    background: var(--gradient-warm);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-colored);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width var(--transition-slow), height var(--transition-slow);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px -10px rgba(255, 107, 157, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.85rem;
}

.btn-success {
    background: var(--gradient-success);
    box-shadow: 0 10px 30px -10px rgba(11, 163, 96, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.3);
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 10px 30px -10px rgba(102, 126, 234, 0.3);
}

.btn-full {
    width: 100%;
}

/* Form Styles */
.input-group {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-input {
    flex: 1;
    min-width: 200px;
    padding: var(--space-md);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-base);
    width: 100%;
    background: var(--bg-card);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.stat-item {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Progress Circle */
.progress-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        var(--primary) calc(var(--percentage) * 3.6deg),
        #e2e8f0 0deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.progress-circle::before {
    content: '';
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-card);
    position: absolute;
}

.progress-circle span {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 1;
}

/* Task Styles */
.task-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
    border-left: 3px solid transparent;
}

.task-item:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-item.overdue {
    background: var(--danger-light);
    border-left-color: var(--danger);
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.task-checkbox:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.task-content {
    flex: 1;
}

.task-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

/* Habit Styles */
.habit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.habit-item {
    background: var(--bg-soft);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.habit-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-warm);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.habit-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.habit-item:hover::before {
    opacity: 1;
}

.habit-item.completed {
    background: var(--success-light);
    border-color: var(--success);
}

.habit-item.completed::before {
    background: var(--gradient-success);
    opacity: 1;
}

.habit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.habit-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.habit-streak {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--warning);
    margin: var(--space-sm) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.habit-streak i {
    font-size: 1.1rem;
}

.habit-progress {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.habit-progress-bar {
    height: 100%;
    background: var(--gradient-warm);
    transition: width var(--transition-slow);
    border-radius: var(--radius-full);
}

/* Finance Styles */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.finance-card {
    background: var(--bg-card);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.finance-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.finance-amount {
    font-size: 1.75rem;
    font-weight: 700;
    margin: var(--space-md) 0;
}

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

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

.balance {
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
    border-left: 3px solid transparent;
}

.transaction-item:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

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

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

/* Auth Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--space-lg);
    background: var(--gradient-primary);
}

.auth-card {
    background: var(--bg-card);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header h1 {
    font-size: 2rem;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.auth-form {
    margin-bottom: var(--space-lg);
}

.auth-footer {
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-base);
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.demo-info {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--info-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    border-left: 3px solid var(--info);
}

/* Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 500;
    min-height: 40px;
    background: var(--bg-soft);
}

.calendar-day:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.calendar-day.today {
    background: var(--gradient-warm);
    color: white;
    box-shadow: var(--shadow-colored);
}

.calendar-day.has-event {
    background: var(--success-light);
    color: var(--success);
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    margin-top: var(--space-2xl);
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-md);
}

footer p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

footer i {
    color: var(--primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
    }

    .container {
        padding: var(--space-md);
    }

    .header {
        padding: var(--space-lg);
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .user-menu {
        position: static;
        margin-top: var(--space-md);
        display: flex;
        justify-content: center;
    }

    .nav-tabs {
        padding: var(--space-sm);
    }

    .tab-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    }

    .habit-grid {
        grid-template-columns: 1fr;
    }

    .finance-summary {
        grid-template-columns: 1fr;
    }

    .card {
        padding: var(--space-lg);
    }

    .auth-card {
        padding: var(--space-xl) var(--space-lg);
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .progress-circle {
        width: 120px;
        height: 120px;
    }

    .progress-circle::before {
        width: 85px;
        height: 85px;
    }

    .progress-circle span {
        font-size: 1.25rem;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-size: 1000px 100%;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

.finance-card-modern.neutral::before {
    background: var(--gradient-warm);
}

.finance-icon.neutral {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary);
}

.finance-amount-large.neutral {
    color: var(--primary);
}
