:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --ink: #1b1f24;
  --ink-2: #414b57;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #cfd5dd;
  --brand: #14171c;
  --accent: #1f5fcf;
  --accent-soft: #eaf1fd;
  --ok: #157a3a;
  --ok-soft: #e6f5ec;
  --warn: #a4570a;
  --warn-soft: #fdf2e1;
  --bad: #b42323;
  --bad-soft: #fdecec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12px ui-monospace, Consolas, monospace; background: #eef0f3; padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pre { white-space: pre-wrap; }
.big { font-size: 16px; font-weight: 600; margin-bottom: 6px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  height: 52px; padding: 0 20px;
  background: var(--brand); color: #fff;
}
.brand { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: #c9ced6; padding: 6px 12px; border-radius: 6px; font-weight: 500; }
.nav a:hover, .nav a.active { background: rgba(255, 255, 255, 0.12); color: #fff; text-decoration: none; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #c9ced6; }
.who .role { background: rgba(255, 255, 255, 0.14); color: #fff; padding: 2px 9px; border-radius: 999px; text-transform: capitalize; }
.env { background: #f5b22e; color: #1b1f24; font-weight: 600; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.switch { display: inline-flex; gap: 2px; background: rgba(255, 255, 255, 0.08); border-radius: 6px; padding: 2px; }
.switch a { color: #c9ced6; padding: 1px 8px; border-radius: 4px; font-size: 12px; }
.switch a.on { background: rgba(255, 255, 255, 0.2); color: #fff; }
.linkish { background: none; border: 0; color: #c9ced6; font: inherit; cursor: pointer; padding: 0; }
.linkish:hover { color: #fff; text-decoration: underline; }

/* page */
main { max-width: 1320px; margin: 0 auto; padding: 18px 20px 40px; }
.crumbs { font-size: 13px; margin-bottom: 4px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 16px; }
.page-head h1 { font-size: 22px; font-weight: 650; margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.tabs { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font: inherit; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.search {
  flex: 1 1 240px; max-width: 380px;
  padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  font: inherit; background: var(--panel); color: var(--ink);
}
.search:focus, input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* cards and grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card > h2 {
  margin: 0; padding: 12px 16px 0;
  font-size: 12px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}
.card > h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.card .body { padding: 10px 16px 14px; }
.section { margin-bottom: 16px; }
.section > h2 + .table-wrap { margin-top: 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-bottom: 16px; }
.grid.wide-first { grid-template-columns: minmax(0, 3fr) minmax(250px, 1fr); }
.grid.wide-first > .section { margin-bottom: 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.addr { line-height: 1.4; }
.addr-block + .addr-block { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.note + .note { margin-top: 10px; }
ul.people { list-style: none; margin: 0; padding: 0; }
ul.people li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* tables */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; white-space: nowrap;
  padding: 9px 12px; background: #f8f9fb; border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
table.list td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr[data-order], table.list tbody tr[data-customer] { cursor: pointer; }
table.list tbody tr[data-order]:hover, table.list tbody tr[data-customer]:hover { background: #f6f8fb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list th.num { text-align: right; }
table.lines td.desc { white-space: pre-line; min-width: 220px; }
table.lines th.size, table.lines td.size { text-align: center; width: 48px; font-variant-numeric: tabular-nums; }
table.lines td.size:not(:empty) { font-weight: 600; }
table.lines tr.charge td { color: var(--ink-2); }
table.lines tr.spacer td { padding: 3px 12px; }
.late { color: var(--bad); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }

/* chips, buttons, menus */
.chip {
  display: inline-block; margin: 0 4px 2px 0; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef0f3; color: var(--ink-2);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--accent-soft); color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: #b8c0cb; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a52b3; }
.btn.wide { width: 100%; padding: 10px; }
.btn:disabled { opacity: 0.6; cursor: default; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: ""; border: 5px solid transparent; border-top-color: currentColor; margin: 5px 0 0 2px; }
details.menu .items {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14);
}
details.menu .items a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
details.menu .items a:hover { background: var(--accent-soft); text-decoration: none; }

/* totals and progress */
.totals .trow { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .trow.strong { font-weight: 700; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 6px; }
ul.steps { list-style: none; margin: 0 0 8px; padding: 0; }
ul.steps li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0 4px 24px; position: relative; color: var(--muted); }
ul.steps li::before {
  content: ""; position: absolute; left: 2px; top: 8px; width: 12px; height: 12px;
  border: 2px solid var(--line-strong); border-radius: 50%;
}
ul.steps li.done { color: var(--ink); }
ul.steps li.done::before { background: var(--ok); border-color: var(--ok); }

/* states */
.empty { padding: 28px; text-align: center; color: var(--muted); }
.error { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.boot { display: grid; place-items: center; min-height: 70vh; color: var(--muted); }

/* sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(400px, 100%); padding: 28px; }
.login-brand { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login label { display: block; font-weight: 600; margin-top: 12px; }
.login input {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; font: inherit;
}
.login .btn.wide { margin-top: 18px; }

/* ---------------------------------------------------------------- order entry */

/* ShopWorks' order type ovals and design type swatches */
.type-badge {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 18px; border-radius: 999px; vertical-align: middle;
  font: 700 12px/1 "Segoe UI", system-ui, sans-serif; color: #fff;
  box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.18), inset 0 2px 3px rgba(255, 255, 255, 0.35);
}
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; flex: none; }
.m-SP { background: #c8352b; }
.m-DTF { background: #f2c21b; color: #1b1f24; }
.m-EMB { background: #2b67d1; }
.m-PROMO { background: #2e8b3e; }
.m-SIGN { background: #e2811b; }
.m-OTHER, .m-NONE { background: #939cab; }
.m-MIX { background: linear-gradient(90deg, #c8352b 50%, #2b67d1 50%); }

/* shared form pieces */
.editor input:not([type=checkbox]):not([type=radio]), .editor select, .editor textarea,
.dlg input:not([type=checkbox]):not([type=radio]), .dlg select, .dlg textarea, .toolbar select {
  width: 100%; min-width: 0; padding: 6px 9px;
  border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel);
  font: inherit; color: var(--ink);
}
.editor input:disabled, .editor select:disabled, .editor textarea:disabled { background: #f3f4f6; color: var(--muted); }
.editor textarea, .dlg textarea { resize: vertical; line-height: 1.4; }
.editor textarea.grow { resize: none; overflow: hidden; }
.editor input:focus, .editor select:focus, .editor textarea:focus,
.dlg input:focus, .dlg select:focus, .dlg textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; align-items: start; }
.form-grid > label, .form-grid > div, .form-grid > fieldset { grid-column: span 2; }
.form-grid > .full { grid-column: 1 / -1; }
.form-grid > .q { grid-column: span 1; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.form-grid.one > * { grid-column: 1 / -1; }
.form-grid label, .stack > label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.form-grid label.check, .stack label.check, label.check {
  flex-direction: row; align-items: center; gap: 7px; font-weight: 500; color: var(--ink); font-size: 13.5px;
}
label.check.small { font-size: 12px; color: var(--muted); margin-top: 3px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.radios { display: flex; flex-direction: column; gap: 6px; }
fieldset.radios legend, .dlg fieldset legend { font-size: 12.5px; font-weight: 650; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
fieldset.radios label { display: flex; flex-direction: row; gap: 7px; align-items: flex-start; font-weight: 500; color: var(--ink); font-size: 13.5px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; width: fit-content; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -3px; }
.btn.small { padding: 3px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #971d1d; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink-2);
  font: 600 15px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer;
}
.icon-btn.text { font-size: 12px; }
.icon-btn:hover:not(:disabled) { background: #eef0f3; border-color: var(--line); color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
details.menu .items .menu-item {
  display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 6px;
  background: none; font: inherit; color: var(--ink); cursor: pointer;
}
details.menu .items .menu-item:hover { background: var(--accent-soft); }
details.menu .items .danger { color: var(--bad); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; flex-wrap: wrap; }
.card-head h2 { margin: 0 auto 0 0; font-size: 12px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.toolbar select { width: auto; }

/* the order screen */
.ed-top { position: sticky; top: 52px; z-index: 6; background: var(--bg); padding-top: 4px; margin: -4px 0 12px; }
/* On a short screen the header would cover too much of the order: let it scroll. */
@media (max-height: 820px) { .ed-top { position: static; } }
.ed-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.ed-head .ed-cust { flex: 1 1 260px; }
.ed-head .ed-actions { margin-left: auto; }
.ed-id { display: flex; align-items: center; gap: 8px; }
.editor .ed-type { width: auto; font-weight: 700; font-size: 15px; border-color: transparent; background: transparent; padding-left: 4px; }
.editor .ed-type:hover { border-color: var(--line-strong); }
.ed-cust { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ed-cust-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.ed-num { text-align: right; white-space: nowrap; }
.ed-num b { font-size: 22px; color: var(--accent); margin-left: 4px; vertical-align: -2px; }
.ed-actions { display: flex; align-items: center; gap: 8px; }
.ed-state { font-size: 12.5px; color: var(--muted); min-width: 92px; text-align: right; }
.ed-state.dirty { color: var(--warn); font-weight: 600; }
.ed-state.clean { color: var(--ok); }
.ed-tabbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 10px; border-bottom: 1px solid var(--line-strong); }
.ed-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.ed-tabs button {
  position: relative; bottom: -1px; padding: 7px 16px 8px; border: 1px solid transparent; border-bottom: 0;
  border-radius: 8px 8px 0 0; background: none; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.ed-tabs button:hover { background: rgba(255, 255, 255, 0.6); }
.ed-tabs button.on { background: var(--panel); border-color: var(--line-strong); color: var(--ink); }
.tab-note { margin-left: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tab-note:empty { display: none; }
.tab-note.warn { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #f5b22e; color: #1b1f24; font-size: 11px; }
.tab-note.warn:empty { display: none; }
.ed-summary { margin-left: auto; display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 0 2px 8px; font-size: 13px; color: var(--ink-2); }
.ed-summary b { color: var(--ink); }
.ed-top > [data-out=error] .error { margin: 10px 0 0; display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.ed-top > [data-out=error] .error .pre { flex: 1 1 320px; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.ed-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ed-body > .card + .card, .ed-body > .placement + .placement { margin-top: 12px; }
.editor textarea.wide { min-height: 90px; }

/* design placements */
.placement .pl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px 0 16px; }
.pl-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #eef0f3; font-size: 12px; font-weight: 700; }
.placement .row-actions { margin-left: auto; }
.pl-lines { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.form-grid label.pill-check {
  display: inline-flex; flex-direction: row; align-items: center; gap: 6px;
  padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fafbfc;
  font-weight: 500; color: var(--ink); font-size: 12.5px; cursor: pointer;
}
.form-grid label.pill-check:has(input:checked) { background: var(--accent-soft); border-color: #b9cdf3; }
.pl-imp { margin-left: auto; font-size: 13px; }

/* line items with the size grid */
table.lines-edit th, table.lines-edit td { padding: 6px 5px; vertical-align: top; }
table.lines-edit th:first-child, table.lines-edit td:first-child { padding-left: 12px; }
table.lines-edit td:first-child { padding-top: 12px; }
table.lines-edit select { width: 92px; padding: 5px 4px; }
table.lines-edit input.part { width: 104px; }
table.lines-edit input.color { width: 104px; }
table.lines-edit td.desc { min-width: 200px; width: 32%; }
table.lines-edit td.desc textarea { min-height: 32px; }
table.lines-edit input.qty { width: 46px; padding: 6px 4px; text-align: center; font-variant-numeric: tabular-nums; }
table.lines-edit td.num input.qty { width: 58px; text-align: right; }
table.lines-edit input.price { width: 80px; text-align: right; font-variant-numeric: tabular-nums; }
table.lines-edit th.size, table.lines-edit td.size { text-align: center; width: 52px; }
table.lines-edit td.num { padding-top: 12px; }
table.lines-edit td.num:has(input) { padding-top: 6px; }
table.lines-edit tr.k-note td { background: #fbfbfc; }
table.lines-edit tfoot td { font-weight: 700; background: #f8f9fb; border-top: 1px solid var(--line); padding-top: 9px; padding-bottom: 9px; }
td.row-actions { white-space: nowrap; }
table.lines-edit td.row-actions { padding-top: 8px; }

.line-flags { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 3px; }
.line-flags label.check.small { margin-top: 0; }
.li-bottom { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.li-left { flex: 1 1 320px; max-width: 620px; }
.li-qty { font-size: 14px; margin: 4px 0 8px; }
.li-qty b { font-size: 16px; margin-left: 6px; }
.li-totals { flex: 0 1 460px; }
.li-totals .trow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.li-totals .trow.strong { font-weight: 700; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 7px; }
.editor .li-totals input.money { width: 110px; text-align: right; }
.tax-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.editor .tax-ctl select { width: auto; padding: 4px 6px; }
.editor .tax-ctl input.rate { width: 64px; text-align: right; padding: 4px 6px; }
.designs-for td { vertical-align: middle; }
.linkish-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linkish-btn:hover { text-decoration: underline; }
.spec-bar .body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; }
.spec-bar .body > span { margin-right: 6px; }
.ed-body > .spec-loc, .ed-body > .spec-bar + .spec-loc { margin-top: 12px; }
.spec-where { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-head .spec-where ~ .btn { flex: none; }
.spec-loc .card-head h2 { margin-right: 10px; }
table.spec-lines td, table.spec-lines th { padding: 6px 10px; }
table.spec-lines th.size, table.spec-lines td.size { text-align: center; width: 48px; }
table.spec-lines td:first-child { width: 110px; }
table.spec-lines tfoot td { font-weight: 700; background: #f8f9fb; }
.ship-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.notes-intro { margin: 0 0 10px; }
.notes-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.note-box .body { padding-top: 8px; }
.note-box textarea { min-height: 64px; }
.note-box .body p { margin: 6px 0 0; }
label.invoice-notes { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
label.invoice-notes + p { margin: 4px 0 0; }
.print-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }

/* the customer window (ShopWorks' New Customer layout) and the customer screen */
.cust-win { display: flex; align-items: stretch; min-height: 440px; padding: 0; }
.dlg-body.cust-win { padding: 0; }
.cust-menu { flex: 0 0 180px; display: flex; flex-direction: column; background: #eceef1; border-right: 1px solid var(--line); }
.cust-menu > button {
  text-align: left; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--line); background: none;
  font: inherit; font-size: 14.5px; color: var(--ink-2); cursor: pointer;
}
.cust-menu > button:hover { background: #e2e5ea; }
.cust-menu > button.on { background: #4a4f57; color: #fff; font-weight: 600; }
.cust-menu > button.on .tab-note { color: #d6dae0; }
.cust-menu-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.cust-panes { flex: 1; min-width: 0; padding: 16px 20px 20px; }
.cust-id { text-align: right; margin-bottom: 10px; }
.cust-grid { display: grid; grid-template-columns: 130px minmax(0, 460px); gap: 7px 12px; align-items: center; }
.cust-grid > label { text-align: right; font-size: 13.5px; color: var(--muted); font-weight: 400; }
.cust-grid input, .cust-grid select, .cust-grid textarea {
  width: 100%; min-width: 0; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--panel); font: inherit; color: var(--ink);
}
.cust-grid input:focus, .cust-grid select:focus, .cust-grid textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.cust-grid input.short { max-width: 140px; }
.cust-grid .inline { display: flex; align-items: center; gap: 10px; }
.cust-grid .inline input[type=checkbox] { width: auto; }
.cust-grid .csz { display: grid; grid-template-columns: minmax(0, 1fr) 56px 110px; gap: 6px; }
.cust-grid > p { margin: 0; }
.cust-page .cust-win { margin-top: 4px; }
.contacts-edit th, .contacts-edit td { padding: 5px 4px; }
.contacts-edit td:first-child, .contacts-edit th:first-child { padding-left: 12px; text-align: center; }
.contacts-edit input:not([type=radio]) {
  width: 100%; min-width: 96px; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--panel); font: inherit; color: var(--ink);
}
.contacts-edit input[type=email] { min-width: 190px; }
.address-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.address-card .card-head h2 { margin-right: auto; }
.address-card .cust-grid { grid-template-columns: 100px minmax(0, 1fr); }
.admin-pane h3 { margin: 4px 0 6px; font-size: 15px; }
.admin-pane h3 + p { margin-top: 0; max-width: 720px; }
.admin-pane p + .btn, .admin-pane .btn + span { margin-bottom: 18px; }
.admin-pane .btn + span { margin-left: 10px; }

/* pickers */
.picker-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.picker-bar .search { max-width: 420px; }
.picker-bar select { width: auto; max-width: 260px; }
.picker-list { max-height: min(56vh, 560px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.card .picker-list { max-height: none; border: 0; }
table.pick tbody tr { cursor: pointer; }
table.pick tbody tr:hover, table.pick tbody tr:focus { background: #f2f6fd; outline: none; }
table.pick tbody tr.picked { background: var(--accent-soft); }
table.pick thead th { position: sticky; top: 0; z-index: 1; }
table.types td { vertical-align: middle; }
ul.addr-pick { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.addr-pick button {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); font: inherit; color: var(--ink); cursor: pointer;
}
ul.addr-pick button:hover { border-color: var(--accent); background: #f7faff; }

/* dialogs and messages */
dialog.dlg {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28); color: var(--ink);
}
dialog.dlg.wide { width: min(1000px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(20, 23, 28, 0.45); }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 17px; font-weight: 650; flex: 1; }
.dlg-body { padding: 14px 18px 18px; overflow: auto; }
.dlg-body > p:first-child { margin-top: 0; }
.dlg fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 12px; }
.dlg-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.dlg-actions > .muted { margin-right: auto; font-size: 13px; }
.dlg .error { white-space: pre-wrap; }
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 100; transform: translate(-50%, 16px); opacity: 0;
  padding: 10px 16px; border-radius: 10px; background: #1b1f24; color: #fff; font-weight: 600;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.3); transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: var(--warn); }

@media (max-width: 760px) {
  /* On a phone the top bar may take two lines rather than push the page sideways. */
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; gap: 6px 10px; padding: 8px 12px; }
  .who { flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px; }
  .who > span:not(.role):not(.env):not(.switch) { display: none; }
  /* The nav wraps rather than push a 375 px phone sideways (five links for admin and office). */
  .nav { flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 6px 8px; }
  main { padding: 12px 12px 32px; }
  .hide-sm { display: none; }
  .grid.wide-first { grid-template-columns: 1fr; }
  .page-head .actions { margin-left: 0; }
  .ed-top { position: static; }
  .ed-num { text-align: left; }
  .ed-actions { flex-wrap: wrap; }
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid > .q { grid-column: span 1; }
  .ed-summary { margin-left: 0; }
  .notes-grid { grid-template-columns: minmax(0, 1fr); }
  .cust-win { flex-direction: column; min-height: 0; }
  .cust-menu { flex: none; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .cust-menu > button { border-bottom: 0; padding: 9px 12px; }
  .cust-menu-actions { margin-top: 0; flex-direction: row; width: 100%; }
  .cust-panes { padding: 12px; }
  .cust-grid, .address-card .cust-grid { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .cust-grid > label { text-align: left; margin-top: 6px; }
  .address-cards { grid-template-columns: minmax(0, 1fr); }
}

/* the orders list: an invoiced order's date */
.invoiced { color: var(--ok); font-weight: 600; white-space: nowrap; }

/* designs: the list */
table.list tbody tr[data-design] { cursor: pointer; }
table.list tbody tr[data-design]:hover { background: #f6f8fb; }
.thumb-cell { width: 58px; padding-top: 5px !important; padding-bottom: 5px !important; }
.thumb-cell img {
  display: block; width: 46px; height: 46px; object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: 4px;
}
td.nowrap { white-space: nowrap; }
/* Load ShopWorks thumbnails (thumbs-load.js) */
.tl p { margin: 0; }
.tl-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-pick .btn.disabled { pointer-events: none; }
.tl-found { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #f8fafc; overflow-wrap: anywhere; }
.warn-text { color: var(--warn); }
.tl-progress { display: flex; flex-direction: column; gap: 6px; }
.tl-progress progress { width: 100%; height: 14px; }
.tl-phase { font-weight: 600; }
.tl-counts li { padding: 3px 0; }
.tl-counts li .btn { margin-left: 6px; }
.tl-failed { max-height: 180px; overflow: auto; font-size: 12.5px; color: var(--bad); overflow-wrap: anywhere; }
.tl-names { max-height: 180px; overflow: auto; font-size: 12.5px; overflow-wrap: anywhere; }
.tl-time { font-size: 12.5px; }
/* .btn is display: inline-flex, which would otherwise show a button marked hidden */
.btn[hidden], .tl [hidden] { display: none !important; }
.page-head select.filter { width: auto; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--panel); font: inherit; }

/* the design screen, after ShopWorks' Designs window */
.dz-buttons { gap: 6px; }
.dz-panels { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); }
.dz-panel { display: flex; flex-direction: column; gap: 7px; padding: 12px 16px; min-width: 0; }
.dz-panel + .dz-panel { border-left: 1px solid var(--line); }
.dz-row { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13.5px; }
.dz-row > span:first-child { text-align: right; color: var(--muted); }
.dz-pair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dz-no { min-width: 46px; font-size: 15px; }
.dz-cust { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.dz-done { min-width: 52px; font-weight: 700; }
.btn.dz-done.no { background: var(--bad-soft); border-color: #f0c2c2; color: var(--bad); }
.btn.dz-done.yes { background: var(--ok-soft); border-color: #b5dfc3; color: var(--ok); }
.icon-btn.x { color: var(--bad); font-size: 13px; }
.icon-btn.dot { color: var(--accent); font-size: 12px; }
.icon-btn.plus { color: var(--ok); font-size: 19px; font-weight: 700; }
.ed-body > .dz-loc { margin-top: 12px; }
.dz-loc { background: #eaf0f9; border-color: #d3deef; }
.dz-loc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px 0; }
.dz-loc-no {
  display: inline-flex; align-items: flex-end; gap: 3px; padding: 2px 7px; border-radius: 6px;
  background: #4a4f57; color: #fff; font-weight: 700; font-size: 18px; line-height: 1.2;
}
.dz-loc-no small { margin-bottom: 2px; padding: 0 4px; border-radius: 3px; background: #fff; color: var(--ink); font-size: 10.5px; }
.dz-loc-name { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.editor .dz-loc-name select, .editor .dz-loc-name input { width: 230px; font-size: 14px; font-weight: 500; }
.dz-tools { margin-left: auto; display: flex; gap: 2px; }
.dz-loc-body {
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; gap: 16px; align-items: start; padding: 10px 14px 14px;
}
.dz-loc-fields { display: flex; flex-direction: column; gap: 5px; }
.dz-loc-fields .dz-row { grid-template-columns: 96px minmax(0, 1fr); }
.editor .dz-loc-fields input, .editor .dz-grid input:not([type=checkbox]) { padding: 4px 7px; }
.dz-loc-fields textarea { margin-top: 4px; }
table.dz-grid { width: 100%; border-collapse: collapse; }
table.dz-grid th { padding: 0 3px 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: left; white-space: nowrap; }
table.dz-grid td { padding: 2px 3px; }
table.dz-grid td.n, table.dz-grid th.n { width: 22px; text-align: right; color: var(--muted); font-size: 12px; }
table.dz-grid th.n { color: var(--ink); font-size: 13px; }
table.dz-grid td.c, table.dz-grid th.c { width: 36px; text-align: center; }
table.dz-grid td.wide { min-width: 150px; }
table.dz-grid td input:not([type=checkbox]) { min-width: 64px; }
table.dz-grid tbody tr:nth-child(even) input:not([type=checkbox]) { background: #f1f2f4; }
table.dz-grid th.dz-grid-tools { text-align: right; }
table.dz-grid td.row-actions { width: 90px; }
.dz-thumb { display: flex; gap: 6px; align-items: flex-end; }
.dz-thumb-box {
  flex: 1; min-width: 0; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 6px; overflow: hidden;
  background: #fff; border: 1px solid var(--line-strong); text-align: center; cursor: copy;
}
.dz-thumb-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dz-thumb-box:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.dz-thumb-box.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-thumb-tools { display: flex; flex-direction: column; gap: 4px; }
.dz-thumb-tools .btn { text-align: left; }
.dz-add { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.dz-pad { margin: 6px 16px 10px; }
.dz-picture { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; min-width: 0; }
.dz-picture-box {
  width: 120px; height: 120px; display: grid; place-items: center; padding: 4px; overflow: hidden;
  background: #fff; border: 1px solid var(--line-strong); text-align: center;
}
.dz-picture-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dz-picture-side { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.dz-enlarged { display: grid; place-items: center; background: #fff; }
.dz-enlarged img { max-width: 100%; max-height: 72vh; object-fit: contain; }
@media (max-width: 1180px) {
  .dz-loc-body { grid-template-columns: 280px minmax(0, 1fr); }
  .dz-thumb { grid-column: 1 / -1; max-width: 360px; }
}
@media (max-width: 900px) {
  .dz-panels { grid-template-columns: minmax(0, 1fr); }
  .dz-panel + .dz-panel { border-left: 0; border-top: 1px solid var(--line); }
  .dz-loc-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .dz-row, .dz-loc-fields .dz-row { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .dz-row > span:first-child { text-align: left; }
  .dz-tools { margin-left: 0; }
  .editor .dz-loc-name select, .editor .dz-loc-name input { width: 100%; }
  .dz-loc-name { flex: 1 1 100%; }
}
.dz-loc-fields input::placeholder { color: #a3abb6; }
.dz-arrows { display: inline-flex; gap: 2px; }
/* shown only when the small screen layout hides the column that holds it */
.show-sm { display: none; }
@media (max-width: 760px) { .show-sm { display: block; } }

/* the shop floor: ShopWorks' station buttons and Order Status panel */
.stations { display: inline-flex; border: 1px solid #8a9099; border-radius: 6px; overflow: hidden; background: #d9dce1; }
.stations a {
  padding: 3px 10px; font: 700 12.5px/1.5 "Segoe UI", system-ui, sans-serif; color: #1b1f24; border-left: 1px solid #8a9099;
}
.stations a:first-child { border-left: 0; }
.stations a:hover { background: #eceef1; text-decoration: none; }
.stations a.on { background: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.flag {
  display: inline-grid; place-items: center; min-width: 36px; padding: 0 6px; height: 18px; border-radius: 3px;
  font: 700 11.5px/1 "Segoe UI", system-ui, sans-serif; color: #fff; border: 1px solid rgba(0, 0, 0, 0.25);
}
.flag.no { background: #e0453c; }
.flag.yes { background: #2e8b3e; }
.flag.partial { background: #e6a817; color: #1b1f24; }
.flag.na { background: #2fa3a8; }
.flag.none { background: #eef0f3; border-color: var(--line); }
.flags { display: flex; flex-direction: column; gap: 4px; }
.flag-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.hold-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #8a9099; background: #fff; }
.hold-dot.on { background: var(--bad); border-color: var(--bad); }
.status-card { display: flex; gap: 16px; flex-wrap: wrap; }
.status-card .flags { min-width: 120px; }
.status-facts { display: flex; flex-direction: column; gap: 3px; color: var(--ink-2); }
.floor-head { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; }
.floor-type { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.hold-flag { color: var(--bad); font-weight: 800; font-size: 17px; }
.floor-cust { display: flex; gap: 8px; align-items: baseline; font-size: 15px; }
.floor-num { margin-left: auto; white-space: nowrap; }
.floor-num b { font-size: 22px; color: var(--accent); margin-left: 4px; vertical-align: -2px; }
.floor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.floor-main > .card + .card { margin-top: 12px; }
.floor-side { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.side-block b { font-size: 16px; }
.floor-main h3.sub { margin: 14px 0 6px; font-size: 13.5px; }
.floor-main h3.sub:first-of-type { margin-top: 4px; }
.card-head .inline-field { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.card-head .inline-field.grow { flex: 1 1 200px; }
.card-head .inline-field input, .card-head .inline-field select, .ship-form input, .ship-form select, .prod-form input,
.prod-form select, .inv-facts input {
  padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); font: inherit; color: var(--ink);
}
.card-head .inline-field.grow input { width: 100%; }
table.goods td.size, table.goods th.size { text-align: center; width: 58px; }
table.goods td.desc { min-width: 160px; }
table.goods input.qty {
  width: 48px; padding: 3px 4px; text-align: center; border: 1px solid var(--line-strong); border-radius: 5px;
  font: inherit; font-variant-numeric: tabular-nums; background: #fffbe6;
}
table.goods input.qty.wide { width: 64px; }
.done-mark { color: var(--ok); font-weight: 700; }
.all-done { color: var(--ok); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.batch { padding: 8px 0; border-top: 1px solid var(--line); }
.batch:first-child { border-top: 0; padding-top: 0; }
.batch-head { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 3px; }
.batch-head .btn { margin-left: auto; }
.batch-line { font-size: 13px; padding-left: 12px; }
.ship-form, .prod-form { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.ship-form label, .prod-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ship-form label.short input { width: 70px; }
.ship-form label.grow, .prod-form label.grow { flex: 1 1 220px; }
.ship-facts { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.floor-facts { display: flex; flex-direction: column; gap: 8px; }
.floor-facts > div { display: flex; align-items: center; gap: 10px; }
.btn.flag-btn { min-width: 52px; font-weight: 700; }
.btn.flag-btn.no { background: var(--bad-soft); border-color: #f0c2c2; color: var(--bad); }
.btn.flag-btn.yes { background: var(--ok-soft); border-color: #b5dfc3; color: var(--ok); }
.prod-status { padding: 2px 12px; border-radius: 4px; font-weight: 700; color: #fff; }
.prod-status.no { background: #e0453c; }
.prod-status.yes { background: #2e8b3e; }
.inv-bottom { display: flex; gap: 16px 32px; flex-wrap: wrap; align-items: flex-start; }
.inv-facts { display: flex; flex-direction: column; gap: 7px; flex: 1 1 280px; }
.inv-facts label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.inv-bottom .totals { flex: 0 1 300px; }
td.short { color: var(--warn); font-weight: 700; }
@media (max-width: 900px) {
  .floor-grid { grid-template-columns: minmax(0, 1fr); }
  .floor-side { order: -1; flex-direction: row; flex-wrap: wrap; gap: 10px 20px; }
  .floor-num { margin-left: 0; }
}

/* purchase orders, after ShopWorks' Purchasing By PO */
.po-kind { color: var(--bad); font-size: 15px; }
.dz-row.top { align-items: start; }
.dz-row.top > span:first-child { padding-top: 6px; }
.editor input.short { max-width: 90px; }
.po-address { display: grid; grid-template-columns: minmax(0, 1fr) 56px 90px; gap: 4px; }
.po-address input { grid-column: 1 / -1; }
.po-address input.a-city { grid-column: 1; }
.po-address input.a-state { grid-column: 2; }
.po-address input.a-zip { grid-column: 3; }
.po-address-tools { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
table.po-lines td.desc { min-width: 220px; }
table.po-lines input.part { width: 120px; }
.po-log { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.po-log-row { display: flex; gap: 10px; align-items: center; font-size: 13px; border-bottom: 1px solid var(--line); padding: 3px 0; }
.po-log-row .grow-text { flex: 1; }
.po-log-add { display: flex; gap: 8px; }
.po-log-add input { flex: 1; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; }
.email-po textarea { font: 13px/1.4 ui-monospace, Consolas, monospace; }
.email-po fieldset label.check { font-size: 13px; }
table.pick tbody tr.blocked td { color: var(--muted); }
.po-top .dz-panels { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.3fr) minmax(0, 1fr); }
.po-top .dz-row { grid-template-columns: 112px minmax(0, 1fr); }
.po-address { grid-template-columns: minmax(0, 1fr) 46px 72px; }
.dz-pair .btn { white-space: nowrap; }
table.po-lines td input:not(.qty):not(.price) { width: 100%; }
table.po-lines td:nth-child(3) { min-width: 170px; }
table.po-lines td:nth-child(5) { min-width: 150px; }
@media (max-width: 900px) { .po-top .dz-panels { grid-template-columns: minmax(0, 1fr); } }

/* quotes (the quotes design, section C.6.9) */
.tabs .tab-link { display: inline-block; padding: 5px 12px; border-radius: 6px; color: var(--ink-2); }
.tabs .tab-link:hover { text-decoration: none; background: #eef0f3; }
.tabs .tab-link.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
table.list tbody tr[data-href]:not([data-href=""]) { cursor: pointer; }
table.list tbody tr[data-href]:not([data-href=""]):hover { background: #f6f8fb; }
.quotes-tools { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: -4px 0 10px; }
.find-w { display: flex; align-items: center; gap: 8px; }
.find-w label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.find-w input { width: 110px; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; }
label.check.recent { margin: 0 0 10px; }
.more-row { padding: 8px 12px; border-top: 1px solid var(--line); }
td.row-action { white-space: nowrap; text-align: right; }
.q-pill { border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 11px; font-family: inherit; font-size: 12.5px;
          font-weight: 600; line-height: 1.35; background: var(--panel); color: var(--ink-2); cursor: pointer; text-align: left; max-width: 100%; }
.q-pill.ok { border-color: #b6dcc3; background: var(--ok-soft); color: var(--ok); }
.q-pill.warn { border-color: #f0d3a4; background: var(--warn-soft); color: var(--warn); }
.q-pill.bad { border-color: #f1c0c0; background: var(--bad-soft); color: var(--bad); }
.q-banner { margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); font-size: 13.5px; }
.q-banner.ok { border-color: #b6dcc3; background: var(--ok-soft); }
.q-banner.warn { border-color: #f0d3a4; background: var(--warn-soft); }
.q-banner.bad { border-color: #f1c0c0; background: var(--bad-soft); }
.q-banner .btn { margin-left: 6px; }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain.files li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--line); }
ul.plain.files li > span:first-child { font-weight: 600; overflow-wrap: anywhere; }
ul.plain.files li .btn { margin-left: auto; }
.btn.disabled, a.btn[aria-disabled="true"] { opacity: 0.5; }
.show-sm-inline { display: none !important; }
.quote-ed .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 3px; }
.quote-ed .inline { display: flex; align-items: center; gap: 6px; }
.quote-ed .inline input { flex: 1; }
.q-head .q-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-head .q-title b { font-size: 20px; color: var(--accent); }
.q-head-total { font-weight: 700; font-size: 15px; min-width: 70px; text-align: right; }
.q-acts { display: contents; }
.q-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; margin-top: 12px; }
.q-main, .q-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.q-side { position: sticky; top: 110px; }
@media (max-height: 820px) { .q-side { position: static; } }
.q-cust { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-garment { position: relative; padding: 10px 34px 10px 0; border-bottom: 1px solid var(--line); }
.q-garment .icon-btn.x { position: absolute; right: 0; top: 18px; }
.q-garment-fields { display: grid; grid-template-columns: 150px 150px minmax(0, 1fr); gap: 8px 10px; }
.q-garment-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.q-garment-fields .full { grid-column: 1 / -1; }
.size-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.size-chips .chip small { display: block; font-size: 10.5px; font-weight: 500; opacity: 0.8; }
.chip.unknown { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.yours { background: var(--accent-soft); color: var(--accent); margin-left: 4px; }
.chip.follows { background: #eef0f3; color: var(--ink-2); margin-left: 4px; }
.q-row-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.q-foot { margin-left: auto; font-size: 13px; }
.q-pieces input.short, .q-pieces-choice input.short { width: 80px; }
.q-pieces-choice { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.q-finish { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding-top: 18px; }
.loc-card { border: 1px solid var(--line-strong); border-radius: 8px; margin-bottom: 8px; background: #fbfcfd; }
.loc-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; }
.loc-head .loc-sum { flex: 1; font-weight: 600; min-width: 0; }
.loc-body { display: none; padding: 4px 12px 12px; }
.loc-card.open .loc-body { display: grid; }
.q-loc-problems { padding: 0 12px 6px; color: var(--bad); font-size: 12.5px; }
.q-more summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.q-more > .form-grid { margin-top: 8px; }
.q-price .card-head { gap: 6px 10px; }
.q-status { font-size: 12.5px; font-weight: 600; }
.q-status.ok { color: var(--ok); }
.q-status.bad { color: var(--bad); }
.q-status.busy, .q-status.muted { color: var(--muted); }
table.q-lines { width: 100%; font-size: 13px; }
table.q-lines th, table.q-lines td { padding: 5px 6px; vertical-align: top; }
table.q-lines td.num, table.q-lines th.num { text-align: right; white-space: nowrap; }
table.q-lines tbody tr.charge td { color: var(--ink-2); }
table.q-lines tfoot td { border-top: 1px solid var(--line); }
table.q-lines tfoot tr.strong td { font-weight: 700; }
.q-each { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer;
          text-decoration: underline dotted; text-underline-offset: 3px; }
.q-greyed { opacity: 0.45; }
.q-web .body p { margin: 0 0 4px; }
.q-web .note { margin-top: 4px; }
.q-web-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.q-bar { display: none; }
dialog.q-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; margin: 0; width: 100%; max-width: 100%;
                 max-height: 75vh; overflow: auto; border: 0; border-radius: 14px 14px 0 0; padding: 0; background: var(--panel); }
dialog.q-sheet::backdrop { background: rgba(16, 24, 40, 0.35); }
.q-sheet-body { padding: 8px 16px 16px; }
.q-sheet-line { padding: 8px 0; border-bottom: 1px solid var(--line); }
.q-sheet-line .num { text-align: left; color: var(--ink-2); margin-top: 2px; }
table.web-lines tr.h td { padding-top: 10px; }
@media (max-width: 760px) {
  .show-sm-inline { display: block !important; }
  .q-grid { grid-template-columns: minmax(0, 1fr); }
  .q-side { position: static; }
  .q-price { display: none; }
  .quote-ed { padding-bottom: 76px; }
  .quote-ed input, .quote-ed select, .quote-ed textarea { font-size: 16px; }
  .q-garment-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .q-garment-fields label.wide { grid-column: 1 / -1; }
  .q-head .ed-actions { width: 100%; }
  .q-head-total { margin-left: auto; }
  .q-bar { display: flex; align-items: center; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
           padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line-strong); }
  .q-bar-text { flex: 1; font-size: 13.5px; min-width: 0; }
  .q-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
  .q-dot.busy, .q-dot.muted { background: #a3abb6; }
  .q-dot.bad { background: var(--bad); }
  .q-foot { margin-left: 0; }
  .quotes-tools { margin-top: 0; }
  table.quotes-in .chip, table.quotes-ours .chip { white-space: normal; }
  table.quotes-in th, table.quotes-in td, table.quotes-ours th, table.quotes-ours td { padding: 8px 6px; }
  table.quotes-in td:nth-child(2), table.quotes-ours td:nth-child(2) { overflow-wrap: anywhere; }
  /* Quotes in: the total is on the quote's own line (pieces and total), so its column goes */
  table.quotes-in th:nth-child(6), table.quotes-in td:nth-child(6) { display: none; }
}

/* A newer build of ShopManager is on the website, and this screen has unsaved work (app/js/build.js) */
.updated {
  position: fixed; left: 50%; top: 62px; transform: translateX(-50%); z-index: 60;
  display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 32px);
  padding: 8px 12px; border-radius: 8px; background: #1b1f24; color: #fff; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
