/* ============================================
   IDM ESWATINI UNIVERSITY PORTAL
   Professional Dark Sidebar Theme
   Complete Responsive CSS - FIXED SCROLLING
   ============================================ */

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f1f5f9;
    color: #334155;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */
.login-body {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: url('https://picsum.photos/id/1015/2000/1200');
    background-size: cover;
    background-position: center;
    animation: subtleZoom 30s ease-in-out infinite alternate;
}

@keyframes subtleZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
}

.login-container {
    width: 100%;
    max-width: 440px;
    z-index: 10;
    margin: 0 auto;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.idm-logo {
    width: 140px;
    height: auto;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1e2937;
    margin-bottom: 6px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

.role-tabs {
    display: flex;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 8px;
    margin-bottom: 32px;
}

.role-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.role-tab i { font-size: 16px; }

.role-tab.active {
    background: #1e2937;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.role-tab:hover:not(.active) {
    background: #e2e8f0;
    color: #334155;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.input-group input:focus {
    outline: none;
    border-color: #1e2937;
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: #1e2937;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-login:hover {
    background: #334155;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.alert-error {
    padding: 14px 18px;
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 12px;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Dark Sidebar */
.sidebar {
    width: 280px;
    background: #1e2937;
    color: #e2e8f0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #334155;
    margin-bottom: 20px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.sidebar-logo span {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.sidebar-nav {
    padding: 0 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.nav-item i {
    width: 22px;
    font-size: 18px;
}

.nav-item:hover {
    background: #334155;
    color: white;
}

.nav-item.active {
    background: #334155;
    color: white;
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e2937;
    border-top: 1px solid #334155;
    padding: 16px 20px;
    margin-top: auto;
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #1e2937;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 24px 32px;
    background: #f1f5f9;
    min-height: 100vh;
    width: calc(100% - 280px);
    overflow-x: auto;
    overflow-y: visible;
}

/* Top Header */
.top-header {
    background: white;
    border-radius: 20px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
    gap: 15px;
}

.page-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1e2937;
    margin-bottom: 4px;
}

.page-title p {
    font-size: 13px;
    color: #64748b;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info .greeting {
    text-align: right;
}

.user-info .greeting .name {
    font-weight: 600;
    color: #1e2937;
    font-size: 14px;
}

.user-info .greeting .role {
    font-size: 12px;
    color: #64748b;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: #1e2937;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Content Cards */
.content-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e2937;
}

.card-header h2 i {
    margin-right: 10px;
    color: #1e2937;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: #f1f5f9;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #1e2937;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1e2937;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 13px;
    color: #64748b;
}

/* Buttons */
.btn-primary {
    background: #1e2937;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #334155;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-print {
    background: #4a5568;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-print:hover {
    background: #2d3748;
    transform: translateY(-1px);
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-edit, .btn-reset, .btn-delete {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-reset {
    background: #fef3c7;
    color: #92400e;
}

.btn-reset:hover {
    background: #fde68a;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background: #fecaca;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.filter-select, select, .form-group select {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 160px;
}

.search-input {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    width: 250px;
    transition: all 0.3s;
}

.search-input:focus, .filter-select:focus, select:focus {
    outline: none;
    border-color: #1e2937;
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1);
}

/* Tables - Fixed for Lecturer Dashboard - NO STICKY HEADERS */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th {
    text-align: left;
    padding: 14px 12px;
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 14px;
}

.data-table tr:hover {
    background: #f8fafc;
}

/* Lecturer Marks Table - FIXED SCROLLING - NO DUPLICATION */
.marks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 1000px;
    table-layout: auto;
}

.marks-table th, 
.marks-table td {
    border: 1px solid #e2e8f0;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}

.marks-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e2937;
    position: relative;
}

.marks-table td:first-child,
.marks-table td:nth-child(2) {
    text-align: left;
}

.marks-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
}

.marks-input:focus {
    outline: none;
    border-color: #1e2937;
    box-shadow: 0 0 0 2px rgba(30, 41, 59, 0.1);
}

.sub-assessment {
    font-size: 9px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.final-mark-cell {
    font-weight: 700;
    color: #1e2937;
    background: #f8fafc;
}

.weight-info {
    font-size: 9px;
    color: #64748b;
    display: block;
}

.marking-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e2937;
}

/* Text alignment */
.text-center {
    text-align: center;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

.grade-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #d1fae5;
    color: #065f46;
}

.status-active, .status-inactive {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-active { background: #d1fae5; color: #065f46; }
.status-inactive { background: #fee2e2; color: #991b1b; }

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.module-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.module-code {
    font-weight: 700;
    color: #1e2937;
    font-size: 14px;
    margin-bottom: 6px;
}

.module-name {
    font-weight: 600;
    color: #334155;
    font-size: 15px;
    margin-bottom: 8px;
}

.module-credits {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.module-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-upcoming { background: #e0e7ff; color: #3730a3; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-pending { background: #fef3c7; color: #92400e; }

/* Info Rows */
.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.info-label {
    width: 180px;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
}

.info-value {
    flex: 1;
    color: #334155;
    font-size: 13px;
}

/* Academic Banner */
.academic-banner {
    background: linear-gradient(135deg, #1e2937 0%, #334155 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 28px;
    color: white;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.banner-icon {
    font-size: 48px;
}

.banner-info h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.banner-info p {
    font-size: 13px;
    opacity: 0.85;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: #94a3b8;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* Programme Layout */
.programme-layout {
    display: flex;
    gap: 25px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.programme-sidebar {
    width: 300px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.programme-sidebar h3 {
    margin-bottom: 18px;
    font-size: 16px;
    color: #1e2937;
    border-left: 3px solid #1e2937;
    padding-left: 12px;
}

.programme-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.programme-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.programme-item:hover {
    background: #e0e7ff;
    border-color: #667eea;
}

.programme-item.active {
    background: linear-gradient(135deg, #1e2937 0%, #334155 100%);
    color: white;
    border-color: transparent;
}

.programme-icon {
    font-size: 28px;
}

.programme-info {
    flex: 1;
}

.programme-info strong {
    display: block;
    font-size: 14px;
    color: #1e2937;
}

.programme-info small {
    font-size: 11px;
    color: #64748b;
}

.btn-add-programme {
    width: 100%;
    padding: 10px;
    background: #1e2937;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.programme-content {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

.programme-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.programme-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1e2937;
}

/* Semester Grid */
.semester-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.semester-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
}

.semester-header {
    background: #f8fafc;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 10px;
}

.semester-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1e2937;
}

.module-count {
    font-size: 12px;
    color: #64748b;
    background: white;
    padding: 4px 10px;
    border-radius: 20px;
}

.semester-modules {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.module-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px;
    position: relative;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.module-item:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.module-lecturer {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-module {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ef4444;
    opacity: 0;
    transition: all 0.3s;
    background: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.module-item:hover .remove-module {
    opacity: 1;
}

.empty-semester {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
}

.add-module-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: #f1f5f9;
    border: 1px dashed #64748b;
    border-radius: 10px;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-module-btn:hover {
    background: #e0e7ff;
    border-color: #1e2937;
    color: #1e2937;
}

/* Popup Overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-container {
    background: white;
    border-radius: 20px;
    width: 480px;
    max-width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.3s ease-out;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #1e2937 0%, #334155 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.popup-header h3 {
    margin: 0;
    font-size: 18px;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
}

.popup-body {
    padding: 24px;
}

.popup-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.popup-buttons button {
    flex: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
}

.form-group input, 
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus, 
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e2937;
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1);
}

/* Table Controls */
.table-controls {
    margin-bottom: 20px;
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Print Styles */
@media print {
    body { background: white; }
    .sidebar, .top-header, .btn-print, .filter-bar, .bulk-actions, 
    .marking-controls, .modal, .mobile-menu-btn, .no-print, .print-actions,
    .clearance-banner, .sidebar-footer {
        display: none !important;
    }
    .main-content { margin: 0 !important; padding: 20px !important; width: 100% !important; overflow: visible !important; }
    .content-card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; overflow: visible !important; }
    .print-report-container { display: block !important; }
    .table-responsive { overflow: visible !important; }
    .marks-table { min-width: auto !important; }
    @page { size: A4; margin: 2cm; }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
.sidebar-overlay.active {
    display: block;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    .sidebar .sidebar-logo span,
    .sidebar .nav-item span,
    .sidebar .sidebar-footer {
        display: none;
    }
    .sidebar .nav-item {
        justify-content: center;
        padding: 14px;
    }
    .sidebar .nav-item i {
        margin: 0;
        font-size: 22px;
    }
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        padding: 20px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .marks-table {
        min-width: 900px;
    }
}

/* Mobile Landscape (576px - 768px) */
@media (max-width: 768px) {
    .main-content {
        padding: 16px;
        margin-left: 0;
        width: 100%;
    }
    
    .top-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .page-title {
        text-align: center;
    }
    .user-info {
        justify-content: center;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    .sidebar .sidebar-logo span,
    .sidebar .nav-item span,
    .sidebar .sidebar-footer {
        display: block;
    }
    .sidebar .nav-item {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    .sidebar .nav-item i {
        font-size: 18px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .mobile-menu-btn {
        display: block;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    .filter-group {
        width: 100%;
    }
    .filter-select, select {
        width: 100%;
    }
    .marking-controls {
        flex-direction: column;
        width: 100%;
    }
    .marking-controls input {
        width: 100%;
    }
    .bulk-actions {
        flex-direction: column;
    }
    .bulk-actions button {
        width: 100%;
    }
    .info-row {
        flex-direction: column;
    }
    .info-label {
        width: 100%;
        margin-bottom: 5px;
    }
    .banner-content {
        flex-direction: column;
        text-align: center;
    }
    .modules-grid {
        grid-template-columns: 1fr;
    }
    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .programme-layout {
        flex-direction: column;
    }
    .programme-sidebar {
        width: 100%;
        position: static;
    }
    .programme-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        max-height: none;
    }
    .semester-modules {
        grid-template-columns: 1fr;
    }
    .actions {
        flex-direction: column;
        align-items: flex-start;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .data-table {
        min-width: 500px;
    }
    .marks-table {
        min-width: 800px;
    }
    .marks-input {
        width: 55px;
        padding: 4px;
        font-size: 11px;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Mobile Portrait (up to 576px) */
@media (max-width: 576px) {
    .login-card {
        padding: 30px 22px;
    }
    .role-tabs {
        flex-direction: column;
        gap: 8px;
    }
    .role-tab {
        width: 100%;
    }
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    .programme-sidebar {
        padding: 15px;
    }
    .programme-content {
        padding: 18px;
    }
    .semester-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .popup-container {
        width: 95%;
    }
    .popup-header {
        padding: 15px 18px;
    }
    .popup-body {
        padding: 18px;
    }
    .modal-content {
        width: 95%;
    }
    .search-input {
        width: 100%;
        max-width: none;
    }
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    .page-title h1 {
        font-size: 20px;
    }
    .logo-small {
        font-size: 18px;
    }
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .marks-table th, 
    .marks-table td {
        padding: 6px 4px;
        font-size: 10px;
    }
    .marks-input {
        width: 50px;
        font-size: 10px;
    }
    .marks-table {
        min-width: 700px;
    }
}

/* Extra Small Devices (up to 380px) */
@media (max-width: 380px) {
    .login-card {
        padding: 25px 18px;
    }
    .idm-logo {
        width: 100px;
    }
    .login-header h1 {
        font-size: 20px;
    }
    .role-tab {
        font-size: 12px;
        padding: 10px;
    }
    .btn-login {
        padding: 12px;
        font-size: 14px;
    }
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    .stat-info h3 {
        font-size: 22px;
    }
    .content-card {
        padding: 16px;
    }
    .card-header h2 {
        font-size: 16px;
    }
    .programme-item {
        padding: 8px 12px;
    }
    .programme-icon {
        font-size: 24px;
    }
    .programme-info strong {
        font-size: 12px;
    }
    .programme-info small {
        font-size: 10px;
    }
    .marks-table {
        min-width: 600px;
    }
}

/* Fix for very small devices */
@media (max-width: 320px) {
    .programme-list {
        grid-template-columns: 1fr;
    }
    .data-table th,
    .data-table td {
        padding: 6px 4px;
        font-size: 10px;
    }
    .btn-edit, .btn-reset, .btn-delete {
        padding: 3px 6px;
        font-size: 10px;
    }
    .marks-table {
        min-width: 550px;
    }
}

/* Hide scrollbar for cleaner look on mobile */
@media (max-width: 768px) {
    .sidebar::-webkit-scrollbar {
        width: 4px;
    }
    .programme-list::-webkit-scrollbar {
        width: 4px;
    }
}

/* Print Report Container */
.print-report-container {
    display: none;
}

/* Clearance Banner */
.clearance-banner {
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}
.clearance-banner.cleared {
    background: #d1fae5;
    border-left: 4px solid #059669;
}
.clearance-banner.blocked {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
}
.clearance-icon {
    font-size: 24px;
}
.clearance-message {
    flex: 1;
}
.clearance-message h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
}
.clearance-message p {
    margin: 0;
    font-size: 13px;
}
.btn-contact {
    background: #1e2937;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
}
.results-disabled {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 16px;
    width: 100%;
}
.results-disabled i {
    font-size: 48px;
    color: #94a3b8;
    margin-bottom: 16px;
}
.nav-item.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}