body.bg-app {
  background: #f2f4f9;
  min-height: 100vh;
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
}

.layout-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.side-nav {
  background: #11162a;
  color: #c7cee8;
  padding: 20px 14px;
}

.brand-title {
  color: #fff;
  font-weight: 700;
  margin-bottom: 22px;
}

.side-link {
  display: block;
  color: #c7cee8;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.side-link:hover,
.side-link.active {
  background: #1e2644;
  color: #55e6a5;
}

.main-area {
  padding: 18px 22px;
}

.topbar {
  background: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 5px 20px rgba(26, 33, 52, 0.08);
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 5px 20px rgba(26, 33, 52, 0.08);
}

.stat-label {
  color: #6e7894;
  font-size: 0.92rem;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: #1f2538;
}

.panel-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(26, 33, 52, 0.08);
  overflow: hidden;
  border: 0;
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid #edf0f7;
  font-weight: 700;
}

.table thead th {
  background: #f7f9fd;
  font-weight: 700;
  color: #445072;
  border-bottom: 0;
}

.table td,
.table th {
  vertical-align: middle;
}

.form-label {
  font-weight: 600;
  color: #47516d;
}

.soft-muted {
  color: #7b86a8;
  font-size: 0.9rem;
}

.empty-state {
  color: #7b86a8;
  text-align: center;
  padding: 18px;
}

.license-toolbar {
  background: #f8faff;
  border: 1px solid #e9eefb;
  border-radius: 12px;
  padding: 12px;
}

.license-pill {
  display: inline-block;
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 700;
}

.license-pill.ok {
  background: #e8f9f0;
  color: #138a4e;
}

.license-pill.warn {
  background: #fff5e8;
  color: #b86a0c;
}

.license-pill.bad {
  background: #ffebee;
  color: #c62828;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.details-item {
  border: 1px solid #eef2fb;
  border-radius: 10px;
  padding: 10px;
  background: #fbfcff;
}

.details-key {
  color: #7381a3;
  font-size: 0.82rem;
}

.details-value {
  color: #1f2a44;
  font-weight: 600;
  margin-top: 4px;
  word-break: break-word;
}

.license-focus {
  border: 1px solid #e7ebf6;
  border-radius: 12px;
  padding: 12px;
  background: #fbfcff;
}

.licenses-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  grid-template-areas:
    "lic-primary lic-aside"
    "lic-full lic-full";
  gap: 14px;
  align-items: start;
}

.licenses-layout__primary {
  grid-area: lic-primary;
  min-width: 0;
}

.licenses-layout__aside {
  grid-area: lic-aside;
  min-width: 0;
}

/* صف كامل أسفل العمودين: قائمة التراخيص بعرض الشبكة بالكامل (موثوق في RTL) */
.licenses-layout__full {
  grid-area: lic-full;
  width: 100%;
  min-width: 0;
}

.licenses-table-wide {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.licenses-layout__full .licenses-table .table td,
.licenses-layout__full .licenses-table .table th {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
  vertical-align: top;
}

.licenses-layout__full .license-key-wrap {
  max-width: min(480px, 56vw);
}

.license-key-wrap {
  max-width: 360px;
  white-space: normal;
  word-break: break-all;
  line-height: 1.25;
}

.licenses-table .table td,
.licenses-table .table th {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-meta {
  font-size: 0.78rem;
  color: #7482a5;
}

.subtle-card {
  border: 1px solid #edf1fb;
  border-radius: 12px;
  background: #f9fbff;
  padding: 10px;
}

/* بطاقة رخصة الجهاز — محددات مستقلة عن الـ wrap حتى لا يختفي التنسيق مع التخزين المؤقت أو DOM مختلف */
.device-license-card {
  border-radius: 20px;
  padding: 1.35rem 1.5rem 1.45rem;
  background: linear-gradient(155deg, #0f1528 0%, #1a2442 42%, #253a62 100%);
  color: #e9eefc;
  box-shadow:
    0 8px 16px rgba(15, 21, 40, 0.18),
    0 20px 48px rgba(18, 26, 48, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.09);
  position: relative;
  overflow: hidden;
}

.device-license-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 100% 0%, rgba(85, 230, 165, 0.14), transparent 52%),
    radial-gradient(ellipse 90% 70% at 0% 100%, rgba(74, 158, 255, 0.1), transparent 50%);
  pointer-events: none;
}

.device-license-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3dd9a0, #55e6a5 35%, #5eb0ff 100%);
  opacity: 0.95;
  z-index: 2;
}

.device-license-card .dl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.05rem;
  position: relative;
  z-index: 1;
}

.device-license-card .dl-title {
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.device-license-card .dl-sub {
  font-size: 0.82rem;
  color: rgba(233, 238, 252, 0.72);
  margin-top: 0.35rem;
  max-width: 42rem;
  line-height: 1.45;
}

.device-license-card .dl-badge {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.device-license-card .dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.device-license-card .dl-tile {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  backdrop-filter: blur(6px);
}

.device-license-card .dl-item-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(233, 238, 252, 0.58);
  margin-bottom: 0.2rem;
}

.device-license-card .dl-item-value {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f3f6ff;
  word-break: break-word;
}

.device-license-card-wrap {
  max-width: 100%;
}

@media (max-width: 992px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }
  .side-nav {
    display: none;
  }
  .details-grid {
    grid-template-columns: 1fr;
  }
  .licenses-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "lic-primary"
      "lic-aside"
      "lic-full";
  }
  .licenses-layout__full .license-key-wrap {
    max-width: 100%;
  }
  .license-key-wrap {
    max-width: 100%;
  }
}

/* --- Landing & login (royal / modern) --- */
.landing-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(99, 102, 241, 0.25), transparent 55%),
    linear-gradient(180deg, #070b14 0%, #0d1324 40%, #0a0e1a 100%);
  color: #e8ecf7;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  background: rgba(7, 11, 20, 0.78);
  border-bottom: 1px solid rgba(201, 169, 98, 0.15);
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.landing-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #c9a962 0%, #8b6914 50%, #e8d5a3 100%);
  box-shadow: 0 4px 20px rgba(201, 169, 98, 0.35);
}

/* لا تُطبَّق على صفحات الدخول/التسجيل — هناك حاوية ثابتة؛ الرأس/التذييل فقط يوسّع الشعار أفقيّاً */
.landing-header .landing-brand-mark:has(.site-logo-img),
.landing-footer-brand .landing-brand-mark:has(.site-logo-img) {
  background: transparent;
  box-shadow: none;
  width: auto;
  height: auto;
  min-height: 38px;
}

.landing-brand-mark-sm {
  width: 28px;
  height: 28px;
  display: inline-block;
  vertical-align: middle;
  margin-inline-end: 0.5rem;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.landing-nav-links a:not(.btn) {
  color: #b8c0dc;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.landing-nav-links a:not(.btn):hover {
  color: #e8d5a3;
}

.landing-btn-login {
  border-radius: 999px;
  padding: 0.45rem 1.35rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c9a962, #a6853c);
  border: none;
  color: #0a0e1a !important;
}

.landing-btn-login:hover {
  filter: brightness(1.08);
  color: #0a0e1a !important;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 3rem 0 4rem;
}

.landing-hero-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(closest-side, rgba(99, 102, 241, 0.35), transparent);
  pointer-events: none;
}

.landing-hero-inner {
  position: relative;
}

.landing-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9a962;
}

.landing-title {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
}

.landing-title-accent {
  background: linear-gradient(90deg, #e8d5a3, #c9a962, #f0e6c8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-lead {
  font-size: 1.1rem;
  color: #a8b2d4;
  max-width: 38rem;
  line-height: 1.75;
}

.landing-btn-primary {
  background: linear-gradient(135deg, #c9a962 0%, #9a7529 100%);
  border: none;
  color: #0a0e1a !important;
  font-weight: 700;
  border-radius: 12px;
}

.landing-btn-primary:hover {
  filter: brightness(1.06);
  color: #0a0e1a !important;
}

.landing-btn-ghost {
  border: 1px solid rgba(201, 169, 98, 0.45);
  color: #e8d5a3 !important;
  background: transparent;
  border-radius: 12px;
  font-weight: 600;
}

.landing-btn-ghost:hover {
  background: rgba(201, 169, 98, 0.1);
  color: #fff6e0 !important;
}

.landing-hero-card {
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(145deg, rgba(201, 169, 98, 0.5), rgba(99, 102, 241, 0.25));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.landing-hero-card-inner {
  background: rgba(15, 20, 36, 0.92);
  border-radius: 18px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-mini-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-mini-stat:last-child {
  border-bottom: 0;
}

.landing-mini-stat-label {
  color: #8b95b8;
  font-size: 0.9rem;
}

.landing-mini-stat-value {
  font-weight: 700;
  color: #e8ecf7;
}

.landing-section {
  padding: 4rem 0;
}

.landing-section-alt {
  background: rgba(255, 255, 255, 0.02);
  border-block: 1px solid rgba(255, 255, 255, 0.05);
}

.landing-section-title {
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
}

.landing-section-sub {
  color: #9aa4c4;
  max-width: 560px;
}

.landing-feature-card {
  border-radius: 18px;
  padding: 1.75rem;
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
}

.landing-feature-icon {
  font-size: 1.75rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.landing-card-emerald {
  background: linear-gradient(155deg, #064e3b 0%, #022c22 100%);
  color: #ecfdf5;
}

.landing-card-sapphire {
  background: linear-gradient(155deg, #1e3a8a 0%, #172554 100%);
  color: #eff6ff;
}

.landing-card-amethyst {
  background: linear-gradient(155deg, #5b21b6 0%, #3b0764 100%);
  color: #faf5ff;
}

.landing-card-gold {
  background: linear-gradient(155deg, #e8d5a3 0%, #c9a962 55%, #a6853c 100%);
  color: #1a1408;
}

.landing-stat-tile {
  text-align: center;
  padding: 1.75rem 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(201, 169, 98, 0.2);
}

.landing-stat-num {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  background: linear-gradient(90deg, #e8d5a3, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-stat-caption {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #9aa4c4;
}

.landing-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(15, 23, 42, 0.9));
  border-block: 1px solid rgba(201, 169, 98, 0.2);
}

.landing-btn-cta {
  background: #fff;
  color: #172554 !important;
  font-weight: 800;
  border-radius: 999px;
  border: none;
}

.landing-btn-cta:hover {
  filter: brightness(1.05);
}

.landing-footer {
  background: linear-gradient(180deg, #060a14 0%, #050810 48%, #03050c 100%);
  border-top: 1px solid rgba(201, 169, 98, 0.14);
}

.landing-footer-list a {
  color: #9aa4c4;
  text-decoration: none;
}

.landing-footer-list a:hover {
  color: #e8d5a3;
}

.landing-footer-main {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.landing-footer-brand-block {
  max-width: 22rem;
}

@media (min-width: 1200px) {
  .landing-footer-brand-block {
    padding-inline-end: 0.75rem;
  }
}

.landing-footer-tagline {
  line-height: 1.65;
  color: #8b95b8 !important;
}

.landing-footer-nav-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem clamp(1rem, 3vw, 2.5rem);
  align-items: start;
}

@media (max-width: 575.98px) {
  .landing-footer-nav-panels {
    grid-template-columns: 1fr;
    gap: 1.35rem;
    padding-top: 0.35rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}

.landing-footer-panel-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c9a962;
  margin: 0 0 0.85rem;
}

.landing-footer-list--dense li {
  margin-bottom: 0.3rem;
}

.landing-footer-list--dense li:last-child {
  margin-bottom: 0;
}

.landing-footer-aside-card {
  border-radius: 18px;
  padding: 1.35rem 1.45rem;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.45), rgba(7, 11, 20, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
}

.landing-footer-dynamic {
  color: #94a3b8;
}

.landing-footer-dynamic a {
  color: #cbd5f5;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.landing-footer-dynamic a:hover {
  color: #e8d5a3;
  border-bottom-color: rgba(232, 213, 163, 0.35);
}

.landing-seo-keywords {
  padding: 1.65rem 0 1.15rem;
  border-top: 1px solid rgba(201, 169, 98, 0.1);
  background: radial-gradient(ellipse 80% 120% at 50% 0%, rgba(99, 102, 241, 0.08), transparent 55%);
}

.landing-seo-keywords-inner {
  max-width: 960px;
  margin-inline: auto;
  padding-inline: 0.75rem;
  text-align: center;
}

.landing-seo-keywords-heading {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.85rem;
}

.landing-seo-keywords-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.45rem;
}

.landing-seo-keywords .landing-seo-kw {
  font-weight: 500;
  font-size: 0.78rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55) !important;
  color: rgba(226, 232, 240, 0.9) !important;
}

.landing-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #64748b !important;
}

.login-page-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.login-page-wrap {
  width: 100%;
  max-width: 440px;
}

.login-back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: #9aa4c4;
  text-decoration: none;
  font-size: 0.95rem;
}

.login-back-link:hover {
  color: #e8d5a3;
}

.login-card {
  background: rgba(15, 20, 36, 0.94);
  border: 1px solid rgba(201, 169, 98, 0.25);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}

/* شعار مرفوع — بطاقات تسجيل الدخول وطلب الحساب: حاوية ثابتة + قص الصورة (بدون الاعتماد على :has) */
.login-page-body .landing-brand-mark,
.signup-wrap .landing-brand-mark {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  min-height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  padding: 4px;
  box-sizing: border-box;
  overflow: hidden !important;
  flex-shrink: 0;
  vertical-align: middle;
  border-radius: 12px;
}

.login-page-body .landing-brand-mark:has(.site-logo-img),
.signup-wrap .landing-brand-mark:has(.site-logo-img) {
  background: transparent !important;
  box-shadow: none !important;
}

.login-page-body .landing-brand-mark .site-logo-img,
.signup-wrap .landing-brand-mark .site-logo-img,
.login-page-body .landing-brand-mark img,
.signup-wrap .landing-brand-mark img {
  display: block;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center;
}

.login-input {
  background: rgba(7, 11, 20, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e8ecf7 !important;
  border-radius: 12px !important;
}

.login-input::placeholder {
  color: rgba(215, 225, 248, 0.72);
  opacity: 1;
}

.login-input::-webkit-input-placeholder {
  color: rgba(215, 225, 248, 0.72);
}

.login-input::-moz-placeholder {
  color: rgba(215, 225, 248, 0.72);
  opacity: 1;
}

@media (max-width: 576px) {
  .landing-nav-links a:not(.btn) {
    display: none;
  }
}

/* --- لوحة إدارة المنصّة (أسلوب الصفحة الرئيسية — كحلي / ذهبي) --- */
.platform-admin-dashboard {
  margin: 0;
  min-height: 100vh;
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(ellipse 100% 70% at 50% -15%, rgba(99, 102, 241, 0.22), transparent 50%),
    linear-gradient(165deg, #070b14 0%, #0c1222 45%, #0a0e1a 100%);
  color: #e8ecf7;
  --pa-gold: #c9a962;
  --pa-gold-soft: #e8d5a3;
  --pa-glass: rgba(15, 22, 42, 0.72);
  --pa-border: rgba(201, 169, 98, 0.18);
  /* يمنع Bootstrap من فرض نص داكن على الجداول والحقول */
  --bs-body-color: #e8ecf7;
  --bs-secondary-color: rgba(186, 198, 232, 0.88);
  --bs-table-color: #e8ecf7;
  --bs-emphasis-color: #f1f4fd;
  color-scheme: dark;
}

.text-secondary-chrome {
  color: rgba(180, 192, 228, 0.72) !important;
}

.platform-shell {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  min-height: 100vh;
  position: relative;
}

.platform-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.32s ease,
    visibility 0.32s ease;
}

.platform-admin-dashboard.platform-nav-open .platform-nav-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.platform-sidebar {
  position: relative;
  z-index: 1040;
  padding: 1.35rem 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(12, 16, 32, 0.96) 0%, rgba(8, 11, 22, 0.98) 100%);
  border-inline-start: 1px solid var(--pa-border);
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0.35, 1);
  will-change: transform;
}

/* صف العلامة التجارية + زر إغلاق القائمة على الجوال */
.platform-brand--with-close {
  flex-wrap: nowrap;
  gap: 0.6rem;
}

.platform-admin-dashboard .dash-drawer-close {
  flex-shrink: 0;
  margin-inline-start: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(232, 236, 247, 0.95);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.platform-admin-dashboard .dash-drawer-close:hover {
  background: rgba(201, 169, 98, 0.22);
  color: var(--pa-gold-soft);
}

.platform-admin-dashboard .dash-drawer-close:active {
  transform: scale(0.94);
}

/* زر الهامبرغر ← حرف X عند فتح القائمة */
.platform-admin-dashboard.platform-nav-open .platform-menu-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.platform-admin-dashboard.platform-nav-open .platform-menu-btn span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.platform-admin-dashboard.platform-nav-open .platform-menu-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.platform-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-inline: 0.35rem;
}

.platform-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--pa-gold) 0%, #8b6914 50%, var(--pa-gold-soft) 100%);
  box-shadow: 0 6px 22px rgba(201, 169, 98, 0.38);
}

.platform-brand-mark:has(.site-logo-img) {
  background: transparent;
  box-shadow: none;
  width: auto;
  height: auto;
  min-height: 42px;
}

.platform-brand-mark .site-logo-img {
  max-height: 42px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.platform-brand-text {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #fff;
}

.platform-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.platform-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 1rem;
  border-radius: 14px;
  color: rgba(199, 206, 232, 0.92);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    transform 0.2s ease;
}

.platform-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--pa-gold-soft);
}

.platform-nav-link.active {
  background: linear-gradient(135deg, rgba(201, 169, 98, 0.18), rgba(99, 102, 241, 0.12));
  border-color: rgba(201, 169, 98, 0.35);
  color: var(--pa-gold-soft);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.platform-nav-ico {
  font-size: 1rem;
  opacity: 0.9;
  width: 1.35rem;
  text-align: center;
}

.platform-sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.platform-main-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.platform-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  padding: 1rem 1.25rem 1rem;
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pa-border);
}

.platform-topbar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.platform-menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 98, 0.35);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.platform-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--pa-gold-soft);
  border-radius: 2px;
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0.35, 1),
    opacity 0.22s ease;
}

.platform-menu-btn:hover {
  background: rgba(201, 169, 98, 0.15);
}

.platform-page-title {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}

.platform-page-sub {
  color: rgba(168, 178, 212, 0.95);
  font-size: 0.92rem;
  line-height: 1.55;
}

.platform-user-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.platform-user-pill {
  max-width: 220px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 169, 98, 0.2);
  color: rgba(220, 228, 248, 0.88);
}

.platform-content {
  flex: 1;
  padding: 1.25rem 1.25rem 2.5rem;
  max-width: 1600px;
  width: 100%;
  margin-inline: auto;
}

.platform-section {
  animation: pa-section-in 0.5s ease backwards;
}

@keyframes pa-section-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .platform-section,
  .platform-panel-animate,
  .platform-stat-card,
  .platform-toast,
  .platform-sidebar,
  .platform-nav-backdrop,
  .platform-menu-btn span {
    animation: none !important;
    transition: none !important;
  }
}

/* بطاقات الإحصاء */
.platform-stat-card {
  position: relative;
  border-radius: 20px;
  padding: 1.35rem 1.25rem 1.45rem;
  min-height: 118px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
}

.platform-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42);
}

.platform-stat-card--sapphire {
  background: linear-gradient(155deg, #1e3a8a 0%, #172554 55%, #0f172a 100%);
}
.platform-stat-card--emerald {
  background: linear-gradient(155deg, #065f46 0%, #064e3b 50%, #022c22 100%);
}
.platform-stat-card--amber {
  background: linear-gradient(155deg, #b45309 0%, #92400e 45%, #451a03 100%);
}
.platform-stat-card--gold {
  background: linear-gradient(155deg, #e8d5a3 0%, #c9a962 45%, #7c5e12 100%);
  color: #1a1408;
}

.platform-stat-card--gold .platform-stat-label {
  color: rgba(26, 20, 8, 0.72);
}
.platform-stat-card--gold .platform-stat-value {
  color: #1a1408;
}

.platform-stat-meta {
  position: relative;
  z-index: 1;
}

.platform-stat-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(232, 236, 247, 0.82);
  margin-bottom: 0.45rem;
}

.platform-stat-value {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.platform-stat-glow {
  position: absolute;
  inset: auto -30% -40% -30%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.14), transparent);
  pointer-events: none;
}

/* لوحات */
.platform-panel {
  border-radius: 20px;
  background: var(--pa-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--pa-border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.platform-panel-animate {
  animation: pa-panel-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.platform-panel-animate-delay-1 {
  animation-delay: 0.08s;
}
.platform-panel-animate-delay-2 {
  animation-delay: 0.14s;
}

@keyframes pa-panel-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.platform-panel-head {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.platform-panel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.platform-panel-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #fff;
}

.platform-panel-body {
  padding: 1.35rem 1.35rem 1.45rem;
}

.platform-subsection-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--pa-gold-soft);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 169, 98, 0.2);
}

.platform-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(196, 206, 236, 0.88);
  margin-bottom: 0.4rem;
}

.platform-input,
.platform-select {
  background: rgba(7, 11, 20, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e8ecf7 !important;
  border-radius: 12px !important;
  padding: 0.55rem 0.85rem !important;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.platform-input:focus,
.platform-select:focus {
  border-color: rgba(201, 169, 98, 0.55) !important;
  box-shadow: 0 0 0 0.2rem rgba(201, 169, 98, 0.15) !important;
}

.platform-input::placeholder {
  color: rgba(180, 192, 220, 0.45);
}

.platform-input-table {
  min-width: 7rem;
}

.platform-hint {
  font-size: 0.85rem;
  color: rgba(168, 178, 212, 0.88);
  line-height: 1.65;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

/* أزرار */
.btn-platform-primary {
  background: linear-gradient(135deg, var(--pa-gold) 0%, #9a7529 100%) !important;
  border: none !important;
  color: #0a0e1a !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  padding: 0.55rem 1.25rem !important;
  transition:
    filter 0.2s ease,
    transform 0.15s ease !important;
}
.btn-platform-primary:hover {
  filter: brightness(1.08);
  color: #0a0e1a !important;
}

.btn-platform-secondary {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(201, 169, 98, 0.35) !important;
  color: var(--pa-gold-soft) !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
}
.btn-platform-secondary:hover {
  background: rgba(201, 169, 98, 0.15) !important;
  color: #fff !important;
}

.btn-platform-ghost {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: rgba(220, 228, 248, 0.9) !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
}
.btn-platform-ghost:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

.btn-platform-outline {
  background: transparent !important;
  border: 1px solid rgba(201, 169, 98, 0.45) !important;
  color: var(--pa-gold-soft) !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
}
.btn-platform-outline:hover {
  background: rgba(201, 169, 98, 0.12) !important;
  color: #fff6e0 !important;
}

.btn-platform-success {
  background: rgba(16, 185, 129, 0.22) !important;
  border: 1px solid rgba(52, 211, 153, 0.45) !important;
  color: #a7f3d0 !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
}
.btn-platform-success:hover {
  background: rgba(16, 185, 129, 0.32) !important;
  color: #ecfdf5 !important;
}

.btn-platform-warn {
  background: rgba(245, 158, 11, 0.18) !important;
  border: 1px solid rgba(251, 191, 36, 0.45) !important;
  color: #fde68a !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
}
.btn-platform-warn:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  color: #fffbeb !important;
}

.btn-platform-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(248, 113, 113, 0.45) !important;
  color: #fecaca !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
}
.btn-platform-danger:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #fff !important;
}

.platform-btn-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.platform-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: min(280px, 55vw);
}

.platform-inline-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 9rem;
}

/* جداول */
.platform-table-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.platform-table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(201, 169, 98, 0.06);
  --bs-table-color: rgba(232, 236, 247, 0.97);
  --bs-table-striped-color: rgba(232, 236, 247, 0.97);
  color: rgba(232, 236, 247, 0.97) !important;
  margin-bottom: 0 !important;
}

.platform-table thead th {
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(220, 228, 252, 0.95) !important;
  font-weight: 700 !important;
  font-size: 0.82rem;
  text-transform: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 0.85rem 1rem !important;
  white-space: nowrap;
}

.platform-table tbody td {
  padding: 0.85rem 1rem !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  vertical-align: middle !important;
  color: rgba(232, 236, 247, 0.96) !important;
}

.platform-table tbody td .platform-code,
.platform-table tbody td .platform-code-sm {
  color: #c7d2fe !important;
}

.platform-admin-dashboard .platform-table .form-check-label {
  color: rgba(214, 222, 248, 0.9) !important;
}

/* حقول داخل الجداول — Bootstrap يفرض غالباً لوناً غامقاً */
.platform-admin-dashboard .platform-table .form-control,
.platform-admin-dashboard .platform-table .form-select {
  color: #e8ecf7 !important;
  background-color: rgba(8, 12, 24, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.platform-admin-dashboard .platform-table .form-control::placeholder {
  color: rgba(170, 182, 214, 0.55);
}

.platform-admin-dashboard .platform-table .form-select option {
  background-color: #12192e;
  color: #e8ecf7;
}

/* حقول التاريخ والوقت — نص فاتح + أيقونة تقويم واضحة (خاصة بدء/انتهاء السريان) */
.platform-admin-dashboard input[type="datetime-local"],
.platform-admin-dashboard input[type="date"],
.platform-admin-dashboard input[type="time"],
.platform-admin-dashboard input[type="month"] {
  color-scheme: dark;
  color: #e8ecf7 !important;
  background-color: rgba(8, 12, 24, 0.88) !important;
}

/*
 * Chromium/Safari: استبدال أيقونة التقويم الداكنة بأيقونة SVG فاتحة
 * (يفيد حقول #issueValidFrom و #issueExpiresAt وغيرها)
 */
.platform-admin-dashboard input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.platform-admin-dashboard input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0.15rem;
  margin-inline-start: 0.15rem;
  filter: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23e8d5a3' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3Cpath d='M11 7.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1zm-3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1zm-3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.platform-admin-dashboard input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  filter: invert(1) brightness(1.2);
}

.platform-admin-dashboard input[type="number"].platform-input {
  color-scheme: dark;
}

.platform-admin-dashboard .platform-panel-body .small,
.platform-admin-dashboard .platform-table .small {
  color: rgba(205, 214, 245, 0.9) !important;
}

.platform-col-wide {
  min-width: 260px;
}

.platform-col-actions {
  min-width: 160px;
}

.platform-empty {
  text-align: center;
  color: rgba(168, 178, 212, 0.75);
  padding: 2rem 1rem !important;
}

/* قائمة التجار — بطاقات بدل صفوف جدول مكدّسة */
.platform-tenant-list-wrap {
  padding: 0 0 0.25rem;
}

.platform-tenant-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.platform-tenant-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(165deg, rgba(12, 18, 34, 0.92) 0%, rgba(6, 10, 20, 0.78) 100%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.platform-tenant-card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.platform-tenant-card__head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  min-width: 0;
  flex: 1;
}

.platform-tenant-card__id {
  font-weight: 800;
  color: #fde68a;
  font-size: 0.92rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(252, 211, 77, 0.28);
  line-height: 1.2;
  flex-shrink: 0;
}

.platform-tenant-card__field {
  min-width: 0;
}

.platform-tenant-card__field--code {
  width: min(200px, 100%);
}

.platform-tenant-card__field--grow {
  flex: 1;
  min-width: min(240px, 100%);
}

.platform-tenant-card__lbl {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(196, 206, 236, 0.9);
  margin-bottom: 0.35rem;
}

.platform-tenant-card__status {
  align-self: center;
  text-transform: capitalize;
}

.platform-tenant-card__body {
  padding: 1.1rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.platform-tenant-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem 1.25rem;
}

.platform-tenant-card__readonly {
  display: block;
  font-size: 0.88rem;
  color: #e8ecf7;
  padding: 0.5rem 0.7rem;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  word-break: break-word;
  line-height: 1.45;
}

.platform-tenant-card__plan-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.platform-tenant-card__block {
  min-width: 0;
}

.platform-tenant-card__token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.platform-tenant-card__token-input {
  flex: 1 1 220px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.78rem !important;
}

.platform-tenant-card__token-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.platform-tenant-card__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.platform-tenant-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

/* إعدادات الرئيسية — فيديوهات يوتيوب (نموذج + جدول متناسق مع الوضع الداكن) */
.platform-landing-videos-add {
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(201, 169, 98, 0.22);
  background: linear-gradient(
    155deg,
    rgba(99, 102, 241, 0.08) 0%,
    rgba(7, 11, 20, 0.58) 48%,
    rgba(5, 8, 14, 0.42) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 12px 32px rgba(0, 0, 0, 0.18);
}

.platform-landing-videos-table-shell {
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  background: rgba(4, 7, 14, 0.5);
}

.platform-landing-vid-title {
  display: inline-block;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.98) !important;
  max-width: min(36rem, 52vw);
  word-break: break-word;
  line-height: 1.45;
}

.platform-landing-vid-yt-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fcd34d !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(252, 211, 77, 0.35);
  white-space: nowrap;
}

.platform-landing-vid-yt-link:hover {
  color: #fde68a !important;
  border-bottom-color: rgba(253, 230, 138, 0.65);
}

.platform-landing-vid-admin-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fcd34d !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(252, 211, 77, 0.35);
  white-space: nowrap;
}

.platform-landing-vid-admin-link:hover {
  color: #fde68a !important;
  border-bottom-color: rgba(253, 230, 138, 0.65);
}

/* صفحة تفاصيل مقطع يوتيوب (لوحة المنصّة — تبويب منفصل) */
.platform-lv-detail-section-inner {
  max-width: 960px;
  margin-inline: auto;
}

.platform-lv-detail-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.platform-lv-detail-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.platform-lv-detail-back {
  font-weight: 700;
  color: var(--pa-gold-soft) !important;
  text-decoration: none !important;
  font-size: 0.95rem;
}

.platform-lv-detail-back:hover {
  color: #fff !important;
}

.platform-lv-detail-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.platform-lv-detail-panel.platform-panel {
  overflow: hidden;
}

.platform-lv-detail-hero {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 992px) {
  .platform-lv-detail-hero {
    grid-template-columns: minmax(240px, 320px) 1fr;
  }
}

.platform-lv-detail-thumb-wrap {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
}

.platform-lv-detail-thumb {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 240px;
}

@media (min-width: 992px) {
  .platform-lv-detail-thumb {
    max-height: none;
    min-height: 280px;
  }
}

.platform-lv-detail-id-badge {
  position: absolute;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  padding: 0.28rem 0.6rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.72);
  color: #fde68a;
  border: 1px solid rgba(252, 211, 77, 0.4);
}

.platform-lv-detail-embed iframe {
  border: 0;
  width: 100%;
  height: 100%;
}

.platform-code {
  font-size: 0.88rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.platform-code-sm {
  font-size: 0.75rem;
  max-width: 180px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.platform-badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.platform-badge--info {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.platform-badge--ok {
  background: rgba(16, 185, 129, 0.18);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.platform-badge--warn {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.platform-badge--muted {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.platform-check .form-check-input {
  border-color: rgba(201, 169, 98, 0.45);
  background-color: rgba(7, 11, 20, 0.5);
}
.platform-check .form-check-input:checked {
  background-color: var(--pa-gold);
  border-color: var(--pa-gold);
}

/* مودال */
.platform-modal .platform-modal-content {
  background: linear-gradient(165deg, #12192e 0%, #0c1222 100%);
  border: 1px solid var(--pa-border);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.platform-muted {
  color: rgba(168, 178, 212, 0.9);
}

.platform-hr {
  border-color: rgba(255, 255, 255, 0.1);
}

/* توست */
.platform-toast-holder {
  position: fixed;
  top: 1rem;
  inset-inline-start: 1rem;
  z-index: 1080;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.platform-toast {
  pointer-events: auto;
  margin-bottom: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: rgba(15, 22, 42, 0.95);
  border: 1px solid rgba(201, 169, 98, 0.35);
  color: #e8ecf7;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.platform-toast--show {
  opacity: 1;
  transform: translateY(0);
}

/* شاشات متوسطة وصغيرة — القائمة الجانبية كدرج تحت عرض xl (يتوافق مع d-xl-none) */
@media (max-width: 1199.98px) {
  .platform-content {
    padding-inline: 1rem;
  }

  .platform-nav-backdrop {
    display: block;
  }

  .platform-admin-dashboard.platform-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .platform-shell {
    grid-template-columns: 1fr;
  }

  .platform-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(300px, calc(100vw - 2rem));
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    transform: translateX(-100%);
    box-shadow: -16px 0 56px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  [dir="rtl"] .platform-sidebar {
    transform: translateX(100%);
  }

  .platform-admin-dashboard.platform-nav-open .platform-sidebar {
    transform: translateX(0);
  }

  .platform-topbar {
    padding: 0.85rem 1rem;
  }

  .platform-page-sub {
    font-size: 0.85rem;
  }
}

@media (max-width: 575.98px) {
  .platform-user-pill {
    display: none !important;
  }

  .platform-content {
    padding: 1rem 0.75rem 2rem;
  }

  .platform-stat-card {
    min-height: 100px;
  }

  .platform-panel-body {
    padding: 1rem 1rem 1.15rem;
  }

  .platform-table thead th,
  .platform-table tbody td {
    padding: 0.65rem 0.65rem !important;
    font-size: 0.82rem;
  }
}

/* --- معاينة سيرفرات Discord — لوحة إدارة المنصّة --- */
.platform-discord-bot-hero {
  border-radius: 20px;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(15, 23, 42, 0.55));
  border: 1px solid var(--pa-border, rgba(201, 169, 98, 0.18));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.platform-discord-bot-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.platform-discord-bot-avatar {
  border-radius: 22px;
  object-fit: cover;
  border: 2px solid rgba(201, 169, 98, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.platform-discord-bot-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--pa-gold-soft, #e8d5a3);
  letter-spacing: -0.02em;
}

.platform-discord-bot-handle {
  opacity: 0.85;
}

.platform-discord-guild-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(15, 22, 42, 0.78);
  border: 1px solid rgba(201, 169, 98, 0.16);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.platform-discord-guild-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--guild-banner);
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  pointer-events: none;
}

.platform-discord-guild-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.15) 0%, rgba(8, 11, 22, 0.92) 48%, rgba(8, 11, 22, 0.97) 100%);
  pointer-events: none;
}

.platform-discord-guild-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 169, 98, 0.32);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
}

.platform-discord-guild-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1.1rem 1.15rem 0.65rem;
}

.platform-discord-guild-icon {
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.platform-discord-guild-meta {
  min-width: 0;
}

.platform-discord-guild-title {
  font-size: 1.08rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  line-height: 1.25;
  word-break: break-word;
}

.platform-discord-guild-id code {
  font-size: 0.72rem;
  opacity: 0.65;
  word-break: break-all;
}

.platform-discord-guild-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding: 0 1.15rem 0.85rem;
}

.platform-discord-guild-stats > div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
}

.platform-discord-guild-stat-label {
  display: block;
  font-size: 0.72rem;
  color: rgba(186, 198, 232, 0.72);
  margin-bottom: 0.2rem;
}

.platform-discord-guild-stats strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f1f4fd;
}

.platform-discord-guild-merchants {
  position: relative;
  z-index: 1;
  padding: 0 1.15rem 1.1rem;
  margin-top: auto;
}

.platform-discord-guild-chip {
  display: inline-block;
  margin: 0.2rem 0 0 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(99, 102, 241, 0.22);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #e0e7ff;
}

.platform-discord-guilds-panel .platform-panel-head .small {
  max-width: 52rem;
}

/* --- لوحة التاجر (ثيم فاتح — نفس النمط والحركة، بدون الخلفية الداكنة) --- */
.merchant-portal-dashboard {
  margin: 0;
  min-height: 100vh;
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(ellipse 90% 55% at 50% -8%, rgba(99, 102, 241, 0.12), transparent 52%),
    linear-gradient(165deg, #f8fafc 0%, #eef2ff 42%, #f1f5f9 100%);
  color: #1e293b;
  color-scheme: light;
  --mp-gold: #b8860b;
  --mp-gold-mid: #c9a962;
  --mp-gold-soft: #f5edd6;
  --mp-card: rgba(255, 255, 255, 0.94);
  --mp-border: rgba(201, 169, 98, 0.28);
  --mp-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
}

.merchant-shell {
  display: grid;
  grid-template-columns: minmax(230px, 272px) 1fr;
  min-height: 100vh;
  position: relative;
}

.merchant-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(5px);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.32s ease,
    visibility 0.32s ease;
}

.merchant-portal-dashboard.merchant-nav-open .merchant-nav-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.merchant-sidebar {
  position: relative;
  z-index: 1040;
  padding: 1.35rem 1rem 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-inline-start: 1px solid var(--mp-border);
  box-shadow: -8px 0 36px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0.35, 1);
  will-change: transform;
}

.merchant-brand--with-close {
  flex-wrap: nowrap;
  gap: 0.6rem;
}

.merchant-portal-dashboard .dash-drawer-close {
  flex-shrink: 0;
  margin-inline-start: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(201, 169, 98, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #78350f;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.merchant-portal-dashboard .dash-drawer-close:hover {
  background: rgba(245, 237, 211, 0.95);
  border-color: rgba(201, 169, 98, 0.55);
}

.merchant-portal-dashboard .dash-drawer-close:active {
  transform: scale(0.94);
}

.merchant-portal-dashboard.merchant-nav-open .merchant-menu-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.merchant-portal-dashboard.merchant-nav-open .merchant-menu-btn span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.merchant-portal-dashboard.merchant-nav-open .merchant-menu-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.merchant-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.6rem;
  padding-inline: 0.25rem;
}

.merchant-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f5e6c8 0%, var(--mp-gold-mid) 45%, #8b6914 100%);
  box-shadow: 0 8px 24px rgba(184, 134, 11, 0.28);
}

.merchant-brand-mark:has(.site-logo-img) {
  background: transparent;
  box-shadow: none;
  width: auto;
  height: auto;
  min-height: 42px;
}

.merchant-brand-mark .site-logo-img {
  max-height: 42px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.merchant-brand-text {
  font-weight: 800;
  font-size: 1.08rem;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.merchant-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.merchant-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1rem;
  border-radius: 14px;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    transform 0.18s ease,
    box-shadow 0.22s ease;
}

.merchant-nav-link:hover {
  background: rgba(201, 169, 98, 0.12);
  color: #92400e;
}

.merchant-nav-link.active {
  background: linear-gradient(135deg, rgba(245, 237, 211, 0.95), rgba(255, 255, 255, 0.98));
  border-color: rgba(201, 169, 98, 0.45);
  color: #78350f;
  box-shadow: 0 10px 28px rgba(180, 140, 40, 0.12);
}

.merchant-nav-ico {
  width: 1.35rem;
  text-align: center;
  font-size: 1rem;
  opacity: 0.88;
}

.merchant-main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.merchant-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  padding: 1rem 1.35rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
}

.merchant-topbar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.merchant-menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 98, 0.45);
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.merchant-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #92400e;
  border-radius: 2px;
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0.35, 1),
    opacity 0.22s ease;
}

.merchant-page-title {
  font-size: clamp(1.15rem, 2.5vw, 1.42rem);
  font-weight: 800;
  color: #0f172a;
}

.merchant-page-sub {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.55;
}

.merchant-content {
  flex: 1;
  padding: 1.25rem 1.35rem 2.75rem;
  max-width: 1680px;
  margin-inline: auto;
  width: 100%;
}

/* بطاقات إحصاء فاتحة */
.merchant-stat-card {
  position: relative;
  border-radius: 20px;
  padding: 1.2rem 1.25rem;
  min-height: 104px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--mp-shadow);
  overflow: hidden;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
  animation: mp-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.merchant-stat-card:nth-child(1) {
  animation-delay: 0.03s;
}
.merchant-stat-card:nth-child(2) {
  animation-delay: 0.06s;
}
.merchant-stat-card:nth-child(3) {
  animation-delay: 0.09s;
}
.merchant-stat-card:nth-child(4) {
  animation-delay: 0.12s;
}

@keyframes mp-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.merchant-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.1);
}

.merchant-stat-card--sky {
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 55%, #f8fafc 100%);
}
.merchant-stat-card--mint {
  background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 55%, #f8fafc 100%);
}
.merchant-stat-card--peach {
  background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 55%, #ffffff 100%);
}
.merchant-stat-card--goldlight {
  background: linear-gradient(145deg, #fffbeb 0%, #fde68a 35%, #fef3c7 100%);
}
.merchant-stat-card--amber {
  background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 50%, #ffffff 100%);
}
.merchant-stat-card--teal {
  background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 55%, #ffffff 100%);
}
.merchant-stat-card--rose {
  background: linear-gradient(145deg, #fff1f2 0%, #ffe4e6 55%, #ffffff 100%);
}
.merchant-stat-card--violet {
  background: linear-gradient(145deg, #f5f3ff 0%, #e9d5ff 45%, #faf5ff 100%);
}

.merchant-stat-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

.merchant-stat-value {
  font-size: clamp(1.55rem, 2.8vw, 2rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

/* لوحات — إعادة استخدام أسماء الكلاسات القديمة */
.merchant-portal-dashboard .panel-card {
  border-radius: 20px;
  background: var(--mp-card);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--mp-shadow);
  overflow: hidden;
  animation: mp-panel-in 0.48s ease backwards;
}

.merchant-portal-dashboard .panel-card:nth-of-type(1) {
  animation-delay: 0.05s;
}

@keyframes mp-panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.merchant-portal-dashboard .panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-weight: 800;
  font-size: 1.02rem;
  color: #0f172a;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
}

.merchant-portal-dashboard .main-area,
.merchant-portal-dashboard .topbar {
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.merchant-portal-dashboard .soft-muted {
  color: #64748b !important;
}

.merchant-portal-dashboard .form-label {
  color: #334155;
  font-weight: 600;
}

.merchant-portal-dashboard .form-control,
.merchant-portal-dashboard .form-select {
  border-radius: 12px;
  border-color: rgba(148, 163, 184, 0.35);
  background-color: #ffffff;
  color: #0f172a;
}

.merchant-portal-dashboard .form-control:focus,
.merchant-portal-dashboard .form-select:focus {
  border-color: rgba(201, 169, 98, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(201, 169, 98, 0.18);
}

.merchant-portal-dashboard .table thead th {
  background: #f1f5f9 !important;
  color: #334155 !important;
  font-weight: 700 !important;
  border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

.merchant-portal-dashboard .table tbody td {
  color: #1e293b !important;
  border-color: rgba(226, 232, 240, 0.95) !important;
}

.merchant-portal-dashboard .table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(201, 169, 98, 0.06);
}

.merchant-portal-dashboard .license-toolbar {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.merchant-portal-dashboard .license-focus {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #475569 !important;
}

.merchant-portal-dashboard .details-item {
  background: #ffffff;
  border-color: rgba(226, 232, 240, 0.95);
}

.merchant-portal-dashboard .empty-state {
  color: #64748b !important;
}

.merchant-portal-dashboard .btn-primary {
  background: linear-gradient(135deg, #e8c547 0%, #b8860b 100%);
  border: none;
  color: #1a1408 !important;
  font-weight: 700;
  border-radius: 12px;
}

.merchant-portal-dashboard .btn-primary:hover {
  filter: brightness(1.05);
  color: #1a1408 !important;
}

.merchant-portal-dashboard .btn-success {
  border-radius: 12px;
  font-weight: 600;
}

.merchant-portal-dashboard .btn-outline-primary {
  border-color: rgba(201, 169, 98, 0.55);
  color: #92400e !important;
  border-radius: 12px;
  font-weight: 600;
}

.merchant-portal-dashboard .btn-outline-primary:hover {
  background: rgba(201, 169, 98, 0.12);
  color: #78350f !important;
}

.merchant-portal-dashboard .btn-outline-secondary,
.merchant-portal-dashboard .btn-outline-dark {
  border-radius: 12px;
}

.merchant-portal-dashboard .btn-dark {
  border-radius: 12px;
  background: #1e293b;
  border-color: #1e293b;
}

.btn-merchant-logout {
  border-radius: 12px !important;
  font-weight: 600 !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #b91c1c !important;
  background: rgba(254, 226, 226, 0.55) !important;
}

.btn-merchant-logout:hover {
  background: rgba(254, 202, 202, 0.85) !important;
  color: #991b1b !important;
}

/* بطاقة رخصة الجهاز تبقى داكنة كعنصر بصري بارز على الخلفية الفاتحة */
.merchant-portal-dashboard .device-license-card {
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.18);
}

/* عرض Markdown — تبويب التعليمات */
.merchant-portal-dashboard .merchant-md-doc {
  font-size: 0.98rem;
  line-height: 1.78;
  color: #334155;
  max-width: 52rem;
}

.merchant-portal-dashboard .merchant-md-doc h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  color: #0f172a;
  margin-top: 0;
  margin-bottom: 1rem;
}

.merchant-portal-dashboard .merchant-md-doc h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1e293b;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.merchant-portal-dashboard .merchant-md-doc h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  margin-top: 1.35rem;
  margin-bottom: 0.5rem;
}

.merchant-portal-dashboard .merchant-md-doc p {
  margin-bottom: 0.85rem;
}

.merchant-portal-dashboard .merchant-md-doc ul,
.merchant-portal-dashboard .merchant-md-doc ol {
  padding-inline-start: 1.35rem;
  margin-bottom: 1rem;
}

.merchant-portal-dashboard .merchant-md-doc li {
  margin-bottom: 0.35rem;
}

.merchant-portal-dashboard .merchant-md-doc hr {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  margin: 1.5rem 0;
}

.merchant-portal-dashboard .merchant-md-doc pre {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 1rem 0;
}

.merchant-portal-dashboard .merchant-md-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(241, 245, 249, 0.95);
  padding: 0.12rem 0.42rem;
  border-radius: 7px;
  font-size: 0.88em;
  border: 1px solid rgba(226, 232, 240, 0.95);
}

.merchant-portal-dashboard .merchant-md-doc pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.merchant-portal-dashboard .merchant-md-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.merchant-portal-dashboard .merchant-md-doc th,
.merchant-portal-dashboard .merchant-md-doc td {
  border: 1px solid rgba(226, 232, 240, 0.95);
  padding: 0.55rem 0.75rem;
  vertical-align: top;
}

.merchant-portal-dashboard .merchant-md-doc th {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  font-weight: 700;
  color: #0f172a;
}

.merchant-portal-dashboard .merchant-md-doc blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-inline-start: 4px solid rgba(201, 169, 98, 0.75);
  background: rgba(255, 251, 235, 0.55);
  border-radius: 0 14px 14px 0;
  color: #57534e;
}

.merchant-portal-dashboard .merchant-md-doc blockquote p:last-child {
  margin-bottom: 0;
}

.merchant-portal-dashboard .merchant-md-doc strong {
  color: #0f172a;
}

.merchant-toast-holder {
  position: fixed;
  top: 1rem;
  inset-inline-start: 1rem;
  z-index: 1080;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.merchant-toast {
  pointer-events: auto;
  margin-bottom: 0.45rem;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(201, 169, 98, 0.4);
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.merchant-toast--show {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .merchant-stat-card,
  .merchant-portal-dashboard .panel-card,
  .merchant-toast,
  .merchant-sidebar,
  .merchant-nav-backdrop,
  .merchant-menu-btn span {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1199.98px) {
  .merchant-content {
    padding-inline: 1.1rem;
  }

  .merchant-nav-backdrop {
    display: block;
  }

  .merchant-portal-dashboard.merchant-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .merchant-shell {
    grid-template-columns: 1fr;
  }

  .merchant-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(300px, calc(100vw - 2rem));
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    transform: translateX(-100%);
    box-shadow: -16px 0 48px rgba(15, 23, 42, 0.12);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  [dir="rtl"] .merchant-sidebar {
    transform: translateX(100%);
  }

  .merchant-portal-dashboard.merchant-nav-open .merchant-sidebar {
    transform: translateX(0);
  }

  .merchant-topbar {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 575.98px) {
  .merchant-content {
    padding: 1rem 0.75rem 2rem;
  }

  .merchant-page-sub {
    font-size: 0.84rem;
  }
}

/* إخفاء أشرطة التمرير الافتراضية — التمرير بالعجلة واللمس والسحب يبقى كما هو */
html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.overflow-auto,
.overflow-y-auto,
.overflow-x-auto,
.table-responsive,
.modal-body,
.platform-sidebar,
.merchant-sidebar,
.signup-wrap,
.licenses-layout__full {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.overflow-auto::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar,
.overflow-x-auto::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.platform-sidebar::-webkit-scrollbar,
.merchant-sidebar::-webkit-scrollbar,
.signup-wrap::-webkit-scrollbar,
.licenses-layout__full::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
