:root {
    /* Color Palette - Soft & Premium */
    --primary: #4F46E5;
    --primary-light: #EEF2FF;
    --secondary: #10B981;
    --secondary-light: #ECFDF5;
    --accent: #F59E0B;
    --accent-light: #FFFBEB;
    --danger: #EF4444;
    --text-dark: #1F2937;
    --text-medium: #4B5563;
    --text-light: #9CA3AF;
    --bg-app: #F3F4F6;
    --bg-card: #FFFFFF;
    --border: #E5E7EB;

    /* Spacing & Radius */
    --radius-lg: 16px;
    --radius-md: 8px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition: all 0.2s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* Utilities */
.hidden {
    display: none !important;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.avatar-initial {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.student-info h2 {
    font-size: 1rem;
    font-weight: 600;
}

.student-info span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

.nav-btn {
    background: transparent;
    border: none;
    text-align: left;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-medium);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-btn:hover {
    background: var(--bg-app);
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary-light);
    color: var(--primary);
}

.separator {
    height: 1px;
    background: var(--border);
    margin: var(--space-md) 0;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: var(--space-md);
}

.current-role-badge {
    text-transform: capitalize;
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: var(--space-sm);
}

.logout-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.8rem;
    width: 100%;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.top-bar {
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-app);
    /* Matches body bg -> transparent feel */
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.top-bar h1 {
    font-size: 1.5rem;
}

.search-bar input {
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    width: 300px;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Views & Scrollable Area */
#views-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-xl) var(--space-xl) var(--space-xl);
}

/* Role Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    text-align: center;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.role-card {
    background: var(--bg-app);
    border: 2px solid transparent;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.role-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-card .icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.role-card h3 {
    margin: 0;
    color: var(--text-dark);
}

.role-card span {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Generic Components */
.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag.high {
    background: #FEE2E2;
    color: #DC2626;
}

.tag.medium {
    background: #FEF3C7;
    color: #D97706;
}

.tag.low {
    background: #E0E7FF;
    color: #4F46E5;
}

.tag.success {
    background: #D1FAE5;
    color: #059669;
}

/* Grid Layouts for Content */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* Strategy/Accordion items */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    overflow: hidden;
    background: white;
}

.accordion-header {
    padding: var(--space-md);
    background: #f9fafb;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-content {
    padding: var(--space-md);
    border-top: 1px solid var(--border);
    display: none;
}

.accordion-item.open .accordion-content {
    display: block;
}

/* Dashboard Specific */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
}

.stat-box {
    text-align: center;
    padding: var(--space-md);
    background: var(--primary-light);
    border-radius: var(--radius-md);
    color: var(--primary);
}

.stat-box .number {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

/* Tracking Form */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.btn-primary:hover {
    background: #4338ca;
}

/* Mobile Specifics */
.menu-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    color: var(--text-dark);
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 900px) {

    /* Tablet adjustments */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* Layout remains flex row, but sidebar moves off-canvas */
    .app-layout {
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        /* Hide off-screen */
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease-in-out;
        border-right: 1px solid var(--border);
    }

    .sidebar.open {
        left: 0;
    }

    .menu-toggle {
        display: block;
        /* Show on mobile */
    }

    .top-bar {
        padding: var(--space-md);
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .header-left {
        width: 100%;
        justify-content: flex-start;
    }

    .search-bar {
        width: 100%;
    }

    .search-bar input {
        width: 100%;
        /* Full width search */
    }

    .main-content {
        width: 100%;
    }

    /* Adjust grids for mobile */
    .items-grid {
        grid-template-columns: 1fr;
        /* Single column */
    }

    .role-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
    }

    #views-container {
        padding: 0 var(--space-md) var(--space-md) var(--space-md);
    }
}