/* ===== BASE STYLES ===== */
:root {
  /* Light Theme */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #7c3aed;
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  /* Neutrals */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  /* Borders */
  --border-color: #e5e7eb;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-width: 320px;
  --top-nav-height: 64px;
}

.dark-theme {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary: #8b5cf6;

  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;

  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;

  --border-color: #374151;
  --gray-100: #1f2937;
  --gray-200: #374151;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

/* Global scrollbar hide */
*::-webkit-scrollbar {
  display: none;
}

* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  transition: var(--transition);
}

.container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  height: var(--top-nav-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.logo-text h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.logo-highlight {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.nav-divider {
  width: 1px;
  height: 32px;
  background: var(--border-color);
}

.system-info {
  display: flex;
  gap: 24px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-item i {
  font-size: 1.25rem;
  color: var(--primary);
  background: var(--bg-secondary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-right {
  display: flex;
  align-items: center;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.nav-btn:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== MAIN DASHBOARD ===== */
.main-dashboard {
  display: flex;
  min-height: calc(100vh - var(--top-nav-height));
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 24px;
}

/* ===== PROGRAM SIDEBAR ===== */
.program-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}

.sidebar-header h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.sidebar-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.sidebar-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* Upload Card */
.upload-card {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  transition: var(--transition);
}

.upload-card:hover {
  border-color: var(--primary);
  background: linear-gradient(to bottom, var(--bg-card), var(--bg-secondary));
}

.upload-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  margin: 0 auto 16px;
}

.upload-card h4 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.upload-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 12px;
}

.upload-area:hover {
  background: var(--gray-100);
  border-color: var(--primary);
}

.upload-area i {
  font-size: 2rem;
  color: var(--primary);
}

.upload-area span {
  font-weight: 500;
  color: var(--text-primary);
}

.upload-area input {
  display: none;
}

.file-types {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Program Filters */
.program-filters {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 24px;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.filter-header h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.filter-clear {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.filter-clear:hover {
  background: var(--gray-100);
}

.filter-search {
  position: relative;
  margin-bottom: 16px;
}

.filter-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  transition: var(--transition);
}

.filter-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.program-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.program-group {
  margin-bottom: 16px;
}

.program-group-header {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.program-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.program-group-count {
  background: var(--gray-200);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.program-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-left: 4px;
}

.program-section-btn {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.program-section-btn:hover {
  background: var(--gray-100);
  border-color: var(--primary-light);
  color: var(--primary);
}

.program-section-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.program-section-btn .section-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Statistics Card */
.statistics-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.statistics-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-box {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.total-exams {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: white;
}

.total-students {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
}

.total-rooms {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
}

.active-faculty {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: white;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  /* For proper flexbox sizing */
}

/* Content Header */
.content-header {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.875rem;
}

.breadcrumb-item {
  color: var(--text-muted);
}

.breadcrumb-item.active {
  color: var(--primary);
  font-weight: 600;
}

.breadcrumb i {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.content-header h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.header-actions {
  margin-top: 20px;
}

.action-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.action-btn i {
  font-size: 1rem;
}

.action-btn.print {
  background: var(--gray-100);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.action-btn.print:hover {
  background: var(--gray-200);
}

.action-btn.export {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
}

.action-btn.export:hover {
  background: linear-gradient(135deg, #0da271, #2bbf8a);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.action-btn.pdf {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: white;
}

.action-btn.pdf:hover {
  background: linear-gradient(135deg, #dc2626, #f05252);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.action-btn.refresh {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.action-btn.refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.action-btn.image-dl {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: white;
}

.action-btn.image-dl:hover {
  background: linear-gradient(135deg, #0284c7, #0891b2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

/* Active format selector in image download modal */
.active-format {
  outline: 3px solid white;
  outline-offset: 2px;
  opacity: 1 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4) !important;
}

/* Selected Program Info */
.selected-program-info {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 0;
  overflow: hidden;
}

.program-card {
  display: flex;
  align-items: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
  border-left: 4px solid var(--primary);
}

.program-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  margin-right: 20px;
  flex-shrink: 0;
}

.program-details {
  flex: 1;
}

.program-details h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.program-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.meta-item i {
  color: var(--primary);
}

.program-stats {
  display: flex;
  gap: 24px;
}

.mini-stat {
  text-align: center;
  padding: 0 16px;
}

.mini-stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.mini-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Table Section */
.table-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
}

.table-header h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.125rem;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 4px;
}

.view-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.view-btn.active {
  background: var(--bg-primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.table-search {
  position: relative;
}

.table-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.table-search input {
  padding: 10px 12px 10px 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  width: 200px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
}

.table-search input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Table Container */
.table-container {
  flex: 1;
  position: relative;
  min-height: 400px;
}

.loading-state,
.empty-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}

.loading-spinner {
  margin-bottom: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-illustration {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 3rem;
  margin-bottom: 24px;
}

.empty-state h3 {
  margin-bottom: 12px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
  text-align: center;
  max-width: 400px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  text-decoration: none;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* Table View */
.table-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.table-scroll {
  flex: 1;
  overflow: auto;
  padding: 0 24px;
}

#scheduleTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1200px;
}

#scheduleTable thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

#scheduleTable th {
  background: var(--gray-50);
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.dark-theme #scheduleTable th {
  background: var(--gray-800);
}

#scheduleTable td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-primary);
}

#scheduleTable tr:hover {
  background: var(--gray-50);
}

.dark-theme #scheduleTable tr:hover {
  background: var(--gray-800);
}

#scheduleTable tr:last-child td {
  border-bottom: none;
}

/* Highlight specific columns */
#scheduleTable td:nth-child(1),
/* DATE */
#scheduleTable td:nth-child(6) {
  /* TIMING */
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

#scheduleTable td:nth-child(5) {
  /* NO. OF STUDENTS */
  text-align: center;
  font-weight: 600;
  color: var(--primary);
}

#scheduleTable td:nth-child(9) {
  /* ROOM NO. */
  font-weight: 600;
  color: var(--secondary);
}

/* Table Footer */
.table-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
}

.table-info {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pagination-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Content Footer */
.content-footer {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-info,
.system-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-info span,
.system-info span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.contact-info i,
.system-info i {
  color: var(--primary);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  background: var(--bg-card);
  border-left: 4px solid var(--success);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(100%);
  opacity: 0;
  animation: slideIn 0.3s forwards;
}

@keyframes slideIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-color: var(--success);
}

.toast.warning {
  border-color: var(--warning);
}

.toast.error {
  border-color: var(--danger);
}

.toast.info {
  border-color: var(--info);
}

.toast-icon {
  font-size: 1.25rem;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast.info .toast-icon {
  color: var(--info);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.toast-message {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1400px) {
  .main-dashboard {
    flex-direction: column;
  }

  .program-sidebar {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .container {
    padding: 0 16px;
  }

  .nav-left {
    gap: 16px;
  }

  .system-info {
    display: none;
  }

  .program-stats {
    display: none;
  }

  .header-actions {
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .nav-container {
    padding: 0 12px;
  }

  .user-details {
    display: none;
  }

  .content-header {
    flex-direction: column;
    gap: 16px;
  }

  .action-group {
    width: 100%;
    justify-content: center;
  }

  .table-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .table-controls {
    flex-direction: column;
    gap: 12px;
  }

  .table-search input {
    width: 100%;
  }

  .content-footer {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-left,
  .footer-right {
    width: 100%;
    justify-content: center;
  }

  .contact-info,
  .system-info {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .program-sections {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .program-card {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .program-icon {
    margin-right: 0;
  }

  .program-meta {
    justify-content: center;
  }
}

/* ===== FILE UPLOAD IMPROVEMENTS ===== */
.upload-card {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-card:hover {
  border-color: var(--primary);
  background: linear-gradient(to bottom, var(--bg-card), var(--bg-secondary));
}

.upload-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.upload-card:hover::before {
  opacity: 1;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 32px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 12px;
  position: relative;
  min-height: 120px;
  justify-content: center;
}

.upload-area:hover {
  background: var(--gray-100);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.upload-area.dragover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
  border-color: var(--primary);
  border-style: solid;
}

.upload-area i {
  font-size: 2.5rem;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.upload-area:hover i {
  transform: scale(1.1);
}

.upload-area span {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.upload-area input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  top: 0;
  left: 0;
}

.file-types {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.file-name {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
  margin-top: 8px;
  word-break: break-all;
  max-width: 100%;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

/* ===== NO PROGRAMS STATE ===== */
.no-programs {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.no-programs i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--gray-400);
}

.no-programs p {
  font-size: 0.875rem;
}

/* ===== TABLE IMPROVEMENTS ===== */
#scheduleTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1200px;
}

#scheduleTable thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

#scheduleTable th {
  background: var(--gray-50);
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.dark-theme #scheduleTable th {
  background: var(--gray-800);
}

#scheduleTable td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}

#scheduleTable tr {
  transition: background-color 0.2s ease;
}

#scheduleTable tr:hover {
  background: var(--gray-50);
}

.dark-theme #scheduleTable tr:hover {
  background: var(--gray-800);
}

#scheduleTable tr:last-child td {
  border-bottom: none;
}

/* Date column specific styling */
#scheduleTable td:nth-child(1) {
  /* DATE */
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 500;
  color: var(--primary);
  white-space: nowrap;
}

/* Make sure Arabic text displays properly */
[dir="rtl"] #scheduleTable th,
[dir="rtl"] #scheduleTable td {
  text-align: right;
}

[dir="rtl"] .program-group-title {
  flex-direction: row-reverse;
}

[dir="rtl"] .info-item {
  flex-direction: row-reverse;
}

/* Add this to style.css for better file upload feedback */

.file-name {
  font-size: 0.875rem;
  color: var(--success);
  font-weight: 500;
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--success);
  word-break: break-all;
  max-width: 100%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.no-programs {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.no-programs i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--gray-400);
}

.no-programs p {
  font-size: 0.875rem;
}

/* Make sure upload area is clearly visible */
.upload-area {
  border: 2px dashed var(--border-color);
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--gray-100);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.upload-area.dragover {
  border-color: var(--primary);
  border-style: solid;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
}

.upload-area i {
  font-size: 2.5rem;
  color: var(--primary);
}

/* Loading state styling */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== INSTRUCTION MODAL ===== */
.instruction-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.instruction-content {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s ease;
  border: 1px solid var(--border-color);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.instruction-header {
  padding: 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.instruction-header h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  margin: 0;
  color: white;
}

.instruction-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.2rem;
}

.instruction-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.instruction-body {
  padding: 30px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.instruction-body h4 {
  color: var(--primary);
  margin-bottom: 25px;
  font-size: 1.25rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.instruction-step {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.instruction-step:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow);
}

.step-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h5 {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.step-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.important-note {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
  border-radius: var(--border-radius);
  padding: 20px;
  margin: 30px 0;
  border-left: 4px solid var(--warning);
}

.important-note h5 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warning);
  margin-bottom: 15px;
}

.important-note ul {
  padding-left: 20px;
  margin: 0;
}

.important-note li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.instruction-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.instruction-footer .primary-btn {
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: 600;
}

.dont-show-again {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.dont-show-again input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .instruction-content {
    width: 95%;
    max-height: 95vh;
  }

  .instruction-step {
    flex-direction: column;
    gap: 15px;
  }

  .step-number {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .instruction-body {
    padding: 20px;
  }

  .instruction-step {
    padding: 15px;
  }
}

/* ===== PORTFOLIO SECTION ===== */
.portfolio-section {
  margin-top: 15px;
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.portfolio-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
}

.portfolio-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  background: linear-gradient(135deg, var(--secondary-dark), var(--accent-dark));
}

.portfolio-info {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 10px;
  z-index: 100;
  min-width: 300px;
  animation: fadeIn 0.3s ease;
}

.portfolio-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.portfolio-card h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.developer-details {
  margin-bottom: 20px;
}

.developer-details p {
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.developer-details strong {
  color: var(--text-secondary);
  min-width: 120px;
  display: inline-block;
}

.developer-details a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.developer-details a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

.portfolio-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.secondary-btn {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.secondary-btn:hover {
  background: var(--gray-100);
  color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .portfolio-section {
    justify-content: center;
    margin-top: 20px;
  }

  .portfolio-info {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    right: auto;
  }

  .portfolio-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .content-footer {
    text-align: center;
  }

  .footer-right {
    align-items: center;
  }

  .portfolio-btn {
    width: 100%;
    justify-content: center;
  }
}