  :root {
    --primary: #3a8bcd;
    --primary-dark: #2a6ea0;
    --accent: #2e8b57;
    --bg: #f4f7f4;
    --sidebar-bg: #0f172a;
    --sidebar-border: #1f2937;
    --text-light: #e5e7eb;
  }

  * {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: #111827;
  }

.page.active {
  display: block !important;
}

  /* ---------- LOGIN ---------- */
  #loginPage {
    min-height: 100vh;
    display: flex;
	padding: 20px;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(circle at top left, rgba(58,139,205,0.12), transparent 55%),
      radial-gradient(circle at bottom right, rgba(46,139,87,0.12), transparent 55%),
      #f4f7f4;
  }

  .login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 26px 26px;
    box-shadow: 0 18px 40px rgba(15,23,42,0.15);
    position: relative;
    overflow: hidden;
  }

  .login-ribbon {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(58,139,205,0.18), rgba(46,139,87,0.12));
    opacity: 0.4;
    pointer-events: none;
  }

  .login-inner {
    position: relative;
    z-index: 1;
  }

  .login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #facc15, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    font-size: 18px;
    box-shadow: 0 0 18px rgba(250,204,21,0.7);
  }

  .login-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
  }

  .login-sub {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 18px;
  }

  .login-ayah {
    font-size: 0.78rem;
    color: #4b5563;
    font-style: italic;
    margin-bottom: 14px;
  }

  .form-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 8px 0 4px;
  }

  .input {
    width: 100%;
    padding: 10px 11px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    background: #f9fafb;
  }

  .input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(58,139,205,0.25);
    background: #ffffff;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.08s, box-shadow 0.1s;
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    box-shadow: 0 10px 20px rgba(37,99,235,0.35);
    width: 100%;
    margin-top: 16px;
  }

  .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37,99,235,0.45);
  }

  .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(37,99,235,0.4);
  }

  .login-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 10px;
  }

  .login-hint code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.76rem;
  }

  /* ---------- APP LAYOUT ---------- */
  #appShell {
    display: none;
    min-height: 100vh;
  }

  .app-shell {
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(58,139,205,0.08), transparent 55%),
                radial-gradient(circle at bottom right, rgba(46,139,87,0.08), transparent 55%),
                #f9fafb;
  }

  .sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
  }

  .sidebar-header {
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .sidebar-logo-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #facc15, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    font-size: 17px;
    box-shadow: 0 0 16px rgba(250,204,21,0.65);
  }

  .sidebar-logo-text {
    font-weight: 700;
    font-size: 1rem;
  }

  .sidebar-tagline {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
  }

  .sidebar-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    padding: 14px 18px 4px;
  }

  .nav-list {
    list-style: none;
    margin: 0;
    padding: 0 10px 10px;
  }

  .nav-item {
    margin: 3px 0;
  }

.nav-btn {
  width: 100%;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: left;   /* ← FIX */
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.18s, color 0.18s, transform 0.05s;
}

  .nav-btn span {
    font-size: 1rem;
  }

  .nav-btn:hover {
    background: rgba(55,65,81,0.95);
    transform: translateY(-1px);
  }

/* Active state should look like hover, not stay solid blue */
.nav-btn.active {
  background: rgba(55, 65, 81, 0.95); /* same hover background */
  color: #ffffff;
  transform: translateY(-1px);        /* same hover pop */
}

  .sidebar-footer {
    margin-top: auto;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 0.75rem;
    color: #9ca3af;
  }

  .sidebar-footer .ayah {
    font-family: "Scheherazade New", "Traditional Arabic", serif;
    font-size: 0.78rem;
    color: #e5e7eb;
    margin-bottom: 4px;
  }

  .sidebar-user {
    font-size: 0.78rem;
    margin-bottom: 6px;
  }

  .badge-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(34,197,94,0.08);
    color: #bbf7d0;
    font-size: 0.7rem;
  }

  .badge-role.instructor {
    background: rgba(59,130,246,0.12);
    color: #bfdbfe;
  }

  /* ---------- MAIN & TOPBAR ---------- */
  .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .topbar {
    height: 56px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 60;
  }

  .topbar-title {
    font-size: 1rem;
    font-weight: 600;
  }

  .topbar-user {
    font-size: 0.85rem;
    color: #4b5563;
  }

  .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eff6ff;
    font-size: 0.8rem;
    color: #1d4ed8;
  }

  .content {
    padding: 18px;
  }

	.page {
	  display: none;
	}

	#loginPage.page.active {
	  display: flex;
	}

	.page.active {
	  display: block;
	}
  /* ---------- CARDS & COMMON ---------- */
  .course-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 10px;
  }

  .course-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 13px;
    box-shadow: 0 7px 18px rgba(15,23,42,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    transition: transform 0.13s ease, box-shadow 0.13s ease, border-color 0.13s;
  }

  .course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15,23,42,0.12);
    border-color: rgba(58,139,205,0.4);
  }

  .course-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
  }

  .course-meta-title {
    font-weight: 600;
    font-size: 0.95rem;
  }

  .course-meta-sub {
    font-size: 0.8rem;
    color: #6b7280;
  }

  .subtle-kicker {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 4px;
  }

  .pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #15803d;
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .pill.blue {
    background: #eff6ff;
    color: #1d4ed8;
  }

  .pill.gold {
    background: #fffbeb;
    color: #92400e;
  }

  .divider {
    height: 1px;
    background: #e5e7eb;
    margin: 10px 0 14px;
  }

  /* ---------- MODULES ---------- */
  .module {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px 11px;
    box-shadow: 0 4px 10px rgba(15,23,42,0.06);
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
  }

  .module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .module-title {
    font-weight: 600;
    font-size: 0.93rem;
  }

  .module-week-pill {
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
  }

  .material-list {
    margin-top: 6px;
  }

  .material-item {
    padding: 6px 9px;
    margin: 4px 0;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .material-label {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .material-tag {
    font-size: 0.75rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #1d4ed8;
  }

  .badge-soft {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
  }

  .back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.83rem;
    color: #4b5563;
    cursor: pointer;
    margin-bottom: 10px;
  }

  .back-link span {
    font-size: 1rem;
  }

  /* ---------- FORMS & INPUTS SMALL ---------- */
  .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
  }

  .select {
    padding: 7px 9px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    background: #ffffff;
    outline: none;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 0.82rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .btn-sm.secondary {
    background: #6b7280;
  }

  /* ---------- GRADEBOOK ---------- */
  .grade-row {
    cursor: pointer;
  }

  .submission-box {
    background: #ffffff;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
  }

  .grade-input {
    width: 220px;
    padding: 8px 9px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
  }

  /* ---------- RESPONSIVE ---------- */
  @media (max-width: 900px) {
    .sidebar {
      width: 210px;
    }
  }

  @media (max-width: 720px) {

  .burger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
	position: relative;
    z-index: 65; /* higher than sidebar */
  }

  /* IMPORTANT: keep main layout normal */
  .app-shell {
    flex-direction: row;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;

    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    border-bottom: none;

    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 50;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }
}

  @media (max-width: 480px) {
    .content {
      padding: 12px;
    }
    .course-row {
      grid-template-columns: 1fr;
    }
  }

.modal-bg {
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.modal {
  background:white;
  padding:20px;
  border-radius:8px;
  width:600px;
  max-width:95%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-label {
  font-weight:600;
  margin-top:10px;
  display:block;
}

.modal-input {
  width:100%;
  padding:8px;
  margin-top:4px;
  border:1px solid #ccc;
  border-radius:4px;
}

.modal-textarea {
  width:100%;
  height:150px;
  margin-top:4px;
  padding:8px;
  border:1px solid #ccc;
  border-radius:4px;
  resize: vertical;
}

/* ——— CLEAN UI ENHANCEMENTS ——— */

.page-sub {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.section-heading {
  font-size: 1rem;
  margin-bottom: 8px;
  margin-top: 20px;
  color: #374151;
}

.clean-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.clean-list .module {
  border-left: 4px solid #3b82f6;
}

.clean-list .module-title {
  font-size: 1rem;
  font-weight: 600;
}

.clean-list .module:hover {
  background: #f9fafb;
}

.material-item {
  transition: background 0.18s;
}

.material-item:hover {
  background: #f3f4f6;
}

#instructorStudentList .module {
  padding: 12px;
  border-left: 4px solid #10b981;
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: white;
}

.roster-table th, 
.roster-table td {
  padding: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
}

.roster-table th {
  background: #f3f4f6;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  text-align: left;
}

.roster-table tr:nth-child(even) {
  background: #f9fafb;
}

.roster-table tr:hover {
  background: #eef2ff;
}

.module-danger {
  border: 2px solid #dc2626 !important;
  background: #fef2f2 !important;
}

.btn-danger {
  background: #dc2626 !important;
  color: white !important;
}
.btn-danger:hover {
  background: #b91c1c !important;
}

/* ---------- STUDENT COURSE CARD GRID ---------- */

.course-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.course-card-vertical {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 22px rgba(15,23,42,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}

.course-card-vertical:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(15,23,42,0.14);
  border-color: rgba(58,139,205,0.45);
}

.course-card-image {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: #f3f4f6;
}

.course-card-image.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.course-card-body {
  padding: 12px 13px;
}

.course-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.course-card-crn {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
  margin-left: 6px;
}

/* ---------- COURSE CARD HOVER OVERLAY ---------- */

.course-card-vertical {
  position: relative;
}

.course-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15,23,42,0.35),
    rgba(15,23,42,0.65)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 2;
}

.course-card-overlay span {
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 24px rgba(37,99,235,0.45);
}

.course-card-vertical:hover .course-card-overlay {
  opacity: 1;
}

/* Mobile: always visible hint */
@media (hover: none) {
  .course-card-overlay {
    opacity: 1;
    background: linear-gradient(
      180deg,
      rgba(15,23,42,0.15),
      rgba(15,23,42,0.35)
    );
  }

  .course-card-overlay span {
    font-size: 0.85rem;
    padding: 8px 14px;
  }
}

/* ===============================
   MOBILE SLIDING SIDEBAR
   =============================== */

.burger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #111827;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 40;
}

/* Mobile behavior */
@media (max-width: 720px) {

  .burger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-shell {
    flex-direction: row; /* keep layout intact */
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 50;

    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,0.35);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }
}

.login-success{
  background:#ecfdf5;
  color:#065f46;
  padding:10px;
  border-radius:8px;
  margin-top:10px;
  font-size:0.85rem;
}