/* ============================================================
   البوابة الرقمية لإدارة المدرسة — الثيم البصري الموحّد
   ============================================================ */

:root {
  --navy: #0b1f3a;
  --navy-2: #14315c;
  --navy-soft: #1f3f6b;
  --white: #ffffff;
  --gray-50: #f5f7fa;
  --gray-100: #eef1f6;
  --gray-300: #d7dee7;
  --gray-500: #7c8798;
  --gray-700: #4a5568;
  --blue: #2f6fb0;
  --blue-soft: #eaf1fa;
  --gold: #c9a253;
  --turquoise: #2fb8ac;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-sm: 0 2px 10px rgba(11, 31, 58, 0.06);
  --shadow-md: 0 10px 28px rgba(11, 31, 58, 0.10);
  --shadow-hover: 0 16px 36px rgba(11, 31, 58, 0.16);
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Tajawal", "IBM Plex Sans Arabic", "Noto Kufi Arabic", Tahoma, sans-serif;
  background: var(--gray-50);
  color: var(--navy);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; }

/* -------------------- الهيدر -------------------- */
.site-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-soft) 100%);
  color: var(--white);
  padding: 20px 0;
  position: relative;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(201, 162, 83, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
}

.header-home-link {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.header-home-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--turquoise);
}

/* -------------------- الهيرو (الرئيسية) -------------------- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 24px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero h2 {
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  margin: 0 0 12px;
  color: var(--navy);
}

.hero p {
  color: var(--gray-700);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1rem;
}

/* -------------------- الحاوية العامة -------------------- */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
  flex: 1;
  width: 100%;
}

/* -------------------- Breadcrumb -------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--gray-500);
  margin: 20px 0 28px;
}

.breadcrumb a {
  color: var(--blue);
  font-weight: 600;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb .sep { color: var(--gray-300); }

.breadcrumb .current {
  color: var(--navy);
  font-weight: 700;
}

/* -------------------- شبكة البطاقات -------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 22px;
  margin-top: 12px;
}

.section-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.section-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--turquoise);
}

.section-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.section-card h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--navy);
}

.section-card p {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.88rem;
  flex: 1;
}

.card-btn {
  align-self: flex-start;
  margin-top: 6px;
  background: var(--navy);
  color: var(--white);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.25s ease;
}

.section-card:hover .card-btn {
  background: var(--turquoise);
}

/* -------------------- بطاقات الملفات (داخل الأقسام) -------------------- */
.page-intro {
  color: var(--gray-700);
  max-width: 760px;
  margin-bottom: 8px;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.file-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

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

.file-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.file-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.file-card-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
}

.file-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-items li {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

.file-items li span:first-child {
  color: var(--navy);
}

.btn-open {
  background: var(--blue);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.btn-open:hover { background: var(--navy); }

.btn-disabled {
  background: var(--gray-300);
  color: var(--gray-700);
  cursor: not-allowed;
}

.file-card.standalone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-card.standalone .file-card-header { margin-bottom: 0; }

.empty-note {
  background: var(--blue-soft);
  color: var(--navy-2);
  border: 1px dashed var(--blue);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.85rem;
  margin-top: 18px;
}

/* -------------------- الرؤية / الرسالة / الأهداف / القيم -------------------- */
.vm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.vm-card {
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  color: var(--white);
}

.vm-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-card p, .vm-card li { font-size: 0.92rem; opacity: 0.95; }

.vm-card ul { display: flex; flex-direction: column; gap: 8px; }
.vm-card li { list-style: none; padding-inline-start: 0; }

.vm-vision { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.vm-mission { background: linear-gradient(135deg, var(--blue), #234f7d); }
.vm-goals { background: var(--white); color: var(--navy); border: 1px solid var(--gray-100); }
.vm-goals li::before { content: "◆ "; color: var(--turquoise); }
.vm-values { background: var(--white); color: var(--navy); border: 1px solid var(--gray-100); }
.vm-values li::before { content: "◆ "; color: var(--gold); }
.vm-goals p, .vm-goals li, .vm-values p, .vm-values li { color: var(--gray-700); }

/* -------------------- الهيكل التنظيمي (Org Chart) -------------------- */
.org-chart-scroll {
  overflow-x: auto;
  padding: 30px 10px 40px;
}

.org-chart {
  direction: ltr;
  display: flex;
  justify-content: center;
  min-width: 620px;
}

.org-chart ul {
  padding-top: 24px;
  position: relative;
  display: flex;
  justify-content: center;
}

.org-chart li {
  list-style: none;
  text-align: center;
  position: relative;
  padding: 24px 14px 0;
}

.org-chart li::before,
.org-chart li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid var(--blue);
  width: 50%;
  height: 24px;
}

.org-chart li::after {
  right: auto;
  left: 50%;
  border-right: none;
  border-left: 2px solid var(--blue);
}

.org-chart li:only-child::before,
.org-chart li:only-child::after {
  display: none;
}

.org-chart li:only-child { padding-top: 0; }

.org-chart li:first-child::before,
.org-chart li:last-child::after {
  border: 0 none;
}

.org-chart li:last-child::before {
  border-right: 2px solid var(--blue);
  border-radius: 0 6px 0 0;
}

.org-chart li:first-child::after {
  border-radius: 6px 0 0 0;
}

.org-chart ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid var(--blue);
  width: 0;
  height: 24px;
}

.org-card {
  direction: rtl;
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.org-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.org-card.level-0 {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  font-size: 0.95rem;
  padding: 14px 22px;
}

.org-card.level-1 {
  border-top: 3px solid var(--blue);
}

.org-card.level-2 {
  border-top: 3px solid var(--turquoise);
  font-weight: 500;
  font-size: 0.8rem;
}

.org-chart-hint {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.82rem;
  margin-top: -10px;
}

/* -------------------- زر العودة للرئيسية (سفلي) -------------------- */
.back-home-wrap {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-300);
  text-align: center;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: var(--white);
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.25s ease, transform 0.2s ease;
}

.back-home-btn:hover {
  background: var(--turquoise);
  transform: translateY(-2px);
}

/* -------------------- الفوتر -------------------- */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
}

/* -------------------- الاستجابة (Responsive) -------------------- */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .hero { padding: 40px 18px 16px; }
  .page-container { padding: 24px 16px 48px; }
  .cards-grid, .files-grid { grid-template-columns: 1fr; }
  .file-card.standalone { flex-direction: column; align-items: flex-start; }
  .org-card { font-size: 0.75rem; padding: 10px 12px; white-space: normal; max-width: 130px; }
}

@media (max-width: 400px) {
  .brand-text h1 { font-size: 1.05rem; }
  .hero h2 { font-size: 1.35rem; }
}
