:root{
  --bg:#f5f7f3;--card:#fff;--text:#18301f;--muted:#66736a;
  --brand:#2f6b3f;--brand2:#e4f0e6;--border:#dce5dd;--warn:#9a6a14;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--text);padding-bottom:80px}
button,select{font:inherit}.app-header{position:sticky;top:0;z-index:5;background:rgba(245,247,243,.94);backdrop-filter:blur(12px);display:flex;justify-content:space-between;align-items:center;padding:18px max(18px,calc((100vw - 1000px)/2));border-bottom:1px solid var(--border)}
h1,h2,h3,p{margin-top:0}.app-header h1{font-size:1.1rem;margin:2px 0}.eyebrow{font-size:.7rem;letter-spacing:.12em;font-weight:800;color:var(--brand);margin-bottom:4px}
.container{max-width:1000px;margin:auto;padding:22px 18px}.view{display:none}.view.active{display:block}
.card{background:var(--card);border:1px solid var(--border);border-radius:20px;box-shadow:0 5px 18px rgba(30,60,40,.05)}
.hero{padding:24px;display:flex;gap:20px;justify-content:space-between;align-items:end}.hero h2{font-size:1.8rem;max-width:600px;margin:8px 0}.hero p{color:var(--muted);max-width:650px;margin-bottom:0}
.badge{display:inline-block;background:var(--brand2);color:var(--brand);border-radius:99px;padding:6px 10px;font-size:.78rem;font-weight:700}
.primary,.secondary{border:0;border-radius:12px;padding:11px 15px;cursor:pointer;font-weight:750}.primary{background:var(--brand);color:white}.secondary{background:white;color:var(--brand);border:1px solid var(--border)}.hidden{display:none!important}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:16px 0}.stat{padding:16px}.stat strong{display:block;font-size:1.6rem}.stat span{color:var(--muted);font-size:.85rem}
.section-title{display:flex;justify-content:space-between;align-items:end;gap:15px;margin:28px 0 12px}.section-title h2{margin:0}
.list{display:grid;gap:12px}.cultivation-card{padding:17px;display:flex;justify-content:space-between;gap:15px;align-items:center}.cultivation-card h3{margin:0 0 5px}.meta{color:var(--muted);font-size:.85rem}.phase{font-size:.78rem;font-weight:800;background:var(--brand2);color:var(--brand);padding:6px 9px;border-radius:99px;white-space:nowrap}
.catalog-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.variety-card{padding:17px}.variety-card h3{margin:8px 0 5px}.variety-card p{color:var(--muted);font-size:.85rem}.tags{display:flex;flex-wrap:wrap;gap:5px;margin:10px 0}.tag{font-size:.7rem;background:#f0f3f0;padding:5px 7px;border-radius:7px}
.detail{display:grid;gap:14px}.detail .card{padding:20px}.back{border:0;background:none;color:var(--brand);cursor:pointer;padding:0;margin-bottom:12px;font-weight:700}.timeline{display:grid;gap:9px}.timeline-item{padding:12px;border-left:3px solid var(--brand);background:#fafcf9;color:var(--text)}.timeline-item strong{display:block}.timeline-item span{color:var(--text)}.form-grid{display:grid;gap:12px}.form-grid label{font-size:.85rem;font-weight:700}.form-grid input,.form-grid textarea,.form-grid select{width:100%;margin-top:5px;border:1px solid var(--border);border-radius:10px;padding:11px;background:white}
.form-grid .check-row{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:.85rem;
  font-weight:700;
  cursor:pointer;
}

.form-grid .check-row input{
  width:auto;
  margin:0;
  padding:0;
}.actions{display:flex;gap:8px;flex-wrap:wrap}
.bottom-nav{position:fixed;z-index:10;bottom:0;left:0;right:0;height:68px;background:white;border-top:1px solid var(--border);display:flex;justify-content:center;gap:10px}.nav-btn{width:130px;border:0;background:none;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem}.nav-btn.active{color:var(--brand);font-weight:800}
.modal{position:fixed;inset:0;background:rgba(10,25,14,.4);z-index:20;display:grid;place-items:center;padding:18px}.modal-card{position:relative;background:white;border-radius:20px;padding:22px;width:min(560px,100%);max-width:calc(100vw - 36px);min-width:0;max-height:90vh;overflow:auto;overflow-x:hidden}.close{position:absolute;right:15px;top:12px;border:0;background:none;font-size:1.7rem;cursor:pointer}
.notice{padding:12px;background:#fff8e6;border:1px solid #ead6a0;border-radius:12px;color:#6f5318;font-size:.85rem}
.empty{text-align:center;padding:30px;color:var(--muted);border:1px dashed var(--border);border-radius:16px}
@media(max-width:700px){.hero{display:block}.hero .primary{margin-top:18px;width:100%}.stats{grid-template-columns:1fr}.catalog-grid{grid-template-columns:1fr 1fr}.cultivation-card{align-items:start}.app-header{padding:14px 16px}}
@media(max-width:430px){.catalog-grid{grid-template-columns:1fr}}

.backup-card{margin-top:16px;padding:18px}.backup-card h2{margin:4px 0 5px;font-size:1.1rem}.backup-status{font-size:.8rem;color:var(--brand);margin:10px 0 0;min-height:1em}

.detail-top{display:flex;justify-content:space-between;gap:15px;align-items:start}.day-number{font-size:2rem;color:var(--brand);line-height:1}
.progress{height:8px;background:#edf1ed;border-radius:99px;overflow:hidden;margin:18px 0 6px}.progress span{display:block;height:100%;background:var(--brand);border-radius:99px}.progress-label{font-size:.72rem;color:var(--muted);margin-bottom:14px}.section-title.compact{margin:0 0 12px}.check-count{background:var(--brand2);color:var(--brand);border-radius:99px;padding:6px 9px;font-weight:800;font-size:.8rem}.daily-checklist{display:grid;gap:8px}.check-item{display:flex;gap:11px;align-items:flex-start;padding:12px;border:1px solid var(--border);border-radius:12px;cursor:pointer}.check-item input{margin-top:3px;accent-color:var(--brand)}.check-item span{display:grid;gap:3px}.check-item small{color:var(--muted);line-height:1.35}.check-item:has(input:checked){background:#f4faf5;border-color:#cce0d0}.check-item.alert{background:#fff8e6;border-color:#ead6a0}.full{width:100%;margin-top:12px}.saved-note{font-size:.75rem;color:var(--brand);margin:9px 0 0}.plan-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:9px;margin:12px 0}.plan-grid div{background:#f7f9f7;padding:11px;border-radius:10px}.plan-grid span{display:block;font-size:.72rem;color:var(--muted)}.plan-grid strong{display:block;margin-top:3px}.compact h3{margin:0}
@media(max-width:500px){.plan-grid{grid-template-columns:1fr 1fr}.detail-top h2{font-size:1.35rem}}

.conditions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.conditions-grid label{display:grid;gap:6px;font-size:.78rem;font-weight:700}.conditions-grid input,.conditions-grid select,.conditions-grid textarea{width:100%;box-sizing:border-box}.conditions-grid .wide{grid-column:1/-1}.file-input{display:block;width:100%;margin:8px 0 14px}.photo-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.photo-card{margin:0;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:#fafcf9}.photo-card img{display:block;width:100%;aspect-ratio:1;object-fit:cover}.photo-card figcaption{font-size:.68rem;color:var(--muted);padding:7px;display:flex;justify-content:space-between;gap:4px;align-items:center}.delete-photo{border:0;background:transparent;color:#a33;font-size:1.2rem;cursor:pointer}.notice{margin-top:12px;padding:10px;border-radius:10px;background:#f6f7f2;font-size:.75rem;color:var(--muted);line-height:1.45}
@media(max-width:560px){.conditions-grid{grid-template-columns:1fr}.conditions-grid .wide{grid-column:auto}.photo-gallery{grid-template-columns:repeat(2,1fr)}}

/* V5 — UX / dashboard */
body{background:#f5f7f3;padding-bottom:78px}.app-shell{max-width:920px;margin:0 auto}.today-hero{position:relative;overflow:hidden;border-radius:24px;padding:28px;margin-bottom:16px;background:linear-gradient(135deg,#1d5a3a,#2f7b4f);color:#fff;box-shadow:0 14px 35px rgba(25,82,50,.16)}.today-hero:after{content:"";position:absolute;width:220px;height:220px;border-radius:50%;right:-80px;top:-90px;background:rgba(255,255,255,.08)}.hero-copy{position:relative;z-index:2;max-width:610px}.hero-copy .eyebrow{color:rgba(255,255,255,.72)}.hero-copy h1{font-size:clamp(1.55rem,4vw,2.25rem);margin:7px 0}.hero-copy p{margin:0;color:rgba(255,255,255,.8)}.hero-orb{position:absolute;right:36px;top:28px;font-size:4.2rem;opacity:.9;z-index:1}.today-metrics{display:flex;gap:8px;margin-top:24px;position:relative;z-index:2;flex-wrap:wrap}.today-metrics div{background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.1);border-radius:12px;padding:9px 13px;display:grid;min-width:68px}.today-metrics strong{font-size:1.05rem}.today-metrics span{font-size:.66rem;color:var(--muted)}.today-metrics .metric-alert{background:rgba(255,198,80,.16)}.today-hero .today-metrics span{color:rgba(255,255,255,.72);}.quick-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:26px}.quick-action{border:1px solid var(--border);background:#fff;border-radius:15px;padding:13px;text-align:left;display:grid;grid-template-columns:auto 1fr;column-gap:9px;align-items:center;cursor:pointer;box-shadow:0 3px 12px rgba(0,0,0,.025)}.quick-action span{grid-row:span 2;font-size:1.35rem}.quick-action strong{font-size:.82rem}.quick-action small{font-size:.66rem;color:var(--muted)}.quick-action.primary{background:#eaf4ec;border-color:#d2e5d5;color:var(--brand)}.dashboard-section{margin:0 0 26px}.section-title>div h2{margin:3px 0 0}.text-button{border:0;background:none;color:var(--brand);font-weight:700;cursor:pointer}.cultivation-list{display:grid;gap:10px}.cultivation-card{background:#fff;border:1px solid var(--border);border-radius:16px;overflow:hidden;box-shadow:0 4px 16px rgba(0,0,0,.025)}.card-main{width:100%;border:0;background:transparent;text-align:left;padding:16px;cursor:pointer}.cultivation-head{display:flex;justify-content:space-between;gap:10px}.cultivation-head h3{margin:7px 0 3px}.cultivation-head p{margin:0;color:var(--muted);font-size:.75rem}.cultivation-day{font-weight:900;color:var(--brand);font-size:1.2rem}.status-pill{font-size:.66rem;font-weight:800;padding:5px 8px;border-radius:999px;display:inline-block}.status-pill.ok{background:#edf6ee;color:#347248}.status-pill.action{background:#eaf3ed;color:#24613c}.status-pill.ready{background:#fff2d9;color:#8a6418}.status-pill.warning{background:#fff4df;color:#956916}.status-pill.danger{background:#fdebea;color:#a03c36}.mini-progress{height:6px;background:#edf1ed;border-radius:99px;margin:15px 0 7px;overflow:hidden}.mini-progress span{height:100%;display:block;background:#4f9664;border-radius:99px}.cultivation-footer{display:flex;justify-content:space-between;font-size:.68rem;color:var(--muted)}.cultivation-footer strong{color:var(--brand)}.calendar-strip{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.calendar-day{position:relative;text-align:center;background:#fff;border:1px solid var(--border);border-radius:12px;padding:9px 3px;display:grid;gap:3px}.calendar-day.today{border-color:#8fc39c;background:#f1f8f2}.calendar-day span{font-size:.62rem;color:var(--muted);text-transform:capitalize}.calendar-day strong{font-size:1rem}.calendar-day small{font-size:.58rem;color:var(--muted)}.calendar-day em{font-style:normal;font-size:.65rem;position:absolute;right:3px;top:3px}.calendar-help{font-size:.65rem;color:var(--muted);text-align:right}.dashboard-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:26px}
/* V6.1 — espaçamento interno dos cards do dashboard */
.dashboard-grid > .card{padding:20px}
@media(max-width:700px){.dashboard-grid > .card{padding:16px}}.card{box-shadow:0 4px 18px rgba(0,0,0,.025)}.intelligence-card{min-height:180px}.insight-row{width:100%;display:grid;grid-template-columns:auto 1fr auto;gap:9px;align-items:center;border:0;border-top:1px solid var(--border);background:none;padding:10px 0;text-align:left;cursor:pointer}.insight-row:first-of-type{border-top:0}.insight-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:#f1f5f1}.insight-icon.warning{background:#fff4df}.insight-icon.danger{background:#fdebea}.insight-icon.ready{background:#fff2d9}.insight-row span:nth-child(2){display:grid}.insight-row small{font-size:.66rem;color:var(--muted);margin-top:2px}.insight-row b{font-size:1.2rem;color:#a4aea6}.good-state{display:grid;gap:4px;padding:14px 0;color:var(--brand)}.good-state span{font-size:.7rem;color:var(--muted)}.activity-list{display:grid}.activity-row{display:grid;grid-template-columns:auto 1fr auto;gap:9px;align-items:center;padding:10px 0;border-bottom:1px solid var(--border)}.activity-row:last-child{border:0}.activity-dot{font-size:.9rem}.activity-row div:nth-child(2){display:grid}.activity-row span,.activity-row time{font-size:.64rem;color:var(--muted)}.activity-row time{text-align:right}.tools-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.tool-card{border:1px solid var(--border);background:#fff;border-radius:14px;padding:15px;text-align:left;display:grid;gap:4px;cursor:pointer}.tool-card span{font-size:1.3rem}.tool-card strong{font-size:.8rem}.tool-card small{font-size:.64rem;color:var(--muted)}.empty-state{text-align:center;background:#fff;border:1px dashed #cbd9cd;border-radius:18px;padding:35px 20px}.empty-state>div{font-size:2.2rem}.empty-state h3{margin:10px 0 4px}.empty-state p{font-size:.76rem;color:var(--muted);max-width:400px;margin:0 auto 15px}.bottom-nav{position:fixed;z-index:100;bottom:0;left:0;right:0;height:64px;background:rgba(255,255,255,.95);backdrop-filter:blur(12px);border-top:1px solid var(--border);display:flex;justify-content:center;gap:6px;padding:5px 10px}.bottom-nav button{border:0;background:transparent;border-radius:12px;min-width:100px;color:#718078;display:grid;place-items:center;gap:1px;cursor:pointer}.bottom-nav button span{font-size:1.1rem}.bottom-nav button small{font-size:.6rem}.bottom-nav button.active{color:var(--brand);background:#edf6ee}.bottom-nav button:nth-child(3){background:#2f7b4f;color:#fff;margin-top:-13px;height:72px;border-radius:18px;box-shadow:0 8px 20px rgba(47,123,79,.25)}.bottom-nav button:nth-child(3) small{color:#fff}
@media(max-width:700px){.hero-orb{right:20px;top:25px;font-size:3rem}.today-hero{padding:22px}.dashboard-grid{grid-template-columns:1fr}.tools-grid{grid-template-columns:1fr 1fr}.quick-actions{grid-template-columns:1fr 1fr}.quick-action:last-child{grid-column:1/-1}.bottom-nav button{min-width:76px}}
@media(max-width:460px){.calendar-strip{gap:3px}.calendar-day{padding:8px 1px}.calendar-day strong{font-size:.9rem}.hero-orb{display:none}.tools-grid{grid-template-columns:1fr}.quick-actions{grid-template-columns:1fr 1fr}.quick-action:last-child{grid-column:auto}}

/* V6 — Inteligência agronômica */
.ai-insight{width:100%;display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:start;text-align:left;border:1px solid var(--border);background:#fff;border-radius:13px;padding:11px;margin-bottom:8px;cursor:pointer}.ai-icon{width:34px;height:34px;border-radius:10px;background:#f1f5f1;display:grid;place-items:center;font-size:1rem}.ai-body{display:grid;gap:3px}.ai-body strong{font-size:.78rem}.ai-body small{font-size:.62rem;color:var(--muted)}.ai-body em{font-style:normal;font-size:.68rem;line-height:1.4;color:#53625a}.ai-insight.danger{border-color:#ecc8c4;background:#fffafa}.ai-insight.warning{border-color:#ead8ad;background:#fffdf7}.ai-insight.ready{border-color:#e7d3a7;background:#fffaf0}.ai-insight.info{border-color:#d3e0e8;background:#fbfdff}.ai-insight.danger .ai-icon{background:#fdebea}.ai-insight.warning .ai-icon,.ai-insight.ready .ai-icon{background:#fff1d4}.ai-insight b{color:#9ba69f;font-size:1.2rem}.ai-detail-list{display:grid;gap:9px}.ai-detail{display:grid;grid-template-columns:36px 1fr;gap:10px;padding:11px;border-radius:12px;background:#f7f9f7}.ai-detail-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:9px;background:#fff}.ai-detail strong{font-size:.78rem}.ai-detail p{font-size:.7rem;line-height:1.45;margin:4px 0;color:#53625a}.ai-detail small{font-size:.6rem;color:var(--muted)}.ai-detail.danger{background:#fff5f4}.ai-detail.warning{background:#fff9ed}.ai-detail.ready{background:#fff8e9}.ai-detail.ok{background:#f1f8f2}

/* Fotos do cultivo */
.photo-field{padding:12px;border:1px solid var(--border,#d8e3d8);border-radius:14px;background:rgba(47,107,63,.05)}
.photo-field .meta{margin:.3rem 0 .7rem}
.photo-pick{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.photo-pick input{display:none}
.photo-preview{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px;min-width:0;overflow:hidden}
.photo-preview img{display:block;width:86px;height:86px;min-width:86px;min-height:86px;max-width:86px;max-height:86px;object-fit:cover;border-radius:10px;border:1px solid var(--border,#d8e3d8)}
.log-photos{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.log-photo{display:block;flex:0 0 86px;width:86px;height:86px;min-width:86px;min-height:86px;max-width:86px;max-height:86px;padding:0;border:0;background:none;cursor:pointer;border-radius:10px;overflow:hidden}
.log-photo img{display:block!important;width:86px!important;height:86px!important;min-width:86px!important;min-height:86px!important;max-width:86px!important;max-height:86px!important;aspect-ratio:1/1;object-fit:cover;border-radius:10px;border:1px solid var(--border,#d8e3d8)}
.log-photo:focus-visible{outline:2px solid var(--accent,#2f6b3f);outline-offset:2px}
