/* ==========================================================================
   ADMIN PANEL DASHBOARD STYLES - PIXEL PERFECT REPLICA (INPUT_FILE_0.PNG)
   ========================================================================== */

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

:root {
  --admin-bg: #F8FAFC;
  --admin-sidebar-bg: #0F172A;
  --admin-sidebar-text: #94A3B8;
  --admin-sidebar-active: #B45309;
  --admin-card-bg: #FFFFFF;
  --admin-border: #E2E8F0;
  --admin-text-main: #0F172A;
  --admin-text-muted: #64748B;
  
  --gold-primary: #D4AF37;
  --gold-light: #F59E0B;
  --emerald-primary: #10B981;
}

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

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   1. AUTHENTICATION OVERLAY
   -------------------------------------------------------------------------- */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #1E293B 0%, #0F172A 80%);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-login-card {
  background: #0F172A;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

.admin-login-logo {
  height: 80px;
  margin: 0 auto 1.5rem auto;
  filter: drop-shadow(0 0 15px rgba(212,175,55,0.4));
}

/* --------------------------------------------------------------------------
   2. MAIN ADMIN LAYOUT (260px SIDEBAR + FLEX CONTENT)
   -------------------------------------------------------------------------- */
.admin-wrapper {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

/* Sidebar Styles */
.admin-sidebar {
  background: var(--admin-sidebar-bg);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  border-right: 1px solid #1E293B;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.5rem 0.75rem 1.5rem 0.75rem;
}

.admin-sidebar-brand img {
  height: 38px;
  width: auto;
}

.admin-brand-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #FFFFFF;
  line-height: 1.2;
}

.admin-brand-sub {
  color: #94A3B8;
  font-size: 0.75rem;
  font-weight: 600;
}

.sidebar-nav-group {
  margin-bottom: 1.5rem;
}

.sidebar-section-label {
  color: #64748B;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.75rem 0.75rem 0.5rem 0.75rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: #94A3B8;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
}

.admin-nav-item:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.admin-nav-item.active {
  background: linear-gradient(135deg, #B45309 0%, #78350F 100%);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3);
}

.nav-item-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-badge-count {
  background: #1E293B;
  color: #F8FAFC;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Sidebar Bottom Support Card */
.sidebar-support-card {
  margin-top: auto;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
}

.support-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem auto;
  color: #FFF;
  font-size: 1.2rem;
}

.btn-contact-support {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #FFF;
  font-size: 0.825rem;
  font-weight: 600;
  margin-top: 0.75rem;
  transition: background 0.2s;
}

.btn-contact-support:hover {
  background: rgba(255,255,255,0.2);
}

/* --------------------------------------------------------------------------
   3. TOPBAR HEADER
   -------------------------------------------------------------------------- */
.admin-header-bar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--admin-border);
  height: 70px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-search-box {
  position: relative;
  width: 380px;
}

.header-search-box input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: #F8FAFC;
  font-size: 0.9rem;
  color: var(--admin-text-main);
}

.header-search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
}

.header-right-tools {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.btn-view-website {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background: #FFFFFF;
  color: #334155;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-view-website:hover {
  background: #F1F5F9;
}

.notification-bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
}

.notif-badge-pill {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #EF4444;
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0F172A;
  color: #F59E0B;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   4. DASHBOARD CONTENT & METRICS GRID
   -------------------------------------------------------------------------- */
.admin-main-view {
  padding: 2rem;
}

.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.welcome-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--admin-text-main);
}

.date-picker-select {
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: #FFFFFF;
  color: #334155;
  font-weight: 600;
  font-size: 0.875rem;
}

/* 4 Metric Cards Grid */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card-white {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.metric-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-icon-bubble {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.bubble-blue { background: #EFF6FF; color: #2563EB; }
.bubble-green { background: #ECFDF5; color: #059669; }
.bubble-purple { background: #F3E8FF; color: #7C3AED; }
.bubble-orange { background: #FFF7ED; color: #EA580C; }

.metric-number-val {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--admin-text-main);
  line-height: 1;
}

.metric-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #059669;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   5. CHARTS & SIDE COLUMN DASHBOARD LAYOUT
   -------------------------------------------------------------------------- */
.dashboard-grid-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

.charts-row-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.white-chart-card {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.chart-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Donut Chart Legend */
.donut-legend-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: #475569;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

/* --------------------------------------------------------------------------
   6. RIGHT SIDEBAR WIDGETS (ACTIVITY & BEST SELLERS)
   -------------------------------------------------------------------------- */
.activity-item {
  display: flex;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.activity-icon-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.best-seller-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.b-rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FEF3C7;
  color: #D97706;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   7. RECENT ORDERS TABLE
   -------------------------------------------------------------------------- */
.white-table-card {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.dashboard-table th {
  color: #64748B;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--admin-border);
}

.dashboard-table td {
  padding: 1rem;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
}

.status-pill-light {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-processing-light { background: #FEF3C7; color: #D97706; }
.status-shipped-light { background: #D1FAE5; color: #059669; }
.status-delivered-light { background: #DCFCE7; color: #166534; }

/* Dynamic Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-container {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 650px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  position: relative;
}

/* ==========================================================================
   ADMIN LIGHT THEME OVERRIDES ([data-theme="light"])
   ========================================================================== */
[data-theme="light"] .admin-sidebar {
  background: #FFFFFF;
  border-right-color: #E2E8F0;
}

[data-theme="light"] .admin-brand-title {
  color: #0F172A;
}

[data-theme="light"] .admin-nav-item {
  color: #475569;
}

[data-theme="light"] .admin-nav-item:hover {
  color: #0F172A;
  background: #F1F5F9;
}

[data-theme="light"] .admin-header-bar {
  background: #FFFFFF;
  border-bottom-color: #E2E8F0;
}

[data-theme="light"] .header-search-box input {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}

/* Responsive Mobile & Tablet Rules for Admin Panel */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 992px) {
  .admin-wrapper {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid-layout {
    grid-template-columns: 1fr;
  }

  .charts-row-container {
    grid-template-columns: 1fr;
  }

  .admin-header-bar {
    padding: 0 1rem;
    flex-wrap: wrap;
    height: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
    gap: 1rem;
  }

  .header-search-box {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .metrics-row {
    grid-template-columns: 1fr;
  }

  .admin-main-view {
    padding: 1rem;
  }

  .welcome-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

