/* ==========================================================================
   PARSADAM ADMIN PANEL - DESIGN SYSTEM & LAYOUT
   ========================================================================== */

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

:root {
  --admin-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --admin-sidebar-bg: #121F18;
  --admin-sidebar-hover: #1D3328;
  --admin-accent: #D4AF37;
  --admin-body-bg: #F4F6F8;
  --admin-card-bg: #FFFFFF;
  --admin-text-main: #1F2937;
  --admin-text-muted: #6B7280;
  --admin-border: #E5E7EB;
  
  --status-pending: #F59E0B;
  --status-processing: #3B82F6;
  --status-shipped: #8B5CF6;
  --status-delivered: #10B981;
  --status-cancelled: #EF4444;

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  --radius-admin: 10px;
}

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

body.admin-body {
  font-family: var(--admin-font);
  background-color: var(--admin-body-bg);
  color: var(--admin-text-main);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar-bg);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.admin-sidebar-brand {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-brand img {
  height: 48px;
  width: auto;
  border-radius: 6px;
}

.brand-text h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.03em;
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--admin-accent);
  text-transform: uppercase;
  font-weight: 700;
}

.admin-nav {
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}

.nav-category-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #9CA3AF;
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
  letter-spacing: 0.08em;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: #D1D5DB;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.admin-nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.admin-nav-item:hover {
  background-color: var(--admin-sidebar-hover);
  color: #FFFFFF;
}

.admin-nav-item.active {
  background: linear-gradient(90deg, #1E3A2B 0%, #2A513C 100%);
  color: var(--admin-accent);
  border-left: 3px solid var(--admin-accent);
}

.admin-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Content */
.admin-main {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  height: 65px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.admin-page-content {
  padding: 2rem;
  flex-grow: 1;
}

/* KPI Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #FFFFFF;
  border-radius: var(--radius-admin);
  padding: 1.5rem;
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info span {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  font-weight: 600;
}

.stat-info h3 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--admin-text-main);
  margin-top: 0.25rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-green { background: #DEF7EC; color: #03543F; }
.icon-gold { background: #FEF3C7; color: #92400E; }
.icon-blue { background: #E1EFFE; color: #1E429F; }
.icon-purple { background: #EDEBFE; color: #5521B5; }

/* Admin Table Cards */
.admin-card {
  background: #FFFFFF;
  border-radius: var(--radius-admin);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
  overflow: hidden;
}

.admin-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.admin-table th {
  background-color: #F9FAFB;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background-color: #FBFDFB;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.pending { background: #FEF3C7; color: #92400E; }
.status-pill.processing { background: #DBEAFE; color: #1E40AF; }
.status-pill.shipped { background: #EDE9FE; color: #5B21B6; }
.status-pill.delivered { background: #D1FAE5; color: #065F46; }
.status-pill.cancelled { background: #FEE2E2; color: #991B1B; }
.status-pill.active { background: #D1FAE5; color: #065F46; }
.status-pill.inactive { background: #F3F4F6; color: #4B5563; }
.status-pill.blocked { background: #FEE2E2; color: #991B1B; }

/* Buttons & Inputs */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-admin-primary {
  background: #1E382B;
  color: #FFFFFF;
}

.btn-admin-primary:hover {
  background: #2D5240;
}

.btn-admin-gold {
  background: var(--admin-accent);
  color: #121F18;
}

.btn-admin-outline {
  border-color: var(--admin-border);
  background: #FFFFFF;
  color: var(--admin-text-main);
}

.btn-admin-outline:hover {
  background: #F3F4F6;
}

.btn-admin-danger {
  background: #EF4444;
  color: #FFFFFF;
}

.btn-admin-danger:hover {
  background: #DC2626;
}

.btn-admin-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--admin-text-main);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--admin-text-main);
  background-color: #FFFFFF;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #1E382B;
  box-shadow: 0 0 0 3px rgba(30, 56, 43, 0.1);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Alert Boxes */
.admin-alert {
  padding: 0.85rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.admin-alert-success {
  background-color: #DEF7EC;
  color: #03543F;
  border-left: 4px solid #10B981;
}

.admin-alert-error {
  background-color: #FDE8E8;
  color: #9B1C1C;
  border-left: 4px solid #EF4444;
}

/* Mobile Sidebar Overlay */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.admin-sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: 100;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
    width: 100%;
  }
  .admin-topbar {
    padding: 0.85rem 1rem;
    height: auto;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .admin-page-content {
    padding: 1.25rem 1rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .admin-grid-2 {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .admin-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }
  .admin-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .admin-topbar {
    justify-content: space-between;
  }
  .btn-admin {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
}
