/* أزرار الإجراءات الموحّدة — زي ERP (إضافة · تعديل · تعيين · حذف · أرشفة) */

.hub-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
}

.hub-page-act {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  color: #fff;
  background: #d70000;
  box-shadow: 0 8px 18px rgba(215, 0, 0, 0.22);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.hub-page-act:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.hub-page-act.ghost {
  background: #fff;
  color: #303848;
  border: 1px solid #e2e6ef;
  box-shadow: none;
}

.hub-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  vertical-align: middle;
}

.hub-act {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.hub-act:hover {
  opacity: 0.88;
  transform: scale(1.06);
}

.hub-act i {
  color: #fff !important;
  font-size: 13px;
}

.hub-act-edit {
  background: #2563eb;
}

.hub-act-assign {
  background: #0f766e;
}

.hub-act-delete {
  background: #dc2626;
}

.hub-act-archive {
  background: #475569;
}

.hub-act-add {
  background: #16a34a;
}

.hub-act-view {
  background: #0891b2;
}

.hub-act.is-text {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  gap: 6px;
  font: inherit;
  font-weight: 800;
  font-size: 12px;
}

.market-card .hub-row-actions,
.shop-card .hub-row-actions,
.card .hub-row-actions {
  margin-top: 10px;
}

/* —— نماذج ERP داخل النظام (بدل prompt المتصفح) —— */
.hub-erp-modal {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.hub-erp-modal.open {
  display: flex;
}

.hub-erp-dialog {
  width: min(720px, 96vw);
  max-height: min(88vh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
  border: 1px solid #e8ebf1;
}

.hub-erp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #eef1f6;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.hub-erp-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  color: #d70000;
}

.hub-erp-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #141820;
}

.hub-erp-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e2e6ef;
  background: #f7f8fb;
  color: #303848;
  cursor: pointer;
}

.hub-erp-body {
  padding: 16px 20px 8px;
}

.hub-erp-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px 18px;
  border-top: 1px solid #eef1f6;
  position: sticky;
  bottom: 0;
  background: #fff;
}

.hub-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.hub-detail-row {
  background: #f7f8fb;
  border: 1px solid #e8ebf1;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.hub-detail-row span {
  font-size: 11px;
  font-weight: 800;
  color: #8a93a3;
}

.hub-detail-row strong {
  font-size: 13px;
  font-weight: 800;
  color: #1a1f28;
  word-break: break-word;
}

.hub-form-block {
  background: #fff;
  border: 1px solid #e8ebf1;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.hub-form-block.warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
  font-weight: 700;
}

.hub-form-block h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: #141820;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-form-block h4 i {
  color: #d70000;
}

.hub-form-block label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #5c6470;
}

.hub-form-block input,
.hub-form-block textarea,
.hub-form-block select {
  border: 1px solid #dde2ea;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 700;
  color: #1a1f28;
  background: #fff;
}

.hub-form-block input:focus,
.hub-form-block textarea:focus,
.hub-form-block select:focus {
  outline: 2px solid rgba(215, 0, 0, 0.2);
  border-color: #d70000;
}

.hub-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hub-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hub-upload-card {
  border: 1.5px dashed #d7dce6;
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
  min-height: 96px;
}

.hub-upload-card input[type='file'] {
  padding: 8px;
  background: #fff;
}

.hub-upload-card small {
  color: #8a93a3;
  font-weight: 700;
}

.hub-common-meta {
  border-color: rgba(215, 0, 0, 0.22);
  background: linear-gradient(180deg, #fff8f8, #fff);
}

.hub-meta-line {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef1f6;
  font-size: 11px;
  font-weight: 700;
  color: #667080;
}

@media (max-width: 720px) {
  .hub-form-grid,
  .hub-upload-grid {
    grid-template-columns: 1fr;
  }
}

.hub-erp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  color: #fff;
}

.hub-erp-btn.ghost {
  background: #fff;
  color: #303848;
  border: 1px solid #e2e6ef;
}

.hub-erp-btn.red {
  background: #d70000;
}

.hub-erp-btn.blue {
  background: #2563eb;
}

.hub-erp-btn.teal {
  background: #0f766e;
}

.hub-erp-btn.slate {
  background: #475569;
}

.hub-modal-empty {
  text-align: center;
  color: #7a8494;
  font-weight: 800;
  padding: 24px;
}

.hub-toast-mini {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  z-index: 130000;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  max-width: min(92vw, 420px);
  text-align: center;
}

.hub-toast-mini.show {
  opacity: 1;
}

@media (max-width: 640px) {
  .hub-act {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .hub-row-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .hub-detail-grid {
    grid-template-columns: 1fr;
  }

  .hub-erp-modal {
    padding: 10px;
    align-items: flex-end;
  }

  .hub-erp-dialog {
    width: 100%;
    max-height: min(92vh, 860px);
    border-radius: 18px 18px 12px 12px;
  }

  .hub-erp-foot {
    flex-wrap: wrap;
  }

  .hub-erp-btn {
    min-height: 42px;
  }

  .hub-toast-mini {
    bottom: 72px;
  }
}

/* Marketplace link block inside add modal */
.hub-marketplace-block .hub-form-hint { margin: 0 0 10px; color: #6b7280; font-size: 12px; font-weight: 600; }
.hub-mp-grid { display: grid; gap: 8px; }
.hub-mp-row { display: grid; grid-template-columns: minmax(140px, 190px) 1fr; gap: 8px; align-items: center; }
.hub-mp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; margin: 0; }
.hub-mp-row input[type="url"] { width: 100%; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 10px; font: inherit; }
.hub-mp-row[data-mp="amazon"] i,
.hub-mp-row[data-mp="temu"] i,
.hub-mp-row[data-mp="shein"] i {
  font-size: 1.4rem;
  width: 1.4rem;
  text-align: center;
  vertical-align: middle;
}
.hub-mp-row[data-mp="amazon"] .hub-mp-check,
.hub-mp-row[data-mp="temu"] .hub-mp-check,
.hub-mp-row[data-mp="shein"] .hub-mp-check {
  font-size: 13px;
}
@media (max-width: 720px) { .hub-mp-row { grid-template-columns: 1fr; } }

/* Product upload multi-select (appearance places + Hub social) */
.hub-multi-block .hub-form-hint { margin: 0 0 10px; }
.hub-multi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hub-multi-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.hub-multi-chip input { accent-color: #dc2626; }
.hub-multi-chip:has(input:checked) {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}
.hub-form-grid .full-span { grid-column: 1 / -1; }

/* Ad publish targets (home · branches · incubators · platforms) */
.hub-ad-targets-block .hub-form-hint { margin: 0 0 12px; color: #6b7280; font-size: 12px; font-weight: 600; }
.hub-ad-home-chip { margin-bottom: 14px; }
.hub-ad-target-group { margin-top: 14px; }
.hub-ad-target-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.hub-ad-target-head strong { font-size: 13px; }
.hub-ad-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
}

/* Inline ads strips on home / branches / incubators / platforms */
.hub-inline-ads {
  margin: 1.5rem 0 2rem;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
  border: 1px solid #e8eaf0;
}
.hub-inline-ads[hidden] { display: none !important; }
.hub-inline-ads-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.hub-inline-ads-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}
.hub-inline-ads-head a {
  color: #dc2626;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
}
.hub-inline-ads-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.hub-inline-ad {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.hub-inline-ad-media {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 22px;
  overflow: hidden;
}
.hub-inline-ad-media img { width: 100%; height: 100%; object-fit: cover; }
.hub-inline-ad-body h3 { margin: 4px 0; font-size: 14px; font-weight: 900; }
.hub-inline-ad-body p {
  margin: 0;
  color: #667080;
  font-size: 12px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hub-inline-ad-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #991b1b;
  background: #fef2f2;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Ad form — project category then project list */
.hub-project-picker .hub-form-hint.warn { color: #b00010; font-weight: 800; }
.hub-project-cats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}
.hub-project-cat { margin: 0; cursor: pointer; }
.hub-project-cat input { position: absolute; opacity: 0; pointer-events: none; }
.hub-project-cat-face {
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  min-height: 110px;
  padding: 14px 10px;
  border: 1px solid #eadfe2;
  border-radius: 16px;
  background: #fff;
  transition: 0.15s ease;
}
.hub-project-cat-face i {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #faf6f7;
  color: #d70000;
  font-size: 18px;
  border: 1px solid #eadfe2;
}
.hub-project-cat-face strong { font-size: 13px; font-weight: 900; }
.hub-project-cat:has(input:checked) .hub-project-cat-face {
  border-color: #d70000;
  background: #fff5f5;
  box-shadow: 0 8px 18px rgba(215, 0, 0, 0.12);
}
.hub-project-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.hub-project-tools .grow { display: grid; gap: 4px; font-size: 12px; font-weight: 800; }
.hub-project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #f0e4e7;
  border-radius: 12px;
  background: #fafafa;
}
.hub-project-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 10px;
  border: 1px solid #eadfe2;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}
.hub-project-item input { margin-top: 3px; accent-color: #d70000; }
.hub-project-item strong { display: block; font-size: 13px; font-weight: 900; }
.hub-project-item small { color: #777; font-weight: 700; }
.hub-project-item.is-mine { border-color: #0a7a3e; background: #f3fbf6; }
.hub-project-item:has(input:checked) {
  border-color: #d70000;
  background: #fff5f5;
}
@media (max-width: 720px) {
  .hub-project-cats,
  .hub-project-tools { grid-template-columns: 1fr; }
}

.hub-inline-ad-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.hub-inline-ad-foot a { color: #dc2626; font-size: 12px; font-weight: 800; text-decoration: none; }
.hub-inline-ads-empty { margin: 0; color: #6b7280; font-weight: 700; }
@media (max-width: 900px) {
  .hub-inline-ads-grid { grid-template-columns: 1fr; }
}
