:root {
  --navy: #101d3a;
  --navy-2: #182a55;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --violet: #7c6ee6;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --soft-2: #eef3f9;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe6f1;
  --shadow: 0 18px 55px rgba(16, 29, 58, .10);
  --shadow-strong: 0 24px 70px rgba(16, 29, 58, .16);
  --radius: 8px;
}

* {
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Cairo", system-ui, sans-serif;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 247, 251, .96), rgba(244, 247, 251, 1)),
    repeating-linear-gradient(135deg, rgba(37, 99, 235, .06) 0 1px, transparent 1px 18px);
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--blue-2);
}

::selection {
  background: rgba(37, 99, 235, .18);
}

.container {
  --bs-gutter-x: 1.25rem;
}

.sanad-navbar {
  background: rgba(16, 29, 58, .94);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 18px 45px rgba(16, 29, 58, .18);
  backdrop-filter: blur(14px);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 42px;
  color: #fff !important;
  font-weight: 800 !important;
}

.navbar-brand::before {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--teal), var(--blue)),
    linear-gradient(45deg, transparent 48%, rgba(255,255,255,.6) 48% 52%, transparent 52%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 10px 24px rgba(20, 184, 166, .24);
}

.navbar-dark .navbar-nav .nav-link {
  position: relative;
  color: rgba(255, 255, 255, .78);
  font-weight: 700;
  padding-inline: .9rem;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: #fff;
}

.navbar-dark .navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  inset-inline: .9rem;
  bottom: .15rem;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(16, 29, 58, .96) 0%, rgba(24, 42, 85, .88) 47%, rgba(37, 99, 235, .66) 100%),
    url("https://images.unsplash.com/photo-1523580846011-d3a5bc25702b?auto=format&fit=crop&w=1800&q=85") center/cover;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, #000 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 92px;
  background: linear-gradient(180deg, transparent, var(--soft));
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero .badge {
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
  backdrop-filter: blur(12px);
}

.hero h1 {
  max-width: 900px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  font-weight: 800;
  line-height: 1.18;
  text-wrap: balance;
  text-shadow: 0 14px 32px rgba(0,0,0,.22);
}

.hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 2;
}

.section-title {
  position: relative;
  font-weight: 800;
  color: var(--navy);
  text-wrap: balance;
}

.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: .65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--violet));
}

.d-flex > .section-title::after {
  display: none;
}

.soft-card,
.stat-card,
.material-card,
.question-card {
  position: relative;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(223, 230, 241, .95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.soft-card::before,
.stat-card::before,
.material-card::before,
.question-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--violet));
  opacity: .85;
}

.material-card,
.question-card,
.soft-card,
.stat-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.material-card:hover,
.question-card:hover,
.soft-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, .28);
  box-shadow: var(--shadow-strong);
}

.feature-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 14px 28px rgba(37, 99, 235, .22);
  font-weight: 800;
  font-size: 1.1rem;
}

.material-card h3,
.material-card h5,
.question-card h2,
.question-card h5,
.soft-card h5 {
  color: var(--navy);
  line-height: 1.55;
}

.text-secondary {
  color: var(--muted) !important;
}

.btn {
  border-radius: var(--radius);
  font-weight: 800;
  padding: .68rem 1.05rem;
  box-shadow: none !important;
}

.btn-sm {
  padding: .45rem .75rem;
  font-weight: 700;
}

.btn-lg {
  padding: .84rem 1.35rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  border-color: transparent;
  box-shadow: 0 14px 26px rgba(37, 99, 235, .22) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #1f58d8, #183fb3);
  border-color: transparent;
  transform: translateY(-1px);
}

.btn-outline-primary {
  border-color: rgba(37, 99, 235, .38);
  color: var(--blue);
  background: rgba(255,255,255,.72);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn-light {
  border-color: rgba(255,255,255,.7);
}

.form-label {
  font-weight: 800;
  color: var(--navy);
}

.form-control,
.form-select {
  min-height: 48px;
  border-radius: var(--radius);
  border-color: var(--line);
  background-color: #fff;
  padding: .74rem .95rem;
  color: var(--ink);
}

textarea.form-control {
  min-height: 150px;
  line-height: 1.8;
}

.form-control:hover,
.form-select:hover {
  border-color: #c7d3e5;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .13);
}

.form-text {
  color: var(--muted);
}

.badge {
  border-radius: 7px;
  padding: .48rem .72rem;
  font-weight: 800;
}

.text-bg-light {
  color: var(--navy) !important;
  background: #eef4ff !important;
}

.page-shell {
  padding-block: 2.5rem;
}

.admin-shell {
  max-width: none;
  padding: 0;
  margin: 0;
}

.admin-shell > .row.g-4 {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
  min-height: calc(100vh - 74px);
  margin: 0;
  background:
    linear-gradient(180deg, rgba(244, 247, 251, .92), rgba(244, 247, 251, 1)),
    radial-gradient(circle at 28% 12%, rgba(37, 99, 235, .08), transparent 34%);
}

.admin-shell > .row.g-4 > .col-lg-3 {
  width: 306px;
  flex: 0 0 306px;
  padding: 0;
}

.admin-shell > .row.g-4 > .col-lg-9 {
  width: auto;
  flex: 1 1 0;
  padding: 2rem 2.25rem 3rem;
}

.page-shell > .row.g-4 {
  align-items: flex-start;
}

.page-shell > .row.g-4 > .col-lg-3 {
  order: 1;
}

.page-shell > .row.g-4 > .col-lg-9 {
  order: 2;
}

.page-shell > .row.g-4 > .col-lg-9 > .section-title {
  margin-bottom: 1.5rem !important;
}

.page-shell > .row.g-4 > .col-lg-9 {
  min-width: 0;
}

.page-shell > .row.g-4 > .col-lg-9 > .table-responsive,
.page-shell > .row.g-4 > .col-lg-9 > .soft-card {
  border: 1px solid rgba(223, 230, 241, .9);
}

.admin-sidebar {
  position: sticky;
  top: 68px;
  min-height: calc(100vh - 68px);
  height: calc(100vh - 68px);
  padding: 1.05rem;
  border-radius: 0 0 0 var(--radius);
  border: 1px solid rgba(255, 255, 255, .10);
  border-inline-start: 1px solid rgba(255,255,255,.10);
  border-inline-end: 0;
  border-top: 0;
  background:
    linear-gradient(160deg, rgba(16, 29, 58, .98), rgba(24, 42, 85, .98) 64%, rgba(18, 58, 88, .98)),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: auto, 42px 42px;
  box-shadow: -22px 0 70px rgba(16, 29, 58, .18);
  overflow: hidden;
}

.admin-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.10), transparent 34%);
  pointer-events: none;
}

.admin-sidebar-head,
.admin-sidebar-nav {
  position: relative;
  z-index: 1;
}

.admin-sidebar-head {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .35rem .35rem 1.05rem;
  margin-bottom: .8rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: #fff;
}

.admin-sidebar-head strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
}

.admin-sidebar-head small {
  display: block;
  margin-top: .2rem;
  color: rgba(255,255,255,.62);
  font-weight: 700;
}

.admin-sidebar-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal), var(--blue));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.20), 0 14px 28px rgba(20,184,166,.24);
}

.admin-sidebar-nav {
  display: grid;
  gap: .45rem;
}

.admin-sidebar a {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 52px;
  padding: .82rem .9rem;
  color: rgba(255, 255, 255, .76);
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 800;
  overflow: hidden;
  transition: transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease;
}

.admin-sidebar a::before {
  content: "";
  position: absolute;
  inset-block: 10px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--teal);
  opacity: 0;
  transform: scaleY(.35);
  transition: opacity .18s ease, transform .18s ease;
}

.admin-link-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.62);
  font-size: .78rem;
  font-weight: 800;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  color: #fff;
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.13);
  transform: translateX(-3px);
}

.admin-sidebar a:hover::before,
.admin-sidebar a.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.admin-sidebar a:hover .admin-link-number,
.admin-sidebar a.active .admin-link-number {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
}

.stat-card {
  min-height: 132px;
}

.stat-card h2 {
  color: var(--navy);
  font-size: 2.35rem;
  margin-bottom: .25rem;
}

.vote-box {
  min-width: 88px;
  text-align: center;
  background: linear-gradient(180deg, #f8fbff, #eef4ff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem;
}

.site-footer {
  position: relative;
  background:
    linear-gradient(135deg, var(--navy), #182a55 60%, #123a58);
  color: #fff;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .65;
}

.site-footer .container {
  position: relative;
  z-index: 1;
}

.footer-link {
  color: rgba(255, 255, 255, .76);
  margin-inline-start: 1rem;
  font-weight: 700;
}

.footer-link:hover {
  color: #fff;
}

.table-responsive {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
}

.table {
  --bs-table-bg: #fff;
  --bs-table-striped-bg: #f8fbff;
  margin-bottom: 0;
  overflow: hidden;
  vertical-align: middle;
}

.table thead th {
  background: #eef4ff;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  white-space: nowrap;
}

.table td {
  color: #344054;
  border-color: #edf1f7;
}

.table tbody tr {
  transition: background .18s ease, transform .18s ease;
}

.table tbody tr:hover {
  background: #f7fbff;
}

.sanad-alert {
  border-radius: var(--radius);
  border: 0;
  box-shadow: var(--shadow);
}

.alert-info {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
}

main > .container:first-child:not(.pt-3) {
  margin-top: 1rem;
}

.vstack.gap-3 > .question-card {
  border-inline-start: 4px solid transparent;
}

.vstack.gap-3 > .question-card:hover {
  border-inline-start-color: var(--teal);
}

.subject-hero {
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,251,255,.92)),
    radial-gradient(circle at 12% 20%, rgba(20,184,166,.12), transparent 28%);
}

.material-interactive-card {
  display: flex;
  flex-direction: column;
}

.rating-summary {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 32px;
  padding: .35rem .65rem;
  border-radius: 7px;
  color: #7c4a03;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-weight: 800;
}

.rating-summary span {
  color: #9a6b25;
  font-size: .85rem;
}

.rating-form {
  padding: .85rem;
  border-radius: var(--radius);
  background: #f8fbff;
  border: 1px solid var(--line);
}

.comments-box {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.comment-item {
  padding: .72rem .8rem;
  margin-bottom: .55rem;
  border-radius: 7px;
  background: #f8fbff;
  border: 1px solid #e8eef8;
}

.comment-item strong {
  display: block;
  color: var(--navy);
  font-size: .92rem;
  margin-bottom: .25rem;
}

.comment-item p {
  margin-bottom: .25rem;
  color: #344054;
  line-height: 1.7;
}

.comment-item span {
  color: var(--muted);
  font-size: .78rem;
}

.notification-card {
  border-inline-start: 4px solid transparent;
}

.notification-card.is-unread {
  border-inline-start-color: var(--teal);
  background: linear-gradient(135deg, #ffffff, #f0fdfa);
}

.notification-card.is-unread h2::after {
  content: "جديد";
  display: inline-flex;
  margin-inline-start: .6rem;
  padding: .2rem .45rem;
  border-radius: 999px;
  color: #065f46;
  background: #ccfbf1;
  font-size: .72rem;
  vertical-align: middle;
}

@media (max-width: 991px) {
  .navbar-collapse {
    padding-top: 1rem;
  }

  .navbar-nav {
    gap: .15rem;
  }

  .navbar-dark .navbar-nav .nav-link {
    padding: .75rem .85rem;
    border-radius: var(--radius);
  }

  .navbar-dark .navbar-nav .nav-link:hover {
    background: rgba(255,255,255,.08);
  }

  .navbar-dark .navbar-nav .nav-link::after {
    display: none;
  }
}

@media (max-width: 767px) {
  .hero {
    min-height: 72vh;
    text-align: center;
  }

  .hero h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .hero p {
    line-height: 1.8;
  }

  .hero .d-flex {
    justify-content: center;
  }

  .soft-card,
  .stat-card,
  .material-card,
  .question-card {
    box-shadow: 0 12px 32px rgba(16, 29, 58, .08);
  }

  .question-card.d-flex {
    flex-direction: column;
  }

  .vote-box {
    width: 100%;
    min-width: 0;
  }

  .footer-link {
    display: inline-block;
    margin-block: .35rem;
  }
}
