:root {
  --ink: #1d2433; --muted: #6b7385; --line: #e3e6ec; --bg: #f5f6f8; --card: #fff;
  --brand: #111111; --brand-2: #2b2b2b; --accent: #d71920; --accent-dark: #b0141a; --ok: #1e7a4c; --ok-bg: #e5f4ec; --warn: #9a5b00; --warn-bg: #fff3dc;
  --bad: #b42318; --bad-bg: #fde8e6; --info: #2952a3; --info-bg: #e8eefc; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--ink); }
a:hover { color: var(--accent); }
h1 { font-size: 24px; margin: 4px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 14px 0 4px; }
.wrap { max-width: none; margin: 0 auto; padding: 0 28px; }
main.wrap { padding-top: 20px; padding-bottom: 60px; }
.top { background: var(--brand); color: #fff; border-bottom: 3px solid var(--accent); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand span { font-weight: 700; color: var(--accent); margin-left: 6px; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.brand:hover { color: #fff; }
.top nav { display: flex; gap: 4px; align-items: center; }
.top nav a, .top nav .link { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; opacity: .85; font-size: 14px; white-space: nowrap; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.12); opacity: 1; color: #fff; }
.top nav a.on { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.top nav form { margin: 0; }
.demo-bar { background: var(--warn-bg); color: var(--warn); text-align: center; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid #f1dfb8; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; gap: 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 14px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c5cad4; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-2); }
.btn.primary:disabled { opacity: .6; cursor: wait; }
.btn.warn { border-color: #e9c46a; background: var(--warn-bg); color: var(--warn); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-top: 10px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 14px; }
.link.danger { color: var(--muted); } .link.danger:hover { color: var(--bad); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; vertical-align: middle; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: #eef0f3; color: var(--muted); }
.flash { background: var(--info-bg); color: var(--info); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.error-text { color: var(--bad); } .warn-text { color: var(--warn); }

table { border-collapse: collapse; width: 100%; }
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tbody tr { cursor: pointer; } .list tbody tr:hover { background: #fafbfc; }
.card .list { border: 0; } .card .list tbody tr { cursor: default; }
.list tfoot td { border: 0; padding: 4px 14px; } .list tfoot .total td { font-weight: 700; font-size: 16px; padding-top: 8px; }
.num { text-align: right; white-space: nowrap; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; }
.filters input { flex: 1; max-width: 420px; }
.filters select { width: 180px; }
.empty { text-align: center; padding: 40px; }
input, select, textarea { font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid #d3d7df; border-radius: 8px; background: #fff; width: 100%; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #f3c2c4; border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label input, label select, label textarea { margin-top: 4px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
label.check input { width: auto; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.mt { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .card { margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.actions form { margin: 0; display: flex; gap: 6px; }
.inline-pay select { width: auto; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.step.ok .dot { background: var(--ok-bg); color: var(--ok); } .step.bad .dot { background: var(--bad-bg); color: var(--bad); } .step.wait .dot { background: #eef0f3; color: var(--muted); }
.history { list-style: none; padding: 0; margin: 0; } .history li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border: 0; }
.kv td { padding: 6px 0; border-bottom: 1px solid var(--line); } .kv td:last-child { text-align: right; font-weight: 500; }
.kv tr.total td { font-size: 18px; font-weight: 700; border: 0; padding-top: 10px; }
.conn p { margin: 4px 0; }

/* order form */
.order-form { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.sticky { position: sticky; top: 16px; }
.seg { display: inline-flex; border: 1px solid #d3d7df; border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--muted); border-right: 1px solid #e6e8ec; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
.inline-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.search { position: relative; margin-bottom: 8px; }
.results { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(20,30,50,.12); max-height: 320px; overflow: auto; }
.results:empty { display: none; }
.results button { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 10px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.results button:hover, .results button:focus { background: #fbeeee; }
.results .sku { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.results .right { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.pad { padding: 10px 12px; }
.picked { background: #f1f1f1; padding: 8px 12px; border-radius: 8px; margin: 0 0 12px; }
.lines-edit { margin: 8px 0 12px; }
.lines-edit th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.lines-edit td { padding: 6px 4px; vertical-align: top; border-bottom: 1px solid var(--line); }
.lines-edit td.num { padding-top: 15px; font-weight: 500; }
.lines-edit input, .lines-edit select { padding: 7px 8px; }
.w-sku { width: 150px; } .w-num { width: 90px; text-align: right; } .w-sm { width: 70px; text-align: right; }
.empty-lines { text-align: center; padding: 20px !important; }

/* login */
body.login { display: grid; place-items: center; min-height: 100vh; }
.login-card { width: 340px; }
.login-card h1 { font-size: 20px; } .accent { color: var(--accent); }
body.login { background: #111; } body.login .card { border-top: 4px solid var(--accent); } .login-card .btn { width: 100%; justify-content: center; }

@media (max-width: 860px) {
  .order-form, .grid2 { grid-template-columns: 1fr; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .top nav a { padding: 8px 6px; }
  .brand span { display: none; }
}

/* sending + inventory */
.nowrap { white-space: nowrap; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); margin-right: 4px; }
.chip.sent { background: var(--ok-bg); color: var(--ok); border-color: #cfe9da; }
.chip.error { background: var(--bad-bg); color: var(--bad); border-color: #f6c9c4; }
.chip.not_sent { background: #f3f4f6; color: var(--muted); }
.send-card .step { align-items: center; }
.send-tick { width: 22px; height: 22px; margin: 3px; accent-color: var(--accent); flex: none; }
.send-card .btn.primary { margin-top: 12px; }
label.check.sub { margin-left: 26px; } label.check.dim { opacity: .5; }
.send-box { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; margin-top: 14px; }
.send-box .send-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.send-box label.check { margin-bottom: 6px; }
.send-box input[type=checkbox], label.check input[type=checkbox], label.check input[type=radio] { accent-color: var(--accent); }
.notice { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.upload-row input[type=file] { width: auto; flex: 1; min-width: 240px; }
.upload-row label.check { margin: 0; }
.result-box { margin-top: 14px; background: #f7f7f8; border-radius: 8px; padding: 12px 14px; }
.result-box p { margin: 0 0 6px; } .result-box details { margin: 6px 0; } .result-box summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.actions.tight { margin: 0; }
.list.static tbody tr { cursor: default; }
.list.static form { margin: 0; }
.results .size { display: inline-block; background: #111; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.results .rrp { text-decoration: line-through; color: var(--muted); font-size: 12px; }

/* settings */
.settings-form { max-width: 820px; }
.hint { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.conn-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.conn-row:last-of-type { border-bottom: 0; }

/* payments */
.hidden { display: none !important; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.pill { margin: 0; color: var(--ink); font-size: 14px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 8px 14px; border: 1px solid #d3d7df; border-radius: 9px; cursor: pointer; background: #fff; }
.pill input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.pill input:focus-visible + span { outline: 2px solid var(--accent); }
.paid-fields { border-left: 3px solid var(--accent); padding-left: 12px; margin: 4px 0 12px; }
.date-label { max-width: 220px; }
.pay-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.paid-email { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.paid-email form.inline { margin: 0; }
.badge.big { font-size: 13px; padding: 4px 12px; }
.refs { margin-top: 10px; } .refs td { font-size: 14px; }
.pay-status { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; }
.subhead { font-weight: 600; font-size: 14px; margin: 6px 0 8px; }
.inline-test { display: flex; gap: 8px; } .inline-test input { width: 260px; }
.numbers-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mono-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .02em; }
.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.img-slot { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.img-slot .thumb { width: 110px; height: 64px; display: grid; place-items: center; background: #fafafa; border-radius: 6px; flex: none; }
.img-slot .thumb img { max-width: 104px; max-height: 58px; object-fit: contain; }
.img-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.img-actions label.btn { margin: 0; color: var(--ink); }
.club-acc { display: flex; gap: 6px; margin: 0; }
.club-acc input { padding: 6px 8px; font-size: 13px; }
.club-acc input[name=accountsName] { width: 140px; }
.heading-input { font-weight: 700; } .heading-row td { background: #fafafa; }
/* item lines: fixed column widths so Item gets the space */
.lines-edit { table-layout: fixed; width: 100%; }
.lines-edit th:nth-child(1) { width: 118px; } .lines-edit th:nth-child(3) { width: 62px; }
.lines-edit th:nth-child(4) { width: 76px; } .lines-edit th:nth-child(5) { width: 70px; }
.lines-edit th:nth-child(6) { width: 82px; } .lines-edit th:nth-child(7) { width: 78px; }
.lines-edit th:nth-child(8) { width: 84px; } .lines-edit th:nth-child(9) { width: 24px; }
.lines-edit td input, .lines-edit td select { width: 100%; min-width: 0; }
.lines-edit .w-sku, .lines-edit .w-num, .lines-edit .w-sm { width: 100%; }
.lines-edit th { text-align: left; } .lines-edit th.num { text-align: right; }
.lines-edit td input, .lines-edit td select { padding: 7px 6px; font-size: 13px; }
.lines-edit input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.lines-edit input[type=number]::-webkit-inner-spin-button, .lines-edit input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lines-edit th:nth-child(1) { width: 112px; } .lines-edit th:nth-child(3) { width: 52px; }
.lines-edit th:nth-child(4) { width: 66px; } .lines-edit th:nth-child(5) { width: 64px; }
.lines-edit th:nth-child(6) { width: 74px; } .lines-edit th:nth-child(7) { width: 68px; }
.lines-edit th:nth-child(8) { width: 78px; }
.order-form { grid-template-columns: 1fr 270px; }
.editing-tag { background: var(--brand); color: #fff; font-weight: 700; padding: 8px 14px; border-radius: 9px; font-size: 14px; }
.btn.primary-outline { border-color: var(--brand); font-weight: 600; }
.note-form textarea { margin-bottom: 8px; }
.note-actions { display: flex; gap: 8px; justify-content: flex-end; }
.note-actions .note-by { width: 140px; }
.notes-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.notes-list li { border-left: 3px solid var(--accent); background: #fafafa; border-radius: 0 8px 8px 0; padding: 10px 14px; }
.note-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.note-meta strong { color: var(--ink); }
.note-text { white-space: normal; }
.opt { color: var(--muted); font-weight: 400; font-size: 12px; }
.results .mfr { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); margin-left: 6px; }
.terms-edit { font-size: 12px; font-family: ui-monospace, Menlo, monospace; } .badge.part { background: #fff1d6; color: #8a4b00; } .cancelled-row td { opacity: .55; }
.balance-now { display: flex; flex-direction: column; justify-content: center; } .balance-now strong { font-size: 20px; }
/* payments */
.money-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.money-row > div { background: #f7f7f8; border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.money-row span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.money-row strong { font-size: 20px; }
.money-row .due { background: #fff1d6; } .money-row .due strong { color: #8a4b00; }
.money-row .clear { background: var(--ok-bg); } .money-row .clear strong { color: var(--ok); }
.money-row .credit { background: var(--info-bg); } .money-row .credit strong { color: var(--info); }
.pay-list { margin-bottom: 12px; } .pay-list form { margin: 0; }
.add-pay { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.add-pay-row { display: grid; grid-template-columns: 170px auto 170px 110px; gap: 14px; align-items: start; }
.add-pay .pills { margin: 0; }
.terms-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.terms-form .pill { margin: 0; }
/* media */
.media-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.media-group h3 { margin: 0; }
.media-group .row-between { margin-bottom: 10px; }
.media-group label.btn { margin: 0; color: var(--ink); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.media-item .thumb { height: 110px; display: grid; place-items: center; background: #f4f4f5; border-radius: 6px; overflow: hidden; text-decoration: none; }
.media-item .thumb img { max-width: 100%; max-height: 110px; object-fit: contain; }
.media-item .file-ext { font-weight: 800; font-size: 20px; color: var(--accent); letter-spacing: .05em; }
.media-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-actions { display: flex; gap: 10px; font-size: 13px; align-items: center; }
.media-actions form { margin: 0; } .media-actions .link { font-size: 13px; }
/* credit notes */
.cn-new { margin-top: 12px; }
.cn-new summary { list-style: none; display: inline-flex; cursor: pointer; }
.cn-new summary::-webkit-details-marker { display: none; }
.cn-new[open] summary { margin-bottom: 12px; }
.cn-lines input { width: 80px; text-align: right; padding: 6px 8px; }
.cn-email { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 10px; background: #f7f7f8; border-radius: 8px; }
.cn-email label.check { margin: 0; } .cn-email input[name=other] { width: 240px; }
@media (max-width: 860px) { .media-cols, .add-pay-row { grid-template-columns: 1fr; } }
.bulk-bar { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; }
.list th.tick, .list td.tick { width: 34px; padding-right: 0; }
.list td.tick input, .list th.tick input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.filters select { width: 200px; }
.filters .btn.small { align-self: center; }
.notice.info-notice { background: var(--info-bg); color: var(--info); }
.narrow-form { max-width: 760px; }
/* header logos */
.top .wrap { height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-plate { display: inline-flex; align-items: center; gap: 9px; background: #fff; border-radius: 7px; padding: 5px 11px; height: 44px; }
.brand-plate img { height: 32px; width: auto; display: block; object-fit: contain; }
.brand-plate img + .brand-vr + img { height: 22px; }
.brand-vr { width: 1px; align-self: stretch; background: #111; margin: 3px 0; }
.login-logos { display: flex; justify-content: center; margin-bottom: 12px; }
.login-logos .brand-plate { border: 1px solid var(--line); height: 58px; }
.login-logos .brand-plate img { height: 44px; } .login-logos .brand-plate img + .brand-vr + img { height: 28px; }
@media (max-width: 860px) { .brand-plate img { height: 24px; } .brand-plate { height: 36px; padding: 4px 8px; } }
.add-staff { display: flex; gap: 8px; margin-bottom: 12px; }
.staff-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.staff-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; background: #111; color: #fff; border-radius: 99px; padding: 5px 6px 5px 12px; font-weight: 600; font-size: 14px; }
.staff-chip button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 11px; }
.staff-chip button:hover { background: var(--accent); }
.filters select { width: 180px; }
.brand-plate img { height: 34px; } .brand-plate img + .brand-vr + img { height: 22px; }
.login-logos .brand-plate img { height: 46px; } .login-logos .brand-plate img + .brand-vr + img { height: 30px; }
/* dashboard */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; border-top: 4px solid var(--brand); transition: transform .08s, box-shadow .08s; }
.tile:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.07); color: var(--ink); }
.tile strong { font-size: 40px; line-height: 1.1; }
.tile-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile-sub { font-size: 14px; color: var(--muted); }
.tile.warn { border-top-color: var(--accent); } .tile.warn strong { color: var(--accent); }
.tile.ok { border-top-color: var(--ok); }
.small-tiles .tile { padding: 12px 16px; border-top-width: 3px; } .small-tiles .tile strong { font-size: 26px; }
.complete-btn { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
.notice.ok-notice { background: var(--ok-bg); color: var(--ok); }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; } }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }
.progress { height: 10px; background: #eee; border-radius: 6px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: #d6001c; transition: width .4s; }

.pers-row td { background: #fbf7f7; }
.pers-row .pers-pick { display: flex; gap: 6px; }
.pers-row .pers-pick select { flex: 0 0 38%; min-width: 0; }
.pers-row .pers-pick input[data-k=title] { flex: 1; min-width: 0; }
.pers-qty-in { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.pers-sum { font-size: 12px; color: #b00018; white-space: nowrap; }
.add-pers { font-size: 12px; }
.pers-list td { padding: 6px 8px; }
.actions-cell form { display: inline; margin-left: 6px; }

/* left-hand tabs (Inventory, Settings) */
.tabbed { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.side-tabs { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px; }
.side-tabs a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 7px; color: #222; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.side-tabs a:hover { background: #f4f4f5; }
.side-tabs a.on { background: #111; color: #fff; border-left-color: #d6001c; font-weight: 600; }
.side-tabs .count { font-size: 12px; color: #888; font-weight: 400; }
.side-tabs a.on .count { color: #ccc; }
.tab-body { min-width: 0; }
.tab-body > .card:first-child, .tab-panel > .card:first-child { margin-top: 0; }
.settings-tabs .tab-panel { display: none; }
.settings-tabs .tab-panel.on { display: block; }
.pers-add { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pers-add label:first-of-type { flex: 1; min-width: 240px; }
.pers-edit input[name=name] { width: 100%; }
@media (max-width: 800px) { .tabbed { grid-template-columns: 1fr; } .side-tabs { position: static; flex-direction: row; flex-wrap: wrap; } }
.pers-add label { display: flex; flex-direction: column; gap: 4px; }
.tab-body .list td.mono { white-space: nowrap; }
.tab-body .settings-form, .tab-body .card { max-width: none; }

/* order lines: 10 columns – SKU, Item, Qty, RRP, Disc, Unit price, Pers £, VAT, Total, remove */
.lines-edit th:nth-child(1) { width: 120px; } .lines-edit th:nth-child(2) { width: auto; }
.lines-edit th:nth-child(3) { width: 60px; } .lines-edit th:nth-child(4) { width: 76px; }
.lines-edit th:nth-child(5) { width: 70px; } .lines-edit th:nth-child(6) { width: 86px; }
.lines-edit th:nth-child(7) { width: 78px; } .lines-edit th:nth-child(8) { width: 84px; }
.lines-edit th:nth-child(9) { width: 92px; } .lines-edit th:nth-child(10) { width: 36px; }
.lines-edit td.rm { text-align: center; padding-top: 12px; }
.lines-edit td.line-total { white-space: nowrap; }
.pers-row .pers-pick { flex-wrap: wrap; }
.pers-row .pers-pick select { flex: 1 1 200px; } .pers-row .pers-pick input[data-k=title] { flex: 2 1 200px; }
.pers-row td.num .pers-qty { display: inline-block; padding-top: 2px; }
.pill { position: relative; }
.pill input { left: 0; top: 0; width: 1px; height: 1px; }
/* items table: keep columns readable on smaller screens – scroll sideways instead of squashing */
.lines-scroll { overflow-x: auto; }
.lines-edit { min-width: 980px; }
.lines-edit th:nth-child(2) { min-width: 260px; }

/* ---------- mobile ---------- */
.menu-btn { display: none; }
@media (max-width: 1100px) {
  .top nav a, .top nav .link { padding: 8px 8px; font-size: 13px; }
}
@media (max-width: 1280px) {
  /* header: menu button + drop-down nav (the full menu needs more width than this) */
  .top .wrap { height: 56px; position: relative; }
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 40px; padding: 0 9px; background: none; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; cursor: pointer; }
  .menu-btn span { display: block; height: 2px; background: #fff; border-radius: 2px; }
  .top nav { display: none; position: absolute; top: 56px; left: 0; right: 0; z-index: 50; flex-direction: column; align-items: stretch; gap: 0; background: var(--brand); border-bottom: 3px solid var(--accent); padding: 6px 10px 10px; box-shadow: 0 12px 24px rgba(0,0,0,.25); }
  .top.open nav { display: flex; }
  .top nav a, .top nav .link { padding: 12px 10px; font-size: 15px; border-radius: 8px; text-align: left; width: 100%; }
  .top nav a.on { box-shadow: inset 3px 0 0 var(--accent); border-radius: 8px; }
  .brand > span:not(.brand-plate) { display: inline; }
  .brand-plate { display: inline-flex !important; flex-wrap: nowrap; margin-left: 0 !important; }
  .menu-btn { margin-left: auto; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .wrap { padding: 0 12px; }
  main.wrap { padding-top: 14px; }
  .card { padding: 14px 14px; border-radius: 10px; }
  h1 { font-size: 21px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .actions, .actions { flex-wrap: wrap; }
  .actions .btn, .page-head .btn { flex: 1 1 auto; justify-content: center; }
  /* stop iOS zooming into fields */
  input, select, textarea { font-size: 16px !important; }
  .row2, .row3, .grid2, .media-cols, .add-pay-row { grid-template-columns: 1fr !important; }
  .seg { flex-wrap: wrap; }
  .seg button { flex: 1 1 auto; }
  .filters { flex-wrap: wrap; }
  .filters input, .filters select { max-width: none; flex: 1 1 100%; }
  /* lists scroll sideways inside their card rather than stretching the page */
  table.list, table.kv-wide { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.list th, table.list td { white-space: nowrap; }
  .tiles { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .tile .num, .tile strong { font-size: 26px; }
  .tabbed { grid-template-columns: 1fr; gap: 12px; }
  .side-tabs { position: static; flex-direction: row; overflow-x: auto; flex-wrap: nowrap; padding: 6px; }
  .side-tabs a { flex: 0 0 auto; white-space: nowrap; border-left: 0; }
  .side-tabs a.on { box-shadow: inset 0 -2px 0 var(--accent); }
  .pers-add { flex-direction: column; align-items: stretch; }
  .pager { flex-wrap: wrap; }

  /* order screen: summary after the form, items as stacked cards */
  .order-form { grid-template-columns: 1fr !important; }
  .form-side .sticky { position: static; }
  .lines-scroll { overflow: visible; }
  .lines-edit { min-width: 0 !important; table-layout: auto; }
  .lines-edit thead { display: none; }
  .lines-edit, .lines-edit tbody { display: block; width: 100%; }
  .lines-edit tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; padding: 12px 34px 12px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; position: relative; }
  .lines-edit td { display: block; border: 0; padding: 0 !important; text-align: left !important; }
  .lines-edit td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
  .lines-edit tr.item-row td[data-label="Item"] { grid-column: 1 / -1; order: -1; }
  .lines-edit tr.item-row td[data-label="SKU"] { grid-column: 1 / -1; order: -2; }
  .lines-edit td.line-total { font-size: 16px; font-weight: 700; padding-top: 0; }
  .lines-edit td.rm { position: absolute; top: 8px; right: 8px; }
  .lines-edit td.rm .link { font-size: 18px; padding: 4px; }
  .lines-edit td.empty { display: none; }
  .lines-edit .pers-row td.pers-label { grid-column: 1 / -1; font-weight: 600; color: var(--accent); }
  .lines-edit .pers-row td.pers-desc { grid-column: 1 / -1; }
  .lines-edit .pers-row { background: #fbf7f7; }
  .lines-edit .heading-row { grid-template-columns: 1fr; }
  .lines-edit .heading-row td[colspan] { grid-column: 1 / -1; }
  .lines-edit tr .empty-lines { grid-column: 1 / -1; }
  .pers-row .pers-pick { flex-direction: column; }
  .pers-row .pers-pick select, .pers-row .pers-pick input[data-k=title] { flex: 1 1 auto; width: 100%; }
  .lines-edit + .btn, .card > .btn.small { margin: 4px 4px 0 0; }
}

.brand .brand-plate { margin-left: 0; text-transform: none; letter-spacing: 0; }
.side-tabs .count { margin-left: 8px; }
@media (max-width: 420px) { .brand > span:not(.brand-plate) { display: none !important; } }
@media (max-width: 760px) { .tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; } }

.restore-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.restore-form input[type=file] { flex: 1 1 320px; }
.restore-form label { display: flex; flex-direction: column; gap: 4px; }
.restore-form input[name=confirm] { width: 160px; }
.backup-counts { max-width: 420px; margin-bottom: 14px; }

.user-add { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.user-add label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 170px; }
.user-add .btn { flex: 0 0 auto; }
.users-list input[name=name], .users-list input[name=email] { width: 100%; min-width: 140px; }
.users-list tr.inactive td { opacity: .6; }
.users-list .badge { margin-top: 4px; }
.pw-reset { display: inline-block; margin: 0 6px; }
.pw-reset form { display: flex; gap: 6px; margin-top: 6px; }
.pw-reset input { width: 150px; }
.me-link { font-weight: 600; }
.master-bar { background: #fde8e6; color: #8a1c13; border-bottom-color: #f2c4bf; }
.account-grid { align-items: start; }

.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ph-chip { font: 12px ui-monospace, Menlo, Consolas, monospace; background: #f4f4f5; border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; cursor: pointer; color: #333; }
.ph-chip:hover { border-color: var(--accent); color: var(--accent); }
.tpl-card label { display: block; margin-bottom: 10px; }
.tpl-card textarea { width: 100%; font-family: inherit; line-height: 1.5; }
.tpl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-preview { margin-top: 14px; border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px; background: #fafafa; }
.tpl-subject { margin: 6px 0 10px; font-size: 14px; }
.ph-help { margin-top: 6px; } .ph-help table { margin-top: 8px; }

.club-field { display: flex; flex-direction: column; }
.new-club { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; background: #fbfbfc; }
.new-club label { display: block; margin-bottom: 8px; }
.new-club-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.disk-bar { background: #b42318; color: #fff; text-align: center; padding: 10px 16px; font-size: 14px; }
.disk-bar a { color: #fff; text-decoration: underline; }

.lw-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lw-actions form { margin: 0; }
.lw-num { margin: 8px 0 0; font-size: 14px; }

form.inline { display: inline; }
.product-form { max-width: 900px; }

.ship-map td { padding: 8px 10px 8px 0; vertical-align: middle; } .ship-map select { min-width: 320px; }

/* order screen product search */
.psearch { margin-bottom: 8px; }
.seg-sm { margin-bottom: 8px; } .seg-sm button { padding: 6px 12px; font-size: 13px; }
.presults { max-height: 520px; }
.presults-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fafafa; position: sticky; top: 0; z-index: 1; }
.pgroup { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pgroup-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.pgroup-head .right { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.psizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.results .psize { display: inline-flex; width: auto; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; font-size: 13px; background: #fff; cursor: pointer; }
.results .psize:hover { border-color: var(--accent); background: #fbeeee; }
.results .psize.added { border-color: #111; background: #111; color: #fff; }
.pcount { font-weight: 700; font-size: 12px; }
@media (max-width: 760px) { .presults { max-height: 70vh; } .seg-sm { display: flex; flex-wrap: wrap; } }

.phead-actions { display: inline-flex; gap: 10px; align-items: center; }
.pchip { display: inline-flex; align-items: stretch; border-radius: 7px; }
.pchip.picked .psize { border-color: var(--accent); background: #fdecee; color: var(--accent); font-weight: 600; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pqty { width: 46px; border: 1px solid var(--accent); border-left: 0; border-radius: 0 7px 7px 0; padding: 4px 6px; font-size: 13px; text-align: center; }
.pall { margin-left: 4px; align-self: center; }
.results .psize .pcount { font-weight: 400; color: var(--muted); font-size: 12px; }
/* keep the generic dropdown-row style off the buttons inside the grouped results */
.presults .presults-head button, .presults .pall { width: auto; display: inline-flex; border: 0; border-bottom: 0; padding: 0; background: none; }
.presults .presults-head .btn.primary { padding: 7px 12px; background: var(--brand); color: #fff; border-radius: 7px; }
.presults .presults-head .link { color: var(--accent); }
.presults .pall { color: var(--accent); font-size: 13px; padding: 6px 4px; }
.presults .pchip { background: none; padding: 0; }
.presults .psize { width: auto; border-bottom: 1px solid var(--line); }
.presults .pchip.picked .psize { border-bottom-color: var(--accent); }

.pers-update { margin-top: 10px; } .pers-update .notice { margin-bottom: 8px; }

/* header logo (white on the black bar) */
.header-logo { height: 40px; width: auto; display: block; }
@media (max-width: 900px) { .header-logo { height: 32px; } }
@media (max-width: 420px) { .header-logo { height: 28px; } }

.dns-check td { vertical-align: top; padding: 8px 10px 8px 0; } .dns-check code { background: #f4f4f5; padding: 1px 5px; border-radius: 4px; font-size: 12px; } .wrap-any { word-break: break-all; }

.tpl-frame{width:100%;min-height:400px;border:1px solid var(--line,#e5e5e5);border-radius:8px;background:#fff;margin-top:8px}
.club-import{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap;border:1px dashed var(--line,#ddd);border-radius:8px;padding:12px 14px;margin:14px 0}.club-import>div:first-child{flex:1;min-width:240px}.club-import-actions{display:flex;gap:8px}.club-import #clubImportMsg{flex-basis:100%}
.ship-list{list-style:none;padding:0;margin:12px 0}.ship-row{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--line,#eee)}.ship-email{display:flex;gap:10px;align-items:center}.ship-grid td,.ship-grid th{padding:6px 8px}.error-text{color:#b42318}
.ship-grid th.c,.ship-grid td.c{text-align:center!important;width:130px}.warn-text{color:#a15c00}
.collect-note{margin:4px 0;padding:6px 10px;background:#f7f7f8;border-radius:6px;font-size:14px}.collect-form .row-between{align-items:flex-end;gap:12px;flex-wrap:wrap}

/* move lines */
.lines-edit th:last-child { width: 78px; }
.lines-edit td.rm { white-space: nowrap; text-align: right; }
.lines-edit td.rm .mv { display: inline-flex; align-items: center; gap: 0; margin-right: 4px; vertical-align: middle; }
.lines-edit td.rm .mv .link { padding: 2px 3px; font-size: 11px; color: var(--muted); line-height: 1; }
.lines-edit td.rm .mv .link:hover:not([disabled]) { color: var(--ink, #111); }
.lines-edit td.rm .mv .link[disabled] { opacity: .25; cursor: default; }
.lines-edit .drag { cursor: grab; color: var(--muted); padding: 2px 4px; font-size: 15px; user-select: none; }
.lines-edit tr.dragging td { opacity: .4; }
.lines-edit tr.drop-before td { box-shadow: inset 0 3px 0 var(--accent, #d71920); }
.lines-edit tr.drop-after td { box-shadow: inset 0 -3px 0 var(--accent, #d71920); }
.search-jump { margin-bottom: 8px; }
.lines-scroll + .psearch { margin-top: 4px; }
@media (max-width: 760px) { .lines-edit .drag { display: none; } .lines-edit td.rm .mv .link { font-size: 15px; padding: 4px 6px; } }

.layout-edit{display:grid;grid-template-columns:minmax(0,1fr) 660px;gap:16px;margin:10px 0}
.layout-edit textarea{width:100%;min-height:560px;font-size:12px;line-height:1.5;white-space:pre;overflow:auto;tab-size:2}
.layout-edit .tpl-frame{margin-top:6px;min-height:560px}
.layout-edit label.inline{display:inline-flex;gap:6px;align-items:center;margin:0}
.layout-edit label.inline select{width:auto;padding:4px 6px}
@media (max-width:1350px){.layout-edit{grid-template-columns:1fr}.layout-edit textarea{min-height:360px}}

.rates-table th, .rates-table td { white-space: nowrap; font-size: 13px; padding: 6px 10px; }
.rates-table th.num, .rates-table td.num { text-align: right; }
.rate-test { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.rate-test input { width: 180px; }
.lw-sample { margin: 10px 0 14px; } .lw-sample input { width: 260px; }
.sample-kv { margin-top: 10px; background: #fafafa; border-radius: 8px; } .sample-kv td { padding: 6px 10px; vertical-align: top; }
.flash-field { box-shadow: 0 0 0 3px #ffd54f !important; transition: box-shadow .3s; }
.delivery-calc { margin-top: 6px; font-size: 13px; }
.sample-kv td:last-child { text-align: left !important; }

.line-stock { font-size: 11px; margin-top: 3px; line-height: 1.2; }
.st-ok { color: #137333; } .st-low { color: #a15c00; font-weight: 600; } .st-out { color: #b42318; font-weight: 600; }
.pstock { display: inline-block; margin-left: 5px; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 8px; line-height: 15px; vertical-align: 1px; }
.pstock:empty { display: none; } .pstock.ok { background: #e6f4ea; color: #137333; } .pstock.out { background: #fde7e7; color: #b42318; }
.perm-grid th.c, .perm-grid td.c { text-align: center; width: 150px; } .perm-grid td { vertical-align: middle; } .perm-grid input[type=checkbox] { width: 18px; height: 18px; accent-color: #d6001c; }
.perm-grid .role-name { width: 140px; font-weight: 600; text-align: center; padding: 5px 6px; }

.pager-num { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; margin: 16px 0 4px; }
.pager-num .pg { min-width: 34px; height: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line, #e3e3e3); border-radius: 8px; background: #fff; color: inherit; text-decoration: none; font-size: 14px; }
.pager-num a.pg:hover { border-color: #111; }
.pager-num .pg.on { background: #111; color: #fff; border-color: #111; font-weight: 700; }
.pager-num .pg.off { opacity: .35; }
.pager-num .pg-gap { padding: 0 4px; color: var(--muted); }
.pager-num .pg-go { margin: 0 0 0 10px; } .pager-num .pg-go input { width: 80px; padding: 5px 8px; margin-left: 4px; }

.stock-check .search { margin: 10px 0 6px; } .stock-check #scQ { width: 100%; }
.sc-group { margin-top: 14px; } .sc-head { margin-bottom: 4px; }
.sc-table th, .sc-table td { padding: 6px 10px; } .sc-table th.c, .sc-table td.c { text-align: center; width: 110px; }
.sc-table tr.sc-hit td { background: #fff8d6; }

.lines.with-marks th.mark-h { width: 74px; text-align: center; font-size: 11px; }
.lines .mark-cell { text-align: center; white-space: nowrap; }
.mark-box { width: 22px; height: 22px; border: 2px solid #bbb; border-radius: 5px; background: #fff; cursor: pointer; padding: 0; vertical-align: middle; }
.mark-box:hover { border-color: #137333; background: #e6f4ea; }
.mark-done { display: inline-flex; align-items: center; gap: 3px; color: #137333; font-weight: 700; font-size: 15px; }
.mark-done .small { font-weight: 600; font-size: 11px; color: #555; }
.mark-undo { color: #b42318; font-size: 14px; padding: 0 3px; margin-left: 2px; }
.mark-help { margin-top: 8px; }
.ordered-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0; } .ordered-form label { margin: 0; } .ordered-form input { width: 220px; }
.ordered-cell input[type=checkbox] { width: 18px; height: 18px; accent-color: #137333; } .po-no { color: #555; font-size: 10px; }
.ordered-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.po-line { white-space: nowrap; } .order-more { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 4px; } .order-more .qty-in { width: 58px; padding: 3px 5px; }

/* order page accordions */
.acc-tools { display: flex; justify-content: flex-end; margin: 4px 0 6px; }
details.acc { background: #fff; border: 1px solid var(--line, #e7e7e7); border-radius: 12px; margin: 0 0 10px; }
details.acc > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: '▸'; color: #999; font-size: 14px; transition: transform .15s; display: inline-block; width: 12px; }
details.acc[open] > summary::before { transform: rotate(90deg); }
details.acc > summary:hover { background: #fafafa; border-radius: 12px; }
.acc-count { background: #eee; color: #444; border-radius: 10px; font-size: 12px; padding: 1px 8px; font-weight: 600; }
.acc-body { padding: 0 18px 16px; }
.acc-body > .card, .acc-body > form.card, .acc-body > .grid2 > .card { border: 0; box-shadow: none; padding: 0; margin: 0 0 12px; background: transparent; }
.acc-body > .grid2 > .card { border: 1px solid var(--line, #eee); padding: 14px; border-radius: 10px; }
.acc-body > .card > h2:first-child, .acc-body > form.card > h2:first-of-type, .acc-body > .card > .row-between:first-child > h2 { display: none; }
.ready-pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; } .ready-pill.ok { background: #e6f4ea; color: #137333; } .ready-pill.part { background: #fff4e5; color: #a15c00; }
.arrived-cell { min-width: 150px; }
.exp-in { width: 140px; padding: 4px 6px; font-size: 13px; } .exp-note { color: #a15c00; margin-top: 3px; white-space: nowrap; }
.size-sel { display: block; margin-top: 4px; width: 100%; font-size: 12px; padding: 3px 4px; }
.media-group.drop-on { outline: 2px dashed #d6001c; outline-offset: 4px; border-radius: 8px; background: #fff5f5; }

/* Dashboard – active orders */
.active-orders .row-between { gap: 12px; flex-wrap: wrap; }
.quick-search { display: flex; gap: 6px; flex: 1; max-width: 460px; }
.quick-search input { flex: 1; min-width: 0; }
.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.stage-chips .chip { border: 1px solid #ddd; background: #fff; border-radius: 16px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.stage-chips .chip b { margin-left: 4px; }
.stage-chips .chip.on { background: #111; color: #fff; border-color: #111; }
.active-wrap { max-height: 640px; overflow: auto; }
.active-wrap thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.stage-pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #eee; color: #444; }
.stage-pill.st-ordered { background: #e8f0fe; color: #1a56c4; }
.stage-pill.st-ready { background: #e6f4ea; color: #137333; }
.stage-pill.st-part { background: #fff4e5; color: #a15c00; }
.stage-pill.st-complete { background: #d7f0df; color: #0b5a26; }
.stage-pill.st-done { background: #111; color: #fff; }
.perm-grid .perm-group td { background: #f6f6f6; padding-top: 14px; }
.ready-pill.instock { background: #eeeeee; color: #555; }
.ready-pill.arrived { background: #e8f0fe; color: #1a56c4; }
.ready-pill.done { background: #111; color: #fff; }
.stage-pill.st-instock { background: #eeeeee; color: #555; }
.stage-pill.st-arrived { background: #e8f0fe; color: #1a56c4; }
.stage-pill.st-ordered { background: #f3e8fd; color: #6b21a8; }

/* Order page – tabs across the top instead of accordions */
.order-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid #e7e7e7; margin: 6px 0 14px; position: sticky; top: 0; background: var(--bg, #f6f6f6); z-index: 5; padding-top: 6px; }
.order-tabs button { border: 0; background: none; padding: 9px 12px; font: inherit; font-weight: 600; font-size: 14px; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; display: inline-flex; align-items: center; gap: 6px; border-radius: 8px 8px 0 0; }
.order-tabs button:hover { color: #111; background: #fff; }
.order-tabs button.on { color: #111; border-bottom-color: var(--red, #d6001c); background: #fff; }
.order-tabs .acc-count { font-size: 11px; }
.order-tabs .badge { font-size: 10px; padding: 1px 6px; }
body.tabs-mode details.acc.tab-on { margin: 0 0 14px; padding: 18px 0 4px; }
body.tabs-mode details.acc > summary { display: none; }
body.tabs-mode details.acc:not(.tab-on) { display: none; }
body.tabs-mode .acc-tools { display: none; }

.tile.info { border-top-color: #1a56c4; } .tile.info strong { color: #1a56c4; }
.lines-edit .sku-wrap { display: flex; align-items: center; gap: 6px; }
.lines-edit .dup-tick { width: 16px; height: 16px; flex: none; margin: 0; accent-color: var(--brand, #d6001c); cursor: pointer; }
.dup-bar { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; }

/* ---------- Printing Schedule ---------- */
.sched-tabs { position: static; }
.sched-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 4px 0 10px; }
.sched-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-nav .wc { font-size: 18px; letter-spacing: .02em; min-width: 260px; text-align: center; }
.sched-nav input[type=date] { width: auto; padding: 5px 8px; }
.sched-key { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-size: 13px; }
.key-chip { padding: 3px 10px; border-radius: 6px; font-weight: 700; font-size: 12px; color: #111; }
.sched-layout { display: grid; grid-template-columns: 250px 1fr; gap: 14px; align-items: start; }
.sched-layout.no-side { grid-template-columns: 1fr; }
.sched-side { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; position: sticky; top: 8px; max-height: calc(100vh - 24px); overflow: auto; }
.sched-side h3 { margin: 0 0 4px; font-size: 15px; }
.sched-side input, .sched-side select { width: 100%; margin: 0 0 6px; }
.side-q { margin: 6px 0 8px !important; }
.sched-card { border: 1px solid var(--line); border-left: 6px solid var(--c, #74c0fc); background: #fff; border-radius: 8px; padding: 7px 9px; margin: 0 0 7px; font-size: 13px; line-height: 1.3; cursor: grab; }
.sched-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sched-card.booked { opacity: .65; }
.sched-card.custom { background: color-mix(in srgb, var(--c) 25%, #fff); }
.sched-card.flash { outline: 3px solid var(--brand, #d6001c); }
.sched-card .sc-label { font-weight: 600; margin: 2px 0; }
.sched-card .sc-booked { color: #137333; }
.sched-main { min-width: 0; overflow-x: auto; }
.sched-printer { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 12px; margin: 0 0 14px; }
.sched-printer h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: .05em; }
.g { display: grid; position: relative; min-width: 760px; }
.g-corner, .g-day { font-size: 11px; font-weight: 700; color: #555; display: flex; flex-direction: column; justify-content: center; align-items: center; border-bottom: 2px solid #222; letter-spacing: .03em; }
.g-day span { font-weight: 500; color: #888; font-size: 11px; }
.g-day.today { color: var(--brand, #d6001c); }
.g-corner { grid-column: 1; grid-row: 1; }
.g-day { grid-row: 1; }
.g-time { grid-column: 1; font-size: 11px; color: #666; padding: 0 6px; display: flex; align-items: center; justify-content: flex-end; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.g-slot { border-left: 1px solid #ececec; border-bottom: 1px dashed #f0f0f0; }
.g-slot.hour { border-bottom-style: solid; border-bottom-color: #e6e6e6; }
.g-slot.today { background: #fffafa; }
.sched.dragging .g-slot:hover, .g-slot.over { background: #e8f0fe; outline: 2px dashed #1a56c4; outline-offset: -2px; }
.g-job { position: relative; z-index: 2; margin: 1px 3px; border-radius: 6px; background: var(--c); border: 1px solid rgba(0,0,0,.12); padding: 2px 6px 6px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; color: #111; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.g-job:hover { box-shadow: 0 2px 8px rgba(0,0,0,.18); z-index: 3; }
.g-job .gj-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-job .gj-s, .g-job .gj-n { font-size: 10.5px; opacity: .8; }
.g-job .gj-rs { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; background: linear-gradient(transparent 2px, rgba(0,0,0,.18) 2px, rgba(0,0,0,.18) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.18) 5px, rgba(0,0,0,.18) 6px, transparent 6px); background-size: 24px 7px; background-repeat: no-repeat; background-position: center; }
.g-job.done { opacity: .55; }
.g-job.done .gj-t { text-decoration: line-through; }
.g-job.gone { outline: 2px dashed #b42318; }
.g-job.resizing { z-index: 5; outline: 2px solid #111; }
.g-job .gj-size { position: absolute; right: 4px; bottom: 8px; background: #111; color: #fff; padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.sched.dragging .g-job { pointer-events: none; opacity: .75; }
.own-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.sched-settings .ss-col { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; max-width: 360px; }
.sched-settings .ss-col .ss-n { flex: 1; }
.sched-settings .ss-col input[type=color] { width: 44px; height: 34px; padding: 2px; }
.sched-modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.sm-box { background: #fff; border-radius: 12px; padding: 18px 20px; width: 100%; max-width: 440px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.sm-box h3 { margin: 0 0 6px; }
.sm-box label { display: block; margin: 8px 0; }
.sm-box label input:not([type=checkbox]), .sm-box label select { width: 100%; }
.sm-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sm-btns .danger { margin-right: auto; }
.sched-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 200; font-size: 14px; transition: opacity .3s; max-width: 90vw; }
.sched-toast.bad { background: #b42318; }
.sched-toast.hide { opacity: 0; pointer-events: none; }
@media (max-width: 900px) { .sched-layout { grid-template-columns: 1fr; } .sched-side { position: static; max-height: none; } }
@media print {
  .top, .sched-tabs, .sched-side, .sched-bar .btn, .sched-nav input, .flash-bar, .demo-bar, .page-head, .sched-settings { display: none !important; }
  .sched-layout { display: block; } body { background: #fff; } .sched-printer { break-inside: avoid; border: 0; padding: 0; }
  .g { min-width: 0; } .g-job { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .key-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.g-job.off { background: repeating-linear-gradient(135deg, #2b2b2b 0 8px, #3d3d3d 8px 16px); color: #fff; border-color: #111; }
.g-job.off .gj-s { opacity: .85; }
.sched-card.off-card { border-left-color: #222; background: repeating-linear-gradient(135deg, #f1f1f1 0 8px, #e4e4e4 8px 16px); }
@media print { .g-job.off { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.g-job.complete { background: #fff; border: 1px solid #d0d0d0; border-left: 5px solid var(--c); color: #666; box-shadow: none; }
.g-job.complete .gj-t { text-decoration: none; }
.g-job .gj-ok { color: #137333; font-weight: 800; }
.sm-box.wide { max-width: 860px; max-height: calc(100vh - 32px); overflow: auto; }
.pj-media { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.pj-media a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: 11px; color: #555; }
.pj-media img { width: 120px; height: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; }
.pj-media .pj-file { flex-direction: row; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; align-self: flex-start; }
.pj-notes { background: #fffbe6; border: 1px solid #f3e3a1; border-radius: 8px; padding: 6px 10px; margin: 0 0 10px; font-size: 13px; }
.pj-table td { vertical-align: top; }
.pj-table .qty-in { width: 64px; margin: 4px auto 0; display: block; }
.pj-table .pers-l { color: #a15c00; }
.pj-book { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.pj-book summary { cursor: pointer; font-weight: 600; font-size: 14px; }
@media print { .g-job.complete { background: #fff !important; } }
.pj-batch { margin: 0 0 8px; font-size: 14px; }

/* ---------- Online Club Shop Request ---------- */
.cs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; align-items: start; }
.cs-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; } .cs-badge .lbl { width: 100%; } .cs-badge input[type=file] { flex: 1; min-width: 180px; }
.cs-badge .lbl { font-weight: 600; }
.cs-badge img { max-width: 90px; max-height: 70px; border: 1px solid var(--line); border-radius: 6px; padding: 3px; background: #fff; }
.cs-defaults { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.cs-defaults label { font-size: 12px; margin: 0; } .cs-defaults input { width: 110px; }
.cs-search { position: relative; margin: 10px 0 4px; }
.cs-search #csQ { width: 100%; margin-top: 6px; }
.cs-results { position: absolute; left: 0; right: 0; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 340px; overflow: auto; margin-top: 4px; }
.cs-results button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f0f0f0; background: #fff; padding: 8px 12px; cursor: pointer; font: inherit; }
.cs-results button:hover { background: #f6f6f6; }
.cs-results .pad { padding: 10px 12px; }
.cs-table { border-collapse: collapse; width: 100%; min-width: 1320px; font-size: 13px; }
.cs-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .02em; background: #111; color: #fff; padding: 6px 4px; border: 1px solid #333; text-align: center; }
.cs-table tr.grp th { background: var(--brand, #d6001c); }
.cs-table td { border: 1px solid #e3e3e3; padding: 4px; vertical-align: top; }
.cs-table input, .cs-table textarea { width: 100%; padding: 5px 6px; font-size: 13px; min-width: 0; }
.cs-table textarea { resize: vertical; min-height: 34px; }
.cs-table .cs-w { min-width: 125px; } .cs-table .cs-m { min-width: 80px; }
.cs-table .cs-n { width: 62px; text-align: right; padding: 5px 4px; }
.cs-table .cs-calc { text-align: center; white-space: nowrap; font-weight: 600; padding-top: 10px; background: #fafafa; }
.cs-table .cs-calc.web { background: #eef7ee; color: #0b5a26; }
.cs-table tr.cs-sec td { background: #eee; }
.cs-table .cs-head-in { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: transparent; border-color: transparent; }
.cs-table .cs-tools { white-space: nowrap; text-align: center; }
.cs-table .cs-tools .link { padding: 2px 3px; font-size: 12px; }
.cs-add { margin-top: 10px; }
.cs-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 -14px; box-shadow: 0 -4px 12px rgba(0,0,0,.05); z-index: 10; }
td.nowrap { white-space: nowrap; }
.cs-web { display: flex; flex-direction: column; gap: 3px; }
.cs-prefix { font-size: 12px; font-weight: 700; background: #111; color: #fff; border-radius: 5px; padding: 2px 7px; align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-table .cs-webp { background: #eef7ee; text-align: center; }
.cs-table .cs-webp input { font-weight: 700; color: #0b5a26; }
.cs-table .cs-webp input::placeholder { color: #0b5a26; opacity: .9; font-weight: 700; }
.cs-table .cs-webp.set { background: #fff4e5; }
.cs-table .cs-webp.set input { color: #a15c00; border-color: #e0a95a; }
.cs-auto { font-size: 10.5px; color: #777; margin-top: 2px; white-space: nowrap; }
.cs-credit-tick { font-size: 13px; margin: 0 0 6px 8px; }
.cs-extras { display: flex; flex-wrap: wrap; gap: 4px; min-width: 200px; }
.cs-chip { display: inline-flex; align-items: center; gap: 0; border: 1px solid #d5d5d5; border-radius: 14px; padding: 2px 9px; font-size: 11.5px; cursor: pointer; background: #fff; user-select: none; margin: 0; }
.cs-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.cs-chip.on { background: #111; color: #fff; border-color: #111; }
.cs-chip:focus-within { outline: 2px solid #1a56c4; outline-offset: 1px; }
.cs-optcols { display: grid; gap: 3px; margin-top: 5px; }
.cs-optcol { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px; font-size: 11.5px; }
.cs-optcol span { font-weight: 600; white-space: nowrap; }
.cs-optcol input { padding: 3px 6px !important; font-size: 12px !important; }
.cs-table .cs-ptype { width: 100%; margin-bottom: 4px; font-size: 12.5px; padding: 4px 6px; }
.cs-optcol { grid-template-columns: minmax(0, max-content) minmax(70px, 1fr); } .cs-optcol span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Stock Order ---------- */
.so-tabs { position: static; margin-top: 0; }
.so-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.so-bar #soQ { flex: 1; min-width: 220px; }
.so-bar label { margin: 0; font-size: 12px; } .so-bar label input { width: 170px; display: block; }
.so-table td { vertical-align: top; }
.so-table tr.ticked td { background: #f3f8ff; }
.so-table .so-qty { width: 70px; text-align: center; }
.so-refs a { display: block; white-space: nowrap; font-size: 12.5px; text-decoration: none; color: inherit; padding: 1px 0; }
.so-refs a:hover strong { text-decoration: underline; }
.so-table tfoot td { border-top: 2px solid #111; background: #fafafa; }
.so-table tfoot tr.so-tick-total td { border-top: 1px solid #e3e3e3; background: #f3f8ff; }
.so-table td.right { text-align: right; }

/* ======================= Phones: no sideways scrolling ======================= */
.m-tab-select { display: none; }
@media (max-width: 760px) {
  body { font-size: 14px; }
  h1 { font-size: 19px; line-height: 1.25; }
  h2 { font-size: 15px; }
  .demo-bar, .flash, .notice { font-size: 13px; }
  .btn { font-size: 13px; padding: 7px 11px; }
  .btn.small { font-size: 12.5px; padding: 5px 9px; }
  .btn.block { font-size: 14px; padding: 11px; }
  .actions .btn, .page-head .btn { flex: 0 1 auto; }
  .badge { font-size: 11px; }
  .tile .label, .tile h3, .tile span:first-child { font-size: 11.5px; }
  .tile .num, .tile strong { font-size: 22px; }
  .tile { padding: 12px; }
  .small { font-size: 12px; }

  /* tables become stacked cards (labels come from the column headings) */
  table.m-cards { display: block !important; width: 100% !important; min-width: 0 !important; overflow: visible !important; border: 0; }
  table.m-cards thead { display: none; }
  table.m-cards tbody, table.m-cards tfoot { display: block; }
  table.m-cards tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; padding: 6px 10px; background: #fff; }
  table.m-cards tr:hover td { background: transparent; }
  table.m-cards td { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 4px 0 !important; border: 0 !important; text-align: right !important; white-space: normal !important; font-size: 13.5px; min-height: 0; background: transparent !important; }
  table.m-cards td[data-label]:not([data-label=""])::before { content: attr(data-label); flex: 0 0 auto; max-width: 44%; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding-top: 2px; }
  table.m-cards td[data-label=""], table.m-cards td:not([data-label]) { justify-content: flex-start; text-align: left !important; }
  table.m-cards td:empty { display: none; }
  table.m-cards td[colspan] { display: block; text-align: left !important; }
  table.m-cards td > * { max-width: 100%; }
  table.m-cards td input:not([type=checkbox]), table.m-cards td select { max-width: 60%; }
  table.m-cards tfoot tr { background: #fafafa; }
  table.m-cards tfoot td::before { content: none !important; }
  table.m-cards tfoot td { justify-content: flex-end; }
  table.m-cards tr.ticked { background: #f3f8ff; }
  .lines-scroll, .active-wrap { overflow: visible !important; max-height: none !important; }
  .active-wrap thead th { position: static; }
  .so-refs a { white-space: normal; text-align: right; }
  .so-table td.right { justify-content: flex-end; }

  /* long tab bars → a drop-down */
  nav.order-tabs:not(.sched-tabs):not(.so-tabs) { display: none; }
  .m-tab-select { display: block; width: 100%; margin: 8px 0 12px; font-weight: 700; padding: 10px 12px; border: 2px solid #111; border-radius: 10px; background: #fff; position: sticky; top: 4px; z-index: 6; }
  .sched-tabs, .so-tabs { flex-wrap: wrap; gap: 2px; }
  .sched-tabs button, .so-tabs button { padding: 7px 9px; font-size: 13px; }
  .side-tabs { overflow: visible !important; flex-wrap: wrap !important; gap: 4px; }
  .side-tabs a { font-size: 13px; padding: 6px 9px; }

  /* settings & forms */
  .settings-form .row-between { flex-wrap: wrap; }
  .kv td, .kv th { font-size: 13px; }
  .quick-search { max-width: none; width: 100%; }
  .stage-chips .chip { font-size: 12px; padding: 3px 9px; }

  /* modal boxes fit the screen */
  .sched-modal { padding: 8px; align-items: flex-end; }
  .sm-box, .sm-box.wide { max-width: 100%; max-height: calc(100vh - 16px); overflow: auto; padding: 14px; border-radius: 12px; }
  .pj-media img { width: 90px; height: 90px; }

  /* stock order bar */
  .so-bar label, .so-bar label input { width: 100%; }
  .so-bar .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 760px) {
  .cs-table { min-width: 0 !important; display: block; }
  .cs-table thead { display: none; }
  .cs-table tbody { display: block; }
  .cs-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 0 0 10px; background: #fff; position: relative; }
  .cs-table td { display: block; border: 0 !important; padding: 0 !important; background: transparent; }
  .cs-table td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 2px; }
  .cs-table td.cs-full { grid-column: 1 / -1; }
  .cs-table td.cs-spacer { display: none; }
  .cs-table .cs-n { width: 100%; text-align: left; }
  .cs-table .cs-calc { text-align: left; padding: 6px 0 0 !important; background: transparent; }
  .cs-table .cs-webp { background: #eef7ee; border-radius: 6px; padding: 4px 6px !important; }
  .cs-table .cs-webp.set { background: #fff4e5; }
  .cs-table .cs-w, .cs-table .cs-m { min-width: 0; }
  .cs-table .cs-tools { position: absolute; top: 6px; right: 6px; grid-column: auto; }
  .cs-table tr.cs-sec { display: flex; align-items: center; padding: 6px 70px 6px 10px; background: #eee; }
  .cs-table tr.cs-sec td[colspan] { flex: 1; }
  .cs-table tr:not(.cs-sec) > td:first-child { padding-right: 70px !important; }
  .cs-extras { min-width: 0; }
  .cs-defaults { width: 100%; } .cs-defaults label { flex: 1 1 40%; } .cs-defaults input { width: 100%; }
  .cs-actions { margin: 0 -14px; padding: 8px 10px; } .cs-actions > span:last-child { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; } .cs-actions .btn { flex: 1 1 auto; justify-content: center; }
  .cs-badge img { max-width: 70px; }
}
.pick-bar { background: #111; color: #fff; padding: 9px 12px; border-radius: 10px; margin: 0 0 10px; font-size: 14px; position: sticky; top: 4px; z-index: 8; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pick-bar .link { color: #fff; text-decoration: underline; }
.sched.picking .g-slot, .pick-bar ~ .sched-layout .g-slot { cursor: copy; }
.m-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 4px; margin: 0 0 10px; }
.m-days button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 0; font: inherit; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.m-days button span { font-size: 15px; }
.m-days button.today { color: var(--brand, #d6001c); }
.m-days button.on { background: #111; color: #fff; border-color: #111; }
@media (max-width: 760px) {
  .sched-main { overflow: visible; }
  .g { min-width: 0 !important; }
  .sched-printer { padding: 8px; }
  .sched-nav { width: 100%; justify-content: space-between; } .sched-nav .wc { min-width: 0; width: 100%; order: -1; font-size: 15px; }
  .sched-nav input[type=date] { flex: 1; }
  .sched-bar > div:last-child { width: 100%; display: flex; gap: 6px; } .sched-bar > div:last-child .btn { flex: 1; justify-content: center; }
  .sched-side { max-height: 46vh; overflow: auto; }
  .g-job .gj-rs { height: 0; }
  .g-time { font-size: 10px; padding: 0 4px; }
  .sched-key { font-size: 11px; } .key-chip { font-size: 10.5px; padding: 2px 7px; }
}
@media (max-width: 760px) {
  /* card cells: label on the left, everything in the cell stacked on the right */
  table.m-cards td { width: auto !important; min-width: 0 !important; max-width: none !important; }
  table.m-cards td[data-label]:not([data-label=""]) { display: flow-root; }
  table.m-cards td[data-label]:not([data-label=""])::before { float: left; width: 40%; max-width: none; margin-right: 8px; padding-top: 2px; }
  table.m-cards td input[type=number], table.m-cards td .qty-in { width: 84px !important; min-width: 84px; display: inline-block; }
  table.m-cards td[data-label]:not([data-label=""]) > div, table.m-cards td[data-label]:not([data-label=""]) > form { display: block; }
  table.m-cards td[data-label=""], table.m-cards td:not([data-label]) { display: block; }
  table.m-cards td input:not([type=checkbox]), table.m-cards td select { max-width: 100%; }
  .po-line { white-space: normal; }
  .order-more { justify-content: flex-end; flex-wrap: wrap; }
  .cs-actions { margin: 0; border-radius: 10px; }
  .ship-grid .mark-btns, .ship-grid form { justify-content: flex-end; flex-wrap: wrap; }
}
@media (max-width: 760px) { table.m-cards tr td.c, table.m-cards tr td.num { text-align: right !important; } table.m-cards td .order-more, table.m-cards td .mark-done { justify-content: flex-end; } }
@media (max-width: 760px) { table.m-cards td .qty-in, table.m-cards td .so-qty { display: block !important; margin: 4px 0 0 auto !important; } }
.nav-order { list-style: none; padding: 0; margin: 0 0 12px; max-width: 520px; }
.nav-order li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0 0 6px; background: #fff; cursor: grab; }
.nav-order li.drag { opacity: .5; border-style: dashed; }
.nav-order .grip { color: #999; font-size: 16px; }
.nav-order .nm { font-weight: 600; flex: 1; }
.nav-order .arrows .link { padding: 2px 5px; }

/* ---------- Presenter editor ---------- */
.pz-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.pz-title { flex: 1; min-width: 220px; font-size: 20px; font-weight: 800; border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 8px; }
.pz-title:hover, .pz-title:focus { border-color: var(--line); background: #fff; }
.pz-top-btns { display: flex; gap: 6px; }
.pz { display: grid; grid-template-columns: 190px minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.pz-pages, .pz-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow: auto; }
.pz-pages h3 { margin: 0 0 8px; font-size: 14px; }
.pz-thumb { border: 2px solid transparent; border-radius: 8px; padding: 3px; margin: 0 0 8px; cursor: pointer; }
.pz-thumb.on { border-color: var(--brand, #d6001c); }
.pz-thumb-box { width: 100%; aspect-ratio: 1123 / 794; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; position: relative; background: #fff; }
.pz-thumb-in { width: 1123px; height: 794px; transform-origin: 0 0; transform: scale(0.148); pointer-events: none; }
.pz-thumb-bar { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; margin-top: 3px; }
.pz-thumb-bar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz-thumb-act { white-space: nowrap; } .pz-thumb-act .link { padding: 0 2px; font-size: 11px; }
.pz-stage { min-width: 0; }
.pz-scale { position: relative; margin: 0 auto; box-shadow: 0 4px 24px rgba(0,0,0,.15); border-radius: 4px; overflow: hidden; background: #fff; }
.pz-page-wrap { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pz-hint { text-align: center; margin-top: 8px; }
.pz-stage .pp-slot { cursor: pointer; }
.pz-stage .pp-slot:hover { outline: 2px dashed rgba(26,86,196,.35); outline-offset: 2px; }
.pz-stage .pp-slot.sel { outline: 3px solid #1a56c4; outline-offset: 2px; }
.pz-stage .pp-slot.pz-drop, .pz-stage .pp-cover.pz-drop { outline: 3px dashed #1a56c4; background: rgba(26,86,196,.05); }
.pz-stage .pp-layer { cursor: move; touch-action: none; }
.pz-stage .pp-layer:hover { outline: 1px dashed rgba(26,86,196,.7); }
.pz-stage .pp-layer.sel { outline: 2px solid #1a56c4; }
.pz-stage .pp-h { display: none; position: absolute; width: 16px; height: 16px; background: #fff; border: 2px solid #1a56c4; border-radius: 50%; z-index: 5; }
.pz-stage .pp-layer.sel .pp-h { display: block; }
.pz-stage .pp-rs { right: -9px; bottom: -9px; cursor: nwse-resize; border-radius: 3px; }
.pz-stage .pp-rot { left: 50%; top: -30px; margin-left: -8px; cursor: grab; }
.pz-stage .pp-rot::after { content: ''; position: absolute; left: 5px; top: 14px; width: 2px; height: 14px; background: #1a56c4; }
.pz-sec { border-bottom: 1px solid #eee; padding: 0 0 10px; margin: 0 0 10px; }
.pz-sec:last-child { border-bottom: 0; }
.pz-sec h4 { margin: 4px 0 8px; font-size: 13.5px; }
.pz-sec label { display: block; font-size: 12.5px; margin: 0 0 6px; }
.pz-sec input:not([type=checkbox]):not([type=range]):not([type=color]), .pz-sec select, .pz-sec textarea { width: 100%; }
.pz-sec input[type=color] { width: 100%; height: 32px; padding: 2px; }
.pz-sel { background: #f3f8ff; margin: 0 -10px 10px; padding: 8px 10px 10px; border-radius: 8px; }
.pz-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.pz-rng { display: grid !important; grid-template-columns: 1fr 44px; gap: 0 6px; align-items: center; }
.pz-rng input { grid-column: 1; width: 100%; } .pz-rng output { grid-row: 1 / span 2; grid-column: 2; font-size: 12px; text-align: right; color: var(--muted); }
.pz-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; align-items: center; }
.pz-lib { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.pz-lib-item { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: repeating-conic-gradient(#f2f2f2 0 25%, #fff 0 50%) 50% / 12px 12px; cursor: grab; display: flex; align-items: center; justify-content: center; }
.pz-lib-item:hover { border-color: #1a56c4; }
.pz-lib-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pz-lib-x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: #111; color: #fff; font-size: 10px; line-height: 18px; padding: 0; cursor: pointer; display: none; }
.pz-lib-item:hover .pz-lib-x { display: block; }
.pz-upl { display: inline-flex; }
.pz-badge-prev, .pz-strip-prev { max-width: 90px; max-height: 70px; display: block; margin: 4px 0; background: repeating-conic-gradient(#f2f2f2 0 25%, #fff 0 50%) 50% / 12px 12px; border-radius: 6px; }
.pz-strip-prev { background: #111; padding: 4px; max-height: 40px; display: inline-block; }
.pz-results { max-height: 220px; overflow: auto; } .pz-results button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f0f0f0; background: #fff; padding: 6px 4px; cursor: pointer; font: inherit; font-size: 13px; } .pz-results button:hover { background: #f6f6f6; }
.pz-pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0; } .pz-pics button { border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; aspect-ratio: 1; } .pz-pics button:hover { border-color: #1a56c4; } .pz-pics img { width: 100%; height: 100%; object-fit: contain; }
.pz-layers-list { display: flex; flex-wrap: wrap; gap: 4px; } .pz-layers-list button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 6px; font-size: 12px; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; max-width: 100%; overflow: hidden; } .pz-layers-list button.on { border-color: #1a56c4; background: #e8f0fe; } .pz-layers-list img { height: 18px; }
.pz-tools { border-top: 1px dashed #cfd8e6; margin-top: 8px; padding-top: 6px; } .pz-tool { margin: 0 0 10px; font-size: 12.5px; } .pz-tool strong { display: block; margin-bottom: 4px; }
.pz-swatches { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 6px; } .pz-sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #bbb; cursor: pointer; padding: 0; } .pz-sw.on { box-shadow: 0 0 0 3px #1a56c4; }
.pz-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; border: 1px solid #999; }
@media (max-width: 1100px) { .pz { grid-template-columns: 150px minmax(0, 1fr); } .pz-panel { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 760px) { .pz { grid-template-columns: 1fr; } .pz-pages { position: static; max-height: none; } .pz-pages-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .pz-thumb-in { transform: scale(0.095); } .pz-hint { display: none; } }

@media (min-width: 1281px) and (max-width: 1600px) { .top nav { gap: 0; } .top nav a, .top nav .link { padding: 8px 8px; font-size: 13px; } }
.nav-show { margin: 0; } .nav-show input { width: 17px; height: 17px; accent-color: var(--brand, #d6001c); }
.tpl-edit { display: inline-block; vertical-align: top; } .tpl-edit summary { list-style: none; display: inline-flex; } .tpl-edit summary::-webkit-details-marker { display: none; }
.tpl-edit[open] { display: block; background: #fafafa; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 6px 0; white-space: normal; max-width: 340px; }
.tpl-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #f3f8ff; border: 1px solid #d6e4fb; border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; font-size: 13px; }
.tpl-bar .lbl { font-weight: 700; margin-right: 2px; }
.tpl-chip { border: 1px solid #b9cdf3; background: #fff; border-radius: 16px; padding: 4px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.tpl-chip:hover { border-color: #1a56c4; } .tpl-chip.on { background: #1a56c4; color: #fff; border-color: #1a56c4; }
.tpl-chip small { opacity: .7; margin-left: 3px; }
.tpl-load { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 4px; }
