:root{
  --btn-advance-bg: #28a745;
  --btn-back-bg: #dc3545;
  --btn-text-color: #ffffff;
  --modal-bg: rgba(0,0,0,0.45);
  --card-accent: #d68200;
  --card-border: #d68200;
}

/* عام */
*{box-sizing:border-box}
body{
  margin:0;
  font-family: Tahoma, Arial, sans-serif;
  background:#f7f7f8;
  color:#222;
  text-align:center;
}

/* top bar */
.top-bar {
  display:flex;
  justify-content:space-between;
  padding:10px 15px;
  background: #fff;
}
.nav-btn{
  background:transparent;border:none;cursor:pointer;width:50px;height:50px;padding:0;
}
.nav-btn img{width:50px;height:50px;object-fit:contain}

.divider{border:1px solid var(--card-border); margin:0}
.page-title{color:var(--card-accent); font-size:22px; margin:15px 0}

/* الحاوية */
#cards-container{ max-width:920px; margin:20px auto; padding:0 12px; }

/* بطاقة */
.card{
  border:2px solid var(--card-border);
  border-radius:10px;
  padding:14px;
  margin:15px 0;
  text-align:right;
  background:#fff;
  box-shadow: 0 8px 28px rgba(0,0,0,0.06);
}
.card h2{ color:var(--card-accent); margin:0 0 8px 0; font-size:18px }
.card p{ margin:6px 0; font-size:15px; color:#222 }

/* أزرار التحكم داخل البطاقة */
.card-controls{ display:flex; gap:12px; justify-content:flex-start; margin-top:12px }
.btn-action{
  padding:10px 14px; border-radius:10px; border:1px solid rgba(0,0,0,0.06);
  cursor:pointer; font-size:15px; min-width:110px; font-family:Tahoma, sans-serif;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.btn-advance{ background:var(--btn-advance-bg); color:var(--btn-text-color); border: none; }
.btn-delete{ background:#fff; color:#c82333; border:1px solid #f5c6cb; }
.btn-disabled{ opacity:0.6; cursor:not-allowed }

/* زر الإضافة */
.add-btn{
  position:fixed; bottom:24px; left:24px;
  background:#f9a825; border:none; border-radius:50%; width:64px; height:64px;
  font-size:36px; color:white; cursor:pointer;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  display:flex; align-items:center; justify-content:center;
}

/* مودال */
.mth-modal{ display:none; position:fixed; inset:0; align-items:center; justify-content:center; z-index:20000 }
.mth-modal.show{ display:flex }
.mth-modal .overlay{ position:absolute; inset:0; background:var(--modal-bg) }
.mth-modal .dialog{ position:relative; background:#fff; border-radius:14px; padding:20px; width:92%; max-width:520px; z-index:2; box-shadow:0 18px 60px rgba(0,0,0,0.35) }
.mth-modal .dialog h3{ margin:0 0 12px 0; font-size:20px; color:#1b5e20 }
.mth-modal .dialog .row{ margin:10px 0; text-align:right }
.mth-modal .dialog label{ display:block; margin-bottom:6px; color:#333; font-weight:600 }

/* الحقول */
.mth-modal .dialog input[type="number"]{ width:100%; padding:10px; font-size:16px; border-radius:8px; border:1px solid #ddd; box-sizing:border-box }
.fancy-select{ width:100%; padding:10px; font-size:16px; border-radius:8px; border:1px solid #ddd; background:white; }

/* تلميحات */
.mth-modal .dialog .hint{ font-size:13px; color:#666; margin-top:6px }

/* أزرار مودال */
.mth-modal .dialog .actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:14px }
.mth-modal .dialog .actions .btn{ padding:10px 14px; border-radius:10px; border:none; cursor:pointer; font-size:15px }
.mth-modal .dialog .actions .btn.cancel{ background:var(--btn-back-bg); color:var(--btn-text-color) }
.mth-modal .dialog .actions .btn.next{ background:var(--btn-advance-bg); color:var(--btn-text-color) }

/* confirm box */
.confirm-summary{ background:#fafafa; border:1px solid #eee; padding:14px; border-radius:8px; margin-top:10px; text-align:right }

/* success */
.success-box{ display:flex; gap:12px; align-items:center; padding:16px; border-radius:12px; border:2px solid #2e8b57; background:#fff }
.success-box .check{ width:56px; height:56px; border-radius:10px; background:#2e8b57; display:flex; align-items:center; justify-content:center; color:#fff; font-size:26px }
.success-box h4{ margin:0; color:#2e8b57; font-size:20px }
.success-box p{ margin:6px 0 0 0; color:#222 }

/* responsive */
@media (max-width:420px){
  .mth-modal .dialog{ padding:14px; width:94% }
  .btn-action{ padding:8px 10px; min-width:72px; font-size:14px }
}

/* Toast (quick) */
.toast-inline {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 88px;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  z-index: 40000;
  font-weight: 600;
}

/* =========================
   تحسين زر "حسناً" في مودال النجاح
   ضع هذا في style.css (يمكن في آخر الملف)
   ========================= */

.mth-modal .dialog .success-actions {
  display: flex;
  justify-content: center;   /* يوسّط الزر أفقياً */
  align-items: center;
  margin-top: 18px;          /* مسافة علوية */
}

/* زر Success (يستهدف id إن وُجد، وإلا يستهدف الزر داخل success-actions) */
#successCloseBtn,
.mth-modal .dialog .success-actions .btn.next {
  display: inline-block;
  margin: 0 auto;                    /* يوسّط داخل الحاوية */
  padding: 12px 36px;                /* حجم مناسب للمس */
  min-width: 150px;                  /* عرض أدنى لطيف */
  border-radius: 14px;               /* زوايا مستديرة */
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #3db06a 0%, #2a8b4b 100%); /* تدرج أخضر */
  box-shadow: 0 10px 30px rgba(42,139,75,0.18), inset 0 -1px 0 rgba(255,255,255,0.03);
  transition: transform .14s ease, box-shadow .14s ease, opacity .12s ease;
  outline: none;
}

/* حالة المرور */
#successCloseBtn:hover,
.mth-modal .dialog .success-actions .btn.next:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(42,139,75,0.26);
}

/* حالة الضغط */
#successCloseBtn:active,
.mth-modal .dialog .success-actions .btn.next:active {
  transform: translateY(0);
  opacity: 0.95;
}

/* حالة التركيز للوصولية */
#successCloseBtn:focus,
.mth-modal .dialog .success-actions .btn.next:focus {
  box-shadow: 0 20px 50px rgba(42,139,75,0.22), 0 0 0 4px rgba(42,139,75,0.12);
}

/* جعل النص داخل مودال النجاح مركزيًا أيضاً */
.mth-modal .dialog .success-box {
  justify-content: center;  /* يوسّط أيقونة + نص */
  text-align: center;
}

/* استجابة لمقاسات الشاشات الصغيرة */
@media (max-width:420px) {
  #successCloseBtn,
  .mth-modal .dialog .success-actions .btn.next {
    padding: 10px 22px;
    font-size: 16px;
    min-width: 120px;
  }
}
