:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #2563eb;
  --danger: #b91c1c;
  --warn: #b45309;
  --ok: #15803d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --card: #1b1e24;
    --text: #e8eaed;
    --muted: #9aa1ab;
    --line: #2c3038;
    --accent: #60a5fa;
    --danger: #f87171;
    --warn: #fbbf24;
    --ok: #4ade80;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.35rem; margin: .4rem 0; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 64px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 8px 0; color: var(--text); }
.narrow { max-width: 380px; margin: 40px auto; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: .92rem; }
.error { color: var(--danger); }
.warn { color: var(--warn); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; align-items: center; }
.summary { display: flex; gap: 16px; flex-wrap: wrap; }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
label { display: block; margin: 6px 0; font-size: .92rem; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 3px; padding: 9px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
input[type=checkbox], input[type=radio] { display: inline; width: auto; margin: 0 6px 0 0; }
label.check { display: flex; align-items: center; color: var(--text); }
.btn { display: inline-block; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .5; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; padding: 0; cursor: pointer; }
.search { display: flex; gap: 8px; margin: 8px 0; }
.search input { margin: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.cols.tight { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.badge { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--text); white-space: nowrap; }
.badge.draft { background: #e5e7eb; color: #374151; }
.badge.sent { background: #fef3c7; color: #92400e; }
.badge.received { background: #dbeafe; color: #1e40af; }
.badge.ready { background: #dcfce7; color: #166534; }
.badge.picked_up { background: #f3f4f6; color: #4b5563; }
.badge.cancelled { background: #fee2e2; color: #991b1b; }
.badge.warnb { background: #fef3c7; color: #92400e; }
.badge.ret-ok { background: #dcfce7; color: #166534; }
.badge.ret-missing, .badge.ret-damaged { background: #fee2e2; color: #991b1b; }
.rol-card.status-ready { border-color: var(--ok); }
.facts div { padding: 3px 0; }
.facts span { display: inline-block; min-width: 130px; color: var(--muted); }
.grid { display: grid; gap: 8px; }
.piece, .item { display: flex; gap: 12px; align-items: flex-start; }
.piece img, .item img, .nophoto { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }
.nophoto { display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); font-size: .75rem; border: 1px dashed var(--line); }
.item-body { flex: 1; min-width: 0; }
.tagline code, legend code { font-weight: 700; }
.remarks { font-style: italic; }
.photo { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; margin-bottom: 8px; }
.pick { gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pick img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.gallery img, .gallery .nophoto { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; }
.receipt-item { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 8px 10px; }
.receipt-item legend { font-weight: 600; padding: 0 4px; }
.radios { display: flex; gap: 14px; flex-wrap: wrap; }
details > summary { cursor: pointer; list-style: none; }
details > summary h2 { display: inline; margin: 0; }
.events { padding-left: 18px; }
.events li { margin: 4px 0; }
.notes { white-space: pre-wrap; margin-top: 6px; }
