/* ==========================================================================
   MDMT Visit Report v2 — design system tunggal.
   Dua tampilan: .shell.md (aplikasi lapangan, mobile-first) & .shell.admin (konsol klien).
   ========================================================================== */
:root {
  --green: #1b7a2f; --green-d: #14591d; --green-l: #2fa149; --green-ink: #0e3d16;
  --tint: rgba(27, 122, 47, .10); --tint-2: rgba(27, 122, 47, .18);
  --grad: linear-gradient(135deg, #1f8a36 0%, #14591d 100%);
  --bg: #eef1ee; --card: #fff; --card-2: #f6f8f6; --sunken: #e9ede9;
  --text: #17201a; --muted: #5f6b63; --faint: #8f9a92;
  --line: #e0e6e1; --line-2: #edf1ed;
  --danger: #c0392b; --danger-tint: rgba(192, 57, 43, .10);
  --warn: #a86b12; --warn-tint: rgba(196, 128, 26, .14);
  --ok: #1b7a2f;
  --r: 14px; --r-sm: 10px; --r-lg: 20px; --pill: 999px;
  --sh-1: 0 1px 2px rgba(16, 32, 20, .05), 0 1px 3px rgba(16, 32, 20, .07);
  --sh-2: 0 6px 18px rgba(16, 32, 20, .10);
  --sh-3: 0 16px 40px rgba(16, 32, 20, .20);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --tab-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d110e; --card: #171c18; --card-2: #1d231e; --sunken: #121613;
    --text: #e7ebe8; --muted: #9ba59e; --faint: #75807a;
    --line: #283029; --line-2: #212822;
    --tint: rgba(47, 161, 73, .16); --tint-2: rgba(47, 161, 73, .26);
    --grad: linear-gradient(135deg, #1c7e32 0%, #0f4a1a 100%);
    --danger-tint: rgba(231, 76, 60, .16); --warn-tint: rgba(230, 160, 40, .16);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 6px 18px rgba(0, 0, 0, .45); --sh-3: 0 16px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.45;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--green); }
img { max-width: 100%; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
[hidden] { display: none !important; }
svg.i.sm { width: 14px; height: 14px; }
.table-scroll { overflow-x: auto; }
.content .stepper { padding: 0 0 14px; }
.photo-slot .cap { pointer-events: none; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .danger-text { color: var(--danger); }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; }
.row { display: flex; align-items: center; gap: 10px; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- boot & loading ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.logo { width: 72px; height: 72px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 26px; letter-spacing: 1px; box-shadow: var(--sh-2); }
.boot .logo { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .8; } }
#loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; opacity: 0; transition: opacity .2s; }
#loadbar.on { opacity: 1; background: linear-gradient(90deg, transparent, #8fe3a2, #2fa149, transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: slide 1s linear infinite; }
@keyframes slide { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.skeleton { background: linear-gradient(90deg, var(--line-2), var(--card-2), var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { height: 74px; margin-bottom: 10px; }

/* ---------- kontrol form ---------- */
label.lbl { display: block; margin: 14px 0 6px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
label.lbl .req { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); color: var(--text); font: inherit; font-size: 16px; /* ≥16px: iOS tidak auto-zoom */
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: 0; border-color: var(--green-l); box-shadow: 0 0 0 3px var(--tint); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23667085' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.ferr { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-sm); font: inherit; font-weight: 650; font-size: 15px;
  cursor: pointer; text-decoration: none; transition: transform .08s, background .15s, box-shadow .15s; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--green); color: #fff; box-shadow: 0 3px 10px rgba(20, 89, 29, .28); }
.btn.primary:hover:not(:disabled) { background: var(--green-l); }
.btn.secondary { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.secondary:hover:not(:disabled) { background: var(--card-2); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.ghost:hover:not(:disabled) { background: var(--tint); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.lg { min-height: 56px; font-size: 16.5px; border-radius: var(--r); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: inherit; display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--tint); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--tint-2); }
.seg { display: inline-flex; background: var(--sunken); border-radius: var(--r-sm); padding: 4px; gap: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; min-width: 86px; text-align: center; padding: 9px 14px; border-radius: 8px; font-weight: 650; cursor: pointer; }
.seg input:checked + span { background: var(--card); color: var(--green); box-shadow: var(--sh-1); }

.switch { position: relative; width: 46px; height: 28px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: var(--pill); background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- kartu & badge ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--sh-1); }
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-weight: 700; font-size: 14.5px; }
.card-h .muted { font-weight: 500; font-size: 12.5px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 22px 2px 10px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--pill); font-size: 12px; font-weight: 700; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--tint); color: var(--green); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.danger { background: var(--danger-tint); color: var(--danger); }
.badge.solid { background: var(--green); color: #fff; }
.banner { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; }
.banner.warn { background: var(--warn-tint); color: var(--warn); }
.banner.danger { background: var(--danger-tint); color: var(--danger); }
.banner.info { background: var(--tint); color: var(--green-d); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg.i { width: 40px; height: 40px; stroke-width: 1.5; color: var(--faint); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- KPI & grafik (satu hue, label teks memakai tinta) ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--sh-1); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green); }
.kpi-lbl { font-size: 12.5px; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.kpi-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; }
.bar-row.link { cursor: pointer; }
.bar-row.link:hover { background: var(--card-2); }
.bar-lbl { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--green); border-radius: 6px; transition: width .5s var(--ease); }
.bar-val { font-size: 13.5px; font-weight: 700; min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.bar-row.zero .bar-lbl, .bar-row.zero .bar-val { color: var(--faint); }
.cols-wrap { overflow-x: auto; padding-bottom: 4px; }
.cols { display: flex; align-items: flex-end; gap: 4px; height: 150px; min-width: 100%; padding-top: 18px; }
.col { flex: 1 0 14px; max-width: 40px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.col-bar { width: 100%; background: var(--green); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .5s var(--ease); }
.col:hover .col-bar { background: var(--green-l); }
.col-val { font-size: 10.5px; font-weight: 700; color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.col-axis { display: flex; gap: 4px; min-width: 100%; border-top: 1px solid var(--line); padding-top: 5px; }
.col-axis span { flex: 1 0 14px; max-width: 40px; font-size: 10px; color: var(--faint); text-align: center; white-space: nowrap; overflow: hidden; }
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 > .card + .card { margin-top: 0; } }

/* ---------- daftar kunjungan ---------- */
.list { display: grid; gap: 10px; }
.vcard { display: flex; align-items: center; gap: 12px; padding: 11px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); text-decoration: none; color: inherit; cursor: pointer; transition: box-shadow .15s, transform .08s; }
.vcard:hover { box-shadow: var(--sh-2); }
.vcard:active { transform: scale(.995); }
.thumb { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 10px; background: var(--sunken); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.vcard .t { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .m { font-size: 12px; color: var(--faint); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chev { color: var(--faint); }

/* ---------- tabel (admin, layar lebar) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--sh-1); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; padding: 11px 14px; background: var(--card-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover { background: var(--card-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.only-wide { display: none; } .only-narrow { display: block; }
@media (min-width: 900px) { .only-wide { display: block; } .only-narrow { display: none; } }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- filter ---------- */
.filterbar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .filterbar { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.filterbar .f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filterbar .f > span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.filterbar .full { grid-column: 1 / -1; }
.filterbar .input { padding: 10px 12px; font-size: 15px; }
.range { display: flex; gap: 8px; } .range .input { min-width: 0; }

/* ---------- toast & modal ---------- */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 20px + var(--sab)); z-index: 300; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #111814; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--sh-3); animation: rise .25s var(--ease); pointer-events: auto; }
.toast.ok { background: var(--green-d); } .toast.err { background: var(--danger); } .toast.warn { background: #8a5a0e; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.modal-bg { position: fixed; inset: 0; z-index: 250; background: rgba(8, 16, 10, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@media (min-width: 640px) { .modal-bg { align-items: center; } }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); width: min(100%, 480px); max-height: 92dvh; overflow: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 18px calc(18px + var(--sab)); box-shadow: var(--sh-3); animation: rise .25s var(--ease); }
@media (min-width: 640px) { .modal { border-radius: var(--r-lg); } }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.overlay { position: fixed; inset: 0; z-index: 260; background: rgba(8, 16, 10, .6); display: grid; place-items: center; color: #fff; text-align: center; padding: 24px; }
.overlay .box { width: min(86vw, 320px); }
.spinner { width: 44px; height: 44px; margin: 0 auto 14px; border: 4px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 8px; background: rgba(255, 255, 255, .25); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; width: 0; background: #8fe3a2; transition: width .2s; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 20px calc(24px + var(--sab)); background: radial-gradient(900px 500px at 50% -10%, var(--tint-2), transparent 60%), var(--bg); }
.login-box { width: min(100%, 360px); }
.login-box .logo { margin: 0 auto 14px; }
.login-box h1 { text-align: center; margin: 0; font-size: 22px; }
.login-box p.sub { text-align: center; color: var(--muted); margin: 6px 0 22px; }
.login-box .btn { margin-top: 18px; }
.login-foot { text-align: center; font-size: 12px; color: var(--faint); margin-top: 22px; }

/* ==========================================================================
   Tampilan MD (lapangan): header hijau + tab bar bawah + tombol Input menonjol
   ========================================================================== */
.shell.md { max-width: 560px; margin: 0 auto; min-height: 100dvh; background: var(--bg); padding-bottom: calc(var(--tab-h) + 18px + var(--sab)); }
.shell.md.in-form { padding-bottom: calc(96px + var(--sab)); }
.appbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 6px; min-height: calc(56px + var(--sat)); padding: var(--sat) 8px 0 12px; background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(14, 61, 22, .22); }
.appbar .title { flex: 1; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.appbar .icon-btn:hover { background: rgba(255, 255, 255, .16); }
.net-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--pill); background: rgba(255, 255, 255, .18); font-size: 12px; font-weight: 700; }
.content { padding: 16px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; justify-content: center; height: calc(var(--tab-h) + var(--sab)); padding: 0 6px var(--sab); background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar a { position: relative; flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 650; }
.tabbar a svg.i { width: 23px; height: 23px; }
.tabbar a.on { color: var(--green); }
.tabbar .tab-fab .fab { width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(20, 89, 29, .42); border: 4px solid var(--bg); }
.tabbar .tab-fab .fab svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
.tabbar .dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; }
.shell.md.in-form .tabbar { display: none; }

.hero { background: var(--grad); color: #fff; border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-2); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -50px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero .hi { font-size: 13px; opacity: .9; }
.hero .who { font-size: 21px; font-weight: 800; margin-top: 2px; }
.hero .note { font-size: 12.5px; opacity: .88; margin-top: 8px; max-width: 34ch; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; box-shadow: var(--sh-1); }
.stat b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.cta { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 0; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-2); cursor: pointer; text-align: left; color: var(--text); font: inherit; border: 1px solid var(--line); }
.cta .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.cta .ic svg.i { width: 26px; height: 26px; stroke-width: 2.3; }
.cta b { display: block; font-size: 16.5px; }
.cta span { font-size: 13px; color: var(--muted); }

/* stepper form */
.stepper { display: flex; gap: 6px; padding: 14px 16px 4px; }
.stepper .st { flex: 1; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--faint); }
.stepper .st i { display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 6px; transition: background .25s; }
.stepper .st.done i { background: var(--green-l); } .stepper .st.on i { background: var(--green); }
.stepper .st.on { color: var(--green); }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 12px 16px calc(12px + var(--sab)); background: color-mix(in srgb, var(--card) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.actionbar .inner { max-width: 528px; margin: 0 auto; display: flex; gap: 10px; }
.actionbar .btn.primary { flex: 1; }

.gps { text-align: center; }
.gps .big { font-size: 15px; font-weight: 700; margin-top: 10px; }
.gps .coords { font-size: 19px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.gps-ic { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--tint); color: var(--green); }
.gps-ic svg.i { width: 32px; height: 32px; }
.gps-ic.busy { animation: pulse 1.2s infinite; }

.sku-tools { position: sticky; top: calc(56px + var(--sat)); z-index: 5; background: var(--bg); padding: 4px 0 10px; }
.sku { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; overflow: hidden; }
.sku.filled { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.sku-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 13px; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sku-h .n { font-weight: 650; }
.sku-h .c { font-size: 12px; color: var(--faint); }
.sku-h .sum { margin-left: auto; font-size: 12px; color: var(--green); font-weight: 700; text-align: right; }
.sku-b { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; padding: 0 13px 13px; }
@media (max-width: 380px) { .sku-b { grid-template-columns: repeat(3, 1fr); } }
.sku-b label { font-size: 10.5px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.sku-b .input { padding: 10px 4px; text-align: center; font-size: 16px; }

.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-slot { position: relative; border: 2px dashed var(--line); border-radius: var(--r); background: var(--card); aspect-ratio: 3 / 4; overflow: hidden; }
.photo-slot.has { border-style: solid; border-color: var(--green); }
.photo-slot.invalid { border-color: var(--danger); }
.photo-slot label.pick { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 10px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 650; }
.photo-slot label.pick svg.i { width: 30px; height: 30px; color: var(--green); }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.photo-slot .x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.photo-slot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.review { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.review dt { color: var(--muted); } .review dd { margin: 0; font-weight: 600; text-align: right; }

/* detail kunjungan */
.dl { display: grid; gap: 0; }
.dl .it { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.dl .it:last-child { border-bottom: 0; }
.dl .it span { color: var(--muted); flex: 0 0 auto; }
.dl .it b { font-weight: 600; text-align: right; word-break: break-word; }
.map { width: 100%; height: 210px; border: 0; border-radius: var(--r-sm); margin-top: 10px; background: var(--sunken); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery figure { margin: 0; }
.gallery a { display: block; border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 3 / 4; background: var(--sunken); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 650; }
.sku-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sku-table th { font-size: 11px; color: var(--muted); text-transform: uppercase; text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.sku-table th:first-child, .sku-table td:first-child { text-align: left; }
.sku-table td { padding: 8px 4px; border-bottom: 1px solid var(--line-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Tampilan ADMIN (konsol klien): sidebar di layar lebar, tab bar di HP
   ========================================================================== */
.shell.admin { min-height: 100dvh; padding-bottom: calc(var(--tab-h) + 18px + var(--sab)); }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; min-height: calc(58px + var(--sat)); padding: var(--sat) 12px 0 16px; background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(14, 61, 22, .22); }
.topbar .title { flex: 1; font-weight: 750; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .actions { display: flex; gap: 8px; align-items: center; }
.topbar .btn.secondary { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .25); }
.topbar .btn.secondary:hover { background: rgba(255, 255, 255, .26); }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .16); }
.content.wide { max-width: 1240px; margin: 0 auto; }
@media (min-width: 1024px) {
  .shell.admin { display: grid; grid-template-columns: 248px 1fr; padding-bottom: 0; }
  .shell.admin > .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: var(--card); border-right: 1px solid var(--line); padding: 18px 14px; }
  .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
  .brand .logo { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; }
  .brand b { display: block; font-size: 15.5px; } .brand span { font-size: 12px; color: var(--muted); }
  .side-nav { display: grid; gap: 4px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-weight: 600; }
  .side-nav a:hover { background: var(--card-2); }
  .side-nav a.on { background: var(--tint); color: var(--green); }
  .side-user { margin-top: auto; padding: 12px; border-radius: var(--r-sm); background: var(--card-2); font-size: 13px; }
  .side-user b { display: block; font-size: 14px; }
  .topbar { background: var(--bg); color: var(--text); box-shadow: none; border-bottom: 1px solid var(--line); min-height: 64px; padding: 0 24px; }
  .topbar .title { font-size: 20px; }
  .topbar .btn.secondary { background: var(--card); color: var(--text); border-color: var(--line); }
  .topbar .icon-btn:hover { background: var(--tint); }
  .content.wide { padding: 22px 24px 40px; }
}
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.tabs a { flex: 0 0 auto; padding: 9px 15px; border-radius: var(--pill); background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 650; font-size: 14px; }
.tabs a.on { background: var(--green); border-color: var(--green); color: #fff; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); }
.mrow:last-child { border-bottom: 0; }
.mrow .nm { flex: 1; min-width: 0; font-weight: 600; }
.mrow.off .nm { color: var(--faint); text-decoration: line-through; }
.add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.add-row .input { flex: 1; min-width: 0; }
.ucard { display: flex; gap: 12px; align-items: flex-start; padding: 13px 4px; border-bottom: 1px solid var(--line-2); }
.ucard:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--green); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.ucard .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.meter { height: 8px; border-radius: 5px; background: var(--line-2); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; background: var(--green); }
.meter.warn span { background: #d08a1e; } .meter.danger span { background: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- perbaikan hasil QA visual --- */
.cta b { color: var(--text); }
.photo-slot .cap { gap: 8px; }
.photo-slot .cap span:first-child { min-width: 0; }
.photo-slot .cap span:last-child { flex: 0 0 auto; white-space: nowrap; }
