:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --accent: #0ea5e9;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-light: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

aside {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 1000;
    transition: transform 0.3s ease;
}

aside .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

aside nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

aside nav a:hover,
aside nav a.active {
    background: #eff6ff;
    color: var(--primary);
}

/* Submenu Styles */
.nav-item-with-submenu {
    margin-bottom: 0.5rem;
}

.nav-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-weight: 500;
    cursor: pointer;
}

.nav-parent:hover,
.nav-parent.active {
    background: #eff6ff;
    color: var(--primary);
}

.submenu-arrow {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-left: 1rem;
    margin-top: 0.25rem;
}

.submenu.open {
    max-height: 500px;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    padding-left: 2.5rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    transition: all 0.2s;
    font-weight: 400;
    font-size: 0.9rem;
}

.submenu-item ion-icon {
    font-size: 1rem;
}

.submenu-item:hover {
    background: #f1f5f9;
    color: var(--text);
    padding-left: 2.75rem;
}

.submenu-item.active {
    background: #dbeafe;
    color: var(--primary);
    font-weight: 500;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.menu-toggle ion-icon {
    font-size: 1.5rem;
    display: block;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    aside {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    aside.active {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
    }

    .sidebar-overlay.active {
        display: block;
    }

    main {
        width: 100%;
        padding: 1rem;
        padding-top: 4rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.5rem;
    }
}

main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-card span.label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-card span.value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card.income .value {
    color: var(--success);
}

.stat-card.expense .value {
    color: var(--danger);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
    background: #f8fafc;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge.pending {
    background: #fff7ed;
    color: var(--warning);
}

.badge.completed {
    background: #f0fdf4;
    color: var(--success);
}

.badge.cancelled {
    background: #fef2f2;
    color: var(--danger);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #eff6ff;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}