:root {
  --ink: #1c1917;
  --header: #292524;
  --header-2: #44403c;
  --accent: #9a3412;
  --accent-2: #c2410c;
  --cream: #f6f3ee;
  --card: #ffffff;
  --line: #e7e0d6;
  --muted: #78716c;
  --faint: #a8a29e;
  --ok: #3f6212;
  --warn: #a16207;
  --bad: #9f1239;
  --rail: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--cream); }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
}
html[data-auth]:not(.auth-ready) body { visibility: hidden; }
body.nav-on { padding-left: var(--rail); }
a { color: inherit; }

.top {
  background: var(--header);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.top h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.top p { margin: 2px 0 0; color: #d6d3d1; font-size: 13px; }
.top-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip, .btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--header-2);
  color: #fff;
  cursor: pointer;
}
.chip.on, .btn.primary { background: var(--accent); }
.chip.static, .btn.static { cursor: default; pointer-events: none; }
.static-search {
  color: var(--faint);
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
}
.chip.ghost, .btn.ghost {
  background: #fff;
  color: #44403c;
  border-color: var(--line);
}
.sample {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fdba74;
  border: 1px solid #9a3412;
  border-radius: 999px;
  padding: 2px 8px;
}

.page { padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 14px; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi, .card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.kpi { padding: 14px 16px; }
.kpi .lbl { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-size: 26px; font-weight: 650; margin-top: 6px; }
.kpi .note { font-size: 12px; color: var(--faint); margin-top: 4px; }
.card { padding: 14px 16px; }
.card h2, .panel h2 { margin: 0 0 10px; font-size: 14px; font-weight: 650; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.split { display: grid; grid-template-columns: 220px 1fr; gap: 10px; min-height: 280px; }
.list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.list h2 { margin: 0 0 8px; font-size: 13px; }
.list input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.row-item {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  font-size: 13px;
}
.row-item strong { display: block; }
.row-item span { color: var(--muted); font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
td { padding: 8px; border-bottom: 1px solid #f3eee7; }
tr:last-child td { border-bottom: 0; }
.line-table tr.pick { cursor: pointer; }
.line-table tr.pick:hover td { background: #f6f3ee; }
.line-table tr.on td, .line-table tr.hit td { background: #f3e8e2; }
.status {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f5f5f4;
  color: var(--muted);
}
.status.wait { background: #fef3c7; color: var(--warn); }
.status.pulled { background: #ffedd5; color: var(--accent); }
.status.shipped { background: #ecfccb; color: var(--ok); }
.status.void { background: #f5f5f4; color: var(--faint); }
.sku-pick { position: relative; }
.sku-list {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  box-shadow: 0 8px 20px rgba(28, 25, 23, 0.08);
}
.sku-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #f3eee7;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}
.sku-list button small { display: block; color: var(--muted); font-size: 11px; }
.today-col.is-empty { background: transparent; opacity: 0.7; }
.today-col.needs { background: #fffbeb; border-color: #fcd34d; }
.today-col a.pulled strong { font-weight: 500; color: var(--muted); }
body.sample-page .kpi,
body.sample-page .card,
body.sample-page .panel,
body.sample-page .list,
body.sample-page .map-box {
  border-style: dashed;
  border-color: #d6d3d1;
  background: #faf8f5;
}
body.sample-page .kpi .val { color: #78716c; font-size: 20px; }
.heat { display: inline-block; min-width: 36px; text-align: center; border-radius: 4px; padding: 2px 4px; background: #f5f5f4; }
.heat.h1 { background: #ffedd5; }
.heat.h2 { background: #fed7aa; }
.heat.h3 { background: #fdba74; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.tabs span { padding: 8px 12px; font-size: 13px; font-weight: 650; color: var(--muted); }
.tabs span.on { color: var(--accent); border-bottom: 2px solid var(--accent); }
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.steps span {
  font-size: 12px;
  font-weight: 650;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
}
.steps span.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.form { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cal-head { text-align: center; font-size: 13px; font-weight: 650; margin-bottom: 8px; }
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal i, .cal b {
  font-style: normal;
  font-weight: 600;
  font-size: 10px;
  text-align: center;
  color: var(--faint);
}
.cal b {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 4px;
  text-align: left;
  font-size: 11px;
}
.cal b em { display: block; margin-top: 4px; font-style: normal; color: var(--accent); font-size: 10px; }

.map-box {
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keys span {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 650;
}
.keys span.ok { background: var(--accent); color: #fff; border-color: var(--accent); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--header);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #1c1917;
  border: 1px solid #44403c;
  border-radius: 16px;
  padding: 28px;
  color: #fff;
}
.login-card h1 { margin: 0; font-size: 28px; }
.login-card .sub { color: #d6d3d1; font-size: 14px; margin: 4px 0 20px; }
.login-card label { display: block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #a8a29e; margin: 12px 0 6px; }
.login-card input {
  width: 100%;
  background: #292524;
  border: 1px solid #44403c;
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
}
.login-card button {
  margin-top: 18px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
}
.login-card .hint { color: #fecaca; font-size: 12px; margin-top: 14px; line-height: 1.4; }
.login-card button:disabled { opacity: 0.7; cursor: default; }

.hl-rail { position: sticky; top: 0; z-index: 5; background: rgba(246,243,238,0.94); border-bottom: 1px solid var(--line); }
.hl-rail-inner { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; }
.hl-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 650;
  color: #57534e;
  cursor: pointer;
  white-space: nowrap;
}
.hl-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hl-main { max-width: 1400px; margin: 0 auto; padding: 22px 16px 72px; }
.hl-section { position: relative; padding-left: 52px; padding-bottom: 28px; }
.hl-step {
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 650;
}
.hl-section h2 { margin: 0; font-size: 18px; }
.hl-section .blurb { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.hl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hl-card {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.hl-card:hover { border-color: var(--accent); }
.hl-card strong { display: block; font-size: 14px; }
.hl-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.hl-card .sample { display: inline-block; margin-top: 8px; color: #9a3412; }
.today { margin-bottom: 18px; }
.today h2 { margin: 0; font-size: 18px; }
.today .blurb { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.today-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.today-col h3 { margin: 0 0 8px; font-size: 13px; }
.today-col a {
  display: block;
  text-decoration: none;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.today-col a strong { display: block; font-size: 14px; }
.today-col a span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.today-empty { color: var(--muted); font-size: 13px; margin: 0; }
.top .example-title { margin: 4px 0 0; color: #fdba74; font-size: 15px; font-weight: 650; }
.top p a { color: #fff; text-decoration: underline; }
.lock-note { color: var(--muted); font-size: 13px; margin: 0; }
.count-piece { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.count-piece .on-hand { font-size: 22px; font-weight: 650; margin: 0; }
.recent { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.recent a {
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}

.drop {
  border: 2px dashed var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
}
.drop strong { display: block; }
.drop span { color: var(--muted); font-size: 13px; }
.price-table td.piece { min-width: 220px; }
.price-table td.size { min-width: 160px; }
.price-table td.money { white-space: nowrap; text-align: right; }
.price-table input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  color: inherit;
  background: transparent;
}
.price-table .sub input { color: var(--muted); font-size: 12px; }
.price-table td.money input { width: 88px; text-align: right; }
.price-table input:hover,
.price-table input:focus {
  border-color: var(--line);
  background: #fff;
  outline: none;
}
.price-table input:focus { border-color: var(--accent); }
.price-table input.saved { border-color: var(--ok); }

.line-table input, .line-table select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  background: #fff;
}
.err {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: var(--bad);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

body.pm-on .money {
  color: transparent !important;
  background: #e7e0d6;
  border-radius: 4px;
  user-select: none;
}

#rail a .sample { margin-left: auto; }
#cmdk button.hit { display: flex; flex-direction: column; align-items: flex-start; }
tr.hit { outline: 2px solid var(--accent); }
.owner-only { display: none; }
body.role-owner .owner-only { display: block; }
body.role-floor .office-only { display: none !important; }
body.role-office .floor-only { display: none !important; }
.floor-card { max-width: 520px; }
.floor-wo { font-size: 32px; margin: 8px 0; }
.floor-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.floor-go { min-height: 72px; font-size: 22px; width: 100%; }
#pack-sheet { display: none; }

@media print {
  body * { visibility: hidden; }
  #pack-sheet, #pack-sheet * { visibility: visible; }
  #pack-sheet {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #fff;
    color: #000;
    padding: 24px;
  }
}

@media (max-width: 900px) {
  .kpis, .grid-2, .cards { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  body.nav-on { padding-left: 0; }
}
@media (max-width: 640px) {
  .kpis, .cards { grid-template-columns: 1fr; }
  .page { padding: 14px; }
  body.floor-page .top p { display: none; }
  body.floor-page .page { padding-bottom: 200px; }
  body.floor-page .floor-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    margin: 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
  }
}
