:root {
  --bg: #041b0d;
  --bg-2: #08341a;
  --bg-3: #0f5627;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.9);
  --text: #112418;
  --text-soft: #5a6b61;
  --line: rgba(4, 50, 20, 0.12);
  --primary: #0d6b2d;
  --primary-deep: #05501e;
  --primary-soft: #2e8d3f;
  --accent: #f0c330;
  --accent-soft: #fff2c4;
  --muted: #eff6f0;
  --danger: #b42318;
  --success: #126838;
  --shadow: 0 20px 60px rgba(4, 27, 13, 0.16);
  --shadow-soft: 0 12px 30px rgba(4, 27, 13, 0.08);
  --radius: 24px;
  --radius-md: 18px;
  --container: min(1200px, calc(100% - 32px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Cairo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(46, 141, 63, 0.12), transparent 22%),
    linear-gradient(180deg, #f5faf6 0%, #edf5ef 100%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
input, textarea, select { min-width: 0; }
.container { width: var(--container); margin-inline: auto; }
.section { padding: 88px 0; position: relative; }
.alt-section { background: linear-gradient(180deg, rgba(13, 107, 45, 0.03), rgba(13, 107, 45, 0.07)); }
.site-shell { min-height: 100vh; overflow: clip; }
.is-hidden { display: none !important; }
.center-text { text-align: center; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(4, 27, 13, 0.82);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
}
.topbar-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  flex-shrink: 0;
}
.brand-copy strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.brand-copy small {
  display: block;
  color: rgba(255,255,255,0.72);
  font-size: 0.88rem;
  text-transform: uppercase;
}
.brand-badge {
  width: 50px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1.3rem;
  color: #123017;
  background: linear-gradient(145deg, var(--accent), #d2ef79);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28), 0 14px 28px rgba(0,0,0,0.18);
}
.large-badge { width: 62px; border-radius: 20px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: #fff;
  flex-wrap: wrap;
}
.nav a {
  color: rgba(255,255,255,0.88);
  font-size: 0.96rem;
  white-space: nowrap;
}
.nav a:hover,
.nav a:focus-visible { color: #fff; }
.nav-static {
  position: static;
  display: flex;
  background: transparent;
  border: 0;
  padding: 0;
}
.nav-toggle {
  display: none;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  flex-shrink: 0;
}

.hero {
  padding-top: 74px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(4,27,13,0.98) 0%, rgba(0,93,31,0.97) 56%, rgba(146,196,62,0.82) 100%);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 32px;
  background: rgba(255,255,255,0.05);
  transform: rotate(40deg);
}
.hero::before { width: 440px; height: 440px; top: -150px; left: -140px; }
.hero::after { width: 380px; height: 380px; bottom: -140px; right: -120px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 32px;
  align-items: center;
}
.eyebrow,
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: var(--accent);
  font-size: 0.92rem;
}
.hero h1,
.section-copy h2,
.section-head h2,
.visit-banner h2,
.subpage-hero h1 {
  margin: 14px 0 12px;
  line-height: 1.15;
  font-size: clamp(2rem, 4vw, 4rem);
}
.hero-subtitle {
  margin: 0 0 14px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 700;
  color: #f4fbf5;
}
.lead,
.section-head p,
.section-copy p,
.visit-banner p,
.portal-header p {
  line-height: 1.95;
  font-size: 1.03rem;
}
.lead { color: rgba(255,255,255,0.88); max-width: 62ch; }
.section-head p,
.section-copy p,
.visit-banner p,
.portal-header p { color: var(--text-soft); }

.hero-actions,
.hero-pills,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-actions { margin: 22px 0 18px; }
.hero-pills { list-style: none; padding: 0; margin: 0; }
.hero-pills li {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-deep));
  box-shadow: 0 18px 35px rgba(13, 107, 45, 0.28);
}
.btn-secondary {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
}
.btn-darkish {
  background: linear-gradient(135deg, #0d6b2d, #08471c);
  color: #fff;
  border: 0;
}
.full-width { width: 100%; }

.glass-card,
.feature-box,
.contact-card,
.admin-card,
.side-card,
.stat-card,
.content-article {
  background: var(--surface-soft);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-panel {
  padding: 26px;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at top right, rgba(240, 195, 48, 0.14), transparent 25%),
    linear-gradient(145deg, rgba(46,141,63,0.11), rgba(255,255,255,0));
  pointer-events: none;
}
.hero-panel-head,
.hero-metrics,
.hero-panel-note { position: relative; z-index: 1; }
.hero-panel-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.hero-logo {
  width: 68px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 22px;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(145deg, var(--accent), #d6ef78);
  color: #103017;
}
.mini-label { margin: 0; color: var(--text-soft); font-size: 0.9rem; }
.hero-panel-head h2 { margin: 4px 0 0; font-size: 1.5rem; }
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.hero-metrics article {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.66);
  border: 1px solid rgba(13,107,45,0.08);
}
.hero-metrics strong {
  display: block;
  color: var(--primary-deep);
  font-size: 1.5rem;
}
.hero-metrics span { color: var(--text-soft); font-size: 0.94rem; }
.hero-panel-note {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(13,107,45,0.05), rgba(240,195,48,0.08));
  color: var(--text-soft);
  line-height: 1.9;
}

.stats-strip { padding-top: 22px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.stat-card {
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
}
.stat-card span {
  display: block;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.stat-card strong {
  font-size: 1.1rem;
  color: var(--primary-deep);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 28px;
  align-items: start;
}
.feature-box,
.contact-card,
.side-card,
.admin-card { padding: 26px; }
.feature-list,
.contact-list,
.info-list,
.admin-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}
.feature-list li,
.info-list li,
.contact-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13,107,45,0.04), rgba(13,107,45,0.08));
  border: 1px solid rgba(13,107,45,0.08);
}
.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.contact-list strong {
  color: var(--primary-deep);
  text-align: end;
}

.section-head { max-width: 760px; margin-bottom: 28px; }
.cards-grid {
  display: grid;
  gap: 22px;
}
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.content-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.content-card-media {
  min-height: 220px;
  background: linear-gradient(135deg, var(--primary-deep), #8cc342);
  position: relative;
}
.content-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(4,27,13,0.28));
}
.content-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.content-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.card-kicker {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.94rem;
}
.content-card-body h3 {
  margin: 0;
  font-size: 1.38rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.content-card-body p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.9;
}
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.92rem;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.visit-banner {
  padding: 34px;
  border-radius: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 20px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(244,250,245,0.96)),
    radial-gradient(circle at top left, rgba(240,195,48,0.08), transparent 20%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.visit-counter-card {
  min-width: 0;
  width: 100%;
  max-width: 320px;
  justify-self: end;
  padding: 24px;
  border-radius: 26px;
  background: linear-gradient(145deg, var(--bg), var(--primary-deep));
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 40px rgba(4, 27, 13, 0.28);
}
.visit-counter-card span {
  display: block;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}
.visit-counter-card strong {
  display: block;
  font-size: clamp(2rem, 3vw, 3rem);
  color: var(--accent);
  word-break: break-word;
}

.contact-form,
.admin-form,
.portal-form {
  display: grid;
  gap: 14px;
}
.contact-form label,
.portal-form label { display: grid; gap: 8px; }
input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(13,107,45,0.18);
  background: #fff;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea { resize: vertical; }
input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 4px rgba(46,141,63,0.12);
}

.footer {
  background: #041b0d;
  color: #fff;
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer p { color: rgba(255,255,255,0.72); margin: 8px 0 0; }
.footer-links a { color: rgba(255,255,255,0.88); }

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.12s; }

/* sub page */
.subpage-body {
  background: linear-gradient(180deg, #f3f8f4, #eff6f0);
}
.subpage-main { min-height: 100vh; }
.subpage-hero {
  padding: 72px 0 36px;
  background: linear-gradient(135deg, rgba(4,27,13,0.98), rgba(0,93,31,0.95));
  color: #fff;
}
.subpage-meta {
  color: rgba(255,255,255,0.78);
  line-height: 1.85;
}
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.content-article { padding: 28px; }
.content-image {
  width: 100%;
  border-radius: 22px;
  margin-bottom: 22px;
  max-height: 420px;
  object-fit: cover;
}
.content-excerpt {
  font-size: 1.15rem;
  color: var(--primary-deep);
  line-height: 1.9;
  font-weight: 700;
}
.content-body {
  line-height: 2;
  color: var(--text);
}
.content-body p:first-child { margin-top: 0; }
.content-body h3 {
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--primary-deep);
}
.content-body ul {
  padding-right: 20px;
  line-height: 2;
}
.content-action-wrap { margin-top: 24px; }
.side-card { box-shadow: var(--shadow-soft); }

/* portal */
.portal-body {
  background:
    radial-gradient(circle at top right, rgba(240,195,48,0.10), transparent 18%),
    linear-gradient(180deg, #041b0d 0%, #0b3118 100%);
}
.portal-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.portal-auth-card {
  width: min(560px, 100%);
  border-radius: 28px;
  padding: 32px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 30px 80px rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.58);
}
.portal-auth-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.portal-auth-head h1 { margin: 4px 0 0; font-size: clamp(1.6rem, 3vw, 2rem); color: var(--text); }
.portal-auth-copy {
  color: var(--text-soft);
  line-height: 1.95;
  margin: 18px 0 22px;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}
.portal-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 28px 20px;
  background: linear-gradient(180deg, #041b0d, #0c5526);
  color: #fff;
  border-left: 1px solid rgba(255,255,255,0.06);
}
.portal-menu {
  display: grid;
  gap: 10px;
  margin: 28px 0;
}
.portal-menu a {
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.06);
}
.portal-menu a:hover,
.portal-menu a:focus-visible { background: rgba(255,255,255,0.12); }
.portal-main {
  padding: 34px;
  background: #eef4ef;
  min-width: 0;
}
.portal-header { margin-bottom: 22px; }
.portal-header h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2rem); }
.portal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.portal-summary span {
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--primary-deep);
  box-shadow: var(--shadow-soft);
}
.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}
.card-topline h3 { margin: 10px 0 0; }
.status-text { color: var(--text-soft); }
.status-text.error { color: var(--danger); }
.status-text.success { color: var(--success); }
.admin-list { margin-top: 16px; }
.admin-item {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.admin-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.admin-item strong {
  display: block;
  overflow-wrap: anywhere;
}
.admin-item small {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.btn-mini {
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
}
.btn-edit {
  color: #0f4c1e;
  background: #e5f5e7;
}
.btn-delete {
  color: #fff;
  background: #b42318;
}
.btn-link {
  color: #fff;
  background: #0d6b2d;
}
.btn-copy {
  color: var(--text);
  background: #f4f7f4;
  border: 1px solid rgba(13,107,45,0.12);
}
.image-helper {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13,107,45,0.03), rgba(13,107,45,0.06));
  border: 1px dashed rgba(13,107,45,0.18);
}
.image-helper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.image-helper input[type="file"] {
  flex: 1 1 240px;
  padding: 12px;
  background: #fff;
}
.image-upload-btn {
  min-height: 48px;
}
.image-preview {
  width: 100%;
  max-width: 340px;
  max-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: #fff;
}
.media-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-deep);
  word-break: break-all;
}

/* responsive */
@media (max-width: 1200px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .split-grid,
  .content-layout,
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
    min-height: auto;
    border-left: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
}

@media (max-width: 992px) {
  .section { padding: 76px 0; }
  .topbar-inner { min-height: 72px; gap: 14px; }
  .nav { gap: 12px; }

  .cards-3,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visit-banner {
    grid-template-columns: 1fr;
  }

  .visit-counter-card {
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border-radius: 20px;
    background: rgba(4,27,13,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 36px rgba(0,0,0,0.18);
  }

  .nav a {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .nav a:hover,
  .nav a:focus-visible {
    background: rgba(255,255,255,0.08);
  }

  .nav.open { display: flex; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, 1200px); }
  .section { padding: 68px 0; }
  .hero { padding-top: 56px; }
  .hero::before { width: 280px; height: 280px; top: -80px; left: -120px; }
  .hero::after { width: 220px; height: 220px; bottom: -90px; right: -70px; }

  .hero-actions,
  .card-actions,
  .image-helper-actions,
  .portal-summary,
  .footer-links {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .btn-mini { width: 100%; }

  .hero-metrics,
  .cards-3,
  .stats-grid { grid-template-columns: 1fr; }

  .contact-list li,
  .admin-item-head,
  .card-topline,
  .footer-inner,
  .portal-auth-head {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-main,
  .portal-auth-card,
  .feature-box,
  .contact-card,
  .admin-card,
  .side-card,
  .content-article,
  .hero-panel,
  .visit-banner { padding: 20px; }

  .content-card-body { padding: 18px; }
  .content-card-media { min-height: 190px; }
  .contact-list strong { text-align: start; }
}

@media (max-width: 560px) {
  .brand-copy small { font-size: 0.76rem; }

  .hero h1,
  .section-copy h2,
  .section-head h2,
  .visit-banner h2,
  .subpage-hero h1 {
    font-size: clamp(1.8rem, 9vw, 2.35rem);
  }

  .lead,
  .section-head p,
  .section-copy p,
  .visit-banner p,
  .portal-header p,
  .content-body,
  .content-excerpt {
    font-size: 0.98rem;
  }

  .topbar-inner { min-height: 66px; }
  .brand-badge { width: 44px; border-radius: 14px; }
  .large-badge { width: 54px; }
  .nav { right: 12px; left: 12px; }
  .portal-main { padding: 16px; }
  .portal-auth { padding: 12px; }
  .portal-auth-card { padding: 18px; border-radius: 22px; }
  .hero-panel-head h2 { font-size: 1.25rem; }
  .content-card-body h3 { font-size: 1.2rem; }
  .visit-counter-card { padding: 20px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .delay-1,
  .btn { transition: none; }
  .reveal { opacity: 1; transform: none; }
}


.contact-form-intro {
  margin: 0 0 16px;
  color: var(--text-soft);
  line-height: 1.9;
}
.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field-note {
  display: block;
  color: var(--text-soft);
  line-height: 1.8;
}
.message-item {
  display: grid;
  gap: 10px;
}
.message-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge-new {
  background: rgba(240, 195, 48, 0.16);
  color: #8a5a00;
}
.badge-read {
  background: rgba(13, 107, 45, 0.10);
  color: var(--primary-deep);
}
.message-meta {
  display: block;
  color: var(--text-soft);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.message-body {
  padding: 14px;
  border-radius: 14px;
  background: #f7faf7;
  border: 1px solid var(--line);
  line-height: 1.95;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .contact-form-grid {
    grid-template-columns: 1fr;
  }
  .message-badge {
    width: fit-content;
  }
}


.section-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
}
.gallery-filter-btn {
  border: 1px solid rgba(13,107,45,0.14);
  background: rgba(255,255,255,0.85);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
}
.gallery-filter-btn.is-active {
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-deep));
  color: #fff;
  border-color: transparent;
}
.gallery-card .content-card-media {
  min-height: 250px;
}
.gallery-card .content-card-body {
  gap: 10px;
}
.gallery-card .meta-line {
  margin-top: auto;
}
.gallery-thumb-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  background: rgba(4,27,13,0.72);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  backdrop-filter: blur(8px);
}

.gallery-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}
.gallery-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f7faf7;
  border: 1px solid rgba(13,107,45,0.1);
  color: var(--primary-deep);
}
.gallery-detail-section {
  margin-top: 28px;
}
.gallery-shots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.gallery-shot {
  overflow: hidden;
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  cursor: zoom-in;
}
.gallery-shot img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}
.gallery-shot-body {
  padding: 14px 16px 18px;
  display: grid;
  gap: 8px;
}
.gallery-shot-body h4 {
  margin: 0;
  font-size: 1rem;
}
.gallery-shot-body p {
  margin: 0;
  line-height: 1.85;
  color: var(--text-soft);
}
.gallery-shot-body:empty {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4,27,13,0.88);
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox-inner {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 14px;
}
.lightbox-inner img {
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 24px;
  background: #07150b;
}
.lightbox-caption {
  color: #fff;
  text-align: center;
  line-height: 1.85;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.admin-inline-grid {
  display: grid;
  gap: 14px;
}
.admin-inline-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.section-tag-soft {
  background: rgba(13,107,45,0.08);
  color: var(--primary-deep);
}
.gallery-builder {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(13,107,45,0.04), rgba(13,107,45,0.08));
  border: 1px solid rgba(13,107,45,0.1);
}
.gallery-builder-head {
  display: grid;
  gap: 8px;
}
.gallery-builder-head h4 {
  margin: 0;
}
.gallery-builder-head small {
  color: var(--text-soft);
  line-height: 1.8;
}
.gallery-upload-box,
.gallery-manual-add {
  display: grid;
  gap: 10px;
}
.gallery-items-list {
  display: grid;
  gap: 12px;
}
.gallery-item-editor {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.gallery-item-editor img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
}
.gallery-item-editor-body {
  display: grid;
  gap: 10px;
}
.gallery-item-editor-meta {
  display: grid;
  gap: 10px;
}
.gallery-item-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gallery-item-editor small {
  color: var(--text-soft);
  line-height: 1.7;
  word-break: break-all;
}
.admin-empty-state {
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed rgba(13,107,45,0.18);
  color: var(--text-soft);
}

@media (max-width: 992px) {
  .gallery-shots-grid,
  .admin-inline-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .gallery-filters,
  .gallery-meta-strip,
  .gallery-item-editor-actions,
  .section-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .gallery-shots-grid,
  .admin-inline-grid-2,
  .gallery-item-editor {
    grid-template-columns: 1fr;
  }
  .gallery-shot img {
    height: 220px;
  }
  .gallery-item-editor img {
    width: 100%;
    height: 180px;
  }
  .lightbox {
    padding: 16px;
  }
}

/* portal refresh */
.portal-body {
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.14), transparent 24%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.14), transparent 20%),
    linear-gradient(180deg, #dfe7f5 0%, #eef3fb 100%);
}
.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}
.portal-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 22px 18px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px);
  color: var(--text);
  border-left: 1px solid rgba(17,24,39,0.08);
  box-shadow: -10px 0 40px rgba(15, 23, 42, 0.06);
}
.portal-sidebar-head {
  display: grid;
  gap: 12px;
}
.portal-sidebar .brand { color: var(--text); }
.portal-sidebar .brand-copy small { color: var(--text-soft); }
.portal-sidebar-copy {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 0.94rem;
}
.portal-menu {
  display: grid;
  gap: 8px;
  margin: 26px 0 18px;
}
.portal-menu-link {
  appearance: none;
  border: 0;
  width: 100%;
  text-align: right;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 18px;
  color: #334155;
  background: transparent;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.portal-menu-link:hover,
.portal-menu-link:focus-visible {
  background: rgba(99,102,241,0.1);
  color: #1e293b;
}
.portal-menu-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, #4361ee, #8b5cf6);
  box-shadow: 0 16px 30px rgba(99,102,241,0.26);
}
.portal-main {
  padding: 20px;
  background: transparent;
}
.portal-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding: 24px 28px;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.portal-topbar h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}
.portal-panel {
  display: none;
  gap: 20px;
}
.portal-panel.is-active {
  display: grid;
}
.portal-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.portal-stat-card {
  padding: 22px;
  text-align: right;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(15,23,42,0.06);
}
.portal-stat-card small {
  display: block;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.portal-stat-card strong {
  display: block;
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  color: #0f172a;
}
.portal-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.portal-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.portal-notes-list {
  margin: 0;
  padding-right: 18px;
  display: grid;
  gap: 10px;
  line-height: 1.9;
  color: var(--text-soft);
}
.portal-section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.portal-section-head h3,
.portal-editor-top h3,
.portal-list-card h3,
.portal-single-card h3 {
  margin: 10px 0 8px;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}
.portal-section-head p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.9;
}
.portal-panel-actions,
.portal-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-soft {
  background: #eef2ff;
  color: #334155;
  border: 1px solid rgba(99,102,241,0.14);
}
.portal-split {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.portal-split-compact {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}
.portal-editor-card,
.portal-list-card,
.portal-single-card,
.portal-topbar,
.portal-section-head,
.portal-stat-card,
.portal-dashboard-grid .admin-card {
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
}
.portal-editor-card {
  position: sticky;
  top: 20px;
}
.portal-editor-card.is-collapsed {
  display: none;
}
.portal-editor-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.portal-editor-static {
  position: sticky;
  top: 20px;
}
.portal-list-card .admin-list {
  display: grid;
  gap: 14px;
}
.portal-list-card .admin-item,
.portal-single-card .admin-item {
  background: rgba(255,255,255,0.92);
}
.portal-single-card {
  padding: 26px;
}
.portal-editor-wide {
  min-width: 0;
}
#galleryEditorCard {
  grid-column: 1 / span 1;
}
#gallerySplit {
  grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
}
.full-width.btn-darkish {
  margin-top: auto;
  background: linear-gradient(135deg, #4361ee, #8b5cf6);
  box-shadow: 0 16px 30px rgba(99,102,241,0.24);
}
.portal-summary span {
  background: rgba(255,255,255,0.86);
  color: #0f172a;
  border-color: rgba(99,102,241,0.12);
}
@media (max-width: 1400px) {
  .portal-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }
  .portal-sidebar {
    position: static;
    min-height: auto;
    border-left: 0;
    border-bottom: 1px solid rgba(15,23,42,0.08);
  }
  .portal-stats-grid,
  .portal-dashboard-grid,
  .portal-split,
  #gallerySplit,
  .portal-split-compact {
    grid-template-columns: 1fr;
  }
  .portal-editor-card,
  .portal-editor-static {
    position: static;
  }
}
@media (max-width: 760px) {
  .portal-main {
    padding: 14px;
  }
  .portal-topbar,
  .portal-section-head,
  .portal-single-card,
  .portal-editor-card,
  .portal-list-card,
  .portal-stat-card,
  .portal-dashboard-grid .admin-card {
    padding: 18px;
  }
  .portal-topbar,
  .portal-section-head,
  .portal-editor-top {
    flex-direction: column;
    align-items: stretch;
  }
  .portal-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .portal-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* portal polish v2 */
.portal-body {
  --portal-bg: #eef3f0;
  --portal-panel: rgba(255, 255, 255, 0.92);
  --portal-panel-strong: rgba(255, 255, 255, 0.97);
  --portal-line: rgba(15, 23, 42, 0.08);
  --portal-line-strong: rgba(15, 23, 42, 0.14);
  --portal-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
  --portal-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.05);
  --portal-primary: #0d6b2d;
  --portal-primary-2: #178544;
  --portal-accent: #d4aa3c;
  background:
    radial-gradient(circle at top left, rgba(212, 170, 60, 0.10), transparent 18%),
    radial-gradient(circle at bottom right, rgba(13, 107, 45, 0.08), transparent 22%),
    linear-gradient(180deg, #edf3ef 0%, #f5f8f6 100%);
}

.portal-body,
.portal-body input,
.portal-body textarea,
.portal-body select,
.portal-body button {
  font-family: "Cairo", sans-serif;
}

.portal-body input,
.portal-body textarea,
.portal-body select {
  border-color: var(--portal-line-strong);
  background: rgba(255,255,255,0.98);
  border-radius: 16px;
  padding: 15px 16px;
}

.portal-body input:focus,
.portal-body textarea:focus,
.portal-body select:focus {
  border-color: rgba(13, 107, 45, 0.42);
  box-shadow: 0 0 0 4px rgba(13, 107, 45, 0.10);
}

.portal-body .btn {
  padding: 13px 20px;
  border-radius: 16px;
  font-weight: 800;
  min-height: 48px;
}

.portal-body .btn:hover {
  transform: translateY(-1px);
}

.portal-body .btn-primary,
.portal-body .full-width.btn-darkish {
  color: #fff;
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-primary-2));
  box-shadow: 0 14px 30px rgba(13, 107, 45, 0.20);
}

.portal-body .btn-secondary,
.portal-body .btn-soft {
  color: #334155;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: none;
}

.portal-body .btn-secondary:hover,
.portal-body .btn-soft:hover {
  background: #f8fafc;
}

.portal-shell {
  grid-template-columns: 310px minmax(0, 1fr);
}

.portal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 18px;
  background:
    linear-gradient(180deg, #071c0d 0%, #0a3f1d 55%, #0d6b2d 100%);
  color: #fff;
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -8px 0 28px rgba(15, 23, 42, 0.08);
}

.portal-sidebar-head {
  gap: 16px;
  padding: 8px 8px 0;
}

.portal-sidebar .brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
}

.portal-sidebar .brand-copy strong {
  font-size: 1.02rem;
  letter-spacing: 0.08em;
}

.portal-sidebar .brand-badge {
  width: 54px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.24), 0 14px 26px rgba(0,0,0,0.18);
}

.portal-sidebar-copy {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.82);
  padding-inline: 10px;
}

.portal-menu {
  gap: 6px;
  margin: 4px 0 6px;
}

.portal-menu-link {
  position: relative;
  padding: 14px 16px;
  border-radius: 16px;
  color: rgba(255,255,255,0.9);
  background: transparent;
}

.portal-menu-link::before {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%);
  transition: background 0.2s ease;
}

.portal-menu-link:hover,
.portal-menu-link:focus-visible {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.portal-menu-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 24px rgba(0,0,0,0.14);
}

.portal-menu-link.is-active::before {
  background: var(--portal-accent);
}

.portal-sidebar .full-width.btn-darkish {
  margin-top: auto;
}

.portal-main {
  min-width: 0;
  padding: 26px 24px 44px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.portal-main > .portal-topbar,
.portal-main > .portal-panel {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
}

.portal-topbar,
.portal-section-head,
.portal-single-card,
.portal-editor-card,
.portal-list-card,
.portal-stat-card,
.portal-dashboard-grid .admin-card {
  background: var(--portal-panel);
  border: 1px solid rgba(255,255,255,0.75);
  box-shadow: var(--portal-shadow);
}

.portal-topbar {
  align-items: flex-start;
  padding: 28px 30px;
  border-radius: 30px;
}

.portal-topbar h2 {
  margin: 10px 0 8px;
  line-height: 1.08;
  color: #102617;
}

.portal-topbar > div:first-child {
  max-width: min(760px, 100%);
}

.portal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  min-width: min(100%, 620px);
}

.portal-summary span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--portal-panel-strong);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--portal-shadow-soft);
  text-align: center;
  font-weight: 700;
  line-height: 1.6;
}

.portal-panel {
  gap: 22px;
}

.portal-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.portal-stat-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 24px;
}

.portal-stat-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0 18px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(13, 107, 45, 0.16), rgba(212, 170, 60, 0.36));
}

.portal-stat-card small {
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.portal-stat-card strong {
  font-size: clamp(2rem, 3vw, 2.8rem);
}

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

.portal-dashboard-grid .admin-card {
  border-radius: 28px;
}

.portal-quick-actions .btn {
  min-width: 140px;
}

.portal-notes-list {
  padding-right: 20px;
}

.portal-section-head {
  padding: 22px 24px;
  border-radius: 26px;
}

.portal-section-head p {
  max-width: 720px;
}

.portal-panel-actions {
  align-items: center;
}

.portal-panel-actions button[id$="CloseTop"] {
  display: none;
}

.portal-panel.has-open-editor .portal-panel-actions button[id$="CloseTop"] {
  display: inline-flex;
}

.portal-panel.has-open-editor .portal-panel-actions {
  gap: 12px;
}

.portal-split,
#gallerySplit,
.portal-split-compact {
  display: block;
  position: relative;
}

.portal-list-card,
.portal-single-card {
  border-radius: 28px;
}

.portal-list-card {
  min-height: 420px;
}

.portal-list-card .admin-list,
.portal-single-card .admin-list {
  display: grid;
  gap: 14px;
}

.admin-empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(243,247,244,0.95));
  border: 1px dashed rgba(15, 23, 42, 0.12);
  padding: 24px;
}

.admin-item {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--portal-shadow-soft);
}

.admin-item-thumb {
  width: 108px;
  height: 108px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(13, 107, 45, 0.12), rgba(212, 170, 60, 0.12));
  display: grid;
  place-items: center;
  color: var(--portal-primary);
  font-size: 1.4rem;
  font-weight: 800;
}

.admin-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-item-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-item-head {
  align-items: flex-start;
}

.admin-item-text {
  display: grid;
  gap: 6px;
}

.admin-item strong {
  font-size: 1.08rem;
  color: #0f172a;
}

.admin-item small {
  margin-top: 0;
  color: #64748b;
  line-height: 1.85;
}

.admin-item-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-item-meta-row span,
.admin-item-badge,
.media-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 0.88rem;
  max-width: 100%;
}

.media-link {
  word-break: break-all;
}

.admin-item-badge {
  color: var(--portal-primary);
  background: rgba(13, 107, 45, 0.08);
  border-color: rgba(13, 107, 45, 0.10);
  font-weight: 700;
}

.admin-actions {
  margin-top: 2px;
  gap: 10px;
}

.btn-mini {
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
}

.btn-edit {
  background: rgba(13, 107, 45, 0.10);
  color: var(--portal-primary);
}

.btn-link {
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-primary-2));
  color: #fff;
}

.btn-copy {
  background: #f8fafc;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.btn-delete {
  background: #b42318;
  color: #fff;
}

.portal-editor-card {
  position: fixed;
  top: 24px;
  left: 24px;
  width: min(560px, calc(100vw - 370px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  z-index: 80;
  border-radius: 30px;
  background: var(--portal-panel-strong);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.22);
}

.portal-editor-card.is-collapsed {
  display: none;
}

.portal-shell.has-editor-open::after {
  content: "";
  position: fixed;
  inset: 0 310px 0 0;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(3px);
  z-index: 70;
}

.portal-editor-card,
.portal-editor-static {
  padding: 24px;
}

.portal-editor-top {
  position: sticky;
  top: -24px;
  z-index: 2;
  margin: -24px -24px 18px;
  padding: 18px 24px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.portal-editor-wide {
  width: min(620px, calc(100vw - 370px));
}

.portal-editor-static {
  position: static;
  max-height: none;
  width: auto;
  box-shadow: var(--portal-shadow);
}

.portal-drawer-open {
  overflow: hidden;
}

.admin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.admin-form > input[type="hidden"] {
  display: none;
}

.admin-form > textarea,
.admin-form > .image-helper,
.admin-form > .gallery-builder,
.admin-form > .portal-form-actions,
.admin-form > .status-text,
.admin-form > button,
.admin-form > .admin-inline-grid,
.admin-form > .gallery-upload-box,
.admin-form > .gallery-manual-add {
  grid-column: 1 / -1;
}

.image-helper,
.gallery-builder {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(245,248,246,0.95), rgba(255,255,255,0.98));
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.image-helper-actions {
  align-items: center;
}

.image-helper input[type="file"] {
  border-style: dashed;
}

.image-preview {
  max-width: 100%;
  max-height: 280px;
  border-radius: 18px;
}

.gallery-builder-head {
  gap: 10px;
}

.gallery-builder-head h4 {
  font-size: 1.12rem;
}

.gallery-upload-box,
.gallery-manual-add {
  gap: 12px;
}

.gallery-items-list {
  gap: 14px;
}

.gallery-item-editor {
  grid-template-columns: 140px minmax(0, 1fr);
  padding: 16px;
  border-radius: 20px;
  border-color: rgba(15, 23, 42, 0.08);
}

.gallery-item-editor img {
  width: 140px;
  height: 140px;
  border-radius: 18px;
}

.gallery-item-editor-body,
.gallery-item-editor-meta {
  gap: 12px;
}

.message-item {
  grid-template-columns: 1fr;
}

.message-item .admin-item-head {
  justify-content: space-between;
}

.message-badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
}

.message-meta {
  color: #64748b;
}

.message-body {
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  line-height: 1.9;
}

.status-text {
  line-height: 1.8;
}

@media (max-width: 1400px) {
  .portal-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }

  .portal-editor-card,
  .portal-editor-wide {
    width: min(520px, calc(100vw - 360px));
  }
}

@media (max-width: 1200px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
    min-height: auto;
    border-left: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .portal-shell.has-editor-open::after {
    inset: 0;
  }

  .portal-editor-card,
  .portal-editor-wide {
    top: 18px;
    left: 18px;
    right: 18px;
    width: auto;
    max-height: calc(100vh - 36px);
  }

  .portal-summary,
  .portal-stats-grid,
  .portal-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .portal-topbar,
  .portal-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-summary,
  .portal-stats-grid,
  .portal-dashboard-grid,
  .admin-form,
  .admin-inline-grid-2 {
    grid-template-columns: 1fr;
  }

  .admin-item,
  .gallery-item-editor {
    grid-template-columns: 1fr;
  }

  .admin-item-thumb,
  .gallery-item-editor img {
    width: 100%;
    height: 220px;
  }
}

@media (max-width: 640px) {
  .portal-main {
    padding: 14px 12px 28px;
  }

  .portal-sidebar {
    padding: 16px 12px;
  }

  .portal-topbar,
  .portal-section-head,
  .portal-single-card,
  .portal-editor-card,
  .portal-list-card,
  .portal-stat-card,
  .portal-dashboard-grid .admin-card,
  .portal-editor-static {
    padding: 18px;
    border-radius: 22px;
  }

  .portal-editor-top {
    top: -18px;
    margin: -18px -18px 18px;
    padding: 16px 18px;
  }

  .portal-panel-actions,
  .portal-form-actions,
  .admin-actions,
  .image-helper-actions,
  .portal-quick-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-summary span {
    min-height: 56px;
    font-size: 0.95rem;
  }
}
