/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN DASHBOARD CSS — ROYAL PURPLE & RADIANT GOLD
   DESIGN: ULTRA-MODERN LUXURY GLASSMORPHISM & NEOMORPHISM
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* Purple Spectrum */
  --purple-950: #0d0618;
  --purple-900: #190a32;
  --purple-850: #220e44;
  --purple-800: #331464;
  --purple-700: #581c87;
  --purple-600: #7e22ce;
  --purple-500: #a855f7;
  --purple-400: #c084fc;
  
  /* Gold & Amber Radiant Spectrum */
  --gold-300: #fef08a;
  --gold-400: #fde047;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --gold-glow: 0 0 25px rgba(245, 158, 11, 0.35);

  /* Admin Base Mapping */
  --bg-main: #0d0618;
  --bg-sidebar: #140827;
  --bg-panel: rgba(25, 10, 50, 0.75);
  --bg-panel-solid: #1d0c3a;
  --bg-input: #120624;
  --border: rgba(216, 180, 254, 0.15);
  --border-gold: rgba(245, 158, 11, 0.3);
  --border-focus: #f59e0b;
  
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-purple: #7e22ce;
  
  --text-main: #fbf8ff;
  --text-muted: #a78bfa;
  --text-dim: #716089;
  
  --accent-gold: #fbbf24;
  --accent-purple: #c084fc;
  --accent-red: #ef4444;
  --accent-green: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top center, #331464 0%, #190a32 40%, #0d0618 100%);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-body::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(126, 34, 206, 0.35) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(60px);
}

.login-box {
  width: 100%;
  max-width: 440px;
  background: rgba(25, 10, 50, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 30px rgba(126, 34, 206, 0.2);
  position: relative;
  z-index: 2;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand .brand-icon {
  font-size: 3.2rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.5));
}

.login-brand h2 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  background: linear-gradient(135deg, #fff 30%, #fde047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand .brand-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.4rem;
}

.quick-hint {
  margin-top: 1.5rem;
  padding: 0.9rem;
  background: rgba(13, 6, 24, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.quick-hint code {
  color: var(--gold-400);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--gold-400);
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN LAYOUT & SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar-brand {
  padding: 1.5rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(51, 20, 100, 0.3) 0%, transparent 100%);
}

.sidebar-brand .brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

.sidebar-brand h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  color: #fff;
  line-height: 1.3;
}

.brand-badge {
  font-size: 0.7rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 1.2rem 0.8rem;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.sidebar-nav a:hover {
  color: #fff;
  background: rgba(126, 34, 206, 0.2);
  border-color: rgba(216, 180, 254, 0.2);
  transform: translateX(-4px);
}

.sidebar-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.4) 0%, rgba(245, 158, 11, 0.2) 100%);
  border: 1px solid var(--border-gold);
  box-shadow: 0 4px 15px rgba(126, 34, 206, 0.3);
  font-weight: 700;
}

.badge-count {
  margin-right: auto;
  background: var(--gold-gradient);
  color: #190a32;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.sidebar-user {
  padding: 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 6, 24, 0.4);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.u-avatar {
  font-size: 1.5rem;
  background: rgba(126, 34, 206, 0.3);
  border: 1px solid var(--border);
  padding: 5px;
  border-radius: 50%;
}

.u-name {
  font-size: 0.88rem;
  font-weight: 700;
  display: block;
  color: #fff;
}

.u-role {
  font-size: 0.72rem;
  color: var(--gold-400);
  display: block;
  font-weight: 600;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: radial-gradient(circle at top right, rgba(51, 20, 100, 0.35) 0%, transparent 60%);
}

.admin-header {
  padding: 1.3rem 2.2rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-title h2 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  color: #fff;
}

.header-actions {
  display: flex;
  gap: 0.8rem;
}

.admin-content {
  flex: 1;
  padding: 1.8rem 2.2rem;
  overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATS CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  margin-bottom: 1.8rem;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(126, 34, 206, 0.2);
}

.stat-icon {
  font-size: 2.2rem;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-gold .stat-icon, .card-yellow .stat-icon, .card-orange .stat-icon {
  background: rgba(245, 158, 11, 0.18);
  color: var(--gold-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-purple .stat-icon, .card-blue .stat-icon {
  background: rgba(126, 34, 206, 0.25);
  color: var(--purple-400);
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.card-green .stat-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-red .stat-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: 'Cairo', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}

.stat-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANELS & TABLES
   ═══════════════════════════════════════════════════════════════════════════ */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 1.8rem;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.panel-head {
  padding: 1.1rem 1.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(126, 34, 206, 0.15) 0%, transparent 100%);
}

.panel-head h2, .panel-head h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.panel-body {
  padding: 1.6rem;
}

.panel-body.no-padding {
  padding: 0;
}

.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th {
  background: rgba(13, 6, 24, 0.6);
  color: var(--gold-400);
  font-weight: 700;
  padding: 0.9rem 1.4rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.table td {
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid rgba(216, 180, 254, 0.08);
  vertical-align: middle;
}

.table tr:hover td {
  background: rgba(126, 34, 206, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS & FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: 10px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #190a32;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  color: #000;
}

.btn-purple, .btn-secondary {
  background: linear-gradient(135deg, #7e22ce 0%, #581c87 100%);
  color: #fff;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.btn-purple:hover, .btn-secondary:hover {
  background: linear-gradient(135deg, #9333ea 0%, #6b21a8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(126, 34, 206, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold-400);
}

.btn-outline:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.form-group {
  margin-bottom: 1.3rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
  background: rgba(18, 6, 36, 0.9);
}

.form-control::placeholder {
  color: var(--text-dim);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES & ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-gold {
  background: rgba(245, 158, 11, 0.18);
  color: var(--gold-400);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-purple {
  background: rgba(126, 34, 206, 0.25);
  color: var(--purple-400);
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.badge-green {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-red {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert {
  padding: 1rem 1.2rem;
  border-radius: 10px;
  margin-bottom: 1.3rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .grid-2col {
    grid-template-columns: 1fr;
  }
  .admin-content {
    padding: 1.2rem;
  }
  .admin-header {
    padding: 1rem 1.2rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR NAV GROUP LABELS
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-group-label {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.7rem 1rem 0.3rem;
  margin-top: 0.3rem;
  pointer-events: none;
  border-top: 1px solid rgba(216,180,254,0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN TAB SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(245,158,11,0.2);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.admin-tab-btn {
  padding: 0.7rem 1.4rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.admin-tab-btn:hover {
  color: #fff;
  background: rgba(245,158,11,0.06);
}
.admin-tab-btn.active {
  color: #fbbf24;
  border-bottom-color: #f59e0b;
  background: rgba(245,158,11,0.08);
}
.admin-tab-panel {
  display: none;
}
.admin-tab-panel.active {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   QUICK ACTIONS GRID (dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.quick-action-card {
  background: rgba(25,10,50,0.7);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.quick-action-card:hover {
  border-color: var(--gold-500);
  background: rgba(245,158,11,0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245,158,11,0.15);
}
.quick-action-card .qa-icon { font-size: 1.8rem; }
.quick-action-card .qa-label { font-size: 0.82rem; font-weight: 700; }
@media (max-width: 768px) {
  .quick-actions-grid { grid-template-columns: repeat(2,1fr); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   STAT CARDS ROW (dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.stat-card-sm {
  background: rgba(25,10,50,0.75);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.8rem;
  text-align: center;
}
.stat-card-sm .sc-num {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-card-sm .sc-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
@media (max-width: 1200px) {
  .stat-cards-row { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 768px) {
  .stat-cards-row { grid-template-columns: repeat(2,1fr); }
}
