:root {
  --primary: #073F46;
  --secondary: #06434A;
  --gold: #B88A3A;
  --cream: #F7F2EC;
  --text: #2F3A3D;
  --border: #E6DED4;
  --card: rgba(247, 242, 236, 0.94);
  --white: #fffdf9;
  --danger: #8b1d1d;
  --success: #1f6b4a;
  --warning: #8a6415;
  --shadow: 0 20px 50px rgba(7, 63, 70, 0.10);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  direction: rtl;
  font-family: Cairo, Almarai, "IBM Plex Sans Arabic", Tajawal, Montserrat, sans-serif;
  font-weight: 600;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(184, 138, 58, 0.12), transparent 30rem),
    linear-gradient(180deg, #fffdf9 0%, var(--cream) 100%);
}
body.has-bottom-ticker { padding-bottom: 58px; }

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

.page-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 12px 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(230, 222, 212, 0.85);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary), var(--secondary));
  color: var(--gold);
  font-weight: 900;
  font-size: 1.45rem;
  border: 1px solid rgba(184, 138, 58, 0.45);
  box-shadow: 0 12px 24px rgba(7, 63, 70, 0.18);
}
.brand-img { width: 56px; height: 56px; object-fit: contain; border-radius: 14px; background: var(--white); }
.brand-text { display: grid; line-height: 1.2; }
.brand-text strong { font-weight: 900; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: rgba(47, 58, 61, 0.70); font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a, .nav-button {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--primary);
  font-weight: 800;
}
.site-nav a:hover, .nav-button:hover { background: rgba(7, 63, 70, 0.08); }
.nav-button.gold { background: var(--gold); color: #fff; }
.inline-form { display: inline; margin: 0; }
.menu-toggle { display: none; border: 1px solid var(--border); background: var(--cream); color: var(--primary); border-radius: 12px; padding: 8px 12px; }
.main-content { flex: 1; display: grid; gap: 20px; }
.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 28px 4px; color: rgba(47, 58, 61, 0.75); font-size: 0.92rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: clamp(18px, 2.5vw, 30px);
  box-shadow: var(--shadow);
}
.soft-card { background: rgba(255, 253, 249, 0.62); border: 1px solid var(--border); border-radius: 20px; padding: 16px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr); gap: 18px; align-items: stretch; }
.clean-hero { min-height: 320px; }
.hero-copy {
  border-radius: 32px;
  padding: clamp(26px, 4vw, 52px);
  background: linear-gradient(145deg, rgba(7, 63, 70, 0.96), rgba(6, 67, 74, 0.91));
  color: #fff;
  border: 1px solid rgba(184, 138, 58, 0.32);
  box-shadow: var(--shadow);
}
.hero-copy h1 { color: #fff; max-width: 760px; }
.hero-copy p { color: rgba(255, 255, 255, 0.82); font-size: 1.1rem; max-width: 720px; }
.hero-panel { display: flex; flex-direction: column; justify-content: center; }
h1, h2, h3, h4 { margin: 0 0 12px; color: var(--primary); font-weight: 900; line-height: 1.3; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); }
h3 { font-size: 1.2rem; }
p { line-height: 1.9; }
.eyebrow { color: var(--gold); font-weight: 900; letter-spacing: .02em; display: inline-block; margin-bottom: 8px; }
.muted { color: rgba(47, 58, 61, 0.72); }
.small { font-size: .88rem; }
code { direction: ltr; display: inline-block; background: rgba(7, 63, 70, 0.08); color: var(--primary); border: 1px solid rgba(7, 63, 70, 0.12); border-radius: 10px; padding: 3px 7px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.compact { gap: 12px; }
.stack { display: grid; gap: 14px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head.mini { align-items: center; }
.badge-stack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(184, 138, 58, 0.12); color: var(--gold); border: 1px solid rgba(184, 138, 58, 0.25); font-size: .84rem; font-weight: 900; }
.pill.danger { color: var(--danger); background: rgba(139, 29, 29, 0.08); border-color: rgba(139, 29, 29, 0.18); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 900;
  min-height: 46px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 12px 24px rgba(7, 63, 70, 0.16); }
.btn.gold { color: #fff; background: var(--gold); }
.btn.outline { border-color: rgba(7, 63, 70, 0.20); color: var(--primary); background: rgba(255, 253, 249, 0.72); }
.btn.danger, .outline.danger { color: var(--danger); border-color: rgba(139, 29, 29, 0.2); }
.btn.danger { background: rgba(139, 29, 29, 0.10); }
.back-chip { border-radius: 10px 18px 10px 18px; min-width: 74px; }
.btn.full { width: 100%; }
.btn.small { min-height: 36px; padding: 8px 12px; border-radius: 12px; font-size: .9rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 22px; }

label { display: grid; gap: 7px; color: var(--primary); font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 253, 249, 0.92);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 13px;
  outline: none;
  min-height: 46px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 138, 58, 0.12); }
.check-row { display: inline-flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; color: var(--text); }
.check-row input { width: 18px; min-height: auto; height: 18px; }
.check-grid { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.tiny-input { min-width: 88px; padding: 8px; }

.auth-wrap { min-height: 64vh; display: grid; place-items: center; }
.auth-wrap.wide { place-items: stretch; }
.auth-card { width: min(520px, 100%); margin: 0 auto; }
.auth-wrap.wide .auth-card { width: 100%; }
.autofill-trap { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.form-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; color: var(--primary); font-weight: 800; }
.flash { border-radius: 16px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; background: #fff; font-weight: 800; }
.flash.inside { margin: 0 0 14px; }
.flash-success { color: var(--success); border-color: rgba(31, 107, 74, 0.22); background: rgba(31, 107, 74, 0.08); }
.flash-danger { color: var(--danger); border-color: rgba(139, 29, 29, 0.22); background: rgba(139, 29, 29, 0.08); }
.flash-warning { color: var(--warning); border-color: rgba(138, 100, 21, 0.22); background: rgba(138, 100, 21, 0.08); }
.flash-info { color: var(--primary); border-color: rgba(7, 63, 70, 0.16); background: rgba(7, 63, 70, 0.08); }

.list-item { border-bottom: 1px solid var(--border); padding: 12px 0; display: grid; gap: 5px; }
.list-item:last-child { border-bottom: 0; }
.list-item p { margin: 0; color: rgba(47, 58, 61, .76); }
.compact-list { margin: 8px 0 0; padding-inline-start: 20px; line-height: 2; }
.deadline-list { display: grid; gap: 10px; }
.deadline-card { display: grid; gap: 8px; border: 1px solid var(--border); background: rgba(255, 253, 249, 0.65); border-radius: 18px; padding: 14px; }
.deadline-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.deadline-card-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.deadline-card-title strong,
.deadline-card-title small {
  overflow-wrap: anywhere;
}
.deadline-interest-form {
  margin: 0;
}
.deadline-interest-btn {
  min-height: 36px;
  border: 1px solid rgba(7, 63, 70, .18);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(7, 63, 70, .08);
  color: var(--primary);
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.deadline-interest-btn:hover,
.deadline-interest-btn.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.deadline-interest-btn.is-active {
  background: rgba(184, 138, 58, .14);
  border-color: rgba(184, 138, 58, .48);
  color: var(--gold);
}
.deadline-card em { color: var(--gold); font-style: normal; font-weight: 900; }
.deadline-copy { margin: 0; color: rgba(47, 58, 61, .82); line-height: 1.75; }
.deadline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.deadline-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.deadline-alert-actions form {
  margin: 0;
}
.filters-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}
.service-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.tile-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(139, 29, 29, 0.18);
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--gold), rgba(7, 63, 70, .72));
  opacity: .85;
}
.service-card p { margin: 0; flex: 1; }
.member-shortcuts {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.member-shortcut-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(7, 63, 70, .16);
  border-radius: 16px;
  background: rgba(7, 63, 70, .06);
  color: var(--primary);
  text-decoration: none;
}
.member-shortcut-card:hover {
  border-color: var(--primary);
  background: rgba(7, 63, 70, .10);
}
.member-shortcut-card span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.member-shortcut-card small {
  color: rgba(47, 58, 61, .68);
  font-weight: 800;
}
.member-services-layout {
  display: grid;
  gap: 14px;
}
.member-service-feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 132px;
}
.member-service-feature h2 {
  margin: 2px 0 4px;
  font-size: clamp(1.25rem, 2vw, 1.9rem);
}
.member-service-feature em {
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
}
.member-service-feature .service-icon,
.member-service-tile .service-icon {
  margin-inline: auto;
}
.member-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.member-service-tile {
  min-height: 145px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--primary);
  text-decoration: none;
  text-align: center;
  position: relative;
}
.member-service-tile strong {
  font-size: 1.08rem;
}
.member-service-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(7, 63, 70, .28);
}
.member-service-tile.is-muted {
  opacity: .88;
}
.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(7, 63, 70, 0.12), rgba(184, 138, 58, 0.12));
  color: var(--primary);
  border: 1px solid rgba(7, 63, 70, .12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  font-size: 1.28rem;
  font-weight: 900;
}
.service-meta { display: flex; justify-content: space-between; gap: 8px; }
.service-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.forum-topic-manage summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.forum-edit-form,
.forum-review-card {
  display: grid;
  gap: 12px;
}
.forum-replies,
.forum-my-replies,
.forum-admin-replies {
  display: grid;
  gap: 12px;
}
.forum-reply-card {
  display: grid;
  gap: 10px;
}
.forum-reply-card p {
  margin: 0;
  line-height: 1.9;
  white-space: pre-line;
}
.flash-dialog .soft-card p {
  margin: 0;
  line-height: 1.9;
}
.forum-post-card,
.forum-review-body {
  line-height: 1.9;
  white-space: pre-line;
}
.initiative-card,
.initiative-admin-card,
.initiative-edit-form,
.initiative-invite-form {
  display: grid;
  gap: 12px;
}
.initiative-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.metric-grid span {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 253, 249, .72);
}
.initiative-note {
  margin: 0;
  color: rgba(47, 58, 61, .78);
  line-height: 1.8;
}
.initiative-request-form,
.initiative-discussion-form {
  display: grid;
  gap: 10px;
}
.initiative-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.initiative-summary p {
  margin: 4px 0 0;
}
.initiative-picker {
  position: relative;
  display: grid;
  gap: 8px;
}
.initiative-selected {
  min-height: 22px;
}
.initiative-participation-card {
  grid-column: 1 / -1;
}
.initiative-participation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(7,63,70,.12);
  border-radius: 12px;
  background: rgba(7,63,70,.04);
}
.initiative-participation-summary span {
  display: grid;
  gap: 3px;
  color: var(--muted);
}
.initiative-participation-summary strong {
  color: var(--primary);
  font-size: 1.05rem;
}
.block {
  display: block;
}
.btn.is-disabled {
  opacity: .5;
  pointer-events: none;
}
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.score-grid span {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 253, 249, .72);
}
.admin-detail-dialog {
  max-width: 720px;
}
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.detail-list div {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 253, 249, .72);
  min-width: 0;
}
.detail-list dt {
  color: rgba(47, 58, 61, .62);
  font-size: .78rem;
  font-weight: 900;
}
.detail-list dd {
  margin: 4px 0 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.form-block {
  display: grid;
  gap: 10px;
  margin: 8px 0;
}
.competency-checks,
.competency-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.competency-checks .check-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 253, 249, .72);
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.registration-mobile-list {
  display: none;
}
.mobile-request-row {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 253, 249, .82);
  color: var(--text);
  font: inherit;
  text-align: right;
  display: grid;
  gap: 3px;
}
.mobile-request-row small {
  color: rgba(47, 58, 61, .68);
  font-weight: 800;
}
.service-admin-card .service-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 1.05rem;
}

.dashboard-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.visitor-number { border: 1px solid var(--border); border-radius: 20px; padding: 12px 16px; background: rgba(255, 253, 249, 0.76); color: var(--primary); white-space: nowrap; }
.end-guest-form { text-align: center; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(7, 63, 70, 0.08);
  color: var(--primary);
  font-weight: 900;
}
.nav-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .74rem;
  font-weight: 900;
}
.delegation-form { margin-top: 12px; }
.delegation-checks {
  padding: 12px;
  border: 1px dashed rgba(7, 63, 70, .18);
  border-radius: 16px;
  background: rgba(255, 253, 249, .55);
}
.delegation-picker {
  position: relative;
  display: grid;
  gap: 8px;
}
.delegation-selected {
  min-height: 24px;
}
.delegation-results {
  display: none;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 5;
}
.delegation-results.is-open {
  display: grid;
  gap: 6px;
}
.delegation-result {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(7, 63, 70, .08);
  border-radius: 12px;
  background: rgba(247, 242, 236, .52);
  color: var(--text);
  text-align: right;
}
.delegation-result:hover {
  border-color: rgba(184, 138, 58, .35);
}
.delegation-result small {
  color: rgba(47, 58, 61, .68);
  line-height: 1.5;
}
.delegation-filter {
  justify-content: flex-start;
}
.notification-bell {
  position: relative;
  width: 38px;
  height: 38px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(184, 138, 58, .10);
}
.notification-bell span {
  position: absolute;
  top: -6px;
  inset-inline-start: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
}
.notification-item.unread { border-color: rgba(184, 138, 58, .38); background: rgba(184, 138, 58, .08); }
.mandatory-alert-card { border-style: dashed; }
.notifications-table .row-unread td { background: rgba(184, 138, 58, .08); }
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: rgba(47, 58, 61, .78);
  font-size: .9rem;
}
.planner-item {
  display: grid;
  gap: 12px;
}
.mandatory-prompt-dialog .soft-card {
  display: grid;
  gap: 12px;
}
.job-search-results {
  display: grid;
  gap: 8px;
}
.job-result-btn {
  width: 100%;
  border: 1px solid rgba(7, 63, 70, .14);
  border-radius: 14px;
  background: rgba(255, 253, 249, .8);
  padding: 10px 12px;
  color: var(--text);
  text-align: right;
  display: grid;
  gap: 3px;
}
.job-result-btn:hover {
  border-color: rgba(184, 138, 58, .42);
  background: rgba(184, 138, 58, .08);
}
.job-result-btn small {
  color: rgba(47, 58, 61, .68);
  font-weight: 800;
}
.stat { text-align: center; display: grid; gap: 6px; }
.stat strong { color: var(--primary); font-size: 2rem; font-weight: 900; }
.stat span { color: rgba(47, 58, 61, .76); }

.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 760px; background: rgba(255, 253, 249, 0.72); }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
th { color: var(--primary); font-weight: 900; background: rgba(7, 63, 70, 0.06); }
tfoot th { background: rgba(184, 138, 58, 0.11); color: var(--gold); }
.actions-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-select, .inline-upload { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-select select, .inline-select input, .inline-upload input { width: auto; min-width: 120px; }
.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid var(--border);
}
.table-length-control,
.table-pager,
.table-page-info {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.table-length-control select {
  min-width: 82px;
  height: 38px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
}
.table-page-info {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}
.table-footer-tools {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .72);
  border-top: 1px solid var(--border);
}
.table-status-filters {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.checkbox-wrapper {
  display: inline-flex;
  cursor: pointer;
}
.checkbox-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.checkbox-tile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  color: var(--primary);
  font-weight: 900;
  transition: .15s ease;
}
.checkbox-icon {
  display: inline-grid;
  place-items: center;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 999px;
  background: rgba(7, 63, 70, .08);
}
.checkbox-input:checked + .checkbox-tile {
  border-color: rgba(184, 138, 58, .72);
  background: rgba(184, 138, 58, .13);
  box-shadow: 0 0 0 3px rgba(184, 138, 58, .08);
}
.checkbox-input:checked + .checkbox-tile .checkbox-icon {
  background: var(--primary);
  color: #fff;
}
.log-details {
  max-width: 420px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  direction: ltr;
  text-align: left;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  padding: 8px;
}
.filter-bar { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: 10px; margin-bottom: 14px; }
.admin-user-filter { grid-template-columns: 1fr 2fr repeat(3, 1fr) auto; }
.admin-users-table { min-width: 980px; font-size: .84rem; }
.admin-users-table th, .admin-users-table td { padding: 8px; }
.admin-users-table .inline-select { gap: 4px; flex-wrap: nowrap; align-items: center; }
.admin-users-table .inline-select select,
.admin-users-table .inline-select input {
  min-width: 82px;
  max-width: 128px;
  min-height: 32px;
  padding: 6px 8px;
  font-size: .82rem;
}
.admin-users-table .btn.small {
  width: auto;
  min-width: 0;
  min-height: 31px;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: .8rem;
}
.admin-users-table code, .admin-users-table small { font-size: .78rem; }
.admin-edit-form { display: grid; gap: 14px; }
.track-box { border: 1px dashed rgba(7, 63, 70, .18); border-radius: 18px; padding: 14px; margin-top: 12px; }
.compact-table td, .compact-table th { vertical-align: middle; }
.settings-dialog {
  width: min(860px, calc(100% - 24px));
  max-width: calc(100vw - 24px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow);
  box-sizing: border-box;
  margin: auto;
}
dialog.settings-dialog:not([open]) { display: none; }
dialog.settings-dialog[open] {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
html.dialog-fallback-active,
body.dialog-fallback-active {
  overflow: hidden;
}
body.dialog-fallback-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(7, 63, 70, 0.34);
  backdrop-filter: blur(8px);
}
dialog.settings-dialog.fallback-open {
  display: block;
  position: fixed !important;
  z-index: 100000;
}
.settings-dialog::backdrop { background: rgba(7, 63, 70, 0.34); backdrop-filter: blur(8px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.report-dialog {
  width: min(980px, calc(100% - 24px));
  max-height: min(820px, calc(100vh - 28px));
  overflow: hidden;
  padding: 0;
  position: relative;
}
.report-dialog-shell {
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
  padding: 58px 20px 20px;
}
.compact-report-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: min(680px, calc(100vh - 28px));
  overflow: auto;
}
.compact-report-stack {
  display: grid;
  gap: 12px;
}
.report-close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(139, 29, 29, 0.22);
  border-radius: 12px;
  color: var(--danger);
  background: rgba(255, 253, 249, 0.96);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}
.promotion-wizard { width: min(980px, calc(100% - 22px)); max-height: min(780px, calc(100vh - 28px)); overflow: auto; }
.wizard-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.wizard-progress span { border: 1px solid var(--border); border-radius: 12px; padding: 9px 10px; text-align: center; color: rgba(47,58,61,.72); background: rgba(255,253,249,.72); font-weight: 900; }
.wizard-progress span.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.wizard-step { display: none; min-height: 260px; }
.wizard-step.active { display: grid; gap: 14px; align-content: start; }
.wizard-step.is-skipped { display: none !important; }
.wizard-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.promotion-wizard > .wizard-actions {
  position: sticky;
  bottom: -1px;
  z-index: 5;
  margin-inline: -4px;
  padding: 12px 4px 4px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.82), var(--white) 42%);
}
.inline-actions { justify-content: flex-start; margin-top: 10px; }
.inline-confirm { border: 1px solid rgba(184, 138, 58, .24); border-radius: 16px; padding: 14px; background: rgba(184, 138, 58, .08); display: grid; gap: 8px; }
.inline-confirm p { margin: 0; }
.training-analysis .table-wrap {
  max-height: 330px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.hijri-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.date-gregorian-output {
  display: block;
  margin-top: 5px;
  color: rgba(47, 58, 61, .64);
  font-size: .78rem;
  font-weight: 800;
}
.date-mode-select {
  width: 100%;
  margin-bottom: 8px;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 253, 249, 0.96);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  padding: 10px 12px;
}
.date-calendar-modebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 253, 249, .96);
  color: rgba(47, 58, 61, .72);
  font-size: .9rem;
  font-weight: 900;
}
.date-calendar-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
}
.date-calendar-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.date-calendar-switch i {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: #d5d7d8;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.18);
  transition: background .18s ease;
}
.date-calendar-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.22);
  transition: transform .18s ease;
}
.date-calendar-switch input:checked + i {
  background: var(--primary);
}
.date-calendar-switch input:checked + i::after {
  transform: translateX(-22px);
}
.hijri-calendar-dialog {
  position: fixed;
  z-index: 100500;
  width: min(320px, calc(100vw - 20px));
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
  direction: rtl;
}
.calendar-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 100400;
  pointer-events: none;
  overflow: visible;
}
.hijri-calendar-dialog.hijri-calendar-in-dialog {
  position: absolute;
  z-index: 100600;
  pointer-events: auto;
}
.hijri-calendar-header {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  padding: 12px;
  color: #fff;
  background: var(--primary);
}
.hijri-calendar-header.date-calendar-header {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.date-calendar-select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  color: #fff;
  padding: 8px 10px;
  font: inherit;
  font-weight: 900;
}
.date-calendar-select option {
  color: #1f2a2d;
}
.hijri-calendar-title {
  text-align: center;
  font-weight: 900;
}
.hijri-calendar-nav {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,.12);
  cursor: pointer;
  font-weight: 900;
}
.hijri-calendar-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.hijri-calendar-weekdays,
.hijri-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}
.hijri-calendar-weekdays span {
  color: rgba(47,58,61,.68);
  font-size: .78rem;
  font-weight: 900;
}
.hijri-calendar-empty,
.hijri-calendar-day {
  min-height: 34px;
}
.hijri-calendar-day {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,253,249,.76);
  color: var(--primary);
  font-weight: 900;
  cursor: pointer;
}
.hijri-calendar-day:hover,
.hijri-calendar-day.is-selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.hijri-calendar-day.is-today:not(.is-selected) {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(184,138,58,.10);
}
.hijri-calendar-caption {
  color: rgba(47,58,61,.64);
  font-size: .78rem;
  text-align: center;
  font-weight: 800;
}
.is-hidden { display: none !important; }
.mini-pre { direction: ltr; white-space: pre-wrap; background: rgba(7,63,70,.06); padding: 10px; border-radius: 12px; overflow: auto; }
.calculator-grid { align-items: start; }
.result-card { margin-bottom: 20px; }
.promotion-result-card .section-head { align-items: center; }
.promotion-result-wrap { overflow-x: visible; }
.promotion-result-table {
  min-width: 0;
  table-layout: fixed;
}
.promotion-result-table th,
.promotion-result-table td {
  line-height: 1.55;
  word-break: break-word;
}
.promotion-result-table .report-btn {
  min-width: 74px;
}
.latest-calculation-details {
  padding: 0;
  overflow: hidden;
}
.latest-calculation-details summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}
.latest-calculation-details summary::-webkit-details-marker {
  display: none;
}
.latest-calculation-details summary::before {
  content: "⌄";
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(7, 63, 70, 0.08);
  color: var(--gold);
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}
.latest-calculation-details summary span {
  padding-inline-start: 36px;
}
.latest-calculation-details[open] summary::before {
  content: "⌃";
}
.latest-calculation-details summary small {
  color: rgba(47, 58, 61, .68);
  font-size: .82rem;
}
.latest-calculation-details .promotion-result-wrap {
  border-top: 1px solid var(--border);
  border-radius: 0;
}
.surplus-notes {
  border-top: 1px solid var(--border);
  padding: 12px 16px 14px;
  display: grid;
  gap: 8px;
  color: rgba(47, 58, 61, .82);
}
.surplus-notes ul,
.print-report-notes ul {
  margin: 0;
  padding-inline-start: 22px;
}
.surplus-notes p,
.print-report-notes p {
  margin: 0;
}
.print-report { display: none; }
.print-report-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 2px solid #d8d1c7;
  padding-bottom: 14px;
}
.print-report-head img,
.print-brand-mark {
  width: 82px;
  height: 82px;
  object-fit: contain;
}
.print-brand-mark {
  display: grid;
  place-items: center;
  border: 2px solid #073F46;
  border-radius: 50%;
  color: #073F46;
  font-size: 34px;
  font-weight: 900;
}
.print-report-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.print-col-element { width: 18%; }
.print-col-weight { width: 10%; }
.print-col-entered { width: 54%; }
.print-col-earned { width: 18%; }
.print-report-table th,
.print-report-table td {
  border: 1px solid #d8d1c7;
  padding: 9px;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}
.print-report-table th {
  background: #f3eee7;
}
.print-element-cell {
  width: 1%;
  font-weight: 800;
  white-space: normal;
}
.print-element-cell.is-volunteering {
  font-size: .82em;
  line-height: 1.35;
}
.print-report-notes {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #d8d1c7;
  background: #faf8f4;
  display: grid;
  gap: 6px;
}
.print-report-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #d8d1c7;
  display: grid;
  gap: 5px;
  color: #2f3a3d;
}
.preview-card { display: grid; align-content: start; gap: 16px; }
.brand-preview { display: flex; align-items: center; gap: 12px; }
.brand-preview div { display: grid; gap: 4px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatches span { height: 52px; border-radius: 14px; border: 1px solid var(--border); }
.swatches span:nth-child(1) { background: var(--primary); }
.swatches span:nth-child(2) { background: var(--secondary); }
.swatches span:nth-child(3) { background: var(--gold); }
.swatches span:nth-child(4) { background: var(--cream); }
.bottom-ticker {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 50px;
  padding: 8px clamp(14px, 3vw, 34px);
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-top: 1px solid rgba(184, 138, 58, 0.38);
  box-shadow: 0 -10px 30px rgba(7, 63, 70, 0.16);
}
.bottom-ticker strong {
  display: none;
}
.bottom-ticker-viewport {
  flex: 1;
  overflow: hidden;
  direction: ltr;
}
.bottom-ticker-track {
  display: flex;
  gap: 42px;
  width: max-content;
  white-space: nowrap;
  animation: bottomTicker var(--ticker-speed, 26s) linear infinite;
}
.bottom-ticker-track span {
  direction: rtl;
  color: rgba(255, 255, 255, 0.94);
  font-weight: 800;
}
.bottom-ticker:hover .bottom-ticker-track { animation-play-state: paused; }
@keyframes bottomTicker {
  from { transform: translateX(-50%); }
  to { transform: translateX(100%); }
}
.prose p { max-width: 70ch; }
.center-card { text-align: center; max-width: 640px; margin: 0 auto; }

.loading-layer {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(7, 63, 70, 0.30);
  backdrop-filter: blur(10px);
  z-index: 100;
}
.loading-layer.active { display: grid; }
.loading-card { background: var(--cream); border: 1px solid var(--border); border-radius: 26px; padding: 26px; display: grid; place-items: center; gap: 10px; color: var(--primary); min-width: 220px; box-shadow: var(--shadow); }
.loading-card strong { font-weight: 900; }
.loading-card small { color: rgba(47,58,61,.7); }

@media (max-width: 980px) {
  .hero, .grid.two, .grid.three, .grid.four, .grid.five { grid-template-columns: 1fr; }
  .initiative-matrix, .metric-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .dashboard-head { align-items: stretch; flex-direction: column; }
  .site-header { align-items: flex-start; }
  .menu-toggle { display: inline-flex; margin-inline-start: auto; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .site-nav.open { display: flex; }
  .site-nav a, .nav-button { width: 100%; text-align: right; }
  .wizard-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
  .page-shell { width: min(100% - 18px, 1180px); }
  .main-content,
  .grid,
  .card,
  .soft-card,
  form,
  fieldset,
  label {
    min-width: 0;
    max-width: 100%;
  }
  input,
  select,
  textarea {
    min-width: 0;
  }
  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-header { border-radius: 18px; top: 6px; }
  .brand-mark, .brand-img { width: 42px; height: 42px; border-radius: 14px; }
  .brand-text strong { max-width: 190px; }
  .card, .hero-copy { border-radius: 22px; }
  .dashboard-head.card {
    padding: 16px;
  }
  .dashboard-head h1 {
    font-size: 1.35rem;
  }
  .dashboard-head p {
    font-size: .88rem;
    margin-bottom: 0;
  }
  .admin-nav.card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }
  .admin-nav a {
    display: grid;
    place-items: center;
    min-height: 42px;
    padding: 8px;
    border-radius: 12px;
    text-align: center;
    font-size: .82rem;
    line-height: 1.45;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  .stat.card {
    padding: 12px 8px;
    border-radius: 16px;
  }
  .stat strong {
    font-size: 1.35rem;
  }
  .stat span {
    font-size: .78rem;
    line-height: 1.5;
  }
  .admin-edit-form,
  .delegation-form {
    gap: 10px;
  }
  .admin-edit-form .grid,
  .card > .grid,
  .soft-card > .grid,
  .grid.two.compact,
  .grid.three.compact,
  .grid.four.compact,
  .grid.five.compact {
    grid-template-columns: 1fr !important;
  }
  .admin-edit-form .btn,
  .card form .btn,
  .soft-card form .btn {
    width: 100%;
  }
  .section-head,
  .section-head.mini,
  .badge-stack,
  .service-meta {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .section-head .pill,
  .section-head .btn,
  .badge-stack .btn {
    width: 100%;
    justify-content: center;
  }
  .check-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-content: start;
    width: 100%;
  }
  .delegation-checks {
    display: grid;
    gap: 10px;
    margin: 0;
  }
  .delegation-checks .check-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .result-card { padding: 14px; }
  .promotion-result-card { font-size: .88rem; }
  .promotion-result-card .section-head {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
  }
  .promotion-result-card .section-head h2 {
    margin: 0;
    font-size: 1.15rem;
  }
  .result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .result-actions .pill {
    grid-column: 1 / -1;
    justify-content: center;
    padding: 5px 8px;
    font-size: .78rem;
  }
  .result-actions .btn {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 11px;
    font-size: .78rem;
  }
  .result-actions .btn.primary {
    grid-column: auto;
  }
  .latest-calculation-details summary {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 12px;
    gap: 4px;
    font-size: .86rem;
  }
  .latest-calculation-details summary::before {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
  }
  .latest-calculation-details summary span {
    padding-inline-start: 0;
  }
  .latest-calculation-details summary strong,
  .latest-calculation-details summary small {
    justify-self: start;
  }
  .promotion-result-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }
  .promotion-result-table {
    display: block;
    min-width: 0 !important;
    background: transparent;
  }
  .promotion-result-table thead {
    display: none;
  }
  .promotion-result-table tbody,
  .promotion-result-table tr,
  .promotion-result-table td,
  .promotion-result-table tfoot,
  .promotion-result-table th {
    display: block;
  }
  .promotion-result-table tbody {
    display: grid;
    gap: 10px;
  }
  .promotion-result-table tr {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 9px 10px;
    background: rgba(255, 253, 249, 0.72);
  }
  .promotion-result-table td {
    display: grid;
    grid-template-columns: minmax(92px, 42%) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(230, 222, 212, 0.72);
    font-size: .84rem;
  }
  .promotion-result-table td:last-child {
    border-bottom: 0;
  }
  .promotion-result-table td::before {
    content: attr(data-label);
    color: var(--primary);
    font-weight: 900;
    font-size: .78rem;
  }
  .promotion-result-table .report-btn {
    width: 100%;
    min-height: 32px;
    padding: 6px 8px;
    font-size: .78rem;
  }
  .promotion-result-table tfoot {
    margin-top: 10px;
  }
  .promotion-result-table tfoot tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    border-color: rgba(184, 138, 58, 0.30);
    background: rgba(184, 138, 58, 0.10);
  }
  .promotion-result-table tfoot th {
    padding: 2px 0;
    border: 0;
    text-align: center;
    background: transparent;
    font-size: .9rem;
  }
  .hero-actions, .actions-cell, .inline-select, .inline-upload { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  dialog.settings-dialog[open],
  dialog.settings-dialog.fallback-open {
    position: fixed !important;
    top: max(7px, env(safe-area-inset-top));
    right: 7px;
    bottom: max(7px, env(safe-area-inset-bottom));
    left: 7px;
    inset: max(7px, env(safe-area-inset-top)) 7px max(7px, env(safe-area-inset-bottom)) 7px;
    width: auto !important;
    max-width: none !important;
    height: auto;
    max-height: none !important;
    transform: none !important;
    margin: 0 !important;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 100000;
  }
  .settings-dialog,
  .promotion-wizard,
  .compact-report-dialog,
  .report-dialog {
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 18px;
  }
  .settings-dialog { padding: 14px; }
  .promotion-wizard { overflow: auto; }
  .dialog-head {
    position: sticky;
    top: -14px;
    z-index: 4;
    padding: 10px 0;
    background: var(--white);
  }
  .report-dialog { padding: 0; overflow: hidden !important; }
  .report-dialog-shell {
    max-height: calc(100dvh - 14px);
    padding: 58px 12px 12px;
  }
  .admin-users-table .inline-select,
  .admin-users-table .inline-upload {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }
  .admin-users-table .btn.small { width: auto; }
  .admin-users-table,
  .admin-delegations-table {
    display: block;
    min-width: 0 !important;
    background: transparent;
    font-size: .82rem;
  }
  .admin-users-table thead,
  .admin-delegations-table thead {
    display: none;
  }
  .admin-users-table tbody,
  .admin-users-table tr,
  .admin-users-table td,
  .admin-delegations-table tbody,
  .admin-delegations-table tr,
  .admin-delegations-table td {
    display: block;
  }
  .admin-users-table tbody,
  .admin-delegations-table tbody {
    display: grid;
    gap: 10px;
  }
  .admin-users-table tr,
  .admin-delegations-table tr {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    background: rgba(255, 253, 249, .72);
  }
  .admin-users-table td,
  .admin-delegations-table td {
    display: grid;
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 1px solid rgba(230, 222, 212, .72);
    word-break: break-word;
  }
  .admin-users-table td:last-child,
  .admin-delegations-table td:last-child {
    border-bottom: 0;
  }
  .admin-users-table td::before,
  .admin-delegations-table td::before {
    content: attr(data-label);
    color: var(--primary);
    font-weight: 900;
    font-size: .76rem;
  }
  .admin-users-table .inline-select {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .admin-users-table .inline-select select,
  .admin-users-table .inline-select input,
  .admin-users-table .btn.small {
    width: 100%;
    max-width: none;
  }
  .admin-nav + .stats-grid,
  .stats-grid + .card {
    min-width: 0;
  }
  .admin-nav.card,
  .stats-grid,
  .admin-users-table,
  .admin-delegations-table {
    contain: layout;
  }
  body:has(.admin-nav) .table-wrap table:not(.admin-users-table):not(.admin-delegations-table):not(.promotion-result-table) {
    min-width: 560px;
  }
  .wizard-actions { flex-direction: column; }
  .hijri-selects { grid-template-columns: 1fr; }
  table { min-width: 680px; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html,
  body {
    width: auto;
    min-height: auto;
    background: #fff;
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  body * { visibility: hidden; }
  .print-report,
  .print-report * { visibility: visible; }
  .print-report {
    display: block !important;
    position: absolute;
    top: 0;
    right: 50%;
    left: auto;
    width: 190mm;
    max-width: none;
    margin: 0;
    transform: translateX(50%);
    box-sizing: border-box;
    direction: rtl;
    color: #111;
    font-size: 9.6px;
    line-height: 1.28;
    page-break-after: avoid;
    page-break-before: avoid;
    page-break-inside: avoid;
  }
  .print-report-head {
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 7px;
  }
  .print-report-head img,
  .print-brand-mark {
    width: 46px;
    height: 46px;
  }
  .print-report h1,
  .print-report h2,
  .print-report p { margin: 0 0 3px; }
  .print-report h1 { font-size: 15px; }
  .print-report h2 { font-size: 13px; }
  .print-report-table {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: auto;
    margin-left: auto;
    font-size: 8.8px;
    table-layout: fixed;
    page-break-inside: avoid;
  }
  .print-report-table th,
  .print-report-table td {
    padding: 3px 4px;
    line-height: 1.22;
  }
  .print-report-notes {
    margin-top: 5px;
    padding: 5px 7px;
    font-size: 8.8px;
    page-break-inside: avoid;
  }
  .print-report-footer {
    margin-top: 6px;
    padding-top: 5px;
    font-size: 8.8px;
    page-break-inside: avoid;
  }
}
.deadline-page-card {
  display: grid;
  gap: 16px;
}
.deadline-page-meta .soft-card p,
.deadline-page-copy p {
  margin: 8px 0 0;
  line-height: 1.85;
}
.deadline-instruction-list {
  margin: 10px 0 0;
  padding: 0 20px 0 0;
  color: rgba(47,58,61,.84);
  line-height: 1.9;
  display: grid;
  gap: 8px;
}
.direct-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.direct-link-box input {
  direction: ltr;
  text-align: left;
  min-width: 0;
}
.text-danger {
  color: #9f1d1d !important;
}
.survey-question-list,
.survey-bars,
.file-tools-grid {
  display: grid;
  gap: 12px;
}
.survey-question-row {
  display: grid;
  gap: 10px;
}
.survey-card {
  display: grid;
  gap: 12px;
}
.survey-bars > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
}
.survey-bars i {
  grid-column: 1 / -1;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) var(--bar), rgba(7,63,70,.12) var(--bar));
}
.metric-big {
  color: var(--primary);
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 900;
  line-height: 1;
}
.file-tool-status-card {
  align-self: start;
}
.form-builder-row,
.pdf-preview-card,
.pdf-library-layout,
.row-actions {
  display: grid;
  gap: 12px;
}
.form-builder-panel {
  display: grid;
  gap: 12px;
}
.details-card {
  border-top: 1px solid rgba(7,63,70,.12);
  padding-top: 10px;
}
.details-card summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
}
.form-section-title {
  margin: 4px 0 0;
  color: var(--primary);
  font-size: 1rem;
}
.annotation-pad-wrap {
  border: 1px solid rgba(7,63,70,.14);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.annotation-pad {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
}
.pdf-preview-frame {
  width: 100%;
  min-height: 72vh;
  border: 0;
  border-radius: 16px;
  background: #fff;
}
.print-sheet .print-head {
  margin-bottom: 14px;
  line-height: 1.8;
}
.print-sheet .section-row td {
  background: rgba(184,138,58,.12);
}
.initiative-print-sheet {
  max-width: 210mm;
  margin-inline: auto;
  gap: 14px;
}
.initiative-approval-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(7,63,70,.22);
  border-radius: 12px;
  padding: 12px;
}
.initiative-approval-box div {
  display: grid;
  min-height: 82px;
  align-content: start;
  gap: 8px;
}
.initiative-approval-box span,
.initiative-approval-box em {
  color: var(--muted);
  font-style: normal;
}
.initiative-print-note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(7,63,70,.12);
  line-height: 1.9;
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 640px) {
  .deadline-card-head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .deadline-interest-form {
    grid-column: 1 / -1;
  }
  .deadline-interest-btn {
    width: 100%;
  }
  .direct-link-box {
    grid-template-columns: 1fr;
  }
  .registration-mobile-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
  }
  .registration-mobile-list + .table-wrap {
    display: none;
  }
  .detail-list {
    grid-template-columns: 1fr;
  }
  .dialog-actions .btn,
  .dialog-actions form {
    width: 100%;
  }
  .forum-topic-manage summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .member-service-feature {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .member-service-feature .deadline-interest-form,
  .member-service-feature .deadline-interest-btn {
    width: 100%;
  }
  .member-service-grid {
    grid-template-columns: 1fr;
  }
  .initiative-summary,
  .score-grid,
  .initiative-participation-summary,
  .initiative-approval-box {
    grid-template-columns: 1fr;
    display: grid;
  }
  .pdf-preview-frame {
    min-height: 56vh;
  }
}

.achievement-form textarea,
.achievement-form input {
  min-width: 0;
}

.portfolio-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.portfolio-table {
  min-width: 980px;
}

.portfolio-table textarea {
  min-height: 52px;
  resize: vertical;
}

.portfolio-table input,
.portfolio-table textarea {
  width: 100%;
}

.delivery-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.export-card {
  margin-top: 18px;
}

.pwa-actions {
  display: none;
  position: fixed;
  inset-inline-start: max(12px, env(safe-area-inset-left));
  bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 1500;
  gap: 8px;
  align-items: center;
}
.is-standalone-app .pwa-actions {
  display: flex;
}
.pwa-refresh-btn,
.pwa-notify-btn {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}
.pwa-notify-btn {
  background: var(--gold);
  color: #102f34;
}
.messages-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.messages-sidebar,
.messages-panel {
  min-width: 0;
}
.message-thread-list,
.contact-cards,
.message-bubbles {
  display: grid;
  gap: 10px;
}
.message-thread {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: inherit;
  text-decoration: none;
}
.message-thread.is-active,
.message-thread:hover {
  border-color: rgba(184, 138, 58, .65);
  background: rgba(184, 138, 58, .08);
}
.message-thread p {
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-bubbles {
  max-height: 54vh;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.46);
}
.message-bubble {
  max-width: min(78%, 620px);
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.8;
}
.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
}
.message-bubble small {
  display: block;
  margin-top: 4px;
  opacity: .72;
}
.message-bubble.is-mine {
  justify-self: start;
  background: var(--primary);
  color: #fff;
}
.message-bubble.is-theirs {
  justify-self: end;
  background: #fff;
  border: 1px solid var(--border);
}
.message-compose {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.message-compose textarea,
.contact-cards textarea {
  min-width: 0;
  width: 100%;
}
.contact-cards .list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  align-items: start;
}

@media (max-width: 720px) {
  .portfolio-table {
    min-width: 760px;
  }

  .delivery-options {
    display: grid;
  }
  .pwa-actions {
    inset-inline-start: 10px;
    bottom: calc(54px + env(safe-area-inset-bottom));
  }
  .pwa-refresh-btn,
  .pwa-notify-btn {
    padding: 9px 11px;
    font-size: .82rem;
  }
  .messages-layout {
    grid-template-columns: 1fr;
  }
  .contact-cards .list-item {
    grid-template-columns: 1fr;
  }
  .message-bubble {
    max-width: 92%;
  }
  .message-bubbles {
    max-height: 48vh;
  }
}
