/* ============================================================
   ADMIN.CSS — Panel Admin Budi Jaya
   Tema: Clean dark sidebar + light content area
   ============================================================ */

:root {
  --admin-sidebar-w: 260px;
  --admin-sidebar-bg: #1A1F2E;
  --admin-sidebar-border: rgba(255,255,255,.06);
  --admin-accent: #8B5E3C;
  --admin-accent-light: #C49A6C;
  --admin-topbar-h: 60px;
  --admin-bg: #F4F6F9;
  --admin-card-bg: #FFFFFF;
  --admin-text: #2D3748;
  --admin-muted: #718096;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body {
  font-family: 'Nunito', sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ──────────────────────────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--admin-sidebar-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--admin-sidebar-border);
}
.sidebar-brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--admin-accent), var(--admin-accent-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.2rem;
  flex-shrink: 0;
}
.sidebar-brand-name {
  font-weight: 700; font-size: 1rem;
  color: white; line-height: 1.1;
}
.sidebar-brand-sub {
  font-size: .68rem; color: rgba(255,255,255,.4);
  letter-spacing: .08em; text-transform: uppercase;
}

.sidebar-nav { padding: 1rem 0; flex: 1; }

.nav-section-label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: .5rem 1.25rem .25rem;
}

.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.25rem;
  color: rgba(255,255,255,.65) !important;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  border-radius: 0;
  transition: all .2s;
  position: relative;
}
.sidebar-link:hover { color: white !important; background: rgba(255,255,255,.06); }
.sidebar-link.active {
  color: white !important;
  background: rgba(139,94,60,.25);
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--admin-accent-light);
  border-radius: 0 2px 2px 0;
}
.sidebar-link i { font-size: 1rem; width: 20px; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto;
  background: #e53935; color: white;
  font-size: .65rem; font-weight: 700;
  padding: .15rem .45rem; border-radius: 20px;
  min-width: 20px; text-align: center;
}

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

.admin-topbar {
  height: var(--admin-topbar-h);
  background: white;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--admin-text); display: none;
  padding: .25rem;
}
.admin-topbar-title { font-weight: 700; flex: 1; font-size: 1rem; }
.admin-avatar {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .88rem; color: var(--admin-text);
}

.admin-content {
  flex: 1;
  padding: 1.75rem;
  max-width: 1400px;
  width: 100%;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border-left: 4px solid transparent;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.stat-icon { font-size: 2rem; flex-shrink: 0; }
.stat-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--admin-muted); margin-top: .2rem; }

.stat-warning { border-left-color: #F59E0B; }
.stat-warning .stat-icon { color: #F59E0B; }
.stat-info    { border-left-color: #3B82F6; }
.stat-info    .stat-icon { color: #3B82F6; }
.stat-primary { border-left-color: #8B5E3C; }
.stat-primary .stat-icon { color: #8B5E3C; }
.stat-success { border-left-color: #10B981; }
.stat-success .stat-icon { color: #10B981; }
.stat-danger  { border-left-color: #EF4444; }
.stat-danger  .stat-icon { color: #EF4444; }
.stat-dark    { border-left-color: #374151; }
.stat-dark    .stat-icon { color: #374151; }

/* ── Admin Cards ─────────────────────────────────────────── */
.admin-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
}
.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #F1F5F9;
  background: #FAFBFC;
}
.admin-card-header h6 { color: var(--admin-text); font-weight: 700; }

/* ── Tables ──────────────────────────────────────────────── */
.admin-table thead th {
  background: #F8FAFC;
  color: var(--admin-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 2px solid #E2E8F0;
  padding: .75rem 1rem;
}
.admin-table tbody td { padding: .7rem 1rem; vertical-align: middle; }
.admin-table tbody tr:hover td { background: #F8FAFC; }

.admin-thumb {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-xs { padding: .2rem .5rem; font-size: .75rem; border-radius: 6px; }
.btn-primary-brand {
  background: var(--admin-accent);
  border-color: var(--admin-accent);
  color: white; font-weight: 600;
  border-radius: 10px;
  transition: all .2s;
}
.btn-primary-brand:hover {
  background: #6B4526;
  border-color: #6B4526;
  color: white;
}

/* ── Stok Rendah list ────────────────────────────────────── */
.stok-rendah-item {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid #F1F5F9;
}
.stok-rendah-item:last-child { border-bottom: none; }
.stok-item-nama { font-weight: 600; font-size: .88rem; }

/* ── Multi Upload ─────────────────────────────────────────── */
.multi-upload-zone {
  border: 2px dashed #CBD5E0;
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #FAFBFC;
}
.multi-upload-zone:hover, .multi-upload-zone.drag-over {
  border-color: var(--admin-accent);
  background: rgba(139,94,60,.04);
}

.foto-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.foto-preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #E2E8F0;
  background: #F8FAFC;
}
.foto-preview-item img {
  width: 100%; height: 100px; object-fit: cover;
}
.foto-preview-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55);
  color: white; font-size: .68rem; padding: .2rem .4rem;
  text-align: center;
}

/* ── Galeri Admin ─────────────────────────────────────────── */
.galeri-admin-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #F8FAFC;
}
.galeri-admin-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.galeri-admin-item:hover img { transform: scale(1.05); }
.galeri-admin-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 50%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: .75rem;
  opacity: 0;
  transition: opacity .25s;
}
.galeri-admin-item:hover .galeri-admin-overlay { opacity: 1; }
.galeri-admin-title { color: white; font-size: .82rem; font-weight: 600; }

/* ── Page Title ──────────────────────────────────────────── */
.page-title-bar { display: flex; align-items: center; gap: .75rem; }
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
}

@media (max-width: 575px) {
  .admin-content { padding: 1rem; }
}

/* ============================================================
   ADMIN PANEL — Extended styles
   Halaman: pesanan, produk, kategori, rekening, galeri
   ============================================================ */

/* ── Page Header ─────────────────────────────────────────── */
.adm-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.adm-page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--admin-text);
  margin: 0;
  line-height: 1.2;
}
.adm-page-sub { color: var(--admin-muted); font-size: .875rem; }

/* ── Tabs (status filter) ────────────────────────────────── */
.adm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  border-bottom: 2px solid #E2E8F0;
  padding-bottom: .5rem;
}
.adm-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  border-radius: 8px 8px 0 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--admin-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  transition: all .18s;
}
.adm-tab:hover { color: var(--admin-text); background: #F8FAFC; }
.adm-tab--active {
  color: var(--admin-accent);
  background: white;
  border-color: #E2E8F0;
  border-bottom-color: white;
  margin-bottom: -2px;
}
.adm-tab-badge {
  background: #E2E8F0;
  color: var(--admin-muted);
  font-size: .65rem;
  font-weight: 800;
  padding: .1rem .45rem;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}
.adm-tab-badge--urgent {
  background: #FEE2E2;
  color: #DC2626;
}

/* ── Toolbar (search + sort) ─────────────────────────────── */
.adm-toolbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  flex-wrap: wrap;
}
.adm-filter-bar { padding: .75rem 1rem; }
.adm-filter-group {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.adm-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.adm-search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-muted);
  font-size: .9rem;
  pointer-events: none;
}
.adm-search-input {
  width: 100%;
  padding: .42rem .75rem .42rem 2.1rem;
  border: 1.5px solid #E2E8F0;
  border-radius: 9px;
  font-size: .875rem;
  outline: none;
  font-family: 'Nunito', sans-serif;
  transition: border-color .18s, box-shadow .18s;
}
.adm-search-input:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(139,94,60,.1);
}
.adm-sort-sel { min-width: 130px; font-size: .82rem; border-radius: 9px !important; }

/* ── Table tweaks ────────────────────────────────────────── */
.adm-row--urgent td { background: #FFFBEB !important; }
.adm-row--inactive td { opacity: .55; }
.adm-kode-link { color: var(--admin-accent); font-weight: 700; text-decoration: none; }
.adm-kode-link:hover { text-decoration: underline; }
.adm-kat-badge {
  display: inline-block;
  background: rgba(139,94,60,.08);
  color: var(--admin-accent);
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 6px;
  border: 1px solid rgba(139,94,60,.2);
}

/* ── Info Table (key-value rows) ─────────────────────────── */
.adm-info-table { display: flex; flex-direction: column; }
.adm-info-row {
  display: flex;
  gap: 1rem;
  padding: .6rem 1.25rem;
  border-bottom: 1px solid #F1F5F9;
  font-size: .9rem;
  align-items: flex-start;
}
.adm-info-row:last-child { border-bottom: none; }
.adm-info-key {
  font-weight: 700;
  color: var(--admin-muted);
  min-width: 100px;
  flex-shrink: 0;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: .05rem;
}

/* ── Status Progress (sidebar pesanan detail) ────────────── */
.adm-status-progress { display: flex; flex-direction: column; gap: 0; }
.adm-status-batal {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #FEF2F2;
  border-radius: 10px;
}
.adm-progress-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem 0;
}
.adm-progress-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #E2E8F0;
  color: var(--admin-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .18s;
}
.adm-progress-num { font-size: .78rem; font-weight: 800; }
.adm-progress-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--admin-muted);
}
.adm-progress-row--done .adm-progress-dot   { background: #D1FAE5; color: #065F46; }
.adm-progress-row--done .adm-progress-label { color: var(--admin-text); }
.adm-progress-row--current .adm-progress-dot {
  background: var(--admin-accent);
  color: white;
  box-shadow: 0 0 0 4px rgba(139,94,60,.2);
}
.adm-progress-row--current .adm-progress-label { color: var(--admin-accent); font-weight: 700; }
.adm-progress-line {
  width: 2px;
  height: 18px;
  background: #E2E8F0;
  margin-left: 16px;
  border-radius: 2px;
  transition: background .18s;
}
.adm-progress-line--done { background: #10B981; }

/* ── Cancel warning ──────────────────────────────────────── */
.adm-cancel-warn {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 8px;
  padding: .65rem .9rem;
  font-size: .8rem;
  color: #92400E;
  font-weight: 600;
}

/* ── Bukti Transfer image ────────────────────────────────── */
.adm-bukti-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  border: 1.5px solid #E2E8F0;
  cursor: zoom-in;
  display: block;
  background: #F8FAFC;
  padding: .25rem;
}

/* ── Foto grid (produk edit) ─────────────────────────────── */
.adm-foto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.adm-foto-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #E2E8F0;
  aspect-ratio: 1;
  background: #F8FAFC;
  transition: border-color .18s;
}
.adm-foto-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.adm-foto-item:hover { border-color: var(--admin-accent); }
.adm-foto-item--utama { border-color: #F59E0B; border-width: 2.5px; }

.adm-foto-badge-utama {
  position: absolute;
  top: 4px; left: 4px;
  background: #F59E0B;
  color: white;
  font-size: .65rem;
  font-weight: 800;
  padding: .15rem .45rem;
  border-radius: 20px;
}
.adm-foto-badge {
  position: absolute;
  top: 4px; left: 4px;
  background: rgba(0,0,0,.5);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 20px;
}
.adm-foto-actions {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
  display: flex;
  justify-content: center;
  gap: .35rem;
  padding: .5rem .3rem .4rem;
  opacity: 0;
  transition: opacity .2s;
}
.adm-foto-item:hover .adm-foto-actions { opacity: 1; }

.adm-foto-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: all .15s;
}
.adm-foto-btn--star { background: #F59E0B; color: white; }
.adm-foto-btn--star:hover { background: #D97706; }
.adm-foto-btn--del  { background: #EF4444; color: white; }
.adm-foto-btn--del:hover { background: #DC2626; }

/* ── Spesifikasi rows ────────────────────────────────────── */
.adm-spec-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
}
.adm-spec-key { flex: 0 0 38%; min-width: 0; }
.adm-spec-val { flex: 1; min-width: 0; }
.adm-spec-del { flex-shrink: 0; }

/* ── Drop zone icon ──────────────────────────────────────── */
.adm-dz-icon {
  font-size: 2.2rem;
  color: var(--admin-accent);
  opacity: .65;
  display: block;
  margin-bottom: .5rem;
}

/* ── Galeri grid (admin) ─────────────────────────────────── */
.adm-galeri-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.adm-galeri-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #F1F5F9;
  border: 1.5px solid #E2E8F0;
  transition: box-shadow .18s, transform .18s;
}
.adm-galeri-item:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  transform: translateY(-2px);
}
.adm-galeri-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.adm-galeri-item:hover img { transform: scale(1.05); }

.adm-galeri-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity .22s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .75rem;
}
.adm-galeri-item:hover .adm-galeri-overlay { opacity: 1; }
.adm-galeri-title  { color: white; font-size: .82rem; font-weight: 700; line-height: 1.3; }
.adm-galeri-kat    { color: rgba(255,255,255,.65); font-size: .7rem; }
.adm-galeri-urutan { color: rgba(255,255,255,.5); font-size: .65rem; margin-top: .1rem; }
.adm-galeri-btns   { display: flex; gap: .4rem; margin-top: .4rem; }

/* ── Responsive extra ────────────────────────────────────── */
@media (max-width: 767px) {
  .adm-tabs { gap: .2rem; }
  .adm-tab  { padding: .35rem .6rem; font-size: .75rem; }
  .adm-toolbar { flex-direction: column; align-items: stretch; }
  .adm-filter-group { flex-direction: column; align-items: stretch; }
  .adm-search-wrap { min-width: unset; }
  .adm-galeri-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); }
  .adm-foto-grid   { grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); }
  .adm-page-header { flex-direction: column; align-items: flex-start; }
}