:root {
    --bg-dark: #0a0c10;
    --sidebar-bg: #111418;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --text-main: #f3f4f6;
    --text-dim: #9ca3af;
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-dark); color: var(--text-main); overflow: hidden; }

.app-container { display: flex; height: 100vh; width: 100vw; }

/* Sidebar FIX */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-shrink: 0;
    overflow-y: auto;
}

.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; padding: 0 10px; }
.logo-icon { width: 28px; height: 28px; background: var(--accent-blue); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 14px; }
.logo-text { font-size: 1.1rem; font-weight: 600; }

.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-link {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.2);
}

.submenu {
    display: none;
    padding-left: 20px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.submenu.active { display: block; }

.submenu-link {
    display: block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.8rem;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.submenu-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.submenu-link.active {
    color: var(--accent-blue);
    font-weight: 600;
}

.sidebar-footer { padding-top: 15px; border-top: 1px solid var(--card-border); font-size: 0.7rem; color: var(--text-dim); opacity: 0.6; }

/* Main Fix */
.main-content { flex: 1; padding: 15px 25px; overflow-y: auto; background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.03), transparent); }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stats-cards { grid-column: span 3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card { background: var(--card-bg); border: 1px solid var(--card-border); backdrop-filter: blur(20px); border-radius: 12px; padding: 20px; }
.stat-card .card-label { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 8px; }
.stat-card .card-value { font-size: 1.3rem; font-weight: 700; }

.income { color: var(--accent-green); }
.expense { color: var(--accent-red); }

/* Table Fix */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th { text-align: left; padding: 12px 10px; color: var(--text-dim); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; border-bottom: 1px solid var(--card-border); }
td { padding: 12px 10px; font-size: 0.85rem; border-bottom: 1px solid var(--card-border); }

.table-scroll { overflow-x: auto; width: 100%; border-radius: 8px; }

.btn-primary { background: var(--accent-blue); color: #fff; border: none; padding: 8px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.85rem; }
.btn-secondary { background: transparent; color: var(--text-dim); border: 1px solid var(--card-border); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; margin-left: 8px; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 100; justify-content: center; align-items: center; }
.modal-content { background: #161b22; width: 500px; padding: 30px; border-radius: 16px; border: 1px solid var(--card-border); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 10px; }
