/* ═══════════════════════════════════════════════════
   شبكة السادس الاعدادي - CSS الرئيسي
   نظام ألوان: أزرق ملكي + ذهبي + أبيض
═══════════════════════════════════════════════════ */

/* ── متغيرات الألوان ─────────────────────────── */
:root {
  --blue-950: #0F1F4A;
  --blue-900: #1E3A8A;
  --blue-800: #1D4ED8;
  --blue-600: #2563EB;
  --blue-400: #60A5FA;
  --blue-100: #DBEAFE;
  --blue-50:  #EFF6FF;

  --gold-600: #B45309;
  --gold-500: #D97706;
  --gold-400: #F59E0B;
  --gold-300: #FCD34D;
  --gold-100: #FEF3C7;
  --gold-50:  #FFFBEB;

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;

  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1),  0 4px 8px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 40px rgba(0,0,0,.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: .22s cubic-bezier(.4,0,.2,1);
  --font: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}

/* ── ريست وأساسيات ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--gray-50);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--blue-800); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-500); }
ul  { list-style: none; }

/* ── Container ──────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── شريط علوي ──────────────────────────────── */
.top-bar {
  background: var(--blue-950);
  color: var(--gold-300);
  font-size: .85rem;
  text-align: center;
  padding: .45rem 0;
  font-weight: 500;
}

/* ── الهيدر ─────────────────────────────────── */
.header {
  background: var(--white);
  border-bottom: 3px solid var(--gold-400);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .85rem 0;
}

/* الشعار */
.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  text-decoration: none;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  color: var(--gold-300);
  font-size: 1.6rem;
  font-weight: 900;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(30,58,138,.35);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-main {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--blue-900);
}

.logo-sub {
  font-size: .85rem;
  color: var(--gold-500);
  font-weight: 600;
}

/* القائمة */
.nav { display: flex; }

.nav-list {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-link, .nav-btn {
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 600;
  color: var(--gray-700);
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: .3rem;
}

.nav-link:hover, .nav-btn:hover {
  color: var(--blue-800);
  background: var(--blue-50);
}

.nav-link.active {
  color: var(--blue-800);
  background: var(--blue-100);
}

/* Dropdown */
.nav-dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100);
  min-width: 190px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 100;
  overflow: hidden;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: .7rem 1.1rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: all var(--transition);
  border-bottom: 1px solid var(--gray-100);
}

.dropdown-menu li:last-child a { border-bottom: none; }

.dropdown-menu li a:hover {
  background: var(--blue-50);
  color: var(--blue-800);
  padding-right: 1.4rem;
}

.arrow { font-size: .7rem; transition: transform var(--transition); }
.nav-dropdown:hover .arrow { transform: rotate(180deg); }

/* همبرجر */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
}

.hamburger span {
  width: 26px;
  height: 2.5px;
  background: var(--blue-900);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  display: block;
}

.hamburger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ── بطل الصفحة الرئيسية ──────────────────── */
.hero {
  background: linear-gradient(135deg, var(--blue-950) 0%, var(--blue-900) 50%, #1a2e6e 100%);
  color: var(--white);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 750px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.35);
  color: var(--gold-300);
  padding: .4rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}

.hero h1 .highlight {
  color: var(--gold-400);
  position: relative;
}

.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,.82);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

/* إحصاءات البطل */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold-300);
  line-height: 1;
}

.stat-label {
  font-size: .8rem;
  color: rgba(255,255,255,.65);
  margin-top: .25rem;
}

/* ── أزرار الأقسام الرئيسية ──────────────────── */
.sections {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--blue-900);
  margin-bottom: .5rem;
}

.section-title p {
  color: var(--gray-500);
  font-size: 1rem;
}

.section-title .line {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-400), var(--blue-600));
  border-radius: var(--radius-full);
  margin: .8rem auto 0;
}

/* بطاقات الأقسام */
.branch-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.branch-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all .3s ease;
  border: 1px solid var(--gray-100);
  position: relative;
}

.branch-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--gold-300);
}

.branch-card-header {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  padding: 2rem 1.5rem 1.5rem;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.branch-card-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 30px;
  background: var(--white);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.branch-icon {
  font-size: 2.5rem;
  margin-bottom: .5rem;
}

.branch-card-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.branch-card-header p {
  font-size: .85rem;
  opacity: .8;
  margin-top: .25rem;
}

.branch-card-body {
  padding: 1.5rem;
}

.branch-links {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.branch-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid var(--gray-100);
  transition: all var(--transition);
}

.branch-link:hover {
  background: var(--blue-50);
  border-color: var(--blue-400);
  color: var(--blue-800);
  padding-right: 1.4rem;
}

.branch-link .link-arrow {
  color: var(--gold-500);
  font-size: 1.1rem;
}

/* ── صفحة الاسئلة الوزارية ──────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--blue-950), var(--blue-900));
  color: var(--white);
  padding: 3rem 0 2rem;
}

.page-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  margin-bottom: .5rem;
}

.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  color: rgba(255,255,255,.7);
  flex-wrap: wrap;
}

.page-header .breadcrumb a {
  color: var(--gold-300);
}

/* فلتر الاسئلة */
.filter-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  margin: 2rem 0;
  border: 1px solid var(--gray-100);
}

.filter-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* سنوات الفلتر */
.filter-years {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.25rem;
}

.year-btn {
  padding: .5rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-full);
  background: none;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
}

.year-btn:hover, .year-btn.active {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: var(--white);
}

/* ادوار الفلتر */
.filter-sessions {
  display: none;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.25rem;
  animation: fadeIn .3s ease;
}

.filter-sessions.visible { display: flex; }

.session-btn {
  padding: .5rem 1.1rem;
  border: 2px solid var(--gold-300);
  border-radius: var(--radius-full);
  background: var(--gold-50);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  color: var(--gold-600);
  cursor: pointer;
  transition: all var(--transition);
}

.session-btn:hover, .session-btn.active {
  background: var(--gold-400);
  border-color: var(--gold-400);
  color: var(--white);
}

/* مواد الفلتر */
.filter-subjects {
  display: none;
  flex-direction: column;
  gap: .5rem;
  animation: fadeIn .3s ease;
}

.filter-subjects.visible { display: flex; }

.subject-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.subject-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
  color: var(--gray-800);
  transition: all var(--transition);
  border: none;
  width: 100%;
  font-family: var(--font);
  font-size: .95rem;
}

.subject-header:hover {
  background: var(--blue-50);
  color: var(--blue-800);
}

.subject-header.open {
  background: var(--blue-900);
  color: var(--white);
}

.subject-links {
  display: none;
  padding: .75rem;
  background: var(--gray-50);
  flex-direction: column;
  gap: .5rem;
}

.subject-links.visible { display: flex; }

.question-link-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
  color: var(--gray-700);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.question-link-item:hover {
  border-color: var(--blue-400);
  color: var(--blue-800);
  background: var(--blue-50);
}

.question-link-item .ql-year {
  font-size: .78rem;
  color: var(--gray-400);
  font-weight: 400;
}

/* ── بطاقة السؤال المنفرد ──────────────────── */
.question-page {
  padding: 2rem 0 3rem;
}

.question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}

.question-meta {
  background: linear-gradient(90deg, var(--blue-900), var(--blue-700));
  color: var(--white);
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(255,255,255,.15);
  padding: .3rem .8rem;
  border-radius: var(--radius-full);
  font-size: .82rem;
  font-weight: 600;
}

.meta-badge.gold {
  background: rgba(245,158,11,.3);
  color: var(--gold-200, #fde68a);
}

.question-images {
  padding: 1.75rem;
}

.question-images h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.question-img {
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  max-width: 100%;
  cursor: zoom-in;
  transition: transform var(--transition);
}

.question-img:hover { transform: scale(1.01); }

/* أزرار الحلول */
.solution-btns {
  display: flex;
  gap: 1rem;
  padding: 0 1.75rem 1.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37,99,235,.45);
  color: var(--white);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-400));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245,158,11,.35);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245,158,11,.45);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--blue-600);
  color: var(--blue-600);
}

.btn-outline:hover {
  background: var(--blue-600);
  color: var(--white);
}

/* ── صفحة الملفات ──────────────────────────── */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 2rem 0;
}

.subject-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  overflow: hidden;
  transition: all .3s ease;
}

.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold-300);
}

.subject-card-header {
  background: var(--blue-50);
  border-bottom: 3px solid var(--gold-400);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.subject-emoji { font-size: 1.5rem; }

.subject-card-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--blue-900);
}

.subject-card-body { padding: 1rem; }

.category-links { display: flex; flex-direction: column; gap: .5rem; }

.category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .9rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-size: .9rem;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.category-link:hover {
  background: var(--blue-50);
  border-color: var(--blue-300);
  color: var(--blue-800);
}

/* بطاقات الملفات */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.file-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  overflow: hidden;
  transition: all .3s ease;
}

.file-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.file-card-img {
  height: 180px;
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.file-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-card-img .file-placeholder {
  font-size: 3.5rem;
  color: var(--blue-300);
}

.file-type-badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--blue-900);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: var(--radius-full);
}

.file-card-body { padding: 1rem 1.1rem; }

.file-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .5rem;
  line-height: 1.4;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .9rem;
}

.file-meta span {
  font-size: .78rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* ── صفحة تحميل الملف ──────────────────────── */
.download-page {
  padding: 2.5rem 0;
}

.download-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.download-cover {
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  overflow: hidden;
}

.download-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.download-info {
  padding: 2rem;
}

.download-info h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--blue-900);
  margin-bottom: 1rem;
  line-height: 1.35;
}

.download-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: 1.25rem 0;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.detail-label {
  font-size: .78rem;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
}

.detail-value {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gray-800);
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--gold-600), var(--gold-400));
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 800;
  margin-top: 1.5rem;
  box-shadow: 0 4px 15px rgba(245,158,11,.4);
  transition: all var(--transition);
  text-align: center;
  width: 100%;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(245,158,11,.5);
  color: var(--white);
}

/* ── لوحة التحكم ────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--blue-950);
  color: var(--white);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  padding: 1rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 1rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  color: rgba(255,255,255,.75);
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--transition);
}

.admin-nav a:hover, .admin-nav a.active {
  background: rgba(255,255,255,.08);
  color: var(--gold-300);
  border-right: 3px solid var(--gold-400);
}

.admin-main {
  background: var(--gray-50);
  padding: 2rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.admin-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue-900);
}

/* بطاقات احصاءات الداشبورد */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card-icon.blue { background: var(--blue-100); }
.stat-card-icon.gold { background: var(--gold-100); }

.stat-card-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--blue-900);
  line-height: 1;
}

.stat-card-label {
  font-size: .82rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* نماذج الادمن */
.admin-form {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  border: 1px solid var(--gray-100);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: .4rem; }

.form-group label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: .65rem .9rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .9rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition);
  outline: none;
  direction: rtl;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue-500, #3b82f6);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* منطقة رفع الصور */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-50);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.upload-zone input[type="file"] { display: none; }

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
}

.upload-preview img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
}

/* ── الفوتر ──────────────────────────────────── */
.footer {
  background: var(--blue-950);
  color: rgba(255,255,255,.8);
  padding: 3.5rem 0 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer-desc {
  font-size: .9rem;
  line-height: 1.8;
  color: rgba(255,255,255,.6);
  margin-top: 1rem;
}

.footer h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 1rem;
}

.footer-links li { margin-bottom: .5rem; }

.footer-links a {
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--gold-300); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem 0;
  text-align: center;
  font-size: .85rem;
  color: rgba(255,255,255,.45);
}

/* ── مساعد: تنبيهات ─────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: var(--blue-50); color: var(--blue-900); border: 1px solid var(--blue-200, #bfdbfe); }

/* ── Loading ─────────────────────────────────── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--gray-400);
  gap: .75rem;
  font-size: .95rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

/* ── Image Lightbox ──────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all .25s ease;
}

.lightbox.open { opacity: 1; visibility: visible; }

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255,255,255,.15);
  color: var(--white);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
}

.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ── Keyframes ───────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.animate-in { animation: slideUp .4s ease both; }

/* ── الاستجابة للشاشات الصغيرة ──────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .download-card { grid-template-columns: 1fr; }
  .download-cover { min-height: 200px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open { display: flex; position: fixed; inset: 0; top: 0; background: var(--white); z-index: 999; padding-top: 80px; flex-direction: column; }
  .nav-list { flex-direction: column; width: 100%; padding: 1rem; gap: .25rem; }
  .nav-link, .nav-btn { width: 100%; justify-content: space-between; font-size: 1.1rem; padding: .9rem 1rem; }
  .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; background: var(--gray-50); margin: .25rem 0 .5rem; border-radius: var(--radius-md); }
  .hamburger { display: flex; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-stats { gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .download-details { grid-template-columns: 1fr; }
  .branch-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.65rem; }
  .section-title h2 { font-size: 1.5rem; }
  .page-header h1 { font-size: 1.35rem; }
  .stat-number { font-size: 1.6rem; }
}

/* ── Reduced Motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
