/* ---- source style block #ayanArchiveTabsVisibilityFix ---- */
#operationsView .ops-archive-switch{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:7px !important;

  width:100% !important;

  margin:0 0 16px !important;
  padding:6px !important;

  box-sizing:border-box !important;

  border:1px solid #dbe4ee !important;
  border-radius:13px !important;

  background:#f8fafc !important;
}

#operationsView .ops-archive-switch > button{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:5px !important;

  width:100% !important;
  min-width:0 !important;
  min-height:42px !important;

  padding:8px 10px !important;

  border:1px solid transparent !important;
  border-radius:9px !important;

  background:#fff !important;
  color:#475569 !important;

  font-weight:800 !important;
  font-size:12px !important;

  white-space:normal !important;
  text-align:center !important;

  cursor:pointer !important;
}

#operationsView .ops-archive-switch > button.active{
  background:#0f766e !important;
  color:#fff !important;
  border-color:#0f766e !important;

  box-shadow:
    0 5px 14px rgba(15,118,110,.18) !important;
}

#operationsView .ops-archive-count{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;

  min-width:22px !important;
  height:22px !important;

  padding:0 6px !important;

  border-radius:999px !important;

  background:#e2e8f0 !important;
  color:#334155 !important;

  font-size:10px !important;
}

#operationsView .ops-archive-switch > button.active .ops-archive-count{
  background:rgba(255,255,255,.22) !important;
  color:#fff !important;
}

/* Operations native dark theme */
#operationsView[data-theme="dark"] .ops-archive-switch{
  background:#0f172a !important;
  border-color:#334155 !important;
}

#operationsView[data-theme="dark"] .ops-archive-switch > button{
  background:#182235 !important;
  color:#cbd5e1 !important;
  border-color:#334155 !important;
}

#operationsView[data-theme="dark"] .ops-archive-switch > button.active{
  background:#0f766e !important;
  border-color:#14b8a6 !important;
  color:#fff !important;
}

@media(max-width:520px){

  #operationsView .ops-archive-switch{
    grid-template-columns:1fr 1fr !important;
    gap:5px !important;
    padding:5px !important;
  }

  #operationsView .ops-archive-switch > button{
    min-height:44px !important;
    padding:6px !important;
    font-size:10px !important;
    line-height:1.35 !important;
  }

}

/* ---- source style block #ayanManualArchiveButtonsStyle ---- */
#operationsView .ops-archive-btn{
  background:#0f766e !important;
  border-color:#0f766e !important;
  color:#fff !important;
}

#operationsView .ops-archive-btn:hover{
  background:#115e59 !important;
}

#operationsView .ops-unarchive-btn{
  background:#e2e8f0 !important;
  border-color:#cbd5e1 !important;
  color:#334155 !important;
}

#operationsView[data-theme="dark"] .ops-unarchive-btn{
  background:#26364c !important;
  border-color:#475569 !important;
  color:#e2e8f0 !important;
}

@media(max-width:700px){

  #operationsView .ops-manual-archive-btn{
    width:100% !important;
    min-height:36px !important;
    margin-top:5px !important;
  }

}

/* ---- source style block #ayanMaintenanceFolderNumberStyle ---- */
#operationsView .ops-project-folder{
  position:relative !important;
  padding-top:18px !important;
}

#operationsView .ops-project-number{
  position:absolute;
  top:9px;
  left:9px;

  min-width:38px;
  height:28px;

  display:flex;
  align-items:center;
  justify-content:center;

  padding:0 8px;

  border-radius:9px;

  background:#0f766e;
  color:#fff;

  font-size:12px;
  font-weight:900;
  letter-spacing:.5px;

  box-shadow:0 5px 12px rgba(15,118,110,.18);
}

#operationsView[data-theme="dark"] .ops-project-number{
  background:#14b8a6;
  color:#062d2a;
}

@media(max-width:520px){

  #operationsView .ops-project-number{
    min-width:34px;
    height:25px;
    font-size:11px;
    top:7px;
    left:7px;
  }

}

/* ---- source style block #ayanUnifiedSettingsSaveStyle ---- */
#saveClientSettingsBtn.ayan-unified-settings-save{
  min-height:44px !important;
  padding:10px 18px !important;
  border-radius:11px !important;
  font-weight:900 !important;
  font-size:13px !important;
  box-shadow:0 7px 18px rgba(22,163,74,.16) !important;
  position:relative !important;
  z-index:5 !important;
}

@media(max-width:700px){

  #saveClientSettingsBtn.ayan-unified-settings-save{
    width:100% !important;
    min-height:46px !important;
    margin-top:8px !important;
  }

}

/* ---- source style block #ayanMobileGFloatingFix ---- */
@media(max-width:700px){

  /* Move G away from bottom action buttons */
  #opsGlobalG{
    left:12px !important;
    right:auto !important;
    bottom:82px !important;

    width:auto !important;
    max-width:none !important;

    z-index:9500 !important;
  }

  /* Compact floating button */
  #opsGlobalGButton{
    width:54px !important;
    min-width:54px !important;
    max-width:54px !important;

    height:54px !important;
    min-height:54px !important;

    padding:0 !important;

    border-radius:50% !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    overflow:hidden !important;

    box-shadow:
      0 8px 24px rgba(15,23,42,.22) !important;
  }

  /* Hide long text inside G button on phones */
  #opsGlobalGButtonContext,
  #opsGlobalGButton strong,
  #opsGlobalGButton small,
  #opsGlobalGButton span:not(.ops-global-g-avatar){
    display:none !important;
  }

  #opsGlobalGButton img{
    width:34px !important;
    height:34px !important;
    object-fit:contain !important;
  }

  /* Give pages safe bottom space for fixed controls */
  #taxonomyView,
  #controlView,
  #operationsView,
  #socialClientsSubView{
    padding-bottom:100px !important;
  }

  /* Unified settings save button stays fully reachable */
  #saveClientSettingsBtn{
    position:relative !important;
    z-index:20 !important;

    margin-bottom:16px !important;
  }

}

/* ---- source style block #ayanGOverlapFinal900Fix ---- */
/* =========================================================
   G COMPACT MODE — PHONE + SMALL TABLET
   ========================================================= */

@media(max-width:900px){

  #opsGlobalG.ops-global-g{
    position:fixed !important;

    left:12px !important;
    right:auto !important;
    bottom:92px !important;

    width:58px !important;
    min-width:58px !important;
    max-width:58px !important;

    height:58px !important;

    margin:0 !important;
    padding:0 !important;

    z-index:99999 !important;
  }

  #opsGlobalGButton.ops-global-g-button{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    width:58px !important;
    min-width:58px !important;
    max-width:58px !important;

    height:58px !important;
    min-height:58px !important;
    max-height:58px !important;

    margin:0 !important;
    padding:4px !important;

    border-radius:50% !important;

    overflow:hidden !important;
  }

  /* Hide the ACTUAL text wrapper */
  #opsGlobalGButton .ops-global-g-button-text{
    display:none !important;
    width:0 !important;
    max-width:0 !important;
    overflow:hidden !important;
  }

  #opsGlobalGButton img{
    display:block !important;

    width:48px !important;
    min-width:48px !important;
    max-width:48px !important;

    height:48px !important;
    min-height:48px !important;
    max-height:48px !important;

    margin:0 !important;
    padding:0 !important;

    object-fit:cover !important;
  }

  /* Keep bottom controls clear */
  #taxonomyView{
    padding-bottom:145px !important;
  }

  #saveClientSettingsBtn{
    position:relative !important;

    width:100% !important;
    max-width:none !important;

    margin:14px 0 28px !important;

    z-index:50 !important;
  }

}


/* Slightly larger compact mode for tablet */
@media(min-width:701px) and (max-width:900px){

  #opsGlobalG.ops-global-g{
    bottom:88px !important;
  }

}

/* ---- source style block #ayanSettingsSaveTopFix ---- */
/* =========================================================
   SETTINGS SAVE BUTTON — TOP / STICKY
   ========================================================= */

#taxonomyView{
  position:relative !important;
}

/* move save button to a safe visible area */
#saveClientSettingsBtn{
  position:sticky !important;
  top:12px !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  width:auto !important;
  min-width:180px !important;

  margin:0 0 16px auto !important;

  z-index:8000 !important;

  box-shadow:
    0 8px 22px rgba(22,163,74,.18) !important;
}

/* mobile */
@media(max-width:900px){

  #saveClientSettingsBtn{
    position:sticky !important;
    top:8px !important;

    width:100% !important;
    min-width:0 !important;

    margin:0 0 14px !important;

    min-height:46px !important;

    border-radius:11px !important;

    z-index:8000 !important;
  }

}

/* ---- source style block #ayanTopActionsLayoutV1 ---- */
/* =========================================================
   SETTINGS SAVE — CENTERED TOP ACTION
   ========================================================= */

#ayanSettingsSaveCenterHost{
  display:flex;
  align-items:center;
  justify-content:center;

  width:100%;

  margin:12px 0 18px;
  padding:0 12px;

  box-sizing:border-box;
}

#ayanSettingsSaveCenterHost #saveClientSettingsBtn{
  position:relative !important;

  width:auto !important;
  min-width:210px !important;
  max-width:360px !important;

  margin:0 !important;

  z-index:20 !important;
}


/* =========================================================
   CLIENT DISTRIBUTION — TOP ACTION BAR
   ========================================================= */

#ayanDistributionTopActions{
  display:flex;
  align-items:center;
  justify-content:center;

  gap:10px;
  flex-wrap:wrap;

  width:100%;

  margin:12px 0 18px;
  padding:10px;

  box-sizing:border-box;

  border:1px solid #dbe4ee;
  border-radius:13px;

  background:#f8fafc;
}

#ayanDistributionTopActions button{
  min-height:42px;

  padding:9px 16px;

  border-radius:10px;

  font-weight:800;
}


/* Dark */
body:not(.theme-light) #ayanDistributionTopActions{
  background:#0f172a;
  border-color:#334155;
}


/* Mobile */
@media(max-width:700px){

  #ayanSettingsSaveCenterHost{
    margin:10px 0 14px;
    padding:0 8px;
  }

  #ayanSettingsSaveCenterHost #saveClientSettingsBtn{
    width:min(86%,320px) !important;
    min-width:0 !important;
  }

  #ayanDistributionTopActions{
    display:grid;
    grid-template-columns:1fr 1fr;

    gap:7px;

    margin:10px 0 14px;
    padding:7px;
  }

  #ayanDistributionTopActions button{
    width:100% !important;
    min-width:0 !important;

    padding:8px 6px !important;

    font-size:11px !important;
  }

}

/* ---- source style block #ayanSettingsRestoreTopV1 ---- */
#ayanSettingsSaveCenterHost{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}

#ayanSettingsSaveCenterHost button{
  min-height:42px !important;
}

@media(max-width:700px){

  #ayanSettingsSaveCenterHost{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:7px !important;
  }

  #ayanSettingsSaveCenterHost button{
    width:100% !important;
    min-width:0 !important;
    font-size:11px !important;
    padding:8px 6px !important;
  }

}

/* ---- source style block #ayanSettingsButtonsFunctionalStyle ---- */
#ayanSettingsSaveCenterHost,
#ayanSettingsSaveCenterHost *{
  pointer-events:auto !important;
}

#saveClientSettingsBtn,
#restoreClientSettingsBtn{
  position:relative !important;
  z-index:999 !important;

  cursor:pointer !important;
  pointer-events:auto !important;

  touch-action:manipulation !important;
}

#saveClientSettingsBtn:disabled,
#restoreClientSettingsBtn:disabled{
  opacity:.65 !important;
  cursor:wait !important;
}

/* ---- source style block #ayanCategoryScopeStyle ---- */
.taxonomy-row .taxonomy-scope-select{
  min-width:150px;
  min-height:38px;
  padding:6px 9px;
  border-radius:9px;
  border:1px solid #cbd5e1;
  font-weight:700;
}

body:not(.theme-light) .taxonomy-row .taxonomy-scope-select{
  background:#0f172a;
  color:#e2e8f0;
  border-color:#334155;
}

@media(max-width:700px){

  #categoryTaxonomyList .taxonomy-row{
    display:grid !important;
    grid-template-columns:1fr 48px !important;
    gap:7px !important;
  }

  #categoryTaxonomyList .taxonomy-row input[type="text"],
  #categoryTaxonomyList .taxonomy-row .taxonomy-scope-select{
    grid-column:1 / -1;
    width:100% !important;
  }

}

/* ---- source style block #ayanTaxonomyProfessionalLayoutV2 ---- */
/* =========================================================
   AYAN TAXONOMY PROFESSIONAL LAYOUT V2
   ========================================================= */

#taxonomyClientsSubView{
  overflow-x:hidden !important;
}

#taxonomyClientsSubView .page{
  width:100% !important;
  max-width:none !important;
  box-sizing:border-box !important;
}

/* حالتين جنب بعض */
#taxonomyClientsSubView .taxonomy-grid{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  gap:18px !important;
  align-items:start !important;
}

#taxonomyClientsSubView .taxonomy-panel{
  min-width:0 !important;
  width:100% !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}

/* =========================================================
   CATEGORY ROW
   الاسم | اللون | مكان الظهور | حذف
   ========================================================= */

#categoryTaxonomyList{
  display:flex !important;
  flex-direction:column !important;
  gap:9px !important;
  width:100% !important;
}

#categoryTaxonomyList .taxonomy-row{
  width:100% !important;
  min-width:0 !important;

  display:grid !important;
  grid-template-columns:
    minmax(180px,1fr)
    48px
    minmax(130px,155px)
    42px !important;

  align-items:center !important;
  gap:8px !important;

  padding:7px !important;
  margin:0 !important;

  box-sizing:border-box !important;

  border:1px solid #e2e8f0 !important;
  border-radius:12px !important;

  background:#fff !important;
}

/* اسم التصنيف */
#categoryTaxonomyList .taxonomy-row input[type="text"]{
  width:100% !important;
  min-width:0 !important;
  height:42px !important;

  box-sizing:border-box !important;
  margin:0 !important;

  border-radius:9px !important;
}

/* اللون */
#categoryTaxonomyList .taxonomy-row input[type="color"]{
  width:48px !important;
  min-width:48px !important;
  height:42px !important;

  padding:3px !important;
  margin:0 !important;

  box-sizing:border-box !important;
  border-radius:9px !important;
}

/* مكان الظهور */
#categoryTaxonomyList .taxonomy-scope-select{
  width:100% !important;
  min-width:0 !important;
  height:42px !important;

  margin:0 !important;
  padding:0 8px !important;

  box-sizing:border-box !important;

  border:1px solid #cbd5e1 !important;
  border-radius:9px !important;

  font-size:12px !important;
  font-weight:800 !important;
  text-align:center !important;

  background:#f8fafc !important;
  color:#0f172a !important;
}

/* زر الحذف */
#categoryTaxonomyList .taxonomy-row > button{
  position:static !important;

  width:42px !important;
  min-width:42px !important;
  max-width:42px !important;

  height:42px !important;
  min-height:42px !important;

  padding:0 !important;
  margin:0 !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  border:0 !important;
  border-radius:9px !important;

  background:#b91c1c !important;
  color:#fff !important;

  font-size:17px !important;
  font-weight:900 !important;

  cursor:pointer !important;
}

/* =========================================================
   STATUS ROW
   ========================================================= */

#statusTaxonomyList{
  display:flex !important;
  flex-direction:column !important;
  gap:9px !important;
}

#statusTaxonomyList .taxonomy-row{
  width:100% !important;
  min-width:0 !important;

  display:grid !important;
  grid-template-columns:minmax(180px,1fr) 48px 42px !important;

  align-items:center !important;
  gap:8px !important;

  padding:7px !important;
  margin:0 !important;

  box-sizing:border-box !important;

  border:1px solid #e2e8f0 !important;
  border-radius:12px !important;

  background:#fff !important;
}

#statusTaxonomyList .taxonomy-row input[type="text"]{
  width:100% !important;
  min-width:0 !important;
  height:42px !important;
  margin:0 !important;
  box-sizing:border-box !important;
}

#statusTaxonomyList .taxonomy-row input[type="color"]{
  width:48px !important;
  min-width:48px !important;
  height:42px !important;
  margin:0 !important;
  padding:3px !important;
  box-sizing:border-box !important;
}

#statusTaxonomyList .taxonomy-row > button{
  position:static !important;

  width:42px !important;
  min-width:42px !important;
  max-width:42px !important;

  height:42px !important;

  padding:0 !important;
  margin:0 !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  border:0 !important;
  border-radius:9px !important;

  background:#b91c1c !important;
  color:#fff !important;

  font-size:17px !important;
  font-weight:900 !important;
}

/* =========================================================
   DARK MODE
   ========================================================= */

body:not(.theme-light)
#categoryTaxonomyList .taxonomy-row,

body:not(.theme-light)
#statusTaxonomyList .taxonomy-row{
  background:#0f172a !important;
  border-color:#334155 !important;
}

body:not(.theme-light)
#categoryTaxonomyList .taxonomy-scope-select{
  background:#172033 !important;
  color:#e2e8f0 !important;
  border-color:#475569 !important;
}

/* =========================================================
   TABLET
   ========================================================= */

@media(max-width:1100px){

  #taxonomyClientsSubView .taxonomy-grid{
    grid-template-columns:1fr !important;
  }

}

/* =========================================================
   MOBILE
   ========================================================= */

@media(max-width:700px){

  #taxonomyClientsSubView .page{
    padding-left:10px !important;
    padding-right:10px !important;
  }

  #categoryTaxonomyList .taxonomy-row{
    grid-template-columns:
      minmax(0,1fr)
      44px
      40px !important;
  }

  #categoryTaxonomyList
  .taxonomy-row
  input[type="text"]{
    grid-column:1 / -1 !important;
  }

  #categoryTaxonomyList
  .taxonomy-scope-select{
    grid-column:1 / 2 !important;
    grid-row:2 !important;

    width:100% !important;
  }

  #categoryTaxonomyList
  .taxonomy-row
  input[type="color"]{
    grid-column:2 !important;
    grid-row:2 !important;

    width:44px !important;
    min-width:44px !important;
  }

  #categoryTaxonomyList
  .taxonomy-row > button{
    grid-column:3 !important;
    grid-row:2 !important;

    width:40px !important;
    min-width:40px !important;
  }

  #statusTaxonomyList .taxonomy-row{
    grid-template-columns:minmax(0,1fr) 44px 40px !important;
  }

}

/* ---- source style block #ayanOpsMarkAllReadStyle ---- */
#operationsView .ops-notification-mark-all{
  border:0;
  border-radius:10px;
  padding:8px 12px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}

#operationsView[data-theme="dark"] .ops-notification-mark-all{
  background:#1f2937;
  color:#f9fafb;
}

#operationsView[data-theme="light"] .ops-notification-mark-all{
  background:#eef2ff;
  color:#111827;
}

#operationsView .ops-notification-mark-all:hover{
  filter:brightness(.96);
}

/* ---- source style block #ayanOperationsPermanentLogoutStyle ---- */
#operationsView .ops-permanent-logout-btn{
  min-height:42px;
  border:1px solid rgba(220,38,38,.22);
  border-radius:11px;
  padding:9px 14px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}

#operationsView[data-theme="light"]
.ops-permanent-logout-btn{
  background:#fff1f2;
  color:#b91c1c;
}

#operationsView[data-theme="dark"]
.ops-permanent-logout-btn{
  background:#3f171c;
  color:#fecaca;
  border-color:#7f1d1d;
}

#operationsView .ops-permanent-logout-btn:hover{
  filter:brightness(.96);
}

#operationsView .ops-permanent-logout-btn:disabled{
  opacity:.65;
  cursor:wait;
}

@media(max-width:700px){

  #operationsView .ops-permanent-logout-btn{
    padding:9px 11px;
    font-size:12px;
  }

}

/* ---- source style block #ayanNotificationDeepLinkStyle ---- */
#operationsView
.ayan-notification-target-row{
  outline:3px solid rgba(245,158,11,.9) !important;
  outline-offset:-3px;
  box-shadow:
    0 0 0 4px rgba(245,158,11,.15),
    0 8px 28px rgba(15,23,42,.12) !important;
  position:relative;
  z-index:2;
  transition:
    outline .25s ease,
    box-shadow .25s ease;
}

/* رأس القسم الفرعي (عنوان + وصف) */
.subview-head{padding:14px 18px 0}
.subview-head h2{margin:0}
.subview-head p{margin:6px 0 0;color:#94a3b8}

/* ---- source style block #ayan-mobile-clients-fix-v1 ---- */
@media (max-width: 700px) {

  /* =========================
     عملاء السوشيال ميديا
     ========================= */

  #socialClientsSubView {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #socialClientsSubView > .page {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 8px 16px !important;
  }

  .subview-head {
    padding: 18px 10px 4px;
  }

  .subview-head h2 {
    font-size: 16px;
    line-height: 1.35;
  }

  .subview-head p {
    font-size: 11px;
    line-height: 1.6;
  }

  /* تبويبات العملاء */
  #clientsView .clients-subnav {
    padding: 8px !important;
    gap: 6px !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  #clientsView .clients-subnav .clients-subtab {
    flex: 0 0 auto;
    width: auto !important;
    white-space: nowrap;
    font-size: 11.5px !important;
    padding: 8px 10px !important;
  }

  /* شريط الأدوات */
  #socialClientsSubView .toolbar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
  }

  #socialClientsSubView .toolbar button,
  #socialClientsSubView .toolbar input,
  #socialClientsSubView .toolbar select {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    margin: 0 !important;
  }

  #socialClientsSubView .toolbar .status-bar {
    grid-column: 1 / -1;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
  }

  #socialClientsSubView .toolbar .range-hint {
    grid-column: 1 / -1;
    text-align: center;
  }


  /* =========================
     كروت إحصائيات السوشيال
     ========================= */

  #socialClientsSubView .analytics-dashboard {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px !important;
  }

  #socialClientsSubView .analytics-dashboard .dash-card {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
    padding: 11px 9px !important;
    border-radius: 13px !important;
  }

  #socialClientsSubView .analytics-dashboard .dash-card.total-card {
    grid-column: 1 / -1;
  }

  #socialClientsSubView .dash-label {
    font-size: 11px !important;
    line-height: 1.4;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  #socialClientsSubView .dash-value {
    font-size: 21px !important;
    line-height: 1.2;
    margin-top: 5px;
    overflow-wrap: anywhere;
  }

  #socialClientsSubView .dash-percent {
    font-size: 10px !important;
    margin-top: 3px;
  }

  /* التقرير */
  #socialClientsSubView .report-info {
    font-size: 11px !important;
    padding: 8px !important;
    overflow-wrap: anywhere;
  }

  /* Pagination */
  #socialClientsSubView .client-pagination {
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
  }


  /* =========================
     توزيع العملاء
     ========================= */

  #clientDistributionSubView {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #clientDistributionSubView > .page {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px !important;
  }

  #clientDistributionSubView .other-clients-head {
    padding: 4px 4px 10px !important;
  }

  #clientDistributionSubView .other-clients-head h2 {
    font-size: 20px !important;
  }

  #clientDistributionSubView .other-clients-head p {
    font-size: 12px !important;
    line-height: 1.7;
  }

  #clientDistributionSubView .mgmt-card {
    width: 100%;
    box-sizing: border-box;
    padding: 12px !important;
    border-radius: 14px !important;
  }

  #clientDistributionSubView .two-cols {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #clientDistributionSubView .two-cols label {
    min-width: 0;
  }

  #clientDistributionSubView .two-cols select,
  #clientDistributionSubView .two-cols input[type="file"] {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* الموظفون */
  #clientDistributionSubView #distributionEmployees {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
    width: 100%;
    box-sizing: border-box;
  }

  #clientDistributionSubView #distributionEmployees > * {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* كروت ملخص التوزيع */
  #clientDistributionSubView #distributionSummary {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100%;
    box-sizing: border-box;
  }

  #clientDistributionSubView #distributionSummary > * {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
    padding: 10px !important;
    border-radius: 12px !important;
  }

  #clientDistributionSubView #distributionSummary .mgmt-card strong {
    font-size: 20px !important;
    overflow-wrap: anywhere;
  }

  #clientDistributionSubView #distributionSummary .mgmt-card small {
    font-size: 10px !important;
  }

  /* جدول المعاينة */
  #clientDistributionSubView .management-table {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #clientDistributionSubView .management-table table {
    min-width: 620px !important;
    width: 620px !important;
  }

  /* أزرار التوزيع */
  #clientDistributionSubView .mgmt-card > div:last-child {
    width: 100%;
  }

  #clientDistributionSubView .mgmt-card > div:last-child button {
    flex: 1 1 140px;
    min-width: 0;
  }
}

/* ---- source style block #ayanMobileSwitchBtnPlacementV1 ---- */
@media(max-width:900px){
  html body .ayan-main-nav{
    grid-template-columns:minmax(0,1fr) auto auto!important;
    grid-template-areas:"brand switch actions" "user user user"!important;
    align-items:center!important;
  }
  /* الزر يبقى مخفيًا حتى يقرر النظام أن للمستخدم أكثر من منصة */
  html body .ayan-main-nav #ayanCrmSystemSwitchBtn[style*="display: none"],
  html body .ayan-main-nav #ayanCrmSystemSwitchBtn[style*="display:none"]{
    display:none!important;
  }
  html body .ayan-main-nav #ayanCrmSystemSwitchBtn{
    grid-area:switch!important;
    justify-self:end!important;
    align-self:center!important;
    position:static!important;
    width:auto!important;
    min-width:0!important;
    height:38px!important;
    min-height:38px!important;
    margin:0!important;
    padding:0 11px!important;
    border-radius:10px!important;
    font-size:0!important;           /* نخفي النص الطويل */
    line-height:1!important;
    white-space:nowrap!important;
    box-shadow:0 2px 6px rgba(2,132,199,.25)!important;
  }
  html body .ayan-main-nav #ayanCrmSystemSwitchBtn::before{
    content:"⇄ تبديل"!important;
    display:inline!important;
    font-size:12px!important;
    font-weight:800!important;
  }
}
@media(max-width:360px){
  html body .ayan-main-nav #ayanCrmSystemSwitchBtn{padding:0 8px!important}
  html body .ayan-main-nav #ayanCrmSystemSwitchBtn::before{content:"⇄"!important;font-size:16px!important}
}

/* ---- source style block #ayanExecMobileNavV1 ---- */
@media(max-width:700px){
  .ayan-exec-mobnav{
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:8px!important;
    padding:10px!important;
    align-items:stretch!important;
  }
  .ayan-exec-mobnav > *{margin:0!important;min-width:0!important;width:auto!important;max-width:none!important}
  /* التنقل بين الأنظمة */
  .ayan-exec-mobnav > [data-ayan-exec-slot="dash"],
  .ayan-exec-mobnav > [data-ayan-exec-slot="ops"],
  .ayan-exec-mobnav > [data-ayan-exec-slot="crm"]{grid-column:span 2!important}
  .ayan-exec-mobnav [data-ayan-exec-nav="dash"],
  .ayan-exec-mobnav [data-ayan-exec-nav="ops"],
  .ayan-exec-mobnav [data-ayan-exec-nav="crm"]{
    width:100%!important;height:66px!important;min-height:66px!important;
    padding:6px 4px!important;border-radius:14px!important;
    display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;
    font-size:12px!important;font-weight:800!important;line-height:1.25!important;white-space:normal!important;text-align:center!important;
  }
  .ayan-exec-mobnav [data-ayan-exec-nav] .ayan-exec-ico{display:block;font-size:20px;line-height:1}
  /* الأدوات */
  .ayan-exec-mobnav > [data-ayan-exec-slot="refresh"],
  .ayan-exec-mobnav > [data-ayan-exec-slot="theme"],
  .ayan-exec-mobnav > [data-ayan-exec-slot="logout"]{grid-column:span 2!important}
  .ayan-exec-mobnav [data-ayan-exec-nav="refresh"],
  .ayan-exec-mobnav [data-ayan-exec-nav="theme"],
  .ayan-exec-mobnav [data-ayan-exec-nav="logout"]{
    width:100%!important;height:42px!important;min-height:42px!important;
    padding:0 6px!important;border-radius:11px!important;
    font-size:12px!important;font-weight:800!important;white-space:nowrap!important;
    display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;
  }
  .ayan-exec-mobnav [data-ayan-exec-nav="logout"]{
    background:transparent!important;color:#f87171!important;border:1.5px solid #f87171!important;box-shadow:none!important;
  }
  /* إدارة المنظومة */
  .ayan-exec-mobnav > [data-ayan-exec-slot="admin"]{grid-column:1 / -1!important}
  .ayan-exec-mobnav [data-ayan-exec-nav="admin"]{padding:9px 12px!important;border-radius:13px!important;min-height:0!important}
  .ayan-exec-mobnav [data-ayan-exec-nav="admin"] *{font-size:13px!important}
  .ayan-exec-mobnav [data-ayan-exec-nav="admin"] small,
  .ayan-exec-mobnav [data-ayan-exec-nav="admin"] p,
  .ayan-exec-mobnav [data-ayan-exec-nav="admin"] span{font-size:11px!important}
}

/* ---- source style block #ayanUsersTableFixV1 ---- */
/* جدول المستخدمين: أزرار الإجراء في سطر واحد بشكل موحّد */
#m3UsersBody .m3-user-actions{
  display:flex;align-items:center;gap:6px;justify-content:flex-start;flex-wrap:nowrap;
}
#m3UsersBody .m3-user-actions button{
  height:32px;padding:0 12px;border-radius:8px;border:1px solid transparent;
  font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer;line-height:1;
}
#m3UsersBody .m3-user-edit{background:#2563eb;color:#fff}
#m3UsersBody .m3-user-edit:hover{background:#1d4ed8}
#m3UsersBody .m3-user-delete{
  background:transparent;color:#dc2626;border-color:#dc2626;
}
#m3UsersBody .m3-user-delete:hover{background:#dc2626;color:#fff}
/* الأعمدة لا تتمدد بلا داعٍ */
#m3UsersBody td{vertical-align:middle;padding:10px 12px}
@media(max-width:900px){
  #m3UsersBody .m3-user-actions{flex-wrap:wrap;gap:6px}
  #m3UsersBody .m3-user-actions button{flex:1 1 auto;min-width:96px}
}

/* ---- source style block #ayanHeaderLayoutFixV4 ---- */
/* الهيدر: صف علوي واحد لا يلتف (شعار + أدوات المستخدم)، وسطر تبويبات تحته.
   يصلح لأي عدد تبويبات ولأي عدد أزرار بين المستخدمين. */
@media(min-width:901px){
  html body .ayan-main-nav{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:10px!important;
    padding:10px 18px!important;
    overflow:visible!important;
  }
  html body .ayan-main-nav > .ayan-brand{
    order:1!important;flex:0 0 auto!important;margin:0!important;
  }
  /* حاوية غير مرئية تجمع كل الأزرار في سطر واحد أفقي */
  html body .ayan-main-nav > .ayan-header-tools{
    order:2!important;
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:10px!important;
    margin-inline-start:auto!important;
    flex:0 0 auto!important;
  }
  html body .ayan-main-nav > .ayan-header-tools > *{
    margin:0!important;position:static!important;float:none!important;flex:0 0 auto!important;
  }
  html body .ayan-main-nav > .ayan-tabs{
    order:3!important;
    flex:1 1 100%!important;
    display:flex!important;
    flex-wrap:wrap!important;
    gap:7px!important;
    width:100%!important;
    max-width:none!important;
    overflow:visible!important;
    margin:0!important;
  }
  html body .ayan-main-nav .ayan-tab{
    flex:0 0 auto!important;white-space:nowrap!important;
    font-size:12.5px!important;padding:8px 12px!important;line-height:1.2!important;
  }
}
@media(min-width:901px) and (max-width:1500px){
  html body .ayan-main-nav .ayan-tab{font-size:11.5px!important;padding:7px 10px!important}
}

/* ---- source style block #ayanFloatingWidgetsSmartV1 ---- */
/* الأزرار العائمة (جي + لوحة المدير): تصغر وتبهت أثناء التمرير،
   وتعود كاملة عند التوقف أو الاقتراب منها. كمبيوتر وجوال. */
#opsGlobalG,
#ayanExecutiveReturnBtn{
  transition:transform .22s ease, opacity .22s ease!important;
  transform-origin:bottom center;
  will-change:transform,opacity;
}
/* الوضع الهادئ: باهت وأصغر */
html.ayan-fw-idle #opsGlobalG,
html.ayan-fw-idle #ayanExecutiveReturnBtn{
  opacity:.38!important;
  transform:scale(.72)!important;
}
/* أثناء التمرير: أصغر وأبهت */
html.ayan-fw-scrolling #opsGlobalG,
html.ayan-fw-scrolling #ayanExecutiveReturnBtn{
  opacity:.22!important;
  transform:scale(.55)!important;
  pointer-events:none!important;
}
/* عند الاقتراب أو اللمس: كامل الوضوح */
#opsGlobalG:hover,
#opsGlobalG:focus-within,
#ayanExecutiveReturnBtn:hover,
#ayanExecutiveReturnBtn:focus,
html.ayan-fw-awake #opsGlobalG,
html.ayan-fw-awake #ayanExecutiveReturnBtn{
  opacity:1!important;
  transform:scale(1)!important;
  pointer-events:auto!important;
}
/* أثناء فتح محادثة جي لا نصغّرها إطلاقًا */
html.ayan-g-open #opsGlobalG{
  opacity:1!important;transform:none!important;pointer-events:auto!important;
}
/* زر لوحة المدير: نص أصغر ومساحة أقل حتى في وضعه الكامل */
#ayanExecutiveReturnBtn{
  padding:8px 14px!important;
  font-size:12.5px!important;
  border-radius:999px!important;
}
@media(max-width:700px){
  #ayanExecutiveReturnBtn{padding:7px 12px!important;font-size:11.5px!important}
  /* في الجوال يتقلص زر لوحة المدير لأيقونة أثناء التمرير */
  html.ayan-fw-scrolling #ayanExecutiveReturnBtn span{display:none!important}
}

/* ---- source style block #ayanGDockRightV1 ---- */
/* جي يرسو في طرف اليمين بعيدًا عن عمود الإجراءات،
   ويبقى مختفيًا خلف الحافة حتى يُضغط عليه. */
html body #opsGlobalG.ops-global-g,
html body #opsGlobalG{
  left:auto!important;
  right:0!important;
  bottom:96px!important;
  transition:transform .25s ease, opacity .25s ease!important;
}
/* الوضع المرسو: يختفي خلف الحافة ويظهر طرفه فقط */
html.ayan-g-docked body #opsGlobalG{
  transform:translateX(62%)!important;
  opacity:.55!important;
}
html.ayan-g-docked body #opsGlobalG:hover,
html.ayan-g-docked body #opsGlobalG:focus-within{
  transform:translateX(0)!important;
  opacity:1!important;
}
/* عند فتح المحادثة يخرج كاملًا */
html.ayan-g-open body #opsGlobalG{
  transform:translateX(0)!important;
  opacity:1!important;
}
/* اللوحة مثبتة على الشاشة نفسها لا على زر جي،
   حتى لا ترث إزاحة الزر وتخرج خارج حدود الشاشة. */
html body .ops-global-g-panel{
  position:fixed!important;
  left:auto!important;
  right:18px!important;
  bottom:96px!important;
  width:min(410px,calc(100vw - 36px))!important;
  max-width:calc(100vw - 36px)!important;
  height:min(640px,calc(100vh - 150px))!important;
  transform:none!important;
  box-sizing:border-box!important;
  z-index:10050!important;
}
@media(max-width:700px){
  html body #opsGlobalG.ops-global-g,
  html body #opsGlobalG{
    right:0!important;left:auto!important;bottom:88px!important;
  }
  html.ayan-g-docked body #opsGlobalG{transform:translateX(58%)!important}
  html body .ops-global-g-panel{
    position:fixed!important;
    left:8px!important;right:8px!important;bottom:8px!important;
    width:auto!important;max-width:none!important;
    height:min(78vh,700px)!important;
  }
}
/* زر لوحة المدير يبقى في الشمال ولا يزاحم جي */
html body #ayanExecutiveReturnBtn{
  left:16px!important;right:auto!important;
}

/* ---- source style block #ayanSafeResponsiveGFixV1 ---- */
/* Final visual-only responsive correction for G. Existing G logic is untouched. */
html,body{max-width:100%;overflow-x:hidden!important}

/* Desktop */
@media (min-width:701px){
  html body #opsGlobalG.ops-global-g{
    position:fixed!important;
    left:auto!important;
    right:14px!important;
    bottom:24px!important;
    z-index:10040!important;
  }
  html body #opsGlobalGPanel,
  html body .ops-global-g-panel{
    position:fixed!important;
    left:auto!important;
    right:18px!important;
    bottom:18px!important;
    width:min(410px,calc(100vw - 36px))!important;
    max-width:calc(100vw - 36px)!important;
    height:min(640px,calc(100vh - 36px))!important;
    max-height:calc(100vh - 36px)!important;
    box-sizing:border-box!important;
    transform:none!important;
    z-index:10050!important;
  }
  html.ayan-g-docked body #opsGlobalG{transform:translateX(58%)!important}
  html.ayan-g-open body #opsGlobalG{transform:none!important;opacity:1!important}
}

/* Phone / small tablet */
@media (max-width:700px){
  html body #opsGlobalG.ops-global-g{
    position:fixed!important;
    left:auto!important;
    right:12px!important;
    bottom:78px!important;
    width:56px!important;
    min-width:56px!important;
    max-width:56px!important;
    height:56px!important;
    margin:0!important;
    padding:0!important;
    z-index:10040!important;
    transform:none!important;
  }
  html body #opsGlobalGButton{
    width:56px!important;min-width:56px!important;max-width:56px!important;
    height:56px!important;min-height:56px!important;
    padding:3px!important;margin:0!important;border-radius:50%!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    overflow:hidden!important;
  }
  html body #opsGlobalGButton .ops-global-g-button-text{display:none!important}
  html body #opsGlobalGButton img{
    display:block!important;width:46px!important;height:46px!important;
    min-width:46px!important;max-width:46px!important;
    min-height:46px!important;max-height:46px!important;
    margin:0!important;object-fit:cover!important;
  }
  html body #opsGlobalGPanel,
  html body .ops-global-g-panel{
    position:fixed!important;
    left:8px!important;right:8px!important;bottom:8px!important;
    top:auto!important;width:auto!important;max-width:none!important;
    height:min(78vh,700px)!important;
    max-height:calc(100vh - 16px)!important;
    min-height:340px!important;
    margin:0!important;box-sizing:border-box!important;
    border-radius:16px!important;transform:none!important;
    z-index:10050!important;
  }
  html.ayan-g-open body #opsGlobalG{transform:none!important;opacity:1!important}
  html.ayan-g-open body #opsGlobalGPanel,
  html.ayan-g-open body .ops-global-g-panel{transform:none!important}
}

@media (max-width:380px){
  html body #opsGlobalG.ops-global-g,
  html body #opsGlobalGButton{width:52px!important;min-width:52px!important;max-width:52px!important;height:52px!important}
  html body #opsGlobalG.ops-global-g{bottom:70px!important;right:10px!important}
  html body #opsGlobalGButton img{width:43px!important;height:43px!important;min-width:43px!important;max-width:43px!important;min-height:43px!important;max-height:43px!important}
  html body #opsGlobalGPanel,
  html body .ops-global-g-panel{left:5px!important;right:5px!important;bottom:5px!important;height:82vh!important;max-height:calc(100vh - 10px)!important}
}

/* ---- source style block #ayan-mobile-g-final-fix ---- */
@media (max-width:700px){

  /* تثبيت الحاوية الرئيسية لـ G داخل الشاشة */
  html body #opsGlobalG,
  html body #opsGlobalG.ops-global-g{
    position:fixed !important;
    left:auto !important;
    right:10px !important;
    bottom:75px !important;

    width:56px !important;
    min-width:56px !important;
    max-width:56px !important;

    height:56px !important;
    min-height:56px !important;
    max-height:56px !important;

    margin:0 !important;
    padding:0 !important;

    transform:none !important;
    opacity:1 !important;

    overflow:visible !important;
    z-index:999999 !important;

    transition:none !important;
  }

  /* زر G */
  html body #opsGlobalGButton{
    width:56px !important;
    min-width:56px !important;
    max-width:56px !important;

    height:56px !important;
    min-height:56px !important;
    max-height:56px !important;

    margin:0 !important;
    padding:3px !important;

    border-radius:50% !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    overflow:hidden !important;
    transform:none !important;
  }

  /* إخفاء النص داخل زر G */
  html body #opsGlobalGButton .ops-global-g-button-text,
  html body #opsGlobalGButtonContext,
  html body #opsGlobalGButton strong,
  html body #opsGlobalGButton small{
    display:none !important;
  }

  /* صورة G */
  html body #opsGlobalGButton img{
    display:block !important;

    width:46px !important;
    min-width:46px !important;
    max-width:46px !important;

    height:46px !important;
    min-height:46px !important;
    max-height:46px !important;

    margin:0 !important;
    padding:0 !important;

    object-fit:cover !important;
    transform:none !important;
  }

  /* منع وضع dock القديم من إخراج G خارج الشاشة */
  html.ayan-g-docked body #opsGlobalG{
    left:auto !important;
    right:10px !important;
    transform:none !important;
    opacity:1 !important;
  }

  /* عند فتح G */
  html.ayan-g-open body #opsGlobalG{
    left:auto !important;
    right:10px !important;
    transform:none !important;
    opacity:1 !important;
  }

  /* لوحة المحادثة */
  html body #opsGlobalGPanel,
  html body .ops-global-g-panel{
    position:fixed !important;

    left:8px !important;
    right:8px !important;

    top:auto !important;
    bottom:8px !important;

    width:auto !important;
    max-width:none !important;

    height:min(78vh,700px) !important;
    max-height:calc(100vh - 16px) !important;
    min-height:340px !important;

    margin:0 !important;
    box-sizing:border-box !important;

    border-radius:16px !important;
    transform:none !important;

    z-index:1000000 !important;
  }
}

/* الشاشات الصغيرة جداً */
@media (max-width:380px){

  html body #opsGlobalG,
  html body #opsGlobalG.ops-global-g{
    right:8px !important;
    bottom:68px !important;

    width:52px !important;
    min-width:52px !important;
    max-width:52px !important;

    height:52px !important;
    min-height:52px !important;
    max-height:52px !important;
  }

  html body #opsGlobalGButton{
    width:52px !important;
    min-width:52px !important;
    max-width:52px !important;

    height:52px !important;
    min-height:52px !important;
    max-height:52px !important;
  }

  html body #opsGlobalGButton img{
    width:43px !important;
    min-width:43px !important;
    max-width:43px !important;

    height:43px !important;
    min-height:43px !important;
    max-height:43px !important;
  }
}

/* منع أي حركة أفقية تسبب قص العنصر */
@media (max-width:700px){

  html body #opsGlobalG,
  html body #opsGlobalGButton,
  html body #opsGlobalGPanel,
  html body .ops-global-g-panel{
    translate:none !important;
  }

}

/* ---- source style block #ayan-g-mobile-portal-fix-v2 ---- */
/* الجوال */
@media (max-width:700px){

  /* لوحة G أصبحت مستقلة عن حاوية الزر */
  body > #opsGlobalGPanel,
  html body #opsGlobalGPanel.ayan-g-portal-panel{
    position:fixed !important;

    left:8px !important;
    right:8px !important;
    top:auto !important;
    bottom:8px !important;

    width:auto !important;
    max-width:none !important;

    height:min(78vh,700px) !important;
    max-height:calc(100dvh - 16px) !important;
    min-height:340px !important;

    margin:0 !important;
    padding:0 !important;

    box-sizing:border-box !important;

    transform:none !important;
    translate:none !important;

    opacity:1 !important;
    visibility:visible !important;

    overflow:hidden !important;

    border-radius:18px !important;

    z-index:2000000 !important;
  }

  /* عند فتح G، لا توجد أي حركة للزر نفسه */
  html.ayan-g-open body #opsGlobalG{
    transform:none !important;
    opacity:1 !important;
    pointer-events:auto !important;
  }

  /* الزر */
  html body #opsGlobalG,
  html body #opsGlobalG.ops-global-g{
    position:fixed !important;

    left:auto !important;
    right:10px !important;
    bottom:75px !important;

    width:56px !important;
    min-width:56px !important;
    max-width:56px !important;

    height:56px !important;
    min-height:56px !important;
    max-height:56px !important;

    transform:none !important;
    translate:none !important;

    opacity:1 !important;

    z-index:1999990 !important;
  }

}


/* جوال صغير */
@media (max-width:380px){

  body > #opsGlobalGPanel,
  html body #opsGlobalGPanel.ayan-g-portal-panel{
    left:5px !important;
    right:5px !important;
    bottom:5px !important;

    height:82vh !important;
    max-height:calc(100dvh - 10px) !important;

    min-height:320px !important;
  }

  html body #opsGlobalG,
  html body #opsGlobalG.ops-global-g{
    right:8px !important;
    bottom:68px !important;

    width:52px !important;
    min-width:52px !important;
    max-width:52px !important;

    height:52px !important;
    min-height:52px !important;
    max-height:52px !important;
  }

}


/* =============================================================================
   زر G على الجوال (<=700px): تعريف واحد نهائي — CSS فقط، بدون مؤقتات أو JS.
   الحجم 44px، ملتصق بحافة الشاشة ونصفه تقريبًا مخفي وشفاف، ويظهر كاملًا
   عند اللمس أو عند فتح محادثة جي. لا يظهر قبل تسجيل الدخول
   (body.auth-pending #opsGlobalG مخفي في index.html).
   الكمبيوتر (>700px) لا يتأثر.
   ============================================================================= */
@media (max-width:700px){
  html body #opsGlobalG.ops-global-g:not(.x){
    position:fixed !important;
    left:auto !important;
    right:0 !important;
    bottom:calc(76px + env(safe-area-inset-bottom,0px)) !important;
    width:44px !important;min-width:44px !important;max-width:44px !important;
    height:44px !important;min-height:44px !important;max-height:44px !important;
    margin:0 !important;padding:0 !important;
    transform:translateX(40%) !important;
    opacity:.78 !important;
    animation:none !important;
    transition:transform .18s ease,opacity .18s ease !important;
    z-index:999999 !important;
    pointer-events:auto !important;
  }
  html body #opsGlobalG.ops-global-g:not(.x):active,
  html.ayan-g-open body #opsGlobalG.ops-global-g:not(.x){
    transform:none !important;
    opacity:1 !important;
  }
  html body #opsGlobalG.ops-global-g:not(.x) #opsGlobalGButton{
    width:44px !important;min-width:44px !important;max-width:44px !important;
    height:44px !important;min-height:44px !important;max-height:44px !important;
    margin:0 !important;padding:2px !important;border-radius:50% !important;
    display:flex !important;align-items:center !important;justify-content:center !important;
    overflow:hidden !important;transform:none !important;animation:none !important;
  }
  html body #opsGlobalG.ops-global-g:not(.x) #opsGlobalGButton img{
    display:block !important;
    width:38px !important;min-width:38px !important;max-width:38px !important;
    height:38px !important;min-height:38px !important;max-height:38px !important;
    margin:0 !important;padding:0 !important;object-fit:cover !important;transform:none !important;
  }
  /* مساحة فاضية أسفل الصفحة حتى لا يغطي الزر آخر الصفوف */
  html body .ayan-system-shell,
  html body .ops-shell{padding-bottom:84px !important}
}

/* =============================================================================
   صفحات العملاء على الجوال (<=700px): عملاء القنوات المختلفة + عملاء السوشيال ميديا.
   تعريف واحد مشترك ومقيَّد بالصفحتين: تحديد جماعي يظهر عند اختيار عميل،
   تبويبات أفقية، مؤشرات مضغوطة، وبطاقة عميل مضغوطة (اسم + هاتف ثم عمودان).
   الكمبيوتر لا يتأثر.
   ============================================================================= */
@media (max-width:700px){
  /* ---- رأس عملاء القنوات المختلفة + الأزرار ---- */
  :is(#otherClientsSubView,#campaignListsSubView) .other-clients-head p{font-size:12px !important;line-height:1.6 !important;margin-top:3px !important}
  :is(#otherClientsSubView,#campaignListsSubView) .other-clients-head > div:last-child{
    display:grid !important;grid-template-columns:1fr 1fr !important;gap:6px !important;width:100% !important}
  :is(#otherClientsSubView,#campaignListsSubView) .other-clients-head button{min-height:40px !important;font-size:12.5px !important;padding:6px 8px !important}

  /* ---- شريط الأدوات (عمودان) ---- */
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .toolbar{grid-template-columns:1fr 1fr !important;gap:6px !important;padding:8px !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .toolbar .status-bar,
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .toolbar .range-hint,
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) #nameSearch{grid-column:1 / -1 !important}
  :is(#otherClientsSubView,#campaignListsSubView) .toolbar button:not(.panel-toggle){grid-column:1 / -1 !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .toolbar button:not(.panel-toggle){min-height:36px !important;font-size:12.5px !important;padding:4px 6px !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .toolbar input,
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .toolbar select{min-height:38px !important;font-size:13px !important;min-width:0 !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .toolbar .status-bar,
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .toolbar .range-hint{font-size:11px !important;text-align:start !important}

  /* ---- التحديد الجماعي: انظر .bulk-actions-panel أدناه ---- */

  /* ---- المؤشرات ---- */
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .analytics-dashboard{gap:6px !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .dash-card{padding:7px 10px !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .dash-value{font-size:20px !important}
  #socialClientsSubView .dash-card{
    display:grid !important;grid-template-columns:1fr auto !important;align-items:center !important;
    column-gap:6px !important;row-gap:0 !important;min-height:0 !important}
  #socialClientsSubView .dash-card .dash-label{grid-column:1 / -1 !important}
  #socialClientsSubView .dash-card .dash-percent{margin:0 !important;justify-self:end}
  :is(#otherClientsSubView,#campaignListsSubView) .dash-card .dash-percent{display:none !important}
  #socialClientsSubView .dash-card .dash-percent{font-size:11px !important;padding:2px 8px !important}

  /* ---- التبويبات السريعة (عملاء القنوات المختلفة) ---- */
  :is(#otherClientsSubView,#campaignListsSubView) .other-quick-tabs{
    display:flex !important;flex-wrap:nowrap !important;overflow-x:auto !important;gap:8px !important;
    padding-bottom:4px !important;-webkit-overflow-scrolling:touch}
  :is(#otherClientsSubView,#campaignListsSubView) .other-quick-tabs button{
    flex:0 0 auto !important;width:auto !important;min-height:36px !important;white-space:nowrap !important;padding:6px 12px !important;font-size:12.5px !important}

  /* ---- بطاقة العميل ---- */
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards tr{
    display:grid !important;grid-template-columns:1fr 1fr !important;position:relative !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td{
    display:flex !important;flex-direction:column !important;align-items:stretch !important;gap:2px !important;
    padding:6px 10px !important;border-bottom:0 !important;grid-template-columns:none !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td::before{font-size:10px !important}
  /* م: مخفي — التحديد: زاوية البطاقة */
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td:nth-child(1){display:none !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="تحديد"]{
    position:absolute !important;top:8px !important;left:8px !important;width:auto !important;padding:0 !important;z-index:1}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="تحديد"]::before{display:none !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="تحديد"] input{width:24px !important;height:24px !important}
  /* الاسم والهاتف بعرض كامل بلا عنوان */
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="اسم العميل"]{
    grid-column:1 / -1 !important;font-size:16px !important;font-weight:800 !important;padding:10px 44px 2px 10px !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label*="هاتف"]{
    grid-column:1 / -1 !important;padding-top:0 !important;direction:rtl !important;text-align:right !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="اسم العميل"]::before,
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label*="هاتف"]::before{display:none !important}
  /* الحقول الطويلة والحذف بعرض كامل */
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="ملاحظات"],
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="الحملة"],
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td:last-child{grid-column:1 / -1 !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td:last-child .delete-btn{min-height:34px !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td select{min-height:36px !important;font-size:13px !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[colspan]{display:block !important}
}

/* أزرار طيّ اللوحات — الجوال فقط (المؤشرات التحليلية + البحث والتصفية)
   على الكمبيوتر تبقى اللوحات ظاهرة: .filter-panel يعرض عناصره كأنها داخل الشريط مباشرة */
.panel-toggle{display:none}
.filter-panel{display:contents}
@media (max-width:700px){
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .panel-toggle{
    display:flex !important;justify-content:space-between;align-items:center;width:100% !important;grid-column:1 / -1;
    min-height:44px !important;margin:8px 0 !important;padding:8px 14px !important;border-radius:12px !important;
    background:rgba(148,163,184,.12) !important;border:1px solid rgba(148,163,184,.32) !important;
    color:inherit !important;font-size:14px !important;font-weight:800 !important;text-align:start}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .panel-toggle::after{content:"▾";font-size:16px}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) .panel-toggle[aria-expanded="true"]::after{content:"▴"}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) :is(.analytics-dashboard,.filter-panel):not(.panel-open){display:none !important}
}

/* ---- تحسينات بطاقات العملاء على الجوال (السوشيال + القنوات المختلفة) ---- */
@media (max-width:700px){
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards tr{
    --td-tint:transparent !important;
    /* لون الحالة/التصنيف فوق خلفية البطاقة (وليس بدلها) ليظهر في الوضعين */
    background:linear-gradient(var(--row-tint,transparent),var(--row-tint,transparent)) var(--bt-card-bg) !important;
    background-clip:padding-box !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td{background:transparent}
  /* خانات النص القابلة للتعديل: تظهر دائمًا ككتابة حتى لو فاضية */
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[contenteditable="true"]{
    min-height:40px !important;border-radius:8px !important;
    background:rgba(255,255,255,.08) !important;outline:1px dashed rgba(148,163,184,.45) !important;outline-offset:-3px !important;
    margin:2px 6px !important;width:auto !important}
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[contenteditable="true"]::before{
    pointer-events:none}
  /* مربع التحديد بدون خلفية ملونة */
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="تحديد"]{background:transparent !important}
  /* خلية الحذف تختفي كلها لمن لا يملك صلاحية الحذف (لا تبقى كلمة "حذف" وحدها) */
  body.m3-no-client-delete #socialClientsSubView table.ayan-mobile-cards td:last-child,
  body.m3-no-other-delete #otherClientsSubView table.ayan-mobile-cards td:last-child{display:none !important}
  body.m3-no-client-delete #campaignListsSubView #clBody td:last-child{display:none !important}
}

@media (max-width:700px){
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label="اسم العميل"],
  :is(#otherClientsSubView,#socialClientsSubView,#campaignListsSubView) table.ayan-mobile-cards td[data-label*="هاتف"]{
    background:transparent !important;outline:none !important;margin:0 !important;min-height:0 !important}
}

/* =============================================================================
   قائمة التنقل (<=900px): قائمة عمودية تفتح داخل الهيدر بزر ☰ وتدفع المحتوى للأسفل
   (بدون موضع ثابت أو ارتفاع مكتوب يدويًا). التعريف الوحيد للقائمة المنسدلة.
   ============================================================================= */
@media (max-width:900px){
  html body .ayan-main-nav > .ayan-tabs{display:none !important}
  html body .ayan-main-nav > .ayan-tabs.mobile-open{
    display:flex !important;flex-direction:column;flex-wrap:nowrap !important;gap:0 !important;
    grid-column:1 / -1;width:100% !important;max-height:calc(100dvh - 190px);
    overflow-y:auto !important;margin:6px 0 0 !important;padding:0 !important;
    border-top:1px solid var(--bt-nav-h)}
  html body .ayan-main-nav > .ayan-tabs.mobile-open .ayan-tab{
    flex:none !important;width:100% !important;min-height:46px !important;margin:0 !important;
    padding:12px 14px !important;border-radius:0 !important;border-bottom:1px solid var(--bt-nav-h);
    font-size:14px !important;line-height:1.4 !important;text-align:start !important;white-space:normal !important}
  html body .ayan-main-nav > .ayan-tabs.mobile-open .ayan-tab:last-child{border-bottom:0}
}


/* ---- زر إدارة المنظومة (أدمن) في جوال لوحة المدير: يمتد على عرض الصف كاملًا ---- */
@media(max-width:700px){
  .ayan-exec-mobnav > #execPlatformAdminButton,
  .exec-v5-nav > #execPlatformAdminButton,
  #execPlatformAdminButton.exec-platform-admin-btn{
    grid-column:1 / -1 !important;
    flex:1 1 100% !important;
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    min-height:50px !important;
    box-sizing:border-box !important;
  }
}

/* كروت المؤشرات قابلة للضغط لعرض العملاء تحت التصنيف */
#clientsView .analytics-dashboard .dash-card,
#otherClientsSubView .analytics-dashboard .dash-card,
#clCards .dash-card{cursor:pointer}
.dash-card.card-active{outline:2px solid #d4af37;outline-offset:-2px;box-shadow:0 0 0 3px rgba(212,175,55,.25)}

/* ---- شريط التحديدات: قائمة منسدلة (details) مطويّة افتراضيًا ---- */
.bulk-actions-bar{margin:10px 0;border:1px solid #334155;border-radius:12px;background:#111827}
body.theme-light .bulk-actions-bar{background:#f8fafc;border-color:#cbd5e1}
.bulk-actions-bar[hidden]{display:none !important}
.bulk-actions-bar > summary{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;cursor:pointer;font-weight:800;list-style:none}
.bulk-actions-bar > summary::-webkit-details-marker{display:none}
.bulk-actions-bar > summary::after{content:"▾";margin-inline-start:auto;padding-inline-start:10px}
.bulk-actions-bar[open] > summary::after{content:"▴"}
.bulk-selected-count{font-weight:900}
.bulk-actions-panel{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:2px 14px 12px}
.bulk-actions-panel select{min-width:145px}
@media (max-width:700px){
  .bulk-actions-panel{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .bulk-actions-panel > label,.bulk-actions-panel > button.red{grid-column:1 / -1}
  .bulk-actions-panel select,.bulk-actions-panel button{width:100%;min-width:0;min-height:38px;font-size:12.5px;box-sizing:border-box}
}
