/* ==========================================================
   PFI INVENTORY — PHYSICAL COUNT / AUDIT SCANNER V1
   Isolated styles. Existing Branch Inventory styles untouched.
   ========================================================== */

#physicalCountView { min-width:0; }
.pc-brand-dot { font-size:12px; color:var(--muted); font-weight:600; vertical-align:middle; }
.pc-topbar { margin-bottom:18px; }
.pc-tabs { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 18px; }
.pc-tab { border:1px solid var(--line); background:#fff; color:var(--ink); border-radius:10px; padding:10px 14px; font-weight:700; cursor:pointer; }
.pc-tab.active { background:#182333; color:#fff; border-color:#182333; }
.pc-home-card { padding:24px; }
.pc-loading,.pc-empty { min-height:180px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:var(--muted); text-align:center; }
.pc-empty strong { color:var(--ink); font-size:18px; }
.pc-empty .btn-secondary { margin-top:14px; }
.pc-section-head { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; margin-bottom:20px; }
.pc-section-head h3 { margin:4px 0 6px; font-size:20px; }
.pc-section-head p { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.pc-start-grid { display:grid; grid-template-columns:1fr 2fr 1fr; gap:16px; }
.pc-start-explainer { margin:20px 0 0; padding:14px 16px; border:1px solid #cbd9e7; background:#f4f8fc; border-radius:12px; display:flex; flex-direction:column; gap:4px; }
.pc-start-explainer span { color:var(--muted); font-size:12px; }
.pc-start-actions { justify-content:flex-end; margin-top:22px; }
.pc-start-actions .btn-primary { min-width:220px; }
.pc-feedback { margin:0 0 16px; border-radius:12px; padding:13px 16px; font-size:13px; font-weight:700; border:1px solid transparent; }
.pc-feedback-info { background:#eef5fb; color:#234d70; border-color:#caddea; }
.pc-feedback-success { background:#edf8f0; color:#27613c; border-color:#bcdcc6; }
.pc-feedback-error { background:#fff1f0; color:#8b2f29; border-color:#efc0bc; }
.pc-feedback-blocking { border-width:2px; }

.pc-history-list { display:flex; flex-direction:column; gap:10px; }
.pc-history-row { width:100%; display:flex; justify-content:space-between; gap:20px; align-items:center; text-align:left; border:1px solid var(--line); background:#fff; border-radius:12px; padding:15px 16px; cursor:pointer; }
.pc-history-row:hover { background:#f7f9fb; border-color:#aab8c6; }
.pc-history-main { display:flex; flex-direction:column; gap:4px; min-width:0; }
.pc-history-main strong { font-size:15px; color:var(--navy); }
.pc-history-main span { color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.pc-history-meta { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:11px; }

.pc-count-identity { display:grid; grid-template-columns:1fr 2fr 1fr 1fr; gap:10px; margin:0 0 18px; }
.pc-count-identity > div { border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fff; min-width:0; }
.pc-count-identity span { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; }
.pc-count-identity strong { display:block; font-size:13px; overflow-wrap:anywhere; }

.pc-scanner-shell { margin:0 0 20px; padding:26px; background:#111c2a; color:#fff; border-radius:18px; box-shadow:0 16px 36px rgba(17,28,42,.14); }
.pc-scanner-state { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:12px; color:#c8d5e2; margin-bottom:20px; }
.pc-scanner-state strong { color:#fff; letter-spacing:.08em; }
.pc-state-dot { width:9px; height:9px; border-radius:50%; background:#5bd08a; box-shadow:0 0 0 4px rgba(91,208,138,.16); }
.pc-recount-chip { margin-left:auto; background:#24364a; color:#e5eef6; border:1px solid #3d536b; border-radius:999px; padding:6px 10px; }
.pc-scan-label { display:block; text-align:center; font-size:15px; font-weight:900; letter-spacing:.14em; margin-bottom:10px; }
.pc-scan-input-wrap { max-width:780px; margin:0 auto; }
.pc-scan-input { width:100%; height:92px; border:4px solid #fff; border-radius:16px; background:#fff; color:#101a27; font-size:42px; line-height:1; font-weight:900; letter-spacing:.08em; text-align:center; padding:12px 18px; box-shadow:0 0 0 6px rgba(255,255,255,.08); transition:border-color .12s, box-shadow .12s, background-color .12s; }
.pc-scan-input:focus { outline:none; border-color:#7da7cf; box-shadow:0 0 0 7px rgba(125,167,207,.22); }
.pc-scan-input.accepted { background:#ecfff2; border-color:#4dbb78; }
.pc-scan-input.rejected { background:#fff0ef; border-color:#d45a50; }
.pc-scan-ready { display:block; margin-top:10px; text-align:center; color:#aebdca; font-size:12px; }
.pc-scan-metrics { display:flex; justify-content:center; gap:12px; flex-wrap:wrap; margin:22px 0 0; }
.pc-scan-metrics > div { min-width:150px; padding:12px 18px; background:#1a2a3d; border:1px solid #30465d; border-radius:12px; text-align:center; }
.pc-scan-metrics span { display:block; color:#aebdca; font-size:10px; text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; }
.pc-scan-metrics strong { display:block; font-size:24px; }
.pc-scan-actions { display:flex; justify-content:center; gap:12px; margin-top:22px; flex-wrap:wrap; }
.pc-scanner-shell .btn-primary,.pc-scanner-shell .btn-secondary { min-width:190px; min-height:44px; font-weight:800; }
.pc-scanner-shell .btn-primary { background:#fff; color:#111c2a; border:2px solid #fff; }
.pc-scanner-shell .btn-secondary { background:transparent; color:#fff; border:2px solid #8295a8; }
.pc-scanner-shell button:disabled { opacity:.55; cursor:not-allowed; }

.pc-live-card,.pc-review-card,.pc-report-table-card { padding:22px; }
.pc-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; }
.pc-table { width:100%; border-collapse:collapse; min-width:820px; margin:0; }
.pc-table th { text-align:left; font-size:10px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); background:#f7f9fb; padding:11px 12px; border-bottom:1px solid var(--line); white-space:nowrap; }
.pc-table td { padding:11px 12px; border-bottom:1px solid #edf0f3; font-size:12px; vertical-align:middle; }
.pc-table tbody tr:last-child td { border-bottom:0; }
.pc-num { text-align:right !important; font-variant-numeric:tabular-nums; }
.pc-barcode { font-variant-numeric:tabular-nums; letter-spacing:.04em; white-space:nowrap; }
.pc-correction-cell { width:62px; text-align:right; }
.pc-minus-button { border:1px solid #bcc7d1; background:#fff; color:#26394e; border-radius:8px; min-width:38px; height:32px; font-size:16px; font-weight:900; cursor:pointer; }
.pc-minus-button:hover { background:#edf2f6; }
.pc-empty-cell { text-align:center; color:var(--muted); padding:28px !important; }
.pc-footer-actions { display:flex; justify-content:flex-end; padding:4px 0 18px; }
.pc-link-danger { border:0; background:transparent; color:#9a3b35; font-weight:700; cursor:pointer; padding:8px; }

.pc-review-head { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:18px; }
.pc-review-head h3 { margin:4px 0 6px; font-size:22px; }
.pc-review-head p { margin:0; color:var(--muted); max-width:700px; font-size:13px; }
.pc-attempt-badge { background:#172537; color:#fff; border-radius:999px; padding:9px 13px; font-size:12px; font-weight:800; white-space:nowrap; }
.pc-review-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px; }
.pc-review-summary > div { border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:#fff; }
.pc-review-summary span { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; margin-bottom:4px; }
.pc-review-summary strong { font-size:21px; }
.pc-result { display:inline-flex; align-items:center; justify-content:center; min-width:82px; border-radius:999px; padding:5px 9px; font-size:10px; font-weight:900; letter-spacing:.04em; }
.pc-result-matched,.pc-result-committed { background:#e9f7ee; color:#2c7044; }
.pc-result-short { background:#fff0ef; color:#9a3b35; }
.pc-result-over { background:#eef4ff; color:#355f9a; }
.pc-result-counting,.pc-result-pending_review,.pc-result-draft { background:#fff7df; color:#775b00; }
.pc-result-cancelled { background:#eef0f2; color:#596572; }
.pc-review-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; flex-wrap:wrap; }
.pc-finalize-button { min-width:210px; }

.pc-report-hero { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:16px; padding:22px 24px; background:#172537; color:#fff; border-radius:16px; }
.pc-report-kicker { font-size:10px; letter-spacing:.1em; color:#b9c7d4; font-weight:800; }
.pc-report-hero h3 { margin:4px 0; font-size:28px; }
.pc-report-hero p { margin:0; color:#c6d2dd; }
.pc-report-actions { display:flex; gap:10px; flex-wrap:wrap; }
.pc-report-hero .btn-primary { background:#fff; border-color:#fff; color:#172537; }
.pc-report-hero .btn-secondary { background:transparent; border:2px solid #8294a6; color:#fff; }
.pc-report-meta { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; padding:0; overflow:hidden; margin-bottom:16px; }
.pc-report-meta > div { padding:13px 15px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); min-width:0; }
.pc-report-meta span,.pc-report-summary span { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em; margin-bottom:4px; }
.pc-report-meta strong { display:block; font-size:12px; overflow-wrap:anywhere; }
.pc-report-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.pc-report-summary > div { border:1px solid var(--line); border-radius:11px; background:#fff; padding:14px 15px; }
.pc-report-summary strong { display:block; font-size:20px; font-variant-numeric:tabular-nums; }
.pc-short-card { border-color:#efc1bd !important; background:#fff8f7 !important; }
.pc-over-card { border-color:#cbdaf0 !important; background:#f7faff !important; }
.pc-short-text { color:#9a3b35; }
.pc-over-text { color:#355f9a; }
.pc-report-table { min-width:1280px; }

#physicalCountView .btn-primary,
#physicalCountView .btn-secondary { border:2px solid #182333; font-weight:700; border-radius:9px; padding:10px 14px; cursor:pointer; }
#physicalCountView .btn-primary { background:#182333; color:#fff; }
#physicalCountView .btn-secondary { background:#fff; color:#182333; }
#physicalCountView .btn-primary:hover:not(:disabled) { background:#34495e; border-color:#34495e; }
#physicalCountView .btn-secondary:hover:not(:disabled) { background:#edf2f6; }
#physicalCountView button:focus-visible,#physicalCountView input:focus-visible,#physicalCountView select:focus-visible { outline:3px solid #4b79a6; outline-offset:3px; }

@media (max-width:900px) {
  .pc-start-grid,.pc-count-identity,.pc-report-meta,.pc-report-summary { grid-template-columns:1fr 1fr; }
  .pc-scan-input { height:78px; font-size:34px; }
  .pc-history-row,.pc-report-hero,.pc-review-head { align-items:flex-start; flex-direction:column; }
  .pc-history-meta { justify-content:flex-start; }
}

@media (max-width:600px) {
  .pc-start-grid,.pc-count-identity,.pc-review-summary,.pc-report-meta,.pc-report-summary { grid-template-columns:1fr; }
  .pc-scanner-shell { padding:20px 14px; border-radius:14px; }
  .pc-scan-input { height:72px; font-size:28px; letter-spacing:.04em; }
  .pc-scan-metrics > div { flex:1 1 130px; min-width:0; }
  .pc-scanner-shell .btn-primary,.pc-scanner-shell .btn-secondary { width:100%; }
}

/* Physical Count confirmation modal — aligned with shared PFI modal foundation */
.pc-start-confirm-modal {
  width: min(620px, 94vw);
  padding: 24px;
}

.pc-start-confirm-modal .section-title {
  margin-bottom: 18px;
}

.pc-confirm-scope {
  display: grid;
  grid-template-columns: 0.8fr 1.7fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}

.pc-confirm-scope > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  background: #f8fafc;
}

.pc-confirm-scope small {
  display: block;
  margin-bottom: 4px;
  color: #748094;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pc-confirm-scope strong {
  display: block;
  color: #202938;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pc-confirm-rule {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #cfdbea;
  border-radius: 10px;
  background: #f4f8fc;
}

.pc-confirm-rule strong {
  color: #202938;
  font-size: 12px;
}

.pc-confirm-rule span {
  color: #667085;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .pc-confirm-scope {
    grid-template-columns: 1fr;
  }

  .pc-start-confirm-modal {
    padding: 20px;
  }

  .pc-start-confirm-modal .receipt-modal-actions {
    flex-direction: column-reverse;
  }

  .pc-start-confirm-modal .receipt-modal-actions button {
    width: 100%;
  }
}

/* ============================================================
   PFI_PHYSICAL_COUNT_SELECTED_STYLES_OFFSET_V1
   ============================================================ */
.pc-scope-section{display:grid;gap:12px;margin-top:14px;}
.pc-style-scope-panel{display:grid;gap:12px;padding:14px;border:1px solid #dce3eb;border-radius:12px;background:#fafbfd;}
.pc-style-scope-panel[hidden]{display:none!important;}
.pc-style-scope-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;}
.pc-style-scope-head strong,.pc-style-scope-head span{display:block;}
.pc-style-scope-head strong{color:#202938;font-size:13px;}
.pc-style-scope-head span{margin-top:3px;color:#748094;font-size:11px;line-height:1.4;}
.pc-scope-count{flex:0 0 auto;padding:5px 8px;border:1px solid #dce3eb;border-radius:999px;background:#fff;color:#4c5a6d!important;font-weight:800;}
.pc-style-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;}
.pc-style-search-row input{min-width:0;}
.pc-style-search-results,.pc-selected-styles{display:grid;gap:7px;}
.pc-style-result{display:flex;justify-content:space-between;gap:14px;width:100%;padding:10px 12px;border:1px solid #dfe5ec;border-radius:10px;background:#fff;color:#202938;text-align:left;cursor:pointer;}
.pc-style-result:hover:not(:disabled){border-color:#aebdd0;background:#f6f9fc;}
.pc-style-result:disabled{cursor:default;opacity:.55;}
.pc-style-result span,.pc-style-result strong,.pc-style-result small{display:block;}
.pc-style-result small{margin-top:2px;color:#748094;}
.pc-style-result em{flex:0 0 auto;color:#667085;font-size:11px;font-style:normal;}
.pc-selected-style{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 12px;border:1px solid #d8e0e9;border-radius:10px;background:#fff;}
.pc-selected-style strong,.pc-selected-style span,.pc-selected-style small{display:block;}
.pc-selected-style span,.pc-selected-style small{margin-top:2px;color:#748094;font-size:10px;}
.pc-style-remove{border:0;background:transparent;color:#9a3e3e;font-size:10px;font-weight:800;cursor:pointer;}
.pc-style-empty{padding:10px 12px;border:1px dashed #d5dde7;border-radius:9px;color:#748094;font-size:11px;}
.pc-style-error{color:#9a3e3e;}
.pc-style-review-card{margin-top:14px;}
.pc-style-review-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:12px 0;}
.pc-style-review-summary>div{padding:10px;border:1px solid #e1e6ec;border-radius:9px;background:#fafbfd;}
.pc-style-review-summary span,.pc-style-review-summary strong{display:block;}
.pc-style-review-summary span{color:#748094;font-size:9px;font-weight:800;text-transform:uppercase;}
.pc-style-review-summary strong{margin-top:4px;color:#202938;font-size:16px;}
.pc-style-review-list{display:grid;gap:8px;}
.pc-style-review-row{display:grid;grid-template-columns:minmax(150px,1.2fr) minmax(320px,2fr) auto;gap:12px;align-items:center;padding:11px 12px;border:1px solid #e1e6ec;border-radius:10px;background:#fff;}
.pc-style-review-row>div:first-child strong,.pc-style-review-row>div:first-child span{display:block;}
.pc-style-review-row>div:first-child span{margin-top:2px;color:#748094;font-size:10px;}
.pc-style-review-numbers{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;}
.pc-style-review-numbers span{display:grid;gap:2px;color:#748094;font-size:9px;}
.pc-style-review-numbers b{color:#202938;font-size:12px;}
.pc-style-review-result{padding:6px 8px;border-radius:999px;background:#f2f4f7;color:#475467;font-size:9px;font-weight:900;white-space:nowrap;}
@media (max-width:900px){.pc-style-review-summary{grid-template-columns:repeat(3,minmax(0,1fr));}.pc-style-review-row{grid-template-columns:1fr;}.pc-style-review-numbers{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media (max-width:680px){.pc-style-search-row{grid-template-columns:1fr;}.pc-style-search-row .btn-secondary{width:100%;}.pc-style-review-summary{grid-template-columns:repeat(2,minmax(0,1fr));}.pc-style-review-numbers{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* ============================================================
   PFI_PHYSICAL_COUNT_THEMED_CONFIRM_V1
   ============================================================ */

body.pc-modal-open {
  overflow: hidden;
}

.pc-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(4px);
}

.pc-confirm-modal[hidden] {
  display: none !important;
}

.pc-confirm-modal-card {
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18), 0 6px 14px rgba(15, 23, 42, 0.08);
}

.pc-confirm-modal-head {
  display: grid;
  gap: 8px;
}

.pc-confirm-modal-head .eyebrow {
  margin: 0;
}

.pc-confirm-modal-head h3 {
  margin: 0;
  color: #18212f;
  font-size: 24px;
  line-height: 1.2;
}

.pc-confirm-modal-head p {
  margin: 0;
  color: #5e6b7f;
  font-size: 15px;
  line-height: 1.6;
}

.pc-confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .pc-confirm-modal-card {
    padding: 18px;
    border-radius: 16px;
  }

  .pc-confirm-modal-actions {
    flex-direction: column-reverse;
  }

  .pc-confirm-modal-actions .btn-secondary,
  .pc-confirm-modal-actions .btn-primary {
    width: 100%;
  }
}
