/* Bagi Kupon — clean, mobile-first */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: #f5f7fa; color: #1a202c;
  line-height: 1.5; font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 14px; }
.container.narrow { max-width: 680px; }

.hero { text-align: center; margin-bottom: 18px; padding: 4px; }
.hero h1 { font-size: 1.4rem; margin-bottom: 6px; font-weight: 800; }
.lead { color: #4a5568; font-size: 0.9rem; }

.card {
  background: #fff; border-radius: 14px; padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-bottom: 14px;
}
.card h2 { font-size: 1rem; margin: 12px 0 8px; padding-top: 12px; border-top: 1px solid #edf2f7; }
.card h2:first-child { padding-top: 0; border-top: 0; margin-top: 0; }

label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 0.82rem; color: #2d3748; }
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], input[type="email"], input[type="url"], textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid #cbd5e0; border-radius: 9px;
  font-size: 16px; font-family: inherit;
  margin-top: 5px; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid #3b82f6; outline-offset: -1px; border-color: #3b82f6; }
input[readonly] { background: #f7fafc; }
textarea { resize: vertical; min-height: 80px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-primary, .btn-secondary, .btn-text {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 22px; border-radius: 10px;
  font-size: 1rem; font-weight: 700;
  cursor: pointer; border: 0; font-family: inherit;
  text-decoration: none; transition: all .15s; min-height: 46px;
}
.btn-primary { background: #2563eb; color: #fff; width: 100%; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-secondary { background: #e2e8f0; color: #2d3748; width: 100%; }
.btn-secondary:hover { background: #cbd5e0; }
.btn-text { background: transparent; color: #2563eb; padding: 6px 12px; }
.btn-text:hover { background: #eff6ff; }

/* Button kecil — STANDARDIZED. Tinggi EXACT 30px, single-line, no wrap.
   Pakai inline-flex supaya icon + text auto-center vertikal & horizontal. */
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  padding: 0 11px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  box-sizing: border-box;
  transition: opacity .12s, transform .08s;
}
.btn-sm.btn-approve { background: #10b981; color: #fff; }
.btn-sm.btn-reject  { background: #ef4444; color: #fff; }
.btn-sm.btn-claim   { background: #3b82f6; color: #fff; }
.btn-sm.btn-unclaim { background: #f59e0b; color: #fff; }
.btn-sm.btn-delete  { background: #6b7280; color: #fff; }
.btn-sm:hover  { opacity: 0.88; }
.btn-sm:active { transform: scale(0.97); }
.btn-sm:disabled { opacity: 0.5; cursor: not-allowed; }

.alert { padding: 12px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 0.88rem; line-height: 1.5; }
.alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert.success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert.warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

.muted { color: #6b7280; }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.75rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 20px; }

.result {
  margin-top: 18px; padding: 18px;
  background: #fff; border-radius: 12px;
  border-left: 4px solid #2563eb;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.result.success { border-left-color: #10b981; }
.result.warning { border-left-color: #f59e0b; }
.result.error   { border-left-color: #ef4444; }

/* ===== MENU GALLERY ===== */
.menu-section { margin-bottom: 22px; }
.section-title {
  font-size: 0.95rem; font-weight: 800; margin: 0 0 10px;
  color: #1a202c; padding-left: 2px;
}
/* Mobile-first: PASTI 2 kolom × 3 baris = 6 menu di HP.
   Breakpoint 3-col baru di tablet ≥720px (bukan 560px lagi). */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;  /* explicit 2 kolom — tidak fluid */
  gap: 10px;
}
@media (min-width: 720px) { .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 980px) { .menu-grid { gap: 14px; } }

.menu-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  border: 1px solid #f1f5f9;
  display: flex; flex-direction: column;
}
/* Padding-bottom hack — bulletproof aspect ratio (4:3 = 75%).
   Wrapper TIDAK collapse meskipun image gagal/lazy/slow. Skeleton shimmer
   muncul sampai img.loaded class di-set oleh JS (lihat app.js attachImgLoaders). */
.menu-img-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 75%;
  overflow: hidden;
  background-color: #e5e7eb;
  background-image: linear-gradient(
    90deg,
    #e5e7eb 0%,
    #f3f4f6 40%,
    #f9fafb 50%,
    #f3f4f6 60%,
    #e5e7eb 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.menu-img-wrap.loaded {
  animation: none;
  background: var(--menu-color, #6366f1);
}
.menu-img-wrap img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  opacity: 0;
  transition: opacity .25s ease-out;
}
.menu-img-wrap.loaded img { opacity: 1; }
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.menu-badge {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,.78); color: #fff;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 7px; border-radius: 999px;
  backdrop-filter: blur(4px); white-space: nowrap;
  z-index: 2;
}
.menu-info {
  padding: 8px 10px 10px;
  flex: 1;
  min-height: 56px;
  display: flex; flex-direction: column;
}
.menu-info h3 {
  font-size: 0.78rem; font-weight: 700; margin: 0 0 2px;
  color: #1a202c; line-height: 1.25;
  height: 1.25em;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.menu-info p {
  font-size: 0.68rem; color: #64748b; margin: 0; line-height: 1.35;
  height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== PUBLIC QUEUE (Aktivitas Live) — COMPACT ===== */
.public-queue {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 12px; padding: 10px 10px 8px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(217,119,6,0.08);
}
.public-queue .section-title {
  margin: 0 0 7px;
  display: flex; align-items: center; gap: 6px;
  color: #92400e;
  font-size: 0.85rem;  /* compact title */
}
.live-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: #ef4444;
  animation: pulse-live 1.4s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50%      { opacity: 0.4; box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Stats compact — 2 col, tinggi minim */
.queue-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-bottom: 7px;
}
.qstat {
  background: #fff; border-radius: 8px; padding: 6px 8px;
  text-align: center;
  border: 1px solid rgba(217,119,6,0.15);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.qstat.hot { background: linear-gradient(180deg, #fff 0%, #fef2f2 100%); border-color: #fca5a5; }
.qstat .big { font-size: 1.15rem; font-weight: 900; line-height: 1; color: #1a202c; }
.qstat.hot .big { color: #b91c1c; }
.qstat .lbl { font-size: 0.62rem; color: #6b7280; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; line-height: 1.1; text-align: left; }

/* List — tinggi PASTI untuk 3 row (~140px), sisanya scroll */
.queue-list {
  /* 3 row × 44px (row) + 2 border = ~134px */
  max-height: 138px;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(217,119,6,0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(217,119,6,0.35) transparent;
}
.queue-list::-webkit-scrollbar { width: 4px; }
.queue-list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb { background: rgba(217,119,6,0.3); border-radius: 4px; }
.queue-list::-webkit-scrollbar-thumb:hover { background: rgba(217,119,6,0.5); }

/* Compact row — 1 baris kiri, 1 baris kanan tight */
.queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  padding: 6px 10px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.74rem;
  min-height: 44px;
  box-sizing: border-box;
}
.queue-row:last-child { border-bottom: 0; }
.queue-row .q-left {
  display: flex; flex-direction: column;
  gap: 1px; min-width: 0; line-height: 1.25;
}
.queue-row .q-name {
  font-weight: 700; color: #1a202c;
  font-size: 0.78rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue-row .q-meta {
  font-size: 0.65rem; color: #6b7280;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue-row .q-right {
  text-align: right; white-space: nowrap;
  display: flex; flex-direction: column; gap: 1px;
  align-items: flex-end; line-height: 1.2;
}
.queue-row .q-time { font-size: 0.6rem; color: #9ca3af; }
.queue-row .q-status-mini {
  font-size: 0.58rem; font-weight: 800;
  padding: 1px 6px; border-radius: 999px;
  background: #e5e7eb; color: #4b5563;
  letter-spacing: 0.3px;
}
.queue-row .q-status-mini.eligible { background: #d1fae5; color: #065f46; }
.queue-row .q-status-mini.approved { background: #dbeafe; color: #1e40af; }
.queue-row .q-status-mini.claimed  { background: #bfdbfe; color: #1e3a8a; }
.queue-row .q-status-mini.pending  { background: #fef3c7; color: #92400e; }
.queue-row .q-status-mini.far      { background: #fee2e2; color: #991b1b; }

.queue-empty {
  padding: 14px 12px; text-align: center;
  color: #9ca3af; font-size: 0.76rem;
}

.form-section { margin-top: 6px; }
.form-section .section-title { padding-left: 0; margin-top: 0; padding-top: 0; border-top: 0; }

fieldset { border: 0; padding: 0; margin: 0; }
fieldset[disabled] input { background: #f7fafc; color: #94a3b8; cursor: not-allowed; }

.btn-spinner {
  display: none; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: btn-spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-primary:disabled .btn-spinner { display: inline-block; }

/* ===== KUPON BOX (post-klaim display) ===== */
.kupon-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  border: 2px dashed #d97706;
  border-radius: 16px; padding: 22px 18px; margin: 18px 0;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.18);
}
.kupon-header {
  font-size: 1rem; font-weight: 800; color: #92400e;
  margin-bottom: 14px; letter-spacing: 0.3px;
}
.kupon-code {
  display: inline-block;
  padding: 14px 22px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1.8rem; font-weight: 900;
  background: #fff;
  color: #b91c1c;
  border: 2px solid #b91c1c;
  border-radius: 10px;
  letter-spacing: 4px;
  word-break: break-all;
  box-shadow: inset 0 0 0 4px #fef3c7;
  margin: 4px 0 14px;
  user-select: all;
}
.kupon-tearline {
  height: 1px; border-bottom: 2px dashed #d97706;
  margin: 14px -6px; position: relative;
}
.kupon-tearline::before, .kupon-tearline::after {
  content: ''; position: absolute; top: -8px;
  width: 16px; height: 16px; background: #f5f7fa;
  border-radius: 50%;
}
.kupon-tearline::before { left: -14px; }
.kupon-tearline::after  { right: -14px; }
.kupon-info { margin-bottom: 12px; }
.kupon-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 6px; font-size: 0.85rem;
}
.kupon-row span { color: #92400e; }
.kupon-row strong { color: #1a202c; }
.kupon-note {
  font-size: 0.78rem; color: #78350f;
  margin-top: 8px; line-height: 1.5;
}
.kupon-status-note {
  margin-top: 10px; padding: 8px;
  background: rgba(255,255,255,0.6); border-radius: 6px;
  font-size: 0.82rem;
}
.kupon-status-note .badge { margin-right: 6px; }

/* ===== ADMIN ===== */
.admin-page { background: #f1f5f9; }
.admin-page .container { max-width: 1400px; }  /* lebih lega dari publik (1100) */
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.admin-header h1 { font-size: 1.3rem; margin-bottom: 4px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card {
  background: #fff; padding: 12px 14px; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05); border-top: 3px solid #cbd5e0;
}
.stat-card.pending  { border-top-color: #94a3b8; }
.stat-card.eligible { border-top-color: #10b981; }
.stat-card.far      { border-top-color: #f59e0b; }
.stat-card.claimed  { border-top-color: #3b82f6; }
.stat-label { color: #6b7280; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; color: #1a202c; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filter-btn {
  padding: 6px 12px; border-radius: 999px; border: 1px solid #cbd5e0;
  background: #fff; cursor: pointer; font-size: 0.78rem; font-weight: 600; color: #4b5563;
}
.filter-btn:hover { background: #f1f5f9; }
.filter-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.table-wrap { background: #fff; border-radius: 10px; overflow-x: auto; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  min-width: 1000px;
  table-layout: fixed;  /* respect % widths di <th> */
}
thead { background: #f8fafc; position: sticky; top: 0; z-index: 1; }

/* SEMUA cell center — vertical & horizontal */
th, td {
  text-align: center;
  vertical-align: middle;
  padding: 12px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th {
  font-weight: 700; color: #4b5563;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.4px;
  border-bottom: 2px solid #e2e8f0;
}
td {
  border-bottom: 1px solid #edf2f7;
  font-size: 0.84rem;
  color: #1f2937;
}
tbody tr:hover { background: #f8fafc; }
tbody tr { height: 56px; }  /* tinggi row UNIFORM */

/* Kolom numbering — selalu narrow + center. Cursor help kalau ada title tooltip. */
.num-cell {
  text-align: center; font-weight: 700; color: #6b7280;
  font-variant-numeric: tabular-nums;
}
.num-cell[title] { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }

/* Stat number cells di referral table */
.stat-num {
  display: inline-block; min-width: 28px; padding: 4px 8px;
  background: #f1f5f9; color: #475569;
  border-radius: 6px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-num.claim {
  background: #d1fae5; color: #065f46; font-size: 1rem;
}

/* Label cell content — semua inline 1 baris, dipisah inline-flex container */
.label-name {
  font-weight: 700; color: #1a202c;
}
.label-note {
  margin-left: 6px; color: #6b7280; font-size: 0.74rem;
  font-weight: 400;
}

/* Inline ref tag (saat nama + ref bareng — 1 baris) */
.ref-inline-tag {
  display: inline-flex; align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  background: #ede9fe; color: #6d28d9;
  border-radius: 999px;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.2px;
  vertical-align: middle;
}

/* Referral pending label (saat row belum klaim, hanya ada ref_label) */
.ref-label-pending {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  background: #ede9fe; color: #5b21b6;
  border-radius: 999px;
  font-weight: 700; font-size: 0.78rem;
}

/* Kode ref display di kolom Kode Ref */
.ref-code-big {
  font-size: 0.85rem; padding: 4px 10px;
}

.kode-cell {
  background: #fef3c7; color: #92400e;
  padding: 3px 8px; border-radius: 4px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.78rem; font-weight: 700;
  white-space: nowrap;
}

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge.pending  { background: #e2e8f0; color: #475569; }
.badge.eligible { background: #d1fae5; color: #065f46; }
.badge.far      { background: #fef3c7; color: #92400e; }
.badge.approved { background: #dbeafe; color: #1e40af; }
.badge.claimed  { background: #bfdbfe; color: #1e3a8a; }
.badge.rejected { background: #fee2e2; color: #991b1b; }

.distance-ok  { color: #065f46; font-weight: 700; }
.distance-far { color: #92400e; font-weight: 700; }

/* Action cell — flex row, NO WRAP, center horizontal. */
.action-cell {
  display: flex; gap: 5px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;  /* button group selalu di tengah kolom */
}

/* ===== REFERRAL MANAGER (admin) ===== */
.ref-create-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.5fr) auto;
  gap: 8px; margin-bottom: 8px; align-items: stretch;
}
.ref-create-row input {
  margin-top: 0;
  padding: 8px 12px;
  font-size: 0.85rem;
}
.ref-create-row button { white-space: nowrap; padding: 8px 16px; font-size: 0.85rem; min-height: 0; }
@media (max-width: 640px) {
  .ref-create-row { grid-template-columns: 1fr; }
}

/* Deleted ref row — visual cue jelas tapi tetap readable */
.ref-row-deleted {
  background: #fef2f2 !important;
  opacity: 0.78;
}
.ref-row-deleted:hover { opacity: 1; }
.ref-row-deleted td { color: #6b7280; }
.ref-row-deleted .label-name { text-decoration: line-through; color: #9ca3af; }

.ref-table { font-size: 0.82rem; min-width: 900px; }
.ref-table th { font-size: 0.68rem; }
.ref-table td { padding: 12px; }

/* URL share cell — compact display + prominent copy button, CENTER */
.ref-url-cell {
  display: flex; gap: 6px;
  align-items: center;
  justify-content: center;
}
.ref-url-display {
  flex: 1; padding: 5px 9px;
  background: #f1f5f9; color: #475569;
  border-radius: 5px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.78rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: help;
}
/* ref-copy-btn pakai .btn-sm jadi auto height 30px — tidak butuh override */

/* Action cell di ref table — SELALU horizontal (kolom Aksi cukup lebar 220px) */
.ref-table .action-cell {
  display: flex; gap: 5px;
  flex-direction: row;
  flex-wrap: nowrap;
}

/* Tag di kolom "Nama / Referral" antrian */
.ref-tag {
  display: inline-block;
  background: #ede9fe; color: #6d28d9;
  padding: 1px 7px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2px;
  margin-left: 4px; white-space: nowrap;
}
.ref-tag-only {
  display: inline-flex; align-items: center; gap: 6px;
  color: #6d28d9; font-weight: 600;
}
.ref-code-mini {
  background: #ede9fe; color: #6d28d9;
  padding: 1px 6px; border-radius: 4px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.7rem; font-weight: 700;
}

/* ===== MENU EDITOR (admin) ===== */
.menu-editor-block {
  background: #fff; border-radius: 10px; margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05); border: 1px solid #e2e8f0;
  overflow: hidden;
}
.menu-editor-block summary {
  cursor: pointer; padding: 12px 16px; font-weight: 700; font-size: 0.9rem;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  list-style: none; user-select: none;
}
.menu-editor-block summary::-webkit-details-marker { display: none; }
.menu-editor-block summary::before { content: '▶ '; transition: transform .2s; display: inline-block; }
.menu-editor-block[open] summary::before { transform: rotate(90deg); }
.menu-editor-body { padding: 14px 16px 18px; }

.menu-edit-row { margin-bottom: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fafbfc; }
.menu-edit-grid {
  display: grid;
  grid-template-columns: 50px 1.2fr 2fr 70px 50px 2fr 36px;
  gap: 6px; align-items: center;
}
.menu-edit-row input { margin-top: 0; padding: 6px 8px; font-size: 0.82rem; border-radius: 6px; }
.menu-edit-row input[type="color"] { padding: 2px; height: 32px; cursor: pointer; }
.menu-edit-row .emoji-input { text-align: center; font-size: 1.1rem; padding: 4px; }
.menu-edit-row .del-menu { width: 30px; height: 30px; font-size: 1.1rem; padding: 0; line-height: 1; }

.menu-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.menu-actions .btn-primary, .menu-actions .btn-secondary { width: auto; flex: 1; min-width: 160px; }

@media (max-width: 720px) {
  .menu-edit-grid {
    grid-template-columns: 50px 50px 70px 36px;
    grid-template-areas:
      "emoji color porsi del"
      "name name name name"
      "desc desc desc desc"
      "img img img img";
    gap: 6px;
  }
  .menu-edit-row input[data-field="emoji"] { grid-area: emoji; }
  .menu-edit-row input[data-field="color"] { grid-area: color; }
  .menu-edit-row input[data-field="porsi"] { grid-area: porsi; }
  .menu-edit-row .del-menu                  { grid-area: del; }
  .menu-edit-row input[data-field="name"]  { grid-area: name; }
  .menu-edit-row input[data-field="desc"]  { grid-area: desc; }
  .menu-edit-row input[data-field="img"]   { grid-area: img; }
}

/* Modal generic */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-content { background: #fff; padding: 22px; border-radius: 12px; max-width: 420px; width: 100%; }
.modal-content h3 { margin-bottom: 16px; }

/* ===== LOCATION POPUP — compact, thin, professional ===== */
.loc-popup {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: loc-popup-fade-in 0.15s ease-out;
}
@keyframes loc-popup-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.loc-popup-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  max-width: 360px;
  width: 100%;
  padding: 22px 22px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  animation: loc-popup-scale-in 0.18s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes loc-popup-scale-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Icon — emoji circle compact, bukan gambar besar */
.loc-popup-icon {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
}

.loc-popup-title {
  font-size: 1.05rem; font-weight: 700;
  margin: 0 0 6px; color: #0f172a;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.loc-popup-desc {
  font-size: 0.85rem; color: #475569;
  margin: 0 0 14px; line-height: 1.5;
}
.loc-popup-extra {
  font-size: 0.78rem; color: #475569;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 10px 12px; margin: 0 0 14px;
  text-align: left;
}
.loc-popup-extra:empty { display: none; }
.loc-popup-extra ol { margin: 0; padding-left: 18px; }
.loc-popup-extra ol li { margin: 2px 0; }
.loc-popup-extra strong { color: #0f172a; }

.loc-popup-btn {
  width: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0 18px;
  height: 42px;
  min-height: 42px;
  letter-spacing: 0.01em;
}

.loc-popup-close {
  width: 100%;
  margin-top: 8px;
  font-size: 0.78rem;
  color: #64748b;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
  font-family: inherit;
}
.loc-popup-close:hover { color: #0f172a; text-decoration: underline; }

/* Mobile — tetap centered card, NOT full-screen. Sedikit lebih lebar */
@media (max-width: 540px) {
  .loc-popup { padding: 16px; }
  .loc-popup-content {
    max-width: 100%;
    padding: 20px 18px;
  }
  .loc-popup-icon { width: 40px; height: 40px; font-size: 1.25rem; margin-bottom: 10px; }
  .loc-popup-title { font-size: 1rem; }
  .loc-popup-desc  { font-size: 0.82rem; }
  .loc-popup-extra { font-size: 0.75rem; padding: 9px 11px; }
  .loc-popup-btn   { font-size: 0.88rem; height: 42px; }
}

/* Body scroll lock saat popup aktif */
body.no-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Setup page */
.setup-page { padding: 12px 0; }
.loc-status { margin: 12px 0; padding: 10px 12px; border-radius: 6px; font-size: 0.88rem; background: #f7fafc; border: 1px dashed #cbd5e0; }
.loc-status.loading { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
.loc-status.success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.loc-status.error   { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.loc-status code { background: rgba(0,0,0,.06); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

.setup-loc-help {
  border: 1px solid #e2e8f0; border-radius: 8px;
  margin-bottom: 8px; background: #fafbfc;
}
.setup-loc-help summary {
  cursor: pointer; padding: 10px 14px;
  font-size: 0.9rem; user-select: none;
  list-style: none; border-radius: 8px;
}
.setup-loc-help summary::-webkit-details-marker { display: none; }
.setup-loc-help summary::before {
  content: '▶ '; color: #6b7280;
  display: inline-block; transition: transform .2s;
}
.setup-loc-help[open] summary::before { transform: rotate(90deg); }
.setup-loc-help[open] summary { background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
.setup-loc-help ol { margin: 0 0 10px 0; }

@media (max-width: 640px) {
  .container { padding: 10px; }
  .hero h1 { font-size: 1.25rem; }
  .hero { margin-bottom: 14px; }
  .card { padding: 14px; border-radius: 12px; }
  .stat-value { font-size: 1.3rem; }
  .stat-label { font-size: 0.65rem; }
  .kupon-code { font-size: 1.45rem; padding: 12px 16px; letter-spacing: 3px; }
}
@media (max-width: 380px) {
  .menu-grid { gap: 8px; }
  .menu-info { padding: 7px 9px 9px; }
  .menu-info h3 { font-size: 0.72rem; }
  .menu-info p { font-size: 0.62rem; }
  .menu-badge { font-size: 0.55rem; padding: 2px 6px; }
}
