/* Suncoast interface refresh. Visual rules only; inventory and scan behavior live in index.html. */
:root {
  --bg: #f7f8fb;
  --card: #fff;
  --line: #e3e8f0;
  --text: #202a3b;
  --muted: #68768c;
  --accent: #0b5fff;
  --blue: #0b5fff;
  --blue-soft: #edf3ff;
  --shadow: 0 2px 8px rgba(26, 42, 73, .025), 0 12px 30px rgba(26, 42, 73, .045);
  --radius: 20px;
}
html { scroll-behavior: smooth; }
body { background: var(--bg); }
button, input, select, textarea { font-family: "Inter", system-ui, sans-serif; }
button { cursor: pointer; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
button:hover { filter: none; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(11,95,255,.45); outline-offset: 2px; }
input, select, textarea { min-height: 42px; }
input:focus, select:focus, textarea:focus { border-color: #78a6ff; box-shadow: 0 0 0 3px rgba(11,95,255,.10); }
input::placeholder { color: #97a2b2; }
.lb-top {
  padding: 12px clamp(16px, 2.5vw, 36px);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #e7ebf2;
  box-shadow: 0 4px 18px rgba(31,46,79,.035);
}
.lb-brand .mark { background: #ff46a2; border-radius: 13px; }
.brand-name { font-size: 17px; color: #202a3b; }
.pill-nav { scrollbar-width: none; gap: 4px; }
.pill-nav::-webkit-scrollbar { display: none; }
.pill-tab { flex: 0 0 auto; padding: 10px clamp(12px,1.4vw,20px); color: #627087; border-radius: 12px; font-size: 13px; }
.pill-tab:hover { background: #f1f4f9; }
.pill-tab.on { background: #eaf1ff; color: #0b5fff; box-shadow: inset 0 0 0 1px #cfdefc; }
.lb-user button.ghost { min-height: 40px; border-radius: 12px; }
.lb-user button.ghost:hover { background: #f4f7fc; }
.workspace { min-height: calc(100vh - 70px); }
.workspace .view, .subnav-bar, .status-slim { max-width: 1380px; }
.subnav-bar { padding-top: 12px; }
.subnav { border: 1px solid #e4e9f2; box-shadow: 0 3px 14px rgba(31,46,79,.035); }
.subnav button { min-height: 36px; }
.subnav button.on { background: #eaf1ff; color: #0b5fff; }
.page-head { margin-bottom: 24px; align-items: end; }
.page-head h1 { font-weight: 750; font-size: clamp(28px,3vw,38px); letter-spacing: -.055em; color: #202a3b; }
.page-head.compact h1 { font-size: clamp(26px,2.5vw,34px); }
.page-head .lede { font-size: 13px; color: #718096; }
.page-head .eyebrow { color: #ed4394; }
.card, .stats div, .stage, .buy-hero, .report-grid .kpi-card {
  border: 1px solid #e4e9f1;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 20px;
}
.card { padding: clamp(16px,2vw,24px); }
.card h2, .session-list h2 { font-size: 17px; color: #263149; }
.stats { gap: 12px; }
.stats div { padding: 17px 20px; }
.stats span { color: #718096; }
.stats strong { color: #202a3b; font-variant-numeric: tabular-nums; }
button.ghost { border-color: #dfe5ee; color: #30415c; background: #fff; }
button.ghost:hover { background: #f5f8ff; border-color: #bfcfea; }
button:not(.ghost):not(.pill-tab):not(.hit-btn):not(.pos-row):not(.danger):not(.undo-btn):hover { background: #004cd4; }
button.danger:hover, .undo-btn:hover { background: #c9143e; }
.hint, .lede { line-height: 1.5; }
.filter-row { gap: 7px; }
.filter-row button.ghost { min-height: 38px; box-shadow: none; }
.filter-row button.on { background: #eaf1ff; color: #0b5fff; border-color: #cfdefc; }
.table-card { padding: 8px; }
.table-card .card-head { padding: 14px 16px 8px; }
.lb-table td { padding: 15px 16px; }
.lb-table tbody tr:hover td { background: #f8faff; }
.row, .trow { border-color: #e5eaf2; border-radius: 14px; padding: 12px 14px; }
.row:hover, .trow:hover { border-color: #cbd8ef; }
.sheet { border: 1px solid #e2e8f0; box-shadow: 0 -20px 60px rgba(22,33,58,.14); }
.auth-card { border-radius: 22px; box-shadow: 0 24px 70px rgba(31,46,79,.12); }
.auth-card input { background: #fff; color: var(--text); }
.undo-toast { box-shadow: 0 14px 36px rgba(22,33,58,.17); }

/* Seller scan workspace: clear current state, clear previous scans, no competing stats. */
body.live-ui #view-scan { max-width: 1160px; }
body.live-ui #stage {
  border: 1px solid #dfe6f0;
  border-top: 5px solid #0b5fff;
  box-shadow: 0 14px 34px rgba(31,46,79,.07);
  padding: clamp(20px,3vw,36px);
}
body.live-ui #stage.ok { border-top-color: #14885a; box-shadow: 0 14px 34px rgba(31,46,79,.07), inset 0 0 0 1px #bbebd3; }
body.live-ui #stage.unknown { border-top-color: #c27a00; }
body.live-ui #stage .pname { color: #1e2a3b; letter-spacing: -.05em; }
body.live-ui #auctionLine { border-radius: 10px; font-weight: 750; }
body.live-ui #readyLabel { letter-spacing: .04em; }
body.live-ui .live-controls { border-radius: 20px; box-shadow: var(--shadow); padding: clamp(16px,2vw,24px); }
body.live-ui #undoScan { color: #ae3443; background: #fff6f6; border-color: #f2d2d6; }
body.live-ui #undoScan:hover { background: #ffebee; }
body.live-ui #sessionRows { max-height: 430px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
body.live-ui #sessionRows .row:first-child { border-color: #bcd0ff; background: #f4f8ff; }
body.live-ui #liveBoardStrip { gap: 10px; }
body.live-ui .board-strip-kpi { border: 1px solid #e4e9f1; background: #fff; border-radius: 15px; }
body.live-ui .board-strip-kpi strong { font-size: 21px; }
body.live-ui .board-strip-kpi.pending strong { color: #a26700; }

/* PO receiving: control selection and count first, scanner remains the focal point. */
body.po-ui #view-scan { max-width: 1160px; }
body.po-ui #poChrome > .card { padding: clamp(18px,2vw,26px); border-radius: 20px; }
body.po-ui #poChrome > .card h2 { font-size: 21px; margin: 0 0 5px; }
body.po-ui .po-pick { gap: 14px; margin: 18px 0 14px; }
body.po-ui .po-pick select { width: 100%; }
body.po-ui #poChrome .already-sold { background: #f7f9fd; border-radius: 12px; }
body.po-ui #poChrome .already-sold.on { background: #fff7e7; border-color: #e9c987; }
body.po-ui #poStats { margin-top: 14px; }
body.po-ui #stage { border: 1px solid #dfe6f0; border-left: 5px solid #0b5fff; text-align: left; min-height: 0; padding: clamp(20px,2.5vw,30px); }
body.po-ui #stage.ok { border-left-color: #128a5b; }
body.po-ui #stage.unknown { border-left-color: #b57300; }
body.po-ui #stage .pname { font-size: clamp(27px,3.2vw,40px); min-height: 0; }
body.po-ui #stage .qtyline { justify-content: flex-start; flex-wrap: wrap; }
body.po-ui #readyLabel { letter-spacing: .06em; }
body.po-ui #poLineRows { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
body.po-ui #poUndo { color: #a73b48; }
body.po-ui #poBatchQty { font-weight: 700; font-variant-numeric: tabular-nums; }
body.po-ui .manual-wrap { margin-top: 14px; }

/* Live board: financial signal first, supporting controls stay quiet. */
.board-shell { max-width: 1380px; }
.board-hero { gap: 14px; }
.board-kpi { background: #fff; border: 1px solid #e4e9f1; border-radius: 19px; box-shadow: var(--shadow); min-height: 116px; }
.board-kpi .lbl { color: #738096; letter-spacing: .06em; }
.board-kpi .num { color: #202a3b; font-size: clamp(27px,3vw,39px); }
.board-kpi.good .num { color: #087a52; }
.board-kpi.bad .num { color: #ba2d2d; }
.board-kpi.pending .num { color: #a26700; }
.board-kpis-meta { margin-top: 14px; gap: 12px; }
.board-kpi.compact { border-radius: 16px; }
.board-toolbar { align-items: center; gap: 10px; }
.board-toolbar button { min-height: 42px; }
.board-toolbar .conn-chip { margin-right: auto; }
#view-board .session-list { margin-top: 26px; }
#view-board .session-list > h2 { margin-bottom: 12px; }
#boardLots { max-height: 780px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.lot-card { border-radius: 18px; }
.lot-money { background: #f8f6f1; }
.price-real { color: #087a52; }
.mock-banner { border-style: solid; }
.board-tools { margin-top: 10px; }
.board-tools summary { width: fit-content; cursor: pointer; color: #65748c; font-size: 12px; font-weight: 650; padding: 6px 2px; }
.board-tools .btnrow { padding: 8px 0; }
.board-tools button.ghost { font-size: 12px; }

/* Purchasing, catalog, reports, inventory: consistent surfaces and readable rows. */
.buy-hero { padding: clamp(20px,2.5vw,30px); }
.buy-hero h2 { font-size: clamp(22px,2.5vw,30px); }
#view-buy .card, #view-pos .card, #view-stock .card, #view-catalog .card,
#view-inv .card, #view-reports .card { margin-bottom: 16px; }
#view-reports .report-grid { gap: 14px; }
#view-reports .kpi-card { min-height: 132px; border: 1px solid #e4e9f1; }
#view-onhand .toolbar input, #view-inv .toolbar input, #view-stock .toolbar input { max-width: 480px; }
#view-onhand .table, #view-lots .table { gap: 8px; }
button.pos-row { box-shadow: none; }
button.pos-row:hover { background: #f8faff; border-color: #a7bde6; }
.pos-status.open { background: #e7f8ef; color: #087a52; }
.pos-status.partial { background: #fff5e1; color: #9b6500; }
.pos-status.closed { background: #eff2f7; color: #66758b; }


/* Order lookup and read-only reconciliation details. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.order-search { margin-top: 4px; }
.order-search input { width: min(100%, 460px); max-width: 460px; padding: 11px 14px; border-radius: 12px; }
.order-open {
  padding: 0;
  min-height: 0;
  background: none;
  border: 0;
  color: #145bd9;
  text-align: left;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.order-open:hover { background: none !important; color:#003baf; text-decoration: underline; }
.order-open:active { transform: none; }
.order-dialog {
  width: min(600px, calc(100vw - 28px));
  max-height: min(82vh, 760px);
  overflow-y: auto;
  border: 1px solid #e0e6ef;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(15,27,50,.25);
  padding: 24px;
  color: var(--text);
}
.order-dialog::backdrop { background: rgba(19,29,49,.48); }
.order-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.order-dialog-head h2 { margin:0; font-size:22px; letter-spacing:-.035em; }
.order-dialog h3 { font-size:15px; margin:22px 0 8px; }
.order-detail-facts { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.order-detail-facts div { padding:13px 14px; border-radius:13px; background:#f5f7fb; min-width:0; }
.order-detail-facts span { display:block; font-size:11px; color:#718096; margin-bottom:3px; }
.order-detail-facts strong { overflow-wrap:anywhere; font-size:14px; }
.order-item-list { list-style:none; margin:0; padding:0; border-top:1px solid #e7ebf2; }
.order-item-list li { display:flex; justify-content:space-between; gap:12px; padding:13px 2px; border-bottom:1px solid #e7ebf2; }
.order-item-list b { font-weight:650; }
.order-item-list span { white-space:nowrap; color:#68768c; }
@media (max-width:560px) {
  .order-dialog { padding:18px; }
  .order-detail-facts { grid-template-columns:1fr; }
}

/* Responsive navigation and touch-friendly controls. */
@media (max-width: 1279px) {
  .lb-top { gap: 10px; }
  .pill-nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .pill-tab { min-width: max-content; flex: 0 0 auto; }
}
@media (max-width: 720px) {
  .lb-top { padding: 10px 14px 8px; }
  .lb-brand { min-width: 0; }
  .lb-user { gap: 5px; }
  .lb-user #settingsBtn, .lb-user #signOutBtn { padding: 7px 9px; min-height: 38px; font-size: 12px; }
  .pill-nav { margin: 0 -14px; padding: 4px 14px 2px; width: calc(100% + 28px); }
  .pill-tab { min-height: 42px; padding: 9px 14px; }
  .workspace .view { padding: 20px 14px 54px; }
  .subnav-bar { padding-left: 14px; padding-right: 14px; overflow-x: auto; }
  .subnav { white-space: nowrap; }
  .page-head { gap: 9px; }
  .page-head h1 { font-size: 28px; }
  .page-head .lede { font-size: 13px; }
  .card { padding: 16px; }
  .board-hero, .board-kpis-meta, body.live-ui #liveBoardStrip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .board-kpi { min-height: 100px; padding: 15px; }
  .board-kpi .num { font-size: clamp(24px,6vw,31px); }
  .board-toolbar .conn-chip { width: 100%; margin: 0; }
  .board-toolbar button { flex: 1 1 auto; }
  .lot-card { grid-template-columns: 1fr; }
  .lot-money { text-align: left; }
  body.po-ui .po-pick { grid-template-columns: 1fr; }
  body.po-ui #stage { padding: 22px 18px; }
  body.live-ui #stage { padding: 22px 18px; }
  body.live-ui #sessionRows, #boardLots { max-height: 60vh; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row button { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 430px) {
  .lb-user .role-chip { display: none; }
  .stats, .board-hero, .board-kpis-meta { gap: 8px; }
  .stats strong { font-size: 19px; }
  .board-kpi .num { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button { transition: none; }
}
