/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #6366f1; /* Indigo 500 */
    --accent-secondary: #a855f7; /* Purple 500 */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.logo-img {
    height: 40px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    color: var(--text-primary);
    border-left: 3px solid var(--accent-primary);
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    width: calc(100% - 260px);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--text-secondary);
}

.stat-card.balance::before { background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary)); }
.stat-card.income::before { background: var(--success); }
.stat-card.expense::before { background: var(--danger); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

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

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.balance .stat-icon { background: rgba(99, 102, 241, 0.1); color: var(--accent-primary); }
.income .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.expense .stat-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* Charts Section */
.charts-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    height: 400px;
}

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

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Recent Transactions */
.recent-transactions {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

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

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 1rem;
    font-size: 0.9rem;
}

.transactions-table td {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.transaction-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    float: left;
}

.amount {
    font-weight: 600;
}
.amount.income { color: var(--success); }
.amount.expense { color: var(--danger); }

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}
.status-paid { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--glass-border);
    animation: slideUp 0.3s ease;
}

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

.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    flex: 1;
}

.btn-submit {
    flex: 1;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 1rem; }
    .charts-container { grid-template-columns: 1fr; }
}
