/* ==========================================================================
   لوحة تحكم إدارة متجر أهلا كل الناس – أحمد رمضان
   Admin Dashboard Stylesheet (Luxury Dark & Gold)
   ========================================================================== */

:root {
  --adm-bg: #050811;
  --adm-surface: #0a1020;
  --adm-sidebar: #080d1a;
  --adm-card: rgba(13, 21, 40, 0.85);
  --adm-card-hover: rgba(20, 32, 60, 0.95);
  --adm-gold: #d4af37;
  --adm-gold-light: #fbbf24;
  --adm-blue: #0284c7;
  --adm-blue-neon: #38bdf8;
  --adm-border: rgba(56, 189, 248, 0.12);
  --adm-border-gold: rgba(212, 175, 55, 0.25);
  --adm-text: #f8fafc;
  --adm-text-sec: #94a3b8;
  --adm-text-muted: #64748b;
  --adm-radius: 14px;
}

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

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--adm-bg);
  color: var(--adm-text);
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
}

/* Login Page Layout */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, rgba(2, 132, 199, 0.15) 0%, rgba(5, 8, 17, 1) 75%);
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border-gold);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.15);
  text-align: center;
}
.login-logo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--adm-gold-light);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
  margin: 0 auto 1.25rem;
  object-fit: cover;
}
.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: #fff;
}
.login-sub {
  color: var(--adm-text-sec);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Dashboard App Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 270px;
  background: var(--adm-sidebar);
  border-left: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 100;
}
.sidebar-brand {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--adm-border);
}
.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--adm-gold);
}
.sidebar-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.sidebar-brand-sub {
  font-size: 0.72rem;
  color: var(--adm-blue-neon);
  display: block;
}
.sidebar-menu {
  list-style: none;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  color: var(--adm-text-sec);
  border-radius: var(--adm-radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: right;
  transition: all 0.2s ease;
}
.nav-item-btn i {
  font-size: 1.2rem;
  color: var(--adm-text-muted);
  transition: color 0.2s ease;
}
.nav-item-btn:hover {
  background: rgba(56, 189, 248, 0.08);
  color: #fff;
}
.nav-item-btn:hover i {
  color: var(--adm-blue-neon);
}
.nav-item-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(212, 175, 55, 0.08) 100%);
  color: var(--adm-gold-light);
  border: 1px solid var(--adm-border-gold);
  font-weight: 800;
}
.nav-item-btn.active i {
  color: var(--adm-gold-light);
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  margin-right: 270px;
  padding: 1.75rem 2.25rem;
  min-height: 100vh;
}

/* Header Top */
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--adm-border);
}
.topbar-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
}
.topbar-title p {
  color: var(--adm-text-sec);
  font-size: 0.9rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Stat Cards Grid */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--adm-border-gold);
}
.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.stat-icon.gold { background: rgba(245, 158, 11, 0.15); color: var(--adm-gold-light); }
.stat-icon.blue { background: rgba(2, 132, 199, 0.15); color: var(--adm-blue-neon); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.stat-info .stat-val {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
}
.stat-info .stat-lbl {
  font-size: 0.85rem;
  color: var(--adm-text-sec);
  margin-top: 0.25rem;
}

/* Content Sections */
.tab-section {
  display: none;
}
.tab-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Container */
.data-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 2rem;
}
.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

/* Toolbar & Filters */
.toolbar-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.25rem;
}
.admin-search {
  flex: 1;
  min-width: 240px;
  background: rgba(5, 8, 17, 0.8);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}
.admin-search:focus {
  outline: none;
  border-color: var(--adm-blue-neon);
}
.admin-select {
  background: rgba(5, 8, 17, 0.8);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.92rem;
}
.admin-table th {
  padding: 0.9rem 1rem;
  background: rgba(5, 8, 17, 0.6);
  color: var(--adm-text-sec);
  font-weight: 700;
  border-bottom: 1px solid var(--adm-border);
}
.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
.admin-table tr:hover td {
  background: rgba(56, 189, 248, 0.03);
}

.table-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(5, 8, 17, 0.7);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--adm-border);
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-new { background: rgba(56, 189, 248, 0.15); color: var(--adm-blue-neon); border: 1px solid var(--adm-blue-neon); }
.status-prep { background: rgba(245, 158, 11, 0.15); color: var(--adm-gold-light); border: 1px solid var(--adm-gold-light); }
.status-shipped { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid #c084fc; }
.status-delivered { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid #34d399; }
.status-cancelled { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid #f87171; }

/* Switch Toggle */
.stock-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.stock-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: 0.3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #10b981;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Action Buttons */
.action-btns {
  display: flex;
  gap: 0.4rem;
}
.btn-act {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--adm-border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--adm-text-sec);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
}
.btn-act:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--adm-blue-neon);
}
.btn-act.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: #ef4444;
}

/* Modals */
.adm-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.adm-modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}
.adm-modal-box {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border-gold);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

/* Form Controls */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.adm-form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.adm-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--adm-text-sec);
}
.adm-input, .adm-textarea, .adm-select {
  width: 100%;
  background: rgba(5, 8, 17, 0.8);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
}
.adm-input:focus, .adm-textarea:focus, .adm-select:focus {
  outline: none;
  border-color: var(--adm-gold-light);
}

/* Buttons */
.btn-adm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-adm-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #0b111e;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}
.btn-adm-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(245, 158, 11, 0.5);
}
.btn-adm-outline {
  background: transparent;
  border: 1px solid var(--adm-border);
  color: var(--adm-text);
}
.btn-adm-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    width: 70px;
  }
  .sidebar-brand-title, .sidebar-brand-sub, .nav-item-btn span, .sidebar-footer {
    display: none;
  }
  .admin-main {
    margin-right: 70px;
    padding: 1.25rem;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}
