/* ============================================================
   VedPurohit Store - Admin Panel Stylesheet
   ============================================================ */

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-body {
  background: #F5F5F5;
  min-height: 100vh;
  font-family: var(--font-mr);
}

.admin-wrap { display: flex; min-height: 100vh; }

/* ── Admin Sidebar ────────────────────────────────────────── */
.admin-sidebar {
  width: 240px;
  background: linear-gradient(180deg, var(--maroon) 0%, #3A000A 100%);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(212,160,23,0.3);
  text-align: center;
}

.sidebar-logo-icon { font-size: 32px; margin-bottom: 6px; }
.sidebar-logo-name { color: var(--gold-light); font-family: var(--font-display); font-size: 18px; }
.sidebar-logo-sub  { color: rgba(255,255,255,0.5); font-size: 11px; }

.sidebar-nav { padding: 12px 0; }
.sidebar-section-title {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(212,160,23,0.15);
  color: var(--white);
  border-left-color: var(--gold);
}

.sidebar-link.active {
  background: rgba(212,160,23,0.2);
  color: var(--gold-light);
  border-left-color: var(--gold-light);
  font-weight: 700;
}

.sidebar-link-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
  position: sticky;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  padding: 12px 16px;
  border-top: 1px solid rgba(212,160,23,0.2);
}

/* ── Sidebar overlay (mobile) ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
}
.sidebar-overlay.visible { display: block; }

/* ── Admin Main ───────────────────────────────────────────── */
.admin-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid #E0E0E0;
  padding: 14px 24px;
  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.06);
}

.topbar-title { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-admin-name { font-size: 13px; color: var(--text-mid); }

.admin-content { padding: 24px; flex: 1; }

/* ── Stats Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid #E0E0E0;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon { font-size: 36px; width: 56px; height: 56px; background: linear-gradient(135deg,#FFF3E0,#FFF8F0); border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--maroon); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-mid); margin-top: 4px; }

/* ── Admin Card + Table ───────────────────────────────────── */
.admin-card {
  background: var(--white);
  border: 1px solid #E0E0E0;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #F0F0F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-card-title { font-size: 16px; font-weight: 700; color: var(--text-dark); }

/* Table scroll wrapper — always present, scrolls on mobile */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: #F8F8F8;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-mid);
  border-bottom: 1px solid #E0E0E0;
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #F5F5F5;
  font-size: 14px;
  color: var(--text-dark);
  vertical-align: middle;
}
.admin-table tr:hover td { background: #FAFAFA; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table img.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid #E0E0E0; }

/* ── Admin Buttons ────────────────────────────────────────── */
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
  font-family: var(--font-mr);
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}
.btn-sm-primary { background: var(--saffron); color: var(--white); }
.btn-sm-primary:hover { background: var(--saffron-dark); }
.btn-sm-edit { background: #E3F2FD; color: #1565C0; }
.btn-sm-edit:hover { background: #BBDEFB; }
.btn-sm-delete { background: #FFEBEE; color: #C62828; }
.btn-sm-delete:hover { background: #FFCDD2; }
.btn-sm-success { background: #E8F5E9; color: #2E7D32; }
.btn-sm-gold { background: var(--gold); color: var(--white); }

/* ── Admin Forms ──────────────────────────────────────────── */
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group-full { grid-column: 1 / -1; }
.admin-form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }
.admin-form-input, .admin-form-select, .admin-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #D0D0D0;
  border-radius: var(--radius-sm);
  font-family: var(--font-mr);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  background: var(--white);
  color: var(--text-dark);
}
.admin-form-input:focus, .admin-form-select:focus, .admin-form-textarea:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(255,107,43,0.1);
}
.admin-form-textarea { resize: vertical; min-height: 100px; }

/* ── Badges / Chips ───────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}
.chip-green  { background: #E8F5E9; color: #2E7D32; }
.chip-red    { background: #FFEBEE; color: #C62828; }
.chip-orange { background: #FFF3E0; color: #E65100; }
.chip-blue   { background: #E3F2FD; color: #1565C0; }
.chip-gold   { background: #FFF8E1; color: #F57F17; }

/* ── Order Status ─────────────────────────────────────────── */
.status-pending    { background:#FFF8E1; color:#F57F17; }
.status-confirmed  { background:#E3F2FD; color:#1565C0; }
.status-processing { background:#F3E5F5; color:#7B1FA2; }
.status-shipped    { background:#E8F5E9; color:#2E7D32; }
.status-delivered  { background:#E8F5E9; color:#1B5E20; }
.status-cancelled  { background:#FFEBEE; color:#C62828; }

/* ── Mobile Sidebar Toggle ────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: var(--maroon);
  color: var(--white);
  border: none;
  padding: 8px 12px;
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Sidebar slide-in */
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: 200;
    height: 100vh;
  }
  .admin-sidebar.open { transform: translateX(0); }

  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }

  /* Topbar */
  .admin-topbar { padding: 10px 12px; }
  .topbar-title { font-size: 15px; }
  .topbar-admin-name { display: none; }

  /* Content */
  .admin-content { padding: 10px; }

  /* Forms single column */
  .admin-form-grid { grid-template-columns: 1fr; }

  /* Stats 2 col */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .stat-card { padding: 12px 8px; gap: 8px; }
  .stat-icon { width: 38px; height: 38px; font-size: 20px; border-radius: 10px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }

  /* Card */
  .admin-card { overflow: visible; border-radius: 10px; }
  .admin-card-header { padding: 12px 12px; }
  .admin-card-title { font-size: 14px; }

  /* TABLE — horizontal scroll with visible gold scrollbar */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #C8960C #F0F0F0;
    border-top: 1px solid #F0F0F0;
  }
  .table-wrap::-webkit-scrollbar { height: 8px; }
  .table-wrap::-webkit-scrollbar-track { background: #F5F5F5; }
  .table-wrap::-webkit-scrollbar-thumb { background: #C8960C; border-radius: 4px; }

  .admin-table { min-width: 580px; }
  .admin-table th { padding: 9px 10px; font-size: 11px; }
  .admin-table td { padding: 9px 10px; font-size: 12.5px; }
  .admin-table img.thumb { width: 36px; height: 36px; }

  /* Buttons in table */
  .admin-table td .btn-sm { padding: 5px 10px; font-size: 12px; }

  /* Tabs */
  .tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
}
