/*
 * Woodland Retail Partner Portal — design tokens + auth screens (FRONTEND_REFERENCE).
 */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --pine: #004648;
  --pine-ink: #002f30;
  --karaka: #00a079;
  --karaka-deep: #007a5c;
  --beige-1: #f7f2e8;
  --beige-2: #d4ccb8;
  --beige-3: #efe6d6;
  --beige-line: #e4d9c4;
  --stone: #6b6055;
  --ink: #1b1f1f;
  --ink-2: #3d4544;
  --ink-3: #5c6463;
  --ink-4: #8a8f8e;
  --white: #ffffff;
  --warn: #b45309;
  --err: #b91c1c;
  --err-bg: #fee2e2;
  --ok-bg: #ecfdf5;
  --platinum: #bdbec1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html:has(.portal-page) {
  height: 100%;
}

body:has(.portal-page) {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--beige-3);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.mono { font-family: "JetBrains Mono", monospace; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow.accent { color: var(--karaka-deep); }

.portal-env-banner {
  background: #9a6700;
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 12px;
}

.flash {
  max-width: 1280px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.flash.notice {
  background: var(--ok-bg);
  color: var(--pine);
  border: 1px solid rgba(0, 160, 121, 0.25);
}

.flash.alert {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid rgba(185, 28, 28, 0.2);
}

.auth-page {
  min-height: 100vh;
  padding: 24px 16px 40px;
}

.auth {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--beige-line);
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
}

.auth-brand {
  position: relative;
  background: var(--pine);
  color: var(--beige-1);
  padding: 40px;
  overflow: hidden;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background: repeating-linear-gradient(135deg, #fff 0 1px, transparent 1px 11px);
}

.auth-brand::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--karaka) 0%, transparent 70%);
  opacity: 0.18;
}

.auth-brand-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mark {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.brand-logo {
  height: 64px;
  width: auto;
  display: block;
}

.brand-logo-mini {
  height: 40px;
  width: auto;
  display: block;
}

.mark-box {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--karaka);
  color: var(--pine-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}

.mark-name { font-weight: 800; letter-spacing: 0.3px; }
.mark-sub { font-size: 11px; color: rgba(247, 242, 232, 0.7); letter-spacing: 0.4px; }

.auth-hero { margin-top: auto; margin-bottom: auto; }
.auth-hero h2 { font-size: 30px; line-height: 1.15; margin: 8px 0 0; font-weight: 800; }
.auth-eyebrow { color: var(--karaka); }

.auth-foot {
  font-size: 11px;
  color: rgba(247, 242, 232, 0.65);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-form {
  padding: 40px;
  display: flex;
  flex-direction: column;
}

.auth-form-top {
  display: flex;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--karaka-deep);
  font-weight: 600;
}

.auth-form-top a { text-decoration: none; }
.auth-form-top a:hover { text-decoration: underline; }

.auth-mini-mark {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-mini-mark .mark-box { width: 28px; height: 28px; font-size: 15px; }
.auth-mini-mark .mark-name { color: var(--ink); font-size: 14px; }

.auth-body { margin: auto 0; }
.auth-body h1 { font-size: 26px; font-weight: 800; margin: 6px 0 6px; }
.auth-body .subtitle { color: var(--ink-2); margin: 0 0 22px; }

.field { margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }

.field-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--beige-2);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: var(--white);
}

.field-input:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(0, 70, 72, 0.1);
}

.btn {
  height: 48px;
  width: 100%;
  border: none;
  border-radius: 6px;
  background: var(--pine);
  color: var(--beige-1);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover { background: var(--pine-ink); }
.btn:disabled { cursor: wait; opacity: 0.92; }
.btn.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--beige-1);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.auth-meta { margin-top: 16px; font-size: 12px; color: var(--ink-3); }
.auth-meta a { color: var(--karaka-deep); font-weight: 600; text-decoration: none; }
.auth-meta a:hover { text-decoration: underline; }

.access-request {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--beige-1);
  border: 1px solid var(--beige-line);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.access-request-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.access-request p { margin: 4px 0 0; }
.access-request a { color: var(--karaka-deep); font-weight: 600; text-decoration: none; }
.access-request a:hover { text-decoration: underline; }

.pin-row { display: flex; gap: 10px; margin: 6px 0 18px; }

.pin-box {
  width: 56px;
  height: 64px;
  border: 1px solid var(--beige-2);
  border-radius: 6px;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 26px;
  background: var(--white);
}

.pin-box:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(0, 70, 72, 0.1);
}

.countdown {
  font-family: "JetBrains Mono", monospace;
  color: var(--ink-3);
  font-size: 13px;
}

.portal-placeholder {
  max-width: 720px;
  margin: 48px auto;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--beige-line);
  border-radius: 10px;
}

.portal-placeholder h1 { margin: 0 0 8px; font-size: 22px; }
.portal-placeholder p { color: var(--ink-3); margin: 0 0 20px; }

/* ───────── Stock portal ───────── */
.portal-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: var(--white);
  overflow: hidden;
}

.topbar {
  flex-shrink: 0;
  height: 64px;
  background: var(--pine);
  color: var(--beige-1);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--pine-ink);
}

.topbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-logo {
  height: 52px;
  width: auto;
  display: block;
}
.topbar-logo-icon { display: none; }

.topbar-divider { width: 1px; height: 26px; background: rgba(247, 242, 232, 0.25); flex-shrink: 0; }
.topbar-context {
  font-size: 12px;
  color: rgba(247, 242, 232, 0.85);
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}
.topbar-context strong { color: var(--beige-1); font-size: 13px; }
.topbar-company { color: rgba(247, 242, 232, 0.7); font-size: 11px; }
.topbar-spacer { flex: 1; }
.topbar-nav { display: flex; gap: 18px; font-size: 13px; font-weight: 600; }
.topbar-nav a,
.topbar-nav span { text-decoration: none; padding: 4px 0; color: rgba(247, 242, 232, 0.8); }
.topbar-nav a.active { color: var(--beige-1); border-bottom: 2px solid var(--karaka); }
.topbar-nav .future {
  opacity: 0.4;
  cursor: not-allowed;
  position: relative;
}
.topbar-nav .future[data-tooltip]:hover::after,
.topbar-nav .future[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--pine-ink);
  color: var(--beige-1);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 60;
  opacity: 1;
  pointer-events: none;
}
.acct-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--karaka); color: var(--pine-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.sign-out-link {
  background: none; border: none; color: rgba(247, 242, 232, 0.85); font: inherit;
  font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0;
}

/* ───────── Platinum Retail Partner ─────────
   Markup is server-gated in shared/_platinum_mark; these rules only style it.
   body.theme-platinum carries the accent tweaks. */
.platinum-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(189, 190, 193, 0.28);
  flex-shrink: 0;
}

.platinum-mark-icon {
  width: 22px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}

.platinum-mark-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.platinum-mark-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--platinum);
}

.platinum-mark-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--platinum);
}

.platinum-chip-icon {
  display: none;
  width: 16px;
  height: 18px;
  flex-shrink: 0;
}

body.theme-platinum .topbar {
  border-bottom-color: rgba(189, 190, 193, 0.35);
}

body.theme-platinum .topbar-nav a.active {
  border-bottom-color: var(--platinum);
}

body.theme-platinum .subbar {
  border-bottom: 1px solid rgba(189, 190, 193, 0.45);
}

.subbar {
  flex-shrink: 0;
  height: 44px;
  background: var(--beige-1);
  border-bottom: 1px solid var(--beige-line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  font-size: 13px;
}
.subbar .crumb { color: var(--ink); font-weight: 600; }

.shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.sidebar {
  min-height: 0;
  border-right: 1px solid var(--beige-line);
  padding: 0 14px 18px;
  background: var(--beige-1);
  overflow-y: auto;
}
.sidebar-head {
  padding: 18px 6px 14px;
  border-bottom: 1px solid var(--beige-line);
  margin-bottom: 14px;
}
.sidebar-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.sidebar-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
}
.side-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--ink-3); margin: 4px 6px 8px; display: flex; justify-content: space-between;
}
.side-item {
  display: flex; justify-content: space-between; align-items: center; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; font-size: 13px; text-decoration: none; color: inherit;
}
.side-item:hover { background: var(--beige-3); }
.side-item.active { background: var(--pine); color: var(--beige-1); }
.side-item .qty { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--ink-3); }
.side-item.active .qty { color: rgba(247, 242, 232, 0.8); }
.cat-group { margin-bottom: 2px; }
.cat-header {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
}
.cat-header.active .cat-link { color: var(--beige-1); }
.cat-header.active .caret { color: rgba(247, 242, 232, 0.85); }
.cat-header.active .cat-toggle:hover { background: rgba(247, 242, 232, 0.12); }
.cat-header.child-active .cat-label { color: var(--pine); font-weight: 700; }
.cat-header.child-active .qty { color: var(--ink); font-weight: 600; }
.cat-link {
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
}
.cat-link:hover { background: var(--beige-3); }
.cat-header.active .cat-link:hover { background: transparent; }
.cat-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 7px 0 7px 6px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
}
.cat-toggle:hover { background: var(--beige-3); }
.cat-header .qty { padding-right: 10px; flex-shrink: 0; }
.caret { display: inline-block; width: 14px; color: var(--ink-3); transition: transform 0.12s; flex-shrink: 0; }
.caret.open { transform: rotate(90deg); }
.side-sub { padding-left: 8px; }
.side-item-sub { padding-left: 28px !important; font-size: 12.5px; }
.side-section { margin-bottom: 18px; }
.checkrow {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px; cursor: pointer;
  font-size: 13px; border-radius: 6px; text-decoration: none; color: inherit;
}
.checkrow:hover { background: var(--beige-3); }
.checkrow.active { background: rgba(0, 70, 72, 0.08); font-weight: 600; }
.check {
  width: 15px; height: 15px; border: 1px solid var(--beige-2); border-radius: 4px; display: inline-block;
}
.check.on { background: var(--pine); border-color: var(--pine); position: relative; }
.check.on::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid var(--beige-1); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.side-count { margin-left: auto; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--ink-3); }

.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main-pad {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px 24px 0;
}
.stock-sticky-head { flex-shrink: 0; }
.stock-table-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}
.page-head h1 { font-size: 22px; font-weight: 800; margin: 0; }
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.page-head-mobile { display: none; }

.controls {
  display: grid; grid-template-columns: minmax(240px, 1fr) auto auto auto; gap: 12px;
  margin: 16px 0 12px; align-items: center;
}
.search { position: relative; min-height: 44px; }
.search input {
  width: 100%; height: 44px; padding: 0 38px; border: 1px solid var(--beige-2); border-radius: 6px;
  font-family: inherit; font-size: 14px; box-sizing: border-box;
}
.search input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(0, 70, 72, 0.1); }
.search-ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}
.search-hint {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px;
  border: 1px solid var(--beige-2); border-radius: 4px; display: grid; place-items: center;
  color: var(--ink-4); font-family: "JetBrains Mono", monospace; font-size: 12px;
}
.search-clear {
  position: absolute; right: 36px; top: 50%; transform: translateY(-50%);
  text-decoration: none; color: var(--ink-3); font-size: 18px; line-height: 1;
}
.seg {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 2px; border: 1px solid var(--beige-2);
  border-radius: 6px; padding: 3px; background: var(--white); height: 44px; box-sizing: border-box;
}
.seg-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--ink-3); padding: 0 8px;
}
.seg-opt {
  padding: 6px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; line-height: 1.2;
  color: var(--ink-2); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.seg-opt.on { background: var(--pine); color: var(--beige-1); }

.chips {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px;
}
.chips .label { font-weight: 700; letter-spacing: 1px; color: var(--ink-3); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--beige-1);
  border: 1px solid var(--beige-line); border-radius: 999px; padding: 4px 10px;
}
.chip .x { cursor: pointer; color: var(--ink-3); text-decoration: none; }
.chip-clear { color: var(--karaka-deep); font-weight: 600; cursor: pointer; text-decoration: none; }
.result-count { margin-left: auto; color: var(--ink-3); }
.result-count strong { color: var(--ink); }

.table-wrap { border: 1px solid var(--beige-line); border-radius: 8px; overflow: visible; }
table.stock { width: 100%; border-collapse: collapse; }
table.stock thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--pine); color: var(--beige-1); font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; text-align: left; padding: 11px 12px; white-space: nowrap;
}
table.stock thead th.num { text-align: right; }
/* box-shadow (not border-bottom) so the karaka underline sticks with the sticky th */
table.stock thead th.wh-on { background: var(--pine-ink); box-shadow: inset 0 -2px 0 var(--karaka); }
table.stock tbody td {
  padding: 8px 12px; border-bottom: 1px solid var(--beige-line); height: 40px; vertical-align: middle;
}
table.stock tbody tr:hover td { background: rgba(0, 70, 72, 0.025); }
table.stock td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.stock td.wh-on { background: rgba(0, 160, 121, 0.04); }
table.stock td.sku { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--pine); font-weight: 500; }
table.stock td.name { font-weight: 600; }
.name-sub { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; font-family: "JetBrains Mono", monospace; }
table.stock td.cat { font-size: 12.5px; }
table.stock td.cat .range { display: block; font-weight: 600; color: var(--ink); font-size: 13px; }
table.stock td.cat .category { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 1px; }
.av { font-weight: 700; font-size: 13px; }
.av .unit { font-weight: 500; color: var(--ink-3); font-size: 11px; margin-left: 2px; }
.av.t-high, .av.t-mid { color: var(--pine); }
.av.t-low { color: var(--ink); }
.av.t-low::before { content: "▲ "; color: var(--warn); font-size: 10px; }
.av.t-low[data-tooltip] { position: relative; cursor: help; }
.av.t-low[data-tooltip]:hover::after,
.av.t-low[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  text-align: center;
  z-index: 60;
  opacity: 1;
  pointer-events: none;
}
.av.t-out { color: var(--stone); text-decoration: line-through; }
.av.t-indent { color: var(--ink-3); font-style: italic; }
.av.wh-qty { font-weight: 600; color: var(--ink-2); }
.av.wh-qty .unit { font-weight: 500; color: var(--ink-3); font-size: 11px; margin-left: 2px; }
.next-arr .d { font-weight: 600; font-size: 12.5px; }
.next-arr .q { display: block; font-size: 11px; color: var(--ink-3); }
.next-arr .none { color: var(--ink-4); }

.cards { display: none; }
.card {
  border: 1px solid var(--beige-line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--white);
}
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-sku { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--pine); font-weight: 500; }
.card-name { font-weight: 600; margin-top: 4px; }
.card-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.card-wh {
  display: flex; gap: 18px; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--beige-line); font-size: 12px;
}
.card-wh .k { color: var(--ink-3); display: block; font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; }
.card-next { margin-top: 6px; font-size: 12px; color: var(--ink-3); }

.filter-btn {
  display: none; height: 44px; box-sizing: border-box; border: 1px solid var(--beige-2); border-radius: 6px; background: var(--white);
  font-family: inherit; font-weight: 600; font-size: 13px; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer;
}
.filter-drawer-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40;
}
.filter-drawer-backdrop.open { display: block; }

.empty-state {
  border: 1px dashed var(--beige-2); border-radius: 8px; padding: 32px; text-align: center; color: var(--ink-3);
}
.empty-state h2 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.empty-clear { color: var(--karaka-deep); font-weight: 600; text-decoration: none; }

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .page-head-mobile { display: block; margin-bottom: 4px; }
  .sidebar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    z-index: 50;
    overflow-y: auto;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .filter-btn { display: flex; }
  .controls { grid-template-columns: 1fr auto auto auto; }
}

body.filter-drawer-open { overflow: hidden; }

@media (max-width: 640px) {
  .topbar {
    height: 52px;
    padding: 0 14px;
    gap: 10px;
  }
  .topbar-logo-full { display: none; }
  .topbar-logo-icon {
    display: block;
    height: 34px;
    width: 34px;
    object-fit: contain;
  }
  .topbar-divider,
  .topbar-context { display: none; }
  .platinum-mark { display: none; }
  .platinum-chip-icon { display: block; }
  .topbar-nav { gap: 12px; font-size: 12px; }
  .topbar-nav .future { display: none; }
  .acct-chip .nm { display: none; }
  .sign-out-link { font-size: 11px; }
  .controls { grid-template-columns: 1fr; gap: 8px; }
  .seg { flex-wrap: wrap; height: auto; min-height: 44px; }
  .seg-opt { padding: 5px 10px; font-size: 12px; }
  .search-hint { display: none; }
  .table-wrap { border: none; background: transparent; }
  table.stock { display: none; }
  .cards { display: block; }
  .main-pad { padding: 14px 14px 0; }
  .stock-table-scroll { padding-bottom: 14px; }
}

@media (max-width: 1024px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mini-mark { display: flex; }
}

@media (max-width: 640px) {
  .auth-form { padding: 26px; }
  .auth-body h1 { font-size: 22px; }
  .pin-box { width: 44px; height: 52px; font-size: 22px; }
  .pin-row { gap: 7px; }
}

/* Orders */
.orders-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.orders-main { flex: 1; min-width: 0; min-height: 0; }
.orders-sticky-head { flex-shrink: 0; position: sticky; top: 0; z-index: 3; background: var(--beige-0); padding-bottom: 4px; }
.orders-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}
.orders-scroll-picker { overflow-x: hidden; }
.orders-controls { grid-template-columns: 1fr; gap: 12px; }
.orders-status-seg { overflow-x: auto; }
.orders-context-banner {
  grid-column: 1 / -1;
  background: var(--beige-1);
  border: 1px solid var(--beige-line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}
.orders-change-customer { margin-left: 10px; color: var(--karaka-deep); font-weight: 600; text-decoration: none; }

table.orders {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}
table.orders col.col-so { width: 12%; }
table.orders col.col-po { width: 12%; }
table.orders col.col-builder { width: 16%; }
table.orders col.col-order-date { width: 10%; }
table.orders col.col-ship-date { width: 14%; }
table.orders col.col-status { width: 14%; }
table.orders col.col-total { width: 12%; }
table.orders col.col-actions { width: 10%; }
table.orders thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--pine);
  color: var(--beige-1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: left;
  padding: 11px 12px;
  white-space: nowrap;
}
table.orders thead th.num { text-align: right; }
table.orders thead th.order-actions-head { padding-left: 8px; padding-right: 8px; }
.order-expand-cell { padding: 0 !important; border-bottom: 1px solid var(--beige-line); }
.order-details { display: block; }
.order-details > summary { list-style: none; cursor: pointer; }
.order-details > summary::-webkit-details-marker { display: none; }
.order-summary { display: block; padding: 8px 0; }
.order-summary:hover { background: rgba(0, 70, 72, 0.025); }
.order-summary-grid {
  display: grid;
  grid-template-columns: 12% 12% 16% 10% 14% 14% 12% 10%;
  gap: 0;
  align-items: center;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}
.order-summary-grid > span {
  min-width: 0;
  padding: 0 12px;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.order-summary-grid > .order-actions { padding-left: 8px; padding-right: 10px; }
.order-so { font-family: "JetBrains Mono", monospace; color: var(--pine); font-weight: 600; }
.order-po, .order-builder { font-weight: 600; }
.order-builder-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.order-progress {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1.3;
}
.order-ship-date {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}
.order-date-kind {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-3);
}
.order-date-value { font-size: 13px; }
.order-total.num { text-align: right; font-variant-numeric: tabular-nums; }
.order-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.order-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.order-details[open] > summary .order-chevron {
  transform: rotate(225deg);
  margin-top: 3px;
}
.track-link-row {
  font-size: 12px;
  white-space: nowrap;
}
.orders-section-row td { border-bottom: none; padding: 0 !important; }
.orders-section-cell {
  padding: 0 !important;
  background: var(--beige-0);
}
.orders-section-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 10px 14px;
  background: rgba(0, 70, 72, 0.08);
  border-top: 2px solid var(--pine);
  border-bottom: 1px solid var(--beige-line);
}
.orders-section-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--pine);
}
.orders-section-card {
  padding: 0;
  margin-top: 12px;
}
.orders-section-card .orders-section-banner {
  margin: 0;
  border-radius: 6px 6px 0 0;
}
.order-status.t-hold {
  background: rgba(180, 60, 50, 0.12);
  color: #8a2f28;
}
.orders-scroll.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.55;
}
.orders-scroll.is-loading::after {
  content: "Loading…";
  position: sticky;
  top: 12px;
  display: block;
  width: fit-content;
  margin: 0 auto 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--pine);
  color: var(--beige-1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  z-index: 4;
}
.seg-opt.is-loading,
.seg-opt.on {
  transition: background 0.12s ease, color 0.12s ease;
}
.orders-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--ink-3);
}
.orders-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.orders-status-help {
  position: relative;
  margin-left: 4px;
  flex-shrink: 0;
}
.orders-status-help-summary {
  list-style: none;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--beige-2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--white);
}
.orders-status-help-summary::-webkit-details-marker { display: none; }
.orders-status-help-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  width: min(320px, 80vw);
  padding: 12px;
  border: 1px solid var(--beige-line);
  border-radius: 8px;
  background: var(--white);
}
.orders-status-help-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--ink-2);
  padding: 6px 0;
  border-top: 1px solid var(--beige-line);
}
.orders-status-help-item:first-child { border-top: none; padding-top: 0; }
.orders-status-help-item strong { color: var(--ink); font-size: 12px; }
.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-expanded {
  padding: 8px 12px 10px;
  background: var(--beige-1);
  border-top: 1px solid var(--beige-line);
}
.order-expanded-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.order-expanded-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.order-expanded-value { font-size: 12.5px; color: var(--ink); line-height: 1.35; }
.order-ship-to { line-height: 1.35; }
.order-lines-block { margin-top: 10px; }
.order-lines-table-wrap,
.fulfillment-lines-wrap {
  margin-top: 4px;
  overflow-x: auto;
  border: 1px solid var(--beige-line);
  border-radius: 4px;
  background: var(--white);
}
table.order-lines,
table.fulfillment-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.order-lines thead th,
table.fulfillment-lines thead th {
  background: var(--beige-1);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid var(--beige-line);
  white-space: nowrap;
}
table.order-lines thead th.num,
table.fulfillment-lines thead th.num,
table.order-lines td.num,
table.fulfillment-lines td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.order-lines tbody td,
table.fulfillment-lines tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--beige-line);
  vertical-align: top;
}
table.order-lines tbody tr:last-child td,
table.fulfillment-lines tbody tr:last-child td {
  border-bottom: none;
}
table.order-lines tr.is-freight td {
  background: rgba(0, 70, 72, 0.04);
}
.order-line-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.order-line-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--pine);
  background: rgba(0, 70, 72, 0.08);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 1.6;
}
.order-line-badge-discount {
  color: #8a2f28;
  background: rgba(180, 60, 50, 0.12);
}
table.order-lines tr.is-discount td {
  background: rgba(180, 60, 50, 0.04);
}
.order-line-price-mobile {
  display: none;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.order-line-sku {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--pine);
  font-weight: 500;
}
.order-line-name {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  font-size: 12px;
}
.order-shipments { margin-top: 10px; }
.shipment-list { list-style: none; margin: 4px 0 0; padding: 0; }
.shipment-item {
  font-size: 12.5px;
  padding: 8px 0;
  border-top: 1px solid var(--beige-line);
}
.shipment-item:first-child { border-top: none; padding-top: 2px; }
.shipment-header { margin-bottom: 4px; }
.shipment-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 1px;
}
.shipment-if {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: var(--pine);
  font-size: 12.5px;
}
.shipment-date { color: var(--ink-2); }
.shipment-warehouse {
  font-size: 11px;
  font-weight: 700;
  color: var(--pine);
  background: rgba(0, 70, 72, 0.08);
  border-radius: 999px;
  padding: 1px 8px;
}
.shipment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 2px;
  color: var(--ink-2);
  font-size: 12px;
  margin-bottom: 4px;
}
.shipment-sep { color: var(--ink-4); margin: 0 4px; }
.shipment-empty { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.track-link { color: var(--karaka-deep); font-weight: 600; text-decoration: none; }
.track-link:hover { text-decoration: underline; }

.order-status {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.order-status.t-confirmed { background: var(--beige-2); color: var(--ink-2); }
.order-status.t-approval { background: rgba(120, 120, 120, 0.12); color: var(--ink-2); }
.order-status.t-pending,
.order-status.t-partial { background: rgba(245, 166, 35, 0.15); color: #9a6700; }
.order-status.t-shipped { background: rgba(0, 160, 121, 0.12); color: var(--pine); }

.orders-cards { display: none; }
.order-card-summary { cursor: pointer; }
.order-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.order-card-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.order-card-meta, .order-card-dates {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; font-size: 12px; color: var(--ink-3);
}
.order-card-total { font-weight: 700; color: var(--ink); }
.order-card-track { margin-top: 8px; }
.order-card .order-progress { margin-top: 6px; }

.orders-alert {
  border: 1px solid rgba(245, 166, 35, 0.35);
  background: rgba(245, 166, 35, 0.08);
  color: var(--ink);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
}
.orders-load-more {
  margin: 20px 0 8px;
  display: flex;
  justify-content: center;
}
.orders-load-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--beige-2);
  border-radius: 6px;
  background: var(--white);
  color: var(--pine);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.orders-load-link:hover {
  background: var(--beige-1);
  border-color: var(--pine);
}
.orders-load-link.is-loading {
  pointer-events: none;
  opacity: 0.7;
  border-color: var(--pine);
  background: var(--beige-1);
}

.customer-picker {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--beige-line);
  border-radius: 8px;
  background: var(--white);
  padding: 24px;
  max-width: 560px;
  width: 100%;
  box-sizing: border-box;
}
.customer-picker-head,
.customer-picker-form {
  flex-shrink: 0;
}
.customer-picker-head h2 { margin: 0 0 6px; font-size: 20px; }
.customer-picker-head p { margin: 0 0 16px; color: var(--ink-3); font-size: 14px; }
.customer-picker-form {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.customer-picker-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
}
.customer-picker-search .search-ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  line-height: 1;
  color: var(--ink-3);
  pointer-events: none;
}
.customer-picker-input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--beige-2);
  border-radius: 6px;
  padding: 0 12px 0 40px;
  font-family: inherit;
  font-size: 14px;
}
.customer-picker-input:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(0, 70, 72, 0.1);
}
.customer-picker-form .btn.customer-picker-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
  height: 44px;
  padding: 0 18px;
  font-size: 14px;
  white-space: nowrap;
}
.customer-picker-results-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 4px;
}
.customer-picker-results-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: 16px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--beige-line);
}
.customer-picker-results-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-3);
}
.customer-picker-results-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--pine);
  background: rgba(0, 70, 72, 0.08);
  border-radius: 999px;
  padding: 2px 8px;
}
.customer-picker-results {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  overflow-y: auto;
  max-height: min(50vh, 420px);
  -webkit-overflow-scrolling: touch;
}
.customer-picker-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--beige-line);
  border-radius: 6px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.customer-picker-result:hover {
  background: var(--beige-1);
  border-color: var(--beige-2);
}
.customer-picker-result-name { font-weight: 600; font-size: 14px; line-height: 1.35; }
.customer-picker-result-arrow {
  flex-shrink: 0;
  color: var(--karaka-deep);
  font-weight: 700;
  font-size: 14px;
}
.customer-picker-empty {
  flex-shrink: 0;
  margin: 16px 0 0;
  padding: 16px;
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
  border: 1px dashed var(--beige-2);
  border-radius: 6px;
  background: var(--beige-1);
}

@media (max-width: 1024px) {
  .order-expanded-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .orders-table-wrap { display: none; }
  .orders-cards { display: block; }
  .orders-status-seg { flex-wrap: wrap; height: auto; min-height: 44px; }
  .customer-picker-form { flex-direction: column; }
  .customer-picker-form .btn.customer-picker-btn { width: 100%; min-width: 0; }
  .order-line-price-mobile { display: block; }
  table.order-lines th.order-lines-unit,
  table.order-lines td.order-lines-unit { display: none; }
  .orders-status-help-panel { right: auto; left: 0; }
}
