:root {
  --green-900: #064e3b;
  --green-800: #075e54;
  --green-700: #0f766e;
  --green-100: #e5f4ef;
  --gold: #b8872f;
  --gold-100: #fbf3df;
  --red: #b91c1c;
  --ink: #17211f;
  --muted: #65716d;
  --line: #dfe7e3;
  --surface: #ffffff;
  --bg: #f5f8f6;
  --shadow: 0 24px 60px rgba(6, 78, 59, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Tajawal", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
}

.brand,
.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green-800), var(--green-700));
  color: white;
  font-weight: 800;
  box-shadow: 0 18px 34px rgba(7, 94, 84, .25);
}

.brand strong,
.admin-brand strong {
  display: block;
  color: var(--green-800);
  font-size: 1.25rem;
  font-weight: 800;
}

.brand small,
.admin-brand small {
  display: block;
  color: var(--muted);
  line-height: 1.3;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.nav-links a {
  padding: 10px 16px;
  border-radius: 999px;
}

.nav-links a:hover,
.nav-links a:first-child {
  background: var(--green-100);
  color: var(--green-800);
}

.hero {
  padding: 72px 0 46px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 44px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--gold-100);
  color: #7a531a;
  font-weight: 800;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--green-900);
}

.hero p {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 650px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--green-800);
  font-weight: 800;
  cursor: pointer;
}

.btn-primary {
  background: var(--green-800);
  color: white;
  border-color: var(--green-800);
  box-shadow: 0 20px 40px rgba(7, 94, 84, .22);
}

.btn-sm {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: .9rem;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
  box-shadow: none;
}

.btn-gold {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}

.inline-actions,
.compact-action-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.inline-actions form,
.compact-action-form {
  margin: 0;
}

.hero-card {
  position: relative;
  padding: 24px;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.member-card-preview {
  aspect-ratio: 85.6 / 53.98;
  border-radius: 24px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.88), rgba(255,255,255,.92)),
    linear-gradient(135deg, rgba(184,135,47,.18), rgba(7,94,84,.15));
  border: 1px solid rgba(7, 94, 84, .18);
}

.card-strip {
  height: 9px;
  border-radius: 99px;
  background: var(--gold);
  margin-bottom: 18px;
}

.member-card-preview h3 {
  margin: 0;
  color: var(--green-900);
  font-size: 1.35rem;
}

.member-card-preview .badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff7e6;
  color: #8a5c19;
  font-weight: 800;
  margin: 12px 0;
}

.card-lines {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.card-lines span {
  display: block;
  height: 10px;
  border-radius: 99px;
  background: rgba(7, 94, 84, .12);
}

.section {
  padding: 58px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 28px;
}

.section-title h2 {
  margin: 0 0 10px;
  color: var(--green-900);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card,
.form-card,
.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(6, 78, 59, .07);
}

.feature-card {
  padding: 22px;
}

.feature-card strong {
  display: block;
  color: var(--green-900);
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.form-shell {
  width: min(760px, calc(100% - 32px));
  margin: 44px auto;
}

.form-card {
  padding: clamp(22px, 4vw, 34px);
}

.form-card h1,
.form-card h2 {
  margin: 0 0 12px;
  color: var(--green-900);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field.full { grid-column: 1 / -1; }
.field label { font-weight: 800; color: var(--green-900); }

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fbfdfc;
  color: var(--ink);
}

.field textarea { min-height: 110px; resize: vertical; }

.hint {
  color: var(--muted);
  font-size: .92rem;
}

.alert {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.alert-success { background: #ecfdf5; border-color: #bbf7d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.membership-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.membership-option {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.membership-option input { margin-left: 6px; }
.membership-option strong { display: block; color: var(--green-900); }
.membership-option span { display: block; color: var(--muted); font-size: .9rem; }

.site-footer {
  border-top: 1px solid var(--line);
  background: white;
  color: var(--muted);
}

.admin-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--green-900);
  color: white;
}

.admin-sidebar .brand-mark {
  background: rgba(255,255,255,.12);
}

.admin-brand {
  margin-bottom: 28px;
}

.admin-brand strong,
.admin-brand small {
  color: white;
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar nav a {
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(255,255,255,.88);
}

.admin-sidebar nav a:hover {
  background: rgba(255,255,255,.1);
}

.admin-main {
  padding: 28px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.admin-topbar h1 {
  margin: 0;
  color: var(--green-900);
}

.admin-topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 7px;
  height: 100%;
  background: var(--green-700);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--green-900);
  line-height: 1;
}

.stat-card span {
  color: var(--muted);
}

.panel {
  padding: 20px;
  margin-bottom: 20px;
}

.soft-panel {
  background: #f8fbfa;
  box-shadow: none;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.detail-head h2 {
  margin: 0;
  color: var(--green-900);
}

.member-detail-head {
  align-items: flex-start;
}

.member-title-block {
  text-align: right;
}

.member-status-panel {
  margin-inline-start: auto;
  min-width: 150px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid #cce3da;
  border-radius: 18px;
  background: linear-gradient(180deg, #f4fbf8 0%, #ffffff 100%);
}

.member-status-panel strong {
  color: var(--green-900);
  font-weight: 900;
}

.member-status-panel .status {
  margin: 0;
}

.details-grid,
.files-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.details-grid div,
.files-grid div {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px;
}

.details-grid div {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  border-color: #d9e8e2;
  box-shadow: 0 10px 24px rgba(5, 83, 67, .05);
}

.files-grid .attachment-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.attachment-card strong {
  color: var(--green-900);
}

.attachment-thumb {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 14px;
  background: #f8fbfa;
  border: 1px solid var(--line);
}

.attachment-preview-link {
  display: block;
}

.attachment-file-icon {
  display: grid;
  place-items: center;
  height: 180px;
  border-radius: 14px;
  border: 1px dashed #d7e2dd;
  background: #f8fbfa;
  color: #991b1b;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.attachment-name {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  overflow-wrap: anywhere;
}

.attachment-open {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  box-shadow: none;
}

.attachment-empty {
  min-height: 150px;
}

.details-grid strong,
.details-grid span {
  display: block;
}

.details-grid strong {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e7f3ee;
  color: var(--green-900);
  font-size: .9rem;
  font-weight: 900;
  border: 1px solid #cce3da;
}

.details-grid span {
  color: #1f2937;
  font-weight: 700;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.membership-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0 20px;
}

.membership-summary div {
  min-height: 86px;
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--membership-color) 92%, #0f172a), color-mix(in srgb, var(--membership-color) 74%, #ffffff));
  color: #fff;
  box-shadow: 0 18px 34px color-mix(in srgb, var(--membership-color) 22%, transparent);
}

.membership-summary strong,
.membership-summary span {
  display: block;
}

.membership-summary strong {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, .78);
  font-size: .9rem;
}

.membership-summary span {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
}

.member-details-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.member-details-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: center;
  min-height: 104px;
  padding: 16px 14px 14px;
}

.member-details-grid > div > strong {
  margin: 0 auto 2px;
}

.member-details-grid > div > span {
  width: 100%;
  text-align: center;
  margin: 0;
}

@media print {
  body.admin-body {
    display: block;
    background: #fff;
  }

  .admin-sidebar,
  .admin-topbar,
  .actions,
  .attachment-open {
    display: none !important;
  }

  .admin-main {
    padding: 0;
    width: 100%;
  }

  .panel {
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  .details-grid,
  .files-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .details-grid div {
    box-shadow: none;
    border-color: #b7cbc2;
  }

  .details-grid strong {
    color: #063f35;
    background: #eef7f3 !important;
    border-color: #c4d9d1;
  }

  .attachment-thumb,
  .attachment-file-icon {
    height: 145px;
  }

  .files-grid .attachment-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th, td {
  text-align: right;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--green-900);
  background: #f8fbfa;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .86rem;
}

.status-new,
.status-pending,
.status-draft { background: #fff7ed; color: #9a3412; }
.status-approved { background: #ecfdf5; color: #047857; }
.status-rejected { background: #fef2f2; color: #b91c1c; }
.status-active { background: #ecfdf5; color: #047857; }
.status-suspended { background: #fff7ed; color: #9a3412; }
.status-expired { background: #fef2f2; color: #b91c1c; }
.status-open { background: #eff6ff; color: #1d4ed8; }
.status-closed { background: #f1f5f9; color: #475569; }
.status-completed { background: #f0fdf4; color: #15803d; }
.status-cancelled { background: #fef2f2; color: #b91c1c; }

.application-actions-cell {
  min-width: 210px;
}

.application-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.application-review-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.application-actions .btn {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 12px;
  box-shadow: none;
  white-space: nowrap;
}

.application-actions .btn-details {
  min-width: 126px;
  background: #ffffff;
  color: var(--green-900);
  border-color: #d7e2dd;
}

.application-actions .btn-approve {
  min-width: 96px;
  background: linear-gradient(135deg, #075e54, #0f766e);
  color: #ffffff;
  border-color: #0f766e;
}

.application-actions .btn-reject {
  min-width: 82px;
  background: #fff;
  color: #991b1b;
  border-color: #fecaca;
}

.member-row-actions {
  min-width: 210px;
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  align-items: center;
  gap: 6px;
}

.member-row-actions form {
  margin: 0;
}

.member-row-actions .btn {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: .86rem;
  line-height: 1.2;
  box-shadow: none;
}

.member-row-actions .btn-details {
  grid-column: auto;
}

.member-status-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(86px, auto);
  gap: 6px;
  width: 100%;
  margin: 0;
}

.member-status-form select {
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid #d7e2dd;
  background: #fff;
  color: var(--green-900);
  font-weight: 800;
  padding: 5px 8px;
  font-size: .84rem;
}

.member-status-form .btn {
  width: 100%;
}

.member-edit-form textarea {
  min-height: 130px;
}

.reviewed-note {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
  font-size: .86rem;
}

.mobile-card-preview {
  display: none;
}

.volunteer-card-stack {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  margin: 22px auto;
}

.digital-card {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 53.98 / 85.6;
  border-radius: 18px;
  overflow: hidden;
  padding: 22px 22px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.9)),
    radial-gradient(circle at 50% 43%, rgba(238,40,37,.08), transparent 30%),
    radial-gradient(circle at 50% 42%, rgba(192,142,65,.13), transparent 35%),
    #fff;
  border: 1px solid rgba(7, 94, 84, .15);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.digital-card-strip {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 8px;
  background: var(--card-color);
}

.digital-card-header {
  width: 100%;
  margin: 4px auto 14px;
  text-align: center;
}

.digital-card-org {
  display: block;
  color: var(--green-900);
  font-size: .9rem;
  line-height: 1.45;
  margin-bottom: 2px;
}

.digital-card-supervision {
  display: block;
  color: #374151;
  font-size: .74rem;
  font-weight: 800;
}

.digital-card-logo {
  position: absolute;
  left: 18px;
  top: 76px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(7, 94, 84, .14);
  box-shadow: 0 12px 22px rgba(6, 78, 59, .1);
}

.digital-card-identity {
  width: calc(100% - 92px);
  margin: 12px 0 16px auto;
  text-align: center;
}

.digital-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-color) 14%, white);
  color: var(--card-color);
  font-weight: 800;
  line-height: 1.1;
}

.digital-card h2 {
  margin: 18px 0 0;
  color: var(--green-900);
  font-size: 1.26rem;
  line-height: 1.25;
}

.digital-card-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  margin: 8px 0 0;
  border-top: 1px solid rgba(7, 94, 84, .12);
}

.digital-card-details div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid rgba(7, 94, 84, .1);
}

.digital-card dt {
  color: #6b7280;
  font-size: .78rem;
  font-weight: 700;
}

.digital-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  font-size: .88rem;
}

.digital-card-signature {
  position: absolute;
  inset-inline: 22px;
  bottom: 14px;
  display: grid;
  justify-items: center;
  padding: 6px 10px 0;
  border-top: 1px solid rgba(7, 94, 84, .18);
  text-align: center;
}

.signature-line {
  min-width: 118px;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(7, 94, 84, .28);
  color: #2563eb;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 1.05rem;
  line-height: 1.1;
}

.signature-image {
  display: block;
  width: 104px;
  max-width: 100%;
  height: 28px;
  margin-bottom: 2px;
  object-fit: contain;
}

.digital-card-signature strong {
  color: var(--green-900);
  font-size: .78rem;
  line-height: 1.25;
}

.digital-card-signature small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.2;
}

.signature-settings-preview {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--green-900);
  font-weight: 800;
}

.signature-settings-preview img {
  width: 120px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8fbfa;
}


.digital-card-back {
  background-image: url("../img/card-back.jpg");
  background-size: cover;
  background-position: center;
}

@media (max-width: 900px) {
  .header-inner,
  .footer-inner,
  .hero-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .hero {
    padding-top: 36px;
  }

  .cards-grid,
  .stats-grid,
  .form-grid,
  .membership-options,
  .details-grid,
  .files-grid {
    grid-template-columns: 1fr;
  }

  .admin-body {
    display: block;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
  }

  .admin-main {
    padding: 18px;
  }

  .volunteer-card-stack {
    grid-template-columns: 1fr;
  }

  .digital-card {
    padding: 18px;
  }

  .digital-card-logo {
    left: 18px;
    top: 28px;
    width: 70px;
    height: 70px;
  }

  .digital-card-header,
  .digital-card-identity {
    width: min(330px, 72%);
  }

  .digital-card-details {
    grid-template-columns: repeat(2, 1fr);
    width: calc(100% - 146px);
  }

  .digital-card-signature {
    left: 18px;
    bottom: 14px;
    min-width: 126px;
    padding: 6px 8px;
  }
}

/* Refined responsive skin */
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(184, 135, 47, .11), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(15, 118, 110, .12), transparent 30rem),
    #f6faf8;
}

.site-header {
  background: linear-gradient(135deg, #063c32, #0b6f61);
  border-bottom: 0;
  box-shadow: 0 18px 44px rgba(6, 78, 59, .16);
}

.site-header .brand strong,
.site-header .brand small,
.site-header .nav-links a {
  color: #fff;
}

.site-header .brand small {
  color: rgba(255,255,255,.72);
}

.site-header .brand-mark {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: none;
}

.site-header .nav-links a {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}

.site-header .nav-links a:hover,
.site-header .nav-links a:first-child {
  background: #fff;
  color: var(--green-800);
}

.hero {
  padding: 76px 0 34px;
}

.hero-grid {
  min-height: 440px;
}

.hero h1 {
  max-width: 720px;
}

.hero-card {
  border: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.72)),
    radial-gradient(circle at 20% 20%, rgba(184,135,47,.15), transparent 16rem);
}

.member-card-preview {
  transform: rotate(-2deg);
  box-shadow: 0 28px 54px rgba(6, 78, 59, .16);
}

.section:nth-of-type(2) {
  background: rgba(255,255,255,.56);
  border-block: 1px solid rgba(223,231,227,.8);
}

.feature-card,
.form-card,
.panel,
.stat-card {
  border-color: rgba(223,231,227,.78);
  box-shadow: 0 18px 46px rgba(6, 78, 59, .08);
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 18px;
  bottom: 18px;
  width: 5px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--green-700), var(--gold));
}

.form-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.92)),
    radial-gradient(circle at 5% 0%, rgba(184,135,47,.13), transparent 18rem);
}

.form-card h1,
.form-card h2,
.section-title h2 {
  letter-spacing: 0;
}

.field input,
.field select,
.field textarea {
  min-height: 52px;
  background: white;
  border-color: #d7e2dd;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(15, 118, 110, .14);
  border-color: var(--green-700);
}

.btn {
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, #075e54, #0f766e);
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 800;
}

.footer-links a {
  color: var(--green-800);
}

.settings-form textarea {
  min-height: 150px;
  direction: rtl;
}

@media (max-width: 900px) {
  .container {
    width: min(100% - 24px, 680px);
  }

  .header-inner {
    min-height: auto;
    padding: 14px 0 12px;
    gap: 12px;
  }

  .brand {
    width: 100%;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    flex: 0 0 auto;
  }

  .brand strong {
    font-size: 1.05rem;
  }

  .brand small {
    font-size: .82rem;
  }

  .nav-links {
    display: flex;
    gap: 8px;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 9px 13px;
    font-size: .92rem;
  }

  .hero {
    padding: 34px 0 20px;
  }

  .hero-grid {
    min-height: auto;
    gap: 22px;
  }

  .hero h1 {
    font-size: 2.35rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-card {
    width: 100%;
    padding: 16px;
    border-radius: 20px;
  }

  .member-card-preview {
    transform: none;
    border-radius: 18px;
  }

  .section {
    padding: 34px 0;
  }

  .form-shell {
    width: min(100% - 24px, 680px);
    margin: 26px auto;
  }

  .form-card,
  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .actions,
  .footer-inner {
    width: 100%;
  }

  .btn {
    width: 100%;
    min-height: 52px;
  }

  .footer-inner {
    align-items: flex-start;
    padding: 18px 0;
  }

  .admin-sidebar {
    border-radius: 0 0 22px 22px;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar nav a {
    text-align: center;
  }

  table {
    min-width: 680px;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: 2rem;
  }

  .eyebrow {
    font-size: .88rem;
  }

  .admin-sidebar nav {
    grid-template-columns: 1fr;
  }
}

/* Stable header and compact navigation */
.site-header {
  background: linear-gradient(135deg, #064235, #0f766e) !important;
  border-bottom: 0;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 10px 0;
}

.site-header .brand {
  min-width: 0;
  width: auto;
}

.site-header .brand > span:last-child {
  min-width: 0;
}

.site-header .brand strong {
  color: #fff;
  font-size: 1.28rem;
  line-height: 1.25;
}

.site-header .brand small {
  color: rgba(255, 255, 255, .76);
  max-width: 760px;
}

.site-header .brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .24);
}

.site-header .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  overflow: visible;
  padding: 0;
}

.site-header .nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.site-header .nav-links a:hover,
.site-header .nav-links a:first-child {
  background: #fff;
  color: var(--green-800);
}

@media (max-width: 900px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
    min-height: auto;
    padding: 14px 0;
  }

  .site-header .brand {
    width: 100%;
  }

  .site-header .nav-links {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .site-header .nav-links::-webkit-scrollbar {
    display: none;
  }

  .site-header .nav-links a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 14px;
    font-size: .9rem;
  }
}

@media (max-width: 520px) {
  .site-header .brand {
    gap: 10px;
  }

  .site-header .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 15px;
  }

  .site-header .brand strong {
    font-size: 1.08rem;
  }

  .site-header .brand small {
    font-size: .82rem;
  }
}

/* Membership management */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0 0 4px;
  color: var(--green-900);
}

.membership-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.membership-admin-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.membership-admin-card__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 106px;
  padding: 18px 18px 18px 68px;
  color: #fff;
  background:
    radial-gradient(circle at 14% 18%, rgba(255,255,255,.18), transparent 7rem),
    linear-gradient(135deg, #0f2547, color-mix(in srgb, var(--plan-color) 55%, #0f2547));
}

.membership-admin-card__head strong,
.membership-admin-card__head span,
.membership-admin-card__head small {
  display: block;
}

.membership-admin-card__head strong {
  font-size: 1.25rem;
  font-weight: 900;
}

.membership-admin-card__head span {
  color: #f9d982;
  font-weight: 800;
}

.membership-admin-card__head small {
  color: #a7f3d0;
}

.membership-admin-icon {
  display: grid !important;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  font-size: 1.5rem;
  margin-inline-start: 28px;
}

.membership-admin-actions {
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  gap: 8px;
  z-index: 2;
}

.membership-admin-actions a,
.membership-admin-actions button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.13);
  color: #fff;
  cursor: pointer;
}

.membership-benefits {
  padding: 18px;
}

.membership-benefits > span {
  display: block;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 10px;
}

.membership-benefits ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.membership-benefits li {
  position: relative;
  padding-inline-start: 24px;
  color: var(--ink);
}

.membership-benefits li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  color: #22c55e;
  font-weight: 900;
}

.membership-editor-form .form-grid {
  align-items: start;
}

.icon-picker,
.color-picker,
.toggle-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
}

.color-picker {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.icon-picker label,
.color-picker label,
.toggle-row label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.icon-picker input,
.color-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.icon-picker input:checked + span,
.color-picker input:checked + span {
  outline: 3px solid rgba(15, 118, 110, .18);
}

.icon-picker span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 1.2rem;
}

.color-picker span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, .05);
}

.toggle-row {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.membership-editor-panel {
  max-width: 1120px;
}

.membership-editor-form {
  display: grid;
  gap: 18px;
}

.membership-editor-form .btn {
  justify-self: end;
}

/* Registration wizard */
.registration-shell {
  width: min(980px, calc(100% - 32px));
  margin: 36px auto 60px;
}

.registration-title {
  text-align: center;
  margin-bottom: 22px;
}

.registration-title h1 {
  margin: 0;
  color: #15213a;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.registration-title p {
  margin: 4px 0 12px;
  color: var(--muted);
}

.verified-note {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
  font-weight: 800;
}

.registration-card {
  padding: clamp(18px, 4vw, 34px);
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .08);
}

.registration-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  list-style: none;
  padding: 0 0 24px;
  margin: 0 auto 26px;
  max-width: 680px;
  border-bottom: 1px solid var(--line);
}

.registration-steps li {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  color: #94a3b8;
  text-align: center;
}

.registration-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 19px;
  inset-inline-end: -50%;
  width: 100%;
  height: 2px;
  background: #dbe4df;
  z-index: 0;
}

.registration-steps .is-done:not(:last-child)::after,
.registration-steps .is-current:not(:last-child)::after {
  background: #22c55e;
}

.registration-steps span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbe4df;
  position: relative;
  z-index: 1;
}

.registration-steps .is-done span {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}

.registration-steps .is-current span {
  background: #f6b40f;
  color: #17211f;
  border-color: #f6b40f;
}

.registration-steps strong {
  font-size: .82rem;
  color: #64748b;
}

.registration-steps small {
  font-size: .72rem;
}

.registration-step-panel {
  width: min(680px, 100%);
  margin: 0 auto 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.registration-step-panel:last-of-type {
  border-bottom: 0;
}

.step-panel-title {
  text-align: right;
  margin-bottom: 18px;
}

.step-panel-title h2 {
  margin: 0 0 4px;
  color: #1e2b45;
}

.step-panel-title p {
  margin: 0;
  color: var(--muted);
}

.segmented-options,
.blood-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.blood-grid {
  grid-template-columns: repeat(4, 1fr);
}

.segmented-options label,
.blood-grid label {
  cursor: pointer;
}

.segmented-options input,
.blood-grid input,
.plan-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-options span,
.blood-grid span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
}

.segmented-options input:checked + span,
.blood-grid input:checked + span {
  background: #17386c;
  color: #fff;
  border-color: #17386c;
}

.upload-list {
  display: grid;
  gap: 12px;
}

.upload-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.upload-item span {
  color: #1e2b45;
  font-weight: 900;
}

.upload-item small {
  color: var(--muted);
}

.upload-item input {
  grid-row: 1 / span 2;
  grid-column: 2;
  max-width: 210px;
}

.plan-list {
  display: grid;
  gap: 12px;
}

.plan-choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
}

.plan-choice:has(input:checked) {
  border-color: var(--plan-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--plan-color) 14%, transparent);
}

.plan-choice__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--plan-color) 12%, white);
}

.plan-choice strong,
.plan-choice small,
.plan-choice b {
  display: block;
}

.plan-choice strong {
  color: #1e2b45;
  font-size: 1.1rem;
}

.plan-choice small {
  color: var(--muted);
  font-weight: 500;
}

.plan-choice b {
  color: #1e2b45;
  text-align: center;
}

.registration-note {
  padding: 12px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--muted);
  text-align: center;
}

.bank-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #102953, #17386c);
  color: #fff;
}

.bank-box strong {
  color: #f9d982;
}

.registration-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: min(680px, 100%);
  margin: 0 auto;
}

@media (max-width: 900px) {
  .section-head,
  .registration-actions {
    flex-direction: column;
  }

  .registration-steps {
    grid-template-columns: 1fr;
  }

  .membership-admin-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }

  .icon-picker {
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  }

  .color-picker,
  .toggle-row {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .registration-steps {
    gap: 10px;
    border-bottom: 0;
  }

  .registration-steps li {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: right;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }

  .registration-steps li::after {
    display: none;
  }

  .registration-steps small {
    grid-column: 2;
  }

  .blood-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .upload-item,
  .plan-choice {
    grid-template-columns: 1fr;
  }

  .upload-item input {
    grid-row: auto;
    grid-column: auto;
    max-width: 100%;
  }
}

/* Member portal */
.volunteer-body {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(184, 135, 47, .09), transparent 26rem),
    radial-gradient(circle at 88% 0%, rgba(15, 118, 110, .12), transparent 32rem),
    #f6faf8;
}

.member-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #064e3b, #075e54);
  color: #fff;
}

.member-sidebar .admin-brand {
  margin-bottom: 28px;
}

.member-sidebar .admin-brand strong {
  color: #fff;
}

.member-sidebar .admin-brand small {
  color: rgba(255, 255, 255, .72);
}

.member-sidebar .brand-mark {
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: none;
}

.member-sidebar nav {
  display: grid;
  gap: 8px;
}

.member-sidebar nav a {
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, .88);
  font-weight: 800;
}

.member-sidebar nav a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.member-main {
  min-width: 0;
  padding: 28px;
}

.member-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .88)),
    radial-gradient(circle at 8% 0%, rgba(184, 135, 47, .13), transparent 18rem);
}

.member-hero h2 {
  margin: 8px 0 4px;
  color: var(--green-900);
  font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.member-list {
  display: grid;
  gap: 12px;
}

.member-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfdfc);
}

.member-list-item strong,
.member-list-item span {
  display: block;
}

.member-list-item strong {
  color: var(--green-900);
  font-size: 1.04rem;
}

.member-list-item span:not(.status) {
  color: var(--muted);
  font-size: .95rem;
}

.empty-state {
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

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

.status-registered,
.status-accepted { background: #eff6ff; color: #1d4ed8; }
.status-attended { background: #f0fdf4; color: #15803d; }
.status-absent { background: #fef2f2; color: #b91c1c; }

.member-profile-card .details-grid span {
  color: #31413d;
  overflow-wrap: anywhere;
}

.attachment-card .btn {
  justify-content: center;
}

.printable-card {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

@media (max-width: 900px) {
  .volunteer-body {
    display: block;
  }

  .member-sidebar {
    position: relative;
    height: auto;
    padding: 18px;
  }

  .member-sidebar nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .member-sidebar nav a {
    white-space: nowrap;
    min-width: max-content;
  }

  .member-main {
    padding: 18px;
  }

  .member-hero,
  .member-list-item {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  .member-sidebar,
  .admin-topbar,
  .section-head .btn,
  .actions,
  [data-print] {
    display: none !important;
  }

  .volunteer-body {
    display: block;
    background: #fff;
  }

  .member-main {
    padding: 0;
  }

  .panel,
  .stat-card,
  .details-grid div,
  .files-grid .attachment-card {
    box-shadow: none !important;
  }

  .files-grid,
  .details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
