/* =====================================================================
   جامعة خليج سرت الدولية - منظومة التعليم عن بُعد
   الهوية البصرية: أزرق بحري عميق + ذهبي رملي، خط ريم كوفي للعناوين
   assets/css/style.css
   ===================================================================== */

:root {
  --ink:        #082430;
  --ink-soft:   #0F3546;
  --sea:        #0D6E85;
  --sea-deep:   #095567;
  --sea-tint:   #E6F1F4;
  --sand:       #C0912F;
  --sand-tint:  #FBF3E0;
  --mist:       #F1F4F6;
  --line:       #E2E9ED;
  --text:       #17303B;
  --text-soft:  #64808C;
  --radius:     14px;
  --radius-sm:  9px;
  --sidebar-w:  272px;
  --shadow:     0 1px 2px rgba(8, 36, 48, .05), 0 8px 24px rgba(8, 36, 48, .06);
}

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Cairo', system-ui, 'Segoe UI', sans-serif;
  background: var(--mist);
  color: var(--text);
  font-size: 15px;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, .display-font, .brand-name {
  font-family: 'Reem Kufi', 'Cairo', sans-serif;
  letter-spacing: 0;
}

a { text-decoration: none; }
a:focus-visible, button:focus-visible, .nav-link:focus-visible, input:focus-visible {
  outline: 2px solid var(--sand);
  outline-offset: 2px;
}

/* ---------- الشريط الجانبي ---------- */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;                      /* القائمة على اليمين دائماً */
  left: auto;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: #CFE0E6;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}

.sidebar .brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar .brand-name {
  color: #fff;
  font-size: 19px;
  line-height: 1.5;
  margin: 0;
}
.sidebar .brand-rule {
  width: 46px;
  height: 3px;
  background: var(--sand);
  border-radius: 2px;
  margin: 10px 0 8px;
}
.sidebar .brand-sub {
  color: #8FAFBA;
  font-size: 12.5px;
  margin: 0;
}

.sidebar-nav {
  padding: 14px 12px 24px;
  overflow-y: auto;
  flex: 1;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

.nav-group-title {
  color: #6E93A0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 16px 12px 6px;
  margin: 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #C3D7DE;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.sidebar-nav .nav-link i { font-size: 17px; width: 20px; text-align: center; opacity: .9; }
.sidebar-nav .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-nav .nav-link.active {
  background: rgba(255, 255, 255, .11);
  color: #fff;
  box-shadow: inset -3px 0 0 var(--sand);   /* شريط ذهبي على الحافة اليمنى للعنصر النشط */
}
.sidebar-nav .nav-link .badge { margin-inline-start: auto; }

.sidebar-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
  color: #7FA0AC;
}

/* ---------- المحتوى ---------- */
.app-main { margin-right: var(--sidebar-w); margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar .page-title { font-size: 17px; margin: 0; font-weight: 600; }
.topbar .term-chip {
  background: var(--sea-tint);
  color: var(--sea-deep);
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 12.5px;
  font-weight: 600;
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.icon-btn:hover { background: var(--mist); color: var(--sea); }
.icon-btn .dot {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #DC3545; border: 2px solid #fff;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sea); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.content { padding: 24px 22px 40px; flex: 1; }

/* ---------- البطاقات ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  font-weight: 600;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-body { padding: 18px; }

.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--sea-tint); color: var(--sea-deep);
}
.stat-card .stat-icon.gold { background: var(--sand-tint); color: var(--sand); }
.stat-card .stat-value { font-size: 26px; font-weight: 700; line-height: 1.1; font-family: 'Reem Kufi', sans-serif; }
.stat-card .stat-label { color: var(--text-soft); font-size: 13px; }

/* ---------- الجداول ---------- */
.table { --bs-table-hover-bg: var(--sea-tint); margin-bottom: 0; }
.table > thead th {
  background: #F7FAFB;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table > tbody td { vertical-align: middle; border-color: #EDF2F4; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ---------- الأزرار والحقول ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 14.5px; }
.btn-primary { background: var(--sea); border-color: var(--sea); }
.btn-primary:hover, .btn-primary:focus { background: var(--sea-deep); border-color: var(--sea-deep); }
.btn-outline-primary { color: var(--sea); border-color: var(--sea); }
.btn-outline-primary:hover { background: var(--sea); border-color: var(--sea); }
.btn-gold { background: var(--sand); border-color: var(--sand); color: #fff; }
.btn-gold:hover { background: #A97C22; border-color: #A97C22; color: #fff; }

.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: #D8E2E7;
  padding: 9px 13px;
  font-size: 14.5px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(13, 110, 133, .12);
}
.form-label { font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.required::after { content: ' *'; color: #DC3545; }

.badge { font-weight: 600; padding: .38em .7em; border-radius: 7px; }

/* ---------- صفحة الدخول ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(192, 145, 47, .22) 0%, transparent 55%),
    linear-gradient(160deg, var(--ink) 0%, var(--sea-deep) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  position: relative;
  overflow: hidden;
}
.auth-side::after {           /* خط الأفق - عنصر الهوية */
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 22%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192, 145, 47, .55), transparent);
}
.auth-side h1 { font-size: 34px; line-height: 1.6; margin: 0 0 6px; }
.auth-side .rule { width: 60px; height: 3px; background: var(--sand); border-radius: 2px; margin: 18px 0; }
.auth-side p { color: #A9C5CE; max-width: 34ch; line-height: 2; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-form .inner { width: 100%; max-width: 380px; }

/* ---------- حالات فارغة ---------- */
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-soft); }
.empty-state i { font-size: 40px; color: #B9CBD3; display: block; margin-bottom: 12px; }

.deadline-note { font-size: 13px; color: var(--sand); font-weight: 600; }

/* ---------- الاستجابة للجوال ---------- */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(8, 36, 48, .45);
  z-index: 1035; display: none;
}
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(100%); }         /* تنزلق خارج الشاشة يميناً */
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .app-main { margin-right: 0; }
  .content { padding: 18px 14px 32px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 40px 28px; min-height: 210px; }
  .auth-side h1 { font-size: 26px; }
  .auth-side p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .btn, .nav-link { transition: none !important; }
}

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app-main { margin: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
}
