/* تنسيق صفحة المزامنة — تشغيل جديد + بطاقات الحالة + شبكة الإحصائيات + الخط الزمني.
   بطاقة التشغيل = بطاقة تحكم (مش قسم dashboard): نفس لغة باقي اللوحات
   (.panel-head + .panel-tools) وعلى عرض محتواها. */

/* -- بطاقة «تشغيل مزامنة جديدة» ------------------------------------------------ */

/* مؤشر المسار: ثلاث مراحل، اللي بيشارك في الوضع المختار بتضيء والباقي بيفتّح.
   ترتيب القراءة RTL: MySQL على اليمين وCloud آخر المرحلة. */
.pipeline {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  font-family: var(--mono);
  direction: ltr;
  unicode-bidi: isolate;
}
.pipeline .seg {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f1f3f6;
  color: var(--muted);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.pipeline .seg.on {
  background: var(--accent-soft);
  border-color: #cfe0f8;
  color: var(--accent);
}
.pipeline .arrow {
  color: #b6bfca;
  font-size: 13px;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  .pipeline .seg {
    transition: none;
  }
}
#run-scope {
  white-space: nowrap;
}

/* الفورم: اختيارين في سطر، وتحته زرار التشغيل بعرض حقل واحد.
   العرض ثابت (مش 1fr) — المحتوى قصير والتمدد بيطلعه صناديق فاضية. */
.run-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 60px;
  row-gap: 35px;
  align-items: start;
  width: 100%;
}

/* زر التشغيل */
.run-form .run-button {
  grid-column: 1 / -1;
  justify-self: center;
  width: 280px;
  margin-top: 5px;
}

/* الموبايل */
@media (max-width: 660px) {
  .run-form {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .run-form .run-button {
    grid-column: auto;
    width: 100%;
    min-width: unset;
  }
}

.run-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.run-group > label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.run-group select {
  width: 100%;
}

/* زرار التشغيل على سطر تاني، بعرض حقل واحد + سطر الحالة جنبه.
   justify-content: start عشان يتراصف تحت أول حقل (اللي على اليمين في RTL). */
.run-action {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.run-action button {
  flex: 0 0 280px;
  font-size: 15px;
  font-weight: 600;
}
.run-action .muted {
  line-height: 1.4;
}
@media (max-width: 660px) {
  .run-action button {
    flex: 1 1 auto;
  }
}

/* -- بطاقات الحالة الحالية --------------------------------------------------- */

#status {
  padding: 0;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbfcfd;
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
}
.stat .value {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.stat.ok .value {
  color: var(--ok);
}
.stat.bad .value {
  color: var(--danger);
}
.stat.info .value {
  color: var(--accent);
}

.timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 18px;
  border-inline-start: 2px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 2px 0;
  font-size: 12.5px;
}
.timeline li::before {
  content: "";
  position: absolute;
  inset-inline-start: -23px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .at {
  color: var(--muted);
  font-size: 11.5px;
  margin-inline-start: 6px;
}

.run-error {
  margin-top: 8px;
  padding: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 8px;
  font-size: 13px;
}
