/* School Management System - Modern Styling */

:root {
    --primary-color: #2d5f3f;
    --primary-dark: #1e3f2a;
    --primary-light: #4a8f5f;
    --secondary-color: #3d7c47;
    --accent-color: #6b9f78;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 15px 10px;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
}

.sidebar-toggle-btn {
    position: absolute;
    top: 25px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 14px;
    z-index: 1001;
    transition: all 0.3s;
}

.sidebar-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.sidebar.collapsed .sidebar-toggle-btn {
    right: -15px;
}

.sidebar-header {
    padding: 20px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid white;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 15px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border-left-color: white;
}

.nav-item.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
    border-left-color: white;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 18px;
    opacity: 1;
    color: rgba(255, 255, 255, 1);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
}

.top-header {
    background: white;
    padding: 10px 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-dark);
    display: none;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-light);
}

.sidebar-toggle i {
    font-size: 20px;
    opacity: 1;
    color: var(--text-dark);
}

.top-header .page-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.top-header h1 {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.top-header .page-title {
    font-size: 18px;
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.top-header .breadcrumb {
    font-size: 11px;
    margin-bottom: 2px;
    color: var(--text-light);
}

.top-header .breadcrumb a {
    color: var(--primary-color);
    font-weight: 500;
}

.top-header .breadcrumb i {
    color: var(--text-light);
    opacity: 0.7;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: var(--text-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name i {
    font-size: 16px;
    opacity: 1;
    color: var(--text-dark);
}

.user-role {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.logout-btn {
    color: var(--danger-color);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.logout-btn i {
    font-size: 14px;
    opacity: 1;
    color: var(--danger-color);
}

.logout-btn:hover {
    background-color: var(--bg-light);
}

.content-wrapper {
    padding: 20px;
}

/* Chart Container Styles */
.chart-container {
    position: relative;
    width: 100%;
}

/* Responsive Chart Grid */
.charts-grid {
    display: grid;
    gap: 25px;
    margin-top: 30px;
}

.charts-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}

.charts-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

@media (max-width: 1024px) {
    .charts-grid-2,
    .charts-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    margin: -20px -20px 15px -20px;
    padding: 15px 20px;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.card-title i {
    color: white;
    opacity: 1;
    font-size: 18px;
}

.card-body {
    padding: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 26px;
    opacity: 1;
    color: white;
}

.stat-icon.primary { 
    background: linear-gradient(135deg, #2d5f3f 0%, #4a8f5f 100%);
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.3);
}

.stat-icon.success { 
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.stat-icon.warning { 
    background: linear-gradient(135deg, #ffc107 0%, #ffcd39 100%);
    color: #856404;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.stat-icon.warning i {
    color: #856404;
}

.stat-icon.info { 
    background: linear-gradient(135deg, #17a2b8 0%, #3fc1d8 100%);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.stat-icon.danger { 
    background: linear-gradient(135deg, #dc3545 0%, #e4606d 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: var(--primary-color);
    color: white;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--bg-light);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #d1e7dd; color: var(--primary-dark); }

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Styled Form */
.styled-form {
    max-width: 100%;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title:first-child {
    margin-top: 0;
}

.form-section-title i {
    font-size: 20px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-group label i {
    color: var(--primary-color);
    width: 18px;
    font-size: 16px;
}

.form-group label .required {
    color: var(--danger-color);
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--primary-light);
}

.form-note {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 25px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #1565c0;
    font-size: 14px;
    line-height: 1.6;
}

.form-note i {
    margin-top: 2px;
    font-size: 18px;
}

.form-note strong {
    color: #0d47a1;
}

.form-submit {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

/* Assignment Rows */
.assignment-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.assignment-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(45, 95, 63, 0.1);
}

.assignment-field {
    display: flex;
    flex-direction: column;
}

.assignment-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.assignment-field label i {
    color: var(--primary-color);
    width: 18px;
    font-size: 16px;
}

.assignment-field select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
}

.assignment-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.btn-remove {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    border: 2px solid var(--danger-color);
    background: white;
    color: var(--danger-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
    margin-bottom: 0;
    align-self: end;
}

.btn-remove:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .assignment-row {
        grid-template-columns: 1fr;
    }
    
    .btn-remove {
        width: 100%;
        align-self: stretch;
    }
    
    .form-submit {
        flex-direction: column;
    }
    
    .form-submit .btn {
        width: 100%;
    }
}

/* =========================================================
   Sidebar width overrides (final)
   Fixes cases where duplicated CSS blocks override layout,
   causing empty space when the sidebar is collapsed.
   ========================================================= */
.dashboard-container .sidebar.collapsed {
    width: 80px !important;
}

.dashboard-container .sidebar.collapsed ~ .main-content {
    margin-left: 80px !important;
    width: calc(100% - 80px) !important;
}

@media (max-width: 768px) {
    /* On small screens, expanded sidebar is a drawer: content uses full width */
    .dashboard-container .sidebar:not(.collapsed) ~ .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Modern Form Styles */
.modern-form {
    max-width: 100%;
}

.form-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.form-section-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section-header i {
    font-size: 24px;
}

.form-section-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.form-section-body {
    padding: 25px;
}

.modern-form-group {
    position: relative;
}

.modern-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.modern-form-group label i {
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

.modern-form-group input,
.modern-form-group select,
.modern-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
}

.modern-form-group input:focus,
.modern-form-group select:focus,
.modern-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.modern-form-group input:hover,
.modern-form-group select:hover {
    border-color: var(--primary-light);
}

.form-info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #1565c0;
    margin-top: 10px;
}

.form-info-box i {
    margin-top: 2px;
    font-size: 18px;
}

.form-info-box span {
    line-height: 1.6;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

.btn-large {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
}

/* Assignment Rows */
.modern-assignment-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.modern-assignment-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(45, 95, 63, 0.1);
}

.assignment-select-group {
    display: flex;
    flex-direction: column;
}

.assignment-select-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.assignment-select-group label i {
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

.assignment-select-group select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
}

.assignment-select-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.btn-remove-assignment {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    border: 2px solid var(--danger-color);
    background: white;
    color: var(--danger-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
    margin-bottom: 0;
}

.btn-remove-assignment:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .modern-assignment-row {
        grid-template-columns: 1fr;
    }
    
    .btn-remove-assignment {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-large {
        width: 100%;
    }
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-icon {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-edit {
    background: var(--info-color);
    color: white;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-view {
    background: var(--primary-color);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 280px !important;
        z-index: 2000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        /* Collapsed should stay visible (icons only) */
        transform: translateX(0);
        width: 80px !important;
    }
    
    .sidebar.collapsed.mobile-open {
        transform: translateX(0);
        width: 80px !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    /* When collapsed (icons-only) on small screens, keep content visible */
    .sidebar.collapsed + .main-content {
        margin-left: 80px !important;
        width: calc(100% - 80px) !important;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
    
    /* Keep the collapse chevron available on small screens too */
    .sidebar-toggle-btn {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid-2,
    .charts-grid-4 {
        grid-template-columns: 1fr !important;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: scroll;
    }

    /* On mobile, hide "List" toggle (grid cards are the intended UX) */
    .view-toggle-btn[data-view="list"] {
        display: none !important;
    }
}

/* Student Cards Grid */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.student-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.student-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.student-card-header {
    position: relative;
    padding: 25px 25px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.student-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    margin: 0 auto;
    border: 4px solid rgba(255,255,255,0.3);
}

.student-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
}

.student-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.student-card-body {
    padding: 20px 25px;
}

.student-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    text-align: center;
}

.student-id {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 20px;
    font-weight: 500;
}

.student-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    transition: background 0.2s;
}

.student-info-item:hover {
    background: #e8eef2;
}

.student-info-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 16px;
}

.student-info-item span {
    flex: 1;
    color: var(--text-dark);
    font-size: 14px;
}

.student-card-footer {
    display: flex;
    gap: 8px;
    padding: 15px 25px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    justify-content: center;
}

.btn-action {
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-action.btn-view {
    background: #3498db;
    color: white;
}

.btn-action.btn-view:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.btn-action.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-action.btn-edit:hover {
    background: #e67e22;
    transform: scale(1.1);
}

.btn-action.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-action.btn-delete:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.btn-action.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-action.btn-info:hover {
    background: #138496;
    transform: scale(1.1);
}

/* View Toggle Buttons */
.view-toggle-btn {
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-dark);
    transition: all 0.3s;
}

.view-toggle-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Students List View */
.students-list {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.students-list .table {
    margin: 0;
}

.students-list .table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.students-list .table tbody tr {
    transition: all 0.2s;
}

.students-list .table tbody tr:hover {
    background-color: var(--bg-light);
    transform: scale(1.01);
}

.empty-state-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.empty-state-card i {
    font-size: 80px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state-card h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-state-card p {
    color: var(--text-light);
}

/* Profile Info Grid */
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.profile-info-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.profile-info-item:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.profile-info-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.profile-info-content {
    flex: 1;
}

.profile-info-content label {
    display: block;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.profile-info-content p {
    margin: 0;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 500;
}

/* Student Profile Header */
.student-profile-header {
    position: relative;
    overflow: hidden;
}

.student-profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.student-profile-header > div {
    position: relative;
    z-index: 1;
}

/* Bulk Actions */
.bulk-actions {
    position: sticky;
    bottom: 20px;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .students-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-info-grid {
        grid-template-columns: 1fr;
    }
    
    .student-card-header {
        padding: 20px 20px 15px;
    }
    
    .student-avatar {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: var(--border-color);
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .btn,
    .action-buttons {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
}


:root {
    --primary-color: #2d5f3f;
    --primary-dark: #1e3f2a;
    --primary-light: #4a8f5f;
    --secondary-color: #3d7c47;
    --accent-color: #6b9f78;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 15px 10px;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
}

.sidebar-toggle-btn {
    position: absolute;
    top: 25px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 14px;
    z-index: 1001;
    transition: all 0.3s;
}

.sidebar-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.sidebar.collapsed .sidebar-toggle-btn {
    right: -15px;
}

.sidebar-header {
    padding: 20px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid white;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 15px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border-left-color: white;
}

.nav-item.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
    border-left-color: white;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 18px;
    opacity: 1;
    color: rgba(255, 255, 255, 1);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
}

.top-header {
    background: white;
    padding: 10px 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-dark);
    display: none;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-light);
}

.sidebar-toggle i {
    font-size: 20px;
    opacity: 1;
    color: var(--text-dark);
}

.top-header .page-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.top-header h1 {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.top-header .page-title {
    font-size: 18px;
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.top-header .breadcrumb {
    font-size: 11px;
    margin-bottom: 2px;
    color: var(--text-light);
}

.top-header .breadcrumb a {
    color: var(--primary-color);
    font-weight: 500;
}

.top-header .breadcrumb i {
    color: var(--text-light);
    opacity: 0.7;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: var(--text-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name i {
    font-size: 16px;
    opacity: 1;
    color: var(--text-dark);
}

.user-role {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.logout-btn {
    color: var(--danger-color);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.logout-btn i {
    font-size: 14px;
    opacity: 1;
    color: var(--danger-color);
}

.logout-btn:hover {
    background-color: var(--bg-light);
}

.content-wrapper {
    padding: 20px;
}

/* Chart Container Styles */
.chart-container {
    position: relative;
    width: 100%;
}

/* Responsive Chart Grid */
.charts-grid {
    display: grid;
    gap: 25px;
    margin-top: 30px;
}

.charts-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}

.charts-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

@media (max-width: 1024px) {
    .charts-grid-2,
    .charts-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    margin: -20px -20px 15px -20px;
    padding: 15px 20px;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.card-title i {
    color: white;
    opacity: 1;
    font-size: 18px;
}

.card-body {
    padding: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 26px;
    opacity: 1;
    color: white;
}

.stat-icon.primary { 
    background: linear-gradient(135deg, #2d5f3f 0%, #4a8f5f 100%);
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.3);
}

.stat-icon.success { 
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.stat-icon.warning { 
    background: linear-gradient(135deg, #ffc107 0%, #ffcd39 100%);
    color: #856404;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.stat-icon.warning i {
    color: #856404;
}

.stat-icon.info { 
    background: linear-gradient(135deg, #17a2b8 0%, #3fc1d8 100%);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.stat-icon.danger { 
    background: linear-gradient(135deg, #dc3545 0%, #e4606d 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: var(--primary-color);
    color: white;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--bg-light);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #d1e7dd; color: var(--primary-dark); }

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Styled Form */
.styled-form {
    max-width: 100%;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title:first-child {
    margin-top: 0;
}

.form-section-title i {
    font-size: 20px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-group label i {
    color: var(--primary-color);
    width: 18px;
    font-size: 16px;
}

.form-group label .required {
    color: var(--danger-color);
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--primary-light);
}

.form-note {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 25px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #1565c0;
    font-size: 14px;
    line-height: 1.6;
}

.form-note i {
    margin-top: 2px;
    font-size: 18px;
}

.form-note strong {
    color: #0d47a1;
}

.form-submit {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

/* Assignment Rows */
.assignment-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.assignment-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(45, 95, 63, 0.1);
}

.assignment-field {
    display: flex;
    flex-direction: column;
}

.assignment-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.assignment-field label i {
    color: var(--primary-color);
    width: 18px;
    font-size: 16px;
}

.assignment-field select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
}

.assignment-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.btn-remove {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    border: 2px solid var(--danger-color);
    background: white;
    color: var(--danger-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
    margin-bottom: 0;
    align-self: end;
}

.btn-remove:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .assignment-row {
        grid-template-columns: 1fr;
    }
    
    .btn-remove {
        width: 100%;
        align-self: stretch;
    }
    
    .form-submit {
        flex-direction: column;
    }
    
    .form-submit .btn {
        width: 100%;
    }
}

/* Modern Form Styles */
.modern-form {
    max-width: 100%;
}

.form-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.form-section-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section-header i {
    font-size: 24px;
}

.form-section-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.form-section-body {
    padding: 25px;
}

.modern-form-group {
    position: relative;
}

.modern-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.modern-form-group label i {
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

.modern-form-group input,
.modern-form-group select,
.modern-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
}

.modern-form-group input:focus,
.modern-form-group select:focus,
.modern-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.modern-form-group input:hover,
.modern-form-group select:hover {
    border-color: var(--primary-light);
}

.form-info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #1565c0;
    margin-top: 10px;
}

.form-info-box i {
    margin-top: 2px;
    font-size: 18px;
}

.form-info-box span {
    line-height: 1.6;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

.btn-large {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
}

/* Assignment Rows */
.modern-assignment-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.modern-assignment-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(45, 95, 63, 0.1);
}

.assignment-select-group {
    display: flex;
    flex-direction: column;
}

.assignment-select-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.assignment-select-group label i {
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

.assignment-select-group select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
}

.assignment-select-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.btn-remove-assignment {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    border: 2px solid var(--danger-color);
    background: white;
    color: var(--danger-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
    margin-bottom: 0;
}

.btn-remove-assignment:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .modern-assignment-row {
        grid-template-columns: 1fr;
    }
    
    .btn-remove-assignment {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-large {
        width: 100%;
    }
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-icon {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-edit {
    background: var(--info-color);
    color: white;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-view {
    background: var(--primary-color);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 280px !important;
        z-index: 2000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
        width: 280px !important;
    }
    
    .sidebar.collapsed.mobile-open {
        transform: translateX(0);
        width: 280px !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
    
    .sidebar-toggle-btn {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid-2,
    .charts-grid-4 {
        grid-template-columns: 1fr !important;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: scroll;
    }
}

/* Student Cards Grid */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.student-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.student-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.student-card-header {
    position: relative;
    padding: 25px 25px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.student-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    margin: 0 auto;
    border: 4px solid rgba(255,255,255,0.3);
}

.student-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
}

.student-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.student-card-body {
    padding: 20px 25px;
}

.student-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    text-align: center;
}

.student-id {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 20px;
    font-weight: 500;
}

.student-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    transition: background 0.2s;
}

.student-info-item:hover {
    background: #e8eef2;
}

.student-info-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 16px;
}

.student-info-item span {
    flex: 1;
    color: var(--text-dark);
    font-size: 14px;
}

.student-card-footer {
    display: flex;
    gap: 8px;
    padding: 15px 25px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    justify-content: center;
}

.btn-action {
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-action.btn-view {
    background: #3498db;
    color: white;
}

.btn-action.btn-view:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.btn-action.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-action.btn-edit:hover {
    background: #e67e22;
    transform: scale(1.1);
}

.btn-action.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-action.btn-delete:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.btn-action.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-action.btn-info:hover {
    background: #138496;
    transform: scale(1.1);
}

/* View Toggle Buttons */
.view-toggle-btn {
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-dark);
    transition: all 0.3s;
}

.view-toggle-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Students List View */
.students-list {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.students-list .table {
    margin: 0;
}

.students-list .table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.students-list .table tbody tr {
    transition: all 0.2s;
}

.students-list .table tbody tr:hover {
    background-color: var(--bg-light);
    transform: scale(1.01);
}

.empty-state-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.empty-state-card i {
    font-size: 80px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state-card h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-state-card p {
    color: var(--text-light);
}

/* Profile Info Grid */
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.profile-info-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.profile-info-item:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.profile-info-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.profile-info-content {
    flex: 1;
}

.profile-info-content label {
    display: block;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.profile-info-content p {
    margin: 0;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 500;
}

/* Student Profile Header */
.student-profile-header {
    position: relative;
    overflow: hidden;
}

.student-profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.student-profile-header > div {
    position: relative;
    z-index: 1;
}

/* Bulk Actions */
.bulk-actions {
    position: sticky;
    bottom: 20px;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .students-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-info-grid {
        grid-template-columns: 1fr;
    }
    
    .student-card-header {
        padding: 20px 20px 15px;
    }
    
    .student-avatar {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: var(--border-color);
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .btn,
    .action-buttons {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
}










