/* =========================================================
   Katalog UMKM — Design System v2 (mobile-first, modern)
   ========================================================= */

:root {
  /* Warna */
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --brand-darker: #115e59;
  --brand-soft: #ccfbf1;
  --brand-tint: #f0fdfa;

  --bg: #f5f7f8;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --border: #e6eaee;

  --green: #16a34a;
  --green-dark: #15803d;
  --amber: #f59e0b;
  --red: #ef4444;

  /* Bentuk & bayangan */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
  --shadow: 0 2px 8px rgba(15,23,42,.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 16px 40px rgba(15,23,42,.12);

  /* Layout */
  --maxw: 1080px;
  --pad: 16px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
}
img, video, iframe { max-width: 100%; height: auto; }

a { color: var(--brand); text-decoration: none; }
a:active { opacity: .7; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); width: 100%; }
.muted { color: var(--muted); font-size: .85rem; }
[hidden] { display: none !important; }

h1 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; }

/* =========================================================
   HEADER
   ========================================================= */
.topbar {
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-height: 58px; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); min-width: 0; }
.brand-logo {
  font-size: 1.35rem; flex: 0 0 auto; width: 40px; height: 40px;
  display: grid; place-items: center; background: var(--brand-soft);
  border-radius: 12px;
}
.brand > span { min-width: 0; }
.brand strong { display: block; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; }

/* Nav desktop (disembunyikan di HP, diganti bottom-nav) */
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a, .topnav button {
  font-size: .85rem; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  border: none; background: none; cursor: pointer; color: var(--text-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px; transition: background .15s, color .15s;
}
.topnav a:hover, .topnav button:hover { background: var(--bg); color: var(--text); }
.topnav a.active { color: var(--brand-dark); background: var(--brand-soft); }
.btn-ghost { border: 1.5px solid var(--border) !important; }

.cart-link { position: relative; }
.cart-badge {
  position: absolute; top: 0; right: 6px; background: var(--red); color: #fff;
  font-size: .62rem; font-weight: 800; min-width: 17px; height: 17px; line-height: 17px;
  text-align: center; border-radius: 999px; padding: 0 4px; border: 2px solid #fff;
}

/* =========================================================
   BOTTOM NAV (hanya HP)
   ========================================================= */
.bottom-nav { display: none; }
@media (max-width: 720px) {
  .topnav { display: none; }
  /* Kecuali nav minimal (halaman auth: tombol kembali saja) */
  .topnav.topnav-min { display: flex; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-b);
    box-shadow: 0 -2px 16px rgba(15,23,42,.05);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 9px 4px 8px; color: var(--muted); font-size: .68rem; font-weight: 600;
    position: relative; min-height: 56px; background: none; border: none; cursor: pointer;
    font-family: inherit;
  }
  .bottom-nav a .ico, .bottom-nav button .ico { font-size: 1.3rem; line-height: 1; }
  .bottom-nav a.active { color: var(--brand-dark); }
  .bottom-nav a.active .ico { transform: translateY(-1px); }
  /* Badge keranjang di bottom-nav: tempel di kanan-atas ikon */
  .bottom-nav .cart-link-bn { position: relative; }
  .bottom-nav .cart-badge {
    position: absolute; top: 4px; left: 50%; right: auto;
    margin-left: 6px; margin-right: 0;
  }
}

/* =========================================================
   HERO / PENCARIAN
   ========================================================= */
.hero { padding: 22px 0 6px; text-align: center; }
.hero h1 { font-size: 1.45rem; margin-bottom: 4px; }
.hero p { color: var(--text-2); font-size: .9rem; }
.searchbox {
  margin: 16px auto 0; max-width: 560px; display: flex; gap: 8px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); padding: 5px; box-shadow: var(--shadow);
}
.searchbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.searchbox input {
  flex: 1; padding: 11px 14px; font-size: 1rem; border: none; background: none; outline: none;
  color: var(--text); min-width: 0;
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox button {
  border: none; border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 1.05rem; cursor: pointer; padding: 0 18px; flex: 0 0 auto;
}
.searchbox button:active { background: var(--brand-dark); }

/* =========================================================
   CHIP KATEGORI
   ========================================================= */
.catbar {
  display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.catbar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--card); font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--text-2);
  white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s; scroll-snap-align: start;
}
.chip:active { transform: scale(.96); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 4px 12px rgba(13,148,136,.3); }
.chip .cnt {
  font-weight: 700; font-size: .72rem; background: var(--bg); color: var(--muted);
  padding: 1px 7px; border-radius: 999px;
}
.chip.active .cnt { background: rgba(255,255,255,.25); color: #fff; }

/* =========================================================
   TOOLBAR
   ========================================================= */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 4px 0 14px; flex-wrap: wrap;
}
.toolbar .muted { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.sortsel {
  padding: 9px 13px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--card); font-size: .82rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; min-height: 40px; outline: none;
}

/* =========================================================
   GRID & KARTU PRODUK
   ========================================================= */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card); border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  border: 1px solid rgba(15,23,42,.03);
  transition: transform .18s, box-shadow .18s;
  min-width: 0;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
}
.card-img {
  aspect-ratio: 1/1; background: linear-gradient(135deg, var(--brand-soft), var(--brand-tint));
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .placeholder { font-size: 2.4rem; opacity: .45; }
.badge-soldout {
  position: absolute; top: 8px; left: 8px; background: var(--red); color: #fff;
  font-size: .68rem; font-weight: 800; padding: 4px 9px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(239,68,68,.35);
}
.badge-cat {
  position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.94);
  font-size: .66rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; color: var(--brand-dark);
  backdrop-filter: blur(4px);
}
.card-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.card-title {
  font-size: .92rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc {
  font-size: .78rem; color: var(--muted); display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-seller {
  font-size: .74rem; color: var(--text-2); font-weight: 600;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rating-row { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--text-2); font-weight: 600; }
.card-price {
  font-size: 1.02rem; font-weight: 800; color: var(--brand-dark); margin-top: 2px;
  letter-spacing: -.02em;
}
.card-price small { font-weight: 600; color: var(--muted); font-size: .72rem; }

.card-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn-add {
  flex: 1; min-height: 40px; padding: 9px; border-radius: 11px; border: none;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .82rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .15s;
}
.btn-add:active { background: var(--brand-dark); }
.btn-add:disabled { background: var(--muted); opacity: .7; }
.btn-review {
  min-height: 40px; width: 42px; border-radius: 11px; border: 1.5px solid var(--border);
  background: var(--card); font-size: .95rem; cursor: pointer; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px;
  padding: 10px; border-radius: 11px; background: #f0fdf4; color: var(--green-dark);
  font-weight: 700; font-size: .82rem; border: 1.5px solid #bbf7d0; cursor: pointer; min-height: 42px;
}
.btn-wa:active { background: #dcfce7; }
.btn-wa.disabled { background: var(--bg); color: var(--muted); border-color: var(--border); pointer-events: none; }

/* Bintang */
.stars { color: var(--amber); font-size: .8rem; letter-spacing: -.3px; }
.stars .empty { color: #e2e8f0; }
.stars-input { display: inline-flex; gap: 3px; font-size: 2rem; cursor: pointer; color: #e2e8f0; }
.stars-input span { transition: color .12s, transform .12s; line-height: 1; }
.stars-input span.on { color: var(--amber); }
.stars-input span:active { transform: scale(1.2); }

/* =========================================================
   KOSONG & LOAD MORE
   ========================================================= */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-ico { font-size: 3rem; margin-bottom: 10px; opacity: .6; }
.empty p { font-size: .9rem; line-height: 1.6; }
.loadmore {
  display: block; margin: 20px auto 0; padding: 13px 28px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--card); font-weight: 700;
  cursor: pointer; font-size: .88rem; color: var(--text-2); min-height: 46px;
  box-shadow: var(--shadow-xs);
}
.loadmore:active { border-color: var(--brand); color: var(--brand); }

.skeleton { background: linear-gradient(90deg, #eef2f4 25%, #f7fafb 50%, #eef2f4 75%); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.footer { text-align: center; padding: 32px 16px 16px; color: var(--muted); font-size: .82rem; }
.footer a { font-weight: 600; }

/* =========================================================
   TOMBOL UMUM
   ========================================================= */
.btn {
  width: 100%; min-height: 48px; padding: 13px; border: none; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: .95rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s;
}
.btn:active { background: var(--brand-dark); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: var(--card); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:active { background: var(--bg); }
.btn-danger { background: var(--red); }
.btn-danger:active { background: #dc2626; }
.btn-sm { width: auto; min-height: 38px; padding: 8px 15px; font-size: .82rem; }

/* =========================================================
   FORM
   ========================================================= */
.form-wrap { max-width: 460px; margin: 22px auto; }
.form-card {
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 22px; border: 1px solid rgba(15,23,42,.03);
}
.form-card h1 { font-size: 1.25rem; margin-bottom: 5px; }
.form-card > p { color: var(--text-2); font-size: .85rem; margin-bottom: 18px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; color: var(--text-2); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px;
  font-size: 1rem; font-family: inherit; background: #fff; outline: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s; min-height: 46px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
.field textarea { resize: vertical; min-height: 88px; }
.field small { color: var(--muted); font-size: .75rem; display: block; margin-top: 4px; }
.form-foot { text-align: center; margin-top: 16px; font-size: .85rem; color: var(--muted); }

.alert { padding: 13px 15px; border-radius: 12px; font-size: .85rem; margin-bottom: 15px; line-height: 1.5; }
.alert-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: var(--brand-tint); color: var(--brand-darker); border: 1px solid var(--brand-soft); }

/* =========================================================
   DASHBOARD / PANEL
   ========================================================= */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 16px; gap: 12px; flex-wrap: wrap;
}
.page-head h1 { font-size: 1.4rem; }
.page-head p { color: var(--text-2); font-size: .85rem; margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat {
  background: var(--card); border-radius: var(--r); padding: 15px 14px;
  box-shadow: var(--shadow); border: 1px solid rgba(15,23,42,.03);
}
.stat b { font-size: 1.6rem; font-weight: 800; display: block; color: var(--brand-dark); letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: .74rem; color: var(--muted); font-weight: 600; }

/* Tab */
.tabs {
  display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 16px; border: none; background: var(--card); font-weight: 700; cursor: pointer;
  color: var(--text-2); border-radius: 999px; white-space: nowrap; font-size: .85rem;
  min-height: 40px; border: 1.5px solid var(--border); transition: all .15s;
}
.tab.active { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 12px rgba(13,148,136,.25); }

/* Tabel (desktop) */
.table-wrap {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  overflow: hidden; border: 1px solid rgba(15,23,42,.03);
}
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 13px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  background: #fafbfc; font-weight: 700;
}
tr:last-child td { border-bottom: none; }
.thumb { width: 46px; height: 46px; border-radius: 11px; object-fit: cover; background: var(--brand-soft); flex: 0 0 auto; }
.pill { font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: #dcfce7; color: #166534; }
.pill-warn { background: #fef3c7; color: #92400e; }
.pill-off { background: #fee2e2; color: #991b1b; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Tabel → Kartu di HP ---- */
@media (max-width: 720px) {
  .responsive-table { background: transparent; box-shadow: none; border: none; border-radius: 0; overflow: visible; }
  .responsive-table table { min-width: 0; width: 100%; display: block; }
  .responsive-table thead { display: none; }
  .responsive-table tbody, .responsive-table tfoot { display: block; }
  .responsive-table tr {
    display: grid; grid-template-columns: 76px 1fr; gap: 3px 12px;
    background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
    padding: 13px; margin-bottom: 11px; border: 1px solid rgba(15,23,42,.03);
    align-items: start;
  }
  .responsive-table td {
    display: block; border: none; padding: 0; text-align: left; font-size: .86rem;
    min-width: 0; overflow-wrap: anywhere; white-space: normal;
  }
  .responsive-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label); display: block; font-size: .66rem; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 1px;
  }
  .responsive-table td.cell-thumb { grid-column: 1; grid-row: 1 / span 3; }
  .responsive-table td.cell-thumb .thumb { width: 76px; height: 76px; border-radius: 13px; }
  .responsive-table td.cell-name {
    grid-column: 2; grid-row: 1; font-size: .95rem; font-weight: 700; padding-bottom: 2px;
  }
  .responsive-table td.cell-name[data-label]::before { display: none; }
  .responsive-table td.cell-name small::before { content: ''; }
  .responsive-table td[data-label="Kategori"] { grid-column: 2; }
  .responsive-table td[data-label="Harga"] { grid-column: 2; font-weight: 800; color: var(--brand-dark); font-size: 1rem; }
  .responsive-table td[data-label="Harga"][data-label]::before { display: none; }
  .responsive-table td[data-label="Status"] { grid-column: 2; }
  .responsive-table td.cell-actions {
    grid-column: 1 / -1; grid-row: auto; margin-top: 9px; padding-top: 11px;
    border-top: 1px solid var(--border);
  }
  .responsive-table td.cell-actions .row-actions { width: 100%; }
  .responsive-table td.cell-actions .btn { flex: 1; width: auto; }
  .responsive-table td.cell-actions .sortsel { width: 100%; }

  .table-wrap:not(.responsive-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap:not(.responsive-table) table { min-width: 440px; }
}

/* =========================================================
   KERANJANG / CHECKOUT (layout kartu)
   ========================================================= */
.page-checkout { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 90px); }
@media (min-width: 721px) { .page-checkout { padding-bottom: 2rem; } }

.co-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 22px; align-items: start; margin: 20px 0 30px; }
.co-main { min-width: 0; }
.co-side { min-width: 0; position: sticky; top: 78px; }

.co-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.co-section-head h2 { font-size: 1.05rem; }
.co-count { font-size: .8rem; color: var(--muted); font-weight: 600; }

/* Daftar item */
.co-list { display: flex; flex-direction: column; gap: 12px; }

.co-item {
  display: flex; gap: 13px; background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow); border: 1px solid rgba(15,23,42,.04); padding: 12px;
}
.co-item-bad { border-color: #fecaca; background: #fff7f7; }
.co-thumb {
  width: 78px; height: 78px; border-radius: 13px; flex: 0 0 auto;
  object-fit: cover; background: linear-gradient(135deg, var(--brand-soft), var(--brand-tint));
}
.co-thumb-ph { display: grid; place-items: center; font-size: 1.7rem; opacity: .5; }

.co-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.co-item-top { display: flex; align-items: flex-start; gap: 8px; }
.co-item-name {
  flex: 1; font-weight: 700; font-size: .95rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.co-del {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--card); cursor: pointer; font-size: .95rem; color: var(--red);
  display: grid; place-items: center;
}
.co-del:active { background: #fef2f2; }
.co-item-price { font-size: .85rem; color: var(--text-2); font-weight: 600; }
.co-item-price small { color: var(--muted); font-weight: 500; }
.co-item-bad-note { font-size: .8rem; color: #b91c1c; font-weight: 600; }

.co-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.co-item-sub { font-weight: 800; color: var(--brand-dark); font-size: .95rem; letter-spacing: -.01em; }

/* Stepper kuantitas */
.qty-step {
  display: inline-flex; align-items: center; border: 1.5px solid var(--border);
  border-radius: 11px; overflow: hidden; background: var(--card);
}
.qty-btn {
  width: 38px; height: 38px; border: none; background: none; font-size: 1.15rem;
  font-weight: 700; color: var(--brand-dark); cursor: pointer; line-height: 1;
}
.qty-btn:active { background: var(--brand-soft); }
.qty-input {
  width: 44px; height: 38px; border: none; text-align: center; font-size: .95rem;
  font-weight: 700; outline: none; background: none; color: var(--text);
  -moz-appearance: textfield; appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Ringkasan biaya */
.co-summary {
  margin-top: 16px; background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow); border: 1px solid rgba(15,23,42,.04); padding: 16px;
}
.co-sum-row { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; color: var(--text-2); padding: 6px 0; }
.co-sum-total { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 13px; font-size: .95rem; color: var(--text); }
.co-sum-total b { font-size: 1.3rem; color: var(--brand-dark); letter-spacing: -.02em; }

/* Form pemesan */
.co-form-card {
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow);
  border: 1px solid rgba(15,23,42,.04); padding: 20px;
}
.co-form-card h2 { font-size: 1.1rem; }
.co-form-card > p { font-size: .82rem; margin: 3px 0 16px; }
.co-submit-desktop { margin-top: 6px; }

/* Bar bawah sticky (HP) */
.co-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b));
  z-index: 55; display: none;
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 11px 14px;
  align-items: center; gap: 12px; box-shadow: 0 -4px 20px rgba(15,23,42,.08);
}
.co-bar-info { display: flex; flex-direction: column; line-height: 1.15; }
.co-bar-label { font-size: .7rem; color: var(--muted); font-weight: 600; }
.co-bar-info b { font-size: 1.15rem; color: var(--brand-dark); letter-spacing: -.02em; }
.co-bar-btn { flex: 1; min-height: 48px; margin: 0; }

@media (max-width: 720px) {
  .co-layout { grid-template-columns: 1fr; gap: 16px; margin: 14px 0 20px; }
  .co-side { position: static; }
  .co-bar { display: flex; }
  .co-submit-desktop { display: none; }
  .co-thumb { width: 68px; height: 68px; }
  .co-item { padding: 11px; gap: 11px; }
  .co-form-card { padding: 18px; }
}

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 150;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  backdrop-filter: blur(3px);
}
.modal-bg[hidden] { display: none; }
@media (min-width: 600px) { .modal-bg { align-items: center; padding: 16px; } }
.modal {
  background: var(--card); width: 100%; max-width: 500px; max-height: 92vh; overflow-y: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 22px;
  box-shadow: var(--shadow-lg); animation: sheet .25s ease;
  padding-bottom: calc(22px + var(--safe-b));
}
@media (min-width: 600px) { .modal { border-radius: var(--r-lg); padding-bottom: 22px; } }
@keyframes sheet { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal h2 { font-size: 1.15rem; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.img-preview { width: 100%; aspect-ratio: 4/3; border-radius: 13px; object-fit: cover; background: var(--brand-soft); margin-bottom: 10px; display: none; }
.img-preview.show { display: block; }

/* Toast */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); left: 50%;
  transform: translateX(-50%) translateY(24px); opacity: 0; visibility: hidden;
  background: #0f172a; color: #fff;
  padding: 13px 20px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s;
  z-index: 220; max-width: 90vw; text-align: center; pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible;
  transition: transform .25s ease, opacity .25s ease, visibility 0s;
}
@media (min-width: 720px) { .toast { bottom: 24px; } }

/* Ulasan */
.review-item { padding: 13px 0; border-bottom: 1px solid var(--border); }
.review-item:last-child { border-bottom: none; }
.review-item .who { font-weight: 700; font-size: .87rem; display: flex; justify-content: space-between; gap: 10px; }
.review-item .when { font-size: .72rem; color: var(--muted); font-weight: 500; }
.review-item .txt { font-size: .85rem; color: var(--text-2); margin-top: 3px; }

/* =========================================================
   SENTUHAN AKHIR MOBILE
   ========================================================= */
@media (max-width: 720px) {
  .container { padding: 0 14px; }
  .hero { padding: 16px 0 4px; }
  .hero h1 { font-size: 1.3rem; }
  .hero p { font-size: .85rem; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin: 16px 0 14px; }
  .page-head .btn { width: 100%; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 12px 10px; text-align: center; }
  .stat b { font-size: 1.35rem; }
  .stat span { font-size: .68rem; }
  .form-card { padding: 18px; }
  .form-wrap { margin: 16px auto; }
  .card-body { padding: 10px 11px 11px; }
  .card-title { font-size: .88rem; }
  .card-desc { display: none; }
  .card-price { font-size: .98rem; }
  .footer { padding: 24px 14px 8px; }
}
@media (max-width: 380px) {
  .grid { gap: 9px; }
  .card-title { font-size: .84rem; }
  .btn-wa { font-size: .78rem; }
}

/* =========================================================
   PANEL ADMIN
   ========================================================= */
.admin-greeting { margin: 20px 0 16px; }
.admin-greeting h1 { font-size: 1.45rem; letter-spacing: -.02em; }
.admin-greeting p { color: var(--text-2); font-size: .88rem; margin-top: 3px; }

/* Kartu statistik dengan ikon + warna */
.stats-admin { grid-template-columns: repeat(4, 1fr); gap: 10px; position: relative; }
.stats-admin .stat { position: relative; padding-top: 34px; }
.stats-admin .stat-ico {
  position: absolute; top: 12px; left: 14px; font-size: 1.1rem;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; background: var(--brand-soft);
}
.stats-admin .stat-label { font-size: .72rem; }
.stat-amber .stat-ico { background: #fef3c7; }
.stat-blue .stat-ico { background: #dbeafe; }
.stat-green .stat-ico { background: #dcfce7; }
.stats-admin .stat b { font-size: 1.65rem; }

/* Tab dengan badge */
.tabs-admin { gap: 8px; }
.tabs-admin .tab {
  display: inline-flex; align-items: center; gap: 7px; position: relative;
  padding: 10px 18px;
}
.tab-ico { font-size: 1rem; }
.tab-badge {
  background: var(--amber); color: #fff; font-size: .68rem; font-weight: 800;
  min-width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 999px; padding: 0 5px;
}
.tab.active .tab-badge { background: rgba(255,255,255,.3); }

/* Daftar admin (kartu penjual & kategori) */
.admin-list { display: flex; flex-direction: column; gap: 12px; }

.admin-card {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  border: 1px solid rgba(15,23,42,.04); padding: 15px;
  transition: box-shadow .15s;
}
.admin-card.card-pending { border-left: 4px solid var(--amber); background: #fffdf7; }

.ac-head { display: flex; align-items: center; gap: 12px; }
.ac-avatar {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
  background: var(--brand-soft); color: var(--brand-dark); letter-spacing: -.02em;
}
.ac-avatar.av-admin { background: #e0e7ff; color: #3730a3; }
.ac-avatar.av-cat { background: var(--brand-soft); font-size: 1.3rem; }
.ac-title { flex: 1; min-width: 0; }
.ac-name {
  font-weight: 700; font-size: .98rem; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-owner {
  font-size: .78rem; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ac-meta {
  display: flex; flex-direction: column; gap: 2px; margin-top: 11px;
  padding: 9px 12px; background: var(--bg); border-radius: 11px;
}
.ac-meta-item {
  font-size: .79rem; color: var(--text-2); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ac-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: nowrap; }
.ac-actions .btn {
  flex: 1; width: auto; min-height: 42px; font-size: .84rem; padding: 10px 12px;
  border-radius: 11px; white-space: nowrap;
}
.btn-approve { background: var(--green); color: #fff; }
.btn-approve:active { background: var(--green-dark); }
.btn-icon {
  flex: 0 0 auto !important; width: 44px; min-width: 44px; padding: 0 !important;
  font-size: 1.05rem;
}
.pill-info { background: #e0e7ff; color: #3730a3; }

/* Form tambah kategori */
.add-cat { margin-bottom: 16px; }
.add-cat-form {
  display: flex; gap: 8px; background: var(--card); padding: 12px;
  border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid rgba(15,23,42,.04);
}
.add-cat-form input {
  flex: 1; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 11px;
  font-size: .95rem; outline: none; min-width: 0; min-height: 46px;
}
.add-cat-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.add-cat-form .btn { flex: 0 0 auto; width: auto; padding: 11px 18px; min-height: 46px; }
.cat-card .ac-head { align-items: center; }

/* Mobile: kartu admin makin lega */
@media (max-width: 720px) {
  .stats-admin { grid-template-columns: repeat(2, 1fr); }
  .stats-admin .stat { padding-top: 32px; }
  .admin-greeting { margin: 16px 0 14px; }
  .admin-greeting h1 { font-size: 1.25rem; }
  .ac-actions .btn { min-height: 44px; }
  .add-cat-form { flex-direction: column; }
  .add-cat-form .btn { width: 100%; }
}
@media (min-width: 721px) {
  .admin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .ac-actions .btn { flex: 0 1 auto; }
}

/* Catatan penolakan & tautan banding di kartu admin */
.admin-card.card-rejected { border-left: 4px solid var(--red); background: #fff7f7; }
.ac-reject {
  margin-top: 10px; padding: 9px 12px; background: #fef2f2; border-radius: 10px;
  font-size: .8rem; color: #991b1b; line-height: 1.5;
}
.ac-appeal-link {
  display: block; width: 100%; margin-top: 10px; padding: 10px 12px; cursor: pointer;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  font-size: .82rem; font-weight: 700; color: #92400e; text-align: left; font-family: inherit;
}
.ac-appeal-link:active { background: #fef3c7; }
.admin-card .ac-actions .btn-danger:not(.btn-icon) { flex: 1; }

/* Kotak penolakan di halaman penjual */
.reject-box { padding: 16px; }
.reject-head { font-size: .98rem; margin-bottom: 6px; }
.reject-reason {
  font-size: .88rem; line-height: 1.55; padding: 11px 13px; background: #fff;
  border-radius: 10px; border: 1px solid #fecaca; color: #7f1d1d;
}
.appeal-history { margin-top: 14px; }
.ah-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.ah-item { padding: 10px 12px; background: #fff; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--border); }
.ah-msg { font-size: .85rem; color: var(--text-2); margin-top: 6px; }
.ah-note { font-size: .8rem; color: var(--brand-darker); margin-top: 5px; }
.appeal-form { margin-top: 14px; }
.appeal-form label { display: block; font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.appeal-form textarea {
  width: 100%; min-height: 90px; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 11px; font-size: .95rem; font-family: inherit; outline: none; resize: vertical;
}
.appeal-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.appeal-form .btn { margin-top: 10px; }


