/* The scan workspace follows the store administration page without changing the portal shell. */
#scanRoot.scan-workspace {
  --scan-ink: #17272c;
  --scan-muted: #7d8c8f;
  --scan-line: #e3ecea;
  --scan-teal: #168e89;
  min-width: 0;
  padding: 24px;
  border-radius: 8px;
  background: #f3f7f6;
  color: var(--scan-ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

#scanRoot.scan-workspace .scan-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 24px;
  margin-bottom: 22px;
}
#scanRoot.scan-workspace .scan-heading { flex: 1 0 210px; min-width: 0; }
#scanRoot.scan-workspace .scan-eyebrow {
  margin: 0 0 9px;
  color: #7d9697;
  font: 600 10px/1.5 Consolas, monospace;
  letter-spacing: .08em;
}
#scanRoot.scan-workspace .scan-heading h2 {
  margin: 0;
  color: var(--scan-ink);
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
}
#scanRoot.scan-workspace .scan-heading p:not(.scan-eyebrow) {
  margin: 8px 0 0;
  color: var(--scan-muted);
  font-size: 12px;
  line-height: 1.6;
}
#scanRoot.scan-workspace .scan-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}
#scanRoot.scan-workspace .scan-toolbar label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--scan-muted);
  font-size: 10px;
  font-weight: 400;
}
#scanRoot.scan-workspace .scan-toolbar input,
#scanRoot.scan-workspace .scan-toolbar select {
  width: auto;
  min-width: 105px;
  max-width: 185px;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #d7e4e1;
  border-radius: 5px;
  background: #fff;
  color: var(--scan-ink);
  font-size: 12px;
  box-shadow: none;
}
#scanRoot.scan-workspace .scan-toolbar input[type="date"] { min-width: 130px; }
#scanRoot.scan-workspace button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  height: auto;
  padding: 0 13px;
  border: 1px solid #c8e3df;
  border-radius: 5px;
  background: #fff;
  color: var(--scan-teal);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
  white-space: nowrap;
}
#scanRoot.scan-workspace button:hover { background: #e4f5f2; }
#scanRoot.scan-workspace button.primary {
  border-color: var(--scan-teal);
  background: var(--scan-teal);
  color: #fff;
}
#scanRoot.scan-workspace button.primary:hover { background: #127873; }
#scanRoot.scan-workspace button:disabled { opacity: .55; cursor: not-allowed; }
#scanRoot.scan-workspace button svg { width: 15px; height: 15px; }
#scanRoot.scan-workspace :is(button, input, select, [tabindex]):focus-visible {
  outline: 2px solid #5cbbb3;
  outline-offset: 2px;
}

#scanRoot.scan-workspace .scan-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
#scanRoot.scan-workspace :is(.scan-store-panel, .scan-detail-panel, .scan-summary-card) {
  min-width: 0;
  border: 1px solid var(--scan-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(25, 55, 57, .06);
}
#scanRoot.scan-workspace :is(.scan-store-panel, .scan-detail-panel) { padding: 19px 20px; }
#scanRoot.scan-workspace :is(.scan-panel-head, .scan-detail-head) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}
#scanRoot.scan-workspace :is(.scan-panel-head, .scan-detail-head) h3 {
  margin: 0;
  color: var(--scan-ink);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}
#scanRoot.scan-workspace :is(.scan-panel-head, .scan-detail-head) small,
#scanRoot.scan-workspace .scan-detail-head > p {
  margin: 0;
  color: var(--scan-muted);
  font-size: 11px;
  line-height: 1.7;
}
#scanRoot.scan-workspace .scan-panel-head > small { flex-shrink: 0; }
#scanRoot.scan-workspace .scan-detail-head > p { flex: 1 1 55%; overflow-wrap: anywhere; }
#scanRoot.scan-workspace .table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 0;
  border-radius: 0;
  scrollbar-width: thin;
  scrollbar-color: #bccac7 #f5f8f7;
}
#scanRoot.scan-workspace table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
  text-align: left;
  white-space: normal;
}
#scanRoot.scan-workspace .scan-stores-table { min-width: 620px; }
#scanRoot.scan-workspace .scan-products-table { min-width: 470px; }
#scanRoot.scan-workspace .scan-records-table { min-width: 600px; }
#scanRoot.scan-workspace table th,
#scanRoot.scan-workspace table td {
  position: static;
  height: auto;
  border: 0;
  border-bottom: 1px solid #eef3f2;
  text-align: left;
  box-shadow: none;
  background: transparent;
}
#scanRoot.scan-workspace table th {
  padding: 0 10px 10px;
  border-bottom-color: var(--scan-line);
  color: #8b9a9b;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
#scanRoot.scan-workspace table td {
  padding: 13px 10px;
  color: var(--scan-ink);
  font-size: 12px;
  line-height: 1.6;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
#scanRoot.scan-workspace table tbody tr:hover td { background: transparent; }
#scanRoot.scan-workspace .scan-stores-table tbody tr { cursor: pointer; }
#scanRoot.scan-workspace .scan-stores-table tbody tr:hover { background: #f7fbfa; }
#scanRoot.scan-workspace .scan-stores-table .scan-row-selected { background: #eaf7f4; }
#scanRoot.scan-workspace .scan-stores-table .scan-row-unscanned { background: #fff8f4; }
#scanRoot.scan-workspace .scan-stores-table .scan-row-unscanned:hover { background: #fff0e9; }
#scanRoot.scan-workspace .scan-stores-table .scan-row-unscanned.scan-row-selected { background: #ffeadf; }
#scanRoot.scan-workspace .scan-store-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 195px;
  margin-bottom: 4px;
  color: var(--scan-ink);
  font-weight: 600;
}
#scanRoot.scan-workspace .scan-store-meta {
  display: block;
  margin-top: 4px;
  color: var(--scan-muted);
  font-size: 10px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
#scanRoot.scan-workspace .scan-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 4px;
  background: #e4f5f2;
  color: #247d66;
  font-size: 9px;
  line-height: 1.5;
  font-weight: 600;
  white-space: nowrap;
}
#scanRoot.scan-workspace .scan-status:is(.unscanned, .warning, .stale) {
  background: #fbe2d9;
  color: #a34f3b;
}
#scanRoot.scan-workspace .scan-status.error { background: #fbe2d9; color: #a34f3b; }
#scanRoot.scan-workspace .scan-detail-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 17px;
}
#scanRoot.scan-workspace .scan-detail-kpi {
  min-width: 0;
  min-height: 61px;
  padding: 10px 11px;
  border: 1px solid #e4efed;
  border-radius: 5px;
  background: #f6fbfa;
}
#scanRoot.scan-workspace .scan-detail-kpi :is(span, small) {
  display: block;
  color: var(--scan-muted);
  font-size: 10px;
  line-height: 1.5;
}
#scanRoot.scan-workspace .scan-detail-kpi strong {
  display: block;
  margin-top: 5px;
  color: var(--scan-ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#scanRoot.scan-workspace .scan-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 23px 0 11px;
  padding-top: 17px;
  border-top: 1px solid var(--scan-line);
}
#scanRoot.scan-workspace .scan-section-title h4 { margin: 0; font-size: 14px; }
#scanRoot.scan-workspace .scan-section-title :is(span, small) { color: var(--scan-muted); font-size: 11px; }
#scanRoot.scan-workspace .scan-records-wrap { max-height: 420px; }
#scanRoot.scan-workspace .scan-empty,
#scanRoot.scan-workspace table td.scan-empty {
  padding: 35px 12px;
  color: var(--scan-muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.8;
  cursor: default;
}
#scanRoot.scan-workspace .scan-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-top: 14px;
}
#scanRoot.scan-workspace .scan-summary-card { padding: 17px 18px; }
#scanRoot.scan-workspace .scan-summary-card :is(span, small) { display: block; color: var(--scan-muted); font-size: 11px; }
#scanRoot.scan-workspace .scan-summary-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#scanRoot.scan-workspace .scan-summary-card small { font-size: 10px; line-height: 1.6; }
#scanRoot.scan-workspace .scan-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 14px;
  padding: 10px 13px;
  border: 1px solid #d9ebe5;
  border-left: 3px solid #56a487;
  border-radius: 6px;
  background: #f7fcfa;
  color: #58736f;
  font-size: 11px;
  line-height: 1.6;
}
#scanRoot.scan-workspace .scan-source.warning,
#scanRoot.scan-workspace .scan-source.error,
#scanRoot.scan-workspace .scan-source.state-stale,
#scanRoot.scan-workspace .scan-source.state-unavailable,
#scanRoot.scan-workspace .scan-source.state-unconfigured { border-color: #f1ddd3; border-left-color: #c77962; background: #fffaf7; color: #95624f; }
#scanRoot.scan-workspace .scan-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 0 0;
  color: var(--scan-muted);
  font-size: 11px;
}
#scanRoot.scan-workspace .scan-pager button { min-height: 29px; padding: 0 9px; font-size: 11px; }
#scanRoot.scan-workspace .scan-pager .grow { display: flex; gap: 7px; margin-left: auto; }

@media (max-width: 1250px) {
  #scanRoot.scan-workspace { padding: 20px; }
  #scanRoot.scan-workspace .scan-header { align-items: flex-start; }
  #scanRoot.scan-workspace .scan-toolbar { justify-content: flex-start; }
  #scanRoot.scan-workspace .scan-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  #scanRoot.scan-workspace .scan-workspace-grid { grid-template-columns: minmax(0, 1fr); }
  #scanRoot.scan-workspace .scan-heading { flex-basis: 100%; }
  #scanRoot.scan-workspace .scan-detail-head > p { flex: 0 1 65%; }
}
@media (max-width: 620px) {
  #scanRoot.scan-workspace { padding: 14px 12px; }
  #scanRoot.scan-workspace .scan-heading h2 { font-size: 25px; }
  #scanRoot.scan-workspace .scan-toolbar { width: 100%; }
  #scanRoot.scan-workspace .scan-toolbar label { flex: 1 1 130px; }
  #scanRoot.scan-workspace .scan-toolbar :is(input, select) { width: 100%; min-width: 0; max-width: none; }
  #scanRoot.scan-workspace :is(.scan-store-panel, .scan-detail-panel) { padding: 15px 14px; }
  #scanRoot.scan-workspace .scan-detail-head { flex-direction: column; gap: 8px; }
  #scanRoot.scan-workspace :is(.scan-summary-grid, .scan-detail-kpis) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #scanRoot.scan-workspace .scan-summary-card { padding: 14px; }
  #scanRoot.scan-workspace .scan-summary-card strong { font-size: 21px; }
}

/* Canonical 门店扫码后台 visual language.  The selector is intentionally rooted
   at #scanRoot so these values cannot bleed into the lifecycle portal. */
#scanRoot.scan-workspace {
  --bg:#f3f7f6; --surface:#fff; --ink:#17272c; --muted:#7d8c8f;
  --line:#e3ecea; --teal:#168e89; --teal-soft:#e4f5f2;
  --warning:#c77962; --shadow:0 12px 30px rgba(25,55,57,.06);
  max-width:1540px; margin:0 auto; padding:32px 34px 42px;
  background:var(--bg); color:var(--ink);
  font-family:"Segoe UI","Microsoft YaHei",sans-serif;
  line-height:normal;
}
#scanRoot.scan-workspace *, #scanRoot.scan-workspace *::before, #scanRoot.scan-workspace *::after { box-sizing:border-box; }
#scanRoot.scan-workspace h1, #scanRoot.scan-workspace h2, #scanRoot.scan-workspace h3,
#scanRoot.scan-workspace h4, #scanRoot.scan-workspace p { margin-top:0; }
#scanRoot.scan-workspace h1 { margin:8px 0 0; font-size:30px; line-height:1.15; }
#scanRoot.scan-workspace h2 { margin:6px 0 0; font-size:18px; }
#scanRoot.scan-workspace h3 { margin:0; font-size:14px; }
#scanRoot.scan-workspace button, #scanRoot.scan-workspace input,
#scanRoot.scan-workspace select { font:inherit; }
#scanRoot.scan-workspace button { cursor:pointer; }
#scanRoot.scan-workspace .admin-header { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:22px; }
#scanRoot.scan-workspace .admin-header p { margin:8px 0 0; color:var(--muted); font-size:12px; }
#scanRoot.scan-workspace .eyebrow { color:#7d9697; font:600 10px Consolas,monospace; letter-spacing:.08em; }
#scanRoot.scan-workspace .header-actions { display:flex; align-items:flex-end; justify-content:flex-end; flex-wrap:wrap; gap:9px; }
#scanRoot.scan-workspace .date-control,
#scanRoot.scan-workspace .period-control,
#scanRoot.scan-workspace .scan-status-control,
#scanRoot.scan-workspace .store-control { display:grid; gap:5px; color:var(--muted); font-size:10px; }
#scanRoot.scan-workspace .period-control select, #scanRoot.scan-workspace .store-control select { min-width:120px; }
#scanRoot.scan-workspace .scan-status-control select { min-width:112px; }
#scanRoot.scan-workspace .date-control input,
#scanRoot.scan-workspace .period-control select,
#scanRoot.scan-workspace .scan-status-control select,
#scanRoot.scan-workspace .store-control select,
#scanRoot.scan-workspace input {
  border:1px solid #d7e4e1; border-radius:5px; background:var(--surface);
  color:var(--ink); padding:9px 10px; outline:0;
}
#scanRoot.scan-workspace input:focus, #scanRoot.scan-workspace select:focus { border-color:#76c9c2; box-shadow:0 0 0 2px #d8f3ef; }
#scanRoot.scan-workspace .button, #scanRoot.scan-workspace .icon-button {
  border:1px solid #c8e3df; border-radius:5px; min-height:36px; padding:0 13px;
  background:var(--surface); color:var(--teal); font-size:12px;
}
#scanRoot.scan-workspace .button.primary { border-color:var(--teal); background:var(--teal); color:#fff; }
#scanRoot.scan-workspace .button.secondary:hover, #scanRoot.scan-workspace .icon-button:hover { background:var(--teal-soft); }
#scanRoot.scan-workspace .icon-button { width:36px; padding:0; font-size:16px; }
#scanRoot.scan-workspace .workspace-grid { display:grid; grid-template-columns:minmax(0,1.18fr) minmax(420px,.82fr); gap:14px; align-items:start; }
#scanRoot.scan-workspace .panel, #scanRoot.scan-workspace .summary-card {
  min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:7px; box-shadow:var(--shadow);
}
#scanRoot.scan-workspace .panel { padding:19px 20px; }
#scanRoot.scan-workspace .panel-header { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:15px; }
#scanRoot.scan-workspace .panel-header h2, #scanRoot.scan-workspace .panel-header h3 { margin:6px 0 0; }
#scanRoot.scan-workspace .muted { color:var(--muted); font-size:11px; white-space:nowrap; }
#scanRoot.scan-workspace .table-scroll { max-width:100%; overflow-x:auto; }
#scanRoot.scan-workspace table { width:100%; border-collapse:collapse; text-align:left; min-width:620px; }
#scanRoot.scan-workspace .stores-panel table { min-width:760px; }
#scanRoot.scan-workspace th { padding:0 10px 10px; color:#8b9a9b; font-size:10px; font-weight:500; border-bottom:1px solid var(--line); white-space:nowrap; }
#scanRoot.scan-workspace td { padding:13px 10px; border-bottom:1px solid #eef3f2; font-size:12px; vertical-align:top; }
#scanRoot.scan-workspace tbody tr { cursor:pointer; }
#scanRoot.scan-workspace tbody tr:hover { background:#f7fbfa; }
#scanRoot.scan-workspace tbody tr.scan-row-selected { background:#eaf7f4; }
#scanRoot.scan-workspace tbody tr.scan-row-unscanned { background:#fff8f4; }
#scanRoot.scan-workspace tbody tr.scan-row-unscanned:hover { background:#fff0e9; }
#scanRoot.scan-workspace .scan-store-name { min-width:140px; font-weight:600; }
#scanRoot.scan-workspace .scan-store-meta { display:block; margin-top:4px; color:var(--muted); font-size:10px; line-height:1.5; overflow-wrap:anywhere; }
#scanRoot.scan-workspace td strong, #scanRoot.scan-workspace td b { display:block; font-weight:600; }
#scanRoot.scan-workspace td small { display:block; margin-top:4px; color:var(--muted); font-size:10px; overflow-wrap:anywhere; }
#scanRoot.scan-workspace .number { font-variant-numeric:tabular-nums; white-space:nowrap; }
#scanRoot.scan-workspace .store-priority-badge { display:inline-flex; align-items:center; margin-right:6px; padding:2px 5px; border-radius:4px; color:#a34f3b; background:#fbe2d9; font-size:9px; font-weight:600; }
#scanRoot.scan-workspace .zero-value, #scanRoot.scan-workspace .last-report-stale { color:#a34f3b; font-weight:600; }
#scanRoot.scan-workspace .status-dot { display:inline-flex; align-items:center; gap:5px; color:#4b9a7e; font-size:10px; white-space:nowrap; }
#scanRoot.scan-workspace .status-dot::before { content:""; width:6px; height:6px; border-radius:50%; background:#65ba91; }
#scanRoot.scan-workspace .status-dot.stale { color:var(--muted); }
#scanRoot.scan-workspace .status-dot.stale::before { background:#b3c1c0; }
#scanRoot.scan-workspace .empty, #scanRoot.scan-workspace .scan-empty { padding:34px 12px!important; text-align:center; color:var(--muted); cursor:default!important; }
#scanRoot.scan-workspace .summary-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:13px; margin:14px 0; }
#scanRoot.scan-workspace .summary-card { padding:17px 18px; }
#scanRoot.scan-workspace .summary-card span, #scanRoot.scan-workspace .summary-card small { display:block; color:var(--muted); font-size:11px; }
#scanRoot.scan-workspace .summary-card strong { display:block; margin:12px 0 6px; font-size:25px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#scanRoot.scan-workspace .summary-card small { font-size:10px; }
#scanRoot.scan-workspace .scan-embedded-status { margin:0; }
#scanRoot.scan-workspace .scan-source { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:-2px 0 14px; padding:11px 14px; border:1px solid #d9ebe5; border-left:3px solid #56a487; border-radius:6px; background:#f7fcfa; color:#58736f; font-size:11px; }
#scanRoot.scan-workspace .scan-source.error, #scanRoot.scan-workspace .scan-source.warning, #scanRoot.scan-workspace .scan-source.state-unavailable, #scanRoot.scan-workspace .scan-source.state-stale { border-color:#f1ddd3; border-left-color:var(--warning); background:#fffaf7; color:#95624f; }
#scanRoot.scan-workspace .scan-state { display:inline-flex; align-items:center; gap:5px; }
#scanRoot.scan-workspace .scan-state svg, #scanRoot.scan-workspace .scan-busy svg { width:14px; height:14px; }
#scanRoot.scan-workspace .scan-meta { display:flex; flex-wrap:wrap; gap:4px 12px; margin-left:auto; color:var(--muted); font-size:10px; }
#scanRoot.scan-workspace .scan-meta b { color:#58736f; }
#scanRoot.scan-workspace .scan-busy { display:inline-flex; align-items:center; gap:4px; }
#scanRoot.scan-workspace .scan-pager { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-top:12px; color:var(--muted); font-size:11px; }
#scanRoot.scan-workspace .scan-pager .grow { display:flex; gap:7px; margin-left:auto; }
#scanRoot.scan-workspace .scan-pager button { min-height:29px; padding:0 9px; border:1px solid #c8e3df; border-radius:5px; background:#fff; color:var(--teal); font-size:11px; }
#scanRoot.scan-workspace .scan-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:15px; }
#scanRoot.scan-workspace .scan-detail-head h3 { margin:0; font-size:18px; }
#scanRoot.scan-workspace .scan-detail-head p { margin:8px 0 0; color:var(--muted); font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
#scanRoot.scan-workspace .scan-detail-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:-2px 0 15px; }
#scanRoot.scan-workspace .scan-detail-kpi { padding:10px 11px; background:#f6fbfa; border:1px solid #e4efed; border-radius:5px; }
#scanRoot.scan-workspace .scan-detail-kpi span, #scanRoot.scan-workspace .scan-detail-kpi strong { display:block; }
#scanRoot.scan-workspace .scan-detail-kpi span { color:var(--muted); font-size:10px; }
#scanRoot.scan-workspace .scan-detail-kpi strong { margin-top:5px; font-size:15px; font-variant-numeric:tabular-nums; }
#scanRoot.scan-workspace .scan-section-title { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin:23px 0 11px; padding-top:17px; border-top:1px solid var(--line); }
#scanRoot.scan-workspace .scan-section-title h4 { margin:0; font-size:14px; }
#scanRoot.scan-workspace .scan-section-title span { color:var(--muted); font-size:11px; }
#scanRoot.scan-workspace .scan-products-table { min-width:560px; }
#scanRoot.scan-workspace .scan-products-table td { padding-top:10px; padding-bottom:10px; }
#scanRoot.scan-workspace .scan-records-wrap { max-height:420px; }
#scanRoot.scan-workspace .scan-records-table { min-width:680px; }
#scanRoot.scan-workspace .unscanned-strip { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:-2px 0 14px; padding:12px 14px; border:1px solid #f0cfc2; border-left:4px solid #c7664d; border-radius:6px; background:#fff7f3; color:#7f4b3d; }
#scanRoot.scan-workspace .unscanned-mark { display:grid; flex:0 0 24px; width:24px; height:24px; place-items:center; border-radius:50%; background:#c7664d; color:#fff; font:700 15px/1 Arial,sans-serif; }
#scanRoot.scan-workspace .unscanned-copy { min-width:220px; flex:1 1 300px; }
#scanRoot.scan-workspace .unscanned-copy strong { display:block; color:#9e4d39; font-size:12px; }
#scanRoot.scan-workspace .unscanned-copy p { margin:4px 0 0; color:#8c6b61; font-size:10px; line-height:1.5; }
#scanRoot.scan-workspace .unscanned-list { display:flex; flex:1 1 300px; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
#scanRoot.scan-workspace .unscanned-store-link { display:inline-flex; align-items:center; gap:5px; min-height:28px; padding:4px 8px; border:1px solid #e9bbae; border-radius:5px; background:#fff; color:#8e4d3d; font-size:11px; }
#scanRoot.scan-workspace .quality-strip { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:-2px 0 14px; padding:11px 14px; border:1px solid #d9ebe5; border-left:3px solid #56a487; border-radius:6px; background:#f7fcfa; color:#58736f; font-size:11px; }
#scanRoot.scan-workspace .quality-strip.has-issues { border-color:#f1ddd3; border-left-color:var(--warning); background:#fffaf7; color:#95624f; }
#scanRoot.scan-workspace .analytics-section { margin:22px 0 14px; }
#scanRoot.scan-workspace .section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:14px; margin:0 0 12px; }
#scanRoot.scan-workspace .section-heading h2 { margin:6px 0 0; }
#scanRoot.scan-workspace .period-metrics { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; margin-bottom:13px; }
#scanRoot.scan-workspace .metric-card { position:relative; min-width:0; padding:14px 15px; background:#fff; border:1px solid var(--line); border-radius:7px; box-shadow:var(--shadow); }
#scanRoot.scan-workspace .metric-card span, #scanRoot.scan-workspace .metric-card small { display:block; color:var(--muted); font-size:10px; line-height:1.45; }
#scanRoot.scan-workspace .metric-card strong { display:block; margin:9px 0 5px; font-size:19px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#scanRoot.scan-workspace .analysis-grid { display:grid; gap:14px; margin-bottom:14px; }
#scanRoot.scan-workspace .trend-category-grid { grid-template-columns:minmax(0,1.05fr) minmax(480px,.95fr); }
#scanRoot.scan-workspace .product-hour-grid { grid-template-columns:minmax(0,1.35fr) minmax(360px,.65fr); }
#scanRoot.scan-workspace .insight-grid, #scanRoot.scan-workspace .inventory-basket-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
#scanRoot.scan-workspace .analysis-panel { min-width:0; padding:17px 18px; }
#scanRoot.scan-workspace .analysis-panel .panel-header { margin-bottom:12px; }
#scanRoot.scan-workspace .chart-legend { display:flex; align-items:center; gap:5px; color:var(--muted); font-size:10px; white-space:nowrap; }
#scanRoot.scan-workspace .chart-legend i { display:inline-block; width:8px; height:8px; border-radius:2px; }
#scanRoot.scan-workspace .legend-current { background:#168e89; }
#scanRoot.scan-workspace .legend-previous { margin-left:5px; background:#b9d7d2; }
#scanRoot.scan-workspace .trend-chart { display:flex; align-items:stretch; gap:7px; height:188px; padding:8px 2px 0; border-bottom:1px solid var(--line); overflow-x:auto; }
#scanRoot.scan-workspace .trend-column { display:flex; flex:1 0 28px; min-width:28px; flex-direction:column; justify-content:flex-end; align-items:center; gap:3px; }
#scanRoot.scan-workspace .trend-bars { display:flex; align-items:flex-end; justify-content:center; gap:2px; width:100%; height:143px; }
#scanRoot.scan-workspace .trend-bars .bar { display:block; width:8px; min-height:1px; border-radius:3px 3px 0 0; }
#scanRoot.scan-workspace .trend-bars .bar.current { background:#168e89; }
#scanRoot.scan-workspace .trend-bars .bar.previous { background:#b9d7d2; }
#scanRoot.scan-workspace .trend-column b { color:#6d8181; font-size:9px; font-weight:500; white-space:nowrap; }
#scanRoot.scan-workspace .trend-column small { color:var(--muted); font-size:9px; white-space:nowrap; }
#scanRoot.scan-workspace .empty-chart { display:grid; place-items:center; width:100%; color:var(--muted); font-size:11px; }
#scanRoot.scan-workspace .analysis-table { min-width:560px; }
#scanRoot.scan-workspace .analysis-table td { padding-top:10px; padding-bottom:10px; }
#scanRoot.scan-workspace .analysis-table th { padding-bottom:9px; }
#scanRoot.scan-workspace .hourly-chart { display:flex; align-items:flex-end; gap:4px; height:188px; padding:7px 2px 0; border-bottom:1px solid var(--line); overflow-x:auto; }
#scanRoot.scan-workspace .hour-column { display:flex; flex:1 0 13px; min-width:13px; height:100%; flex-direction:column; justify-content:flex-end; align-items:center; gap:4px; }
#scanRoot.scan-workspace .hour-column i { display:block; width:100%; min-height:2px; border-radius:3px 3px 0 0; background:#63b6ad; }
#scanRoot.scan-workspace .hour-column b { color:#809493; font:500 8px Consolas,monospace; }
#scanRoot.scan-workspace .quality-detail { min-height:124px; }
#scanRoot.scan-workspace .quality-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
#scanRoot.scan-workspace .quality-grid div { padding:10px 11px; background:#f7fbfa; border:1px solid #e5efed; border-radius:5px; }
#scanRoot.scan-workspace .quality-grid span, #scanRoot.scan-workspace .quality-grid strong { display:block; }
#scanRoot.scan-workspace .quality-grid span { color:var(--muted); font-size:10px; }
#scanRoot.scan-workspace .quality-grid strong { margin-top:5px; color:#3d706a; font-size:17px; font-variant-numeric:tabular-nums; }
#scanRoot.scan-workspace .insights-list { display:grid; gap:8px; }
#scanRoot.scan-workspace .insight-item { display:flex; gap:9px; padding:10px 11px; border:1px solid #e6eeec; border-left:3px solid #8dbcb4; border-radius:5px; background:#fafdfc; }
#scanRoot.scan-workspace .insight-item.priority-high { border-color:#f0ddd6; border-left-color:#c77962; background:#fffaf8; }
#scanRoot.scan-workspace .insight-item.priority-medium { border-left-color:#c9a05a; background:#fffdf7; }
#scanRoot.scan-workspace .insight-mark { display:grid; flex:0 0 18px; width:18px; height:18px; place-items:center; border-radius:50%; color:#fff; background:#599e91; font:700 11px Arial,sans-serif; }
#scanRoot.scan-workspace .insight-item strong { display:block; color:#355b58; font-size:11px; }
#scanRoot.scan-workspace .insight-item p { margin:3px 0 2px; color:#6f8481; font-size:10px; }
#scanRoot.scan-workspace .insight-item small { color:var(--muted); font-size:10px; line-height:1.5; }
#scanRoot.scan-workspace .empty-insight { padding:30px 10px; color:var(--muted); text-align:center; font-size:11px; }
#scanRoot.scan-workspace .stock-status { display:inline-flex; padding:3px 6px; border-radius:4px; font-size:10px; white-space:nowrap; }
#scanRoot.scan-workspace .stock-out { color:#a35443; background:#fbe9e3; }
#scanRoot.scan-workspace .stock-low { color:#98712f; background:#fff2d7; }
#scanRoot.scan-workspace .stock-unknown { color:#738281; background:#edf1f0; }
#scanRoot.scan-workspace .stock-normal { color:#327a65; background:#e3f5ed; }
#scanRoot.scan-workspace .basket-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:-2px 0 13px; }
#scanRoot.scan-workspace .basket-summary div { padding:9px 10px; background:#f7fbfa; border:1px solid #e4efed; border-radius:5px; }
#scanRoot.scan-workspace .basket-summary span, #scanRoot.scan-workspace .basket-summary strong { display:block; }
#scanRoot.scan-workspace .basket-summary span { color:var(--muted); font-size:10px; }
#scanRoot.scan-workspace .basket-summary strong { margin-top:4px; color:#3c716b; font-size:15px; font-variant-numeric:tabular-nums; }
#scanRoot.scan-workspace .admin-footer { margin-top:18px; color:#8a999a; font-size:11px; line-height:1.7; }

/* Full-screen scan view keeps the portal available through the view switcher,
   but gives the scan workspace the entire content width. */
#appShell.scan-fullscreen .p-banner, #appShell.scan-fullscreen .p-crumbbar,
#appShell.scan-fullscreen .p-side, #appShell.scan-fullscreen .p-rail { display:none!important; }
#appShell.scan-fullscreen .p-shell { display:block; min-height:100vh; }
#appShell.scan-fullscreen .p-main, #appShell.scan-fullscreen .p-content { width:100%; max-width:none; padding:0; }
#appShell.scan-fullscreen #scanRoot.scan-workspace { max-width:none; min-height:100vh; }
#scanRoot.scan-workspace .scan-back { margin-bottom:14px; }

@media (max-width:1250px) {
  #scanRoot.scan-workspace .summary-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #scanRoot.scan-workspace .period-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #scanRoot.scan-workspace .trend-category-grid, #scanRoot.scan-workspace .product-hour-grid { grid-template-columns:1fr; }
}
@media (max-width:1000px) {
  #scanRoot.scan-workspace { padding:24px 20px 34px; }
  #scanRoot.scan-workspace .admin-header { align-items:flex-start; flex-direction:column; }
  #scanRoot.scan-workspace .header-actions { justify-content:flex-start; }
  #scanRoot.scan-workspace .workspace-grid { grid-template-columns:1fr; }
  #scanRoot.scan-workspace .insight-grid, #scanRoot.scan-workspace .inventory-basket-grid { grid-template-columns:1fr; }
}
@media (max-width:620px) {
  #scanRoot.scan-workspace { padding:18px 13px 28px; }
  #scanRoot.scan-workspace h1 { font-size:25px; }
  #scanRoot.scan-workspace .summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  #scanRoot.scan-workspace .summary-card { padding:14px; }
  #scanRoot.scan-workspace .summary-card strong { font-size:21px; }
  #scanRoot.scan-workspace .period-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  #scanRoot.scan-workspace .header-actions { width:100%; }
  #scanRoot.scan-workspace .date-control, #scanRoot.scan-workspace .period-control,
  #scanRoot.scan-workspace .scan-status-control, #scanRoot.scan-workspace .store-control { flex:1 1 140px; }
  #scanRoot.scan-workspace .date-control input, #scanRoot.scan-workspace .period-control select,
  #scanRoot.scan-workspace .scan-status-control select, #scanRoot.scan-workspace .store-control select { width:100%; min-width:0; }
  #scanRoot.scan-workspace .panel { padding:15px 14px; }
  #scanRoot.scan-workspace .scan-detail-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #scanRoot.scan-workspace .quality-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #scanRoot.scan-workspace .basket-summary { gap:6px; }
  #scanRoot.scan-workspace .basket-summary div { padding:8px; }
}
