:root {
    --primary: #3b82f6;
    --danger: #ef4444;
    --success: #059669;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --header-height: 64px;
    --nav-sidebar-width: 250px;
    --sidebar-bg: #FFF9C4;
    --header-bg: #ef4444;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--gray-50);
    min-height: 100vh;
    color: var(--gray-800);
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-logo {
    height: 40px;
}

.header-nav {
    margin-left: auto;
    display: flex;
    gap: 24px;
}

.header-nav a {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--nav-sidebar-width);
    background: var(--sidebar-bg);
    padding: 20px 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 99;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--nav-sidebar-width)));
}

.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: -40px;
    width: 40px;
    height: 40px;
    background: var(--sidebar-bg);
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gray-700);
    transition: background-color 0.2s;
    z-index: 98;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
    background-color: #FFF176;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-group {
    margin-bottom: 8px;
}

.nav-group-title {
    padding: 10px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background-color 0.2s;
}

.nav-group-title i {
    margin-right: 8px;
    width: 16px;
}

.nav-group-title:hover {
    background-color: #FFF176;
}

.nav-group-title .arrow {
    font-size: 1.2rem;
    color: var(--gray-600);
    transition: transform 0.2s ease;
}

.submenu {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
}

.submenu.active {
    height: auto;
}

.nav-group a {
    padding: 8px 20px 8px 36px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group:first-child a {
    padding-left: 20px;
    font-weight: 600;
}

.nav-group a i {
    width: 16px;
}

.nav-group a:hover {
    background: #FFF176;
}

.nav-group a.active {
    background: #FFF176;
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: inset 4px 0 0 var(--header-bg);
}

/* Main Content Styles */
.main-content {
    margin-left: var(--nav-sidebar-width);
    margin-top: var(--header-height);
    padding: 20px;
    transition: margin-left 0.3s ease;
    background: var(--gray-50);
    min-height: calc(100vh - var(--header-height));
}

.sidebar.collapsed + .main-content {
    margin-left: 0;
}

/* User Info Styles */
.user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.user-info i {
    font-size: 1.1rem;
}

.user-info span {
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 10px;
    }

    .sidebar {
        transform: translateX(calc(-1 * var(--nav-sidebar-width)));
    }

    .sidebar.collapsed {
        transform: translateX(0);
    }
}
