/* ============================================================
   AIU Student Portal — style.css
   ============================================================ */

/* ---- Google Fonts: Cairo ---------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---------------------------------------- */
:root {
  --red:        #b8001f;
  --red-dark:   #8c0017;
  --red-light:  #f9e8ea;
  --bg:         #f6f7fb;
  --white:      #ffffff;
  --text:       #18181b;
  --text-muted: #71717a;
  --border:     rgba(0,0,0,.10);
  --header-bg:  #d9d9d9;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 12px rgba(0,0,0,.10);
  --radius:     14px;
  --radius-sm:  8px;
  --nav-h:      72px;
  --max-w:      1200px;
  --gap:        24px;
}

/* Dark mode variables */
html.dark {
  --bg:         #09090b;
  --white:      #18181b;
  --text:       #fafafa;
  --text-muted: #a1a1aa;
  --border:     rgba(255,255,255,.12);
  --header-bg:  rgba(24,24,27,.95);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow:     0 4px 12px rgba(0,0,0,.4);
}

/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Cairo', system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .2s, color .2s;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }

/* ---- Typography -------------------------------------------- */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem;  font-weight: 600; }
p  { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

/* ---- Layout ------------------------------------------------ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 64px 64px;
}
@media (max-width: 1024px) {
  .container { padding: 28px 24px 48px; }
}
.page-header {
  margin-bottom: 28px;
}
.page-header h1 { margin-bottom: 4px; }
.page-header p  { color: var(--text-muted); font-size: .95rem; }

/* ---- Sticky Header ----------------------------------------- */
#nav-container {
  position: sticky;
  top: 0;
  z-index: 900;
  overflow: visible;
}

.nav {
  background: var(--header-bg);
  border-bottom-left-radius: 50% 20px;
  border-bottom-right-radius: 50% 20px;
  margin-bottom: -2px;
  padding: 0 64px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-top {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-brand {
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.nav-brand img {
  height: 52px;
  width: auto;
}
.nav-brand:hover { text-decoration: none; }

.nav-spacer { flex: 1; }

/* Desktop search */
.nav-search {
  flex: 1;
  max-width: 400px;
}
.nav-search input {
  width: 100%;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: .88rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.nav-search input:focus { border-color: var(--red); }
html.dark .nav-search input { background: var(--white); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Avatar circle */
.nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  overflow: hidden;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Theme / notif buttons */
.nav-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background .15s;
  color: var(--text);
}
.nav-icon-btn:hover { background: rgba(0,0,0,.07); }
html.dark .nav-icon-btn:hover { background: rgba(255,255,255,.1); }
.nav-icon-btn img { width: 18px; height: 18px; }
.nav-icon-btn svg { width: 18px; height: 18px; }

/* Notification dot */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--header-bg);
}

/* Nav bottom row: page links */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  list-style: none;
  padding-bottom: 4px;
}
.nav-links a {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color .15s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width .25s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--red); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* Notification badge (count) */
.nav-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  margin-inline-start: 4px;
  vertical-align: middle;
  line-height: 1.4;
}

/* Sign-out + lang buttons */
.nav-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: .84rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.nav-btn:hover { border-color: var(--red); color: var(--red); }
.nav-btn.lang-btn { min-width: 44px; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--white);
  z-index: 899;
  padding: 16px 20px 32px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav-drawer.open { display: block; }
.nav-drawer ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.nav-drawer a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
}
.nav-drawer a:hover, .nav-drawer a.active {
  background: var(--red-light);
  color: var(--red);
}
.nav-drawer .drawer-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

/* ---- Cards ------------------------------------------------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 20px 22px;
}
.card-title {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.card + .card { margin-top: 16px; }

/* ---- Stat Cards ------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--red);
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-sub {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ---- Banners ---------------------------------------------- */
.banner {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: .92rem;
  font-weight: 500;
}
.banner-green  { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.banner-blue   { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.banner-amber  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.banner-red    { background: var(--red-light); color: var(--red-dark); border: 1px solid #fca5a5; }

/* ---- Badges ----------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f3f4f6; color: #374151; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ---- Tables ----------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}
.data-table {
  width: 100%;
  font-size: .88rem;
}
.data-table thead tr {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
.data-table th {
  padding: 10px 14px;
  text-align: start;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafaf9; }

/* ---- Forms ------------------------------------------------ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(184,0,31,.12);
}
.form-group input:read-only {
  background: var(--bg);
  color: var(--text-muted);
  cursor: default;
}
.form-error {
  font-size: .82rem;
  color: var(--red);
  margin-top: 5px;
}

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, opacity .15s;
  text-align: center;
}
.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
}
.btn-outline:hover { background: var(--red-light); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.btn-sm { padding: 5px 14px; font-size: .82rem; }
.btn-full { width: 100%; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ---- Quick links row -------------------------------------- */
.quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ---- Accordion -------------------------------------------- */
.accordion-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.accordion-header:hover { background: var(--bg); }
.accordion-header h3 { font-size: 1rem; font-weight: 600; }
.accordion-meta {
  font-size: .85rem;
  color: var(--text-muted);
  margin-inline-start: auto;
  margin-inline-end: 16px;
}
.accordion-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
}
.accordion-chevron::after { content: '▼'; }
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}
.accordion-item.open .accordion-body { display: block; }

/* ---- Timetable -------------------------------------------- */
.timetable-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.timetable {
  min-width: 600px;
  border-collapse: collapse;
  width: 100%;
  font-size: .85rem;
}
.timetable th {
  background: var(--red);
  color: #fff;
  padding: 10px 12px;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--red-dark);
}
.timetable td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  vertical-align: top;
  min-height: 60px;
  min-width: 100px;
  background: var(--white);
}
.timetable td.time-col {
  background: var(--bg);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.tt-slot {
  background: var(--red-light);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  padding: 4px 7px;
  margin-bottom: 4px;
  font-size: .78rem;
  line-height: 1.35;
}
.tt-slot strong { display: block; color: var(--red-dark); }
.tt-slot span   { color: var(--text-muted); }

/* ---- Enrollment cards ------------------------------------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.course-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.course-card:hover { border-color: var(--red); box-shadow: var(--shadow-sm); }
.course-card.selected { border-color: var(--red); background: #fff8f8; }
.course-card.disabled { opacity: .55; pointer-events: none; }
.course-card .cc-code { font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.course-card .cc-name { font-size: .95rem; font-weight: 600; }
.course-card .cc-meta { font-size: .82rem; color: var(--text-muted); }
.course-card .cc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }

/* Enrollment sidebar */
.enroll-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.enroll-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}
.selection-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.selection-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .88rem;
}
.selection-item .si-code { font-weight: 600; flex-shrink: 0; }
.selection-item .si-name { flex: 1; color: var(--text-muted); font-size: .83rem; }
.selection-item .si-ch  { font-size: .8rem; color: var(--text-muted); flex-shrink: 0; }
.selection-item .si-remove {
  background: none; border: none; cursor: pointer;
  font-size: .8rem; color: var(--text-muted); padding: 0 2px;
  flex-shrink: 0;
}
.selection-item .si-remove:hover { color: var(--red); }
.ch-bar-wrap { margin: 12px 0; }
.ch-bar-label { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 5px; }
.ch-bar-bg { background: var(--border); border-radius: 999px; height: 8px; overflow: hidden; }
.ch-bar-fill { height: 100%; background: var(--red); border-radius: 999px; transition: width .3s; }
.ch-bar-fill.over { background: #dc2626; }

/* ---- Notifications ---------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow .15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notif-item:hover { box-shadow: var(--shadow-sm); }
.notif-item.unread { background: #eff6ff; border-color: #bfdbfe; }
.unread-dot {
  width: 9px; height: 9px;
  background: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.read-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.notif-content { flex: 1; }
.notif-title { font-weight: 600; font-size: .92rem; margin-bottom: 3px; }
.notif-body  { font-size: .85rem; color: var(--text-muted); margin-bottom: 6px; }
.notif-meta  { display: flex; align-items: center; gap: 8px; }
.notif-time  { font-size: .78rem; color: var(--text-muted); }

/* ---- Toast ----------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
html[dir=rtl] #toast-container { right: auto; left: 24px; }
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  pointer-events: auto;
  max-width: 320px;
  animation: toast-in .25s ease;
}
.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }
.toast.info    { background: #1e40af; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Shimmer / Loading ------------------------------------ */
.shimmer {
  background: linear-gradient(90deg, #e8e6e2 25%, #f0ede9 50%, #e8e6e2 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.shimmer-line { height: 14px; margin-bottom: 10px; }
.shimmer-line.short { width: 60%; }
.shimmer-line.medium { width: 80%; }

.spinner-wrap { display: flex; align-items: center; justify-content: center; padding: 48px; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Progress bar ---------------------------------------- */
.progress-wrap { background: var(--border); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--red); border-radius: 999px; transition: width .4s; }

/* ---- Section headers ------------------------------------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-header h2 { font-size: 1.1rem; }

/* ---- Financial ------------------------------------------- */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.finance-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}
.finance-card .fc-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.finance-card .fc-value { font-size: 1.5rem; font-weight: 700; }
.fc-value.positive { color: #065f46; }
.fc-value.negative { color: var(--red); }

/* Amount colors in table */
.amt-charge  { color: var(--red); font-weight: 600; }
.amt-payment { color: #065f46; font-weight: 600; }

/* ---- Profile --------------------------------------------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.profile-info h2 { font-size: 1.3rem; }
.profile-info p  { color: var(--text-muted); font-size: .9rem; margin-bottom: 2px; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---- Login page ------------------------------------------ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: url('../aiu-bg.png') center/cover no-repeat;
  position: relative;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.55);
}
html.dark .login-page::before {
  background: rgba(0,0,0,.6);
}
.login-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(4px);
}
html.dark .login-card {
  background: rgba(24,24,27,.92);
  border-color: rgba(255,255,255,.1);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo img {
  height: 64px;
  width: auto;
  display: inline-block;
}
.login-logo .portal-label {
  font-size: .9rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 600;
}
.login-lang { text-align: center; margin-bottom: 20px; }

/* ---- Empty state ----------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state p { font-size: 1rem; }

/* ---- Chart container ------------------------------------- */
.chart-wrap {
  padding: 16px 0 0;
  max-height: 280px;
}

/* ---- Divider --------------------------------------------- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---- Footer ---------------------------------------------- */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  padding: 40px 64px;
  background: var(--white);
}
@media (max-width: 1024px) { .site-footer { padding: 32px 24px; } }
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-social {
  display: flex;
  gap: 14px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 700;
  transition: border-color .15s, color .15s;
}
.footer-social a:hover { border-color: var(--red); color: var(--red); }
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}
.footer-links a:hover { color: var(--red); }
.footer-copy {
  font-size: .8rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   RTL Support
   ============================================================ */
html[dir=rtl] body { font-family: 'Cairo', system-ui, "Segoe UI", "Tahoma", Arial, sans-serif; }
html[dir=rtl] .nav-top { flex-direction: row-reverse; }
html[dir=rtl] .nav-links { flex-direction: row-reverse; }
html[dir=rtl] .accordion-meta { margin-inline-start: auto; margin-inline-end: 16px; }
html[dir=rtl] .section-header { flex-direction: row-reverse; }
html[dir=rtl] .profile-header { flex-direction: row-reverse; }
html[dir=rtl] .data-table th, html[dir=rtl] .data-table td { text-align: right; }
html[dir=rtl] .tt-slot { border-left: none; border-right: 3px solid var(--red); }
html[dir=rtl] .enroll-layout { }
html[dir=rtl] .notif-item { flex-direction: row-reverse; }
html[dir=rtl] .finance-grid { }
html[dir=rtl] .quick-links { flex-direction: row-reverse; }
html[dir=rtl] .nav-drawer ul { }
html[dir=rtl] .selection-item { flex-direction: row-reverse; }

/* ============================================================
   Responsive — Tablet 768px
   ============================================================ */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .finance-grid { grid-template-columns: repeat(2, 1fr); }
  .enroll-layout { grid-template-columns: 1fr; }
  .enroll-sidebar { position: static; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Responsive — Tablet nav 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .nav { padding: 0 24px 16px; }
  .nav-search { display: none; }
}

/* ============================================================
   Responsive — Mobile 600px
   ============================================================ */
@media (max-width: 600px) {
  :root { --gap: 16px; --nav-h: 60px; }
  .container { padding: calc(var(--nav-h) + 20px) 16px 40px; }
  .nav { padding: 0 16px 12px; }
  .nav-links { display: none; }
  .nav-btn.signout-btn { display: none; }
  .hamburger { display: flex; }
  h1 { font-size: 1.4rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 1.5rem; }
  .finance-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .profile-header { flex-direction: column; text-align: center; }
  .course-grid { grid-template-columns: 1fr; }
  .quick-links { flex-direction: column; }
  .quick-links .btn { width: 100%; }
  .enroll-layout { grid-template-columns: 1fr; }
}
