/* admin.css - تنسيقات لوحة تحكم جبهالك */

/* ===== الوضع الليلي: مقصور على لوحات التحكم بس (الأدمن/التاجر/المسوّق)
   لأن الملف ده مش بيتحمّل في صفحات المتجر خالص، فمفيش خطر إن الوضع الليلي يأثر على تجربة الشراء ===== */
html[data-theme="dark"]{
  --navy:#3E7CB1;
  --navy-dark:#0C2942;
  --orange:#F5821F;
  --orange-dark:#DA6F10;
  --green:#2FB27C;
  --bg:#12181F;
  --bg-soft:#1C242D;
  --text:#E8ECF1;
  --text-muted:#9BA5B3;
  --border:#2C3640;
  --card-bg:#1A2129;
  --shadow:0 1px 3px rgba(0,0,0,0.4);
}
html[data-theme="dark"] body{background:var(--bg);color:var(--text);}

.admin-body{background:var(--bg-soft);min-height:100vh;min-height:100dvh;}

/* ===== Admin layout ===== */
.admin-wrapper{display:flex;min-height:100vh;min-height:100dvh;}

.admin-sidebar{
  width:238px;background:var(--navy-dark);color:#fff;flex-shrink:0;
  position:sticky;top:0;height:100vh;height:100dvh;display:flex;flex-direction:column;padding:18px 0;
}
.admin-sidebar .admin-logo{display:flex;align-items:center;gap:10px;padding:0 20px 18px;margin-bottom:8px;border-bottom:1px solid rgba(255,255,255,.08);}
.admin-sidebar .admin-logo img{height:28px;background:#fff;border-radius:6px;padding:4px 8px;}
.admin-sidebar .admin-logo span{font-size:13px;font-weight:700;opacity:.85;}

.admin-nav{flex:1;padding:0 12px;overflow-y:auto;min-height:0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent;}
.admin-nav::-webkit-scrollbar{width:5px;}
.admin-nav::-webkit-scrollbar-track{background:transparent;}
.admin-nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:4px;}
.admin-nav::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.32);}
.admin-nav-section-title{
  font-size:10.5px;font-weight:700;color:rgba(255,255,255,.35);
  text-transform:uppercase;letter-spacing:.06em;padding:14px 12px 6px;
}
.admin-nav-section-title:first-child{padding-top:4px;}
.admin-nav a{
  display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;
  font-size:13px;font-weight:600;color:rgba(255,255,255,.68);margin-bottom:2px;
  transition:background .12s ease,color .12s ease;
}
.admin-nav a svg{width:17px;height:17px;flex-shrink:0;opacity:.9;}
.admin-nav a:hover{background:rgba(255,255,255,.07);color:#fff;}
.chat-nav-unread-dot{width:8px;height:8px;border-radius:50%;background:#D64545;flex-shrink:0;}
.chat-nav-unread-dot-sidebar{margin-inline-start:auto;}
.mobile-bottom-nav a{position:relative;}
.chat-nav-unread-dot-bottom{position:absolute;top:2px;inset-inline-end:calc(50% - 15px);}
.admin-nav a.active{background:var(--orange);color:#fff;box-shadow:0 2px 8px rgba(245,130,31,.25);}
.admin-nav a.active svg{opacity:1;}

.admin-sidebar-footer{padding:0 12px;}
.admin-sidebar-footer a{
  display:flex;align-items:center;gap:8px;padding:10px 12px;font-size:12.5px;color:rgba(255,255,255,.6);
}
.admin-sidebar-footer a:hover{color:#fff;}
.admin-sidebar-footer button{
  display:flex;align-items:center;gap:8px;padding:10px 12px;font-size:12.5px;
  color:#F1A9A9;width:100%;border-radius:8px;
}
.admin-sidebar-footer button:hover{background:rgba(255,255,255,.06);}
.admin-sidebar-footer svg{width:16px;height:16px;}

.admin-main{flex:1;min-width:0;}
.admin-topbar{
  background:var(--card-bg);border-bottom:1px solid var(--border);padding:14px 28px;
  display:flex;justify-content:space-between;align-items:center;
  position:sticky;top:0;z-index:220;
}
.admin-topbar-user{display:flex;align-items:center;gap:12px;font-size:13px;color:var(--text-muted);}
.topbar-logo{display:flex;align-items:center;flex-shrink:0;}
.topbar-logo img{height:30px;display:block;}
/* اللوجو ألوانه (كحلي وبرتقالي) مصمّمة على خلفية بيضاء، فمش بتبان واضحة على خلفية غامقة.
   بنحط خلفية بيضاء خفيفة خلفه بس في الوضع الليلي عشان يفضل واضح 100% */
html[data-theme="dark"] .topbar-logo{
  background:#fff;padding:5px 10px;border-radius:8px;
}
.theme-toggle-btn{
  width:34px;height:34px;border-radius:8px;border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  color:var(--text-muted);background:transparent;transition:background-color .15s ease;
}
.theme-toggle-btn:hover{background:var(--bg-soft);}
.theme-toggle-btn svg{width:17px;height:17px;}
.theme-toggle-btn .icon-moon{display:none;}
html[data-theme="dark"] .theme-toggle-btn .icon-sun{display:none;}
html[data-theme="dark"] .theme-toggle-btn .icon-moon{display:flex;}
.admin-topbar-user .avatar{
  width:32px;height:32px;border-radius:50%;background:var(--navy);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;
}
.admin-content{padding:28px;}
.page-title{font-size:19px;font-weight:800;color:var(--navy);margin-bottom:18px;}

/* ===== Stat cards ===== */
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:28px;}
.stat-card{background:var(--card-bg);border:1px solid var(--border);border-radius:10px;padding:20px;}
.stat-card .stat-icon{
  width:38px;height:38px;border-radius:8px;display:flex;align-items:center;justify-content:center;margin-bottom:12px;
}
.stat-card .stat-icon svg{width:19px;height:19px;color:#fff;}
.stat-card .stat-value{font-size:24px;font-weight:800;color:var(--navy);margin-bottom:2px;}
.stat-card .stat-label{font-size:12.5px;color:var(--text-muted);}

/* ===== Admin card / table ===== */
.admin-card{background:var(--card-bg);border:1px solid var(--border);border-radius:10px;overflow:hidden;}
.admin-card-body{padding:20px;}
.admin-card-head{
  padding:16px 20px;border-bottom:1px solid var(--border);display:flex;
  justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;
}
.admin-card-head h3{font-size:15px;font-weight:800;color:var(--navy);}

.admin-btn{
  background:var(--navy);color:#fff;padding:9px 18px;border-radius:6px;font-size:13px;font-weight:700;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:background .15s;
}
.admin-btn:hover{background:var(--navy-dark);}
.admin-btn.orange{background:var(--orange);}
.admin-btn.orange:hover{background:var(--orange-dark);}
.admin-btn svg{width:15px;height:15px;}

.admin-table{width:100%;border-collapse:collapse;}
.admin-table th{
  text-align:start;padding:12px 20px;font-size:12px;color:var(--text-muted);font-weight:700;
  background:var(--bg-soft);border-bottom:1px solid var(--border);white-space:nowrap;
}
.admin-table td{padding:14px 20px;font-size:13px;border-bottom:1px solid var(--border);vertical-align:middle;}
.admin-table tr:last-child td{border-bottom:none;}
.admin-table tr:hover td{background:var(--bg-soft);}

.admin-product-thumb{display:flex;align-items:center;gap:10px;}
.admin-product-thumb img{width:42px;height:42px;border-radius:6px;object-fit:cover;background:var(--bg-soft);flex-shrink:0;}
.admin-product-thumb span{font-weight:600;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.admin-row-actions{display:flex;gap:8px;}
.admin-icon-btn{
  width:30px;height:30px;border-radius:6px;display:flex;align-items:center;justify-content:center;
  border:1px solid var(--border);color:var(--text-muted);flex-shrink:0;
}
.admin-icon-btn:hover{border-color:var(--navy);color:var(--navy);}
.admin-icon-btn.danger:hover{border-color:#D64545;color:#D64545;}
.admin-icon-btn svg{width:14px;height:14px;}

.admin-status-select{
  border:1px solid var(--border);border-radius:6px;padding:6px 8px;font-family:inherit;font-size:12px;
  outline:none;cursor:pointer;background:var(--card-bg);color:var(--text);
}

.admin-empty{padding:50px 20px;text-align:center;color:var(--text-muted);font-size:13.5px;}

/* ===== Product form ===== */
.admin-form-card{background:var(--card-bg);border:1px solid var(--border);border-radius:10px;padding:26px;max-width:760px;}
.admin-form-card .form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.admin-form-card .form-group{margin-bottom:16px;}
.admin-form-card label{display:block;font-size:13px;font-weight:700;margin-bottom:6px;}
.admin-form-card input, .admin-form-card select, .admin-form-card textarea{
  width:100%;border:1px solid var(--border);border-radius:6px;padding:10px 12px;
  font-family:inherit;font-size:13.5px;outline:none;
}
.admin-form-card input:focus, .admin-form-card select:focus, .admin-form-card textarea:focus{border-color:var(--navy);}
.admin-form-card textarea{min-height:90px;resize:vertical;}
.admin-form-section-title{font-size:13.5px;font-weight:800;color:var(--navy);margin:22px 0 12px;padding-top:16px;border-top:1px solid var(--border);}
.admin-form-section-title:first-child{margin-top:0;padding-top:0;border-top:none;}

.spec-row{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin-bottom:8px;align-items:center;}
.spec-row button{
  width:34px;height:34px;border:1px solid var(--border);border-radius:6px;color:#D64545;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.spec-row button:hover{border-color:#D64545;background:#FDECEC;}
.spec-row button svg{width:15px;height:15px;}

.admin-form-actions{display:flex;gap:10px;margin-top:22px;padding-top:22px;border-top:1px solid var(--border);}
.admin-btn-secondary{
  background:var(--bg-soft);color:var(--text);padding:10px 20px;border-radius:6px;font-size:13.5px;font-weight:700;
}

/* ===== Admin login ===== */
.admin-login-wrap{
  min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;background:var(--navy-dark);padding:20px;
}
.admin-login-box{background:var(--card-bg);border-radius:12px;padding:32px;max-width:380px;width:100%;position:relative;overflow:hidden;}
.admin-login-box .admin-logo-center{text-align:center;margin-bottom:20px;}
.admin-login-box .admin-logo-center img{height:36px;}
.admin-login-box h2{font-size:16px;font-weight:800;text-align:center;color:var(--navy);margin-bottom:22px;}

.admin-mobile-toggle{
  display:none;width:36px;height:36px;border-radius:6px;border:1px solid var(--border);
  align-items:center;justify-content:center;flex-shrink:0;color:var(--navy);
}
.admin-mobile-toggle svg{width:19px;height:19px;}

.admin-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:290;display:none;}
.admin-overlay.show{display:block;}

@media (max-width:900px){
  .stats-grid{grid-template-columns:repeat(2,1fr);}
  .admin-form-card .form-row{grid-template-columns:1fr;}
}
@media (max-width:768px){
  .admin-mobile-toggle{display:flex;}
  .admin-sidebar{position:fixed;right:-238px;z-index:300;transition:right .2s ease;top:0;}
  .admin-sidebar.open{right:0;}
  .admin-content{padding:16px;padding-bottom:86px;}
  .admin-topbar{padding:12px 16px;}
  .stats-grid{grid-template-columns:1fr 1fr;}
  .admin-table{display:block;overflow-x:auto;overflow-y:hidden;white-space:nowrap;}
}

/* ===== الشريط السفلي للتنقل على الموبايل (بدل القائمة الجانبية) ===== */
.mobile-bottom-nav{display:none;}
@media (max-width:768px){
  .mobile-bottom-nav{
    display:flex;position:fixed;bottom:0;right:0;left:0;z-index:250;
    background:var(--card-bg);border-top:1px solid var(--border);box-shadow:0 -4px 16px rgba(0,0,0,.06);
    padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-bottom-nav a, .mobile-bottom-nav button{
    flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;
    padding:6px 2px;color:var(--text-muted);font-size:10.5px;font-weight:600;border-radius:8px;
    transition:color .15s ease;background:none;border:none;font-family:inherit;
  }
  .mobile-bottom-nav a svg, .mobile-bottom-nav button svg{width:20px;height:20px;stroke-width:2;}
  .mobile-bottom-nav a.active{color:var(--navy);}
  .mobile-bottom-nav a.active svg{color:var(--orange);}
}

/* ===== Search box ===== */
.admin-search{
  display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:6px;
  padding:8px 12px;background:var(--card-bg);max-width:280px;flex:1;
}
.admin-search svg{width:16px;height:16px;color:var(--text-muted);flex-shrink:0;}
.admin-search input{border:none;outline:none;font-family:inherit;font-size:13px;width:100%;background:transparent;color:var(--text);}

/* ===== Order detail modal ===== */
.order-modal-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:300;
  display:none;align-items:center;justify-content:center;padding:20px;
}
.order-modal-overlay.show{display:flex;}
.order-modal{
  background:var(--card-bg);border-radius:12px;max-width:560px;width:100%;max-height:85vh;overflow-y:auto;
}
.order-modal-head{
  padding:18px 22px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;
  position:sticky;top:0;background:var(--card-bg);
}
.order-modal-head h3{font-size:15.5px;font-weight:800;color:var(--navy);}
.order-modal-close{width:30px;height:30px;border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--text-muted);}
.order-modal-close:hover{background:var(--bg-soft);}
.order-modal-close svg{width:17px;height:17px;}
.order-modal-body{padding:22px;}
.order-modal-section{margin-bottom:20px;}
.order-modal-section:last-child{margin-bottom:0;}
.order-modal-section h5{font-size:12.5px;font-weight:800;color:var(--text-muted);margin-bottom:10px;text-transform:uppercase;letter-spacing:.3px;}
.order-modal-info-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.order-modal-info-item{font-size:13px;}
.order-modal-info-item span{display:block;color:var(--text-muted);font-size:11.5px;margin-bottom:2px;}
.order-modal-item-row{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--border);font-size:13px;}
.order-modal-item-row:last-child{border-bottom:none;}
.order-modal-totals{background:var(--bg-soft);border-radius:8px;padding:14px 16px;}
.order-modal-totals .row{display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px;}
.order-modal-totals .row:last-child{margin-bottom:0;font-weight:800;font-size:14.5px;color:var(--navy);padding-top:8px;border-top:1px solid var(--border);}

/* ===== Settings form ===== */
.settings-section{margin-bottom:26px;}
.settings-section h4{font-size:14px;font-weight:800;color:var(--navy);margin-bottom:4px;}
.settings-section p.hint{font-size:12px;color:var(--text-muted);margin-bottom:14px;}

/* ===== Image upload ===== */
.image-upload-zone{
  border:2px dashed var(--border);border-radius:8px;padding:24px;text-align:center;cursor:pointer;
  transition:border-color .15s,background .15s;
}
.image-upload-zone:hover{border-color:var(--orange);background:#FFF9F3;}
.image-upload-zone svg{width:32px;height:32px;color:var(--text-muted);margin:0 auto 8px;}
.image-upload-zone p{font-size:13px;color:var(--text-muted);}
.image-upload-zone p strong{color:var(--navy);}
.image-preview-list{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;}
.image-preview-item{position:relative;width:84px;height:84px;border-radius:8px;overflow:hidden;border:1px solid var(--border);}
.image-preview-item img{width:100%;height:100%;object-fit:cover;}
.image-preview-item .main-badge{
  position:absolute;bottom:0;right:0;left:0;background:rgba(18,59,94,.85);color:#fff;
  font-size:9.5px;text-align:center;padding:2px 0;
}
.image-preview-item .remove-img-btn{
  position:absolute;top:3px;left:3px;width:20px;height:20px;background:rgba(0,0,0,.6);color:#fff;
  border-radius:50%;display:flex;align-items:center;justify-content:center;
}
.image-preview-item .remove-img-btn svg{width:11px;height:11px;}
.image-upload-progress{font-size:12px;color:var(--text-muted);margin-top:8px;}

/* ===== فورم فيه أيقونات داخل الحقول وتباعد واضح (زي فورم السحب) ===== */
.withdraw-form .form-row{margin-bottom:18px;gap:14px;}
.withdraw-form .form-group{margin-bottom:0;}
.withdraw-form .form-group label{display:block;font-size:12.5px;font-weight:700;color:var(--text);margin-bottom:7px;}
.input-with-icon{position:relative;display:flex;align-items:center;}
.input-with-icon svg{
  position:absolute;right:12px;width:16px;height:16px;color:var(--text-muted);pointer-events:none;
}
.input-with-icon input, .input-with-icon select{padding-right:36px;width:100%;}
.input-with-icon input{padding-left:40px;}
.input-with-icon select{padding-left:36px;}
.input-with-icon .input-suffix{
  position:absolute;left:12px;font-size:12px;font-weight:700;color:var(--text-muted);pointer-events:none;
}
.withdraw-form #withdrawBtn, .withdraw-form #savePayoutBtn{width:100%;margin-top:6px;padding:13px 0;font-size:14px;}
#eWalletFields, #instapayFields{margin-bottom:18px;}
#eWalletFields .form-row, #instapayFields .form-group{margin-bottom:0;}

@media (max-width:768px){
  .withdraw-form .form-row{grid-template-columns:1fr;gap:16px;}
}

/* ===== حالة تحميل (Skeleton) موحّدة - بديل عن ظهور بيانات فارغة ثم تحديثها فجأة ===== */
.skeleton-box{
  background:linear-gradient(90deg, var(--bg-soft) 25%, #eef1f4 50%, var(--bg-soft) 75%);
  background-size:200% 100%;animation:skeletonShine 1.4s infinite;border-radius:10px;
}
@keyframes skeletonShine{from{background-position:200% 0;}to{background-position:-200% 0;}}

/* ===== القائمة المنسدلة لاسم المستخدم في الهيدر (إعدادات الحساب + تسجيل الخروج) ===== */
.user-menu-wrapper{position:relative;}
.user-menu-trigger{
  display:flex;align-items:center;gap:8px;background:none;border:none;cursor:pointer;
  font-family:inherit;color:inherit;padding:0;
}
.user-menu-trigger span{display:none;}
.user-dropdown{
  position:absolute;top:calc(100% + 10px);inset-inline-end:0;background:var(--card-bg);
  border:1px solid var(--border);border-radius:10px;box-shadow:0 10px 28px rgba(0,0,0,.14);
  min-width:180px;overflow:hidden;z-index:150;
  opacity:0;visibility:hidden;transform:translateY(-8px);
  transition:opacity .18s ease,transform .18s ease,visibility .18s;
}
.user-dropdown.show{opacity:1;visibility:visible;transform:translateY(0);}
.user-dropdown a, .user-dropdown button{
  display:flex;align-items:center;gap:9px;width:100%;padding:11px 14px;font-size:13px;
  font-weight:600;color:var(--text);text-align:start;background:none;border:none;font-family:inherit;
}
.user-dropdown a:hover, .user-dropdown button:hover{background:var(--bg-soft);}
.user-dropdown button{color:#D64545;border-top:1px solid var(--border);}

/* ===== صفحة "المزيد" كاملة الشاشة على الموبايل - بديل الدرج الجانبي الضيق ===== */
.more-menu-overlay{
  display:none;position:fixed;top:0;right:0;bottom:0;left:0;background:var(--bg);z-index:230;
  flex-direction:column;transform:translateY(100%);transition:transform .25s ease;
}
.more-menu-overlay.show{display:flex;transform:translateY(0);}
.more-menu-header{
  display:flex;align-items:center;justify-content:space-between;padding:16px 20px;
  border-bottom:1px solid var(--border);flex-shrink:0;
}
.more-menu-header h3{font-size:17px;font-weight:800;color:var(--navy);}
.more-menu-header button{
  width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;
  color:var(--text-muted);background:var(--bg-soft);
}
.more-menu-header button svg{width:16px;height:16px;}
.more-menu-list{flex:1;overflow-y:auto;overflow-x:hidden;padding:8px 0 24px;}
.more-menu-row{
  display:flex;align-items:center;gap:14px;padding:15px 20px;font-size:14.5px;font-weight:700;
  color:var(--text);width:100%;background:none;border:none;font-family:inherit;text-align:start;
}
.more-menu-row:active{background:var(--bg-soft);}
.more-menu-icon{
  width:22px;height:22px;flex-shrink:0;color:var(--navy);display:flex;align-items:center;justify-content:center;
}
.more-menu-icon svg{width:100%;height:100%;}
.more-menu-label{flex:1;}
.more-menu-arrow{display:none;}
.more-menu-divider{height:8px;background:var(--bg-soft);margin:8px 0;}
.more-menu-danger{color:#D64545;}
.more-menu-danger .more-menu-icon{color:#D64545;}

@media (min-width:769px){
  .more-menu-overlay{display:none !important;}
}

/* ===== صف بيانات المستخدم في نهاية صفحة المزيد - بينزل تحته إعدادات الحساب وتسجيل الخروج ===== */
.more-menu-user-row{justify-content:flex-start;}
.more-menu-user-avatar{
  width:32px;height:32px;border-radius:50%;background:var(--navy);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex-shrink:0;
}
.more-menu-user-chevron{width:16px;height:16px;color:var(--text-muted);flex-shrink:0;transition:transform .2s ease;}
.more-menu-user-row.open .more-menu-user-chevron{transform:rotate(180deg);}

/* القائمة بتنزل لتحت في مكانها الطبيعي (Accordion) بدل ما تظهر كنافذة عائمة */
.more-menu-user-popup{
  max-height:0;overflow:hidden;background:var(--bg-soft);
  transition:max-height .25s ease;
}
.more-menu-user-popup.show{max-height:160px;}
.more-menu-user-popup a, .more-menu-user-popup button{
  display:flex;align-items:center;gap:10px;width:100%;padding:14px 20px;font-size:14px;
  font-weight:700;color:var(--text);text-align:start;background:none;border:none;font-family:inherit;
}
.more-menu-user-popup a:hover, .more-menu-user-popup button:hover{background:var(--border);}
.more-menu-user-popup button{color:#D64545;border-top:1px solid var(--border);}
.more-menu-user-popup .popup-icon{width:17px;height:17px;flex-shrink:0;}

/* قسم اللغة بقى ظاهر دايمًا كصف مستقل، مش تابع لاسم المستخدم */
.lang-switch-row{
  display:flex;align-items:center;justify-content:space-between;padding:14px 20px;
  border-top:1px solid var(--border);background:var(--bg-soft);
  /* التسمية "اللغة/Language" بتتبع اتجاه الصفحة الطبيعي (يمين في عربي، شمال في إنجليزي) */
}
.lang-switch-label{font-size:13px;font-weight:700;color:var(--text-muted);}
.lang-options{display:flex;align-items:center;gap:8px;direction:ltr;}
/* ترتيب "عربي" و"English" بينهم بس هو اللي ثابت مهما كانت اللغة الحالية */
.lang-option{
  font-size:13px;font-weight:700;color:var(--text-muted);padding:6px 14px;border-radius:20px;
  background:transparent;border:none;font-family:inherit;cursor:pointer;
}
.lang-option.active{background:#FFF3E6;color:var(--orange);}

/* ===== خيار تبديل اللغة في آخر القائمة الجانبية (ديسكتوب) ===== */
.sidebar-lang-row{
  display:flex;align-items:center;justify-content:space-between;padding:14px 12px 4px;
  margin-top:8px;border-top:1px solid rgba(255,255,255,.1);
}
.sidebar-lang-label{font-size:12px;font-weight:700;color:rgba(255,255,255,.5);}
.admin-sidebar-footer .lang-options{display:flex;align-items:center;gap:6px;}
.admin-sidebar-footer .lang-option{
  font-size:12px;font-weight:700;color:rgba(255,255,255,.6);padding:5px 10px;border-radius:14px;
  background:transparent;border:none;font-family:inherit;cursor:pointer;
}
.admin-sidebar-footer .lang-option.active{background:rgba(245,130,31,.22);color:var(--orange);}

/* ===== صف اسم المستخدم في آخر القائمة الجانبية - بينزل منه إعدادات الحساب وتسجيل الخروج ===== */
.sidebar-user-row{
  display:flex;align-items:center;gap:10px;padding:11px 12px;cursor:pointer;border-radius:8px;
  color:rgba(255,255,255,.85);
}
.sidebar-user-row:hover{background:rgba(255,255,255,.06);}
.sidebar-user-avatar{
  width:28px;height:28px;border-radius:50%;background:rgba(255,255,255,.15);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;flex-shrink:0;
}
.sidebar-user-name{flex:1;min-width:0;font-size:12.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.sidebar-user-chevron{width:14px;height:14px;color:rgba(255,255,255,.5);flex-shrink:0;transition:transform .2s ease;}
.sidebar-user-row.open .sidebar-user-chevron{transform:rotate(180deg);}

.sidebar-user-popup{max-height:0;overflow:hidden;transition:max-height .25s ease;}
.sidebar-user-popup.show{max-height:120px;}
.sidebar-user-popup a, .sidebar-user-popup button{
  display:flex;align-items:center;gap:8px;width:100%;padding:9px 12px 9px 12px;margin-right:0;
  font-size:12.5px;font-weight:600;color:rgba(255,255,255,.6);background:none;border:none;font-family:inherit;
}
.sidebar-user-popup a:hover, .sidebar-user-popup button:hover{color:#fff;}
.sidebar-user-popup button{color:#F1A9A9;}
.sidebar-user-popup button:hover{color:#fff;}

/* ===== أيقونة الإشعارات في الهيدر مع النافذة المنسدلة ===== */
.notif-bell-wrap{position:relative;}
.notif-badge{
  position:absolute;top:2px;left:2px;background:#D64545;color:#fff;font-size:9px;font-weight:800;
  min-width:15px;height:15px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  padding:0 3px;line-height:1;border:2px solid var(--card-bg);
}
.notif-popup{
  position:absolute;top:calc(100% + 10px);inset-inline-end:0;background:var(--card-bg);
  border:1px solid var(--border);border-radius:12px;box-shadow:0 14px 34px rgba(0,0,0,.16);
  width:320px;max-width:calc(100vw - 32px);overflow:hidden;z-index:150;
  opacity:0;visibility:hidden;transform:translateY(-8px) scale(.97);transform-origin:top center;
  transition:opacity .2s cubic-bezier(.16,1,.3,1),transform .2s cubic-bezier(.16,1,.3,1),visibility .2s;
}
.notif-popup.show{opacity:1;visibility:visible;transform:translateY(0) scale(1);}
.notif-popup-head{
  display:flex;align-items:center;justify-content:space-between;padding:12px 14px;
  border-bottom:1px solid var(--border);
}
.notif-popup-head h4{font-size:13.5px;font-weight:800;color:var(--navy);}
.notif-popup-head button{font-size:11.5px;font-weight:700;color:var(--text-muted);}
.notif-popup-head button:hover{color:var(--navy);}
.notif-popup-list{max-height:340px;overflow-y:auto;overflow-x:hidden;}
.notif-item{padding:12px 14px;border-bottom:1px solid var(--border);position:relative;}
.notif-item:last-child{border-bottom:none;}
.notif-item.unread{background:var(--bg-soft);}
.notif-item.unread::before{
  content:'';position:absolute;top:16px;right:14px;width:7px;height:7px;border-radius:50%;background:var(--orange);
}
.notif-item .notif-item-title{font-size:13px;font-weight:700;margin-bottom:3px;padding-right:16px;}
.notif-item .notif-item-message{font-size:12px;color:var(--text-muted);line-height:1.6;margin-bottom:5px;}
.notif-item .notif-item-date{font-size:10.5px;color:var(--text-muted);opacity:.8;}
.notif-open-link{
  display:inline-block;margin-top:6px;font-size:11.5px;font-weight:700;color:var(--orange);
}
.notif-open-link:hover{text-decoration:underline;}
.notif-empty{padding:36px 16px;text-align:center;font-size:12.5px;color:var(--text-muted);}

/* ===== بطاقة مستوى المسوّق بالعمولة ===== */
.tier-badge{
  display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:20px;font-size:12.5px;font-weight:800;color:#fff;
}
.tier-progress-track{background:var(--bg-soft);border-radius:20px;height:8px;overflow:hidden;margin-top:10px;}
.tier-progress-fill{height:100%;border-radius:20px;transition:width .4s ease;}

/* ===== موضع ودجت شات الدعم (تاجر/مسوّق) - على الشمال دايمًا عشان مايغطيش القائمة الجانبية أو أيقونة اللغة ===== */
#supportChatFab{ left:22px; right:auto; }
#supportChatPanel{ left:22px; right:auto; transform-origin:bottom left; }
#supportChatToast{ left:22px; right:auto; }
@media (max-width:768px){
  #supportChatFab{ left:14px; bottom:86px; width:52px; height:52px; }
  #supportChatPanel{ left:14px; bottom:150px; }
  #supportChatToast{ left:12px; bottom:150px; width:calc(100vw - 24px); }
}

/* ===== حالة تحميل/خطأ عامة لأي قائمة أو محتوى بيتحمّل من السيرفر (زي قائمة المحادثات) ===== */
.admin-loading-state{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;
  padding:40px 20px;text-align:center;color:var(--text-muted);font-size:12.5px;
}
.admin-spinner{
  width:26px;height:26px;border-radius:50%;flex-shrink:0;
  border:3px solid var(--border);border-top-color:var(--navy);
  animation:adminSpin .7s linear infinite;
}
@keyframes adminSpin{to{transform:rotate(360deg);}}

/* ===== منع سفاري في الآيفون من عمل زوم تلقائي لما تدوس على أي حقل إدخال ===== */
@media (max-width:768px){
  input, select, textarea{font-size:16px !important;}
}
