/* ============================================
   ABUXAY.UZ - Admin Panel Styles
   ============================================ */

/* ============ ADMIN LOGIN ============ */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.03) 0%, transparent 60%),
              var(--bg-darkest);
}

.admin-login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: fadeInScale 0.5s ease;
}

.admin-login-card h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.admin-login-card p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-8);
}

.admin-login-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--gold-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-8);
}

/* ============ ADMIN LAYOUT ============ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-dark);
  border-right: 1px solid var(--border-subtle);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  transition: transform var(--transition-base);
}

.admin-sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-sidebar-header svg {
  width: 32px;
  height: 32px;
  color: var(--gold-primary);
}

.admin-sidebar-header h3 {
  font-size: var(--text-base);
  font-weight: 700;
}

.admin-sidebar-header span {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 400;
}


.admin-sidebar-nav::-webkit-scrollbar {
  display: none;
}
.admin-sidebar-nav {
  -ms-overflow-style: none;
  scrollbar-width: none;

  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-4) 80px var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-primary);
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.admin-nav-link.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--gold-primary);
}

.admin-nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.admin-nav-link .badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  background: var(--gold-primary);
  color: var(--bg-darkest);
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.admin-sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.admin-logout-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--error);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-primary);
}

.admin-logout-btn:hover {
  background: rgba(231, 76, 60, 0.1);
}

.admin-logout-btn svg {
  width: 20px;
  height: 20px;
}

/* Admin Main Content */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-darkest);
}

.admin-topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.admin-topbar h2 {
  font-size: var(--text-lg);
  font-weight: 600;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-content {
  padding: var(--space-8);
}

/* Mobile Admin Sidebar Toggle */
.admin-sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-md);
}

.admin-sidebar-toggle svg {
  width: 24px;
  height: 24px;
}

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: calc(var(--z-sticky) - 1);
}

@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-sidebar-overlay.show {
    display: block;
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-sidebar-toggle {
    display: flex;
  }
  .admin-content {
    padding: var(--space-4);
  }
}

/* ============ ADMIN DASHBOARD ============ */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.admin-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: var(--space-6);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: all var(--transition-slow);
}

.admin-stat-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-3px);
}

.admin-stat-card:active {
  transform: translateY(0) scale(0.98);
}

.admin-stat-info h4 {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.admin-stat-info .stat-number {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.admin-stat-info .stat-change {
  font-size: var(--text-xs);
  color: var(--success);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.admin-stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  border-radius: var(--radius-md);
  color: var(--gold-primary);
  flex-shrink: 0;
}

.admin-stat-icon svg {
  width: 24px;
  height: 24px;
}

/* ============ ADMIN TABLES ============ */
.admin-table-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.admin-table-header h3 {
  font-size: var(--text-base);
  font-weight: 600;
}

.admin-table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-table-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.admin-table-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  width: 180px;
}

.admin-table-search input::placeholder {
  color: var(--text-muted);
}

.admin-table-search svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.admin-table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  white-space: nowrap;
}

.admin-table td {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table-product {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-table-product img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.admin-table-product-info h4 {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.admin-table-product-info span {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.admin-table-actions-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.admin-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-action-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: rgba(37, 99, 235, 0.05);
}

.admin-action-btn.delete:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(231, 76, 60, 0.05);
}

.admin-action-btn svg {
  width: 16px;
  height: 16px;
}

.admin-table-empty {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ============ ADMIN FORMS/MODAL ============ */
.admin-modal .modal {
  max-width: 560px;
}

.admin-modal-body {
  padding: var(--space-6);
}

.admin-modal-body h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.admin-form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

/* Image Upload */
.admin-img-upload {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-surface);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.admin-img-upload:hover {
  border-color: var(--gold-primary);
  background: rgba(37, 99, 235, 0.03);
}

.admin-img-upload svg {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
}

.admin-img-upload span {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.admin-img-upload img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-img-upload input[type="file"] {
  display: none;
}

@media (max-width: 640px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ ADMIN ORDER DETAILS ============ */
.admin-order-detail {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}

.admin-order-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.admin-order-customer h4 {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.admin-order-customer p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.admin-order-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-order-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.admin-order-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.admin-order-item-info {
  flex: 1;
}

.admin-order-item-info h5 {
  font-size: var(--text-sm);
  font-weight: 500;
}

.admin-order-item-info span {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.admin-order-item-price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gold-primary);
  white-space: nowrap;
}

/* ============ RECENT ORDERS (Dashboard) ============ */
.admin-recent-section {
  margin-top: var(--space-8);
}

.admin-recent-section h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

/* ============ NOTIFICATION BELL ============ */
.admin-notification-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-notification-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.admin-notification-btn svg {
  width: 20px;
  height: 20px;
}

.admin-notification-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: var(--radius-full);
  animation: goldPulse 2s infinite;
}

/* ============ VIEW STORE LINK ============ */
.admin-view-store {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: none;
  text-decoration: none;
  font-family: var(--font-primary);
}

.admin-view-store:hover {
  color: var(--gold-primary);
  border-color: var(--border-gold);
}

.admin-view-store svg {
  width: 14px;
  height: 14px;
}

/* ============ ADMIN THEME TOGGLE ============ */
.admin-theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-theme-toggle:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: rgba(37, 99, 235, 0.05);
}

.admin-theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* ============ BANNER MANAGEMENT ============ */
.admin-banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-5);
}

.admin-banner-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-slow);
}

.admin-banner-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.admin-banner-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.admin-banner-card-body {
  padding: var(--space-4);
}

.admin-banner-card-body h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.admin-banner-card-body .meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.admin-banner-card-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
}
