:root {
  --bg: #ffffff;
  --topbar: #1f2733;
  --text: #1f2733;
  --muted: #6b7280;
  --border: #e3e6ea;
  --panel-head: #f7f8fa;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --info-bg: #eff8fb;
  --info-border: #cfeaf2;
  --success: #16a34a;
  --danger: #dc2626;
  --skip: #9ca3af;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== الشريط العلوي ===== */
.topbar {
  background: var(--topbar);
  color: #fff;
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 20px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
}
.nav {
  display: flex;
  gap: 20px;
}
.nav a {
  color: #c7ccd4;
  font-size: 0.92rem;
}
.nav a:hover {
  color: #fff;
}
.user {
  margin-left: auto;
  color: #c7ccd4;
  font-size: 0.92rem;
}

/* ===== المحتوى ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.breadcrumb {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.breadcrumb a:hover {
  color: var(--primary);
}
.page-title {
  margin: 0 0 4px;
  font-size: 1.9rem;
}
.page-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
}
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0 22px;
}

.mode-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.mode-badge.execute {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.mode-badge.dry-run {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

/* ===== صناديق المعلومات ===== */
.info-box {
  display: flex;
  gap: 12px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.info-box.light {
  background: #f8fbfd;
}
.info-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.info-icon {
  font-size: 1.1rem;
}
.checklist {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}
.checklist li {
  margin: 2px 0;
}

/* ===== الأقسام (panels) ===== */
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  gap: 12px;
  background: var(--panel-head);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.panel-body {
  padding: 18px;
}
.panel-body label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* ===== الحقول ===== */
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
}
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.input-group {
  display: flex;
}
.input-group input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.addon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--panel-head);
  border: 1px solid var(--border);
  border-left: none;
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  color: var(--muted);
  white-space: nowrap;
}
.hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ===== الأزرار ===== */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.btn {
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--panel-head);
}
.btn-danger {
  background: #fff;
  border-color: #fecaca;
  color: var(--danger);
}
.btn-danger:hover {
  background: #fef2f2;
}
.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.confirm-text {
  color: var(--danger);
  font-size: 0.85rem;
  margin-right: 6px;
}

.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ===== النتائج ===== */
.results {
  margin-top: 34px;
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.results-summary {
  margin-bottom: 16px;
  color: var(--muted);
}
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
}
.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.step-icon {
  font-weight: 700;
  width: 22px;
  text-align: center;
}
.step.success .step-icon {
  color: var(--success);
}
.step.failed .step-icon {
  color: var(--danger);
}
.step.skipped .step-icon {
  color: var(--skip);
}
.step.warning .step-icon {
  color: #d97706;
}
.step-title {
  font-weight: 600;
}
.step-status {
  margin-left: auto;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted);
}
.step-output {
  background: #0f172a;
  color: #cbd5e1;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  padding: 12px 14px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid var(--border);
}
.step.failed .step-output {
  color: #fca5a5;
}

/* ===== صفحة النطاقات ===== */
.nav a.active {
  color: #fff;
  font-weight: 600;
}
.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.muted-box {
  color: var(--muted);
  background: var(--panel-head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.muted-box a {
  color: var(--primary);
}

.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th,
.table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.table thead th {
  background: var(--panel-head);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover {
  background: #fafbfc;
}
.col-actions {
  text-align: right;
  white-space: nowrap;
}
.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.domain-link {
  color: var(--primary);
  text-decoration: none;
}
.domain-link:hover {
  text-decoration: underline;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}
.port-input {
  width: 110px;
  padding: 6px 10px;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.pill-ok {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.pill-muted {
  background: var(--panel-head);
  color: var(--muted);
  border: 1px solid var(--border);
}
.pill-warn {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

/* ===== نموذج إنشاء مشروع + السجلّات ===== */
.create-form {
  margin-bottom: 26px;
}
.panel-body label.mt {
  margin-top: 18px;
}
.path-cell {
  color: var(--muted);
  font-size: 0.85rem;
}
.logs-title {
  font-size: 1rem;
  margin: 18px 0 8px;
}
.logs-output {
  background: #0f172a;
  color: #cbd5e1;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  padding: 14px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
}
