:root {
  --bg: #f5f5ef;
  --surface: #ffffff;
  --surface-soft: #eef4f0;
  --text: #1e2930;
  --muted: #4f5f67;
  --brand: #0f6a57;
  --brand-strong: #0a4f41;
  --accent: #c37a1f;
  --border: #d8e0da;
  --shadow: 0 10px 30px rgba(15, 52, 44, 0.09);
  --anchor-offset: 5rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor-offset);
}

body {
  margin: 0;
  font-family: "Work Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #e4efe9, transparent 40%), var(--bg);
  line-height: 1.6;
}

html[lang="ar"] body {
  font-family: "Tajawal", "Segoe UI", sans-serif;
}

.lang-ar {
  display: none;
}

html[lang="ar"] .lang-en {
  display: none;
}

html[lang="ar"] .lang-ar {
  display: inline;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.2;
  font-family: "Playfair Display", Georgia, serif;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  font-family: "Tajawal", "Segoe UI", sans-serif;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 245, 239, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.24s ease, background 0.24s ease;
}

.site-header-hidden {
  transform: translateY(-100%);
}

.nav-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0 0.9rem;
}

.header-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand-logo {
  width: 6.2rem;
  height: 6.2rem;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: block;
  min-width: 0;
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  line-height: 1.1;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
}

html[lang="ar"] .brand-title {
  font-family: "Tajawal", "Segoe UI", sans-serif;
}

.brand-subtitle {
  margin-top: 0.35rem;
  line-height: 1.35;
  font-size: 0.98rem;
  color: var(--muted);
  font-weight: 500;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.main-nav a {
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--brand);
  color: #fff;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.8rem;
  border-radius: 0.5rem;
  font-weight: 600;
}

.hero {
  padding: 4rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: start;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-strong);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

html[lang="ar"] .kicker {
  text-transform: none;
  letter-spacing: 0;
}

.hero-text {
  max-width: 62ch;
  color: var(--muted);
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.hero-card ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
}

html[lang="ar"] .hero-card ul,
html[lang="ar"] .signs-list {
  padding-left: 0;
  padding-right: 1.2rem;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-strong);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--brand-strong);
  border: 2px solid var(--brand-strong);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.section {
  padding: 3.8rem 0;
}

[id] {
  scroll-margin-top: var(--anchor-offset);
}

.section-light {
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.6rem;
}

.feature-split {
  align-items: center;
}

.feature-media {
  display: flex;
}

.feature-image {
  width: 100%;
  display: block;
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  object-fit: cover;
  min-height: 320px;
  background: var(--surface);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.cards {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
}

.activity-meta {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.activity-list {
  margin: 0.8rem 0;
  padding-left: 1.2rem;
}

html[lang="ar"] .activity-list {
  padding-left: 0;
  padding-right: 1.2rem;
}

.activity-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.activity-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface-soft);
}

.signs-list {
  padding-left: 1.2rem;
  margin: 1rem 0;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

.resource-list {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.resource-link {
  display: block;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.resource-link:hover {
  text-decoration: none;
  border-color: var(--brand);
  transform: translateY(-1px);
}

.video-embed {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.video-embed iframe,
.video-embed video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-note {
  margin-top: 0.9rem;
  color: var(--muted);
}

.supporters-section {
  background: var(--surface);
}

.supporters-wrap {
  max-width: 860px;
}

.supporters-intro {
  color: var(--muted);
  max-width: 60ch;
}

.partners-logos {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.partner-logo-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  min-height: 132px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.partner-logo {
  max-width: 100%;
  max-height: 76px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.supporters-subtitle {
  margin: 2rem 0 0.8rem;
}

.supporters-list {
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.supporters-list li {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.contact {
  background: linear-gradient(180deg, #f8faf8, #eef4f0);
}

.contact-grid {
  max-width: 720px;
}

.btn-office {
  background: var(--accent);
}

.btn-office:hover {
  background: #9d6215;
}

.office-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card,
.table-card,
.review-card,
.news-admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  margin: 0.35rem 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--brand-strong);
}

.management-form label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-grid-full {
  grid-column: 1 / -1;
}

.management-form input,
.management-form select,
.management-form textarea {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
  font: inherit;
  color: var(--text);
}

.management-form textarea {
  resize: vertical;
}

.form-message {
  margin: 0;
  color: var(--brand-strong);
  font-weight: 600;
}

.form-error {
  color: #9f1c1c;
}

.table-card {
  margin-top: 1.2rem;
}

.toolbar-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-grid-medical {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-admin-list {
  display: grid;
  gap: 0.85rem;
}

.section-admin-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface-soft);
}

.section-admin-item h4 {
  margin-bottom: 0.35rem;
}

.code-textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  min-height: 24rem;
}

.media-managed-image {
  margin-top: 1rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--brand-strong);
  font-size: 0.92rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.status-under-processing {
  background: #fff1d6;
  color: #8a5a00;
}

.status-confirmed {
  background: #dff5e8;
  color: #0d6d3d;
}

.status-rejected {
  background: #fde3e3;
  color: #9f1c1c;
}

.table-action {
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: transparent;
  color: var(--brand-strong);
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.danger-action {
  border-color: #b93030;
  color: #9f1c1c;
}

.table-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.news-card p:last-child,
.news-admin-card p:last-child {
  margin-bottom: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.portal-notice {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid #b7e0c7;
  border-radius: 0.9rem;
  background: #e8f8ee;
  color: #0d6d3d;
  font-weight: 700;
}

.portal-notice-error {
  border-color: #e8b5b5;
  background: #fdeaea;
  color: #9f1c1c;
}

.service-panel-header {
  margin-bottom: 1rem;
}

.service-chip-list {
  display: grid;
  gap: 0.75rem;
}

.service-chip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface-soft);
}

.toolbar-select {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.toolbar-select select {
  min-width: 140px;
}

.finance-stats-grid {
  margin-top: 1.2rem;
}

.review-card {
  margin-top: 1rem;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
  margin: 1rem 0;
}

.empty-state {
  color: var(--muted);
  margin: 0;
}

.hidden {
  display: none;
}

.portal-body {
  min-height: 100vh;
}

.portal-shell {
  width: min(1180px, 92%);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.portal-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
}

.portal-section {
  padding-top: 2rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #e8efe9;
}

.footer-wrap {
  padding: 1rem 0;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 860px) {
  :root {
    --anchor-offset: 8rem;
  }

  .nav-wrap {
    gap: 0.55rem;
  }

  .header-top {
    align-items: flex-start;
  }

  .brand-logo {
    width: 4.6rem;
    height: 4.6rem;
  }

  .brand-text {
    width: min(62vw, 280px);
  }

  .activity-gallery {
    grid-template-columns: 1fr;
  }

  .resource-list {
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-subtitle {
    font-size: 0.82rem;
  }

  .menu-toggle {
    display: inline-block;
  }

  .main-nav {
    position: absolute;
    right: 4%;
    top: 88px;
    display: none;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.7rem;
    min-width: 180px;
    box-shadow: var(--shadow);
    border-top: 1px solid var(--border);
  }

  html[lang="ar"] .main-nav {
    right: auto;
    left: 4%;
  }

  .main-nav.open {
    display: flex;
  }

  .hero-grid,
  .split,
  .contact-grid,
  .partners-logos,
  .supporters-list,
  .cards,
  .stats-grid,
  .form-grid,
  .dashboard-grid,
  .review-grid,
  .portal-hero,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
  }

  .toolbar-header {
    flex-direction: column;
    align-items: stretch;
  }

  .section-admin-item {
    flex-direction: column;
    align-items: stretch;
  }
}
