/* ============================================================
   COIIN.X — Admin Dashboard Styles
   Fully Responsive — 320px → 1920px+
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  --gold:         #C8A94A;
  --gold-light:   #E8C96A;
  --gold-glow:    rgba(200,169,74,0.15);
  --gold-grad:    linear-gradient(135deg,#C8A94A,#F0D878,#C8A94A);
  --bg-base:      #050505;
  --bg-sidebar:   #0A0A0A;
  --bg-card:      #111;
  --bg-elevated:  #1A1A1A;
  --bg-input:     #141414;
  --border:       rgba(255,255,255,0.07);
  --border-gold:  rgba(200,169,74,0.3);
  --text:         #F0F0F0;
  --text-sec:     #B8B8B8;
  --text-muted:   #8E8E8E;
  --success:      #4ac864;
  --danger:       #ff6b6b;
  --warning:      #C8A94A;
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       12px;
  --font:         'Tajawal', sans-serif;
}

.text-muted { color: #9ea3a9 !important; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  direction: rtl;
  font-size: 15px;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text);
  display: block;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* Background scroll lock on mobile when sidebar is open */
html.sidebar-open,
body.sidebar-open {
  overflow: hidden !important;
}

html.sidebar-open .admin-sidebar,
body.sidebar-open .admin-sidebar {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* ── Sidebar ─────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 220;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 900;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.logo-admin {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.sidebar-close {
  display: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-sec);
  font-size: 1.1rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.sidebar-close:hover,
.sidebar-close:focus-visible {
  background: rgba(255,80,80,0.15);
  border-color: rgba(255,80,80,0.4);
  color: var(--danger);
  transform: rotate(90deg);
  outline: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0 20px;
  overscroll-behavior: contain;
}

.sidebar-nav ul {
  list-style: none;
  padding-bottom: 28px;
}

.nav-separator {
  padding: 12px 20px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--text-sec);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-right: 3px solid transparent;
  position: relative;
  min-height: 44px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text);
}

.nav-item.active {
  background: var(--gold-glow);
  color: var(--gold);
  border-right-color: var(--gold);
}

.nav-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-inline-start: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

.nav-badge:empty { display: none; }

.sidebar-footer {
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-user-name { font-size: 0.85rem; font-weight: 600; }
.sidebar-user-role { font-size: 0.72rem; color: var(--gold); }

.btn-logout {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255,80,80,0.3);
  border-radius: 8px;
  color: var(--danger);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.btn-logout:hover { background: rgba(255,80,80,0.1); }

/* ── Sidebar Overlay (mobile) ─────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* ── Main Area ───────────────────────────────── */
.admin-main {
  flex: 1;
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
}

/* ── Topbar ──────────────────────────────────── */
.admin-topbar {
  height: var(--topbar-h);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-menu-btn {
  display: none;
  background: rgba(200,169,74,0.08);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.topbar-menu-btn:hover,
.topbar-menu-btn:focus-visible {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 12px rgba(200,169,74,0.3);
  outline: none;
}

.topbar-menu-btn:active {
  transform: scale(0.95);
}

.menu-btn-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 20px;
  height: 20px;
}

.menu-btn-icon span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.topbar-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.topbar-time { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }

/* ── Alerts ──────────────────────────────────── */
.admin-alerts { padding: 0 24px; }
.admin-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0 0;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s ease;
  word-break: break-word;
}
.admin-alert-success { background: rgba(74,200,100,0.1); border: 1px solid rgba(74,200,100,0.3); color: var(--success); }
.admin-alert-error   { background: rgba(255,80,80,0.1); border: 1px solid rgba(255,80,80,0.3); color: var(--danger); }

/* ── Sections ────────────────────────────────── */
.admin-section { padding: 24px; flex: 1; }

.section-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

/* ── Stats Grid ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
  overflow: hidden;
}

.stat-card:hover { border-color: var(--border-gold); }

.stat-card-icon { font-size: 1.8rem; margin-bottom: 8px; }
.stat-card-value {
  font-size: 1.8rem;
  font-weight: 900;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-all;
}
.stat-card-label { color: var(--text-sec); font-size: 0.8rem; margin-top: 4px; }
.stat-card-sub   { color: var(--text-muted); font-size: 0.75rem; margin-top: 2px; }

/* ── Cards ───────────────────────────────────── */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow: hidden;
}

.admin-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Table ───────────────────────────────────── */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  border-radius: 8px;
}

/* Table horizontal scroll hint badge */
.table-scroll-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(200,169,74,0.08);
  border: 1px dashed var(--border-gold);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 10px;
  user-select: none;
}

@media (max-width: 767px) {
  .table-scroll-hint {
    display: flex;
  }
}

.admin-table-wrap::-webkit-scrollbar {
  height: 6px;
}
.admin-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(200,169,74,0.3);
  border-radius: 99px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 500px;
}

.admin-table th {
  text-align: right;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.admin-table tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending    { background:rgba(200,169,74,0.15); color:var(--gold); border:1px solid var(--border-gold); }
.badge-approved   { background:rgba(74,200,100,0.12); color:var(--success); border:1px solid rgba(74,200,100,0.3); }
.badge-rejected   { background:rgba(255,80,80,0.12); color:var(--danger); border:1px solid rgba(255,80,80,0.3); }
.badge-published  { background:rgba(74,200,100,0.12); color:var(--success); border:1px solid rgba(74,200,100,0.3); }
.badge-draft      { background:rgba(255,255,255,0.05); color:var(--text-muted); }
.badge-paused     { background:rgba(200,169,74,0.1); color:var(--gold); }
.badge-processing { background:rgba(100,149,255,0.12); color:#6495ff; border:1px solid rgba(100,149,255,0.3); }
.badge-paid       { background:rgba(74,200,100,0.12); color:var(--success); border:1px solid rgba(74,200,100,0.3); }
.badge-cancelled  { background:rgba(255,255,255,0.05); color:var(--text-muted); }
.badge-active     { background:rgba(74,200,100,0.12); color:var(--success); }
.badge-suspended  { background:rgba(255,165,0,0.12); color:orange; }
.badge-banned     { background:rgba(255,80,80,0.12); color:var(--danger); }

/* ── Inputs ──────────────────────────────────── */
.admin-input {
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
  direction: rtl;
  max-width: 100%;
}

.admin-input:focus { border-color: var(--gold); }

.admin-select {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  cursor: pointer;
  max-width: 100%;
}

.admin-label {
  display: block;
  color: var(--text-sec);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.admin-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
  margin-inline-end: 8px;
  flex-shrink: 0;
}

.form-group { margin-bottom: 16px; }
.form-check-group { display: flex; align-items: center; margin-bottom: 10px; }

/* ── Buttons ──────────────────────────────────── */
.btn-admin-primary {
  padding: 9px 20px;
  background: var(--gold-grad);
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  white-space: nowrap;
}

.btn-admin-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-admin-success {
  padding: 9px 20px;
  background: rgba(74,200,100,0.12);
  border: 1px solid rgba(74,200,100,0.4);
  border-radius: 8px;
  color: var(--success);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  white-space: nowrap;
}

.btn-admin-danger {
  padding: 9px 20px;
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.4);
  border-radius: 8px;
  color: var(--danger);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  white-space: nowrap;
}

.btn-admin-warning {
  padding: 9px 20px;
  background: rgba(200,169,74,0.1);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  color: var(--gold);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  white-space: nowrap;
}

.btn-sm-action {
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-sec);
  font-family: var(--font);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
  white-space: nowrap;
}

.btn-sm-action:hover { border-color: var(--border-gold); color: var(--gold); }

/* ── Modal ───────────────────────────────────── */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.admin-modal-overlay.d-none {
  display: none !important;
}

.admin-modal-overlay:not(.d-none) {
  display: flex !important;
}

.admin-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  box-sizing: border-box;
}

.admin-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 1;
  border-radius: 16px 16px 0 0;
}

.admin-modal-header h3 { font-size: 1rem; font-weight: 700; margin: 0; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: rgba(255,80,80,0.1); color: var(--danger); }

.admin-modal-body { padding: 20px; }

.admin-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--bg-elevated);
  z-index: 1;
  border-radius: 0 0 16px 16px;
}

/* Modal details */
.modal-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  gap: 12px;
}

.modal-detail-row:last-child { border-bottom: none; }
.modal-detail-label { color: var(--text-sec); white-space: nowrap; flex-shrink: 0; }
.modal-detail-value { font-weight: 600; word-break: break-word; text-align: left; min-width: 0; }

/* ── Pagination ──────────────────────────────── */
.admin-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 16px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-sec);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  min-height: 36px;
}

.page-btn:hover, .page-btn.active { border-color: var(--gold); color: var(--gold); }

/* ── Skeleton ────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: -200% } 100% { background-position: 200% } }
@keyframes fadeIn  { from { opacity:0 } to { opacity:1 } }

/* ── Tabs ────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tab {
  padding: 10px 18px;
  background: transparent;
  border: none;
  color: var(--text-sec);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 44px;
}

.admin-tab:hover { background: var(--bg-elevated); color: var(--text); }
.admin-tab.active { background: var(--gold); color: #000; }

.admin-tab-panel { animation: fadeIn 0.3s ease; }

/* ── Color Picker ────────────────────────────── */
.color-picker-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-color {
  width: 44px;
  height: 38px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  background: var(--bg-input);
  cursor: pointer;
  flex-shrink: 0;
}

.admin-color-text {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  min-width: 0;
}

/* ── 3-Column Grid ────────────────────────────── */
.admin-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ── Upload Zone ─────────────────────────────── */
.upload-zone {
  padding: 20px;
  border: 2px dashed var(--border-gold);
  border-radius: var(--radius);
  text-align: center;
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-zone:hover { border-color: var(--gold); }

.btn-admin-outline {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.btn-admin-outline:hover { background: var(--gold-glow); }

/* ── Social Links ────────────────────────────── */
.social-link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-base);
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  gap: 12px;
  flex-wrap: wrap;
}

.social-link-row:hover { border-color: var(--border-gold); }

.social-link-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.social-link-icon { font-size: 1.4rem; flex-shrink: 0; }

.social-link-platform {
  font-weight: 700;
  font-size: 0.9rem;
}

.social-link-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-link-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── VIP Tiers ───────────────────────────────── */
.vip-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Unified Responsive Cards Grid (VIP Tiers Style) ────────────── */
.admin-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .admin-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 10px;
  }
}

.admin-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.admin-item-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.admin-item-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: rgba(255,255,255,0.015);
}

.admin-item-card-icon {
  font-size: 1.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-item-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.admin-item-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.admin-item-card-badges {
  margin-inline-start: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-item-card-body {
  padding: 14px 18px;
  flex: 1;
}

.admin-item-card-desc {
  font-size: 0.84rem;
  color: var(--text-sec);
  line-height: 1.5;
  margin-bottom: 12px;
  word-break: break-word;
}

.admin-item-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .admin-item-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.admin-item-stat {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg-base);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}

.admin-item-stat-value {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--gold);
  word-break: break-all;
}

.admin-item-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-item-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(0,0,0,0.1);
}

.vip-tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}

.vip-tier-card:hover { border-color: var(--border-gold); transform: translateY(-2px); }

.vip-tier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.vip-tier-name {
  font-weight: 800;
  font-size: 1.05rem;
}

.vip-tier-slug {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.vip-tier-body { padding: 16px 20px; }

.vip-tier-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.vip-stat {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg-base);
  border-radius: 8px;
  overflow: hidden;
}

.vip-stat-value {
  font-weight: 800;
  font-size: 1rem;
  color: var(--gold);
  word-break: break-all;
}

.vip-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.vip-tier-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Tier Modal Overlay ──────────────────────── */
#tier-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
  padding: 16px;
}

/* ── Utility: w-100 ─────────────────────────── */
.w-100 { width: 100% !important; }

/* ── Dashboard quick-list items (JS-rendered inline) ── */
.dash-quick-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--bg-base);
  border-radius: 8px;
  margin-bottom: 6px;
  gap: 12px;
}

/* ── Content section cards (rendered by JS) ── */
.content-section-card {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-base);
  border-radius: 12px;
  overflow: hidden;
}

.content-section-card .admin-input {
  width: 100%;
}


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

/* ── Laptop and smaller: ≤1439px ────────────── */
@media (max-width: 1439px) {
  .vip-tiers-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ── Tablet and below: ≤1024px ──────────────── */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 280px !important;
    max-width: 85vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    transform: translateX(100%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease, box-shadow 0.3s ease !important;
    border-left: 1px solid var(--border-gold);
    display: flex !important;
    flex-direction: column !important;
    z-index: 10000 !important;
    box-shadow: none !important;
  }

  [dir="ltr"] .admin-sidebar {
    right: auto !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
    border-left: none;
    border-right: 1px solid var(--border-gold);
  }

  .admin-sidebar.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    box-shadow: -10px 0 40px rgba(0,0,0,0.95) !important;
  }

  [dir="ltr"] .admin-sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 10px 0 40px rgba(0,0,0,0.95) !important;
  }

  .sidebar-overlay {
    z-index: 9999 !important;
  }

  .admin-main {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .topbar-menu-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 105 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background: rgba(200, 169, 74, 0.16) !important;
    border: 1.5px solid var(--gold) !important;
    border-radius: 10px !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 0 10px rgba(200, 169, 74, 0.25) !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  .topbar-menu-btn svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    stroke: var(--gold-light) !important;
  }

  .sidebar-close {
    display: flex !important;
    touch-action: manipulation;
  }

  .admin-grid-2col { grid-template-columns: 1fr; }
  .admin-grid-3col { grid-template-columns: 1fr 1fr; }
}

/* ── Large phone / Small tablet: ≤767px ────── */
@media (max-width: 767px) {
  html { font-size: 14px; }

  .admin-topbar {
    padding: 0 16px;
    height: 56px;
    gap: 8px;
  }

  .topbar-title {
    font-size: 0.95rem;
  }

  .admin-section { padding: 16px; }

  .admin-alerts { padding: 0 16px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-value {
    font-size: 1.4rem;
  }

  .admin-card {
    padding: 16px;
  }

  .admin-grid-3col {
    grid-template-columns: 1fr;
  }

  .vip-tiers-grid {
    grid-template-columns: 1fr;
  }

  .vip-tier-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  /* Modal adjustments */
  .admin-modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .admin-modal {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    max-width: 100%;
  }

  .admin-modal-header {
    border-radius: 16px 16px 0 0;
  }

  .admin-modal-body {
    padding: 16px;
  }

  .admin-modal-footer {
    padding: 12px 16px;
    border-radius: 0;
    gap: 8px;
  }

  .admin-modal-footer button {
    flex: 1;
    min-width: 0;
  }

  /* Tier modal special */
  #tier-modal .admin-modal {
    max-width: 100%;
  }

  /* Modal detail rows stack on small screens */
  .modal-detail-row {
    flex-direction: column;
    gap: 4px;
  }

  .modal-detail-value {
    text-align: right;
  }

  /* ═══════════════════════════════════════════════════════════
     TABLES TO MODERN RESPONSIVE CARDS (≤767px)
     ═══════════════════════════════════════════════════════════ */
  .table-scroll-hint {
    display: none !important;
  }

  .admin-table-wrap {
    overflow: visible !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  .admin-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
    border: none !important;
    background: transparent !important;
  }

  .admin-table thead {
    display: none !important;
  }

  .admin-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .admin-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    background: linear-gradient(135deg, rgba(26, 27, 36, 0.96) 0%, rgba(18, 19, 25, 0.98) 100%) !important;
    border: 1px solid rgba(240, 216, 120, 0.22) !important;
    border-radius: 14px !important;
    padding: 14px 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    transition: transform 0.15s ease, border-color 0.15s ease !important;
  }

  .admin-table tbody tr:active {
    transform: scale(0.99);
  }

  .admin-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    text-align: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 34px !important;
  }

  .admin-table td > div {
    max-width: none !important;
  }

  .admin-table td:last-child {
    border-bottom: none !important;
    padding-top: 10px !important;
    padding-bottom: 0 !important;
    display: flex !important;
    width: 100% !important;
    justify-content: stretch !important;
  }

  /* Empty state */
  .admin-table tr td[colspan] {
    display: block !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 30px 14px !important;
    border-bottom: none !important;
    background: transparent !important;
  }
  .admin-table tr td[colspan]::before {
    display: none !important;
  }

  /* ── 1. Tasks Table (#tasks-table) ── */
  #tasks-table td:nth-of-type(1)::before { content: "رقم المهمة (#)"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #tasks-table td:nth-of-type(2)::before { content: "عنوان المهمة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #tasks-table td:nth-of-type(3)::before { content: "المكافأة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #tasks-table td:nth-of-type(4)::before { content: "فئة VIP المسموحة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #tasks-table td:nth-of-type(5)::before { content: "حالة المهمة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #tasks-table td:nth-of-type(6)::before { content: "التسليمات المكتملة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #tasks-table td:nth-of-type(7)::before { content: "الإجراءات"; display: none !important; }
  #tasks-table td:nth-of-type(7) > div { width: 100% !important; display: flex !important; gap: 8px !important; }
  #tasks-table td:nth-of-type(7) .btn-sm-action { flex: 1 !important; min-height: 42px !important; padding: 8px 12px !important; font-size: 0.88rem !important; font-weight: 700 !important; border-radius: 8px !important; justify-content: center !important; text-align: center !important; }

  /* ── 2. Submissions Table (#submissions-table) ── */
  #submissions-table td:nth-of-type(1)::before { content: "رقم الإثبات (#)"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #submissions-table td:nth-of-type(2)::before { content: "المستخدم"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #submissions-table td:nth-of-type(3)::before { content: "المهمة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #submissions-table td:nth-of-type(4)::before { content: "المكافأة المستحقة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #submissions-table td:nth-of-type(5)::before { content: "حالة الإثبات"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #submissions-table td:nth-of-type(6)::before { content: "تاريخ التسليم"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #submissions-table td:nth-of-type(7)::before { content: "الإجراء"; display: none !important; }
  #submissions-table td:nth-of-type(7) .btn-sm-action { width: 100% !important; min-height: 42px !important; font-size: 0.92rem !important; font-weight: 800 !important; border-radius: 8px !important; justify-content: center !important; text-align: center !important; background: var(--gold) !important; color: #000 !important; }

  /* ── 3. Users Table (#users-table) ── */
  #users-table td:nth-of-type(1)::before { content: "المعرف (#)"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #users-table td:nth-of-type(2)::before { content: "الاسم الكامل"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #users-table td:nth-of-type(3)::before { content: "البريد الإلكتروني"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #users-table td:nth-of-type(4)::before { content: "الرصيد المتاح"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #users-table td:nth-of-type(5)::before { content: "حالة الحساب"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #users-table td:nth-of-type(6)::before { content: "تاريخ الانضمام"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #users-table td:nth-of-type(7)::before { content: "إجراء تغيير الحالة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; margin-bottom: 2px !important; }
  #users-table td:nth-of-type(7) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
  #users-table td:nth-of-type(7) select { width: 100% !important; min-height: 42px !important; font-size: 0.88rem !important; padding: 6px 12px !important; border-radius: 8px !important; background: var(--bg-card) !important; border: 1px solid var(--border-gold) !important; }

  /* ── 4. Withdrawals Table (#wd-table) ── */
  #wd-table td:nth-of-type(1)::before { content: "رقم الطلب (#)"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #wd-table td:nth-of-type(2)::before { content: "المستخدم"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #wd-table td:nth-of-type(3)::before { content: "المبلغ المطلوب"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #wd-table td:nth-of-type(4)::before { content: "الشبكة الرقمية"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #wd-table td:nth-of-type(5)::before { content: "حالة السحب"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #wd-table td:nth-of-type(6)::before { content: "تاريخ الطلب"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #wd-table td:nth-of-type(7)::before { content: "الإجراء"; display: none !important; }
  #wd-table td:nth-of-type(7) .btn-sm-action { width: 100% !important; min-height: 42px !important; font-size: 0.92rem !important; font-weight: 800 !important; border-radius: 8px !important; justify-content: center !important; text-align: center !important; background: var(--gold) !important; color: #000 !important; }

  /* ── 5. Site Identity (#section-site-identity) ── */
  #section-site-identity .admin-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 8px !important;
    padding: 6px 4px !important;
    border-radius: 12px !important;
    background: rgba(22, 23, 29, 0.9) !important;
    border: 1px solid var(--border) !important;
    margin-bottom: 16px !important;
  }
  #section-site-identity .admin-tabs::-webkit-scrollbar {
    display: none !important;
  }
  #section-site-identity .admin-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
    min-height: 40px !important;
    border-radius: 8px !important;
  }

  #section-site-identity .admin-card {
    max-width: 100% !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  #section-site-identity .admin-grid-3col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #section-site-identity .color-picker-group {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    padding: 6px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #section-site-identity .admin-color {
    width: 44px !important;
    height: 38px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  #section-site-identity .admin-color-text {
    flex: 1 !important;
    border: none !important;
    background: transparent !important;
    font-family: monospace !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    padding: 0 !important;
    min-height: auto !important;
    direction: ltr !important;
    text-align: left !important;
  }

  .social-footer-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .social-footer-row button {
    width: 100% !important;
    min-height: 44px !important;
  }

  #section-site-identity .upload-zone {
    padding: 18px 12px !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #section-site-identity #logo-upload-btn {
    width: 100% !important;
    min-height: 44px !important;
    text-align: center !important;
  }

  #section-site-identity button[type="submit"] {
    width: 100% !important;
    min-height: 46px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
  }

  /* ── Modals Responsiveness ── */
  .admin-modal-overlay {
    padding: 8px !important;
    align-items: flex-end !important;
  }

  .admin-modal {
    max-height: 94vh !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .admin-modal-body {
    max-height: calc(94vh - 130px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px 14px !important;
  }

  .admin-modal-footer {
    padding: 12px 14px !important;
    gap: 8px !important;
    flex-direction: column-reverse !important;
  }

  .admin-modal-footer button {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 0.92rem !important;
    margin: 0 !important;
  }

  #wd-modal .admin-modal-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  #wd-paid-btn {
    order: 1 !important;
    background: var(--success) !important;
    color: #fff !important;
    font-weight: 800 !important;
    min-height: 46px !important;
  }

  #wd-processing-btn {
    order: 2 !important;
  }

  #wd-reject-btn {
    order: 3 !important;
  }

  /* Section toolbar */
  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .section-toolbar .btn-admin-primary {
    width: 100%;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
  }

  .section-filters {
    width: 100%;
  }

  .section-filters .admin-select,
  .section-filters .admin-input {
    width: 100%;
    min-height: 44px;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  #users-search {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 0.9rem !important;
    border-radius: 10px !important;
  }

  /* Admin tabs */
  .admin-tabs {
    gap: 4px;
    padding: 4px;
  }

  .admin-tab {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* Social links */
  .social-link-url {
    max-width: 160px;
  }

  /* Pagination */
  .admin-pagination {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 38px;
  }

  /* Bootstrap row overrides for modals */
  .row.g-2 > [class*="col-md-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ── Standard phone: ≤430px ─────────────────── */
@media (max-width: 430px) {
  .admin-section { padding: 12px; }
  .admin-alerts { padding: 0 12px; }

  .admin-topbar {
    padding: 0 12px;
  }

  .topbar-title {
    font-size: 0.95rem;
    font-weight: 800;
  }

  .topbar-time {
    display: none;
  }

  .admin-tabs {
    gap: 4px;
    padding: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tab {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.78rem;
    min-height: 42px;
  }

  /* Social cards mobile */
  .social-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .social-card-controls {
    width: 100%;
    justify-content: space-between;
  }

  .social-card-body {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .social-input-wrap {
    min-width: 100%;
    width: 100%;
  }

  .social-card-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card-value {
    font-size: 1.2rem;
  }

  .stat-card-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
  }

  .stat-card-label {
    font-size: 0.72rem;
  }

  .admin-card {
    padding: 14px;
    border-radius: 10px;
  }

  .admin-card-title {
    font-size: 0.9rem;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  /* Sidebar mobile */
  .admin-sidebar {
    width: 85vw;
    max-width: 300px;
  }

  /* Upload zone */
  .upload-zone {
    padding: 16px;
  }

  /* Social link form responsive */
  .social-link-form .admin-grid-3col {
    grid-template-columns: 1fr;
  }

  .social-link-row {
    padding: 10px 12px;
  }

  .social-link-url {
    max-width: 120px;
    font-size: 0.7rem;
  }

  /* VIP tier */
  .vip-tier-header {
    padding: 12px 14px;
    gap: 8px;
  }

  .vip-tier-body {
    padding: 12px 14px;
  }

  .vip-tier-footer {
    padding: 10px 14px;
  }

  .vip-stat-value {
    font-size: 0.85rem;
  }

  .vip-stat-label {
    font-size: 0.65rem;
  }
}

/* ── Small phone: ≤374px ───────────────────── */
@media (max-width: 374px) {
  html { font-size: 13px; }

  .admin-topbar {
    height: 50px;
    gap: 6px;
  }

  .admin-section { padding: 10px; }
  .admin-alerts { padding: 0 10px; }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card-value {
    font-size: 1.3rem;
  }

  .admin-card {
    padding: 12px;
    border-radius: 8px;
  }

  .admin-sidebar {
    width: 90vw;
    max-width: 280px;
  }

  .nav-item {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .nav-separator {
    padding: 10px 16px 4px;
    font-size: 0.62rem;
  }

  /* Modal even tighter */
  .admin-modal-overlay {
    padding: 8px;
  }

  .admin-modal-body {
    padding: 12px;
  }

  .admin-modal-footer {
    padding: 10px 12px;
  }

  /* Buttons stretch full width */
  .btn-admin-primary,
  .btn-admin-danger,
  .btn-admin-success,
  .btn-admin-warning {
    padding: 9px 14px;
    font-size: 0.8rem;
  }

  /* VIP stat grid force 2 columns */
  .vip-tier-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Pagination compact */
  .page-btn {
    padding: 5px 8px;
    font-size: 0.7rem;
  }

  /* Admin tab even smaller */
  .admin-tab {
    padding: 7px 10px;
    font-size: 0.72rem;
  }
}

/* ── Very small phone: ≤319px ──────────────── */
@media (max-width: 319px) {
  html { font-size: 12px; }

  .admin-sidebar {
    width: 100vw;
    max-width: 100vw;
  }
}

/* ── Large desktop: ≥1440px ──────────────────── */
@media (min-width: 1440px) {
  .admin-section {
    padding: 32px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Extra large: ≥1920px ───────────────────── */
@media (min-width: 1920px) {
  .admin-section {
    padding: 40px;
    max-width: 1800px;
  }
}

/* ── Print ───────────────────────────────────── */
@media print {
  .admin-sidebar,
  .sidebar-overlay,
  .topbar-menu-btn,
  .sidebar-close {
    display: none;
  }
  .admin-main {
    margin-right: 0;
  }
}

/* ── Standardized Social Media Settings ──────── */
.social-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.social-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  transition: all 0.2s ease;
  position: relative;
}

.social-card-item:hover {
  border-color: var(--border-gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.social-card-item.is-active-card {
  border-right: 4px solid var(--gold);
}

.social-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.social-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.95rem;
}

.social-platform-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.social-platform-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.social-platform-icon.whatsapp { background: rgba(37, 211, 102, 0.15); color: #25d366; border: 1px solid rgba(37, 211, 102, 0.3); }
.social-platform-icon.facebook { background: rgba(24, 119, 242, 0.15); color: #1877f2; border: 1px solid rgba(24, 119, 242, 0.3); }
.social-platform-icon.telegram { background: rgba(34, 158, 217, 0.15); color: #229ed9; border: 1px solid rgba(34, 158, 217, 0.3); }
.social-platform-icon.instagram { background: rgba(225, 48, 108, 0.15); color: #e1306c; border: 1px solid rgba(225, 48, 108, 0.3); }

.social-card-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-card-body {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.social-input-wrap {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.social-input-wrap .admin-input {
  width: 100%;
  padding-left: 36px;
  font-family: monospace, var(--font);
  font-size: 0.85rem;
}

.social-input-wrap .social-validation-status {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
}

.social-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Switch toggle */
.admin-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
}

.admin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.admin-switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s;
  border-radius: 24px;
  border: 1px solid var(--border);
  display: inline-block;
  flex-shrink: 0;
}

.admin-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  right: 2px;
  bottom: 2px;
  background-color: #fff;
  transition: 0.25s;
  border-radius: 50%;
}

.admin-switch input:checked + .admin-switch-slider {
  background-color: var(--gold);
  border-color: var(--gold);
}

.admin-switch input:checked + .admin-switch-slider:before {
  transform: translateX(-20px);
  background-color: #000;
}

.admin-switch-label {
  font-size: 0.8rem;
  color: var(--text-sec);
  user-select: none;
}

/* ── Standard Switch Component ── */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 28px;
  border: 1px solid var(--border);
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  right: 4px;
  bottom: 3px;
  background-color: #e0e0e0;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
input:checked + .slider {
  background-color: var(--gold);
  border-color: var(--gold);
}
input:checked + .slider:before {
  transform: translateX(-24px);
  background-color: #0b0c10;
}

/* ── Responsive Card Representation for VIP Subscriptions on Mobile ── */
@media (max-width: 768px) {
  #vip-sub-table td:nth-of-type(1)::before { content: "رقم الطلب"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #vip-sub-table td:nth-of-type(2)::before { content: "المستخدم"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #vip-sub-table td:nth-of-type(3)::before { content: "الفئة المطلوبة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #vip-sub-table td:nth-of-type(4)::before { content: "المبلغ المقفل"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #vip-sub-table td:nth-of-type(5)::before { content: "طريقة الدفع"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #vip-sub-table td:nth-of-type(6)::before { content: "تاريخ الإنشاء"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #vip-sub-table td:nth-of-type(7)::before { content: "الإيصال"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #vip-sub-table td:nth-of-type(8)::before { content: "حالة الطلب"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #vip-sub-table td:nth-of-type(9)::before { content: "الإجراء"; display: none !important; }
  #vip-sub-table td:nth-of-type(9) button { width: 100% !important; min-height: 42px !important; }

  #payment-methods-table td:nth-of-type(1)::before { content: "#"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(2)::before { content: "اسم الطريقة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(3)::before { content: "النوع"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(4)::before { content: "المعرف / العنوان"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(5)::before { content: "المستفيد / البنك"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(6)::before { content: "العملة"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(7)::before { content: "حالة التفعيل"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(8)::before { content: "متاح لـ VIP"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(9)::before { content: "الطلبات"; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
  #payment-methods-table td:nth-of-type(10)::before { content: "الإجراءات"; display: none !important; }
  #payment-methods-table td:nth-of-type(10) div { width: 100% !important; }
  #payment-methods-table td:nth-of-type(10) button { flex: 1 !important; min-height: 40px !important; }
}

/* ── Mobile & Small Screen Optimizations (<= 768px & <= 480px) ── */
@media (max-width: 768px) {
  .admin-modal-overlay {
    padding: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .admin-modal-overlay.d-none {
    display: none !important;
  }

  .admin-modal {
    max-height: 94vh !important;
    border-radius: 14px !important;
    width: 100% !important;
    margin: auto !important;
  }

  .admin-modal-header {
    padding: 14px 16px !important;
  }

  .admin-modal-body {
    padding: 14px 16px !important;
  }

  .admin-modal-footer {
    padding: 12px 16px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .admin-modal-footer button {
    flex: 1 1 45% !important;
    min-height: 44px !important;
  }

  .section-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .section-toolbar > div,
  .section-toolbar > button,
  .section-toolbar .section-filters {
    width: 100% !important;
  }

  .section-toolbar button {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
  }

  .admin-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .admin-item-card {
    padding: 14px !important;
  }

  .admin-item-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .admin-item-card-footer {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .admin-item-card-footer button,
  .admin-item-card-footer select {
    width: 100% !important;
    min-height: 40px !important;
  }
}

@media (max-width: 480px) {
  .admin-modal-footer button {
    flex: 1 1 100% !important;
  }
}



