@import url('variables.css');
@import url('components.css');

/* Layout Structure */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-medium);
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.nav-brand {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}
.nav-brand span { color: var(--electric-green); font-size: 1.1rem; }

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* User Profile Mini */
.user-profile-sm {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-light);
}
.user-profile-sm .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--electric-blue), var(--electric-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}
.user-profile-sm .info { flex: 1; }
.user-profile-sm .name { font-weight: 600; font-size: 0.95rem; }
.role-badge {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.2rem;
    width: 100%;
    cursor: pointer;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}
.nav-item:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
}
.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 255, 102, 0.1), transparent);
    color: var(--electric-green);
    border-left: 3px solid var(--electric-green);
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.05), transparent 40%),
                radial-gradient(circle at bottom left, rgba(0, 255, 102, 0.05), transparent 40%);
}

.topbar {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.icon-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.icon-btn:hover {
    color: var(--electric-blue);
    border-color: var(--electric-blue);
}

.main-content {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.4s ease forwards;
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}
.page-header h1 {
    margin: 0;
    font-size: 2.2rem;
    color: #064e3b; /* Dark Green */
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-medium);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-medium);
    box-shadow: var(--shadow-md);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { margin: 0; font-size: 1.25rem; }
.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}
.close-modal:hover { color: var(--text-primary); }
.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .mobile-toggle, .menu-btn { display: block; }
}
