/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:      #FDBB0B;
  --primary-dark: #D49C0A;
  --primary-glow: rgba(253,187,11,0.15);
  --bg:           #181A20;
  --surface:      #262932;
  --surface-2:    #1F222A;
  --surface-3:    #2D3141;
  --border:       #35383F;
  --border-glow:  rgba(253,187,11,0.3);
  --text-primary: #FFFFFF;
  --text-muted:   #9E9E9E;
  --danger:       #E05C5C;
  --success:      #2ECC71;
  --info:         #5B8DEF;
  --radius:       14px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Cairo', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ── Layout ────────────────────────────────────────────────── */
.admin-container { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-icon {
  width: 46px; height: 46px;
  background: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #000;
  box-shadow: 0 4px 16px rgba(253,187,11,0.35);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 20px 20px 8px;
}

.nav-links { list-style: none; padding: 8px 12px; }

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  transition: all 0.2s;
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 600;
}

.nav-links li a i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  transition: transform 0.2s;
}

.nav-links li a:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

.nav-links li a:hover i { transform: scale(1.15); }

.nav-links li a.active {
  background: var(--primary-glow);
  color: var(--primary);
  border-right: 3px solid var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.sidebar-footer a:hover { background: rgba(224,92,92,0.1); }

/* ── Main Content ──────────────────────────────────────────── */
.main-content { flex: 1; padding: 28px; background: var(--bg); overflow: hidden; }

/* ── Top Header ────────────────────────────────────────────── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.header h1::before {
  content: '';
  width: 4px; height: 24px;
  background: var(--primary);
  border-radius: 4px;
  display: inline-block;
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.admin-badge {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid var(--border-glow);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
}

/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-item:hover { transform: translateY(-2px); border-color: var(--border-glow); }

.stat-item::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: var(--primary-glow);
  border-radius: 0 var(--radius) 0 60px;
}

.stat-item .stat-icon {
  font-size: 24px;
  margin-bottom: 12px;
}

.stat-item h3 {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-item .val {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

/* ── Search & Filter Bar ──────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 11px 16px 11px 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--primary); }

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.filter-select {
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Cairo', sans-serif;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 140px;
}

.filter-select:focus { border-color: var(--primary); }

.filter-btn {
  padding: 11px 20px;
  background: var(--primary);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex; align-items: center; gap: 6px;
  font-family: 'Cairo', sans-serif;
}

.filter-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

.filter-reset {
  padding: 11px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Cairo', sans-serif;
}

.filter-reset:hover { border-color: var(--danger); color: var(--danger); }

/* ── Results Count ─────────────────────────────────────────── */
.results-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.results-count span { color: var(--primary); font-weight: 700; }

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 3px; height: 18px;
  background: var(--primary);
  border-radius: 3px;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 10px; }

table { width: 100%; border-collapse: collapse; text-align: right; }

thead { background: var(--surface-2); }

th {
  padding: 13px 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(253,187,11,0.04); }

.text-muted { color: var(--text-muted); font-size: 12px; }
.text-primary { color: var(--primary); }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

.badge-pending    { background: rgba(253,187,11,0.1);  color: var(--primary); border: 1px solid rgba(253,187,11,0.2); }
.badge-approved   { background: rgba(46,204,113,0.1);  color: var(--success); border: 1px solid rgba(46,204,113,0.2); }
.badge-verified   { background: rgba(46,204,113,0.1);  color: var(--success); border: 1px solid rgba(46,204,113,0.2); }
.badge-completed  { background: rgba(46,204,113,0.1);  color: var(--success); border: 1px solid rgba(46,204,113,0.2); }
.badge-rejected   { background: rgba(224,92,92,0.1);   color: var(--danger);  border: 1px solid rgba(224,92,92,0.2); }
.badge-suspended  { background: rgba(224,92,92,0.1);   color: var(--danger);  border: 1px solid rgba(224,92,92,0.2); }
.badge-unverified { background: rgba(158,158,158,0.1); color: var(--text-muted); border: 1px solid rgba(158,158,158,0.2); }
.badge-buy  { background: rgba(46,204,113,0.1);  color: var(--success); border: 1px solid rgba(46,204,113,0.2); }
.badge-sell { background: rgba(253,187,11,0.1);  color: var(--primary); border: 1px solid rgba(253,187,11,0.2); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: 'Cairo', sans-serif;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #27ae60; transform: translateY(-1px); }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: #c0392b;  transform: translateY(-1px); }
.btn-warning { background: rgba(253,187,11,0.15); color: var(--primary); border: 1px solid var(--border-glow); }
.btn-warning:hover { background: rgba(253,187,11,0.25); }
.btn-sm { padding: 5px 10px; font-size: 11px; border-radius: 6px; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); font-weight: 600; }

input[type="text"], input[type="password"], input[type="number"],
input[type="email"], textarea, select {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus { border-color: var(--primary); }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}

.alert::before { font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 16px; }
.alert-danger  { background: rgba(224,92,92,0.1);  color: var(--danger); border: 1px solid rgba(224,92,92,0.25); }
.alert-success { background: rgba(46,204,113,0.1); color: var(--success); border: 1px solid rgba(46,204,113,0.25); }
.alert-danger::before  { content: '\f057'; }
.alert-success::before { content: '\f058'; }

/* ── Login Page ────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, #2a2200 0%, var(--bg) 60%);
}

.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border-radius: 20px;
  padding: 44px 40px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.login-logo {
  text-align: center;
  margin-bottom: 6px;
}

.login-logo .logo-circle {
  width: 72px; height: 72px;
  background: var(--primary);
  border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 36px; color: #000;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(253,187,11,0.35);
}

.login-logo h2 { font-size: 24px; font-weight: 800; color: var(--text-primary); }
.login-subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }

/* ── Image preview ─────────────────────────────────────────── */
.img-preview {
  width: 50px; height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: transform 0.2s;
  cursor: pointer;
}

.img-preview:hover { transform: scale(1.05); border-color: var(--primary); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Code tags ─────────────────────────────────────────────── */
code {
  background: rgba(253,187,11,0.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 220px; }
}

@media (max-width: 768px) {
  .admin-container { flex-direction: column; }
  
  /* Mobile Sidebar as Horizontal Scrollable Nav */
  .sidebar { 
    width: 100%; 
    min-height: auto; 
    height: auto; 
    position: sticky; 
    top: 0; 
    z-index: 1000;
    display: block; 
    overflow-x: auto; 
    overflow-y: hidden;
    white-space: nowrap; 
    -webkit-overflow-scrolling: touch; 
    background: var(--surface);
    border-left: none;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    padding: 0 15px;
  }
  .sidebar::-webkit-scrollbar { height: 4px; }
  
  .sidebar-logo { 
    display: inline-flex; 
    vertical-align: middle; 
    border-bottom: none; 
    padding: 12px 0;
    margin-left: 20px;
  }
  .sidebar-logo .logo-icon { width: 36px; height: 36px; font-size: 18px; }
  .sidebar-logo .logo-text { font-size: 16px; }
  .sidebar-logo .logo-sub { display: none; }
  
  .nav-section-title { display: none; }
  
  .nav-links { 
    display: inline-block; 
    vertical-align: middle; 
    padding: 12px 0 12px 10px; 
    margin: 0; 
  }
  .nav-links li { display: inline-block; margin-left: 6px; }
  .nav-links li a { 
    display: inline-flex; 
    margin-bottom: 0; 
    padding: 8px 14px; 
    font-size: 13px; 
    background: var(--surface-2); 
    border-radius: 20px; 
    border: 1px solid transparent;
  }
  .nav-links li a.active { border-right: none; border: 1px solid var(--primary); }
  
  .sidebar-footer { 
    display: inline-block; 
    vertical-align: middle; 
    padding: 12px 15px 12px 0; 
    border: none; 
    margin-top: 0; 
  }
  .sidebar-footer a { 
    padding: 8px 14px; 
    background: rgba(224,92,92,0.1); 
    border-radius: 20px; 
  }
  
  /* Content Adjustments */
  .main-content { padding: 15px; overflow-x: hidden; }
  .header { margin-bottom: 20px; padding-bottom: 15px; }
  .header h1 { font-size: 18px; }
  
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-item { padding: 15px; }
  .stat-item .val { font-size: 24px; }
  
  .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-box { min-width: 100%; }
  .filter-select, .filter-btn, .filter-reset { width: 100%; justify-content: center; text-align: center; }
  
  .table-wrap { overflow-x: auto; border-radius: 8px; -webkit-overflow-scrolling: touch; }
  table { min-width: 800px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  table { min-width: 700px; }
}
