/* Shelfline application, wide screens first. The phone app layout is in mobile.css. */
.app-body { --bar: 40px; }
.app-body .demo-bar { position: sticky; top: 0; z-index: 15; height: var(--bar); flex-wrap: nowrap; white-space: nowrap; }
.shell { --side: 244px; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--bar)); }
.sidebar { position: sticky; top: var(--bar); align-self: start; display: flex; flex-direction: column; gap: 18px; height: calc(100vh - var(--bar)); padding: 16px 10px; background: var(--navy); color: #dcdcd8; overflow-y: auto; }
.sidebar .brand { padding: 0 8px; color: #fff; }
.sidebar nav ul { display: grid; gap: 1px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; min-height: 39px; padding: 0 10px; border-radius: 6px; color: #cbcbc6; font-weight: 500; text-decoration: none; }
.sidebar nav a:hover { background: #35383c; color: #fff; }
.sidebar nav a.is-active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: inset 4px 0 0 var(--accent); }
.sidebar nav a.is-active .icon { color: var(--accent); }
.sidebar nav a .pill { margin-left: auto; }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.pill-accent { background: var(--accent); color: #fff; }
.sidebar-foot { display: grid; gap: 6px; margin-top: auto; }
.whoami { display: flex; align-items: center; gap: 10px; padding: 12px 4px 4px; border-top: 1px solid #45484d; line-height: 1.3; }
.whoami strong { display: block; color: #fff; font-size: 14.5px; }
.whoami div span { font-size: 13px; color: #b4b6ba; }
.avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-dark); font-size: 13.5px; font-weight: 700; }
.side-btn { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: #cbcbc6; font-size: 14px; cursor: pointer; text-align: left; }
.side-btn:hover { background: #35383c; color: #fff; }
.scrim { display: none; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: var(--bar); z-index: 10; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--bg); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.menu-btn { display: none; }
.global-search { position: relative; flex: 1; max-width: 430px; }
.global-search > .icon { position: absolute; left: 12px; top: 11px; color: var(--ink-2); }
.global-search input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.results, .popover { position: absolute; z-index: 20; top: 46px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 14px 32px -12px rgba(32, 33, 36, .35); }
.results { left: 0; right: 0; padding: 6px; }
.results a, .popover li a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.results a:hover, .popover li a:hover { background: var(--accent-tint); }
.results span, .popover li span { display: block; font-size: 13.5px; color: var(--ink-2); }
.results .none { padding: 8px 10px; color: var(--ink-2); }
.site-chip { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.bell-wrap { position: relative; }
.popover { right: 0; width: min(340px, calc(100vw - 28px)); padding: 12px; }
.popover h2 { font-size: 14.5px; padding: 0 10px 6px; }
.popover p { padding: 0 10px 8px; }
.popover-all { display: block; padding: 8px 10px 2px; font-weight: 600; font-size: 14px; }
.dot { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 19px; text-align: center; }

.content { max-width: 1280px; padding: 22px 24px 56px; }
.content > * + * { margin-top: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head h1, .record-head h1, .locked h1 { font: 700 29px/1.15 var(--head); letter-spacing: .002em; }
.page-head p { color: var(--ink-2); margin-top: 2px; }
.page-actions, .actionbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.actionbar:empty { display: none; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 600; text-decoration: none; font-size: 14.5px; }
.back + .record-head { margin-top: 4px; }
.record-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.record-head > div:first-child { min-width: 0; }
.record-head p { color: var(--ink-2); }
.record-id { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 2px; }
.record-id .sku { font-size: 14px; color: var(--ink); }
.section-title, .card h2, .card-head h2 { font: 700 18px/1.25 var(--head); letter-spacing: .005em; }

.card { min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.card-head a { font-size: 14px; font-weight: 600; }
.card h2 + * { margin-top: 10px; }
.card-head + * { margin-top: 0; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.columns-wide { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.columns-one { grid-template-columns: minmax(0, 1fr); }
.column { display: grid; gap: 16px; min-width: 0; }
.muted { color: var(--ink-2); }
.hint { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.late { color: var(--danger); font-weight: 600; }
.upnote { color: var(--info); }
.up { color: var(--ok); }
.down { color: var(--danger); }
.nowrap { white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat { display: flex; flex-direction: column; padding: 13px 18px; color: var(--ink); text-decoration: none; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.stat:hover { background: #fbf5e6; }
.stat-name { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.stat-value { font: 700 32px/1.2 var(--head); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13.5px; color: var(--ink-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 5px; font-size: 13px; font-weight: 600; line-height: 1.55; white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.tone-ok { background: var(--ok-tint); color: var(--ok); }
.tone-neutral { background: var(--soft); color: #3c3e43; }
.tone-warn { background: var(--warn-tint); color: var(--warn); }
.tone-danger { background: var(--danger-tint); color: var(--danger); }
.tone-info { background: var(--info-tint); color: var(--info); }
.tone-wait { background: var(--wait-tint); color: var(--wait); }

/* Filters */
.filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.filter-selects { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-selects:empty { display: none; }
.filter { display: grid; gap: 2px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.filter select { min-height: 40px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 400; }
.filter-inline select { min-height: 36px; }
.searchfield { display: flex; align-items: center; gap: 9px; flex: 1 1 250px; max-width: 380px; min-height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.searchfield:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.searchfield input { flex: 1; min-width: 0; height: 38px; border: 0; background: none; color: var(--ink); outline: none; }
.tabs { display: flex; gap: 4px; max-width: 100%; padding: 4px; overflow-x: auto; background: var(--soft); border-radius: 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer; user-select: none; }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(32, 33, 36, .18); }
.segmented { display: inline-flex; gap: 3px; padding: 4px; border-radius: 10px; background: var(--soft); }
.segmented button { min-height: 38px; padding: 0 18px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.segmented button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(32, 33, 36, .18); }
.content > .segmented { display: flex; width: fit-content; max-width: 100%; }
.list-count { margin-bottom: 8px; color: var(--ink-2); font-size: 14px; }

/* Tables */
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
th { padding: 10px 10px; background: #fafaf8; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-href] { cursor: pointer; }
tbody tr:hover { background: #fbf7ec; }
.num { text-align: right; }
.grow { width: 34%; min-width: 180px; }
@media (min-width: 761px) { td:not(.grow) { white-space: nowrap; } }
th button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
th button i { width: 0; height: 0; border-inline: 4px solid transparent; }
th button i.up { border-bottom: 5px solid var(--accent); }
th button i.down { border-top: 5px solid var(--accent); }
.cell-main { display: block; line-height: 1.35; }
.cell-main small { display: block; color: var(--ink-2); font-size: 13px; }
.qty { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.qty .icon { width: 14px; height: 14px; }
.qty-low { color: var(--warn); font-weight: 700; }
.qty-out { color: var(--danger); font-weight: 700; }
.card:not(.card-flush) > .table-wrap { margin-inline: -18px; }
.card > .table-wrap th:first-child, .card > .table-wrap td:first-child { padding-left: 18px; }
.card > .table-wrap th:last-child, .card > .table-wrap td:last-child { padding-right: 18px; }
.list-empty { padding: 8px; }
.empty { padding: 22px 16px; text-align: center; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--ink-2); margin: 2px 0 0; }
.empty .btn { margin-top: 12px; }
.meter-wrap { display: grid; gap: 3px; min-width: 96px; }
.meter { display: block; height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter-wrap small { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* Lists on dashboards */
.feed-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--soft); color: var(--accent-dark); }
.feed > li { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; }
.feed > li + li, .queue > li + li, .approve-list > li + li, .alert-list > li + li, .doc-list > li + li { border-top: 1px solid var(--line); }
.feed > li > div { display: grid; flex: 1; min-width: 0; line-height: 1.4; }
.feed > li > div > span { font-size: 14.5px; }
.feed small { color: var(--ink-2); font-size: 13px; }
.feed > li > b, .feed-end { font-variant-numeric: tabular-nums; }
.feed > li > b { font-size: 16px; }
.feed-end { display: grid; justify-items: end; }
.feed-end b { font-size: 16px; }
.queue a { display: flex; align-items: center; gap: 12px; padding: 11px 0; color: var(--ink); text-decoration: none; }
.queue a:hover strong { color: var(--accent-dark); }
.queue-main { display: grid; flex: 1; min-width: 0; line-height: 1.38; }
.queue-main span { color: var(--ink-2); font-size: 14.5px; }
.queue-main small { font-size: 13px; color: var(--ink-2); }
.queue-main small.late { color: var(--danger); }
.queue-go { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--accent-dark); font-weight: 700; font-size: 14.5px; }
.approve-list > li { display: flex; flex-wrap: wrap; gap: 10px 12px; padding: 12px 0; }
.approve-list > li:first-child, .alert-list > li:first-child, .doc-list > li:first-child, .queue > li:first-child a, .feed > li:first-child { padding-top: 2px; }
.approve-main { display: grid; flex: 1 1 220px; min-width: 0; line-height: 1.4; }
.approve-main small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.approve-main a { font-weight: 700; color: var(--ink); text-decoration: none; }
.approve-main a:hover { color: var(--accent-dark); text-decoration: underline; }
.approve-main span { color: var(--ink-2); font-size: 14.5px; }
.approve-actions { display: flex; gap: 6px; align-self: center; }
.alert-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; }
.alert-list > li > a { display: grid; flex: 1 1 230px; min-width: 0; color: var(--ink); text-decoration: none; line-height: 1.4; }
.alert-list > li > a strong { font-size: 15px; font-weight: 600; }
.alert-list small { color: var(--ink-2); font-size: 13.5px; }
.alert-list small .sku { margin-right: 6px; color: var(--ink); }
.alert-list > li > div { display: flex; align-items: center; gap: 8px; }
.doc-list > li > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.doc-list > li > a > span:first-child { display: grid; min-width: 0; line-height: 1.4; }
.doc-list small { color: var(--ink-2); font-size: 13.5px; }
.doc-end { display: grid; justify-items: end; flex: none; font-size: 14px; font-weight: 600; }
.doc-end em { font-style: normal; color: var(--danger); font-size: 13px; }
.lane { display: flex; align-items: center; gap: 7px; }
.lane .icon { width: 16px; height: 16px; color: var(--accent); }

/* One item */
.sitecards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sitecards-1 { grid-template-columns: minmax(0, 1fr); }
.sitecards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sitecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.sitecard.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sitecard > button { display: grid; gap: 2px; width: 100%; padding: 14px 16px 8px; border: 0; background: none; text-align: left; cursor: pointer; }
.sitecard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sitecard-top strong { font: 700 18px/1.2 var(--head); }
.sitecard-big { color: var(--ink-2); }
.sitecard-big b { font: 700 34px/1.2 var(--head); color: var(--ink); font-variant-numeric: tabular-nums; }
.sitecard dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.sitecards-1 dl { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sitecard dt { font-size: 13px; color: var(--ink-2); }
.sitecard dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.elsewhere { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-2); }
.tally { margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--ink); font-size: 14.5px; text-align: right; }

/* Document progress */
.steps { display: flex; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.steps li { position: relative; display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; line-height: 1.25; color: var(--ink-2); }
.steps li + li::before { content: ""; flex: 1; min-width: 10px; height: 2px; margin: 0 6px 0 14px; background: var(--line); order: -1; }
.steps li + li { flex: 1.6; }
.steps li.is-done + li::before, .steps li.is-done + li.is-now::before { background: var(--accent); }
.steps i { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 99px; border: 2px solid var(--line-2); font-style: normal; font-size: 13px; font-weight: 700; }
.steps i .icon { width: 15px; height: 15px; }
.steps .is-done i { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps .is-now { color: var(--ink); }
.steps .is-now i { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark); }
.steps span { display: grid; font-size: 14px; font-weight: 600; }
.steps small { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.steps-dead, .callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); background: var(--soft); }
.callout { background: var(--info-tint); }
.callout-warn { background: var(--warn-tint); }
.callout .icon, .steps-dead .icon { margin-top: 2px; }

/* Lines on a purchase order, dispatch, transfer or count */
.lines { container-type: inline-size; }
.lines > .line { padding: 14px 0; }
.lines > .line:first-child { padding-top: 2px; }
.lines > .line + .line { border-top: 1px solid var(--line); }
.line.is-done { background: #f3f8f1; box-shadow: 0 0 0 8px #f3f8f1; }
.line-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.line-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.line-id > div { display: grid; min-width: 0; line-height: 1.35; }
.line-id strong { font-weight: 600; }
.line-sku { font-size: 15px; }
.bin { display: grid; place-items: center; flex: none; min-width: 78px; padding: 5px 8px; border-radius: 6px; background: var(--navy); color: #fff; font: 600 14px/1.25 var(--mono); }
.bin small { font: 500 11.5px/1.2 var(--font); color: #c6c7ca; }
.line-money { display: grid; justify-items: end; font-weight: 700; line-height: 1.3; }
.line-money small { font-weight: 400; font-size: 13px; color: var(--ink-2); }
.line-facts { display: flex; flex-wrap: wrap; gap: 2px 20px; margin-top: 8px; color: var(--ink-2); font-size: 14.5px; }
.line-facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.line-facts .late b { color: var(--danger); }
.line-inputs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-top: 10px; }
.line-inputs .reason { flex: 0 1 240px; }
.stepper > span { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stepper > div { display: flex; align-items: stretch; width: 160px; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stepper button { display: grid; place-items: center; flex: none; width: 44px; border: 0; background: var(--soft); cursor: pointer; }
.stepper button:active { background: var(--accent-tint); }
.stepper input { flex: 1; min-width: 0; width: 100%; height: 42px; border: 0; background: none; text-align: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.line-error { display: flex; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--danger-tint); color: var(--danger); font-weight: 600; font-size: 14.5px; }
@container (min-width: 820px) {
  .line:has(> .line-inputs), .line:has(> .line-facts):not(:has(.line-money, .picked)) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; align-items: center; }
  .line > .line-inputs { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; justify-content: flex-end; }
  .line:has(> .line-facts):not(:has(> .line-inputs, .line-money, .picked)) > .line-facts { grid-column: 2; grid-row: 1; margin-top: 0; justify-content: flex-end; }
  .line > .line-error { grid-column: 1 / -1; }
}
.picked { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 700; }
.formbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.formbar > span { margin-right: auto; color: var(--ink-2); font-weight: 600; }
.notefield { margin-top: 10px; }
.receipts > li { padding: 10px 0; }
.receipts > li:first-child { padding-top: 0; }
.receipts > li + li { border-top: 1px solid var(--line); }
.receipts p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.receipts p span { color: var(--ink-2); font-size: 14px; }
.receipts ul li { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-size: 14.5px; }
.facts > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; }
.facts > div + div { border-top: 1px solid var(--line); }
.facts dt { flex: none; color: var(--ink-2); }
.facts dd { min-width: 0; text-align: right; overflow-wrap: anywhere; font-weight: 500; }

/* Warehouses, adjustments, suppliers, reports */
.loc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.loccard { display: flex; flex-direction: column; }
.loccard h2 { display: flex; align-items: center; gap: 9px; }
.loccard h2 .icon { color: var(--accent); }
.loccard dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.loccard dt { color: var(--ink-2); }
.loccard dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.loccard .btn { margin-top: auto; align-self: flex-start; }
.loccard dl { margin-bottom: 12px; }
.adj-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.adj-list > li { display: flex; flex-direction: column; gap: 6px; }
.adj-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adj-top > span { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.adj-top > b { font: 700 24px/1 var(--head); }
.adj-item { line-height: 1.35; }
.adj-by { color: var(--ink-2); font-size: 14px; }
.adj-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.supplier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.supplier-grid > li { display: flex; flex-direction: column; gap: 6px; }
.supplier-grid .card-head { margin: 0; }
.supplier-contact { display: grid; font-size: 14.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.supplier-grid dl { display: flex; gap: 22px; padding-top: 8px; border-top: 1px solid var(--line); }
.supplier-grid dt { font-size: 13px; color: var(--ink-2); }
.supplier-grid dd { font-weight: 700; }
.supplier-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.exportbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.exportbar > span { display: inline-flex; align-items: center; gap: 8px; margin-right: 4px; font-weight: 600; }
.locked { max-width: 520px; margin: 48px auto; text-align: center; }
.locked > .icon { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--accent); }
.locked p { margin: 8px 0 18px; color: var(--ink-2); }

/* Role choice */
.signin { max-width: 760px; margin: 0 auto; padding: 44px 20px 64px; text-align: center; }
.signin h1 { margin-top: 30px; font: 700 clamp(28px, 4vw, 38px)/1.12 var(--head); }
.signin-sub { max-width: 52ch; margin: 8px auto 0; color: var(--ink-2); }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; text-align: left; }
.role { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; height: 100%; padding: 22px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.role:hover { border-color: var(--accent); transform: translateY(-2px); }
.role-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-dark); }
.role-icon .icon { width: 24px; height: 24px; }
.role-title { margin-top: 10px; font: 700 22px/1.2 var(--head); }
.role-name { color: var(--accent-dark); font-weight: 600; }
.role-points { display: grid; gap: 7px; margin-top: 12px; color: var(--ink-2); }
.role-points > span { display: flex; gap: 8px; }
.role-points .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }
.noscript { padding: 40px; text-align: center; }

/* Popups: the title and buttons stay in view while the fields scroll */
dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 12px; color: var(--ink); overflow: hidden; box-shadow: 0 30px 70px -20px rgba(32, 33, 36, .55); }
dialog::backdrop { background: rgba(28, 29, 32, .58); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.modal-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 20px/1.2 var(--head); }
.modal-body { min-height: 0; padding: 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > * + * { margin-top: 12px; }
.modal-foot { display: flex; flex: none; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.wide { grid-column: 1 / -1; }
.modal-note { color: var(--ink-2); }
.modal-note strong { color: var(--ink); }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.field input:disabled { background: var(--soft); }
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.error { display: block; color: var(--danger); font-size: 13.5px; font-weight: 600; }
.error:empty { display: none; }
.form-error { padding: 9px 12px; border-radius: var(--radius); background: var(--danger-tint); color: var(--danger); font-weight: 600; }
.linerows { display: grid; gap: 10px; }
.linerow { display: grid; grid-template-columns: minmax(0, 1fr) 100px 40px; gap: 8px; align-items: start; }
.linerow.has-cost { grid-template-columns: minmax(0, 1fr) 92px 112px 40px; }
.linerow-x { margin-top: 23px; height: 42px; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 40px; padding: 8px 0; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.checklist legend, .sitegrid legend { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.checklist > div { margin-top: 4px; border-top: 1px solid var(--line); }
.checklist .check { border-bottom: 1px solid var(--line); }
.checklist .sku { margin-right: 6px; color: var(--accent-dark); }
.sitegrid > .form-grid { margin-top: 10px; }
.sitegrid .hint { margin-top: 2px; }

.toasts { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: var(--radius); background: var(--navy); color: #fff; box-shadow: 0 12px 28px -12px rgba(32, 33, 36, .6); }
.toast .icon { margin-top: 2px; color: #9fd6a6; }
.toast-warn .icon { color: #ffc35c; }

@media (max-width: 1240px) {
  .hide-md { display: none; }
}
@media (max-width: 1120px) {
  .columns, .columns-wide { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sitecards-3 dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loc-grid, .supplier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sitecards-1 dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 260px; height: 100dvh; visibility: hidden; transform: translateX(-100%); transition: transform .2s ease, visibility .2s; }
  .menu-open .sidebar { visibility: visible; transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; border: 0; background: rgba(28, 29, 32, .5); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 56px; }
  .adj-list { grid-template-columns: minmax(0, 1fr); }
  .steps { flex-wrap: wrap; gap: 8px 18px; }
  .steps li, .steps li + li { flex: 0 0 auto; }
  .steps li + li::before { display: none; }
}
@media (max-width: 860px) {
  .site-chip { display: none; }
  .bell-wrap { margin-left: auto; }
  .loc-grid { grid-template-columns: minmax(0, 1fr); }
  .sitecards-3, .sitecards-2 { grid-template-columns: minmax(0, 1fr); }
  .sitecards-3 dl, .sitecards-2 dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .roles { grid-template-columns: minmax(0, 1fr); }
  .linerow, .linerow.has-cost { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .linerow-item { grid-column: 1 / -1; }
  .linerow:not(.has-cost) > .field:nth-of-type(2) { grid-column: 1 / 3; }
  .linerow-x { width: 44px; height: 44px; }
}

.role-short { display: none; }
