/* -------------------------------------------------------------
   Organic Oils Store - Admin Dashboard Stylesheet
   ------------------------------------------------------------- */

:root {
  --admin-sidebar-w: 260px;
  --admin-primary: var(--primary-color, #c27803);
  --admin-secondary: var(--secondary-color, #78350f);
  --admin-gradient: var(--theme-gradient, linear-gradient(135deg, #d97706 0%, #78350f 100%));
  --admin-bg: #f8fafc;
  --admin-card: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-muted: #64748b;
  --admin-radius: 12px;
}

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--admin-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand h2 {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-brand span {
  font-size: 0.75rem;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.menu-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  padding: 12px 12px 6px;
  font-weight: 700;
}

.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-item a i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-item a:hover {
  background: #1e293b;
  color: #ffffff;
}

.sidebar-item.active a {
  background: var(--admin-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
}

.user-info h5 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
}

.user-info p {
  font-size: 0.75rem;
  color: #64748b;
}

.btn-sidebar-view {
  background: #1e293b;
  color: #e2e8f0;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-sidebar-view:hover {
  background: #334155;
  color: #ffffff;
}

/* Main Content Area */
.admin-main {
  margin-left: var(--admin-sidebar-w);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.topbar-title h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--admin-text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-logout {
  background: #fee2e2;
  color: #b91c1c;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #fca5a5;
  color: #7f1d1d;
}

.admin-container {
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  box-sizing: border-box;
}

/* Alert Banners */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Metric / Analytics Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  transition: transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

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

.icon-views { background: #eff6ff; color: #2563eb; }
.icon-whatsapp { background: #ecfdf5; color: #059669; }
.icon-call { background: #fef3c7; color: #d97706; }
.icon-products { background: #f3e8ff; color: #7c3aed; }

.metric-content h4 {
  font-size: 0.85rem;
  color: var(--admin-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.metric-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1;
}

/* Charts & Activity Tables */
.card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

.card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--admin-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-text);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.thumb-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #0369a1; }

.table-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
}

.btn-edit { background: #e0e7ff; color: #3730a3; }
.btn-edit:hover { background: #c7d2fe; }
.btn-delete { background: #fee2e2; color: #991b1b; }
.btn-delete:hover { background: #fca5a5; }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(194, 120, 3, 0.15);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* Image Upload Slots (Up to 3) */
.image-upload-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.upload-slot-card {
  border: 2px dashed var(--admin-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  position: relative;
  background: #f8fafc;
  transition: all 0.2s;
}

.upload-slot-card:hover {
  border-color: var(--admin-primary);
  background: #ffffff;
}

.slot-preview {
  width: 100%;
  height: 130px;
  border-radius: 6px;
  object-fit: cover;
  margin-bottom: 10px;
  background: #edf2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0aec0;
  font-size: 2rem;
}

.slot-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* Theme Gradients Grid */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.theme-card {
  border: 2px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.theme-card.active {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(194, 120, 3, 0.2);
  background: #fffbf5;
}

.theme-gradient-bar {
  height: 50px;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.theme-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--admin-text);
}

.theme-color-tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.color-tag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.active-check {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--admin-primary);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .image-upload-slots {
    grid-template-columns: 1fr;
  }
}
