/* =========================================================
   سودسود — Design System v5.1
   Light Sidebar · Clean Professional
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand */
  --accent:         #F97316;
  --accent-2:       #EA580C;
  --accent-hover:   #EA580C;
  --accent-soft:    rgba(249,115,22,0.10);
  --accent-soft-2:  rgba(249,115,22,0.15);

  /* Status */
  --success:        #10B981;
  --success-soft:   rgba(16,185,129,0.12);
  --success-text:   #065F46;
  --warn:           #F59E0B;
  --warning:        #F59E0B;
  --warn-soft:      rgba(245,158,11,0.12);
  --warn-text:      #92400E;
  --danger:         #EF4444;
  --danger-soft:    rgba(239,68,68,0.10);
  --danger-text:    #991B1B;
  --info:           #1E3A5F;
  --info-soft:      rgba(30,58,95,0.10);
  --info-text:      #0F2340;
  --teal:           #14B8A6;
  --teal-soft:      rgba(20,184,166,0.12);
  --teal-text:      #0F766E;

  /* Surfaces */
  --bg:             #F1F5F9;
  --bg-main:        #F1F5F9;
  --card:           #FFFFFF;
  --bg-card:        #FFFFFF;

  /* Sidebar — LIGHT */
  --side-bg:        #FFFFFF;
  --side-border:    #E2E8F0;
  --side-text:      #475569;
  --side-text-mute: #94A3B8;
  --side-hover-bg:  #F8FAFC;
  --side-active-bg: rgba(249,115,22,0.08);
  --side-active-tx: #EA580C;
  --side-w:         260px;
  --sidebar-width:  260px;

  /* Text */
  --text:           #0F172A;
  --text-primary:   #0F172A;
  --text-2:         #334155;
  --text-secondary: #334155;
  --text-3:         #64748B;
  --text-muted:     #94A3B8;

  /* Lines */
  --border:         #E2E8F0;
  --border-strong:  #CBD5E1;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(15,23,42,0.05);
  --shadow:     0 1px 3px rgba(15,23,42,0.07), 0 4px 16px rgba(15,23,42,0.05);
  --shadow-md:  0 4px 12px rgba(15,23,42,0.08), 0 12px 32px rgba(15,23,42,0.06);
  --shadow-lg:  0 16px 48px rgba(15,23,42,0.12);

  /* Radius */
  --r-sm:   8px;
  --r:      12px;
  --r-lg:   16px;
  --r-xl:   22px;
  --r-pill: 999px;
  --radius-sm: 8px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Spacing */
  --gap: 20px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }

/* =========================================================
   LAYOUT
   ========================================================= */

.app, .dashboard-layout {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
  direction: rtl;
}

/* =========================================================
   SIDEBAR — Light
   ========================================================= */

.sidebar {
  background: var(--side-bg);
  border-inline-start: 1px solid var(--side-border);
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -2px 0 12px rgba(15,23,42,0.06);
}

/* Brand */
.brand, .sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--side-border);
  flex-shrink: 0;
}
.brand-logo { display: flex; align-items: center; gap: 12px; }
.brand-mark, .brand-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg,#F97316,#EA580C);
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 17px;
  box-shadow: 0 4px 12px rgba(249,115,22,0.30);
  flex-shrink: 0;
}
.brand-name, .brand-text {
  font-size: 17px; font-weight: 800;
  color: var(--text); letter-spacing: -0.02em;
}
.brand-text span { color: var(--accent); }
.brand-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* Profile */
.profile-mini, .user-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--side-border);
  flex-shrink: 0;
  background: #FAFBFC;
}
.avatar, .user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg,#F97316,#8B5CF6);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.profile-mini .who, .user-name {
  font-size: 13px; font-weight: 700; color: var(--text);
}
.profile-mini .role, .user-role {
  font-size: 11px; color: var(--text-muted); margin-top: 1px;
}
.profile-mini .dot {
  width: 7px; height: 7px;
  background: var(--success); border-radius: 50%;
  margin-inline-start: auto; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.2);
}

/* Nav */
.sidebar-scroll, .sidebar-nav {
  overflow-y: auto; flex: 1;
  padding: 10px 12px 20px;
}
.nav-group { margin-bottom: 4px; }
.nav-group-title, .nav-section-title {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 14px 10px 6px;
  display: block;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--side-text);
  font-size: 13px; font-weight: 500;
  margin-bottom: 1px;
  transition: background 0.12s, color 0.12s;
  text-decoration: none; cursor: pointer;
  position: relative;
}
.nav-item:hover {
  background: var(--side-hover-bg);
  color: var(--text);
}
.nav-item.active {
  background: var(--side-active-bg);
  color: var(--side-active-tx);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  inset-inline-end: -12px;
  top: 7px; bottom: 7px;
  width: 3px;
  background: var(--accent);
  border-radius: 99px 0 0 99px;
}
.nav-icon, .ico {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  flex-shrink: 0; font-size: 15px;
  opacity: 0.7;
}
.nav-item.active .nav-icon,
.nav-item.active .ico { opacity: 1; }
.nv-badge {
  margin-inline-start: auto;
  background: #F1F5F9; color: var(--text-3);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
}
.nv-badge.hot { background: var(--accent); color: white; }

/* Submenu */
.nav-section { padding: 0; }
.nav-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--side-text);
  font-size: 13px; font-weight: 500;
  margin-bottom: 1px;
  cursor: pointer; user-select: none;
  transition: background 0.12s;
}
.nav-toggle:hover { background: var(--side-hover-bg); }
.nav-toggle .arrow { margin-inline-start: auto; font-size: 10px; transition: transform 0.2s; }
.nav-toggle.open .arrow { transform: rotate(90deg); }
.nav-submenu { padding-inline-start: 8px; max-height: 0; overflow: hidden; transition: max-height 0.25s; }
.nav-submenu.active { max-height: 300px; }
.nav-submenu .nav-item { font-size: 12.5px; padding: 7px 12px; }


/* ── Campaign Submenu ── */
.nav-parent { user-select: none; }
.nav-sub { overflow: hidden; max-height: 0; transition: max-height 0.25s ease; }
.nav-sub:not(.collapsed) { max-height: 200px; }
.nav-sub.collapsed { max-height: 0; }
.nav-sub-item { font-size: 12.5px !important; padding-right: 32px !important; padding-top: 7px !important; padding-bottom: 7px !important; }
.nav-parent.open .chevron { transform: rotate(180deg) !important; }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--side-border);
  flex-shrink: 0;
}
.version-info { font-size: 11px; color: var(--text-muted); }

/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main-content, .main {
  min-width: 0; background: var(--bg);
  display: flex; flex-direction: column;
}

/* ─── Topbar ─── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(241,245,249,0.90);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.page-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; white-space: nowrap; }

.tb-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 12px;
  min-width: 220px; color: var(--text-3); font-size: 13px;
}
.tb-search input { border: 0; outline: 0; background: transparent; width: 100%; font: inherit; color: var(--text); }

.wallet-badge, .tb-wallet {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 12px;
  font-size: 12.5px; color: var(--text-3);
  text-decoration: none; white-space: nowrap;
}
.wallet-badge span:last-child,
.tb-wallet .amt { font-weight: 700; color: var(--text); }

.action-btn, .tb-icon-btn {
  position: relative; width: 36px; height: 36px;
  border-radius: 9px; background: var(--card);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-2); transition: 0.15s; font-size: 16px;
  text-decoration: none;
}
.action-btn:hover, .tb-icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.nbadge, .notification-count {
  position: absolute; top: -4px; inset-inline-start: -4px;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px;
  border-radius: 99px; display: grid; place-items: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--bg);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 0 rgba(249,115,22,0.4); }
  50%      { box-shadow: 0 0 0 2px var(--bg), 0 0 0 6px rgba(249,115,22,0); }
}

.tb-avatar {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 12px 3px 3px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 99px; font-size: 12px; color: var(--text-2);
}
.tb-avatar .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#F97316,#8B5CF6);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 11px;
}

.mobile-menu-toggle {
  display: none;
  background: var(--accent); color: white; border: none;
  width: 36px; height: 36px; border-radius: 8px;
  place-items: center; font-size: 18px; flex-shrink: 0;
}

/* ─── Sidebar overlay ─── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(3px);
  z-index: 90; opacity: 0; transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* ─── Content area ─── */
.content-area { padding: 24px; flex: 1; }

/* =========================================================
   CARDS
   ========================================================= */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
}
.card-header, .card-head {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.card-title { font-size: 14.5px; font-weight: 700; color: var(--text); margin: 0; }
.card-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-body  { padding: 20px; }
.card-pad-sm { padding: 14px; }

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 7px;
  background: var(--accent); color: white;
  border: 0; border-radius: var(--r-sm);
  padding: 9px 18px;
  font-weight: 600; font-size: 13px;
  transition: 0.15s; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(249,115,22,0.22);
  white-space: nowrap;
}
.btn:hover { background: var(--accent-2); color: white; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(249,115,22,0.28); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-2); color: white; }

.btn-secondary, .btn-light, .btn-outline {
  background: #F1F5F9; color: var(--text); border: 0; box-shadow: none;
}
.btn-secondary:hover, .btn-light:hover, .btn-outline:hover { background: #E2E8F0; color: var(--text); box-shadow: none; transform: none; }

.btn-ghost, .btn-outline-primary {
  background: transparent; color: var(--text-2);
  border: 1.5px solid var(--border); box-shadow: none;
}
.btn-ghost:hover, .btn-outline-primary:hover { border-color: var(--accent); color: var(--accent); background: transparent; box-shadow: none; transform: none; }

.btn-success { background: var(--success); color: white; }
.btn-danger  { background: var(--danger);  color: white; }
.btn-warning { background: var(--warn);    color: white; }

.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 22px; font-size: 14px; }
.btn-block, .btn-full, .w-100 { width: 100%; }

.submit-btn, .btn-save-settings, .btn-save-page {
  background: var(--accent); color: white; border: 0;
  padding: 12px 28px; border-radius: var(--r-sm);
  font-weight: 700; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: 0.15s;
  box-shadow: 0 2px 8px rgba(249,115,22,0.25);
}
.submit-btn:hover, .btn-save-settings:hover, .btn-save-page:hover { background: var(--accent-2); transform: translateY(-1px); }

/* =========================================================
   BADGES & STATUS
   ========================================================= */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--r-pill); padding: 3px 10px;
  font-size: 11.5px; font-weight: 600;
}
.badge-success, .badge.success, .badge-active  { background: var(--success-soft); color: var(--success-text); }
.badge-danger,  .badge.danger,  .badge-inactive { background: var(--danger-soft);  color: var(--danger-text); }
.badge-warning, .badge.warn                     { background: var(--warn-soft);    color: var(--warn-text); }
.badge-info,    .badge.info                     { background: var(--info-soft);    color: var(--info-text); }
.badge-primary, .badge.brand                    { background: var(--accent-soft);  color: var(--accent-2); }
.badge-neutral, .badge.neutral                  { background: #F1F5F9;             color: var(--text-2); }
.badge-new  { background: var(--accent-soft); color: var(--accent-2); }
.badge-free { background: #F1F5F9; color: var(--text-2); }
.badge-diamond { background: rgba(99,102,241,0.12); color: #4338CA; }

/* Status badges used inline */
.status-badge, .stat-badge {
  display: inline-block; padding: 4px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.status-pending, .badge-pending  { background: var(--warn-soft);    color: var(--warn-text); }
.status-paid                     { background: var(--info-soft);    color: var(--info-text); }
.status-processing, .badge-process { background: var(--info-soft);  color: var(--info-text); }
.status-shipped,  .badge-shipped { background: var(--teal-soft);    color: var(--teal-text); }
.status-completed,.badge-done,
.status-approved, .badge-approved { background: var(--success-soft); color: var(--success-text); }
.status-cancelled,.badge-canceled,
.status-closed,   .badge-rejected { background: var(--danger-soft);  color: var(--danger-text); }
.status-open,     .badge-open    { background: var(--accent-soft);  color: var(--accent-2); }
.status-answered                 { background: var(--teal-soft);    color: var(--teal-text); }
.status-waiting                  { background: var(--warn-soft);    color: var(--warn-text); }

/* =========================================================
   ALERTS
   ========================================================= */

.alert {
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: 13.5px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--success-soft); color: var(--success-text); }
.alert-danger,
.alert-error   { background: var(--danger-soft);  color: var(--danger-text); }
.alert-warning { background: var(--warn-soft);    color: var(--warn-text); }
.alert-info    { background: var(--info-soft);    color: var(--info-text); }

/* =========================================================
   FORMS
   ========================================================= */

.form-group, .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label, .field label, .form-label {
  font-size: 13px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 4px;
}
.form-text, .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.form-control, .input, .textarea, .select {
  width: 100%; background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 14px;
  font: inherit; font-size: 13.5px; color: var(--text);
  transition: 0.15s; outline: none; direction: rtl;
}
.form-control::placeholder, .input::placeholder { color: var(--text-muted); }
.form-control:focus, .input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.form-control, .textarea { min-height: 90px; resize: vertical; line-height: 1.7; }
select.form-control, .select { appearance: none; }

.input-group {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--card); overflow: hidden; transition: 0.15s;
}
.input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-group .ig-addon, .input-group-text {
  padding: 0 12px; display: grid; place-items: center;
  background: #F8FAFC; color: var(--text-3);
  font-size: 12.5px; border-inline-start: 1px solid var(--border);
  white-space: nowrap;
}
.input-group .ig-addon.start { border-inline-start: 0; border-inline-end: 1px solid var(--border); }
.input-group input, .input-group .form-control {
  border: 0 !important; outline: 0 !important;
  background: transparent !important; box-shadow: none !important;
  padding: 10px 14px; font: inherit; font-size: 13.5px;
  color: var(--text); flex: 1; min-width: 0;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Toggle */
.toggle-switch, .toggle {
  --w: 40px; --h: 22px;
  position: relative; width: var(--w); height: var(--h);
  background: #CBD5E1; border-radius: 99px;
  transition: background 0.18s; flex-shrink: 0; cursor: pointer; border: 0;
  display: inline-block;
}
.toggle-switch::after, .toggle::after {
  content: ''; position: absolute;
  top: 2px; inset-inline-end: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: 0.18s;
}
.toggle-switch.on, .toggle.on { background: var(--accent); }
.toggle-switch.on::after, .toggle.on::after { inset-inline-end: calc(var(--w) - 20px); }
.toggle-slider { /* fallback */ }
input[type=checkbox].toggle-switch { appearance: none; }

.toggle-row {
  display: flex; align-items: center;
  justify-content: space-between; padding: 12px 0; gap: 16px;
}
.toggle-row + .toggle-row { border-top: 1px solid var(--border); }
.toggle-row .lbl-main { font-weight: 600; font-size: 13.5px; }
.toggle-row .lbl-sub  { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Color picker */
.color-picker-wrap { display: flex; align-items: center; gap: 12px; }
.color-picker-wrap input[type=color] { width: 50px; height: 44px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; padding: 2px; background: none; }
.color-preview { flex: 1; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; transition: background 0.3s; }
.color-palette, .color-selector { display: flex; gap: 10px; flex-wrap: wrap; }
.palette-item, .color-option, .color-sw {
  width: 32px; height: 32px; border-radius: 9px;
  cursor: pointer; border: 2px solid white;
  box-shadow: 0 0 0 1px var(--border); transition: 0.15s;
}
.palette-item:hover, .color-option:hover, .color-sw:hover { transform: scale(1.1); }
.palette-item.selected, .color-sw.on { box-shadow: 0 0 0 2px var(--accent); }

/* Upload areas */
.upload-area, .file-upload-area {
  border: 2px dashed var(--border-strong); border-radius: var(--r);
  padding: 24px; background: #FAFBFC;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center; cursor: pointer; transition: 0.15s;
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-soft); }
.logo-upload-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.logo-preview {
  width: 80px; height: 80px; border-radius: 12px;
  border: 2px dashed var(--border); display: flex;
  align-items: center; justify-content: center;
  font-size: 28px; overflow: hidden; background: #F7FAFC;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

/* =========================================================
   TABLES
   ========================================================= */

.table-responsive, .table-wrap { overflow-x: auto; }
table.table, table.tbl {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.table thead th, .tbl thead th {
  background: #F8FAFC; color: var(--text-3);
  font-weight: 600; font-size: 12px;
  text-align: right; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td, .tbl tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.table tbody tr:hover td, .tbl tbody tr:hover td { background: #FAFBFC; }
.table tbody tr:last-child td, .tbl tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, monospace; }

/* =========================================================
   GRID & ROW HELPERS
   ========================================================= */

.row { display: flex; gap: var(--gap); flex-wrap: wrap; }
.col-1  { flex: 1 1 8%; min-width: 0; }
.col-2  { flex: 1 1 16%; min-width: 0; }
.col-3  { flex: 1 1 calc(25% - 15px); min-width: 180px; }
.col-4  { flex: 1 1 calc(33% - 14px); min-width: 200px; }
.col-6  { flex: 1 1 calc(50% - 10px); min-width: 0; }
.col-7  { flex: 2 1 calc(58% - 10px); min-width: 0; }
.col-8  { flex: 2 1 calc(66% - 10px); min-width: 0; }
.col-9  { flex: 3 1 calc(75% - 10px); min-width: 0; }
.col-12 { flex: 1 1 100%; }

.grid       { display: grid; gap: var(--gap); }
.flex       { display: flex; }
.stack      { display: flex; flex-direction: column; gap: 14px; }
.row-between{ display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-flex   { display: flex; align-items: center; gap: 12px; }

/* =========================================================
   STAT CARDS
   ========================================================= */

.dashboard-stats, .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap); margin-bottom: 24px;
}
.stat-card, .stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 20px 22px; position: relative;
  overflow: hidden; transition: 0.2s;
}
.stat-card:hover, .stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before, .stat::before {
  content: ''; position: absolute;
  inset-block: 16px; inset-inline-end: 0;
  width: 3px; border-radius: 99px;
  background: var(--accent);
}
.stat-card.blue::before  { background: var(--accent); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before{ background: var(--warn); }
.stat-card.purple::before{ background: #8B5CF6; }
.stat.s-orange::before   { background: var(--accent); }
.stat.s-blue::before     { background: var(--info); }
.stat.s-green::before    { background: var(--success); }
.stat.s-amber::before    { background: var(--warn); }

.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat-row    { display: flex; align-items: flex-start; gap: 14px; }
.stat-icon, .stat-ico {
  width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center;
  flex-shrink: 0; font-size: 21px;
}
.stat-card.blue   .stat-icon, .stat.s-orange .stat-ico { background: var(--accent-soft);   color: var(--accent); }
.stat-card.green  .stat-icon, .stat.s-green .stat-ico  { background: var(--success-soft);  color: var(--success); }
.stat-card.orange .stat-icon, .stat.s-amber .stat-ico  { background: var(--warn-soft);     color: var(--warn); }
.stat-card.purple .stat-icon                            { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.stat.s-blue .stat-ico                                  { background: var(--info-soft);     color: var(--info); }

.stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); margin-top: 4px; letter-spacing: -0.02em; }
.stat-unit  { font-size: 12px; color: var(--text-3); font-weight: 400; margin-inline-start: 4px; }
.stat-meta  { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; margin-top: 8px; color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* =========================================================
   DASHBOARD LAYOUT BLOCKS
   ========================================================= */

.dashboard-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--gap); margin-bottom: var(--gap);
}
.dash-row-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.dash-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }

/* Orders table card */
.orders-table {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: var(--gap);
}
.orders-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.orders-title { font-size: 15px; font-weight: 700; margin: 0; }

/* Chart card */
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: var(--gap); }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-title  { font-size: 15px; font-weight: 700; margin: 0; }

/* =========================================================
   SUBSCRIPTION CARD
   ========================================================= */

.subscription-card, .sub-card {
  border-radius: var(--r); padding: 22px; color: white;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg,#059669,#047857 60%,#065F46);
  box-shadow: 0 8px 24px rgba(5,150,105,0.22);
  margin-bottom: var(--gap);
}
.subscription-card.inactive, .sub-card.expired {
  background: linear-gradient(135deg,#DC2626,#B91C1C 60%,#991B1B);
  box-shadow: 0 8px 24px rgba(220,38,38,0.22);
}
.subscription-icon { font-size: 38px; margin-bottom: 10px; }
.subscription-title { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.subscription-meta  { font-size: 13px; opacity: 0.9; margin-bottom: 12px; }
.subscription-progress { height: 6px; background: rgba(255,255,255,0.25); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.subscription-progress-bar { height: 100%; background: white; border-radius: 99px; }
.subscription-days  { font-size: 12px; opacity: 0.85; }
.subscription-warning { background: var(--warn-soft); color: var(--warn-text); padding: 14px 16px; border-radius: var(--r-sm); margin-bottom: var(--gap); }

/* =========================================================
   SHOP CARD
   ========================================================= */

.shop-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; margin-bottom: var(--gap); }
.shop-header { text-align: center; margin-bottom: 16px; }
.shop-icon   { font-size: 44px; margin-bottom: 10px; }
.shop-name   { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.shop-url    {
  background: #F8FAFC; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  font-size: 12.5px; color: var(--accent);
  word-break: break-all; direction: ltr;
  text-align: center; margin-bottom: 16px;
  display: block;
}
.shop-actions { display: flex; gap: 10px; }
.shop-actions .btn { flex: 1; }

/* =========================================================
   WALLET CARD
   ========================================================= */

.wallet-card {
  background: linear-gradient(135deg,#4338CA,#5B21B6 50%,#6D28D9);
  color: white; border-radius: var(--r); padding: 22px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(91,33,182,0.25);
  margin-bottom: var(--gap);
}
.wallet-card::before {
  content: ''; position: absolute;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle,rgba(255,255,255,0.15),transparent 70%);
  top: -80px; inset-inline-start: -40px; pointer-events: none;
}
.wallet-info  { display: flex; flex-direction: column; }
.wallet-label { font-size: 12px; opacity: 0.8; }
.wallet-amount { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.wallet-btn {
  background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3);
  color: white; padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: 0.15s; margin-top: 16px;
  display: inline-block; text-decoration: none;
}
.wallet-btn:hover { background: rgba(255,255,255,0.3); color: white; }
.wc-label  { font-size: 12px; opacity: 0.8; }
.wc-amount { font-size: 28px; font-weight: 800; margin-top: 6px; }
.wc-row    { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }

/* =========================================================
   ORDERS PAGE
   ========================================================= */

.orders-stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 14px; margin-bottom: 20px;
}
.o-stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 20px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.o-stat .num { font-size: 26px; font-weight: 800; color: var(--text); }
.o-stat .lbl { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.filter-tabs, .filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 18px; align-items: center;
}
.ftab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 99px;
  border: 1.5px solid var(--border); color: var(--text-3);
  text-decoration: none; font-size: 13px; font-weight: 500;
  transition: 0.15s; background: var(--card);
}
.ftab:hover, .ftab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.filter-bar select.form-control {
  width: auto; padding: 8px 14px;
  background: var(--card); border: 1.5px solid var(--border);
}

.orders-grid, .order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: 0.15s;
}
.order-card:hover { border-color: #CBD5E1; box-shadow: var(--shadow); }
.order-card-head, .order-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; background: #F8FAFC;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.order-num, .oid { font-family: ui-monospace,monospace; font-size: 13px; font-weight: 700; color: var(--text); }
.order-date, .odate { font-size: 12px; color: var(--text-3); }
.order-card-body, .order-body { padding: 15px 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.order-product, .opn { font-weight: 600; font-size: 14px; }
.order-meta {
  font-size: 12px; color: var(--text-3); margin-top: 4px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.meta-item .meta-label, .ilabel { color: var(--text-muted); margin-inline-end: 4px; }
.meta-item .meta-value, .ivalue { color: var(--text); }
.order-card-foot, .order-foot {
  padding: 12px 18px; background: #FAFBFC;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.price-info { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.selling-price { font-size: 14px; font-weight: 700; color: var(--text); }
.profit-badge  { background: var(--success-soft); color: var(--success-text); padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* Complete / Pay buttons */
.btn-complete, .btn-pay {
  background: var(--accent); color: white; border: none;
  padding: 8px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: 0.15s;
}
.btn-complete:hover, .btn-pay:hover { background: var(--accent-2); }
.btn-complete:disabled { opacity: 0.5; cursor: not-allowed; }

/* Customer info box */
.customer-info-box {
  background: #F8FAFC; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 16px; margin-bottom: 12px;
}
.customer-info-box h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.ilabel { color: var(--text-3); }
.ivalue { color: var(--text); font-weight: 500; }

/* Paid info */
.paid-info { text-align: center; padding: 20px; }
.paid-icon { font-size: 52px; margin-bottom: 12px; }
.paid-info p { font-size: 15px; font-weight: 600; color: var(--text); }

/* =========================================================
   PRODUCTS PAGE
   ========================================================= */

.products-grid, .product-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: var(--gap);
}
.product-card, .product {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: 0.2s;
  display: flex; flex-direction: column;
}
.product-card:hover, .product:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-image, .product .ph {
  height: 200px; width: 100%; object-fit: cover;
  background: linear-gradient(135deg,#F1F5F9,#E2E8F0);
  position: relative; overflow: hidden;
}
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.product-title {
  font-weight: 600; font-size: 14px; line-height: 1.5; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px;
}
.product-description { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.product-price-original { color: var(--text-muted); text-decoration: line-through; font-size: 12px; }
.product-price { font-weight: 700; font-size: 15px; color: var(--text); }
.product-meta { font-size: 12px; color: var(--text-3); }
.product-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 4px; }
.added-badge { background: var(--success-soft); color: var(--success-text); padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.owned-badge { background: var(--info-soft); color: var(--info-text); padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.blurred    { filter: blur(4px); user-select: none; }
.blur-price { filter: blur(4px); user-select: none; }

/* Search box in products */
#searchInput {
  width: 100%; padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm); font: inherit;
  font-size: 14px; transition: 0.15s; outline: none;
  color: var(--text); background: var(--card);
}
#searchInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* =========================================================
   SHOP SETTINGS PAGE
   ========================================================= */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.setting-section {
  background: var(--card); border-radius: var(--r);
  padding: 22px; border: 1px solid var(--border);
  box-shadow: var(--shadow); margin-bottom: var(--gap);
}
.setting-section h4 {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.full-section {
  background: var(--card); border-radius: var(--r);
  padding: 22px; border: 1px solid var(--border);
  box-shadow: var(--shadow); margin-bottom: var(--gap);
}
.full-section h4 {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dns-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dns-table th,.dns-table td { padding: 9px 12px; border: 1px solid var(--border); text-align: right; }
.dns-table th { background: #F8FAFC; font-weight: 600; color: var(--text-2); }
.dns-table-wrap { overflow-x: auto; }

/* =========================================================
   PLANS / SUBSCRIPTIONS
   ========================================================= */

.plans-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.plan-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); padding: 28px 22px;
  text-align: center; position: relative;
  transition: 0.2s; box-shadow: var(--shadow-sm);
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-md); }
.plan-name     { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.plan-price    { font-size: 32px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.plan-duration { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }
.plan-features { list-style: none; text-align: right; margin-bottom: 20px; }
.plan-features li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.plan-features li:last-child { border-bottom: 0; }
.period-btns { display: flex; gap: 8px; margin-bottom: 24px; }
.period-btns .btn { flex: 1; }

/* =========================================================
   SETTINGS PAGE (user profile)
   ========================================================= */

.settings-grid .setting-section .sg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.tab-nav { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tbtn {
  padding: 8px 18px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: 0.15s;
}
.tbtn.active, .tbtn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* =========================================================
   TICKETS
   ========================================================= */

.tickets-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.tickets-header h2 { font-size: 20px; font-weight: 700; }
.ticket-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 20px;
  margin-bottom: 12px; box-shadow: var(--shadow-sm);
  transition: 0.15s; display: block; text-decoration: none;
}
.ticket-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.ticket-header-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.ticket-top  { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.ticket-id   { font-family: ui-monospace,monospace; font-size: 12px; color: var(--text-3); }
.ticket-subject { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ticket-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ticket-meta   { font-size: 12px; color: var(--text-3); margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.ticket-info-item { display: flex; flex-direction: column; gap: 3px; }
.ticket-container { max-width: 860px; }
.ticket-info  { background: #F8FAFC; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 18px; margin-bottom: 20px; }
.ticket-form  { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-sm); }
.unread-badge { background: var(--danger); color: white; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }

/* Reply area */
.reply-area, .reply-box { margin-top: 20px; }
.message-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px;
}
.message-card.admin-message { background: #EEF2F7; border-color: #B0C4DE; }
.message-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; }
.message-author { font-weight: 700; }
.message-time   { color: var(--text-3); font-size: 12px; }
.message-content { font-size: 14px; line-height: 1.7; color: var(--text-2); }
.reply-row { display: flex; gap: 10px; align-items: flex-end; }
.reply-row .form-control { min-height: 80px; flex: 1; }
.send-btn { background: var(--accent); color: white; border: none; padding: 12px 20px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; transition: 0.15s; }
.send-btn:hover { background: var(--accent-2); }

/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.notif-wrap  { max-width: 800px; }
.notif-topbar{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.notif-card  {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 18px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm); transition: 0.15s;
  display: flex; gap: 14px; align-items: flex-start;
}
.notif-card.unread { border-inline-start: 3px solid var(--accent); background: #FFFBF5; }
.notif-head  { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.notif-title { font-weight: 700; font-size: 14px; }
.notif-body  { font-size: 13px; color: var(--text-3); line-height: 1.6; }
.notif-time  { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.notif-bar   { width: 4px; border-radius: 99px; background: var(--accent); align-self: stretch; flex-shrink: 0; }
.notif-empty { text-align: center; padding: 48px 20px; color: var(--text-3); }

/* =========================================================
   TUTORIALS
   ========================================================= */

.course-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.course-card  { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); transition: 0.2s; }
.course-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.course-cover { height: 180px; background: linear-gradient(135deg,#F1F5F9,#E2E8F0); position: relative; overflow: hidden; }
.course-info  { padding: 16px; }
.course-meta  { font-size: 12px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.play-btn     { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 52px; height: 52px; background: rgba(249,115,22,0.9); border-radius: 50%; display: grid; place-items: center; color: white; font-size: 20px; }
.play-overlay { position: absolute; inset: 0; background: rgba(15,23,42,0.35); display: flex; align-items: center; justify-content: center; }

.single-video-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); }
.video-player-box  { border-radius: var(--r); overflow: hidden; background: #000; }
.video-player-wrap { position: relative; padding-bottom: 56.25%; height: 0; }
.video-player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.tut-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 0 6px; }
.tut-divider { height: 1px; background: var(--border); margin: 8px 0; }
.ep-list { display: flex; flex-direction: column; gap: 4px; }
.ep-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: 0.12s; text-decoration: none; color: var(--text-2); }
.ep-item:hover, .ep-item.current { background: var(--accent-soft); color: var(--accent-2); }
.ep-num   { font-family: ui-monospace,monospace; font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.ep-info  { flex: 1; min-width: 0; }
.ep-thumb { width: 48px; height: 32px; border-radius: 5px; background: linear-gradient(135deg,#F1F5F9,#E2E8F0); flex-shrink: 0; }

/* =========================================================
   ANALYTICS
   ========================================================= */

.stats-g { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); margin-bottom: var(--gap); }

/* =========================================================
   REFERRAL
   ========================================================= */

.ref-hero { background: linear-gradient(135deg,#F97316,#EA580C); color: white; border-radius: var(--r-lg); padding: 32px; margin-bottom: var(--gap); position: relative; overflow: hidden; }
.ref-hero::before { content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.12); top: -80px; inset-inline-end: -60px; }
.share-row  { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.copy-btn, .copy-button { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: 0.15s; }
.copy-btn:hover, .copy-button:hover { background: rgba(255,255,255,0.3); }
.link-wrap { background: rgba(255,255,255,0.15); border-radius: 8px; padding: 10px 14px; font-size: 13px; direction: ltr; flex: 1; }

/* =========================================================
   COUPONS
   ========================================================= */

.coupon-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.coupon-card { background: var(--card); border: 1.5px dashed var(--border); border-radius: var(--r); padding: 22px; text-align: center; transition: 0.2s; }
.coupon-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.coupon-code { font-family: ui-monospace,monospace; font-size: 20px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 10px 18px; border-radius: 8px; display: inline-block; margin: 10px 0; letter-spacing: 0.1em; }
.coupon-info { font-size: 13px; color: var(--text-3); }

/* =========================================================
   REVIEWS
   ========================================================= */

.review-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.rating-stars, .stars { display: flex; gap: 3px; }
.rating-star  { font-size: 18px; }
.rating-section { margin-bottom: 16px; }

/* =========================================================
   PLUGIN PAGE
   ========================================================= */

.plugin-hero { background: linear-gradient(135deg,#0F172A,#1E293B); color: white; border-radius: var(--r-lg); padding: 32px; margin-bottom: var(--gap); }
.plugin-notice { background: var(--info-soft); border: 1px solid rgba(59,130,246,0.2); border-radius: var(--r-sm); padding: 14px 18px; font-size: 13.5px; color: var(--info-text); margin-bottom: 16px; }
.api-url-box { background: #F8FAFC; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; font-family: ui-monospace,monospace; font-size: 13px; direction: ltr; text-align: left; word-break: break-all; }
.download-section { text-align: center; padding: 28px; }
.download-button { display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: white; padding: 14px 28px; border-radius: var(--r); font-size: 15px; font-weight: 700; text-decoration: none; box-shadow: 0 4px 16px rgba(249,115,22,0.3); transition: 0.15s; }
.download-button:hover { background: var(--accent-2); color: white; transform: translateY(-2px); }
.feature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-sm); }
.feature-icon { font-size: 32px; margin-bottom: 12px; }
.feature-title{ font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: 13px; color: var(--text-3); line-height: 1.6; }
.license-box  { background: #F8FAFC; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 16px; }
.license-key  { font-family: ui-monospace,monospace; font-size: 14px; color: var(--text); }
.license-key-display { background: var(--card); border: 1.5px solid var(--border); border-radius: 8px; padding: 12px 16px; font-family: ui-monospace,monospace; font-size: 14px; direction: ltr; text-align: left; margin-bottom: 12px; }

/* =========================================================
   PLUGIN MARKET
   ========================================================= */

.pm-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.pm-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); transition: 0.2s; }
.pm-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pm-img   { height: 160px; background: linear-gradient(135deg,#F1F5F9,#E2E8F0); object-fit: cover; width: 100%; }
.pm-body  { padding: 16px; }
.pm-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.pm-desc  { font-size: 13px; color: var(--text-3); line-height: 1.6; margin-bottom: 12px; }
.pm-footer{ display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }
.pm-price { font-size: 16px; font-weight: 700; color: var(--accent); }
.btn-buy  { background: var(--accent); color: white; border: none; padding: 7px 16px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.15s; }
.btn-buy:hover { background: var(--accent-2); }

/* Live chat */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--gap); height: calc(100vh - 160px); }
.chat-main { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.chat-head { padding: 16px 20px; border-bottom: 1px solid var(--border); background: #F8FAFC; }
.msgs-area { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.6; }
.msg-v  { background: var(--accent); color: white; align-self: flex-end; border-radius: 12px 4px 12px 12px; }
.msg-s  { background: #F1F5F9; color: var(--text); align-self: flex-start; border-radius: 4px 12px 12px 12px; }
.msg-time { font-size: 10.5px; opacity: 0.7; margin-top: 4px; }
.msg-body { }
.reply-area { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.reply-area .form-control { flex: 1; min-height: auto; padding: 10px 14px; }

/* Sessions */
.sess-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.sess-top   { padding: 14px 16px; border-bottom: 1px solid var(--border); background: #F8FAFC; font-weight: 700; }
.sess-item  { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: 0.12s; }
.sess-item:hover, .sess-item.active { background: var(--accent-soft); }
.sess-item:last-child { border-bottom: 0; }
.sess-name  { font-weight: 600; font-size: 13.5px; }
.sess-last  { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.sess-time  { font-size: 11px; color: var(--text-muted); }
.no-sess    { text-align: center; padding: 32px; color: var(--text-3); font-size: 13px; }

/* =========================================================
   THEMES
   ========================================================= */

.themes-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.theme-card  { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--r); overflow: hidden; transition: 0.2s; }
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-preview { height: 160px; }
.theme-info   { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.btn-select-theme { font-size: 13px; }

/* =========================================================
   PAGES BUILDER
   ========================================================= */

.pages-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.page-card  { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); transition: 0.15s; }
.page-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.page-card-header { padding: 14px 16px; background: #F8FAFC; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.page-card-title  { font-weight: 700; font-size: 14px; }
.page-card-body   { padding: 14px 16px; }
.page-header      { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }

/* Page Builder canvas */
.pb-layout  { display: grid; grid-template-columns: 240px 1fr; gap: var(--gap); height: calc(100vh - 160px); }
.pb-sidebar { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; overflow-y: auto; }
.pb-canvas  { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.canvas-block { border: 2px dashed var(--border); border-radius: 8px; margin: 8px; padding: 14px; transition: 0.15s; position: relative; }
.canvas-block:hover { border-color: var(--accent); }
.block-type  { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.empty-canvas{ display: grid; place-items: center; height: 100%; color: var(--text-3); }
.action-buttons { position: absolute; top: 6px; inset-inline-start: 6px; display: flex; gap: 4px; }
.block-del,.block-move,.del-btn { background: white; border: 1px solid var(--border); border-radius: 5px; width: 24px; height: 24px; display: grid; place-items: center; cursor: pointer; font-size: 13px; }
.layout-tag { position: absolute; top: 6px; inset-inline-end: 6px; font-size: 10px; background: var(--accent-soft); color: var(--accent); padding: 2px 6px; border-radius: 4px; }
.pbtn, .sbtn { display: block; width: 100%; background: #F1F5F9; border: 0; border-radius: 8px; padding: 10px 12px; text-align: right; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: 0.12s; color: var(--text-2); margin-bottom: 4px; }
.pbtn:hover, .sbtn:hover { background: var(--accent-soft); color: var(--accent-2); }

/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty-state, .empty-s {
  text-align: center; padding: 48px 20px; color: var(--text-3);
}
.empty-state-icon { font-size: 52px; margin-bottom: 14px; }
.empty-state-title, .empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state-text,  .empty-state p  { font-size: 13.5px; color: var(--text-3); }

/* =========================================================
   MODALS
   ========================================================= */

.modal-overlay, .modal {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 1000; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-overlay.show, .modal.show,
.modal-overlay.active { display: flex; }
.modal-box, .modal-content {
  background: var(--card); border-radius: var(--r-lg);
  padding: 28px; width: 90%; max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head, .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-size: 17px; font-weight: 700; margin: 0; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-3); cursor: pointer; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--danger); }
.modal-body   { margin-bottom: 18px; }
.modal-footer { display: flex; gap: 10px; flex-wrap: wrap; }

/* =========================================================
   MISC
   ========================================================= */

.pagination { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-2);
  font-size: 13px; font-weight: 600; text-decoration: none; transition: 0.15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); color: white; border-color: var(--accent); }

.toast {
  position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 9999;
  background: var(--text); color: white; padding: 12px 20px;
  border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(249,115,22,0.25);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.warning-box { background: var(--warn-soft); border: 1px solid rgba(245,158,11,0.25); border-radius: var(--r-sm); padding: 14px 18px; color: var(--warn-text); font-size: 13.5px; margin-bottom: 16px; }

/* Utility */
.muted, .text-muted    { color: var(--text-muted); }
.muted-2               { color: var(--text-3); }
.small                 { font-size: 12px; }
.tiny                  { font-size: 11px; }
.bold                  { font-weight: 700; }
.text-success          { color: var(--success); }
.text-danger           { color: var(--danger); }
.text-warning          { color: var(--warn); }
.text-accent, .text-primary { color: var(--accent); }
.text-end              { text-align: end; }
.text-center           { text-align: center; }
.divider, hr           { height: 1px; background: var(--border); margin: 14px 0; border: 0; }
.shrink-0              { flex-shrink: 0; }
.truncate              { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-link, .back-btn  { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; text-decoration: none; margin-bottom: 16px; }
.back-link:hover, .back-btn:hover { color: var(--accent); }
.blur-price            { filter: blur(5px); user-select: none; }
.d-none                { display: none !important; }
.hidden                { display: none; }
.d-block               { display: block; }
.d-flex                { display: flex; }
.mt-0{margin-top:0}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:16px}.mt-4{margin-top:24px}.mt-5{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:16px}.mb-4{margin-bottom:24px}.mb-5{margin-bottom:32px}
.p-3{padding:16px}.p-4{padding:24px}
.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:16px}.gap-4{gap:24px}
.history-table { width: 100%; }
.bar-outer { background: #F1F5F9; border-radius: 99px; height: 8px; overflow: hidden; margin-top: 6px; }
.bar-inner { height: 100%; border-radius: 99px; background: var(--accent); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {
  .dashboard-stats, .stats-grid { grid-template-columns: repeat(2,1fr); }
  .plans-grid, .course-grid, .feature-grid, .pm-grid { grid-template-columns: repeat(2,1fr); }
  .products-grid, .product-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 1024px) {
  .app, .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; right: 0; top: 0;
    transform: translateX(100%);
    z-index: 100;
  }
  .sidebar.active { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content, .main { margin-right: 0 !important; }
  .mobile-menu-toggle { display: grid !important; }
  .content-area { padding: 18px; }
  .settings-grid { grid-template-columns: 1fr; }
  .dash-row-2, .dash-row-3, .dashboard-grid, .wallet-grid { grid-template-columns: 1fr; }
  .single-video-grid { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .pb-layout { grid-template-columns: 1fr; height: auto; }
}

@media (max-width: 768px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .tb-search { display: none; }
  .content-area { padding: 14px; }
  .dashboard-stats, .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .orders-stats { grid-template-columns: 1fr 1fr; }
  .products-grid, .product-grid { grid-template-columns: 1fr 1fr; }
  .plans-grid, .course-grid, .themes-grid, .pages-grid, .pm-grid, .feature-grid { grid-template-columns: 1fr 1fr; }
  .coupon-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal-box, .modal-content { max-width: calc(100vw - 28px); }
  .row { flex-direction: column; }
  .col-3, .col-4, .col-6, .col-7, .col-8, .col-9 { flex: 1 1 100%; }
  .order-card-body, .order-body { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .dashboard-stats, .stats-grid, .orders-stats { grid-template-columns: 1fr; }
  .products-grid, .product-grid { grid-template-columns: 1fr; }
  .plans-grid, .course-grid, .themes-grid, .pages-grid, .pm-grid, .coupon-grid, .feature-grid { grid-template-columns: 1fr; }
  .tb-wallet { display: none; }
  .tb-avatar span { display: none; }
  .stat-value { font-size: 22px; }
  .content-area { padding: 10px; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }
}

/* =========================================================
   PATCH — Short class aliases & missing components
   ========================================================= */

/* Card header/body short aliases used in analytics, coupons, reviews */
.ch {
  padding: 16px 20px;
  font-size: 14.5px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
  background: #FAFBFC;
}
.ch h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.cb { padding: 20px; }

/* Stat card short aliases — analytics & referral */
.sk {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 18px;
  border-inline-start: 4px solid var(--accent) !important;
  box-shadow: var(--shadow-sm); text-align: center;
  transition: 0.2s;
}
.sk:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sv, .sn {
  font-size: 26px; font-weight: 800; color: var(--text);
  margin: 8px 0 4px; letter-spacing: -0.02em;
}
.ss, .sl { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* Analytics stats grid */
.stats-g {
  display: grid; grid-template-columns: repeat(5,1fr);
  gap: 14px; margin-bottom: var(--gap);
}
@media(max-width:1200px){ .stats-g{grid-template-columns:repeat(3,1fr);} }
@media(max-width:768px){ .stats-g{grid-template-columns:repeat(2,1fr);} }
@media(max-width:480px){ .stats-g{grid-template-columns:1fr 1fr;} }

/* ─── Toggle Switch (checkbox-based — pages.php) ─── */
.toggle-switch {
  position: relative; display: inline-block;
  width: 42px; height: 24px; cursor: pointer;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #CBD5E1; border-radius: 99px;
  transition: background 0.18s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  top: 3px; right: 3px;
  transition: right 0.18s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { right: calc(100% - 21px); }

/* ─── Product Detail Page ─── */
.product-detail-container { max-width: 1100px; }
.product-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 32px; margin-top: 8px;
}
@media(max-width:900px){ .product-detail-grid{grid-template-columns:1fr;} }

.product-gallery { display: flex; flex-direction: column; gap: 12px; }
.main-image {
  width: 100%; height: 400px; object-fit: cover;
  border-radius: var(--r-lg); border: 1px solid var(--border);
  background: #F1F5F9; cursor: zoom-in;
}
.thumbnail-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbnail {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 8px; border: 2px solid var(--border);
  cursor: pointer; transition: 0.15s;
}
.thumbnail:hover, .thumbnail.active { border-color: var(--accent); }

.product-info { display: flex; flex-direction: column; gap: 20px; }
.product-info .product-title { font-size: 22px; font-weight: 800; line-height: 1.4; }
.product-info .product-price {
  font-size: 28px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.02em;
}
.product-info .product-description {
  font-size: 14px; line-height: 1.8; color: var(--text-2);
  background: #FAFBFC; padding: 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.product-meta { display: flex; flex-direction: column; gap: 8px; }
.product-meta .meta-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: #F8FAFC;
  border-radius: 8px; border: 1px solid var(--border);
  font-size: 13.5px;
}
.product-meta .meta-label { color: var(--text-3); }
.product-meta .meta-value { font-weight: 600; color: var(--text); }

/* Shipping info box */
.product-info .shipping-box {
  background: var(--accent-soft); border: 1.5px solid rgba(249,115,22,0.2);
  border-radius: var(--r-sm); padding: 16px;
}
.product-info .shipping-box h3 { font-size: 15px; color: var(--accent-2); margin-bottom: 12px; }

/* Add to shop large button */
.btn-add-large {
  width: 100%; padding: 16px 24px;
  background: var(--accent); color: white;
  border: none; border-radius: var(--r);
  font: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: 0.18s;
  box-shadow: 0 4px 16px rgba(249,115,22,0.30);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-add-large:hover { background: var(--accent-2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(249,115,22,0.35); }

.already-added {
  display: flex; align-items: center; gap: 8px;
  background: var(--success-soft); color: var(--success-text);
  padding: 14px 18px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; margin-bottom: 10px;
}
.action-buttons { display: flex; flex-direction: column; gap: 10px; }

/* Profit display */
#profit_display {
  background: var(--success-soft);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-sm); padding: 14px;
  color: var(--success-text);
}

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.88); align-items: center; justify-content: center;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 20px; inset-inline-end: 20px;
  background: rgba(255,255,255,0.2); border: none; color: white;
  font-size: 28px; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; display: grid; place-items: center;
}

/* ─── Coupon page fixes ─── */
.coupon-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
@media(max-width:900px){ .coupon-grid{grid-template-columns:repeat(2,1fr);} }
@media(max-width:600px){ .coupon-grid{grid-template-columns:1fr;} }

.coupon-card {
  background: var(--card); border: 1.5px dashed var(--border);
  border-radius: var(--r-lg); padding: 22px;
  text-align: center; transition: 0.2s; position: relative;
}
.coupon-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.coupon-code {
  font-family: ui-monospace, monospace;
  font-size: 18px; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); padding: 10px 18px;
  border-radius: 8px; display: inline-block;
  margin: 10px 0; letter-spacing: 0.08em;
}
.coupon-info { font-size: 13px; color: var(--text-3); line-height: 1.8; }
.del-btn {
  position: absolute; top: 10px; inset-inline-start: 10px;
  background: var(--danger-soft); color: var(--danger-text);
  border: none; border-radius: 6px; width: 28px; height: 28px;
  display: grid; place-items: center; cursor: pointer; font-size: 13px;
  transition: 0.15s;
}
.del-btn:hover { background: var(--danger); color: white; }

/* Form inputs inside coupon card */
.card .form-row input[type=text],
.card .form-row input[type=number],
.card .form-row input[type=date],
.card .form-row select,
.card .form-row label {
  width: 100%; display: block;
  padding: 9px 13px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--card); outline: none; transition: 0.15s;
  margin-top: 6px;
}
.card .form-row label { padding: 0; border: none; background: none; font-weight: 600; font-size: 12.5px; color: var(--text-2); margin-top: 0; }
.card .form-row input:focus,
.card .form-row select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ─── Referral page fixes ─── */
.ref-hero {
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 60%, #C2410C);
  color: white; border-radius: var(--r-lg); padding: 32px;
  margin-bottom: var(--gap); position: relative; overflow: hidden;
}
.ref-hero::before {
  content: ''; position: absolute; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255,255,255,0.12);
  top: -80px; inset-inline-end: -60px; pointer-events: none;
}
.ref-hero h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.ref-hero p  { font-size: 14px; opacity: 0.9; margin-bottom: 0; }

.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.link-wrap {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; direction: ltr; flex: 1; min-width: 160px;
  word-break: break-all;
}
.copy-btn, .copy-button {
  background: rgba(255,255,255,0.25); border: 1px solid rgba(255,255,255,0.35);
  color: white; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: 0.15s; flex-shrink: 0;
}
.copy-btn:hover, .copy-button:hover { background: rgba(255,255,255,0.38); }

/* Stats row inside ref-hero */
.ref-hero .sc2c {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 14px;
  margin-top: 24px;
}
.ref-hero .sc2c .sk {
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25);
  border-inline-start: 3px solid rgba(255,255,255,0.5) !important;
  border-radius: 10px; padding: 16px; text-align: center;
}
.ref-hero .sc2c .sk:hover { transform: none; box-shadow: none; }
.ref-hero .sc2c .sn { color: white; font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.ref-hero .sc2c .sl { color: rgba(255,255,255,0.85); font-size: 12px; }

/* Referral stats outside hero */
.sc2c {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 14px; margin-bottom: var(--gap);
}
@media(max-width:900px){ .sc2c{grid-template-columns:repeat(2,1fr);} }

/* ─── Pages (برگه‌ها) toggle fix ─── */
.page-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: #FAFBFC;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}
.page-card-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px;
}
.page-card-body { padding: 18px; }

/* Preview link button — was blue, now navy */
a[style*="EBF8FF"], a[style*="2B6CB0"] {
  background: rgba(30,58,95,0.07) !important;
  color: #1E3A5F !important;
}

/* ─── Replace ALL blue-ish hard-coded colors → orange ─── */
/* info-soft backgrounds used inline → override with orange tones */
.badge-process { background: var(--accent-soft) !important; color: var(--accent-2) !important; }

/* Active subscription warning box */
.alert.alert-success a.btn,
.alert a.btn { color: white; }

/* Shop settings — link/address input highlights */
.shop-settings-page .input-group:focus-within,
.full-section .input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Shipping info in product-detail — replace blue */
div[style*="f0f9ff"], div[style*="#f0f9ff"] {
  background: var(--accent-soft) !important;
}
div[style*="bfdbfe"], div[style*="#bfdbfe"] {
  border-color: rgba(249,115,22,0.25) !important;
}
div[style*="1e40af"], span[style*="1e40af"],
h3[style*="1e40af"] {
  color: var(--accent-2) !important;
}

/* profit_display green box — keep green, just normalize */
#profit_display {
  background: var(--success-soft) !important;
  border-color: rgba(16,185,129,0.2) !important;
  color: var(--success-text) !important;
}

/* ─── Analytics chart cards ─── */
.analytics-grid {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: var(--gap); margin-bottom: var(--gap);
}

/* Fix card when used without card-body — add padding to direct children */
.card > .ch + .cb { border-top: 0; }
.card > .ch:first-child { border-radius: var(--r) var(--r) 0 0; }

/* ─── pages toggle BG fix ─── */
.status-badge.badge-active  { background: var(--success-soft); color: var(--success-text); border-radius: 99px; padding: 3px 10px; font-size: 11px; font-weight: 600; }
.status-badge.badge-inactive { background: #F1F5F9; color: var(--text-3); border-radius: 99px; padding: 3px 10px; font-size: 11px; font-weight: 600; }

/* Fix form-row inside .card .cb */
.cb .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.cb .form-row div { display: flex; flex-direction: column; gap: 5px; }
.cb .form-row label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cb .form-row input,
.cb .form-row select { padding: 9px 13px; border: 1.5px solid var(--border); border-radius: var(--r-sm); font: inherit; font-size: 13px; outline: none; transition: 0.15s; background: var(--card); color: var(--text); }
.cb .form-row input:focus, .cb .form-row select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media(max-width:600px){ .cb .form-row{grid-template-columns:1fr;} }

/* Badge/status ubadge */
.ubadge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.bdg    { display: inline-flex; align-items: center; gap: 4px; }
.ba     { background: var(--success-soft); color: var(--success-text); }
.bp     { background: var(--warn-soft);    color: var(--warn-text); }
.br     { background: var(--danger-soft);  color: var(--danger-text); }
.bi     { background: var(--info-soft);    color: var(--info-text); }
.bn     { background: var(--accent-soft);  color: var(--accent-2); }

/* ─── Misc fixes ─── */
.sc2c .card { margin-bottom: 0; }
.order-summary { background: #FAFBFC; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 16px; }
.pay-wrap    { max-width: 480px; margin: 0 auto; }
.pay-card    { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.pay-head    { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; padding: 22px 24px; }
.pay-body    { padding: 24px; }
.pay-opt     { border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: 0.15s; }
.pay-opt:hover, .pay-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-opt-icon { font-size: 22px; margin-bottom: 6px; }
.pay-opt-title { font-weight: 700; font-size: 14px; }
.pay-opt-desc  { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pay-opt-badge { background: var(--accent-soft); color: var(--accent-2); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.pay-amount    { font-size: 28px; font-weight: 800; color: var(--accent); }
.price-label   { font-size: 12px; color: var(--text-3); }
.price-val     { font-size: 18px; font-weight: 700; color: var(--text); }
.price-row     { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.price-row:last-child { border-bottom: 0; }

/* Step indicators */
.steps-r { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.step    { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: #F1F5F9; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.step.active { background: var(--accent-soft); color: var(--accent-2); }
.step.done   { background: var(--success-soft); color: var(--success-text); }

/* Upgrade button */
.upgrade-button {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: white;
  padding: 12px 24px; border-radius: var(--r); font-size: 14px;
  font-weight: 700; text-decoration: none; transition: 0.15s;
  box-shadow: 0 4px 14px rgba(249,115,22,0.28);
}
.upgrade-button:hover { background: var(--accent-2); color: white; transform: translateY(-1px); }

.subscription-warning {
  background: var(--warn-soft); border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--r); padding: 22px; text-align: center;
  color: var(--warn-text);
}

/* ─── Embed box & API boxes ─── */
.embed-box, .api-url-box {
  background: #F8FAFC; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px;
  font-family: ui-monospace, monospace; font-size: 13px;
  direction: ltr; text-align: left; word-break: break-all;
}

/* ─── Warning/info boxes that used blue inline styles ─── */
.warning-box, .info-box {
  background: var(--accent-soft); border: 1px solid rgba(249,115,22,0.2);
  border-radius: var(--r-sm); padding: 14px 18px;
  color: var(--accent-2); font-size: 13.5px;
  display: flex; gap: 10px; align-items: flex-start;
}


/* Referral .sg stat grid */
.sg {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 14px; margin-bottom: var(--gap);
}
@media(max-width:900px){ .sg{grid-template-columns:repeat(2,1fr);} }
@media(max-width:480px){ .sg{grid-template-columns:1fr 1fr;} }

/* sbtn social share buttons */
.sbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text-2); transition: 0.15s; text-decoration: none;
}
.sbtn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sbtn.sc2c  { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }

/* snum inside steps */
.snum {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}


/* =========================================================
   PATCH v2 — Products grid fix + Admin toggle fix
   ========================================================= */

/* ─── Product card: fix position:absolute badge overflow ─── */
.product-card {
  position: relative;   /* needed for absolute badges inside */
}
.product-card > a {
  display: block;
  text-decoration: none;
  color: inherit;
}
.product-image {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
}
.product-card .product-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-card .product-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
  margin: 0;
}
.product-card .product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.product-card .product-actions {
  padding: 0 14px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
/* No subscription warning inside card */
.product-card .no-sub-notice {
  background: #FFF5F5;
  color: #742A2A;
  font-size: 12px;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 0 14px 4px;
}

/* ─── Admin toggle-switch: label wrapping checkbox + span text ─── */
/*
  Admin uses:
    <label class="toggle-switch">
      <input type="checkbox">
      <span>متن فعال‌سازی</span>
    </label>

  We need the label to be flex-row, not the toggle itself.
  So override with a different structure.
*/
label.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  /* reset the toggle-switch position rules */
  position: static;
}
label.toggle-switch input[type="checkbox"] {
  /* hide the raw checkbox */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
/* pseudo-toggle track */
label.toggle-switch::before {
  content: '';
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #CBD5E1;
  flex-shrink: 0;
  transition: background 0.18s;
  position: relative;
}
/* pseudo-toggle thumb */
label.toggle-switch::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  position: absolute;
  /* will be overridden below via sibling trick */
}

/*
  Because CSS can't style based on child checkbox state with pure label::before/after,
  we use a JS-friendly approach AND a CSS trick:
  When checkbox is checked, add class 'on' to the label via JS,
  OR use the adjacent sibling selector where possible.
  
  Since admin.php may not have JS for this, we use a small inline approach.
  Actually the cleanest fix: use a wrapper div pattern.
  
  But since we can't change PHP easily, let's use the JS approach in the existing
  admin header, or add a small script.
  
  For now: style the label as a proper row and use a custom span.toggle-track approach.
*/

/* Reset everything and use a simpler approach: */
label.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  /* dimensions reset */
  width: auto !important;
  height: auto !important;
  background: none !important;
  border-radius: 0 !important;
  position: static !important;
}
label.toggle-switch::before,
label.toggle-switch::after { display: none !important; }

/* The actual track is built from the input element's appearance */
label.toggle-switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 42px !important;
  height: 24px !important;
  border-radius: 99px;
  background: #CBD5E1;
  position: relative !important;
  opacity: 1 !important;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s;
  outline: none;
  border: none;
}
label.toggle-switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  top: 3px;
  right: 3px;
  transition: right 0.18s;
}
label.toggle-switch input[type="checkbox"]:checked {
  background: var(--accent);
}
label.toggle-switch input[type="checkbox"]:checked::after {
  right: calc(100% - 21px);
}
label.toggle-switch > span {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

/* Also fix the toggle-row context in admin */
.form-group label.toggle-switch {
  margin-bottom: 0;
  padding: 4px 0;
}

/* ─── Products grid responsive fix ─── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1100px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .products-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* ─── Admin: mb-3, mb-4 Bootstrap compat ─── */
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mb-5 { margin-bottom: 32px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.px-5 { padding-inline: 32px !important; }
.text-muted { color: var(--text-muted) !important; }
.card.mb-4 { margin-bottom: 24px; }

/* ─── Alert info — make sure it shows orange not blue ─── */
.alert-info {
  background: var(--accent-soft) !important;
  color: var(--accent-2) !important;
  border: 1px solid rgba(249,115,22,0.2);
}


/* =========================================================
   PATCH v3 — Products card size, shop-settings inputs,
   plugin page, themes grid, blue buttons fix
   ========================================================= */

/* ─── 1. Products grid — smaller proportional cards ─── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-card .product-image,
.product-card img.product-image {
  height: 170px;
  object-fit: cover;
  width: 100%;
  display: block;
  background: linear-gradient(135deg,#F1F5F9,#E2E8F0);
}
.product-card .product-body {
  padding: 12px 14px;
  gap: 6px;
}
.product-card .product-title {
  font-size: 13px;
  min-height: 38px;
}
.product-card .product-price {
  font-size: 14px;
}
.product-card .product-actions {
  padding: 0 12px 12px;
  gap: 6px;
}
.product-card .product-actions .btn {
  padding: 7px 10px;
  font-size: 12px;
}
.product-card .added-badge {
  font-size: 12px;
  padding: 5px 10px;
}
@media(max-width:1200px){ .products-grid{grid-template-columns:repeat(3,1fr);} }
@media(max-width:900px)  { .products-grid{grid-template-columns:repeat(2,1fr);} }
@media(max-width:480px)  { .products-grid{grid-template-columns:1fr 1fr;} }

/* ─── 2. Shop-settings — fix raw inputs without .form-control ─── */
.full-section input[type=text],
.full-section input[type=url],
.full-section input[type=email],
.full-section input[type=number],
.full-section input[type=file],
.full-section textarea,
.full-section select,
.setting-section input[type=text],
.setting-section input[type=url],
.setting-section input[type=email],
.setting-section input[type=number],
.setting-section textarea,
.setting-section select {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  direction: rtl;
}
.full-section input[dir=ltr],
.setting-section input[dir=ltr] { direction: ltr; text-align: left; }
.full-section input:focus,
.full-section textarea:focus,
.full-section select:focus,
.setting-section input:focus,
.setting-section textarea:focus,
.setting-section select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* the inline-flex slug row */
.full-section .form-group [style*="display:flex"][style*="direction:ltr"] {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: 0.15s;
  background: var(--card);
}
.full-section .form-group [style*="display:flex"][style*="direction:ltr"]:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.full-section .form-group [style*="display:flex"][style*="direction:ltr"] input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: transparent;
}
.full-section .form-group [style*="display:flex"][style*="direction:ltr"] span {
  background: #F8FAFC;
  border-right: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  display: flex;
  align-items: center;
}
/* DNS box blue → navy */
.full-section [style*="EBF8FF"],
.full-section [style*="#EBF8FF"] {
  background: rgba(30,58,95,0.07) !important;
}
.full-section [style*="2C5282"],
.full-section [style*="#2C5282"] {
  color: #1E3A5F !important;
}
.full-section [style*="0EA5E9"],
.full-section td[style*="0EA5E9"] {
  color: #1E3A5F !important;
}
.full-section [style*="667eea"] { color: #1E3A5F !important; }
.full-section [style*="F7FAFC"] { background: #FAFBFC !important; }

/* ─── 3. Page title fix for shop-settings ─── */
/* header.php $page_title is set in the page itself — already 'تنظیمات فروشگاه' */

/* ─── 4. Plugin page — license key card ─── */
.license-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
}
.license-box h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* License key display — hero card */
.license-key-display {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.license-key-display::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.15), transparent 70%);
  top: -80px; right: -60px;
}
.license-key-display > div:first-child {
  font-size: 12px !important;
  color: #94A3B8 !important;
  font-weight: 500;
  margin-bottom: 12px !important;
  letter-spacing: 0.04em;
}
.license-key {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 20px !important;
  font-weight: 800;
  color: #FED7AA !important;
  letter-spacing: 0.12em;
  word-break: break-all;
  line-height: 1.5;
  padding: 14px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  margin-bottom: 14px;
}
.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 9px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s;
  box-shadow: 0 4px 14px rgba(249,115,22,0.30);
}
.copy-button:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.38);
}
.copy-button:active { transform: translateY(0); }
.copy-button.copied {
  background: var(--success);
  box-shadow: 0 4px 14px rgba(16,185,129,0.30);
}

/* API URL box */
.api-url-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F8FAFC;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin: 8px 0;
  direction: ltr;
}
.api-url-box span {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--text-2);
  word-break: break-all;
}
/* override the inline blue copy button */
.api-url-box button,
button[onclick="copyApiUrl()"] {
  background: var(--accent) !important;
  color: white !important;
  border: none;
  padding: 7px 16px;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.api-url-box button:hover,
button[onclick="copyApiUrl()"]:hover {
  background: var(--accent-2) !important;
}

/* Info table in plugin */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.info-table th {
  text-align: right;
  padding: 12px 16px;
  color: var(--text-3);
  font-weight: 600;
  font-size: 12.5px;
  width: 180px;
  border-bottom: 1px solid var(--border);
}
.info-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.info-table tr:last-child th,
.info-table tr:last-child td { border-bottom: 0; }

/* Download section */
.download-section {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  border-radius: var(--r-lg);
  padding: 40px 32px;
  text-align: center;
  margin-bottom: var(--gap);
  position: relative; overflow: hidden;
  color: white;
}
.download-section::before {
  content: ''; position: absolute;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.18), transparent 70%);
  top: -120px; right: -80px; pointer-events: none;
}
.download-section h2 {
  font-size: 24px; font-weight: 800; margin-bottom: 8px; color: white;
}
.download-section p {
  color: #94A3B8; margin-bottom: 28px; font-size: 14px;
}
.download-button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent);
  color: white;
  padding: 16px 36px;
  border-radius: var(--r);
  font-size: 16px; font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(249,115,22,0.38);
  transition: 0.2s;
  position: relative;
}
.download-button:hover {
  background: var(--accent-2); color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(249,115,22,0.45);
}

/* Plugin hero */
.plugin-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: white; border-radius: var(--r-lg);
  padding: 36px 32px; margin-bottom: var(--gap);
  position: relative; overflow: hidden;
}
.plugin-hero::before {
  content: ''; position: absolute;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.18), transparent 70%);
  top: -100px; left: -60px; pointer-events: none;
}
.plugin-hero h1 {
  font-size: 26px; font-weight: 800; margin-bottom: 8px; position: relative;
}
.plugin-hero p { color: #94A3B8; font-size: 15px; position: relative; }

/* ─── 5. Themes grid — fix text bleeding over preview ─── */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.theme-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: 0.2s;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.theme-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }

.theme-preview {
  height: 200px;
  overflow: hidden;
  position: relative;
  /* CRITICAL: isolate the preview so inner text can't overflow */
  contain: strict;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
}
/* scale down preview content to fit */
.theme-preview > * {
  transform-origin: top right;
}

.theme-info {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.theme-info h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.theme-info p {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
  margin: 0;
}
.layout-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-2);
  width: fit-content;
}
.active-badge {
  background: var(--success-soft);
  color: var(--success-text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}

.btn-select-theme {
  padding: 10px 20px;
  border-radius: 9px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  width: 100%;
  margin-top: auto;
}
.btn-select-theme:hover:not([disabled]) {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(249,115,22,0.28);
}
.btn-select-theme[disabled],
.btn-select-theme.current {
  background: var(--success-soft);
  color: var(--success-text);
  border-color: var(--success);
  cursor: default;
}
@media(max-width:900px){ .themes-grid{grid-template-columns:1fr 1fr;} }
@media(max-width:600px){ .themes-grid{grid-template-columns:1fr;} }

/* ─── 6. Blue buttons/links after actions — force navy ─── */
/* Any button/link with blue inline background */
button[style*="#222065"],
button[style*="222065"],
button[style*="#3B82F6"],
button[style*="3B82F6"],
button[style*="#2563EB"],
button[style*="#1d4ed8"],
a[style*="#222065"],
a[style*="222065"],
a[style*="#3B82F6"] {
  background: #1E3A5F !important;
  color: white !important;
  border-color: #1E3A5F !important;
}
/* class-based blue buttons */
.btn-info, .btn-primary-blue {
  background: #1E3A5F !important;
  color: white !important;
  border: none;
}
/* Bootstrap-like btn-primary that some pages might use */
.btn.btn-primary,
.btn-primary {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent) !important;
}
.btn.btn-primary:hover,
.btn-primary:hover {
  background: var(--accent-2) !important;
}
/* Alert-info override (was blue) */
.alert-info, .alert.alert-info {
  background: rgba(30,58,95,0.08) !important;
  color: #0F2340 !important;
  border: 1px solid rgba(30,58,95,0.2) !important;
}
/* Subscriptions page blue active badge */
.badge-active, .status-active {
  background: var(--success-soft) !important;
  color: var(--success-text) !important;
}
/* Any inline style with blue color remnants */
[style*="color:#222065"],
[style*="color: #222065"],
[style*="color:#2563EB"],
[style*="color:#1E40AF"],
[style*="color:#667EEA"],
[style*="color:#667eea"] {
  color: #1E3A5F !important;
}
[style*="background:#222065"],
[style*="background: #222065"],
[style*="background:#2563EB"],
[style*="background:#3B82F6"],
[style*="background:#1E3A8A"] {
  background: #1E3A5F !important;
}
[style*="background-color:#222065"],
[style*="background-color: #222065"],
[style*="background-color:#3B82F6"] {
  background-color: #1E3A5F !important;
}

/* ─── Fix: restore .toggle-slider inside label.toggle-switch (user panel pages) ─── */
/* The admin override of label.toggle-switch breaks user/pages.php toggles.
   When a label.toggle-switch contains a .toggle-slider span, restore proper toggle behavior. */
label.toggle-switch:has(.toggle-slider) {
  display: inline-block !important;
  width: 42px !important;
  height: 24px !important;
  background: none !important;
  border-radius: 0 !important;
  position: relative !important;
  gap: 0 !important;
  cursor: pointer;
}
label.toggle-switch:has(.toggle-slider)::before,
label.toggle-switch:has(.toggle-slider)::after { display: none !important; }
label.toggle-switch:has(.toggle-slider) input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none;
}
label.toggle-switch:has(.toggle-slider) .toggle-slider {
  position: absolute;
  inset: 0;
  background: #CBD5E1;
  border-radius: 99px;
  transition: background 0.18s;
  display: block !important;
}
label.toggle-switch:has(.toggle-slider) .toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  top: 3px; right: 3px;
  transition: right 0.18s;
}
label.toggle-switch:has(.toggle-slider) input:checked + .toggle-slider { background: var(--accent); }
label.toggle-switch:has(.toggle-slider) input:checked + .toggle-slider::before { right: calc(100% - 21px); }
