/* ========= Grand Institute — shared structure (no portal colors) ========= */

/* Preserve destructive semantics after --accent becomes CTA blue */
.btn-accent {
  background: var(--danger-accent);
  box-shadow: 0 6px 18px rgba(217, 51, 63, 0.25);
}
.btn-accent:hover { background: #c02e38; }
.btn-accent:active { background: #a82832; }

.badge-danger {
  background: color-mix(in srgb, var(--danger-accent) 12%, white);
  color: #a82832;
}

.input-danger { border-color: var(--danger-accent); }
.input-danger:focus {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger-accent) 25%, transparent);
}

/* ========= Dashboard shell (desktop: permanent sidebar column) ========= */

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.dash-sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  width: 260px;
  background: var(--primary);
  color: #fff;
  padding: 20px 16px;
  overflow: hidden;
  z-index: 1040;
}

.dash-sidebar__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 8px;
}

.dash-sidebar__foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.dash-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.dash-sidebar-brand__logo {
  display: block;
  width: min(100%, 200px);
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.dash-sidebar-brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.dash-sidebar-brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-sidebar-brand__ar {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.dash-sidebar-brand__en {
  font-size: 0.62rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.72);
}

.dash-nav--actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-nav--actions a {
  font-size: 0.88rem;
  font-weight: 600;
}

.dash-sidebar .logo {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-sidebar .brand-mark {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: #fff;
}

.dash-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-nav li + li { margin-top: 4px; }

.dash-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.dash-nav a:hover,
.dash-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dash-nav-group {
  margin-top: 8px;
}

.dash-nav-group__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.dash-nav-group__toggle:hover,
.dash-nav-group__toggle.is-active,
.dash-nav-group.is-open > .dash-nav-group__toggle {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dash-nav-group__toggle i:first-child {
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
}

.dash-nav-group__label {
  flex: 1 1 auto;
}

.dash-nav-group__chevron {
  font-size: 0.72rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.dash-nav-group.is-open .dash-nav-group__chevron {
  transform: rotate(180deg);
}

.dash-nav-group .dash-nav--sub {
  display: none;
  margin: 2px 0 0;
  padding-inline-start: 6px;
}

.dash-nav-group.is-open .dash-nav--sub {
  display: block;
}

.dash-nav--sub a {
  padding: 8px 14px 8px 30px;
  font-size: 0.88rem;
}

.dash-nav--sub a i {
  width: 1rem;
  margin-inline-end: 8px;
  font-size: 0.82rem;
  opacity: 0.85;
}

.dash-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.dash-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid rgba(2, 8, 23, 0.08);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.dash-topbar .role-badge {
  margin-inline-start: 0;
}

.dash-content {
  padding: 24px;
  flex: 1;
}

.dash-topbar .nav-toggle {
  background: transparent;
  border: 1px solid rgba(2, 8, 23, 0.12);
  padding: 6px 10px;
  line-height: 1;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, white);
  color: var(--primary);
}

.role-badge.admin { background: color-mix(in srgb, var(--accent) 12%, white); color: var(--accent-700); }
.role-badge.instructor { background: color-mix(in srgb, var(--accent) 12%, white); color: var(--accent-700); }
.role-badge.student { background: color-mix(in srgb, var(--primary) 12%, white); color: var(--primary); }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dash-stat-card .icon-box {
  background: linear-gradient(135deg, var(--accent), var(--accent-600));
}

/* KPI card color variants — apply in phase 4/5 */
.dash-stat-card--pink   { background: #fbe4ec; }
.dash-stat-card--pink .icon,
.dash-stat-card--pink .icon-box   { background: #d1477a; color: #fff; }
.dash-stat-card--green  { background: #e3f6ec; }
.dash-stat-card--green .icon,
.dash-stat-card--green .icon-box  { background: #2e9e5b; color: #fff; }
.dash-stat-card--blue   { background: #e6f0fb; }
.dash-stat-card--blue .icon,
.dash-stat-card--blue .icon-box   { background: #3b7dd8; color: #fff; }
.dash-stat-card--orange { background: #fff3e0; }
.dash-stat-card--orange .icon,
.dash-stat-card--orange .icon-box { background: #e89b3a; color: #fff; }
.dash-stat-card--purple { background: #efe6fb; }
.dash-stat-card--purple .icon,
.dash-stat-card--purple .icon-box { background: #8e5fd1; color: #fff; }

.dash-stat-card .icon-box i {
  font-size: 1.15rem;
}

/* ========= Topbar enhancements ========= */

.dash-topbar__greeting {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-topbar__welcome {
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.3;
}

.dash-topbar__subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.dash-topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.dash-topbar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-topbar__user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.dash-topbar__user-text strong {
  font-size: 0.9rem;
  color: var(--accent);
}

.dash-topbar__user-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

.dash-topbar__search {
  flex: 1;
  max-width: 340px;
  margin-inline: 12px;
}

.dash-topbar__search .form-control {
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: 10px;
}

.dash-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

/* ========= Dashboard home widgets ========= */

.dash-home-row--triple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.dash-home-row--double {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.dash-home-activity {
  max-width: 100%;
}

.dash-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-nav a i {
  width: 18px;
  text-align: center;
  opacity: 0.88;
  font-size: 0.95rem;
}

.dash-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

.dash-home-grid__main,
.dash-home-grid__side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.dash-panel {
  border: 0;
  box-shadow: var(--shadow-1);
  padding: 0;
  overflow: hidden;
}

.dash-panel__head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(2, 8, 23, 0.06);
  background: color-mix(in srgb, var(--primary) 4%, white);
}

.dash-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-table thead th {
  background: color-mix(in srgb, var(--primary) 6%, white);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid rgba(2, 8, 23, 0.08);
}

.dash-table tbody td {
  font-size: 0.9rem;
  vertical-align: middle;
}

.lecture-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.lecture-pill--active {
  background: #e3f6ec;
  color: #2e9e5b;
}

.lecture-pill--upcoming {
  background: #eef0f2;
  color: #6c757d;
}

.lecture-pill--completed {
  background: #f3e3ea;
  color: #a64d6a;
}

.lecture-pill--soon {
  background: #fff3e0;
  color: #c67a12;
}

.lecture-pill--today {
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent-700);
}

.current-lectures {
  list-style: none;
  margin: 0;
  padding: 8px 0 12px;
}

.current-lectures__item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(2, 8, 23, 0.05);
}

.current-lectures__item:last-child {
  border-bottom: 0;
}

.current-lectures__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 0.95rem;
}

.current-lectures__icon--blue   { background: #3b7dd8; }
.current-lectures__icon--green  { background: #2e9e5b; }
.current-lectures__icon--orange { background: #e89b3a; }
.current-lectures__icon--purple { background: #8e5fd1; }
.current-lectures__icon--pink   { background: #d1477a; }

.current-lectures__body {
  min-width: 0;
  flex: 1;
}

.current-lectures__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.current-lectures__title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.current-lectures__meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.current-lectures__empty,
.rank-list__empty,
.activity-feed__empty {
  padding: 16px 20px;
}

.dash-rankings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 12px 16px 16px;
}

.rank-list__item + .rank-list__item {
  margin-top: 14px;
}

.rank-list__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.rank-list__name {
  font-weight: 600;
  color: var(--ink);
}

.rank-list__name-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rank-list__sub {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.rank-list__pct {
  font-weight: 700;
  color: var(--primary);
}

.rank-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(2, 8, 23, 0.08);
  overflow: hidden;
}

.rank-bar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease;
}

.rank-bar--high { background: linear-gradient(90deg, #2e9e5b, #45b872); }
.rank-bar--mid  { background: linear-gradient(90deg, #e89b3a, #f0b35a); }
.rank-bar--low  { background: linear-gradient(90deg, #b0b8c4, #c8ced6); }

.rank-bar--seq-blue   { background: linear-gradient(90deg, #3b7dd8, #5b96e8); }
.rank-bar--seq-orange { background: linear-gradient(90deg, #e89b3a, #f0b35a); }
.rank-bar--seq-purple { background: linear-gradient(90deg, #8e5fd1, #a87de0); }

.activity-feed {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  max-height: 420px;
  overflow-y: auto;
}

.activity-feed__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(2, 8, 23, 0.05);
}

.activity-feed__item:last-child {
  border-bottom: 0;
}

.activity-feed__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(2, 8, 23, 0.06);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-feed__body {
  flex: 1;
  min-width: 0;
}

.activity-feed__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.activity-feed__subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}

.activity-feed__time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 2px;
}

.dash-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(2, 8, 23, 0.08);
  text-align: center;
}

.dash-footer p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 991.98px) {
  .dash-home-row--triple {
    grid-template-columns: 1fr;
  }

  .dash-home-row--double {
    grid-template-columns: 1fr;
  }

  .dash-topbar__user-text {
    display: none;
  }

  .dash-home-grid {
    grid-template-columns: 1fr;
  }

  .dash-topbar__search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 8px 0 0;
  }
}


@media (max-width: 991.98px) {
  .dashboard {
    display: block;
  }

  .dash-sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: auto;
    height: 100vh;
    transition: transform 0.25s ease;
  }

  [dir="rtl"] .dash-sidebar {
    transform: translateX(100%);
    box-shadow: -8px 0 24px rgba(2, 8, 23, 0.18);
  }

  [dir="ltr"] .dash-sidebar {
    transform: translateX(-100%);
    box-shadow: 8px 0 24px rgba(2, 8, 23, 0.18);
  }

  .dash-sidebar.open {
    transform: translateX(0);
  }
}

/* ========= Split-panel login (all portals) ========= */

.login-page {
  margin: 0;
  background: var(--bg);
}

.login-split {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  min-height: 100vh;
}

/* RTL document: lock brand-left / form-right against native grid flip */
[dir="rtl"] .login-split {
  direction: ltr;
}

/* LTR document: mirror to brand-right / form-left */
[dir="ltr"] .login-split {
  direction: rtl;
}

/* Inner panels: real text direction (overrides layout-only .login-split direction) */
[dir="rtl"] .login-split__brand,
[dir="rtl"] .login-split__form {
  direction: rtl;
}

[dir="ltr"] .login-split__brand,
[dir="ltr"] .login-split__form {
  direction: ltr;
}

.login-split__brand {
  position: relative;
  background: var(--primary);
  color: #fff;
  overflow: hidden;
}

/* ========= Language switcher (login + dashboard) ========= */

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.lang-switch__label {
  letter-spacing: 0.04em;
}

.lang-switch--brand {
  position: absolute;
  top: 20px;
  inset-inline-start: 20px;
  z-index: 2;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.lang-switch--brand:hover {
  background: rgba(255, 255, 255, 0.16);
}

.lang-switch--login-card {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 2;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(2, 8, 23, 0.12);
  background: var(--card);
  color: var(--ink);
}

.lang-switch--login-card:hover {
  background: rgba(2, 8, 23, 0.04);
}

.lang-switch--topbar {
  height: 36px;
  padding: 0 12px;
  margin-inline-start: auto;
  border: 1px solid rgba(2, 8, 23, 0.12);
  background: var(--card);
  color: var(--ink);
  flex-shrink: 0;
}

.lang-switch--topbar:hover {
  background: rgba(2, 8, 23, 0.04);
}

.login-card {
  position: relative;
  width: min(100%, 420px);
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 32px 28px;
}

.login-brand-dots {
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 200px;
  height: 200px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
}

[dir="rtl"] .login-brand-dots {
  mask-image: radial-gradient(circle at bottom left, #000 30%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at bottom left, #000 30%, transparent 72%);
}

[dir="ltr"] .login-brand-dots {
  mask-image: radial-gradient(circle at bottom right, #000 30%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at bottom right, #000 30%, transparent 72%);
}

.login-split__brand--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--login-brand-photo);
  background-size: cover;
  background-position: center;
  filter: blur(6px);
  transform: scale(1.08);
  opacity: 0.45;
}

.login-split__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--login-brand-overlay);
  pointer-events: none;
}

.login-split__brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 40px;
  gap: 32px;
  text-align: center;
}

.login-brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: auto;
}

.login-brand-logo__img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.login-brand-logo__mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.login-brand-logo__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-brand-logo__ar {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.login-brand-logo__en {
  font-size: 0.85rem;
  opacity: 0.85;
  letter-spacing: 0.04em;
}
.login-brand-logo__lockup {
  display: block;
  width: min(100%, 320px);
  height: auto;
  object-fit: contain;
  margin: auto;
}
.login-brand-hero__eyebrow {
  margin: 0 0 8px;
  font-size: 1rem;
  opacity: 0.9;
}

.login-brand-hero__title {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  color: var(--danger-accent);
  line-height: 1.25;
}

.login-brand-hero__tagline {
  margin: 0;
  line-height: 1.7;
  opacity: 0.88;
  font-size: 0.95rem;
}

.login-brand-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  /* Keep reference LTR icon order: التقارير → المحاضرات left-to-right */
  direction: ltr;
}

.login-brand-feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 10px;
  min-height: 148px;
  padding: 18px 10px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.login-brand-feature-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  font-size: 1.65rem;
  line-height: 1;
  color: #fff;
}

/* FA Free: book-open/chart-bar/id-badge are solid-only — stroke them for outline look */
.login-brand-feature-card__icon .fa-solid {
  color: transparent;
  -webkit-text-stroke: 1.35px rgba(255, 255, 255, 0.95);
}

.login-brand-feature-card__icon .fa-regular {
  color: #fff;
  -webkit-text-stroke: 0;
}

.login-brand-feature-card__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.login-brand-feature-card__desc {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.login-brand-footer {
  margin-top: auto;
  font-size: 0.85rem;
  opacity: 0.85;
}

.login-brand-footer p {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-brand-footer__copy {
  margin-top: 12px !important;
  font-size: 0.78rem;
  opacity: 0.7;
}

.login-split__form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--bg);
}

.login-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 22px;
}

.login-card__brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: color-mix(in srgb, var(--primary) 10%, white);
  color: var(--primary);
}

.login-card__brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.login-card__brand-ar {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
}

.login-card__brand-en {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.login-card__brand-lockup {
  display: block;
  width: min(100%, 260px);
  height: auto;
  object-fit: contain;
}

.login-card__divider {
  width: 52px;
  height: 3px;
  margin: 0 auto 22px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
}

.login-split__brand--solid::before,
.login-split__brand--solid::after {
  display: none;
}


.login-card__title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
}

.login-card__subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-card .form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.login-card .input,
.login-card .form-control {
  border-radius: 10px;
}

.login-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.login-card__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  cursor: pointer;
}

.login-card__remember input {
  margin: 0;
}

.login-card__forgot {
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.login-card__forgot:hover {
  color: var(--accent-600);
  text-decoration: underline;
}

.login-page .btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-weight: 700;
  box-shadow: 0 6px 18px var(--login-btn-shadow);
  transition: background 0.2s ease, transform 0.1s ease;
}

.login-page .btn-login:hover {
  background: var(--accent-600);
  color: #fff;
}

.login-page .btn-login:active {
  background: var(--accent-700);
  transform: translateY(1px);
}

.login-card__portal-links {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(2, 8, 23, 0.08);
  text-align: center;
  font-size: 0.88rem;
}

.login-card__portal-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.login-card__portal-links a:hover {
  text-decoration: underline;
}

.login-help-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 8%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.login-help-box__icon {
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  margin-top: 2px;
}

.login-help-box a {
  color: var(--accent);
  font-weight: 600;
}

@keyframes login-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.login-card.shake {
  animation: login-shake 0.45s ease both;
}

@media (max-width: 768px) {
  .login-split {
    grid-template-columns: 1fr;
  }

  .login-split__brand {
    display: none;
  }

  .login-split__form {
    min-height: 100vh;
    padding: 24px 16px;
  }

  .login-brand-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ========= Courses management (admin + teacher) ========= */

.courses-page-head {
  margin-bottom: 20px;
}

.courses-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.courses-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.courses-breadcrumb a:hover {
  text-decoration: underline;
}

.courses-breadcrumb__sep {
  opacity: 0.55;
}

.courses-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.courses-panel {
  overflow: visible;
}

.courses-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(2, 8, 23, 0.06);
  flex-wrap: wrap;
}

.courses-toolbar__new {
  white-space: nowrap;
}

.courses-toolbar__search {
  position: relative;
  flex: 1;
  max-width: 320px;
  margin-inline-start: auto;
}

.courses-toolbar__search-icon {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.courses-toolbar__search .form-control {
  padding-inline-start: 36px;
  border-radius: 10px;
}

.courses-toolbar__search .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.courses-table__title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.course-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 0.85rem;
}

.course-row-icon--blue   { background: #3b7dd8; }
.course-row-icon--green  { background: #2e9e5b; }
.course-row-icon--orange { background: #e89b3a; }
.course-row-icon--purple { background: #8e5fd1; }
.course-row-icon--pink   { background: #d1477a; }

.courses-table__link {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.courses-table__link:hover {
  text-decoration: underline;
}

.courses-table__name {
  font-weight: 700;
  color: var(--ink);
}

.courses-table__code {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.attendance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
}

.attendance-badge--zero {
  background: rgba(2, 8, 23, 0.08);
  color: #6c757d;
}

.attendance-badge--mid {
  background: #fff3e0;
  color: #c67a12;
}

.attendance-badge--high {
  background: #e3f6ec;
  color: #2e9e5b;
}

.courses-actions__toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.courses-actions__toggle:hover {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent-700);
}

.courses-actions__delete {
  margin: 0;
}

.courses-actions__delete .dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: inherit;
}

.courses-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid rgba(2, 8, 23, 0.06);
  font-size: 0.85rem;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid rgba(2, 8, 23, 0.06);
  font-size: 0.85rem;
}

.courses-pagination__per-page label,
.list-pagination__per-page label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.courses-pagination__per-page select,
.list-pagination__per-page select {
  width: auto;
  min-width: 72px;
}

.courses-pagination__pages,
.list-pagination__pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.courses-page-link,
.list-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  background: transparent;
}

.courses-page-link:hover,
.list-page-link:hover {
  background: rgba(2, 8, 23, 0.06);
}

.courses-page-link.is-active,
.list-page-link.is-active {
  background: var(--accent);
  color: #fff;
}

.courses-page-link.is-disabled,
.list-page-link.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.courses-page-ellipsis,
.list-page-ellipsis {
  color: var(--muted);
  padding: 0 4px;
}

.courses-pagination__summary,
.list-pagination__summary {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 991.98px) {
  .courses-toolbar__search {
    flex: 1 1 100%;
    max-width: none;
    margin-inline-start: 0;
  }

  .courses-pagination,
  .list-pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .courses-pagination__pages,
  .list-pagination__pages {
    justify-content: center;
  }
}

/* Phase 8 — series attendance warnings (informational, calm tone) */
.attendance-series-warn {
  background: #fff8e6;
  border: 1px solid #e8d4a0;
  border-radius: var(--radius-sm, 8px);
  color: #7a5c00;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
}

.attendance-series-warn--compact {
  display: inline-block;
  font-size: 0.78rem;
  margin-bottom: 0;
  max-width: 220px;
  padding: 0.35rem 0.5rem;
  white-space: normal;
}
