/* ============================================================
   Minaglow Admin - Styles
   ============================================================ */

:root {
  --pink:       #EC4899;
  --pink-light: #FDF2F8;
  --pink-pale:  #FCE7F3;
  --sidebar-w:  240px;
  --font:       'Poppins', system-ui, sans-serif;
  --serif:      'Playfair Display', Georgia, serif;
  --radius:     12px;
  --shadow:     0 4px 16px rgba(0,0,0,0.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  background: #F8F9FB;
  color: #1F1F2E;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ============================================================
   LAYOUT ADMIN
   ============================================================ */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  width: var(--sidebar-w);
  background: #1F1F2E;
  color: rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .logo {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--pink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand p { font-size: 0.72rem; color: rgba(255,255,255,0.4); margin-top: 4px; }

.sidebar-menu { padding: 16px 0; flex: 1; }
.sidebar-section {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3);
  padding: 14px 20px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}
.sidebar-link.active {
  background: rgba(236,72,153,0.12);
  color: var(--pink);
  border-left-color: var(--pink);
}
.sidebar-link .icon { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.sidebar-footer a:hover { color: #EF4444; }

/* ---- Main area ---- */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top bar ---- */
.admin-topbar {
  background: white;
  border-bottom: 1px solid #F3F4F6;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.topbar-title h2 { font-size: 1.05rem; font-weight: 600; }
.topbar-title p  { font-size: 0.78rem; color: #9CA3AF; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EC4899, #F472B6);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ---- Content ---- */
.admin-content { padding: 28px; flex: 1; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-card.pink   { border-left-color: #EC4899; }
.stat-card.purple { border-left-color: #8B5CF6; }
.stat-card.green  { border-left-color: #10B981; }
.stat-card.orange { border-left-color: #F59E0B; }

.stat-info h3 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: #1F1F2E;
  line-height: 1;
}
.stat-info p { font-size: 0.82rem; color: #9CA3AF; margin-top: 4px; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.stat-card.pink   .stat-icon { background: #FDF2F8; }
.stat-card.purple .stat-icon { background: #F5F3FF; }
.stat-card.green  .stat-icon { background: #D1FAE5; }
.stat-card.orange .stat-icon { background: #FEF3C7; }

/* ============================================================
   TABLES
   ============================================================ */
.admin-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.admin-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-header h3 { font-size: 0.95rem; font-weight: 600; }
.admin-card-body { padding: 0; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9CA3AF;
  padding: 12px 16px;
  background: #FAFAFA;
  text-align: left;
  border-bottom: 1px solid #F3F4F6;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F9FAFB;
  font-size: 0.88rem;
  color: #374151;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFAFA; }

.product-thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--pink-light);
}
.product-thumb-placeholder {
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--pink-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

/* ============================================================
   BUTTONS (admin)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: #EC4899; color: white; }
.btn-primary:hover { background: #BE185D; }
.btn-secondary { background: #F3F4F6; color: #374151; }
.btn-secondary:hover { background: #E5E7EB; }
.btn-edit { background: #EEF2FF; color: #4338CA; }
.btn-edit:hover { background: #E0E7FF; }
.btn-danger { background: #FEE2E2; color: #DC2626; }
.btn-danger:hover { background: #FECACA; }
.btn-success { background: #D1FAE5; color: #059669; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.92rem; }

/* ============================================================
   FORMS (admin)
   ============================================================ */
.form-grid { display: grid; gap: 20px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.83rem; font-weight: 500; color: #374151; }
.form-control {
  padding: 10px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.88rem;
  color: #1F1F2E;
  background: white;
  outline: none;
  transition: all 0.2s ease;
}
.form-control:focus { border-color: #EC4899; box-shadow: 0 0 0 3px rgba(236,72,153,0.1); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; cursor: pointer; }

.form-hint { font-size: 0.76rem; color: #9CA3AF; }

/* Required star */
.required::after { content: ' *'; color: #EF4444; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.alert-success { background: #D1FAE5; color: #065F46; border-left: 4px solid #10B981; }
.alert-error   { background: #FEE2E2; color: #991B1B; border-left: 4px solid #EF4444; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-pending   { background: #FEF3C7; color: #92400E; }
.badge-confirmed { background: #DBEAFE; color: #1E40AF; }
.badge-shipped   { background: #E0E7FF; color: #4338CA; }
.badge-delivered { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }
.badge-active    { background: #D1FAE5; color: #065F46; }
.badge-inactive  { background: #F3F4F6; color: #6B7280; }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-muted { color: #9CA3AF; }
.text-pink  { color: #EC4899; }
.fw-600     { font-weight: 600; }
.flex       { display: flex; }
.items-center { align-items: center; }
.gap-sm     { gap: 8px; }
.gap-md     { gap: 16px; }
.actions    { display: flex; gap: 8px; align-items: center; }
.page-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }

/* Pagination */
.pagination { display: flex; gap: 8px; align-items: center; padding: 16px 24px; border-top: 1px solid #F3F4F6; }
.page-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #374151;
  background: #F3F4F6;
  transition: all 0.2s;
}
.page-link:hover, .page-link.active { background: #EC4899; color: white; }

/* Revenue bar chart */
.mini-chart { display: flex; align-items: flex-end; gap: 6px; height: 60px; padding: 8px 0; }
.chart-bar {
  flex: 1;
  background: linear-gradient(to top, #EC4899, #F9A8C9);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: all 0.3s ease;
  position: relative;
}
.chart-bar:hover { opacity: 0.8; }

/* Image upload preview */
#imagePreview { display: none; margin-top: 10px; max-width: 180px; border-radius: 10px; border: 2px solid #FCE7F3; }
.upload-zone {
  border: 2px dashed #F9A8C9;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover { border-color: #EC4899; background: #FDF2F8; }
