/* ============ QC STATION — Precision instrument design system ============ */
:root {
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;

  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e3e8ef;
  --line-2: #eef2f7;

  --pri: #2563eb;
  --pri-bg: #eff4ff;
  --pri-ink2: #1d4ed8;

  --ok: #16a34a;  --ok-bg: #e7f8ed;  --ok-ink: #15803d;
  --err: #dc2626; --err-bg: #fdecec; --err-ink: #b91c1c;
  --warn: #d97706; --warn-bg: #fef4e2; --warn-ink: #b45309;

  --r: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08);
  --gap: 16px;
  --pad: 18px;
}
:root[data-density="compact"] { --gap: 11px; --pad: 13px; }
:root[data-density="comfy"]   { --gap: 22px; --pad: 24px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; font-size: 14px; }
#root { min-height: 100%; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.qc-app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- TOP BAR ---------- */
.qc-topbar { position: sticky; top: 0; z-index: 100; height: 60px; flex-shrink: 0;
  background: #0b1220; color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.07); }
.qc-brand { display: flex; align-items: center; gap: 12px; }
.qc-brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--pri);
  display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 4px 12px rgba(37,99,235,.4); }
.qc-brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.qc-brand-sub { font-size: 11px; color: rgba(255,255,255,.45); font-weight: 500; white-space: nowrap; }
.qc-topbar-right { display: flex; align-items: center; gap: 14px; }
.qc-topchip { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  color: rgba(255,255,255,.78); padding: 6px 11px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08); border-radius: 8px; white-space: nowrap; }
.qc-livedot { width: 7px; height: 7px; border-radius: 999px; background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.5)} 70%{box-shadow:0 0 0 6px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }
.qc-topdiv { width: 1px; height: 24px; background: rgba(255,255,255,.1); }
.qc-topclock { display: flex; align-items: center; gap: 7px; font-family: var(--mono);
  font-size: 13px; color: rgba(255,255,255,.7); font-weight: 500; }
.qc-operator { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.qc-operator-av { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.1);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  border: 1px solid rgba(255,255,255,.12); }
.qc-operator-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.qc-operator-st { font-size: 10.5px; color: rgba(255,255,255,.45); white-space: nowrap; }
.qc-operator-txt { min-width: 0; }

.qc-main { flex: 1; }
.qc-page { max-width: 1180px; margin: 0 auto; padding: var(--gap) 22px 40px; }

/* ---------- DASHBOARD: scan bar ---------- */
.qc-scanbar { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: var(--pad) calc(var(--pad) + 4px); margin: var(--gap) 0;
  display: grid; grid-template-columns: 1fr; gap: 14px; position: relative;
  background-image: radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 0);
  background-size: 22px 22px; }
.qc-scanbar-label { display: flex; align-items: center; gap: 13px; }
.qc-scanbar-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.qc-scanbar-sub { font-size: 12.5px; color: var(--ink-2); }
.qc-resi-field { display: flex; align-items: center; gap: 12px; background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 11px; padding: 8px 8px 8px 16px;
  transition: border-color .15s, box-shadow .15s; }
.qc-resi-field:focus-within { border-color: var(--pri); box-shadow: 0 0 0 4px var(--pri-bg); background: #fff; }
.qc-resi-field.is-err { border-color: var(--err); box-shadow: 0 0 0 4px var(--err-bg); animation: shake .35s; }
.qc-resi-input { flex: 1; border: 0; background: transparent; outline: none; font-size: 17px;
  font-family: var(--mono); font-weight: 500; letter-spacing: 0.01em; color: var(--ink); min-width: 0; }
.qc-resi-input::placeholder { font-family: var(--sans); color: var(--ink-3); font-weight: 400; letter-spacing: 0; }
.qc-resi-errmsg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--err-ink); font-weight: 600; margin-top: -4px; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-5px)} 40%,80%{transform:translateX(5px)} }

/* ---------- buttons ---------- */
.qc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 9px; font-size: 14px; font-weight: 600; padding: 0 16px; height: 40px;
  border: 1px solid transparent; transition: all .14s; white-space: nowrap; }
.qc-btn-pri { background: var(--pri); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.qc-btn-pri:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,.32); }
.qc-btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.qc-btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.qc-btn-ghost:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); background: var(--surface-2); }
.qc-btn:disabled { opacity: .45; cursor: not-allowed; }
.qc-iconbtn { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center; flex-shrink: 0; transition: all .14s; }
.qc-iconbtn:hover { border-color: var(--ink-3); color: var(--ink); }

/* ---------- stats ---------- */
.qc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.qc-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; display: flex; align-items: center; gap: 13px; box-shadow: var(--shadow); }
.qc-stat-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.qc-stat-warn .qc-stat-ic { background: var(--warn-bg); color: var(--warn-ink); }
.qc-stat-ok .qc-stat-ic { background: var(--ok-bg); color: var(--ok-ink); }
.qc-stat-pri .qc-stat-ic { background: var(--pri-bg); color: var(--pri-ink2); }
.qc-stat-neutral .qc-stat-ic { background: var(--surface-2); color: var(--ink-2); }
.qc-stat-val { font-size: 26px; font-weight: 700; line-height: 1; font-feature-settings: "tnum"; letter-spacing: -0.02em; }
.qc-stat-lbl { font-size: 12px; color: var(--ink-2); margin-top: 4px; font-weight: 500; }

/* ---------- JubCard (Jubelio-style stat cards) ---------- */
.qc-jcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.qc-jcard-top { display: flex; align-items: center; justify-content: space-between; }
.qc-jcard-label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.qc-jcard-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.qc-jcard-ic-ok      { background: var(--ok-bg);      color: var(--ok-ink); }
.qc-jcard-ic-warn    { background: var(--warn-bg);    color: var(--warn-ink); }
.qc-jcard-ic-pri     { background: var(--pri-bg);     color: var(--pri-ink2); }
.qc-jcard-ic-neutral { background: var(--surface-2);  color: var(--ink-2); }
.qc-jcard-val { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-feature-settings: "tnum"; }
.qc-jcard-bottom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qc-jcard-delta { font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 20px; }
.qc-jcard-delta.is-up { color: var(--ok-ink); background: var(--ok-bg); }
.qc-jcard-delta.is-dn { color: var(--err);    background: #fef2f2; }
.qc-jcard-sub { font-size: 11.5px; color: var(--ink-3); }

/* ---------- list head + tabs ---------- */
.qc-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.qc-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.qc-tab { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent;
  color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 7px; transition: all .14s; }
.qc-tab:hover { color: var(--ink); }
.qc-tab.is-on { background: var(--ink); color: #fff; }
.qc-tab-count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-family: var(--mono); }
.qc-tab.is-on .qc-tab-count { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- order table ---------- */
.qc-table { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.qc-tr { display: grid; grid-template-columns: 1.5fr 1.6fr 1fr 1fr 1fr 36px; align-items: center; gap: 14px; padding: 0 18px; }
.qc-th { height: 42px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.qc-row { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line-2);
  min-height: 66px; transition: background .12s; }
.qc-row:last-child { border-bottom: 0; }
.qc-row:hover { background: var(--surface-2); }
.qc-cell-resi { display: flex; flex-direction: column; gap: 3px; }
.qc-cell-time { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.qc-itempill { font-size: 12px; font-weight: 600; color: var(--ink-2); font-family: var(--mono); background: var(--surface-2);
  border: 1px solid var(--line); padding: 4px 9px; border-radius: 7px; }
.qc-row-go { display: grid; place-items: center; opacity: .5; transition: transform .14s, opacity .14s; }
.qc-row:hover .qc-row-go { opacity: 1; transform: translateX(2px); }
.qc-empty { padding: 48px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---------- DETAIL header ---------- */
.qc-detail { max-width: 1180px; }
.qc-dhead { display: flex; align-items: center; gap: 16px; padding: var(--gap) 0;
  border-bottom: 1px solid var(--line); margin-bottom: var(--gap); flex-wrap: wrap; }
.qc-dhead-main { flex: 1; min-width: 200px; }
.qc-dhead-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qc-dhead-sub { display: flex; align-items: center; gap: 9px; font-size: 13px; margin-top: 5px; flex-wrap: wrap; }
.qc-dot { width: 3px; height: 3px; border-radius: 999px; background: var(--ink-3); }
.qc-dhead-prog { width: 220px; flex-shrink: 0; }
.qc-dhead-pcs { display: flex; align-items: baseline; gap: 5px; font-family: var(--mono); }
.qc-dhead-pcs b { font-size: 24px; font-weight: 700; color: var(--pri); }
.qc-dhead-pcs span { font-size: 13px; color: var(--ink-3); }
.qc-progbar { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 5px; }
.qc-progbar-fill { height: 100%; background: linear-gradient(90deg, var(--pri), var(--pri-ink2)); border-radius: 999px; transition: width .45s cubic-bezier(.2,.8,.2,1); }
.qc-dhead-sku { font-size: 11.5px; color: var(--ink-2); font-weight: 500; }

/* ---------- scan input ---------- */
.qc-sticky { position: sticky; top: 60px; z-index: 40; padding: 6px 0 14px; background: linear-gradient(var(--bg) 78%, transparent); }
.qc-scaninput { display: flex; align-items: center; gap: 13px; background: #0b1220; border: 1.5px solid #1e293b;
  border-radius: 12px; padding: 0 18px; height: 58px; transition: border-color .15s, box-shadow .15s; }
.qc-scaninput:focus-within { border-color: var(--pri); box-shadow: 0 0 0 4px var(--pri-bg); }
.qc-scaninput.is-big { height: 66px; }
.qc-scaninput.is-disabled { opacity: .5; }
.qc-scaninput-ic { display: grid; place-items: center; }
.qc-scaninput-field { flex: 1; border: 0; background: transparent; outline: none; font-size: 18px;
  font-family: var(--mono); font-weight: 500; color: #fff; min-width: 0; }
.qc-scaninput-field::placeholder { font-family: var(--sans); color: #64748b; font-weight: 400; }
.qc-scaninput-hint { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #94a3b8; font-weight: 600; white-space: nowrap; }

/* ---------- product row (LIST) ---------- */
.qc-lay-list { }
.qc-prow-list { display: flex; flex-direction: column; gap: 10px; }
.qc-prow { position: relative; display: flex; align-items: center; gap: 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s, background .2s; }
.qc-prow.is-done { background: linear-gradient(0deg, var(--ok-bg), #fff 60%); border-color: #bbecca; }
.qc-prow-info { flex: 1; min-width: 0; }
.qc-prow-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.qc-prow-codes { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.qc-codechip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 7px; white-space: nowrap; }
.qc-codechip.lg { font-size: 14px; padding: 6px 13px; }
.qc-codechip-k { font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--ink-3); }
.qc-prow-status { width: 76px; display: flex; justify-content: flex-end; }
.qc-prow-wait { font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* qty meter */
.qc-qty { display: inline-flex; align-items: baseline; font-family: var(--mono); font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 13px; }
.qc-qty-now { font-size: 19px; color: var(--ink); }
.qc-qty-sep { font-size: 14px; color: var(--ink-3); margin: 0 3px; }
.qc-qty-req { font-size: 14px; color: var(--ink-3); }
.qc-qty.is-done { background: var(--ok-bg); border-color: #bbecca; }
.qc-qty.is-done .qc-qty-now { color: var(--ok-ink); }

/* flash */
.qc-flash { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5; }
.qc-flash-ok { animation: flashOk .65s ease-out; }
.qc-flash-over, .qc-flash-wrong { animation: flashWarn .55s ease-out; }
@keyframes flashOk { 0%{background:rgba(22,163,74,.35);box-shadow:inset 0 0 0 2px var(--ok)} 100%{background:transparent;box-shadow:inset 0 0 0 0 transparent} }
@keyframes flashWarn { 0%,30%{background:rgba(220,38,38,.28);box-shadow:inset 0 0 0 2px var(--err)} 100%{background:transparent;box-shadow:inset 0 0 0 0 transparent} }
.qc-screenflash { position: fixed; inset: 0; z-index: 150; pointer-events: none; background: rgba(220,38,38,.16);
  box-shadow: inset 0 0 0 5px var(--err); animation: flashWarn .5s ease-out forwards; }

/* ---------- SPLIT layout ---------- */
.qc-lay-split { display: grid; grid-template-columns: 340px 1fr; gap: var(--gap); align-items: start; }
.qc-split-left { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.qc-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0; }
.qc-ring-pct { font-family: var(--mono); font-size: 26px; font-weight: 700; fill: var(--ink); }
.qc-ring-lbl { font-size: 11px; fill: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.qc-ring-cap { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.qc-lastscan { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 11px;
  border: 1.5px dashed var(--line); min-height: 66px; transition: all .2s; }
.qc-lastscan.is-ok { border-style: solid; border-color: #bbecca; background: var(--ok-bg); }
.qc-lastscan.is-warn { border-style: solid; border-color: #f3c2c2; background: var(--err-bg); }
.qc-lastscan-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-lastscan-idle { font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin: 0 auto; }
.qc-split-right { min-width: 0; }
.qc-pcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.qc-pcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s, background .2s; }
.qc-pcard.is-done { background: linear-gradient(0deg, var(--ok-bg), #fff 65%); border-color: #bbecca; }
.qc-pcard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.qc-pcard-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; min-height: 36px; }
.qc-pcard-codes { display: flex; flex-direction: column; gap: 2px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line-2); }

/* ---------- FOCUS layout ---------- */
.qc-lay-focus { }
.qc-focus-grid { display: grid; grid-template-columns: 1fr 320px; gap: var(--gap); align-items: start; }
.qc-focus-main { min-height: 380px; }
.qc-target { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-md); padding: 36px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 16px; overflow: hidden; }
.qc-target.is-empty { color: var(--ok-ink); font-size: 18px; font-weight: 700; gap: 14px; padding: 80px 36px; }
.qc-target-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--pri-ink2); background: var(--pri-bg);
  padding: 7px 14px; border-radius: 999px; }
.qc-target-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; max-width: 440px; line-height: 1.25; }
.qc-target-codes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.qc-target-need { font-size: 15px; color: var(--ink-2); }
.qc-target-need b { font-size: 22px; color: var(--pri); font-family: var(--mono); margin: 0 3px; }
.qc-target-need-sub { font-size: 13px; color: var(--ink-3); margin-left: 6px; font-family: var(--mono); }
.qc-focus-side { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); position: sticky; top: 76px; }
.qc-focus-side-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 10px; }
.qc-qrow { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 9px; margin-bottom: 4px; }
.qc-qrow.is-active { background: var(--pri-bg); box-shadow: inset 0 0 0 1.5px var(--pri); }
.qc-qrow.is-done { opacity: .6; }
.qc-qrow-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-qrow .qc-qty { padding: 3px 9px; }
.qc-qrow .qc-qty-now { font-size: 14px; }

/* ---------- scanner simulator ---------- */
.qc-sim { margin-top: 18px; border: 1px dashed var(--line); border-radius: 12px; padding: 13px; background: var(--surface-2); }
.qc-lay-list .qc-sim, .qc-lay-focus .qc-sim { margin-top: 20px; }
.qc-sim-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 11px; }
.qc-sim-tag { font-weight: 500; color: var(--ink-3); font-size: 11px; }
.qc-sim-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.qc-focus-side .qc-sim-btns { flex-direction: column; }
.qc-sim-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 11px 7px 7px; font-size: 12px; color: var(--ink-2); transition: all .12s; }
.qc-sim-btn:hover:not(:disabled) { border-color: var(--pri); color: var(--pri-ink2); transform: translateY(-1px); box-shadow: var(--shadow); }
.qc-sim-btn:disabled { opacity: .4; cursor: not-allowed; }
.qc-sim-bad { color: var(--err-ink); border-color: #f3d0d0; padding: 7px 13px; font-weight: 600; }
.qc-sim-bad:hover:not(:disabled) { border-color: var(--err); color: var(--err-ink); }

/* ---------- complete overlay ---------- */
.qc-overlay { position: fixed; inset: 0; z-index: 180; background: rgba(11,18,32,.55);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px; animation: fadeIn .2s; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
.qc-complete { background: var(--surface); border-radius: 18px; box-shadow: 0 24px 64px rgba(0,0,0,.3);
  padding: 36px; width: min(440px, 94vw); text-align: center; animation: popIn .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes popIn { from{opacity:0;transform:scale(.92) translateY(12px)} to{opacity:1;transform:none} }
.qc-complete-check { width: 76px; height: 76px; border-radius: 999px; background: var(--ok); margin: 0 auto 18px;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(22,163,74,.4); animation: checkPop .45s cubic-bezier(.2,.9,.3,1.4); }
@keyframes checkPop { 0%{transform:scale(0)} 60%{transform:scale(1.12)} 100%{transform:scale(1)} }
.qc-complete-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.qc-complete-sub { font-size: 14px; color: var(--ink-2); margin-top: 7px; line-height: 1.5; }
.qc-complete-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 16px; margin: 22px 0; text-align: left; }
.qc-cc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.qc-cc-row:last-child { border-bottom: 0; }
.qc-cc-row > span:first-child { color: var(--ink-3); font-weight: 500; }
.qc-complete-actions { display: flex; gap: 10px; }
.qc-complete-actions .qc-btn { flex: 1; }

/* ---------- toast anim ---------- */
.qc-toast { animation: toastIn .26s cubic-bezier(.2,.9,.3,1.2); }
@keyframes toastIn { from{opacity:0;transform:translateY(-10px) scale(.96)} to{opacity:1;transform:none} }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .qc-stats { grid-template-columns: repeat(2, 1fr); }
  .qc-lay-split, .qc-focus-grid { grid-template-columns: 1fr; }
  .qc-split-left, .qc-focus-side { position: static; }
  .qc-tr { grid-template-columns: 1.4fr 1.5fr 1fr 30px; }
  .hide-sm { display: none !important; }
  .qc-dhead-prog { width: 100%; }
}
/* ---------- nav + operator menu ---------- */
.qc-topbar-left { display: flex; align-items: center; gap: 26px; min-width: 0; }
.qc-nav { display: flex; gap: 4px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 4px; }
.qc-nav-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent;
  color: rgba(255,255,255,.6); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 7px; transition: all .14s; white-space: nowrap; }
.qc-nav-btn:hover { color: #fff; }
.qc-nav-btn.is-on { background: var(--pri); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.4); }
.qc-operator-wrap { position: relative; }
.qc-operator { display: flex; align-items: center; gap: 9px; padding: 4px 4px 4px 4px; background: transparent; border: 0; border-radius: 9px; transition: background .14s; }
.qc-operator:hover { background: rgba(255,255,255,.06); }
.qc-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 240px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: 8px; z-index: 120; animation: toastIn .16s; }
.qc-menu-head { display: flex; align-items: center; gap: 11px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.qc-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--err-ink);
  font-size: 13.5px; font-weight: 600; padding: 10px 8px; border-radius: 8px; text-align: left; transition: background .12s; }
.qc-menu-item:hover { background: var(--err-bg); }
.qc-list-hint { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.qc-refresh-btn { background: none; border: none; cursor: pointer; color: var(--pri); font-size: 12px; font-weight: 600; padding: 0; font-family: var(--mono); }
.qc-refresh-btn:hover { text-decoration: underline; }

/* Pagination */
.qc-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.qc-page-info { font-size: 12.5px; color: var(--ink-3); }
.qc-page-btns { display: flex; align-items: center; gap: 4px; }
.qc-page-btn { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); transition: background .15s; }
.qc-page-btn:hover:not(:disabled) { background: var(--surface-2); }
.qc-page-btn:disabled { opacity: .4; cursor: default; }
.qc-page-num { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; transition: background .15s; }
.qc-page-num:hover:not(.is-on) { background: var(--surface-2); }
.qc-page-num.is-on { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 700; }
.qc-page-ellipsis { color: var(--ink-3); padding: 0 4px; font-size: 13px; }

/* ---------- LOGIN ---------- */
.qc-login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.qc-login-brand { position: relative; background: #0b1220; color: #fff; padding: 44px;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.qc-login-grid { position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.06) 1px, transparent 0); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(120% 80% at 30% 20%, #000, transparent 75%); mask-image: radial-gradient(120% 80% at 30% 20%, #000, transparent 75%); }
.qc-login-brand > * { position: relative; }
.qc-login-brand-top { display: flex; align-items: center; gap: 13px; }
.qc-login-brand-name { font-size: 17px; font-weight: 700; }
.qc-login-brand-sub { font-size: 12px; color: rgba(255,255,255,.5); }
.qc-login-hero { max-width: 440px; }
.qc-login-hero-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #7aa2ff; background: rgba(37,99,235,.18); border: 1px solid rgba(37,99,235,.35); padding: 6px 12px; border-radius: 999px; margin-bottom: 22px; }
.qc-login-hero-h { font-size: 42px; line-height: 1.08; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 18px; }
.qc-login-hero-p { font-size: 15.5px; line-height: 1.6; color: rgba(255,255,255,.6); margin: 0; }
.qc-login-foot { display: flex; gap: 32px; }
.qc-login-stat b { display: block; font-family: var(--mono); font-size: 24px; font-weight: 700; }
.qc-login-stat span { font-size: 12px; color: rgba(255,255,255,.45); }
.qc-login-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 22px; background: var(--bg); }
.qc-login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-md); padding: 34px; }
.qc-login-card-in { display: flex; flex-direction: column; gap: 16px; }
.qc-login-h { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.qc-login-sub { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin-top: -10px; }
.qc-field { display: flex; flex-direction: column; gap: 7px; }
.qc-field-top { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.qc-input { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 0 13px; height: 48px; transition: border-color .15s, box-shadow .15s; }
.qc-input:focus-within { border-color: var(--pri); box-shadow: 0 0 0 4px var(--pri-bg); background: #fff; }
.qc-input input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--ink); min-width: 0; }
.qc-input-eye { border: 0; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 600; padding: 4px; white-space: nowrap; }
.qc-input-eye:hover { color: var(--pri); }
.qc-link { border: 0; background: transparent; color: var(--pri); font-size: 12.5px; font-weight: 600; padding: 0; white-space: nowrap; }
.qc-link:hover { text-decoration: underline; }
.qc-link-back { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); margin-bottom: 2px; align-self: flex-start; }
.qc-login-err { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--err-ink); font-weight: 600; background: var(--err-bg); padding: 9px 12px; border-radius: 8px; }
.qc-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; }
.qc-check input { width: 16px; height: 16px; accent-color: var(--pri); }
.qc-login-hint { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 2px; }
.qc-login-sent { text-align: center; align-items: center; }
.qc-login-copy { font-size: 12px; color: var(--ink-3); }

/* ---------- REPORT ---------- */
.qc-rep-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: var(--gap) 0 var(--gap); flex-wrap: wrap; }
.qc-rep-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.qc-rep-sub { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.qc-rep-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qc-seg { display: inline-flex; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.qc-seg-btn { border: 0; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: 7px; transition: all .13s; }
.qc-seg-btn:hover { color: var(--ink); }
.qc-seg-btn.is-on { background: var(--ink); color: #fff; }
.qc-seg-sm .qc-seg-btn { padding: 6px 12px; font-size: 12px; }

.qc-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.qc-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 18px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.qc-kpi.is-clickable:hover { border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 12%, transparent); }
.qc-kpi.is-active { border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 15%, transparent); }
.qc-kpi-top { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.qc-kpi-lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.qc-kpi-val { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.025em; font-family: var(--mono); }
.qc-kpi-sub { font-size: 12px; color: var(--ink-3); margin-top: 7px; }

.qc-rep-row { display: grid; gap: var(--gap); margin-bottom: var(--gap); align-items: stretch; }
.qc-rep-row-2 { grid-template-columns: 1.7fr 1fr; }
.qc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.qc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.qc-card-head > div:first-child { min-width: 0; }
.qc-card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.qc-card-cap { font-size: 12px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; }
.qc-card-body { padding: 20px; }
/* card standalone di luar qc-rep-row dapat margin bawah yang konsisten */
.qc-report > .qc-card { margin-bottom: var(--gap); }

/* bar chart */
.qc-chart-wrap { position: relative; }
.qc-barchart { width: 100%; height: 220px; display: block; overflow: visible; }
.qc-chart-xlbl { font-size: 10px; fill: var(--ink-3); font-family: var(--mono); }
.qc-chart-tip { position: absolute; top: -6px; transform: translateX(-50%); background: var(--ink); color: #fff;
  font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-md); }
.qc-chart-tip b { font-family: var(--mono); }
.qc-chart-tip span { display: block; font-size: 10.5px; color: rgba(255,255,255,.6); }

/* donut */
.qc-donut { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.qc-donut-num { font-family: var(--mono); font-size: 28px; font-weight: 700; fill: var(--ink); }
.qc-donut-lbl { font-size: 11px; fill: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.qc-donut-legend { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.qc-donut-leg { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.qc-donut-leg b { margin-left: auto; font-family: var(--mono); font-weight: 700; }
.qc-donut-leg-lbl { color: var(--ink-2); font-weight: 500; }
.qc-donut-dot { width: 11px; height: 11px; border-radius: 3px; }

/* horizontal bars */
.qc-hbars { display: flex; flex-direction: column; gap: 15px; }
.qc-hbar-row { display: flex; align-items: center; gap: 12px; }
.qc-hbar-rank { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-3); font-family: var(--mono); }
.qc-hbar-main { flex: 1; min-width: 0; }
.qc-hbar-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.qc-hbar-lbl { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-hbar-val { font-size: 13px; font-weight: 700; font-family: var(--mono); flex-shrink: 0; white-space: nowrap; }
.qc-hbar-val i { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.qc-hbar-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.qc-hbar-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.qc-hbar-sub { font-size: 11px; color: var(--ink-3); flex-shrink: 0; }
.qc-pop-grid { }
.qc-paginator { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 4px; }
.qc-pag-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-1); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; line-height: 1; }
.qc-pag-btn:hover:not(:disabled) { background: var(--surface-3, #e5e7eb); }
.qc-pag-btn:disabled { opacity: .35; cursor: default; }
.qc-pag-info { font-size: 13px; color: var(--ink-2); font-family: var(--mono); min-width: 48px; text-align: center; }
.qc-rep-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; color: var(--ink-3); text-align: center; font-size: 14px; }

/* marketplace */
.qc-mp { display: flex; flex-direction: column; }
.qc-mp-row { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.qc-mp-row:last-child { border-bottom: 0; padding-bottom: 0; }
.qc-mp-row:first-child { padding-top: 0; }
.qc-mp-rank { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-3); font-family: var(--mono); }
.qc-mp-logo { width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center;
  color: #fff; font-size: 17px; font-weight: 700; box-shadow: var(--shadow); }
.qc-mp-main { flex: 1; min-width: 0; }
.qc-mp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.qc-mp-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-mp-name i { font-style: normal; font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.qc-mp-omset { font-size: 14.5px; font-weight: 700; font-family: var(--mono); flex-shrink: 0; }
.qc-mp-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.qc-mp-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.qc-mp-tx { flex-shrink: 0; text-align: right; min-width: 78px; }
.qc-mp-tx b { display: block; font-size: 18px; font-weight: 700; font-family: var(--mono); line-height: 1.1; }
.qc-mp-tx span { font-size: 11px; color: var(--ink-3); }

@media (max-width: 900px) {
  .qc-login { grid-template-columns: 1fr; }
  .qc-login-brand { display: none; }
  .qc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .qc-rep-row-2 { grid-template-columns: 1fr; }
  .qc-nav { display: none; }
}

@media (max-width: 560px) {
  .qc-page { padding: 10px 14px 32px; }
  .qc-topbar { padding: 0 14px; }
  .qc-brand-sub, .qc-topclock, .qc-operator-txt { display: none; }
  .qc-topchip span:not(.qc-livedot) { display: none; }
  .qc-stats { grid-template-columns: 1fr 1fr; }
  .qc-kpi-grid { grid-template-columns: 1fr 1fr; }
  .qc-pcard-grid { grid-template-columns: 1fr 1fr; }
  .qc-tr { grid-template-columns: 1.3fr 1fr 28px; }
  .qc-scanbar { background-image: none; }
  .qc-rep-head-actions { width: 100%; }
  .qc-login-hero-h { font-size: 32px; }
  .qc-mp-name i { display: none; }
  .qc-mp-tx { min-width: 64px; }
}

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.qc-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.qc-modal {
  background: var(--surface); border-radius: 14px; width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,.18); overflow: hidden;
}
.qc-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
}
.qc-modal-title { font-size: 15px; font-weight: 600; color: var(--ink-1); }
.qc-modal-close {
  background: none; border: none; cursor: pointer; font-size: 16px;
  color: var(--ink-3); padding: 2px 6px; border-radius: 6px;
}
.qc-modal-close:hover { background: var(--bg); color: var(--ink-1); }
.qc-modal-body { padding: 18px 20px; }
.qc-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px 16px; border-top: 1px solid var(--line);
}

/* ─── Retur ──────────────────────────────────────────────────────────────────── */
.retur-scan-panel { padding: 18px 20px; margin-bottom: var(--gap); }
.retur-scan-fb {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
}
.retur-scan-fb.is-ok  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.retur-scan-fb.is-err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.retur-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.retur-table th {
  text-align: left; padding: 10px 14px; font-size: 11.5px; font-weight: 600;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.retur-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.retur-table tbody tr:last-child td { border-bottom: none; }
.retur-table tbody tr:hover { background: var(--bg); }
.retur-row-pending { background: #fffbeb; }
.retur-row-pending:hover { background: #fef9c3 !important; }

.retur-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.retur-badge-ok   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.retur-badge-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.retur-badge-ret  { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.retur-badge-gray { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* ---- Footer ---- */
.qc-footer {
  text-align: center;
  padding: 12px var(--pad);
  font-size: 11.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  background: var(--surface);
  letter-spacing: .01em;
}

/* ---- QC info row di detail header ---- */
.qc-dhead-qcinfo {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2);
  margin-top: 5px; flex-wrap: wrap;
}
.qc-dhead-qcinfo b { color: var(--ink); font-weight: 600; }
