/* ============================================================================
   AMOMS — Operator Tablet (OPT · Gate & Logistics, Module 2)
   Landscape 1280 × 800. Touch-first (48px min targets). Layered on the AMOMS
   tokens (app.css → shadcn-tokens + amoms-tokens). Everything scoped .op-*.
   Brand-forward avocado primary, matching the Farmer field app family.
   ============================================================================ */

/* ---- Stage: centers + scales the tablet to fit any viewport ----------------
   Aligned with the admin-web shell: warm-bone surface, the shared avocado-leaf
   motif + soft top glow, plus a gentle vignette to seat the device. Theme-aware
   through the shared tokens (no hard-coded forest green). ---------------------*/
.op-stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #22291A;
  overflow: hidden;
}
.op-scaler { transform-origin: center center; flex-shrink: 0; }

/* ---- Operator-specific motif --------------------------------------------------
   The shared admin motif is baked at 6% opacity — nearly invisible on the tablet
   screen. Point the operator screen + stage at higher-contrast copies (16%) so
   the avocado motif actually reads, while leaving admin-web's SVGs untouched.
   Follows the same data-pattern switching (Motif / Fields / None). --------------*/
.op-screen { --pattern-bg: url('../../css/avocado-pattern-2.svg'); }
.dark .op-screen { --pattern-bg: url('../../css/avocado-pattern-2-dark.svg'); }
html[data-pattern="none"] .op-screen { --pattern-bg: none; }
html[data-pattern="mosaic"] .op-screen { --pattern-bg: url('../../css/pattern-mosaic.svg'); --pattern-size: 920px 395px; }
html.dark[data-pattern="mosaic"] .op-screen { --pattern-bg: url('../../css/pattern-mosaic-dark.svg'); }
html[data-pattern="botanical"] .op-screen { --pattern-bg: url('../../css/pattern-botanical.svg'); --pattern-size: 760px 760px; }
html.dark[data-pattern="botanical"] .op-screen { --pattern-bg: url('../../css/pattern-botanical-dark.svg'); }

/* ---- Device bezel (landscape tablet) --------------------------------------
   Thin, premium graphite frame with a subtle metallic gradient + a soft,
   warm-tinted elevation shadow so it reads as a real tablet floating on the
   admin surface — not a bulky black slab. --------------------------------------*/
.op-device {
  padding: 14px;
  background:
    linear-gradient(155deg, oklch(0.32 0.006 135), oklch(0.20 0.006 135) 52%, oklch(0.16 0.006 135));
  border-radius: 34px;
  position: relative;
  box-shadow:
    inset 0 0 0 1px oklch(1 0 0 / 0.05),
    inset 0 1.5px 0 oklch(1 0 0 / 0.14),
    inset 0 -1.5px 0 oklch(0 0 0 / 0.35),
    0 2px 4px oklch(0 0 0 / 0.18),
    0 44px 80px -30px oklch(0.30 0.05 135 / 0.40),
    0 24px 56px -34px oklch(0 0 0 / 0.45);
}
.dark .op-device {
  box-shadow:
    inset 0 0 0 1px oklch(1 0 0 / 0.06),
    inset 0 1.5px 0 oklch(1 0 0 / 0.10),
    0 2px 4px oklch(0 0 0 / 0.4),
    0 44px 90px -30px oklch(0 0 0 / 0.7),
    0 24px 56px -34px oklch(0 0 0 / 0.55);
}
/* front camera, centered on the top long edge */
.op-cam {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(0.26 0.01 135);
  box-shadow: inset 0 0 0 1.5px oklch(0.11 0.006 135), 0 0 0 1px oklch(1 0 0 / 0.04);
}

/* ---- Screen --------------------------------------------------------------- */
.op-screen {
  width: 1280px; height: 800px;
  background-color: var(--background);
  background-image:
    radial-gradient(ellipse 90% 58% at 50% -8%, var(--pattern-glow), transparent 60%),
    var(--pattern-bg);
  background-size: 100% 100%, var(--pattern-size);
  background-position: 0 0, 0 0;
  background-repeat: no-repeat, repeat;
  color: var(--foreground);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.06);
}

/* ---- Tablet OS status bar ------------------------------------------------- */
.op-osbar {
  flex-shrink: 0; height: 30px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--foreground); background: var(--card);
  position: relative; z-index: 30;
}
.op-osbar .op-os-time { font-variant-numeric: tabular-nums; }
.op-osbar .op-os-right { display: flex; align-items: center; gap: 8px; }
.op-osbar .op-os-batt { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.op-osbar svg { display: block; }

/* ---- Top app bar (C-102 tablet) ------------------------------------------- */
.op-appbar {
  flex-shrink: 0; height: 62px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: oklch(from var(--card) l c h / 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  position: relative; z-index: 20;
}
.op-ab-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.op-ab-mark {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(155deg, oklch(from var(--avocado) calc(l + 0.05) c h), var(--avocado)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.22), 0 2px 6px -2px oklch(from var(--avocado) l c h / 0.5);
}
.op-ab-mark::after {
  content: ""; position: absolute; right: -4px; bottom: -5px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--soil);
}
.op-ab-facility { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
.op-ab-gate { font-size: 11.5px; color: var(--muted-foreground); display: flex; align-items: center; gap: 5px; }
.op-ab-back {
  width: 44px; height: 44px; flex-shrink: 0; margin-left: -6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: none; background: transparent;
  color: var(--foreground); cursor: pointer;
}
.op-ab-back:hover { background: var(--accent); }
.op-ab-title { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.op-ab-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 1px; }
.op-ab-spacer { flex: 1; }
.op-ab-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* sync / network chip */
.op-sync {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 13px; border-radius: 9999px;
  border: 1px solid var(--border); background: var(--card);
  font-size: 12.5px; font-weight: 600; color: var(--muted-foreground);
  cursor: pointer;
}
.op-sync .op-sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.op-sync.offline { background: var(--system-offline); border-color: transparent; color: var(--system-offline-fg); }
.op-sync.offline .op-sync-dot { background: var(--warning); }

.op-ab-clock { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--foreground); padding: 0 4px; }
.op-ab-user { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 9999px; cursor: pointer; }
.op-ab-user:hover { background: var(--accent); }
.op-ab-user .op-au-name { font-size: 12.5px; font-weight: 600; line-height: 1.1; }
.op-ab-user .op-au-role { font-size: 11px; color: var(--muted-foreground); }

.op-iconbtn {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--card);
  color: var(--foreground); cursor: pointer; position: relative;
}
.op-iconbtn:hover { background: var(--accent); }
.op-iconbtn.ghost { border-color: transparent; background: transparent; }
.op-iconbtn.ghost:hover { background: var(--accent); }
.op-iconbtn .op-dot {
  position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--soil); border: 2px solid var(--card);
}

/* ---- Offline system banner ------------------------------------------------ */
.op-offline-bar {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 9px 22px; font-size: 13px; font-weight: 500;
  background: var(--system-offline); color: var(--system-offline-fg);
}
.op-offline-bar .op-ob-chev { margin-left: auto; opacity: 0.75; }

/* ---- Body ----------------------------------------------------------------- */
.op-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.op-body::-webkit-scrollbar { width: 9px; }
.op-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
.op-pad { padding: 20px 24px; }
.op-pad-lg { padding: 24px 28px; }

/* ---- Bottom tab bar — floating pill --------------------------------------- */
.op-tabbar-wrap {
  flex-shrink: 0;
  border-top: none;
  background: transparent;
  padding: 8px 20px 18px;
}
.op-tabbar {
  height: 64px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 112px;
  width: fit-content; max-width: 92%; margin: 0 auto;
  gap: 6px; padding: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: oklch(from var(--card) l c h / 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  box-shadow: var(--shadow-lg, 0 10px 30px -8px oklch(0 0 0 / 0.28));
}
.op-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted-foreground); position: relative;
  border-radius: 999px;
  transition: background-color .16s ease, color .16s ease;
}
.op-tab:hover:not(.on) { background: var(--accent); }
.op-tab .op-tab-label { font-size: 11px; font-weight: 600; letter-spacing: 0.01em; }
.op-tab.on {
  color: var(--avocado-fg);
  background: var(--avocado-soft);
}
.op-tab.on .op-tab-label { font-weight: 700; }
.op-tab .op-tab-badge {
  position: absolute; top: 6px; left: 50%; margin-left: 8px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--soil); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}

/* ---- Buttons (touch) ------------------------------------------------------ */
.op-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 52px; padding: 0 22px;
  border-radius: var(--radius-lg); border: 1px solid transparent;
  font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: filter .14s, background-color .14s, border-color .14s, opacity .14s;
}
.op-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.op-btn-primary {
  background: linear-gradient(180deg, oklch(from var(--avocado) calc(l + 0.035) c h) 0%, var(--avocado) 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.20),
    0 1px 2px oklch(from var(--avocado) calc(l - 0.2) c h / 0.42),
    0 8px 18px -8px oklch(from var(--avocado) l c h / 0.5);
}
.op-btn-primary:not(:disabled):hover { filter: brightness(1.05); }
.op-btn-primary:not(:disabled):active { transform: translateY(0.5px); filter: brightness(0.98); }
.op-btn-dark {
  background: var(--foreground); color: var(--background);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.12), 0 1px 2px oklch(0 0 0 / 0.22), 0 8px 18px -10px oklch(0 0 0 / 0.4);
}
.op-btn-dark:not(:disabled):hover { filter: brightness(1.12); }
.op-btn-outline { background: var(--card); border-color: var(--border); color: var(--foreground); box-shadow: var(--shadow-xs); }
.op-btn-outline:hover { background: var(--accent); }
.op-btn-ghost { background: transparent; color: var(--foreground); }
.op-btn-ghost:hover { background: var(--accent); }
.op-btn-destructive { background: transparent; color: var(--destructive); border-color: oklch(from var(--destructive) l c h / 0.45); }
.op-btn-destructive:hover { background: oklch(from var(--destructive) l c h / 0.08); }
.op-btn-soft { background: var(--avocado-soft); color: var(--avocado-fg); }
.op-btn-hero { height: 72px; font-size: 19px; border-radius: var(--radius-xl); gap: 12px; }
.op-btn-hero.op-btn-primary {
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.22),
    0 2px 4px oklch(from var(--avocado) calc(l - 0.2) c h / 0.38),
    0 18px 38px -16px oklch(from var(--avocado) l c h / 0.6);
}
.op-btn-hero.op-btn-primary:not(:disabled):hover {
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.22),
    0 3px 6px oklch(from var(--avocado) calc(l - 0.2) c h / 0.34),
    0 22px 46px -16px oklch(from var(--avocado) l c h / 0.66);
}
.op-btn-lg { height: 60px; font-size: 16px; }
.op-btn-sm { height: 42px; font-size: 13.5px; padding: 0 16px; gap: 7px; }
.op-btn-block { width: 100%; }
.op-btn .op-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid oklch(1 0 0 / 0.4); border-top-color: #fff; animation: op-spin .7s linear infinite; }
@keyframes op-spin { to { transform: rotate(360deg); } }

/* ---- Sticky bottom action bar --------------------------------------------- */
.op-actionbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  position: sticky; bottom: 0; z-index: 30; margin-top: auto;
  border-top: 1px solid var(--border);
  background: oklch(from var(--background) l c h / 0.94);
  backdrop-filter: saturate(160%) blur(10px);
}
.op-actionbar .op-ab-grow { flex: 1; }
.op-actionbar.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; min-height: 92px; background: var(--card); box-shadow: 0 -6px 22px -8px oklch(0 0 0 / 0.2); animation: zoom-in .12s ease-out; }
.dark .op-actionbar.dock { box-shadow: 0 -6px 22px -8px oklch(0 0 0 / 0.5); }

/* ---- Cards ---------------------------------------------------------------- */
.op-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: 0 1px 2px oklch(0 0 0 / 0.04), 0 3px 8px -3px oklch(0 0 0 / 0.06); }
.dark .op-card { box-shadow: 0 1px 2px oklch(0 0 0 / 0.2), 0 3px 10px -3px oklch(0 0 0 / 0.3); }
.op-card.flush { overflow: hidden; }
.op-card-pad { padding: 18px; }
.op-card-head { padding: 16px 18px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.op-card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.op-card-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; }
.op-card-body { padding: 0 18px 18px; }

/* ---- Section labels ------------------------------------------------------- */
.op-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 11px; }
.op-sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-foreground); }
.op-sec-link { font-size: 12.5px; font-weight: 600; color: var(--avocado-fg); cursor: pointer; background: none; border: 0; padding: 0; font-family: inherit; }
.op-sec-link:hover { text-decoration: underline; }

/* ---- KPI tiles (C-110) ---------------------------------------------------- */
.op-kpi { padding: 15px 17px; display: flex; align-items: center; gap: 13px; }
.op-kpi-ic { width: 46px; height: 46px; flex-shrink: 0; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: var(--avocado-soft); color: var(--avocado-fg); }
.op-kpi-txt { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.op-kpi-label { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.op-kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1; font-variant-numeric: tabular-nums; }
.op-kpi-value small { font-size: 15px; font-weight: 500; color: var(--muted-foreground); margin-left: 3px; }
.op-kpi.clickable { cursor: pointer; transition: border-color .14s, box-shadow .14s; }
.op-kpi.clickable:hover { border-color: oklch(from var(--avocado) l c h / 0.5); box-shadow: 0 1px 2px oklch(0 0 0 / 0.04), 0 10px 22px -10px oklch(from var(--avocado) l c h / 0.28); }
.op-kpi.warn { border-color: oklch(from var(--status-pending) l c h / 0.45); background: linear-gradient(180deg, var(--status-pending-soft), var(--card) 65%); }
.op-kpi.warn .op-kpi-ic { background: oklch(from var(--status-pending) l c h / 0.18); color: var(--status-pending-fg); }

/* ---- List rows (expected / on-site) --------------------------------------- */
.op-list { display: flex; flex-direction: column; }
.op-row {
  display: flex; align-items: center; gap: 13px; padding: 13px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; background: var(--card);
  text-align: left; border-left: none; border-right: none; border-top: none; width: 100%;
}
.op-row:last-child { border-bottom: none; }
.op-row:hover { background: var(--accent); }
.op-row.amber { background: var(--status-pending-soft); }
.op-row.amber:hover { filter: brightness(0.98); }
.op-row-thumb {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--avocado-soft); color: var(--avocado-fg);
}
.op-row-thumb.soil { background: var(--soil-soft); color: var(--soil-fg); }
.op-row-thumb.pulp { background: var(--pulp-soft); color: var(--pulp-fg); }
.op-row-body { flex: 1; min-width: 0; }
.op-row-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.op-row-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 1px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.op-row-meta { text-align: right; flex-shrink: 0; }
.op-mono { font-family: var(--font-mono); }
.op-gpn { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.01em; }
/* Incoming (per-truck) vs batch QC provenance tag \u2014 subtle, token-driven */
.op-kind-tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; border: 1px solid var(--border); background: var(--surface); color: var(--muted-foreground); }
.op-kind-tag.in { color: var(--info-fg); border-color: color-mix(in oklch, var(--info-fg) 30%, transparent); background: color-mix(in oklch, var(--info-fg) 8%, var(--card)); }

/* ---- Data table (C-201) --------------------------------------------------- */
.op-tbl-wrap { overflow-x: auto; border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--card); box-shadow: 0 1px 2px oklch(0 0 0 / 0.04), 0 3px 8px -3px oklch(0 0 0 / 0.06); }
.op-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.op-tbl thead th {
  text-align: left; font-weight: 600; color: var(--muted-foreground);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.op-tbl tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.op-tbl tbody tr { cursor: pointer; }
.op-tbl tbody tr:hover { background: var(--accent); }
.op-tbl tbody tr:last-child td { border-bottom: none; }
.op-tbl tbody tr.selected { background: var(--avocado-soft); }
.op-tbl .num { font-variant-numeric: tabular-nums; }

/* ---- Filter chips --------------------------------------------------------- */
.op-chips { display: flex; gap: 9px; flex-wrap: wrap; }
.op-chip {
  height: 40px; padding: 0 16px; display: inline-flex; align-items: center; gap: 7px;
  border-radius: 9999px; border: 1px solid var(--border); background: var(--card);
  color: var(--foreground); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.op-chip:hover { background: var(--accent); }
.op-chip.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.op-chip-count { font-variant-numeric: tabular-nums; opacity: 0.6; font-weight: 600; }

/* ---- Inputs --------------------------------------------------------------- */
.op-field { margin-bottom: 16px; }
.op-label { font-size: 13px; font-weight: 600; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.op-label .req { color: var(--soil); }
.op-input, .op-select, .op-textarea {
  width: 100%; height: 50px; padding: 0 15px;
  border: 1px solid var(--input); border-radius: var(--radius-lg);
  background: var(--card); font-size: 15px; color: var(--foreground); box-shadow: var(--shadow-xs);
}
.op-textarea { height: auto; min-height: 84px; padding: 13px 15px; line-height: 1.5; resize: none; }
.op-input::placeholder, .op-textarea::placeholder { color: var(--muted-foreground); }
.op-input:focus, .op-select:focus, .op-textarea:focus {
  outline: none; border-color: var(--avocado);
  box-shadow: 0 0 0 3px oklch(from var(--avocado) l c h / 0.18), var(--shadow-xs);
}
.op-input.err, .op-select.err { border-color: var(--destructive); box-shadow: 0 0 0 3px oklch(from var(--destructive) l c h / 0.14); }
.op-hint { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; line-height: 1.4; }
.op-err { font-size: 12px; color: var(--destructive); margin-top: 6px; display: flex; align-items: flex-start; gap: 5px; line-height: 1.4; }
.op-err > svg { flex-shrink: 0; margin-top: 1px; }
.op-select-wrap { position: relative; }
.op-select { appearance: none; padding-right: 42px; }
.op-select-wrap .op-select-chev { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.op-search { position: relative; }
.op-search .op-search-ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.op-search .op-input { padding-left: 42px; }

/* search input within a header (shorter) */
.op-search.sm .op-input { height: 44px; }

/* ---- Big number / weight input (C-004 / C-118) ---------------------------- */
.op-num {
  display: flex; align-items: center; height: 88px; border: 1.5px solid var(--input);
  border-radius: var(--radius-xl); background: var(--card); overflow: hidden; box-shadow: var(--shadow-xs);
}
.op-num:focus-within { border-color: var(--avocado); box-shadow: 0 0 0 3px oklch(from var(--avocado) l c h / 0.18); }
.op-num-btn { width: 72px; height: 100%; flex-shrink: 0; border: none; background: var(--surface); font-size: 30px; color: var(--muted-foreground); cursor: pointer; }
.op-num-btn:hover { background: var(--accent); color: var(--foreground); }
.op-num-input { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; text-align: center; font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; outline: none; color: var(--foreground); }
.op-num-suffix { font-size: 15px; color: var(--muted-foreground); padding: 0 20px; white-space: nowrap; border-left: 1px solid var(--border); height: 50%; display: flex; align-items: center; font-weight: 600; }

/* net weight display */
.op-bignum { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.op-bignum b { font-size: 48px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.op-bignum span { font-size: 18px; color: var(--muted-foreground); font-weight: 600; }

/* ---- Toggle switch (anti-fraud) ------------------------------------------- */
.op-toggle-row { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); cursor: pointer; }
.op-toggle-row.on { border-color: var(--avocado); background: var(--avocado-soft); }
.op-toggle-row .op-tr-body { flex: 1; min-width: 0; }
.op-toggle-row .op-tr-title { font-size: 14.5px; font-weight: 600; }
.op-toggle-row .op-tr-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; line-height: 1.4; }
.op-switch { width: 52px; height: 30px; background: var(--muted); border-radius: 9999px; position: relative; flex-shrink: 0; transition: background-color .2s; }
.op-switch.on { background: var(--avocado); }
.op-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow-sm); }
.op-switch.on::after { transform: translateX(22px); }

/* ---- Photo capture tile (C-011) ------------------------------------------- */
.op-phototile {
  position: relative; border: 2px dashed var(--input); border-radius: var(--radius-xl);
  background: var(--surface); cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted-foreground); transition: border-color .14s, background-color .14s; text-align: center; padding: 16px;
}
.op-phototile:hover { border-color: var(--avocado); background: var(--avocado-soft); color: var(--avocado-fg); }
.op-phototile.filled { border-style: solid; border-color: var(--border); background: #111; padding: 0; }
.op-phototile .op-pt-label { font-size: 13px; font-weight: 600; }
.op-phototile .op-pt-hint { font-size: 11.5px; opacity: 0.8; }
.op-phototile .op-pt-img {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, oklch(0.30 0.01 130) 0 11px, oklch(0.26 0.01 130) 11px 22px);
}
.op-phototile .op-pt-tag {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  background: oklch(0 0 0 / 0.6); color: #fff; font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 9999px; font-family: var(--font-mono);
}
.op-phototile .op-pt-retake {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  background: oklch(0 0 0 / 0.6); color: #fff; font-size: 11.5px; font-weight: 600;
  padding: 6px 11px; border-radius: 9999px; border: none; cursor: pointer;
}
.op-phototile .op-pt-check { position: absolute; right: 10px; top: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; background: var(--success); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

/* ---- Banners (C-106) ------------------------------------------------------ */
.op-banner { display: flex; gap: 12px; padding: 14px 16px; align-items: flex-start; border-radius: var(--radius-lg); border: 1px solid var(--border); font-size: 13.5px; background: var(--card); }
.op-banner .op-banner-ic { flex-shrink: 0; margin-top: 1px; }
.op-banner .op-banner-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.op-banner .op-banner-desc { color: var(--muted-foreground); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.op-banner-success { background: var(--success-soft); border-color: oklch(from var(--success) l c h / 0.3); }
.op-banner-success .op-banner-ic { color: var(--success-fg); }
.op-banner-warning { background: var(--warning-soft); border-color: oklch(from var(--warning) l c h / 0.3); }
.op-banner-warning .op-banner-ic { color: var(--warning-fg); }
.op-banner-info { background: var(--info-soft); border-color: oklch(from var(--info) l c h / 0.3); }
.op-banner-info .op-banner-ic { color: var(--info-fg); }
.op-banner-danger { background: var(--danger-soft); border-color: oklch(from var(--destructive) l c h / 0.3); }
.op-banner-danger .op-banner-ic { color: var(--danger-fg); }
.op-banner-soil { background: var(--soil-soft); border-color: oklch(from var(--soil) l c h / 0.3); }
.op-banner-soil .op-banner-ic { color: var(--soil-fg); }
.op-banner-neutral { background: var(--muted); }
.dark .op-banner { color: var(--foreground); }
.dark .op-banner-warning { background: oklch(0.24 0.05 70); border-color: oklch(0.40 0.09 70 / 0.45); }
.dark .op-banner-success { background: oklch(0.22 0.05 140); border-color: oklch(0.36 0.08 140 / 0.45); }
.dark .op-banner-info { background: oklch(0.24 0.05 230); border-color: oklch(0.38 0.09 230 / 0.45); }
.dark .op-banner-soil { background: oklch(0.24 0.04 55); }

/* status strip (full-width, top of result screens) */
.op-strip { display: flex; align-items: center; gap: 13px; padding: 18px 24px; color: #fff; }
.op-strip .op-strip-ic { width: 40px; height: 40px; border-radius: 11px; background: oklch(1 0 0 / 0.18); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.op-strip .op-strip-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.op-strip .op-strip-sub { font-size: 13px; opacity: 0.9; margin-top: 1px; }
.op-strip.success { background: var(--success); }
.op-strip.danger { background: var(--destructive); }
.op-strip.warning { background: oklch(0.62 0.15 70); }

/* ---- Status / detail rows ------------------------------------------------- */
.op-srow { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.op-srow:last-child { border-bottom: none; }
.op-srow .k { font-size: 13px; color: var(--muted-foreground); display: flex; align-items: center; gap: 8px; }
.op-srow .v { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.op-srow .v small { font-weight: 500; color: var(--muted-foreground); font-size: 12px; }

/* ---- Verification checklist card (C-009 large) ---------------------------- */
.op-check-card { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); }
.op-check-card.match { border-color: oklch(from var(--success) l c h / 0.5); background: var(--success-soft); }
.op-check-card.fail { border-color: oklch(from var(--destructive) l c h / 0.5); background: oklch(0.97 0.02 25); }
.dark .op-check-card.fail { background: oklch(0.26 0.05 25); }
.op-check-thumb { width: 64px; height: 64px; border-radius: var(--radius-lg); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--muted); color: var(--muted-foreground); overflow: hidden; }
.op-check-num { width: 26px; height: 26px; border-radius: 50%; background: var(--foreground); color: var(--background); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.op-check-toggle { display: flex; gap: 8px; flex-shrink: 0; }
.op-mbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 48px; padding: 0 18px;
  border-radius: var(--radius-lg); border: 1.5px solid var(--border); background: var(--card);
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--foreground);
}
.op-mbtn:hover { background: var(--accent); }
.op-mbtn.match.on { background: var(--success); border-color: var(--success); color: #fff; }
.op-mbtn.fail.on { background: var(--destructive); border-color: var(--destructive); color: #fff; }

/* ---- QR display (C-116) --------------------------------------------------- */
.op-qr { border-radius: var(--radius-lg); background: #fff; padding: 16px; box-shadow: var(--shadow-md); }
.op-qr svg { display: block; width: 100%; height: 100%; }

/* ---- Scanner viewport (C-117) --------------------------------------------- */
.op-scanner { position: absolute; inset: 0; background: #0c0f0c; display: flex; flex-direction: column; }
.op-scanner-feed {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 60% at 50% 42%, oklch(0.34 0.02 130 / 0.6), transparent),
    repeating-linear-gradient(115deg, oklch(0.18 0.01 130) 0 26px, oklch(0.21 0.012 130) 26px 52px);
}
.op-scanner-overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; }
.op-scan-topbar { display: flex; align-items: center; gap: 14px; padding: 18px 22px; color: #fff; }
.op-scan-topbar .op-scan-title { font-size: 17px; font-weight: 600; flex: 1; }
.op-scan-iconbtn { width: 48px; height: 48px; border-radius: 14px; border: 1px solid oklch(1 0 0 / 0.2); background: oklch(1 0 0 / 0.1); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.op-scan-iconbtn.on { background: var(--pulp); border-color: var(--pulp); color: oklch(0.30 0.06 90); }
.op-scan-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.op-scan-frame { width: 300px; height: 300px; position: relative; box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12); border-radius: 10px; }
.op-scan-corner { position: absolute; width: 54px; height: 54px; border: 4px solid #fff; border-radius: 8px; }
.op-scan-corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.op-scan-corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.op-scan-corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.op-scan-corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.op-scan-laser { position: absolute; left: 8px; right: 8px; height: 3px; background: linear-gradient(90deg, transparent, var(--avocado), transparent); top: 10%; animation: op-scan 2.4s ease-in-out infinite; box-shadow: 0 0 14px 2px oklch(from var(--avocado) l c h / 0.6); }
@keyframes op-scan { 0%,100% { top: 8%; } 50% { top: 90%; } }
.op-scan-hint { color: oklch(0.96 0.01 80); font-size: 15px; font-weight: 500; text-align: center; max-width: 380px; }
.op-scan-bottom { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.op-scan-link { color: #fff; font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; background: none; border: none; }
.op-scan-status { display: inline-flex; align-items: center; gap: 9px; color: oklch(0.96 0.01 80); font-size: 14px; font-weight: 500; }
.op-scan-status .op-spin { border-color: oklch(1 0 0 / 0.3); border-top-color: #fff; }

/* ---- Full-screen success / centered states -------------------------------- */
.op-success { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; }
.op-success-ring { width: 84px; height: 84px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; animation: op-pop .4s cubic-bezier(.2,.8,.3,1.2); }
@keyframes op-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- Empty state (C-105) -------------------------------------------------- */
.op-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 36px; }
.op-empty-art { width: 104px; height: 104px; border-radius: 28px; margin-bottom: 18px; background: var(--muted); display: inline-flex; align-items: center; justify-content: center; color: var(--muted-foreground); }
.op-empty-title { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.op-empty-desc { font-size: 14px; color: var(--muted-foreground); line-height: 1.55; max-width: 380px; margin-top: 8px; }

/* ---- Timeline (C-123) ----------------------------------------------------- */
.op-timeline { position: relative; padding-left: 6px; }
.op-tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.op-tl-item:last-child { padding-bottom: 0; }
.op-tl-rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.op-tl-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--avocado-soft); color: var(--avocado-fg); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
.op-tl-dot.muted { background: var(--muted); color: var(--muted-foreground); }
.op-tl-dot.danger { background: var(--status-rejected-soft); color: var(--status-rejected-fg); }
.op-tl-dot.warning { background: var(--status-pending-soft); color: var(--status-pending-fg); }
.op-tl-line { flex: 1; width: 2px; background: var(--border); margin: 4px 0; min-height: 14px; }
.op-tl-body { flex: 1; min-width: 0; padding-bottom: 2px; }
.op-tl-time { font-size: 11.5px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.op-tl-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; margin-top: 1px; }
.op-tl-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; line-height: 1.45; }

/* ---- Tabs (in-page) ------------------------------------------------------- */
.op-tabs { display: inline-flex; background: var(--muted); padding: 4px; border-radius: var(--radius-md); gap: 2px; }
.op-tabs button { background: transparent; border: none; font: inherit; font-size: 13.5px; font-weight: 600; height: 38px; padding: 0 18px; border-radius: 7px; color: var(--muted-foreground); cursor: pointer; white-space: nowrap; }
.op-tabs button.on { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-xs); }

/* ---- Stepper (C-124) ------------------------------------------------------ */
.op-stepper { display: flex; align-items: center; gap: 8px; }
.op-step-pip { display: flex; align-items: center; gap: 8px; }
.op-step-num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--muted-foreground); }
.op-step-pip.done .op-step-num { background: var(--avocado); border-color: var(--avocado); color: #fff; }
.op-step-pip.cur .op-step-num { border-color: var(--avocado); color: var(--avocado-fg); }
.op-step-label { font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.op-step-pip.cur .op-step-label, .op-step-pip.done .op-step-label { color: var(--foreground); }
.op-step-sep { width: 28px; height: 2px; background: var(--border); border-radius: 2px; }
.op-step-sep.done { background: var(--avocado); }

/* ---- Modal (centered overlay) --------------------------------------------- */
.op-modal-scrim { position: absolute; inset: 0; background: oklch(0 0 0 / 0.5); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 40px; animation: op-fade .15s ease; }
@keyframes op-fade { from { opacity: 0; } to { opacity: 1; } }
.op-modal { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-2xl); box-shadow: var(--shadow-2xl); padding: 24px; animation: op-pop .18s ease; }
.op-modal.wide { max-width: 620px; }
.op-modal h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
.op-modal p { font-size: 13.5px; color: var(--muted-foreground); line-height: 1.5; margin: 0 0 18px; }
.op-modal-actions { display: flex; gap: 10px; margin-top: 18px; }

/* PIN entry */
.op-pin { display: flex; gap: 12px; justify-content: center; }
.op-pin-cell { width: 56px; height: 64px; border: 1.5px solid var(--input); border-radius: var(--radius-lg); background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; box-shadow: var(--shadow-xs); }
.op-pin-cell.filled { border-color: var(--avocado); }
.op-pin-cell.cursor { border-color: var(--avocado); box-shadow: 0 0 0 3px oklch(from var(--avocado) l c h / 0.18); }

/* ---- Toast ---------------------------------------------------------------- */
.op-toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 70; background: var(--foreground); color: var(--background); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; align-items: center; gap: 11px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-xl); animation: op-pop .24s ease; }

/* ---- Photo viewer (C-11 viewer) ------------------------------------------- */
.op-viewer { position: absolute; inset: 0; background: #0b0d0b; display: flex; flex-direction: column; z-index: 1; }
.op-viewer-top { display: flex; align-items: center; gap: 14px; padding: 16px 22px; color: #fff; background: oklch(0 0 0 / 0.4); position: relative; z-index: 3; }
.op-viewer-top .op-vt-body { flex: 1; min-width: 0; }
.op-viewer-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 0; }
.op-viewer-photo { width: min(560px, 80%); aspect-ratio: 4/3; border-radius: var(--radius-lg); background: repeating-linear-gradient(135deg, oklch(0.92 0.01 90) 0 28px, oklch(0.86 0.01 90) 28px 56px); box-shadow: var(--shadow-2xl); position: relative; overflow: hidden; }
.op-viewer-meta { position: absolute; left: 22px; bottom: 22px; right: 22px; z-index: 3; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; color: #fff; }
.op-viewer-nav { width: 52px; height: 52px; border-radius: 50%; background: oklch(1 0 0 / 0.14); border: 1px solid oklch(1 0 0 / 0.2); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.op-viewer-nav:hover { background: oklch(1 0 0 / 0.24); }

/* ---- Misc ----------------------------------------------------------------- */
.op-divider { height: 1px; background: var(--border); margin: 16px 0; }
.op-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.op-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.op-muted { color: var(--muted-foreground); }
.op-dwell { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.op-dwell.amber { color: var(--warning-fg); }
.op-dwell.red { color: var(--destructive); }
.op-skel { background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-sheen) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; animation: op-shim 1.4s infinite; border-radius: 7px; }
@keyframes op-shim { to { background-position: -200% 0; } }
