/* ---- Fast capture ---- */
.step-dot {
  display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 0.4rem; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 1rem; font-weight: 800; vertical-align: middle;
}
.capture-example { display: grid; gap: 0.2rem; margin-bottom: 1rem; padding: 0.8rem 1rem; border-radius: var(--radius); background: var(--tag-soft); color: #5a4300; }
.capture-example span { font-style: italic; }
.capture-text { font-size: 1.1rem; line-height: 1.5; min-height: 150px; }
.capture-live { margin: 0.5rem 0 0; color: var(--red); font-weight: 650; }
.capture-actions { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.dictate-btn { min-width: 150px; }
.dictate-btn.is-live { background: var(--red); border-color: var(--red); color: #fff; animation: pulse-red 1.4s ease-in-out infinite; }
@keyframes pulse-red { 0%, 100% { box-shadow: 0 0 0 0 rgb(192 50 42 / 0.45); } 50% { box-shadow: 0 0 0 10px rgb(192 50 42 / 0); } }

.page-full { max-width: 1500px; }
.capture-table .cell-input { min-height: 42px; padding: 0.3rem 0.55rem; min-width: 64px; width: 100%; }
.capture-table .cell-input.wide { min-width: 190px; }
.capture-table td { vertical-align: top; padding: 0.55rem 0.5rem; }
.capture-table td.right .cell-input { text-align: right; min-width: 78px; }
.capture-table .cell-select { min-height: 42px; width: 112px; padding: 0.3rem 0.5rem; }
.capture-table:not(.is-count) .col-match, .capture-table.is-count .col-new { display: none; }
.capture-table tr.act-skip td { opacity: 0.55; }
.capture-table tr.act-skip td:first-child, .capture-table tr.act-skip td:last-child { opacity: 1; }
.capture-table tr.has-flags td { background: #fffaea; }
.capture-table tr.has-error td { background: var(--red-soft); }
.capture-table .row-note { margin: 0.3rem 0 0; font-size: 0.86rem; line-height: 1.3; }
.capture-table .row-note-flag { color: var(--amber); font-weight: 600; }
.capture-table .row-note-error { color: var(--red); font-weight: 700; }
.code-cell { display: flex; gap: 0.2rem; align-items: center; }
.code-cell .cell-input { min-width: 120px; }
.capture-summary { font-weight: 700; color: var(--ink-2); }
.capture-review .sticky-actions { margin-top: 1rem; }
.capture-result { text-align: center; padding: 2.2rem 1.5rem; display: grid; justify-items: center; gap: 0.5rem; }
.capture-result h2 { font-size: 1.6rem; }

/* Barcode scanner dialog */
.scan-dialog { width: min(96vw, 560px); }
.scan-view { position: relative; margin: 1rem 0 0.6rem; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden; background: #0e1620; }
/* The video fills the box by absolute positioning (like the photo frame): Safari does not resolve height:100% inside an aspect-ratio box and the video collapses to nothing. */
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 3px; background: var(--red); box-shadow: 0 0 14px var(--red); animation: scan-sweep 1.8s ease-in-out infinite; }
@keyframes scan-sweep { 0%, 100% { transform: translateY(-60px); } 50% { transform: translateY(60px); } }
.scan-status { text-align: center; font-weight: 650; margin: 0 0 0.8rem; min-height: 1.5rem; }

/* ---- Complete (tablet): photo + barcode, one product at a time ---- */
.complete { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.complete-queue { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; }
.complete-queue-head { padding: 1rem 1.1rem 0.8rem; border-bottom: 1px solid var(--line); }
.complete-queue-head strong { display: block; font-size: 1.05rem; }
.complete-progress { height: 8px; border-radius: 99px; background: #e8edf1; margin-top: 0.6rem; overflow: hidden; }
.complete-progress > div { height: 100%; background: var(--green); transition: width 0.3s ease; }
.complete-list { overflow-y: auto; flex: 1; min-height: 0; }
.queue-item { display: flex; gap: 0.7rem; align-items: center; width: 100%; padding: 0.65rem 1rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; min-height: 60px; }
.queue-item:hover { background: #f6f8fa; }
.queue-item[aria-current="true"] { background: var(--green-soft); box-shadow: inset 4px 0 0 var(--green); }
.queue-item .q-name { flex: 1; min-width: 0; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.q-marks { display: flex; gap: 0.25rem; }
.q-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #e8edf1; color: var(--ink-3); }
.q-mark.ok { background: var(--green); color: #fff; }
.q-mark .icon { width: 14px; height: 14px; }

.complete-work { display: grid; gap: 1rem; min-width: 0; }
.complete-title { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.complete-title h2 { font-size: 1.7rem; }
.complete-meta { color: var(--ink-2); font-weight: 600; }
.complete-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.complete-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem; display: grid; gap: 0.8rem; align-content: start; }
.complete-card h3 { display: flex; align-items: center; gap: 0.5rem; }
.complete-card h3 .badge { margin-left: auto; }
.photo-frame { position: relative; aspect-ratio: 1; width: 100%; max-width: 440px; margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; background: #e8edf1; display: grid; place-items: center; }
.photo-frame img, .photo-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-frame .placeholder { color: var(--ink-3); display: grid; gap: 0.4rem; justify-items: center; text-align: center; padding: 1rem; }
.photo-frame .placeholder .icon { width: 3rem; height: 3rem; }
.photo-frame .guide { position: absolute; inset: 0; pointer-events: none; border: 3px solid rgb(255 255 255 / 0.9); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15); }
.photo-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 6px solid var(--ink); background: #fff; box-shadow: 0 0 0 3px #fff, var(--shadow); padding: 0; }
.shutter:active { transform: scale(0.94); }
.code-box { display: grid; gap: 0.7rem; }
.code-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: 0.04em; min-height: 2.2rem; }
.code-value.empty { color: var(--ink-3); font-size: 1.1rem; letter-spacing: 0; font-weight: 600; }
.code-view { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #0e1620; }
.code-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.complete-bar { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.complete-msg { min-height: 1.6rem; font-weight: 650; }
.complete-msg.bad { color: var(--red); }
.complete-msg.good { color: var(--green-dark); }
.complete-empty { text-align: center; padding: 3rem 1.5rem; }

@media (max-width: 1000px) {
  .complete { grid-template-columns: 1fr; }
  /* Phones and small tablets: a roomy list (about half the screen) with big, easy-to-tap rows. */
  .complete-queue { position: static; height: clamp(340px, 62dvh, 560px); max-height: none; }
  .queue-item { min-height: 68px; padding: 0.8rem 1.1rem; }
  .queue-item .q-name { font-size: 1.08rem; }
  .q-mark { width: 30px; height: 30px; }
  .q-mark .icon { width: 17px; height: 17px; }
  .queue-tools .input { min-height: 46px; }
  .queue-tools .btn { min-height: 46px; }
}

/* ---- Inventory team: home, intake, count ---- */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.work-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem; display: grid; gap: 1rem; align-content: start; }
.work-card header { display: flex; gap: 0.8rem; align-items: center; }
.work-card h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
.work-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 0; }
.work-stats div { background: var(--canvas); border-radius: var(--radius); padding: 0.6rem 0.8rem; }
.work-stats dt { color: var(--ink-2); font-size: 0.88rem; }
.work-stats dd { margin: 0; font-size: 1.5rem; font-weight: 700; }
.work-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Intake */
.intake-total { text-align: center; background: var(--green-soft); color: var(--green-dark); border-radius: var(--radius-lg); padding: 0.5rem 1.1rem; }
.intake-total .num { display: block; font-size: 2rem; font-weight: 750; line-height: 1.1; }
.intake-total small { font-weight: 650; }
.intake-card { display: grid; gap: 0.8rem; }
.intake-label { font-weight: 700; font-size: 1.05rem; }
.intake-row { display: flex; gap: 0.7rem; }
.intake-input { font-size: 1.25rem; min-height: 60px; }
.intake-row .dictate-btn { min-height: 60px; flex: none; }
.intake-save { min-height: 62px; font-size: 1.2rem; }
.intake-recent li { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 1.3rem; border-top: 1px solid var(--line); }
.intake-recent .r-name { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.intake-recent .r-price { color: var(--ink-2); font-weight: 650; }
.empty-note { padding: 1.2rem 1.3rem 1.4rem; color: var(--ink-3); margin: 0; }
.confirm-dialog { width: min(96vw, 500px); }
.confirm-dialog .intake-input { min-height: 56px; }
.dup-box { margin: 0.8rem 0 0; }
.intake-toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 60; background: var(--green); color: #fff; font-weight: 700;
  padding: 0.85rem 1.4rem; border-radius: 14px; box-shadow: var(--shadow-lift); animation: toast-in 0.2s ease-out;
}

/* Count */
.count-toolbar { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.4rem; }
.count-remaining { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 0.45rem 1.1rem; text-align: center; min-width: 110px; }
.count-remaining .num { display: block; font-size: 1.9rem; font-weight: 750; line-height: 1.1; }
.count-remaining small { color: #b9c6d2; font-weight: 600; }
.count-toolbar .search { min-width: 220px; }
.count-msg { min-height: 1.6rem; margin: 0.4rem 0 0.6rem; font-weight: 650; }
.count-msg.good { color: var(--green-dark); }
.count-msg.bad { color: var(--red); }
.count-list { display: grid; gap: 0.6rem; }
.count-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 150px auto; gap: 0.5rem 1rem; align-items: center;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 0.7rem 1rem;
}
.count-row[hidden] { display: none; }
.count-row.is-new { border-color: var(--tag); background: #fffdf3; }
.count-row.has-error { border-color: var(--red); background: #fffafa; }
.count-row .c-info { display: flex; gap: 0.5rem 0.8rem; align-items: center; flex-wrap: wrap; min-width: 0; }
.count-row .c-info strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.count-row .price-chip { background: var(--tag); color: var(--tag-ink); font-family: var(--font-display); font-weight: 700; padding: 0.05rem 0.55rem; border-radius: 6px 6px 6px 2px; }
.count-input { min-height: 54px; font-size: 1.4rem; font-weight: 700; text-align: center; }
.count-row .btn { min-height: 54px; min-width: 120px; }
.count-row .row-error { grid-column: 1 / -1; margin: 0; color: var(--red); font-weight: 650; }
@media (max-width: 700px) {
  .count-row { grid-template-columns: auto minmax(0, 1fr); }
  .count-input, .count-row .btn { grid-column: 1 / -1; }
}

/* Console: the inventory tools of a business */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.7rem; }
.tool-tile {
  display: grid; gap: 0.15rem; justify-items: start; padding: 0.9rem 1rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--ink); background: var(--surface); transition: border-color 0.12s, box-shadow 0.12s;
}
.tool-tile:hover { border-color: var(--ink); box-shadow: var(--shadow); text-decoration: none; }
.tool-tile .icon { width: 1.5rem; height: 1.5rem; color: var(--green); margin-bottom: 0.3rem; }
.tool-tile span { color: var(--ink-2); font-size: 0.9rem; }
.inventory-fieldset { border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.1rem; margin: 0 0 1.1rem; }
.inventory-fieldset legend { padding: 0 0.4rem; }
.queue-tools { display: grid; gap: 0.5rem; margin-top: 0.8rem; }
.queue-tools .input { min-height: 40px; }
.save-btn { min-width: 190px; min-height: 58px; font-size: 1.15rem; }

/* Intake: what the AI understood */
.ai-status { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; padding: 0.55rem 0.8rem; border-radius: var(--radius); background: var(--blue-soft); color: #153a96; font-weight: 600; font-size: 0.95rem; }
.ai-status:empty { display: none; }
.ai-status.is-busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 3px solid rgb(21 58 150 / 0.25); border-top-color: #153a96; animation: spin 0.8s linear infinite; }
.ai-status.is-low { background: var(--amber-soft); color: var(--amber); }
.ai-status.is-ok { background: var(--green-soft); color: var(--green-dark); }
.ai-status.is-plain { background: #eef2f5; color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.alt-box { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.alt-box .chip { min-height: 38px; }
