:root{--bg:#f7f7f2;--card:#fff;--ink:#1e211d;--muted:#72766e;--line:#e5e6df;--accent:#324f3a;--soft:#e9efe9;--danger:#9b3329;--warn:#9a6517;--radius:20px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;padding-bottom:92px}.top{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;align-items:center;padding:22px max(20px,calc((100vw - 920px)/2));background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(16px)}.eyebrow{font-size:12px;text-transform:uppercase;letter-spacing:.16em;color:var(--accent);font-weight:800}.top h1{font-size:28px;line-height:1.05;margin:3px 0 0}.icon{border:0;background:var(--card);border-radius:50%;width:42px;height:42px;font-size:22px;box-shadow:0 5px 18px #0000000b}main{max-width:920px;margin:auto;padding:4px 18px}.view{display:none}.view.active{display:block}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.stat{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:16px}.stat strong{display:block;font-size:28px}.stat span{font-size:12px;color:var(--muted)}.section-head{display:flex;align-items:end;justify-content:space-between;margin:28px 2px 10px}.section-head h2,.form-card h2,.camera-card h2{margin:0;font-size:18px}.link,.back{border:0;background:none;color:var(--accent);font-weight:700;padding:6px}.stack{display:grid;gap:10px}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:15px 16px;display:flex;gap:14px;align-items:center}.card-main{min-width:0;flex:1}.card h3{margin:0;font-size:16px}.meta{margin-top:5px;color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.qty{min-width:48px;text-align:center;font-size:20px;font-weight:800;color:var(--accent)}.badge{display:inline-block;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800;margin-top:8px;background:var(--soft);color:var(--accent)}.badge.danger{background:#f7e4e1;color:var(--danger)}.badge.warn{background:#f8ecd8;color:var(--warn)}.search{display:flex;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:0 14px;align-items:center;margin-bottom:14px}.search input{width:100%;border:0;outline:0;background:transparent;padding:14px;font:inherit}.form-card,.camera-card,.info{background:var(--card);border:1px solid var(--line);border-radius:24px;padding:20px;margin-bottom:14px}.camera-card{text-align:center}.camera-icon{font-size:42px}.camera-card p,.info{color:var(--muted);font-size:14px;line-height:1.5}.photo-preview{display:block;max-height:220px;max-width:100%;margin:14px auto 0;border-radius:16px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}label{display:block;font-size:12px;font-weight:800;color:#4f544c;margin:12px 0}input,select,textarea{width:100%;border:1px solid var(--line);background:#fbfbf8;border-radius:12px;padding:12px;margin-top:6px;font:inherit;color:var(--ink)}textarea{resize:vertical}hr{border:0;border-top:1px solid var(--line);margin:22px 0}.btn{display:inline-flex;justify-content:center;align-items:center;padding:13px 16px;border-radius:14px;border:0;font-weight:800;font:inherit;cursor:pointer}.primary{width:100%;background:var(--accent);color:#fff}.secondary{background:var(--soft);color:var(--accent)}.muted{color:var(--muted);font-weight:400}.bottom{position:fixed;z-index:20;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,700px);display:grid;grid-template-columns:repeat(4,1fr);padding:8px 10px calc(8px + env(safe-area-inset-bottom));background:#ffffffee;backdrop-filter:blur(18px);border:1px solid var(--line);border-bottom:0;border-radius:22px 22px 0 0}.bottom button{border:0;background:none;color:var(--muted);font-size:11px;font-weight:700}.bottom button span{display:block;font-size:24px;line-height:1.2}.bottom button.active{color:var(--accent)}.bottom .add-nav span{background:var(--accent);color:white;width:42px;height:42px;border-radius:50%;line-height:39px;margin:-18px auto 1px}.batch{display:grid;grid-template-columns:1fr auto;gap:12px;background:var(--card);border:1px solid var(--line);border-radius:18px;padding:15px;margin:10px 0}.batch-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.mini{border:1px solid var(--line);background:#fafaf7;border-radius:10px;padding:7px 10px;font-size:12px;font-weight:700}.detail-title{margin:10px 0 20px}.detail-title h2{font-size:28px;margin:0}.empty{text-align:center;color:var(--muted);padding:35px 12px;background:#ffffff80;border-radius:18px}#toast{position:fixed;z-index:50;left:50%;bottom:100px;transform:translate(-50%,20px);background:#1e211d;color:#fff;padding:11px 16px;border-radius:999px;font-size:13px;opacity:0;pointer-events:none;transition:.2s}#toast.show{opacity:1;transform:translate(-50%,0)}@media(max-width:650px){.stats{grid-template-columns:1fr 1fr}.grid2{grid-template-columns:1fr}.top{padding-left:20px;padding-right:20px}.stat strong{font-size:24px}}
.ocr-status{margin:12px auto 0;font-size:13px;color:var(--muted)}.ocr-text{margin-top:10px;min-height:90px}.camera-card #ocrBtn{margin-top:12px}
.capture-intro{margin:4px 2px 12px}.capture-intro h2{margin:0 0 5px}.capture-intro p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}.capture-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}.capture-card{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:14px;min-width:0}.capture-head{display:flex;align-items:center;gap:9px;margin-bottom:12px}.capture-head strong,.capture-head small{display:block}.capture-head small{font-size:11px;color:var(--muted);margin-top:2px}.capture-num{display:grid;place-items:center;flex:0 0 30px;height:30px;border-radius:50%;background:var(--soft);color:var(--accent);font-weight:900}.capture-card .btn{width:100%;font-size:12px;padding:11px 9px}.capture-preview{display:block;width:100%;height:150px;object-fit:cover;border-radius:13px;margin-top:10px;border:1px solid var(--line)}.mini.full{width:100%;margin-top:8px}.thumb{width:58px;height:58px;object-fit:cover;border-radius:13px;flex:0 0 58px;border:1px solid var(--line)}.thumb-empty{display:grid;place-items:center;background:var(--soft);font-size:24px}.qty small{display:block;font-size:10px;color:#777}.detail-hero{width:100%;max-height:330px;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:20px;margin:4px 0 14px}.mini-gallery{display:flex;gap:10px;overflow:auto;margin:12px 0 20px}.mini-gallery figure{margin:0;flex:0 0 130px}.mini-gallery img{width:130px;height:100px;object-fit:cover;border-radius:12px;border:1px solid var(--line)}.mini-gallery figcaption{font-size:11px;color:var(--muted);margin-top:4px}.batch-date-photo{width:82px;height:82px;object-fit:cover;border-radius:12px;border:1px solid var(--line);float:left;margin-right:12px;margin-bottom:8px}.badge.danger{font-weight:900}.priority-card .badge{white-space:normal}.info strong{color:var(--ink)}
@media(max-width:700px){.capture-grid{grid-template-columns:1fr}.capture-card{display:grid;grid-template-columns:1fr auto;gap:8px 12px;align-items:center}.capture-head{grid-column:1/-1;margin-bottom:2px}.capture-card .btn{width:auto}.capture-preview{grid-column:1/-1;height:180px}.capture-card .ocr-status,.capture-card .full{grid-column:1/-1}}


/* MiDespensa v0.2.2a */
.app-version{font-size:.85em;font-weight:700;letter-spacing:.05em;text-transform:none;opacity:.72}
.capture-card{overflow:hidden}.capture-preview{max-width:100%;object-position:center}
.capture-card[data-capture="product"] .capture-preview{height:180px;max-height:180px;object-fit:contain;background:#f7f7f2}
.capture-card[data-capture="date"] .capture-preview{height:130px;max-height:130px;object-fit:cover}
.capture-card[data-capture="barcode"] .capture-preview{height:110px;max-height:110px;object-fit:contain;background:#fff}
.vision-box{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:14px;margin:-2px 0 14px}.vision{width:100%;background:#263f78;color:#fff}.vision:disabled{opacity:.5}.vision-status{text-align:center;color:var(--muted);font-size:12px;margin-top:8px}
@media(max-width:700px){.capture-card[data-capture="product"] .capture-preview{height:170px;max-height:170px}.capture-card[data-capture="date"] .capture-preview{height:120px;max-height:120px}.capture-card[data-capture="barcode"] .capture-preview{height:100px;max-height:100px}}

/* MiDespensa v0.2.2b */
.mini.danger{border-color:#d9aaaa;color:#9b2f2f;background:#fff8f8}
.mini.danger:active{background:#f8e7e7}
.detail-title .danger{margin-top:12px}
.vision-box .btn.secondary{margin-top:10px}


/* MD-002 — Administration / Backup Manager */

.admin-grid{
  display:grid;
  gap:14px;
}

.admin-card{
  width:100%;
  border:1px solid #dedfd7;
  background:#fff;
  border-radius:22px;
  padding:20px;
  display:flex;
  align-items:center;
  gap:16px;
  text-align:left;
  font:inherit;
  cursor:pointer;
}

.admin-card strong{
  display:block;
  font-size:18px;
  color:#20221f;
}

.admin-card small{
  display:block;
  margin-top:4px;
  color:#777b72;
  font-size:14px;
}

.admin-icon{
  width:48px;
  height:48px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#eef3ec;
  color:#315a3d;
  font-size:24px;
  flex:0 0 auto;
}

.backup-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:18px 0;
}

.backup-status{
  min-height:24px;
  color:#657064;
  margin-bottom:12px;
}

.backup-row{
  background:#fff;
  border:1px solid #dedfd7;
  border-radius:18px;
  padding:16px 18px;
}

.backup-row strong{
  display:block;
  word-break:break-word;
}

@media(max-width:620px){
  .backup-actions{
    grid-template-columns:1fr;
  }

  .bottom button{
    font-size:11px;
  }
}
/* MD-002.1 — Direct Backup Download */
.backup-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.backup-info{min-width:0;flex:1}
.backup-download{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:0 16px;border:1px solid #315a3d;border-radius:14px;color:#315a3d;text-decoration:none;font-weight:700;white-space:nowrap;background:#fff}
.backup-download:hover{background:#eef3ec}
@media(max-width:620px){.backup-row{align-items:flex-start;flex-direction:column}.backup-download{width:100%}}