/* Manager Visit - Tomoro Coffee. Flat design, mobile-first. */
:root {
  --brand: #f0582d;
  --brand-btn: #d4441a;      /* orange untuk tombol/teks di atas putih (kontras >= 4.5:1) */
  --brand-soft: #fff0ea;
  --brand-line: #fbd5c7;
  --bg: #f5f5f4;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #667085;
  --line: #ececea;
  --soft: #f3f3f1;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --ok-line: #bfe6cc;
  --bad: #d92d20;
  --bad-soft: #fdeceb;
  --warn: #b45309;
  --warn-soft: #fff4de;
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
img { display: block; }
.boot { padding: 64px 16px; text-align: center; color: var(--muted); }
.page { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(132px + var(--safe-b)); }
.muted { color: var(--muted); }
.req { color: var(--bad); }

/* ---------- header oranye ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff;
  padding: calc(12px + var(--safe-t)) 16px 16px;
  border-radius: 0 0 24px 24px;
}
.hdr-in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.hdr .grow { flex: 1; min-width: 0; }
.hdr h1 { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 800; overflow-wrap: anywhere; }
.hdr .sub { font-size: 13px; line-height: 1.3; margin-top: 2px; opacity: .95; }
.hdr .back {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .22); color: #fff; display: grid; place-items: center;
}
.hdr .back:active, .pill-btn:active { background: rgba(255, 255, 255, .34); }
.pill-btn {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, .22); color: #fff; font-weight: 700; font-size: 14px;
}
.hdr.big { position: static; padding-bottom: 28px; }
.hdr.big .logo-w { height: 30px; width: auto; }
.hdr.big .hello { font-size: 22px; font-weight: 800; line-height: 1.2; margin-top: 18px; max-width: 640px; margin-left: auto; margin-right: auto; }
.hdr.big .sub { max-width: 640px; margin-left: auto; margin-right: auto; }
.hdr.big + .page { margin-top: -12px; }

/* ---------- kartu ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card h2 { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.card .desc { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.label-sm { font-size: 13px; font-weight: 700; color: var(--muted); margin: 18px 4px 8px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- tombol ---------- */
.btn {
  width: 100%; min-height: 52px; border: 0; border-radius: 14px; padding: 14px 16px; font-weight: 800; font-size: 16px;
  background: var(--brand-btn); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.btn:active { filter: brightness(.94); }
.btn.green { background: var(--ok); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.white { background: #fff; color: var(--brand-btn); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--brand-btn); font-size: 14px; font-weight: 700; min-height: 44px; padding: 0 8px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; background: var(--brand); color: #fff; display: flex; flex-direction: column; padding: calc(32px + var(--safe-t)) 24px calc(28px + var(--safe-b)); }
.login .mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; max-width: 420px; width: 100%; margin: 0 auto; }
.login .mark { width: 88px; height: auto; }
.login .word { width: 220px; max-width: 70%; height: auto; margin-top: 4px; }
.login h1 { margin: 18px 0 0; font-size: 26px; font-weight: 800; }
.login p { margin: 0; opacity: .95; }
.login .box { max-width: 420px; width: 100%; margin: 0 auto; }
.login .note { background: rgba(255, 255, 255, .2); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }

/* ---------- input & toko ---------- */
.input, .textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px;
  background: #fff; color: var(--ink); font: inherit; min-height: 48px;
}
.textarea { min-height: 112px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(240, 88, 45, .18); }
.storelist { margin-top: 10px; max-height: 46dvh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.storeitem {
  width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 14px; min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.storeitem:last-child { border-bottom: 0; }
.storeitem.sel { background: var(--brand-soft); box-shadow: inset 4px 0 0 var(--brand); }

/* ---------- chip ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; background: var(--soft); border-radius: 999px; padding: 3px 10px; color: var(--muted); white-space: nowrap; }
.chip.red { background: var(--bad-soft); color: var(--bad); }
.chip.green { background: var(--ok-soft); color: var(--ok); }
.chip.amber { background: var(--warn-soft); color: var(--warn); }
.chip.orange { background: var(--brand-soft); color: var(--brand-btn); }

/* ---------- progres ---------- */
.prog { display: flex; align-items: center; gap: 16px; }
.ring {
  --p: 0; width: 76px; height: 76px; flex: 0 0 76px; border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--brand-soft) 0);
  display: grid; place-items: center; position: relative;
}
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.ring b { position: relative; font-size: 18px; font-weight: 800; }
.prog .stats { flex: 1; font-size: 14px; }
.prog .stats .r { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.prog .stats .r span:first-child { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--ok); }
.dot.o { background: var(--brand); }
.progress { height: 8px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s; }

/* ---------- tile (area & section) ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 440px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 10px 12px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 150px; position: relative;
  transition: background .12s, transform .08s;
}
.tile:active { transform: scale(.98); background: var(--brand-soft); }
.tile .ticon { width: 60px; height: 60px; border-radius: 16px; background: var(--brand-soft); display: grid; place-items: center; }
.tile .ticon img { width: 40px; height: 40px; }
.tile .name { font-weight: 700; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.tile .chip { margin-top: auto; }
.tile.done { border-color: var(--ok-line); background: #f7fdf9; }
.tile.done .ticon { background: var(--ok-soft); }
.tile .badge { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; }

/* ---------- pertanyaan ---------- */
.qtitle { font-weight: 800; font-size: 16px; margin: 0; }
.qdesc { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.item { margin-top: 16px; }
.item .lbl { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button {
  min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--soft);
  display: grid; place-items: center; color: #8a94a6; transition: background .12s, transform .08s;
}
.seg button:active { transform: scale(.98); }
.seg button.on.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg button.on.x { background: var(--bad); border-color: var(--bad); color: #fff; }
.seg.text button { font-weight: 800; font-size: 15px; }

/* ---------- foto ---------- */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--soft); border: 1px solid var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .rm { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(31, 36, 48, .78); color: #fff; font-size: 18px; line-height: 1; }
.ph .st { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .78); font-size: 12px; text-align: center; padding: 4px; }
.ph .st.err { background: rgba(253, 236, 235, .94); color: var(--bad); }
.addph {
  aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--brand); background: var(--brand-soft); color: var(--brand-btn);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 4px;
}

/* ---------- bar bawah ---------- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px calc(12px + var(--safe-b)); }
.bar .inner { max-width: 640px; margin: 0 auto; }

/* ---------- review / hasil ---------- */
.scorecard { background: var(--brand); color: #fff; border-radius: 20px; padding: 22px 16px; text-align: center; margin-bottom: 12px; }
.scorecard .lbl { font-size: 14px; font-weight: 700; opacity: .95; }
.scorecard .num { font-size: 68px; font-weight: 800; line-height: 1.05; }
.scorecard .of { font-size: 14px; opacity: .95; }
.alert { border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.alert.red { background: var(--bad-soft); color: #b42318; border: 1px solid #f5c6c2; }
.alert.amber { background: var(--warn-soft); color: #8a4b08; border: 1px solid #f3dcae; }
.alert.green { background: var(--ok-soft); color: #166534; border: 1px solid var(--ok-line); }
.list { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.list li { margin: 3px 0; }
.finditem { border-top: 1px solid var(--line); padding: 12px 0; }
.finditem:first-of-type { border-top: 0; }
.finditem .h { font-weight: 800; font-size: 15px; }
.finditem .s { color: var(--muted); font-size: 13px; font-weight: 600; }
.finditem .note { background: var(--soft); border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-top: 8px; }
.status { font-size: 13px; font-weight: 600; margin-top: 6px; }
.status.ok { color: var(--ok); }
.status.no { color: var(--warn); }

.toast {
  position: fixed; left: 50%; bottom: calc(104px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .2s; max-width: 90vw; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(0, 0, 0, .15); border-top-color: currentColor; border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 8px; }
@keyframes sp { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid rgba(240, 88, 45, .55); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: .01ms !important; } }

/* ---------- lihat foto ---------- */
.ph img[data-act="viewphoto"] { cursor: zoom-in; }
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(15, 18, 25, .92); display: grid; place-items: center; padding: calc(56px + var(--safe-t)) 12px calc(24px + var(--safe-b)); }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; background: #000; }
.lb-x { position: absolute; top: calc(8px + var(--safe-t)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .2); color: #fff; display: grid; place-items: center; }
.lb-note { position: absolute; left: 12px; right: 12px; bottom: calc(16px + var(--safe-b)); background: rgba(255, 255, 255, .16); color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 13px; text-align: center; }

.autoitem { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.autoitem .lbl { margin: 0; flex: 1; }
.keypoint { background: var(--brand-soft); color: var(--ink); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; line-height: 1.45; margin: 0 0 10px; }
.keypoint b { display: block; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-btn); margin-bottom: 2px; }
