/* أزرار واتساب — Dr Mahmoud AI
   الألوان من متغيرات القالب الابن، مع قيم احتياطية إن غاب القالب. */

.dm-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--dm-control-h, 48px);
  padding-inline: var(--dm-space-6, 24px);
  border-radius: var(--dm-radius-md, 12px);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease;
}

.dm-wa--primary {
  background: #0F7A6C;
  color: #fff;
}

.dm-wa--primary:hover,
.dm-wa--primary:focus {
  background: #0B5C51;
  color: #fff;
}

.dm-wa--ghost {
  background: transparent;
  color: var(--dm-blue-600, #1B5FD0);
  box-shadow: inset 0 0 0 1px var(--dm-border-strong, #C3D2E8);
}

.dm-wa--ghost:hover,
.dm-wa--ghost:focus {
  background: var(--dm-surface-2, #F5F8FF);
}

.dm-wa:focus-visible,
.dm-wa-float:focus-visible {
  outline: 2px solid var(--dm-cyan-700, #0E7E8A);
  outline-offset: 3px;
}

.dm-wa__icon {
  flex-shrink: 0;
}


/* الأزرار عناصر سطرية عارية داخل المحتوى، فيتبعثر عرضها بعرض نصّها.
   كل زر خيار مستقل لا عنصر في شريط أدوات، فالمكدّس أصح بصريًا. */
.entry-content > .dm-wa {
  margin-block-end: 10px;
  margin-inline-end: 10px;
  vertical-align: top;
}

.dm-wa > span {
  text-align: start;
}

@media (max-width: 782px) {
  .dm-wa {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    padding-inline: 16px;
    min-height: 52px;
  }

  .entry-content > .dm-wa {
    margin-inline-end: 0;
    margin-block-end: 12px;
  }
}

/* الزر العائم.
   inset-inline-start في واجهة RTL = يمين الشاشة، وهو المقصود:
   زر «العودة لأعلى» في Kadence يقع يسارًا في RTL، فلا يتصادم الزران. */
.dm-wa-float {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-start: 20px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #0F7A6C;
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(16, 24, 40, .45);
  text-decoration: none;
}

.dm-wa-float:hover {
  background: #0B5C51;
  color: #fff;
}

@media (max-width: 640px) {
  .dm-wa-float {
    inset-block-end: 16px;
    inset-inline-start: 16px;
    width: 56px;
    height: 56px;
  }
}

@media print {
  .dm-wa-float { display: none; }
}

/* ============================================================
   الدفع اليدوي — تعليمات التحويل ورفع الإثبات
   ============================================================ */

.dm-pay-methods {
  background: var(--dm-surface-2, #F5F8FF);
  border: 1px solid var(--dm-border, #DCE5F2);
  border-radius: var(--dm-radius-sm, 8px);
  padding: 14px 18px;
  margin-block: 12px;
}

.dm-pay-method {
  margin: 0 0 8px;
  font-size: 15px;
}

.dm-pay-method:last-child { margin-bottom: 0; }

.dm-pay-note {
  font-size: 13px;
  color: var(--dm-text-muted, #5A6B87);
}

.dm-thankyou {
  border: 1px solid var(--dm-border-strong, #C3D2E8);
  border-radius: var(--dm-radius-md, 12px);
  padding: 20px 24px;
  margin-block: 24px;
  background: var(--dm-surface, #fff);
}

.dm-proof-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin-block-start: 12px;
}

.dm-proof-form label { font-weight: 600; }

.dm-proof-hint {
  font-size: 13px;
  color: var(--dm-text-muted, #5A6B87);
  margin: 0;
}

.dm-proof-ok {
  background: var(--dm-success-bg, #E5F7EF);
  color: var(--dm-success-text, #027A48);
  border-radius: var(--dm-radius-sm, 8px);
  padding: 12px 16px;
}

.dm-proof-reject {
  background: var(--dm-error-bg, #FDECEA);
  color: var(--dm-error-text, #B42318);
  border-radius: var(--dm-radius-sm, 8px);
  padding: 12px 16px;
}

/* حقل توجيه الاشتراك لعمل خير */
.dm-donation {
  border: 1px solid var(--dm-border, #DCE5F2);
  border-radius: var(--dm-radius-md, 12px);
  padding: 16px 20px;
  margin-block: 20px;
  background: var(--dm-surface-2, #F5F8FF);
}

.dm-donation h3 {
  margin-block: 0 6px;
  font-size: 1.0625rem;
}

.dm-donation__note {
  font-size: 14px;
  color: var(--dm-text-muted, #5A6B87);
  margin-block-end: 12px;
}

.dm-donation .dm-donation__field select {
  width: 100%;
  min-height: 44px;
}

/* ============================================================
   الحضور والغياب ولوحة ولي الأمر
   ============================================================ */

.dm-attendance__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 14px 18px;
  background: var(--dm-surface-2, #F5F8FF);
  border-radius: var(--dm-radius-sm, 8px);
  margin-block-end: 16px;
  font-size: 15px;
}

.dm-attendance__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dm-attendance__table th,
.dm-attendance__table td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--dm-border, #DCE5F2);
}

.dm-attendance__table thead th {
  background: var(--dm-surface-2, #F5F8FF);
  font-size: 12.5px;
  color: var(--dm-text-muted, #5A6B87);
}

.dm-att {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}

.dm-att--present { background: var(--dm-success-bg, #E5F7EF); color: var(--dm-success-text, #027A48); }
.dm-att--late    { background: var(--dm-warning-bg, #FDF2E3); color: var(--dm-warning-text, #B54708); }
.dm-att--absent  { background: var(--dm-error-bg, #FDECEA);   color: var(--dm-error-text, #B42318); }
.dm-att--excused { background: var(--dm-surface-3, #E7EEFA);  color: var(--dm-text-2, #2C3E5E); }

.dm-parent__child {
  border: 1px solid var(--dm-border, #DCE5F2);
  border-radius: var(--dm-radius-md, 12px);
  padding: 22px 24px;
  margin-block-end: 24px;
  background: var(--dm-surface, #fff);
}

.dm-parent__child h2 { margin-block: 0 16px; }

.dm-parent__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-block-end: 22px;
}

.dm-stat {
  background: var(--dm-surface-2, #F5F8FF);
  border-radius: var(--dm-radius-sm, 8px);
  padding: 14px;
  text-align: center;
}

.dm-stat__num {
  display: block;
  font-family: var(--dm-font-display, inherit);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dm-blue-600, #1B5FD0);
  line-height: 1.2;
}

.dm-stat__lbl {
  display: block;
  font-size: 12.5px;
  color: var(--dm-text-muted, #5A6B87);
  margin-block-start: 4px;
}

/* ============================================================
   نموذج تأكيد تحويل فودافون كاش
   ============================================================ */

.dm-pay__steps {
  counter-reset: dmstep;
  list-style: none;
  padding-inline-start: 0;
  margin-block-end: 24px;
}

.dm-pay__steps > li {
  position: relative;
  padding-inline-start: 42px;
  margin-block-end: 16px;
  line-height: 1.8;
}

.dm-pay__steps > li::before {
  counter-increment: dmstep;
  content: counter(dmstep);
  position: absolute;
  inset-inline-start: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--dm-blue-600, #1B5FD0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.dm-pay__amount {
  display: inline-block;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--dm-blue-600, #1B5FD0);
  margin-inline-start: 6px;
}

.dm-pay__target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block-start: 8px;
  padding: 12px 14px;
  background: var(--dm-surface-2, #F5F8FF);
  border: 1px dashed var(--dm-border-strong, #C3D2E8);
  border-radius: var(--dm-radius-sm, 8px);
}

.dm-pay__target code {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: none;
  border: 0;
  padding: 0;
  color: var(--dm-text, #101828);
}

.dm-pay__copy {
  border: 1px solid var(--dm-border-strong, #C3D2E8);
  background: #fff;
  color: var(--dm-blue-600, #1B5FD0);
  border-radius: var(--dm-radius-sm, 8px);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}

.dm-pay__copy:hover { background: var(--dm-surface-2, #F5F8FF); }

.dm-pay__copy:focus-visible {
  outline: 2px solid var(--dm-blue-600, #1B5FD0);
  outline-offset: 2px;
}

.dm-pay__owner {
  font-size: 13px;
  color: var(--dm-text-muted, #5A6B87);
}

.dm-proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
}

.dm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.dm-field label {
  font-weight: 600;
  font-size: 14px;
}

.dm-field label span[aria-hidden] { color: var(--dm-error-text, #B42318); }

.dm-field input,
.dm-field select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--dm-border-strong, #C3D2E8);
  border-radius: var(--dm-radius-sm, 8px);
  font: inherit;
  width: 100%;
}

.dm-field input:focus-visible,
.dm-field select:focus-visible {
  outline: 2px solid var(--dm-blue-600, #1B5FD0);
  outline-offset: 1px;
}

.dm-field--file { margin-block-start: 18px; }

.dm-proof-form { display: block; }

.dm-proof-form .dm-btn {
  margin-block-start: 20px;
  min-height: 48px;
  padding-inline: 28px;
  background: var(--dm-blue-600, #1B5FD0);
  color: #fff;
  border: 0;
  border-radius: var(--dm-radius-md, 12px);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.dm-proof-form .dm-btn:hover { background: var(--dm-blue-700, #14489E); }

/* ============================================================
   شريط «١٠٠٪ لعمل خير» — في تذييل كل صفحة
   ============================================================ */

.dm-give-strip {
  background: linear-gradient(160deg, #03133B 0%, #061B4F 100%);
  color: #fff;
  padding: 18px 20px;
  text-align: center;
}

.dm-give-strip p {
  margin: 0 auto;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.7;
  color: #C7D8F5;
}

.dm-give-strip strong { color: #fff; }

.dm-give-strip ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
}

.dm-give-strip li {
  border: 1px solid rgba(18, 199, 214, .3);
  background: rgba(18, 199, 214, .1);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #8FE9F2;
}

@media (max-width: 640px) {
  .dm-give-strip { padding: 16px; }
  .dm-give-strip ul { gap: 6px; }
  .dm-give-strip li { font-size: 12.5px; padding: 4px 11px; }
}

@media print { .dm-give-strip { display: none; } }

/* ============================================================
   دعوة تسجيل الدخول
   ============================================================ */

.dm-login {
  border: 1px solid var(--dm-border, #DCE5F2);
  border-radius: var(--dm-radius-md, 12px);
  background: var(--dm-surface-2, #F5F8FF);
  padding: 22px 24px;
  margin-block: 20px;
}

.dm-login p { margin: 0; }

.dm-login__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-block-start: 16px !important;
}

.dm-login__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding-inline: 26px;
  border-radius: var(--dm-radius-md, 12px);
  background: var(--dm-blue-600, #1B5FD0);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.dm-login__btn:hover,
.dm-login__btn:focus { background: var(--dm-blue-700, #14489E); color: #fff; }

.dm-login__alt { font-size: 14px; }

@media (max-width: 640px) {
  .dm-login__btn { width: 100%; }
}
