/* =====================================================================
   admin.css — Dashboard Admin
   Semua class memakai prefix "ad-" supaya aman dari bentrok global.css.
   Design system: dark premium, gradient #7C3AED → #06B6D4, glassmorphism.
   ===================================================================== */

:root {
  --ad-bg: #0A0A0F;
  --ad-bg-2: #0E0E15;
  --ad-card: #12121A;
  --ad-card-2: #171722;
  --ad-border: rgba(255, 255, 255, 0.08);
  --ad-border-strong: rgba(255, 255, 255, 0.16);
  --ad-text: #F5F5F7;
  --ad-muted: #A1A1AA;
  --ad-dim: #71717A;

  --ad-primary: #7C3AED;
  --ad-cyan: #06B6D4;
  --ad-grad: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);

  --ad-success: #10B981;
  --ad-warning: #F59E0B;
  --ad-danger: #EF4444;

  --ad-radius: 14px;
  --ad-radius-sm: 10px;
  --ad-sidebar-w: 264px;

  --ad-font-head: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --ad-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ad-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
.ad-body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ad-bg);
  color: var(--ad-text);
  font-family: var(--ad-font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Grid background subtle + glow */
  background-image:
    radial-gradient(600px 300px at 85% -5%, rgba(124, 58, 237, 0.14), transparent 70%),
    radial-gradient(500px 300px at 10% 0%, rgba(6, 182, 212, 0.08), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}
.ad-body.ad-lock { overflow: hidden; }
.ad-body *, .ad-body *::before, .ad-body *::after { box-sizing: border-box; }
.ad-body [hidden] { display: none !important; }
.ad-body a { color: inherit; text-decoration: none; }
.ad-body h1, .ad-body h2, .ad-body h3, .ad-body h4 {
  font-family: var(--ad-font-head);
  margin: 0;
  letter-spacing: -0.01em;
}
.ad-body p { margin: 0; }
.ad-body i[data-lucide], .ad-body svg.lucide { width: 18px; height: 18px; flex-shrink: 0; }

.ad-body :focus-visible {
  outline: 2px solid var(--ad-cyan);
  outline-offset: 2px;
}

/* ---------- Gate (loading verifikasi admin) ---------- */
.ad-gate {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: var(--ad-bg);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.ad-gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.ad-gate-box { text-align: center; color: var(--ad-muted); }
.ad-gate-box p { margin-top: 14px; font-size: 13px; }

.ad-spinner {
  width: 34px; height: 34px; margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--ad-cyan);
  animation: adSpin 0.8s linear infinite;
}
.ad-spinner-sm { width: 16px; height: 16px; border-width: 2px; margin: 0; }
@keyframes adSpin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.ad-app { min-height: 100vh; }

.ad-main {
  margin-left: var(--ad-sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  min-width: 0;
}
.ad-content {
  flex: 1;
  width: 100%;
  max-width: 1360px;
  padding: 32px clamp(16px, 3vw, 40px) 64px;
}

/* ---------- Sidebar ---------- */
.ad-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--ad-sidebar-w);
  z-index: 60;
  display: flex; flex-direction: column;
  background: rgba(14, 14, 21, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--ad-border);
  transition: transform 0.35s var(--ad-ease);
}
.ad-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 18px 14px;
}
.ad-sidebar-close { display: none; }

.ad-brand { display: inline-flex; align-items: center; gap: 10px; }
.ad-brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ad-grad);
  box-shadow: 0 6px 20px -4px rgba(124, 58, 237, 0.6);
  color: #fff;
}
.ad-brand-mark i, .ad-brand-mark svg { width: 18px; height: 18px; }
.ad-brand-name {
  font-family: var(--ad-font-head);
  font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
}
.ad-brand-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  color: var(--ad-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.ad-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.ad-nav-label {
  padding: 14px 10px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ad-dim);
}
.ad-nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--ad-radius-sm);
  color: var(--ad-muted);
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.ad-nav-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--ad-text); transform: translateX(2px); }
.ad-nav-link.is-active {
  color: var(--ad-text);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.22), rgba(6, 182, 212, 0.08));
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.3);
}
.ad-nav-link.is-active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--ad-grad);
}
.ad-nav-link.is-active > i:first-child { color: var(--ad-cyan); }
.ad-nav-ext { margin-left: auto; width: 14px !important; height: 14px !important; opacity: 0.5; }
.ad-nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: #1a1203; background: var(--ad-warning);
  border-radius: 999px;
}

.ad-sidebar-foot {
  padding: 14px;
  border-top: 1px solid var(--ad-border);
  display: grid; gap: 12px;
}
.ad-profile { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ad-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-weight: 700; color: #fff;
  background: var(--ad-grad);
}
.ad-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-profile-info { min-width: 0; }
.ad-profile-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-profile-email { font-size: 12px; color: var(--ad-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ad-sidebar-backdrop {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

/* ---------- Topbar (mobile) ---------- */
.ad-topbar { display: none; }

/* ---------- Page ---------- */
.ad-page { animation: adPageIn 0.45s var(--ad-ease) both; }
@keyframes adPageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.ad-page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.ad-page-title { font-size: clamp(24px, 3vw, 30px); font-weight: 800; }
.ad-page-sub { margin-top: 4px; color: var(--ad-muted); }
.ad-page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  font: 600 14px/1 var(--ad-font-body);
  color: var(--ad-text);
  border: 1px solid transparent; border-radius: var(--ad-radius-sm);
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ad-ease), box-shadow 0.25s, background 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.ad-btn:hover:not(:disabled) { transform: translateY(-1px); }
.ad-btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.ad-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ad-btn-block { width: 100%; }
.ad-btn-sm { padding: 8px 12px; font-size: 13px; }
.ad-btn-primary {
  background: var(--ad-grad); color: #fff;
  box-shadow: 0 8px 24px -8px rgba(124, 58, 237, 0.7);
}
.ad-btn-primary:hover:not(:disabled) { box-shadow: 0 10px 32px -6px rgba(6, 182, 212, 0.6); }
.ad-btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--ad-border-strong); }
.ad-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.ad-btn-danger { background: var(--ad-danger); color: #fff; box-shadow: 0 8px 22px -8px rgba(239, 68, 68, 0.7); }
.ad-btn-success { background: var(--ad-success); color: #04130d; box-shadow: 0 8px 22px -8px rgba(16, 185, 129, 0.7); }
.ad-btn-warning-outline { color: var(--ad-danger); border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.06); }
.ad-btn-warning-outline:hover:not(:disabled) { background: rgba(239, 68, 68, 0.14); }
.ad-btn.is-loading { pointer-events: none; opacity: 0.85; }

.ad-icon-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ad-muted);
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.ad-icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--ad-text); }
.ad-icon-btn.is-edit:hover { color: var(--ad-cyan); border-color: rgba(6, 182, 212, 0.35); background: rgba(6, 182, 212, 0.08); }
.ad-icon-btn.is-delete:hover { color: var(--ad-danger); border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.08); }
.ad-icon-btn.is-view:hover { color: var(--ad-primary); border-color: rgba(124, 58, 237, 0.4); background: rgba(124, 58, 237, 0.1); }

.ad-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 13px; color: var(--ad-cyan);
  transition: gap 0.2s;
}
.ad-link:hover { gap: 10px; }
.ad-link i, .ad-link svg { width: 15px !important; height: 15px !important; }

/* ---------- Card ---------- */
.ad-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)) , var(--ad-card);
  border: 1px solid var(--ad-border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}
.ad-card-flush { padding: 0; overflow: hidden; }
.ad-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.ad-card-title { font-size: 17px; font-weight: 700; }
.ad-card-sub { margin-top: 2px; font-size: 13px; color: var(--ad-muted); }
.ad-card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ad-cyan); background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ---------- Stat cards ---------- */
.ad-stats {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}
.ad-stat {
  --accent: var(--ad-primary);
  position: relative; overflow: hidden;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px;
  background: var(--ad-card);
  border: 1px solid var(--ad-border);
  border-radius: 16px;
  transition: transform 0.3s var(--ad-ease), border-color 0.3s, box-shadow 0.3s;
}
.ad-stat::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: var(--accent); opacity: 0.12; filter: blur(30px); pointer-events: none;
  transition: opacity 0.3s;
}
.ad-stat:hover { transform: translateY(-3px); border-color: var(--ad-border-strong); box-shadow: 0 16px 40px -20px var(--accent); }
.ad-stat:hover::after { opacity: 0.25; }
.ad-stat[data-accent="violet"] { --accent: #7C3AED; }
.ad-stat[data-accent="cyan"] { --accent: #06B6D4; }
.ad-stat[data-accent="green"] { --accent: #10B981; }
.ad-stat[data-accent="amber"] { --accent: #F59E0B; }
.ad-stat-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.ad-stat-body { min-width: 0; position: relative; z-index: 1; }
.ad-stat-label { font-size: 13px; color: var(--ad-muted); }
.ad-stat-value {
  margin-top: 2px; font-size: clamp(22px, 2.2vw, 28px); font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ad-stat-hint { margin-top: 2px; font-size: 12px; color: var(--ad-dim); }

/* ---------- Chart ---------- */
.ad-chart-box { position: relative; height: 300px; }
.ad-chart-box canvas { width: 100% !important; height: 100% !important; }
.ad-chart-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--ad-muted); pointer-events: none;
}

.ad-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ad-border); border-radius: 10px;
}
.ad-seg-btn {
  padding: 6px 12px; font: 600 12px var(--ad-font-body);
  color: var(--ad-muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ad-seg-btn:hover { color: var(--ad-text); }
.ad-seg-btn.is-active { color: #fff; background: var(--ad-grad); }

/* ---------- Toolbar ---------- */
.ad-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ad-border);
}
.ad-search { position: relative; flex: 1 1 260px; min-width: 200px; max-width: 420px; display: block; }
.ad-search > i, .ad-search > svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ad-dim); pointer-events: none; width: 17px; height: 17px;
}
.ad-search .ad-input { padding-left: 38px; }
.ad-toolbar-select { width: auto; min-width: 180px; }
.ad-count { margin-left: auto; font-size: 13px; color: var(--ad-muted); }

/* ---------- Form ---------- */
.ad-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.ad-full { grid-column: 1 / -1; }
.ad-field { margin-bottom: 0; min-width: 0; }
#contactForm .ad-field { margin-bottom: 16px; }
.ad-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--ad-text); }
.ad-req { color: var(--ad-danger); }
.ad-opt { margin-left: 4px; font-weight: 400; font-size: 12px; color: var(--ad-dim); }
.ad-hint { margin-top: 6px; font-size: 12px; color: var(--ad-dim); }

.ad-input, .ad-select, .ad-textarea {
  width: 100%;
  padding: 11px 14px;
  font: 400 14px var(--ad-font-body);
  color: var(--ad-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ad-border-strong);
  border-radius: var(--ad-radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.ad-textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.ad-input::placeholder, .ad-textarea::placeholder { color: var(--ad-dim); }
.ad-input:hover, .ad-select:hover, .ad-textarea:hover { border-color: rgba(255, 255, 255, 0.25); }
.ad-input:focus, .ad-select:focus, .ad-textarea:focus {
  outline: none; border-color: var(--ad-primary);
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}
.ad-input.is-invalid, .ad-select.is-invalid, .ad-textarea.is-invalid {
  border-color: var(--ad-danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.ad-select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.ad-select option { background: #12121A; color: #F5F5F7; }
.ad-form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.ad-form-error {
  margin-top: 16px; padding: 10px 14px; font-size: 13px;
  color: #fca5a5; background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3); border-radius: var(--ad-radius-sm);
}

/* Upload thumbnail */
.ad-thumb-field { display: flex; gap: 16px; align-items: flex-start; }
.ad-thumb-preview {
  width: 160px; aspect-ratio: 16 / 10; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--ad-border-strong); border-radius: 12px;
}
.ad-thumb-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-thumb-ph { color: var(--ad-dim); }
.ad-thumb-ph i, .ad-thumb-ph svg { width: 28px !important; height: 28px !important; }
.ad-thumb-controls { flex: 1; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.ad-thumb-controls .ad-input { justify-self: stretch; }
.ad-thumb-controls .ad-hint { margin-top: 0; }

/* Switch (checkbox unggulan) */
.ad-switch { display: flex; align-items: center; gap: 14px; cursor: pointer; user-select: none;
  padding: 12px 14px; border: 1px solid var(--ad-border); border-radius: var(--ad-radius-sm);
  background: rgba(255, 255, 255, 0.02); }
.ad-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ad-switch-track {
  position: relative; width: 42px; height: 24px; flex-shrink: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); transition: background 0.25s;
}
.ad-switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.25s var(--ad-ease);
}
.ad-switch input:checked + .ad-switch-track { background: var(--ad-grad); }
.ad-switch input:checked + .ad-switch-track .ad-switch-thumb { transform: translateX(18px); }
.ad-switch input:focus-visible + .ad-switch-track { outline: 2px solid var(--ad-cyan); outline-offset: 2px; }
.ad-switch-text { display: grid; gap: 1px; }
.ad-switch-text strong { font-size: 14px; }
.ad-switch-text small { font-size: 12px; color: var(--ad-dim); }

/* ---------- Table ---------- */
.ad-table-wrap { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ad-table th {
  padding: 12px 16px; text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ad-dim);
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--ad-border);
}
.ad-table td { padding: 14px 16px; vertical-align: middle; border-bottom: 1px solid var(--ad-border); }
.ad-table tbody tr { transition: background 0.2s; }
.ad-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.ad-table tbody tr:hover { background: rgba(124, 58, 237, 0.07); }
.ad-table tbody tr:last-child td { border-bottom: 0; }
.ad-table .is-right { text-align: right; }
.ad-col-img { width: 84px; }

.ad-cell-title { font-weight: 600; color: var(--ad-text); }
.ad-cell-sub { margin-top: 2px; font-size: 12px; color: var(--ad-dim); }
.ad-cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; }
.ad-cell-clip { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-price-old { font-size: 12px; color: var(--ad-dim); text-decoration: line-through; }
.ad-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

.ad-thumb {
  width: 64px; height: 42px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--ad-border); color: var(--ad-dim);
}
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ad-rating { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.ad-rating i, .ad-rating svg { width: 14px !important; height: 14px !important; color: var(--ad-warning); fill: var(--ad-warning); }

.ad-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ad-user .ad-avatar { width: 30px; height: 30px; font-size: 12px; }

.ad-pill-featured {
  display: inline-block; margin-left: 6px; padding: 1px 7px; vertical-align: middle;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ad-warning); background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 999px;
}
.ad-chip {
  display: inline-block; padding: 3px 10px; font-size: 12px; font-weight: 500; white-space: nowrap;
  color: var(--ad-muted); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--ad-border); border-radius: 999px;
}

/* Select status inline di tabel */
.ad-status-select {
  width: auto; padding: 7px 30px 7px 10px; font-size: 12px; font-weight: 600; border-radius: 8px;
}

/* ---------- Badge status ---------- */
.ad-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; font-size: 12px; font-weight: 600; text-transform: capitalize; white-space: nowrap;
  border-radius: 999px; border: 1px solid transparent;
}
.ad-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ad-badge.is-pending { color: var(--ad-warning); background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
.ad-badge.is-paid { color: var(--ad-cyan); background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.3); }
.ad-badge.is-delivered { color: var(--ad-success); background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); }
.ad-badge.is-cancelled { color: var(--ad-danger); background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); }

/* ---------- Empty state & skeleton ---------- */
.ad-empty { padding: 56px 20px; text-align: center; color: var(--ad-muted); }
.ad-empty i, .ad-empty svg { width: 40px !important; height: 40px !important; color: var(--ad-dim); margin-bottom: 10px; }

.ad-skel {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: adShimmer 1.4s linear infinite;
}
.ad-skel-img { width: 64px; height: 42px; border-radius: 8px; }
@keyframes adShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Settings ---------- */
.ad-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.ad-settings-grid .ad-card { margin-bottom: 0; }
.ad-qris-box {
  display: flex; align-items: center; justify-content: center;
  min-height: 260px; padding: 16px; margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--ad-border-strong); border-radius: 14px;
}
.ad-qris-img { max-width: 100%; max-height: 320px; border-radius: 10px; background: #fff; padding: 8px; object-fit: contain; cursor: zoom-in; }
.ad-qris-empty { text-align: center; color: var(--ad-dim); }
.ad-qris-empty i, .ad-qris-empty svg { width: 44px !important; height: 44px !important; margin-bottom: 8px; }

/* ---------- Modal ---------- */
.ad-modal {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s;
}
.ad-modal.ad-modal-top { z-index: 960; }
.ad-modal.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.ad-modal-backdrop { position: absolute; inset: 0; background: rgba(5, 5, 10, 0.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ad-modal-card {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(18, 18, 26, 0.96);
  border: 1px solid var(--ad-border-strong); border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 60px -30px rgba(124, 58, 237, 0.6);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.35s var(--ad-ease);
}
.ad-modal.is-open .ad-modal-card { transform: none; }
.ad-modal-lg { max-width: 760px; }
.ad-modal-sm { max-width: 400px; }
.ad-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--ad-border);
}
.ad-modal-head h2 { font-size: 19px; font-weight: 700; }
.ad-modal-head p { margin-top: 2px; font-size: 13px; color: var(--ad-muted); }
.ad-modal-card > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ad-modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.ad-modal-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 24px; border-top: 1px solid var(--ad-border); background: rgba(255, 255, 255, 0.02);
}
.ad-modal-foot-center { justify-content: center; }

/* Konfirmasi */
.ad-confirm { padding: 28px 24px 8px; text-align: center; }
.ad-confirm-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ad-danger); background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3);
}
.ad-confirm-icon.is-info { color: var(--ad-cyan); background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.3); }
.ad-confirm-icon.is-success { color: var(--ad-success); background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); }
.ad-confirm-icon i, .ad-confirm-icon svg { width: 26px !important; height: 26px !important; }
.ad-confirm h2 { font-size: 18px; }
.ad-confirm p { margin-top: 6px; color: var(--ad-muted); }

/* Detail pesanan (dirender admin.js) */
.ad-detail { display: grid; gap: 18px; }
.ad-detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ad-detail-total { font-family: var(--ad-font-head); font-size: 26px; font-weight: 800; }
.ad-detail-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.ad-box { padding: 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--ad-border); border-radius: 12px; }
.ad-box-title { margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ad-dim); }
.ad-kv { display: grid; gap: 10px; }
.ad-kv-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.ad-kv-label { color: var(--ad-muted); flex-shrink: 0; }
.ad-kv-value { text-align: right; font-weight: 500; word-break: break-word; }
.ad-proof {
  position: relative; display: block; width: 100%; padding: 0; overflow: hidden;
  background: #0b0b11; border: 1px solid var(--ad-border); border-radius: 10px; cursor: zoom-in;
}
.ad-proof img { display: block; width: 100%; max-height: 300px; object-fit: contain; transition: transform 0.35s var(--ad-ease); }
.ad-proof:hover img { transform: scale(1.03); }
.ad-proof-zoom {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; font-size: 11px; font-weight: 600;
  color: #fff; background: rgba(0, 0, 0, 0.65); border-radius: 999px; backdrop-filter: blur(4px);
}
.ad-proof-zoom i, .ad-proof-zoom svg { width: 13px !important; height: 13px !important; }
.ad-proof-empty { padding: 28px 12px; text-align: center; font-size: 13px; color: var(--ad-dim); }
.ad-order-actions { justify-content: space-between; }
.ad-order-actions-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* Lightbox */
.ad-lightbox {
  position: fixed; inset: 0; z-index: 980;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(3, 3, 8, 0.92); backdrop-filter: blur(8px);
  visibility: hidden; opacity: 0; transition: opacity 0.25s, visibility 0.25s; cursor: zoom-out;
}
.ad-lightbox.is-open { visibility: visible; opacity: 1; }
.ad-lightbox img {
  max-width: min(94vw, 900px); max-height: 90vh; object-fit: contain; border-radius: 12px;
  transform: scale(0.96); transition: transform 0.3s var(--ad-ease);
}
.ad-lightbox.is-open img { transform: none; }
.ad-lightbox-close { position: absolute; top: 18px; right: 18px; color: #fff; background: rgba(255, 255, 255, 0.1); }

/* ---------- Scrollbar ---------- */
.ad-body ::-webkit-scrollbar { width: 9px; height: 9px; }
.ad-body ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; }
.ad-body ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }
.ad-body ::-webkit-scrollbar-track { background: transparent; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1200px) {
  .ad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablet & mobile: sidebar jadi drawer */
@media (max-width: 1024px) {
  .ad-main { margin-left: 0; }
  .ad-sidebar { transform: translateX(-100%); box-shadow: none; width: min(300px, 84vw); }
  .ad-sidebar-close { display: inline-flex; }
  .ad-body.ad-drawer-open .ad-sidebar { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6); }
  .ad-body.ad-drawer-open .ad-sidebar-backdrop { opacity: 1; visibility: visible; }
  .ad-body.ad-drawer-open { overflow: hidden; }

  .ad-topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ad-border);
  }
  .ad-brand-sm .ad-brand-mark { width: 30px; height: 30px; }
  .ad-brand-sm .ad-brand-tag { display: none; }
  .ad-topbar-title { margin-left: auto; font-size: 13px; color: var(--ad-muted); font-weight: 500; }
  .ad-content { padding-top: 24px; }
  .ad-settings-grid { grid-template-columns: 1fr; }
}

/* Mobile: tabel berubah jadi kartu */
@media (max-width: 760px) {
  .ad-content { padding: 20px 14px 56px; }
  .ad-card { padding: 18px; }
  .ad-card-flush { padding: 0; }
  .ad-stats { gap: 12px; }
  .ad-stat { padding: 16px; flex-direction: column; gap: 10px; }
  .ad-page-head { align-items: stretch; }
  .ad-page-actions .ad-btn { flex: 1; }

  .ad-toolbar { padding: 14px; }
  .ad-search { max-width: none; flex-basis: 100%; }
  .ad-toolbar-select { flex: 1; min-width: 0; }
  .ad-count { margin-left: 0; }

  .ad-table-wrap { overflow: visible; padding: 12px; }
  .ad-card:not(.ad-card-flush) > .ad-table-wrap { padding: 0; }
  .ad-table, .ad-table tbody, .ad-table tr, .ad-table td { display: block; width: 100%; }
  .ad-table thead { display: none; }
  .ad-table tbody tr, .ad-table tbody tr:nth-child(even) {
    margin-bottom: 12px; padding: 6px 14px;
    background: var(--ad-card-2);
    border: 1px solid var(--ad-border); border-radius: 14px;
  }
  .ad-table tbody tr:last-child { margin-bottom: 0; }
  .ad-table td, .ad-table tbody tr:last-child td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 0; text-align: right;
    border-bottom: 1px dashed var(--ad-border);
  }
  .ad-table td:last-child { border-bottom: 0; }
  .ad-table td::before {
    content: attr(data-label); flex-shrink: 0;
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ad-dim);
  }
  .ad-table td[data-label=""]::before, .ad-table td:not([data-label])::before { content: none; }
  .ad-table .is-right { text-align: right; }
  .ad-cell-clip { max-width: 190px; }
  .ad-actions { justify-content: flex-end; flex-wrap: wrap; }

  .ad-form-grid { grid-template-columns: 1fr; }
  .ad-thumb-field { flex-direction: column; }
  .ad-thumb-preview { width: 100%; }
  .ad-thumb-controls { width: 100%; }

  .ad-modal { padding: 0; align-items: flex-end; }
  .ad-modal-card, .ad-modal-lg, .ad-modal-sm { max-width: none; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .ad-modal.ad-modal-top { align-items: center; padding: 20px; }
  .ad-modal.ad-modal-top .ad-modal-card { border-radius: 18px; max-width: 400px; }
  .ad-modal-head, .ad-modal-body, .ad-modal-foot { padding-left: 18px; padding-right: 18px; }
  .ad-detail-cols { grid-template-columns: 1fr; }
  .ad-modal-foot .ad-btn { flex: 1; }
  .ad-order-actions-group { width: 100%; }
  .ad-order-actions-group .ad-btn { flex: 1; }
}

@media (max-width: 420px) {
  .ad-stats { grid-template-columns: 1fr; }
}

/* Hormati preferensi kurangi animasi */
@media (prefers-reduced-motion: reduce) {
  .ad-body *, .ad-body *::before, .ad-body *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}