@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: local('Cairo'), local('Cairo Regular'),
       url('https://cdn.jsdelivr.net/fontsource/fonts/cairo:vf@latest/arabic-wght-normal.woff2') format('woff2-variations'),
       url('https://cdn.jsdelivr.net/fontsource/fonts/cairo:vf@latest/latin-ext-wght-normal.woff2') format('woff2-variations');
}

:root {
  --primary: #0f9d92;
  --primary-dark: #08776f;
  --primary-soft: #e8f7f5;
  --text: #173a3b;
  --muted: #6e7f80;
  --bg: #f4f8f8;
  --white: #ffffff;
  --border: #d9e9e7;
  --shadow: 0 14px 34px rgba(8, 77, 72, 0.09);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(15,157,146,.08), transparent 25%),
    linear-gradient(180deg, #f8fbfb 0%, #eef5f5 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
body, button, input, textarea, select, option, a, h1, h2, h3, h4, h5, h6, p, span, strong, div, label { font-family: 'Cairo', Tahoma, Arial, sans-serif; }
button, input, textarea, select { font: inherit; }
.container { width: min(1100px, calc(100% - 28px)); margin-inline: auto; }

/* إبراز الهيدر بشكل جميل */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: #e4fff4;
  border-bottom: 1px solid #e5e7eb;

  /* هذا أهم جزء */
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);

  backdrop-filter: blur(6px); /* لمسة عصرية */
}

/* تنعيم الحواف */
.topbar-inner {
  border-radius: 0 0 18px 18px;
}

.topbar-inner.compact { min-height: 86px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { width: 150px; }

.inner-nav-wrap { padding-top: 14px; }
.inner-nav { display: flex; gap: 10px; flex-wrap: wrap; }

.hero { padding: 15px 0 18px; }
.hero-card {
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(232,247,245,.95));
  border: 1px solid rgba(15,157,146,.12);
  border-radius: 30px; padding: 28px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; align-items: center;
}
.hero-card.single-column { grid-template-columns: 1fr; }
.hero-badge {
  display: inline-flex; width: fit-content; align-items: center; justify-content: center;
  padding: 9px 16px; border-radius: 999px; background: var(--primary-soft);
  color: var(--primary-dark); font-weight: 800; margin-bottom: 14px;
}
.hero h2 { margin: 0 0 12px; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.6; }
.hero p { margin: 0; color: var(--muted); line-height: 1.95; }

.role-grid, .dashboard-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px;
}
.role-card, .portal-card {
  min-height: 162px; border-radius: 22px; padding: 22px;
  background: rgba(255,255,255,.95); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  transition: .22s ease;
}
.role-card:hover, .portal-card:hover { transform: translateY(-3px); }
.role-card strong, .portal-card strong { font-size: 1.12rem; color: var(--primary-dark); }
.role-card span, .portal-card span { color: var(--muted); line-height: 1.9; }
.portal-card.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
}
.portal-card.primary strong, .portal-card.primary span { color: #fff; }

.section-title { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin: 0 0 18px; }
.section-title.simple { margin-bottom: 18px; }
.section-title h3 { margin: 0; font-size: 1.35rem; }
.section-title p { margin: 6px 0 0; color: var(--muted); }

.category-card, .card {
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.category-card { padding: 22px; }
.content-wrap { padding: 18px 0 50px; }

/* إضافة تغير ظهور كروت الانجاز 
.page-content {
  width: 100%;
  display: block;
}
 نهاية الاضافة */


.page-grid, .admin-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; }
.narrow-wrap { width: min(760px, 100%); }
.page-content h2, .announcement-single h2, .login-card h2 { margin-top: 0; margin-bottom: 12px; }
.content-text { color: var(--muted); line-height: 1.95; }

.feature-list { display: grid; gap: 12px; margin-top: 18px; }
.feature-item {
  background: linear-gradient(180deg, #fff 0%, #f7fbfb 100%);
  border: 1px solid var(--border); border-radius: 18px; padding: 16px;
}
.feature-item strong { display: block; margin-bottom: 6px; color: var(--primary-dark); }

.mock-image {
  min-height: 340px; border-radius: 24px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15,157,146,.14), rgba(15,157,146,.05)),
    radial-gradient(circle at top left, rgba(255,255,255,.85), transparent 30%),
    linear-gradient(135deg, #dff3f0, #f7fbfb);
  display: flex; align-items: end; padding: 18px;
}
.mock-label {
  width: 100%; border-radius: 20px; background: rgba(255,255,255,.92); border: 1px solid var(--border); padding: 18px;
}
.badges, .stats, .ad-meta, .actions, .split-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.badge, .pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 8px 14px; border-radius: 999px;
  background: #f7fbfb; border: 1px solid var(--border); color: var(--primary-dark); font-weight: 700;
}

.button-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tab-btn, .btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 56px; padding: 14px 18px; border-radius: 18px;
  border: 1px solid rgba(15,157,146,.18);
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfb 100%);
  color: var(--primary-dark); font-weight: 800; transition: .2s ease; cursor: pointer;
}
.tab-btn:hover, .btn:hover, .tab-btn:focus, .btn:focus, .tab-btn:active, .btn:active {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px rgba(10, 64, 62, .11);
  color: var(--primary-dark);
}
.tab-btn.primary, .btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: transparent;
}
.ghost-btn { background: rgba(255,255,255,.94); }
.back-btn { min-width: 170px; }
.top-actions { margin-bottom: 16px; }

.ads-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  align-items: stretch;
}

.ad-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
}
.ad-card h3 { margin: 0; }
.ad-card p { margin: 0; color: var(--muted); line-height: 1.9; }
.announcement-single { padding: 24px; }
.single-meta { margin-bottom: 12px; }
.big-stats { margin: 16px 0; }
.reaction-form { display: flex; gap: 12px; flex-wrap: wrap; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
input, textarea, select {
  width: 100%; border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 16px; padding: 14px 16px; outline: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15,157,146,.08); }

.notice {
  border-radius: 18px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--border);
}
.notice.success { background: #eefaf8; color: #0d6a63; }
.notice.error { background: #fff2f2; color: #a04141; }
.notice.info { background: #f4fbff; color: #215f74; }
.empty-state { padding: 22px; text-align: center; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); text-align: right; }
.data-table th { color: var(--primary-dark); background: #f7fbfb; }

.footer { padding: 22px 0 34px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .hero-card, .page-grid, .admin-grid, .role-grid, .dashboard-grid, .ads-grid { grid-template-columns: 1fr; }
  .topbar-inner { align-items: flex-start; }
}

@media (max-width: 640px) {
  .container { width: min(100%, calc(100% - 20px)); }
  .topbar-inner { padding: 12px 0; gap: 10px; }
  .brand { gap: 10px; }
  .brand img { width: 150px; }
  .brand p { font-size: .82rem; }
  .hero { padding-top: 16px; }
  .hero-card, .category-card, .announcement-single { padding: 18px; border-radius: 22px; }
  .form-grid, .button-grid { grid-template-columns: 1fr; }
  .tab-btn, .btn { min-height: 54px; }
  .user-badge { padding-inline: 12px; font-size: .92rem; }
  .inner-nav { gap: 8px; }
}


.brand-text h1 { margin: 0; font-size: clamp(1rem, 2.3vw, 1.35rem); line-height: 1.5; }
.brand-text p { margin: 3px 0 0; color: var(--muted); font-size: .92rem; }
.user-badge-wrap { display: flex; align-items: center; }
.user-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 18px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 800; font-size: 1rem;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 10px 24px rgba(8, 77, 72, 0.18);
}
.portal-intro {
  margin-top: 18px; padding: 18px 20px; border-radius: 22px;
  background: rgba(255,255,255,.9); border: 1px solid rgba(15,157,146,.12);
  color: var(--text); line-height: 2;
}
.portal-intro p { margin: 0; color: #8c1b05; }
.login-shell { display: grid; gap: 18px; }
.password-panel {
  position: relative;
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f4fbfa 100%);
  border: 1px solid rgba(15,157,146,.14);
  box-shadow: var(--shadow);
}
.password-panel::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top left, rgba(15,157,146,.09), transparent 34%);
  pointer-events: none;
}
.password-box {
  position: relative;
  display: grid; gap: 12px;
  padding: 18px; border-radius: 20px;
  background: #fff; border: 1px solid rgba(15,157,146,.14);
}
.password-box label { color: var(--primary-dark); font-weight: 800; }
.password-box input {
  min-height: 58px; border-radius: 18px; border: 1px solid rgba(15,157,146,.18);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
  padding-inline: 18px; font-size: 1rem;
}
.password-box input::placeholder { color: #8aa1a0; }
.password-help { color: var(--muted); line-height: 1.9; }
.footer small { display: block; margin-top: 6px; }
@media (max-width: 640px) {
  .user-badge { min-height: 46px; border-radius: 14px; font-size: .92rem; }
  .portal-intro { padding: 16px; }
  .password-panel { padding: 16px; border-radius: 20px; }
  .password-box { padding: 14px; }
}

.login-btn-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
}

.login-btn-wrap .btn {
  width: 220px;
  max-width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto !important;
  float: none !important;
}

.form-grid > .login-btn-wrap {
  grid-column: 1 / -1;
}

/* Scroll أفقي للبطاقات */
.horizontal-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* شبكة أفقية بدل عمودية */
.horizontal-scroll .admin-grid {
  display: flex !important;
  flex-direction: row !important;
  gap: 14px;
  min-width: max-content;
}

/* كل بطاقة */
.horizontal-scroll .category-card {
  min-width: 340px;
  max-width: 360px;
  flex: 0 0 auto;
}

/* للجوال */
@media (max-width: 768px) {
  .horizontal-scroll {
    padding-bottom: 8px;
  }

  .horizontal-scroll .category-card {
    min-width: 92vw; /* بعرض الشاشة تقريبًا */
  }
}

.footer a {
  color: #1a73e8 !important; /* الأزرق */
  font-weight: 700;
}

.footer a:hover {
  color: #0b57d0 !important; /* أزرق أغمق عند المرور */
  text-decoration: underline;
}

/* بطاقات القيادات - ستايل مبسط مشابه للمثال */
.leaders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.leader-card {
  position: relative;
  border-radius: 28px;
  padding: 24px 18px 18px;
  background: linear-gradient(145deg, #ffffff, #eef6f0);
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow:
    0 20px 34px rgba(54, 84, 65, 0.14),
    0 8px 14px rgba(54, 84, 65, 0.08),
    inset 0 2px 0 rgba(255,255,255,0.95),
    inset 0 -4px 10px rgba(120, 148, 129, 0.06);
  overflow: hidden;
  text-align: center;
  scroll-margin-top: 120px;
}

.leader-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0.1) 35%,
    transparent 60%
  );
  pointer-events: none;
}

.leader-top-line {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, #7ad0a4, #4e8f68, #dff8ea);
  box-shadow: 0 2px 8px rgba(78, 143, 104, 0.25);
}

.leader-main .leader-top-line {
  background: linear-gradient(90deg, #0f9d92, #08776f, #bdf1eb);
}

.leader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.leader-avatar-3d {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 24px;
  background: linear-gradient(145deg, #6fc18f, #3e7655);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  box-shadow:
    0 12px 20px rgba(62, 118, 85, 0.26),
    inset 0 2px 8px rgba(255,255,255,0.24),
    inset 0 -6px 10px rgba(0,0,0,0.08);
  position: relative;
}

.leader-main .leader-avatar-3d {
  background: linear-gradient(145deg, #0f9d92, #08776f);
}

.leader-avatar-3d::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 24px;
  height: 9px;
  border-radius: 20px;
  background: rgba(255,255,255,0.35);
  transform: rotate(-15deg);
}

.leader-role-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(145deg, #f8fffb, #d9f0e1);
  color: #2f6b49;
  font-size: 14px;
  font-weight: 700;
  box-shadow:
    0 6px 12px rgba(70, 120, 90, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

.leader-main .leader-role-badge {
  background: linear-gradient(145deg, #e6fbf8, #c7f2ec);
  color: #0d5a54;
}

.leader-info {
  width: 100%;
}

.leader-name-3d,
.leader-name {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #183828;
  line-height: 1.7;
  text-align: center;
  margin-bottom: 0;
  text-shadow: 0 1px 0 rgba(255,255,255,0.65);
}

.leader-input {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  border-radius: 16px;
  border: 1px solid rgba(15,157,146,.18);
  background: #fff;
  color: #173a3b;
  text-align: center;
  padding: 12px 14px;
  outline: none;
}

.leader-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15,157,146,.08);
}

.leader-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
  width: 100%;
}

.leader-actions .btn {
  min-height: 42px;
  padding: 10px 14px;
  flex: 1 1 auto;
}

@media (max-width: 768px) {
  .leaders-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .leader-card {
    padding: 22px 16px 16px;
    border-radius: 24px;
  }

  .leader-avatar-3d {
    width: 80px;
    height: 80px;
    font-size: 28px;
    border-radius: 20px;
  }

  .leader-name-3d,
  .leader-name {
    font-size: 20px;
  }
}

.hidden {
  display: none;
}

/* النص الرئيسي */
.portal-intro {
  text-align: center;
  margin-top: 10px;
}

.intro-main {
  font-family: 'Aref Ruqaa', serif;    
  font-size: 1.7rem;
  line-height: 2.2;
  color: #374151;
  margin-bottom: 22px;
}

/* شبكة الرؤية والرسالة */
.vision-mission {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* الكرت */
.vm-card {
  padding: 18px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

/* العنوان */
.vm-card h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

/* النص */
.vm-card p {
  font-size: 1.2rem;
  line-height: 1.9;
  color: #4b5563;
}

/* ألوان مميزة */
.vm-card.vision {
  border-top: 4px solid #0f9d92;
}

.vm-card.mission {
  border-top: 4px solid #2563eb;
}

/* للجوال */
@media (max-width: 768px) {
  .vision-mission {
    grid-template-columns: 1fr;
  }
}

/* صفحة إحصائيات الغياب */
.hijri-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.attendance-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 18px 0 22px;
}

.attendance-box {
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.attendance-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 0.98rem;
}

.attendance-box span {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.attendance-latest-title {
  margin-top: 28px;
}

@media (max-width: 900px) {
  .attendance-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hijri-grid {
    grid-template-columns: 1fr;
  }

  .attendance-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* أضافة بسيط بخصوص المساعد الإداري */
.names-input {
  min-height: 90px;
  resize: none;
}

.names-list span {
  display: block;
  margin-bottom: 4px;
}

/* اضافة تنسيق يتعلق بالإحصائيات */
.attendance-grades-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.total-absence-box {
  background: linear-gradient(135deg, #0f9d92, #08776f);
  color: #fff;
  border-color: transparent;
}

.total-absence-box strong,
.total-absence-box span {
  color: #fff;
}

@media (max-width: 900px) {
  .attendance-grades-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .attendance-grades-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== الهيكل الإداري الشجري ===== */
.org-tree-wrap {
  width: 100%;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 30px;
  padding-bottom: 40px;
}

.org-tree-stage {
  position: relative;
  width: 1500px;
  height: 920px;
  transform-origin: top center;
}

.org-tree-chart {
  position: relative;
  width: 1500px;
  height: 920px;
}

.org-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.org-line {
  stroke: #1f2937;
  stroke-width: 3.5;
  fill: none;
}

.org-arrow {
  fill: #1f2937;
}

.org-box {
  position: absolute;
  width: 360px;
  min-height: 180px;
  border-radius: 30px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  text-align: center;
  background: #fff;
  border: 3px solid;
  box-shadow: 0 10px 26px rgba(0,0,0,0.07);
  z-index: 2;
  overflow: visible;
}

.org-box .leader-content {
  width: 100%;
  padding: 22px 18px;
}

.org-box .leader-avatar-3d {
  transform: scale(1.08);
  margin-bottom: 10px;
}

.org-box .leader-role-badge {
  margin-bottom: 12px;
  font-size: 22px;
}

.org-box .leader-name {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.5;
}

.org-box .leader-input {
  width: 100%;
  margin-top: 10px;
  text-align: center;
  font-size: 20px;
}

.org-box .leader-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* الصف الأول */
.org-box.principal {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #dde4f3;
  border-color: #7d96bf;
}

/* الصف الثاني */
.org-box.edu {
  top: 325px;
  left: 70px;
  background: #dfe8db;
  border-color: #8fad73;
}

.org-box.school {
  top: 325px;
  left: 50%;
  transform: translateX(-50%);
  background: #dfe8db;
  border-color: #8fad73;
}

.org-box.student {
  top: 325px;
  right: 70px;
  background: #dfe8db;
  border-color: #8fad73;
}

/* الصف الثالث */
.org-box.activity {
  top: 660px;
  left: 130px;
  background: #e4ddeb;
  border-color: #9a84b3;
}

.org-box.health {
  top: 660px;
  left: 50%;
  transform: translateX(-50%);
  background: #efe1cc;
  border-color: #cb9a2b;
}

.org-box.guide {
  top: 660px;
  right: 150px;
  background: #efe1cc;
  border-color: #cb9a2b;
}

/* تحسين بسيط للجوال */
@media (max-width: 900px) {
  .org-tree-wrap {
    margin-top: 18px;
    padding-bottom: 20px;
  }

  .org-box .leader-role-badge {
    font-size: 22px;
  }

  .org-box .leader-name {
    font-size: 26px;
  }
}

/* جزئية رقم التواصل  */
.contact-btn {
  background: linear-gradient(135deg, #0f9d92, #08776f);
  color: #fff !important;
  font-weight: bold;
  border-radius: 10px;
}

.contact-btn:hover {
  opacity: 0.9;
}

/* ضبط صورة الأنجازات */
.achievement-thumb-wrap {
  width: 100%;
  height: 180px;
  background: #f7fbfb;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.achievement-thumb {
  width: 100%;
  height: 100%;
  /*object-fit: cover;*/
  display: block;
}

.achievement-thumb.no-pic {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #94a3b8;
  background: #f8fafc;
}

.achievement-image {
  width: 100%;
  max-width: 700px;
  display: block;
  margin: 15px auto;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s ease;
}

.achievement-image:hover {
  transform: scale(1.02);
}

/* بطاقات الإعلانات بنفس نمط الاتصال المؤسسي */
.ad-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2px;
}

.ad-card {
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ad-card h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.8;
  color: var(--text);
}

.ad-card .btn {
  width: 100%;    
  margin-top: auto;
}

.achievement-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* نص الإعلان و نص الإنجاز */
.reading-box {
  margin-top: 18px;
  padding: 22px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
}

.reading-box::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark), #bdf1eb);
}

.reading-box-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: .98rem;
}

.reading-box-content {
  font-size: 1.08rem;
  line-height: 2.15;
  color: #243b3c;
  white-space: pre-line;
  word-break: break-word;
}

@media (max-width: 640px) {
  .reading-box {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .reading-box-content {
    font-size: 1rem;
    line-height: 2;
  }
}

/* إضافة جديدة للازرار بعد التفاعل */
.reacted-btn {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
}

/* ستايل لإظهار نوع التفاعل  */
/* لايك (أخضر - نفس الحالي) */
.reaction-like {
  background: #eefaf8;
  color: #0d6a63;
  border: 1px solid #bfe7e2;
}

/* ديسلايك (أحمر) */
.reaction-dislike {
  background: #fdecec;
  color: #b42318;
  border: 1px solid #f5c2c0;
}

/* توحيد صور المعاينة داخل الإعلان والإنجاز */
.achievement-gallery {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.achievement-gallery.single-image {
  grid-template-columns: 1fr;
}

.achievement-gallery.two-images {
  grid-template-columns: repeat(2, 1fr);
}

.achievement-gallery-item {
  width: 100%;
  height: 360px;
  border-radius: 18px;
  overflow: hidden;

  /* ✨ خلفية أجمل */
  background: linear-gradient(135deg, #f8fafc, #eef2f7);

  border: 1px solid var(--border);

  /* 🔥 أهم إضافة */
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-gallery-item .achievement-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ✅ يظهر كامل بدون تشويه */

  /* ✨ تحسين العرض */
  padding: 10px;
  border-radius: 12px;

  cursor: pointer;
}

@media (max-width: 768px) {
  .achievement-gallery.two-images {
    grid-template-columns: 1fr;
  }

  .achievement-gallery-item {
    height: 260px;
  }
}

/* ===== صفحة أرقام التواصل ===== */
.contacts-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.contact-class-card {
  min-height: 105px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
  box-shadow: 0 8px 20px rgba(8, 77, 72, 0.07);
  padding: 12px 10px;
  cursor: pointer;
  transition: .22s ease;
  color: var(--text);
  text-align: center;
}

.contact-class-card:hover,
.contact-class-card.active {
  transform: translateY(-2px);
  border-color: rgba(15,157,146,.35);
}

.contact-class-icon {
  display: flex;
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 20px;
}

.contact-class-card strong {
  display: block;
  font-size: .95rem;
  color: var(--primary-dark);
  margin-bottom: 2px;
  line-height: 1.5;
}

.contact-class-card small {
  color: var(--muted);
  font-weight: 700;
  font-size: .78rem;
}

.pdf-viewer-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
  box-shadow: var(--shadow);
}

.pdf-viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pdf-viewer-head strong {
  color: var(--primary-dark);
  font-size: 1.05rem;
}

.pdf-viewer-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.contacts-pdf-frame {
   width: 100%;
  height: 780px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  overflow: auto;
}

/* ألوان الفصول */
.contact-class-card.contact-color-blue {
  background: linear-gradient(135deg, #e0f2fe, #ffffff);
  border-color: #bae6fd;
}

.contact-class-card.contact-color-pink {
  background: linear-gradient(135deg, #fce7f3, #ffffff);
  border-color: #fbcfe8;
}

.contact-class-card.contact-color-blue .contact-class-icon {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
}

.contact-class-card.contact-color-pink .contact-class-icon {
  background: linear-gradient(135deg, #f9a8d4, #db2777);
}

.contact-class-card.contact-color-blue.active,
.contact-class-card.contact-color-blue:hover {
  background: linear-gradient(135deg, #bae6fd, #f0f9ff);
}

.contact-class-card.contact-color-pink.active,
.contact-class-card.contact-color-pink:hover {
  background: linear-gradient(135deg, #fbcfe8, #fff1f2);
}

@media (max-width: 768px) {
  .contacts-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
  }

  .contact-class-card {
    min-height: 88px;
    padding: 9px 7px;
    border-radius: 15px;
  }

  .contact-class-icon {
    width: 34px;
    height: 34px;
    font-size: 17px;
    border-radius: 11px;
    margin-bottom: 5px;
  }

  .contact-class-card strong {
    font-size: .84rem;
    line-height: 1.4;
  }

  .contact-class-card small {
    font-size: .68rem;
  }

  .contacts-pdf-frame {
    height: 620px;
  }

  .pdf-viewer-head .btn {
    width: 100%;
  }
}
/* لتميز الفصل المختار  */
.contact-class-card.active {
  border: 2.5px solid #000; /* إطار أسود */
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08); /* توهج خفيف */
}

/* تعديل زر التواصل للمدرسة */
.no-link {
  cursor: default;
  pointer-events: none;
  text-decoration: none;
}

.contact-btn {
  font-weight: 700;
}

/*  تنسيقات تتعلق بإعادة التعيين  */
.danger-btn {
  background: linear-gradient(135deg, #dc2626, #991b1b) !important;
  color: #fff !important;
  border: none !important;
}

.reset-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.reset-modal.show {
  display: flex;
}

.reset-box {
  width: min(950px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.reset-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #fee2e2;
  color: #991b1b;
  font-size: 26px;
  cursor: pointer;
}

.reset-box h2 {
  margin: 0 0 8px;
  color: #111827;
}

.reset-warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 700;
}

.reset-section {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  background: #f9fafb;
}

.reset-section h3 {
  margin: 0 0 12px;
  color: #0f172a;
}

.reset-section label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0 6px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.reset-section input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.full-reset-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px !important;
  font-size: 17px;
}

.reset-select-all-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.reset-note {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 18px;
}

.custom-modal-overlay.show {
  display: flex;
}

.custom-modal-box {
  width: min(92vw, 430px);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 25px 70px rgba(0,0,0,.2);
  text-align: center;
}

.custom-modal-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #b91c1c;
}

.custom-modal-title {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.custom-modal-text {
  font-size: 14px;
  color: #475569;
  line-height: 1.9;
  margin-bottom: 20px;
}

.custom-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-danger-soft,
.btn-cancel-soft {
  min-width: 120px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
}

.btn-danger-soft {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
}

.btn-cancel-soft {
  background: #eef2f7;
  color: #334155;
}

.site-toast-wrap {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  pointer-events: none;
}

.site-toast {
  min-width: 280px;
  max-width: 92vw;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  border: 1px solid #86efac;
  box-shadow: 0 18px 40px rgba(22, 101, 52, 0.14);
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-18px) scale(.96);
  transition: .3s ease;
}

.site-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.site-toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(22, 101, 52, .12);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* تعديل مكان زر إعادة التعيين */
.nav-separator {
  margin: 0 8px;
  font-weight: bold;
  color: #94a3b8;
}

