:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --background: #0f172a;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a);
    color: var(--text-main);
    min-height: 100vh;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-container {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-form h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-form p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-group input,
.input-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.auth-link {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
}

/* Dashboard Layout */
.dashboard-page {
    display: flex;
}

.sidebar {
    width: 260px;
    height: 100vh;
    padding: 2rem;
    position: fixed;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: var(--primary);
}

.sidebar ul {
    list-style: none;
    flex-grow: 1;
}

.sidebar ul li {
    margin-bottom: 1rem;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.sidebar ul li.active a,
.sidebar ul li a:hover {
    background: var(--glass);
    color: var(--text-main);
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--glass);
    border-radius: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 2.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.currency-widget {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
}

.exchange-rate .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

.exchange-rate .value {
    font-weight: 600;
    color: var(--success);
}

/* Overview Cards */
.overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.balance .card-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

.income .card-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.expense .card-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.card-data .label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.card-data .value {
    font-size: 1.5rem;
    margin-top: 0.25rem;
}

/* Grid layout for Chart and Form */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-container,
.form-container {
    padding: 1.5rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

h3 {
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Transactions Table */
.transactions {
    padding: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.type-income {
    color: var(--success);
}

.type-expense {
    color: var(--error);
}

.amount-income {
    color: var(--success);
    font-weight: 600;
}

.amount-expense {
    color: var(--error);
    font-weight: 600;
}

.alert {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.mt-10 {
    margin-top: 10px;
}

.btn-delete {
    color: #ff4d4d;
    font-size: 1.1rem;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: rgba(255, 77, 77, 0.15);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}