* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --green: #1E5631; --green-dark: #143D22; --green-soft: #E8F5E9; --ink: #1C2B21; --muted: #5A6B5E; --line: #DCE7DE; --bg: #F2F6F2; --card: #FFFFFF; --amber: #B7791F; --ease: cubic-bezier(.22,.61,.36,1); }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; }
.phone { max-width: 420px; margin: 0 auto; background: var(--bg); min-height: 100vh; }
a { color: var(--green); }
button { font: inherit; }

/* ---------- Header + tab ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--green); color: #fff; padding: 14px 16px; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand strong { display: block; font-size: 17px; line-height: 1.2; }
.brand span { display: block; font-size: 11px; opacity: .85; }
.batch-chip { text-align: right; font-size: 10px; line-height: 1.35; opacity: .95; white-space: nowrap; }
.batch-chip strong { font-size: 11px; letter-spacing: .02em; }
/* ---------- View switching (fade + slide ringan) ---------- */
main { padding: 16px 16px 8px; }
.view { display: none; }
.view.active { display: flex; flex-direction: column; gap: 14px; animation: viewIn .3s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; animation: cardIn .35s var(--ease) both; }
.card:nth-child(2) { animation-delay: .04s; }
.card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(4) { animation-delay: .12s; }
.card:nth-child(5) { animation-delay: .16s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Hero ---------- */
.hero { background: var(--green-dark); color: #fff; border-radius: 16px; padding: 20px 18px; animation: cardIn .35s var(--ease) both; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #BFE3C6; font-weight: 700; }
.hero h1 { font-size: 24px; line-height: 1.2; margin: 8px 0 6px; }
.hero-sub { font-size: 13px; opacity: .9; }
.chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 10px; padding: 8px 10px; flex: 1; min-width: 90px; transition: background .2s var(--ease); }
.chip span { display: block; font-size: 11px; opacity: .85; }
.chip strong { display: block; font-size: 15px; margin-top: 2px; }
.auth { margin-top: 14px; font-size: 13px; background: rgba(255,255,255,.1); border-radius: 10px; padding: 9px 12px; }
.check { display: inline-block; background: #fff; color: var(--green); border-radius: 50%; width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 12px; font-weight: 700; margin-right: 6px; }

/* ---------- Tombol ---------- */
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn { display: inline-block; font-size: 14px; font-weight: 700; text-align: center; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.97); }
.btn-light { background: #fff; color: var(--green-dark); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-green { background: var(--green); color: #fff; width: 100%; margin-top: 12px; }
.btn-outline-dark { background: #fff; color: var(--green-dark); border-color: var(--green); }
.btn-big { padding: 13px 16px; font-size: 15px; }

/* ---------- Kartu umum ---------- */
.card h2 { font-size: 17px; margin-bottom: 10px; color: var(--green-dark); }
.section-sub { font-size: 13px; color: var(--muted); margin: -4px 0 14px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts div:last-of-type { border-bottom: 0; }
.facts dt { color: var(--muted); flex-shrink: 0; }
.facts dd { text-align: right; font-weight: 600; }

/* ---------- Parameter kualitas ---------- */
.params { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.param { background: var(--green-soft); border: 1px solid #CBE2CF; border-radius: 12px; padding: 12px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.param:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(20,61,34,.12); }
.param span { display: block; font-size: 12px; color: var(--muted); }
.param strong { display: block; font-size: 18px; color: var(--green-dark); margin-top: 2px; }
.param em { display: block; font-size: 11px; font-style: normal; color: var(--muted); }
.note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---------- Tahapan ---------- */
.stage { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.stage:last-child { margin-bottom: 0; }
.stage:hover { box-shadow: 0 4px 16px rgba(20,61,34,.10); }
.stage-art svg { display: block; }
.stage-body { padding: 12px 14px 14px; }
.stage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stage-head h3 { font-size: 16px; color: var(--green-dark); }
.stage-body p { font-size: 14px; margin-top: 4px; }
.stage-body .meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status.done { background: var(--green-soft); color: var(--green-dark); border: 1px solid #BFDCC4; }
.status.doing { background: #FDF3D7; color: #7A5A00; border: 1px solid #F0DFA8; }
.status.todo { background: #F1F3F1; color: var(--muted); border: 1px solid var(--line); }

/* ---------- Profil petani + verifikasi ---------- */
.farmer-body { display: flex; gap: 12px; align-items: flex-start; }
.avatar { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.farmer-body strong { font-size: 16px; }
.farmer-body p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.auth-line { margin-top: 12px; font-size: 14px; background: var(--green-soft); border-radius: 10px; padding: 10px 12px; }
footer { padding: 18px 20px 28px; text-align: center; font-size: 13px; color: var(--muted); }
footer strong { color: var(--green-dark); }
footer .fine { margin-top: 8px; font-size: 12px; }

/* ---------- Banner status batch ---------- */
.status-banner { border-radius: 14px; padding: 14px 16px; font-size: 14px; animation: cardIn .35s var(--ease) both; }
.status-banner strong { display: block; font-size: 15px; margin-bottom: 2px; }
.status-banner.ok { background: var(--green-soft); border: 1px solid #BFDCC4; color: var(--green-dark); }
.status-banner.fail { background: #FDECEC; border: 1px solid #F3C2C2; color: #7F1D1D; }
.status-banner.pending { background: #FDF3D7; border: 1px solid #F0DFA8; color: #6B4E00; }
.status-banner.low { background: #FFF4E5; border: 1px solid #F5D9A8; color: #7C4A00; }
.check.bad { background: #FECACA; color: #9B1C1C; }
.check.warn { background: #FDE68A; color: #92400E; }

/* ---------- Status tambahan ---------- */
.status.fail { background: #FDE8E8; color: #9B1C1C; border: 1px solid #F5C6C6; }
.status.cancel { background: #F1F3F1; color: var(--muted); border: 1px dashed #C9D6CC; }
.status.low { background: #FFF4E5; color: #7C4A00; border: 1px solid #F5D9A8; }

/* ---------- Banner offline ---------- */
.offline-banner { background: #FDF3D7; border-bottom: 1px solid #F0DFA8; color: #6B4E00; font-size: 13px; font-weight: 600; padding: 10px 16px; text-align: center; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--green-dark); color: #fff; font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 24px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); z-index: 50; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 480px) {
  body { padding: 24px 0; }
  .phone { border-radius: 24px; overflow: hidden; box-shadow: 0 12px 40px rgba(20,61,34,.18); border: 1px solid var(--line); }
  .topbar { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
