/* Seller dashboard PWA. Designed for cheap Android phones: big touch targets,
   system fonts, no external assets, works one-handed. */
:root {
  --p: #0f9d58; --p-dark: #0b7a44; --p-soft: #eaf5ef;
  --bg: #f4f7f5; --card: #ffffff; --ink: #1a212b; --muted: #67707d;
  --line: #e4e9e6; --red: #dc2626; --amber: #f59e0b; --blue: #0277bd;
  --nav-h: 62px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
button { font: inherit; cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; display: block; }
input, textarea, select { font: inherit; color: var(--ink); }

.view { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 16px 16px calc(var(--nav-h) + 24px); padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px)); }
.boot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 40vh; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3.5px solid var(--line); border-top-color: var(--p); border-radius: 999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* bottom navigation */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); text-decoration: none;
}
.bottom-nav a .ic { font-size: 20px; }
.bottom-nav a.on { color: var(--p); }

/* common blocks */
.h1 { font-size: 21px; font-weight: 900; letter-spacing: -.4px; }
.h2 { font-size: 16px; font-weight: 800; margin: 20px 0 10px; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.topbar .back { background: var(--card); border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 12px; font-size: 17px; flex: none; }
.topbar .grow { flex: 1; min-width: 0; }

.card { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 12px; }
.card h3 { font-size: 14.5px; margin-bottom: 8px; }

.btn { display: block; width: 100%; text-align: center; text-decoration: none; background: var(--p); color: #fff; border-radius: 13px; padding: 14px; font-size: 15px; font-weight: 800; }
.btn:active { background: var(--p-dark); }
.btn[disabled] { opacity: .55; }
.btn.sec { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: #fff0f0; color: var(--red); border: 1.5px solid #fbd5d5; }
.btn.sm { padding: 10px 14px; font-size: 13.5px; width: auto; display: inline-block; border-radius: 11px; }
.btn.wa { background: #25D366; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 16px; background: var(--card); outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--p); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.err { color: var(--red); font-size: 13.5px; min-height: 18px; margin: 6px 0; text-align: center; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin-bottom: 10px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; background: var(--card); border: 1.5px solid var(--line); color: var(--ink); border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 700; }
.chip.on { background: var(--p); border-color: var(--p); color: #fff; }

.badge { display: inline-block; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 10px; }
.badge.baru { background: #fff7e6; color: #b45309; }
.badge.diproses { background: #e3f1fa; color: #075985; }
.badge.dikirim { background: #ede9fe; color: #6d28d9; }
.badge.selesai { background: var(--p-soft); color: var(--p-dark); }
.badge.dibatalkan { background: #f4f4f5; color: #71717a; }
.badge.premium { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.badge.free { background: var(--line); color: var(--muted); }

/* home */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hello .grow { flex: 1; min-width: 0; }
.linkcard { background: linear-gradient(135deg, #0f9d58, #0a6e3e); color: #fff; border-radius: 18px; padding: 18px; margin-bottom: 12px; }
.linkcard .lbl { font-size: 12px; opacity: .85; font-weight: 700; }
.linkcard .lnk { font-size: 15px; font-weight: 800; word-break: break-all; margin: 5px 0 14px; }
.linkcard .row-btns .btn { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); padding: 11px; font-size: 13.5px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat .n { font-size: 22px; font-weight: 900; letter-spacing: -.5px; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 700; }
.banner { border-radius: 14px; padding: 13px 15px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px; }
.banner.warn { background: #fff7e6; color: #92400e; }
.banner.info { background: #e3f1fa; color: #075985; }
.banner a { color: inherit; font-weight: 800; }

/* lists */
.item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(0,0,0,.04); text-decoration: none; }
.item .thumb { width: 52px; height: 52px; border-radius: 11px; background: var(--p-soft); flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .right { text-align: right; flex: none; }
.item .price { font-size: 14px; font-weight: 800; color: var(--p-dark); }
.item.dim { opacity: .55; }
.iconbtn { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; font-size: 15px; flex: none; }

.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state .big { font-size: 46px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; margin-bottom: 18px; }

/* photo picker */
.photo-pick { width: 132px; height: 132px; border-radius: 16px; border: 2px dashed var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; overflow: hidden; position: relative; margin: 0 auto 16px; }
.photo-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-pick .pic-ic { font-size: 30px; }

/* order detail */
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 14px; }
.kv .k { color: var(--muted); flex: none; }
.kv .v { text-align: right; font-weight: 600; word-break: break-word; }
.oi { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.oi:last-child { border-bottom: 0; }
.oi .q { color: var(--muted); }
.total-line { display: flex; justify-content: space-between; font-weight: 900; font-size: 16px; padding-top: 10px; }
.status-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 4px; }

/* theme picker */
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme-sw { border-radius: 13px; padding: 9px 6px 8px; text-align: center; border: 2px solid var(--line); background: var(--card); font-size: 11px; font-weight: 800; }
.theme-sw .dot { width: 26px; height: 26px; border-radius: 999px; margin: 0 auto 5px; }
.theme-sw.on { border-color: var(--p); }
.theme-sw .lock { font-size: 10px; color: var(--amber); }

/* premium */
.plan-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.plan-opt { border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px 10px; text-align: center; }
.plan-opt.on { border-color: var(--p); background: var(--p-soft); }
.plan-opt .pp { font-size: 17px; font-weight: 900; }
.plan-opt .pl { font-size: 12px; color: var(--muted); font-weight: 700; }
.paybox { background: var(--bg); border-radius: 13px; padding: 13px 15px; font-size: 13.5px; margin: 10px 0; }
.paybox b { font-size: 15px; }
.qris { width: 190px; margin: 10px auto; border-radius: 10px; border: 1px solid var(--line); }

/* toast + offline */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 20px; font-size: 14px; font-weight: 600; z-index: 90; max-width: 88vw; text-align: center; box-shadow: 0 6px 22px rgba(0,0,0,.3); }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 95; background: #92400e; color: #fff; font-size: 12.5px; font-weight: 700; text-align: center; padding: 7px 10px; }

/* auth */
.auth-wrap { max-width: 420px; margin: 0 auto; padding-top: 5vh; }
.auth-logo { text-align: center; font-size: 26px; font-weight: 900; letter-spacing: -.5px; margin-bottom: 4px; }
.auth-logo em { color: var(--p); font-style: normal; }
.auth-tag { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.auth-tabs { display: flex; background: var(--line); border-radius: 13px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; padding: 11px; border-radius: 10px; background: none; font-weight: 800; font-size: 14px; color: var(--muted); }
.auth-tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pin-row { position: relative; }
.pin-row input { letter-spacing: 6px; font-weight: 800; }
.pin-eye { position: absolute; right: 8px; top: 6px; bottom: 6px; width: 44px; background: none; font-size: 18px; }
.feature-list { margin-top: 26px; display: grid; gap: 9px; color: var(--muted); font-size: 13px; }
.success-live { text-align: center; padding-top: 6vh; }
.success-live .big { font-size: 58px; }
.success-live h1 { font-size: 22px; margin: 10px 0 6px; }

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb0 { margin-bottom: 0; }

/* multi-image support */
.photo-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px; margin-bottom: 16px; scrollbar-width: none; }
.photo-row::-webkit-scrollbar { display: none; }
.photo-item { position: relative; width: 104px; height: 104px; border-radius: 12px; overflow: hidden; background: var(--line); flex: none; border: 1.5px solid var(--line); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .photo-actions { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.6); display: flex; justify-content: space-around; padding: 2px 0; }
.photo-item .photo-actions button { background: none; border: none; color: #fff; font-size: 13px; cursor: pointer; padding: 2px 6px; }
.photo-item .photo-del { position: absolute; top: 4px; right: 4px; background: rgba(220, 38, 38, 0.85); color: #fff; border: none; width: 22px; height: 22px; border-radius: 999px; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: bold; }
.photo-add-btn { width: 104px; height: 104px; border-radius: 12px; border: 2px dashed var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11.5px; font-weight: 700; flex: none; cursor: pointer; }
.photo-add-btn .pic-ic { font-size: 24px; }

/* AI Modal Popup Styles */
.ai-modal-wrap { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 20px; }
.ai-modal-wrap.open { display: flex; }
.ai-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.ai-sheet { position: relative; z-index: 10; width: 100%; max-width: 440px; background: var(--card); border-radius: 20px; padding: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); max-height: 85vh; overflow-y: auto; text-align: left; }
.ai-close { position: absolute; top: 14px; right: 14px; background: var(--line); border: none; width: 28px; height: 28px; border-radius: 999px; font-size: 13px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.ai-price-box { background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; margin: 16px 0; text-align: center; }
.ai-rec-val { font-size: 24px; font-weight: 800; color: var(--p); margin: 4px 0; }
.ai-range-val { font-size: 13px; color: var(--muted); }
.ai-section-title { font-size: 14px; font-weight: 800; margin: 16px 0 6px; color: var(--ink); }
.ai-analysis { font-size: 13px; color: var(--muted); line-height: 1.5; }
.ai-tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ai-tips li { font-size: 13px; color: var(--muted); padding-left: 20px; position: relative; line-height: 1.4; }
.ai-tips li::before { content: '💡'; position: absolute; left: 0; font-size: 12px; }
