/* Aplicador · FaleAgro — alto contraste, botões grandes (sol, luva) */
:root {
  --ink: #0b0b0b;
  --muted: #3d3d3d;
  --bg: #f4f4f1;
  --card: #fff;
  --line: #1f1f1f;
  --green: #14532d;
  --green-2: #1f7a3f;
  --amber: #f0b429;
  --red: #b00020;
  --blue: #0b3d91;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--green); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 900; font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--green); font-size: 1.2rem; }
.name-chip { background: rgba(255,255,255,.15); color: #fff; border: 2px solid #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; font-size: 1rem; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 720px; margin: 0 auto; padding: 14px; }
h1 { font-size: 1.5rem; margin: 6px 0; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }
.sec { margin-top: 26px; color: var(--muted); }
.muted { color: var(--muted); font-weight: 500; }
.loading, .empty { text-align: center; padding: 40px 10px; font-size: 1.15rem; color: var(--muted); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.btn-small { font: inherit; font-weight: 800; font-size: 1rem; padding: 10px 16px; min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
.cards { display: grid; gap: 12px; }
.cards.dim .app-card { opacity: .85; }
.app-card { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 2px 0 var(--line); }
.app-card:active { transform: translateY(2px); box-shadow: none; }
.app-card.st-enviada { border-left: 10px solid var(--blue); }
.app-card.st-recebida, .app-card.st-em_andamento { border-left: 10px solid var(--amber); }
.app-card.st-aplicada { border-left: 10px solid var(--green-2); }
.ac-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.date { font-weight: 800; text-transform: capitalize; }
.ac-title { font-size: 1.35rem; font-weight: 900; margin: 6px 0 2px; }
.ref { display: inline-block; background: var(--ink); color: #fff; border-radius: 8px; padding: 0 8px; font-size: .9em; }
.ac-sub { color: var(--muted); font-weight: 600; }
.ac-new { margin-top: 8px; font-weight: 900; color: var(--blue); }
.ac-prog { font-weight: 700; margin-top: 4px; }
.pill { font-size: .85rem; font-weight: 900; padding: 4px 10px; border-radius: 999px; border: 2px solid var(--line); white-space: nowrap; }
.pill.st-enviada { background: var(--blue); color: #fff; border-color: var(--blue); }
.pill.st-recebida, .pill.st-em_andamento { background: var(--amber); color: #000; }
.pill.st-aplicada { background: var(--green-2); color: #fff; border-color: var(--green-2); }
.bar { height: 12px; background: #ddd; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bar.big { height: 20px; }
.bar i { display: block; height: 100%; background: var(--green-2); }

.back { display: inline-block; font-weight: 900; font-size: 1.1rem; color: var(--ink); text-decoration: none; padding: 8px 4px; min-height: 44px; }
.app-head { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.app-head h1 { font-size: 1.55rem; }

.btn { font: inherit; font-weight: 900; border-radius: var(--radius); border: 3px solid var(--line); padding: 14px 18px; min-height: 60px; cursor: pointer; font-size: 1.1rem; }
.btn.full { display: block; width: 100%; margin: 12px 0; }
.btn.xl { min-height: 76px; font-size: 1.45rem; }
.btn-go { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 4px 0 #062b15; }
.btn-done { background: var(--ink); color: #fff; box-shadow: 0 4px 0 #555; }
.btn-ghost { background: #fff; color: var(--ink); }
.btn:disabled { opacity: .55; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }

/* papelão / tabela da calda */
.calda { background: #fffef6; border: 3px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.calda-h { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }
.calda-h b { font-size: 1.15rem; }
.calda-t, .sum-t { width: 100%; border-collapse: collapse; }
.calda-t th, .sum-t th { text-align: left; font-size: .85rem; text-transform: uppercase; letter-spacing: .02em; border-bottom: 3px solid var(--line); padding: 6px 4px; }
.calda-t td, .sum-t td { border-bottom: 1px solid #999; padding: 10px 4px; font-weight: 700; vertical-align: middle; }
.calda-t td:first-child { font-size: 1.1rem; font-weight: 900; }
.calda-t td.big { font-size: 1.45rem; font-weight: 900; white-space: nowrap; text-align: right; }
.calda-t th:last-child { text-align: right; }
.calda-ph { margin-top: 10px; font-weight: 800; }
.calda-note { margin-top: 8px; padding: 8px; background: #fff3c4; border-radius: 10px; font-weight: 600; }

.loads, .summary, .done-box { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.load { border: 2px solid #888; border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.load.done { border-color: var(--green-2); background: #effaf2; }
.load.done.bad { border-color: var(--red); background: #fff0f1; }
.load.next { border: 3px dashed var(--ink); background: #fffbe6; }
.ld-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.05rem; }
.ld-main b { font-size: 1.15rem; }
.ld-main .btn-small { margin-left: auto; }
.ck { font-size: 1.3rem; font-weight: 900; width: 26px; text-align: center; }
.load.done .ck { color: var(--green-2); }
.ld-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.tag { font-size: .9rem; font-weight: 800; padding: 3px 10px; border-radius: 8px; border: 2px solid var(--line); background: #fff; }
.tag.q-green { background: #1f7a3f; color: #fff; border-color: #1f7a3f; }
.tag.q-amber { background: var(--amber); color: #000; }
.tag.q-red { background: var(--red); color: #fff; border-color: var(--red); }
.sum-big { font-size: 1.25rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sum-big b { font-size: 1.6rem; }
.pct { margin-left: auto; font-weight: 900; font-size: 1.4rem; }
.sum-t { margin-top: 12px; }
.done-box { border-color: var(--green-2); background: #effaf2; font-weight: 800; }
.done-box pre { white-space: pre-wrap; font: inherit; font-weight: 600; background: #fff; border: 1px solid #999; border-radius: 10px; padding: 10px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); }
.err-box { background: #fff0f1; border: 3px solid var(--red); color: var(--red); padding: 14px; border-radius: var(--radius); font-weight: 800; }

/* folhas (dialogs) */
dialog.sheet { width: min(640px, 100vw); max-width: 100vw; max-height: 100dvh; margin: auto auto 0; border: 0; border-radius: 20px 20px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); background: #fff; color: var(--ink); }
dialog.sheet::backdrop { background: rgba(0,0,0,.6); }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 20px; } }
.sheet h2 { font-size: 1.5rem; margin: 0 0 6px; }
.sheet .sub { margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.sheet label { display: block; margin: 10px 0; font-weight: 800; }
.sheet label > span, .lbl { display: block; margin-bottom: 4px; font-weight: 800; }
.sheet em { font-style: normal; font-weight: 500; color: var(--muted); }
.input { width: 100%; font: inherit; font-size: 1.1rem; padding: 12px; border: 3px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.input.big { font-size: 1.5rem; font-weight: 900; min-height: 62px; }
.input:focus { outline: 4px solid #f0b429; outline-offset: 1px; }
textarea.input { font-size: 1.05rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.amounts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .95rem; background: #fffef6; border: 2px dashed #777; border-radius: 10px; padding: 8px 10px; }
.amounts:empty { display: none; }
.warn-line { margin: -4px 0 6px; color: var(--red); font-weight: 900; }
.err { background: #fff0f1; border: 2px solid var(--red); color: var(--red); font-weight: 900; padding: 10px; border-radius: 10px; }
.actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 14px; }
.photo-btn { display: grid !important; place-items: center; min-height: 64px; border: 3px dashed var(--line); border-radius: var(--radius); background: #f2f2f2; font-size: 1.15rem; font-weight: 900; cursor: pointer; text-align: center; padding: 8px; }
.prev { display: block; max-width: 100%; max-height: 220px; margin: 6px auto; border-radius: 12px; border: 2px solid var(--line); }
.or { text-align: center; font-weight: 900; color: var(--muted); margin: 4px 0; }
.or::before, .or::after { content: " — "; }

/* qualidade da calda: 6 botões grandes, escolha única */
.q-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-btn { min-height: 64px; font: inherit; font-size: 1rem; font-weight: 900; line-height: 1.15; border-radius: 12px; border: 3px solid var(--line); padding: 6px 8px; cursor: pointer; color: #000; }
.q-btn.q-green { background: #b9e8c7; }
.q-btn.q-amber { background: #ffe08a; }
.q-btn.q-red { background: #ffc2c8; }
.q-btn.sel { outline: 4px solid #000; outline-offset: 2px; }
.q-btn.sel.q-green { background: #1f7a3f; color: #fff; }
.q-btn.sel.q-amber { background: #e08e00; color: #000; }
.q-btn.sel.q-red { background: var(--red); color: #fff; }
.q-btn.sel::before { content: "✓ "; }

.photo-view img { display: block; max-width: 100%; max-height: 75dvh; margin: 0 auto; }
.photo-view .actions { grid-template-columns: 1fr; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; font-weight: 800; padding: 14px 18px; border-radius: 14px; max-width: 92vw; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.toast.bad { background: var(--red); }
[hidden] { display: none !important; }

/* sobra de calda que vem de outra aplicação */
.calda-vem { background: #e8f3fd; border: 3px solid #3d8bd9; border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.calda-vem .cv-h { font-size: 1.15rem; margin-bottom: 6px; }
.calda-vem .cv-warn { background: #fff3c4; border-radius: 10px; padding: 8px; font-weight: 600; margin-bottom: 8px; }
.calda-vem .cv-note { margin-top: 8px; }
fieldset.sobra { border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 10px 0; }
fieldset.sobra legend { font-weight: 700; padding: 0 4px; }
.ls-h { margin: 4px 0 8px; }
.tag.gasto { background: #fbefe7; color: #8a3b12; border-color: #e8c2a8; }
/* v16 fotos: câmera / galeria / colar, várias com miniatura */
.qff{margin:4px 0 10px}
.qff-btns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px}
.qff-btn{display:flex;align-items:center;justify-content:center;text-align:center;min-height:44px;padding:6px;border:1.5px dashed #8fd1ac;border-radius:12px;background:#f2faf5;color:#1f5a3a;font-weight:600;font-size:.86rem;cursor:pointer;line-height:1.15}
.qff-thumbs{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.qff-th{position:relative;margin:0}
.qff-th img{width:72px;height:72px;object-fit:cover;border-radius:8px;border:1px solid #ddd;display:block}
.qff-rm{position:absolute;top:-6px;right:-6px;width:26px;height:26px;border-radius:50%;border:0;background:#c62828;color:#fff;font-size:18px;line-height:24px;padding:0;cursor:pointer}
.qff-msg{font-size:.8rem;margin:4px 0 0;min-height:0}
.qff-msg:empty{display:none}
/* v20 dose por área */
.calda-h.pt-h { margin-top: 10px; color: #0b4f9c; }
.calda-t tr.pt-dif td { background: #fff1c2; font-weight: 700; }
