:root { 
  --primary-color: #1e3a8a; /* Premium University Blue (Deep Navy) */
  --primary-hover: #1e40af; 
  --dark-theme: #0f172a; /* Slate 900 for Header */
  --light-bg: #f8fafc; 
  --text-dark: #0f172a;
  --error-bg: #fef2f2;
}

body { background: var(--light-bg); font-family: 'Inter', 'Segoe UI', sans-serif; min-height: 100vh; }

.text-theme { color: var(--primary-color) !important; }
.border-theme { border-color: var(--primary-color) !important; }

.app-header { background: var(--dark-theme); padding: 15px 0; box-shadow: 0 4px 10px rgba(0,0,0,0.1); margin-bottom: 15px; position: relative; }
.header-text-container { width: 90%; max-width: 800px; margin: 0 auto; text-align: center; }
.header-line-1, .header-line-2, .header-line-3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; color: #ffffff !important; display: block; }
.header-line-1 { font-size: 1.3rem; letter-spacing: 1px; font-weight: 800 !important; }
.header-line-2 { font-size: 1rem; margin-top: 3px !important; font-weight: 700 !important; opacity: 0.95;}
.header-line-3 { font-size: 0.8rem; margin-top: 5px !important; opacity: 0.85; font-weight: 400;}

.logout-btn { position: absolute; top: 10px; right: 10px; z-index: 10; border-radius: 6px; background: white !important; border: none; padding: 4px 10px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.logout-btn:hover { background: #fef2f2 !important; transform: translateY(-2px); }

.nav-container { background: white; padding: 6px; border-radius: 12px; border: 1px solid #f1f5f9; overflow-x: auto; scrollbar-width: none; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.nav-container::-webkit-scrollbar { display: none; }
.custom-tabs .nav-item { margin: 0 2px; flex: 1; text-align: center; }
.custom-tabs .nav-link { color: #64748b; font-weight: 600; border-radius: 10px; padding: 10px 8px; transition: all 0.3s ease; background: transparent; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; border: none; width: 100%;}
.custom-tabs .nav-link.active { background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25); }

.content-card { background: white; border-radius: 16px; padding: 15px; box-shadow: 0 8px 20px -5px rgba(0,0,0,0.05); border: 1px solid #fff; }
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 15px; }
.login-card { background: white; border-radius: 20px; padding: 30px; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1); width: 100%; max-width: 400px; }
.login-logo { width: 60px; height: 60px; background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 20px; box-shadow: 0 8px 15px rgba(30, 58, 138, 0.3);}

.custom-input-group { background: white; border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden; display: flex;}
.custom-input-group .input-group-text { background: #f8fafc; border: none; padding-left: 12px; padding-right: 12px; display: flex; align-items: center;}
.custom-input-group .form-control, .custom-input-group .form-select { border: none; box-shadow: none; background: transparent; flex-grow: 1; padding: 10px;}
.custom-input-group .form-control:focus, .custom-input-group .form-select:focus { outline: none; }

.btn-rich { transition: all 0.2s; background: var(--primary-color); border: none; color: white;}
.btn-rich:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(30, 58, 138, 0.25) !important; background: var(--primary-hover); color: white;}

.college-badge { background: white; padding: 8px 16px 8px 10px; border-radius: 40px; box-shadow: 0 8px 15px -5px rgba(0,0,0,0.05); border: 1px solid rgba(255,255,255,0.5); display: inline-flex; align-items: center; }
.icon-circle { width: 32px; height: 32px; background: var(--light-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 10px; color: var(--primary-color); font-size: 0.9rem;}
.college-name-text { color: var(--text-dark); font-weight: bold; margin: 0; font-size: 1rem;}

/* ======== SKELETON LOADER ======== */
.skeleton-container { display: none; width: 100%; }
.skeleton-container.active { display: block; }
.skeleton { background: #e2e8f0; background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: loading 1.5s infinite; border-radius: 8px; margin-bottom: 10px; }
.skel-header { height: 30px; width: 30%; margin-bottom: 15px; }
.skel-row { height: 40px; width: 100%; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ======== RESPONSIVE TABLE & ERROR HIGHLIGHTS ======== */
.table-container { border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0; background: white; }
.mobile-header { display: none; }
.mark-input, .table-input { width: 100%; min-width: 80px; text-align: center; border-radius: 6px; border: 1px solid #cbd5e1; padding: 6px; font-weight: 500; font-size: 13px; background: #f8fafc; transition: all 0.2s; }
.mark-input:focus, .table-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15); outline: none; background: white; }

.stat-box { padding: 6px !important; }

/* ERROR HIGHLIGHTING CLASSES */
.error-row td { background-color: var(--error-bg) !important; border-top: 1px solid #fca5a5 !important; border-bottom: 1px solid #fca5a5 !important; }
.is-invalid { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important; background-color: white !important; }

@media (max-width: 768px) {
  .app-header { padding: 10px 0; margin-bottom: 12px;}
  .header-line-1 { font-size: 1.1rem; }
  .header-line-2 { font-size: 0.75rem; }
  .header-line-3 { display: none; } 
  .custom-tabs .nav-link { padding: 8px 4px; font-size: 0.8rem; flex-direction: column; }
  .custom-tabs .nav-link i { margin-bottom: 3px; margin-right: 0 !important; font-size: 1rem;}
  
  .responsive-card-table thead { display: none; }
  .responsive-card-table tbody tr { display: flex; flex-direction: column; margin-bottom: 1rem; border: 1px solid #cbd5e1; border-radius: 10px; padding: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); background-color: white; }
  .responsive-card-table tbody td { display: flex; justify-content: space-between; align-items: center; border: none; padding: 8px 4px; border-bottom: 1px dashed #e2e8f0; }
  .responsive-card-table tbody td:last-child { border-bottom: none; }
  .responsive-card-table .student-name-cell { flex-direction: column; align-items: flex-start; background: #f8fafc; padding: 10px !important; border-radius: 6px; margin-bottom: 5px; }
  .mobile-header { display: block !important; font-weight: 600; color: #475569; font-size: 0.8rem; }
  .mark-input, .table-input { width: 110px; padding: 6px;}
  
  .error-row { border-color: #ef4444 !important; }
}
