/* Thorium POS — staff app styles. Owner rule: Barlow for text, Barlow Condensed for headings. */
@font-face { font-family: 'Barlow'; src: url(fonts/barlow-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url(fonts/barlow-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url(fonts/barlow-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url(fonts/barlow-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(fonts/barlowc-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(fonts/barlowc-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --indigo: #0b2236;      /* Thorium navy: navigation, headings */
  --indigo-2: #163a57;
  --plum: #0d72b5;        /* Thorium blue: primary actions, selection (stores can set their own colour) */
  --plum-soft: #e3f0fa;
  --ground: #f2f3f6;      /* cool fitting-room grey */
  --paper: #ffffff;
  --line: #dde0e8;
  --line-2: #c9cdd8;
  --ink: #1b2233;
  --mute: #5f6880;
  --teal: #0f766e; --teal-soft: #e3f3f1;
  --amber: #a15c07; --amber-soft: #fbf0dc;
  --red: #b42318; --red-soft: #fbe9e7;
  --r: 8px; --r-lg: 12px;
  --shadow: 0 1px 2px rgba(31, 42, 68, .06), 0 4px 16px rgba(31, 42, 68, .06);
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--font); color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--plum); }
.num, td.n, th.n {  text-align: right; white-space: nowrap; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 700; color: var(--indigo); letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 10px; font-weight: 600; color: var(--indigo); }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--indigo); color: #d9deea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { display: block; color: #fff; font-size: 17px; font-weight: 700; line-height: 1.2; }
.brand span { font-size: 12px; color: #9aa4bd; }
.nav { padding: 8px 10px 12px; flex: 1; }
.nav .top, .side-foot .top { display: flex; align-items: center; gap: 11px; width: 100%; color: #d9deea; text-decoration: none; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 15px; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; }
.nav .top:hover, .side-foot .top:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav .top:focus-visible, .nav .kids a:focus-visible, .side-foot .top:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.nav .top.on, .side-foot .top.on { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--plum); }
.ico { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav .chev { width: 15px; height: 15px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 2; opacity: .6; transition: transform .15s; }
.nav .badge { margin-left: auto; }
.nav .badge:not(.hidden) + .chev { margin-left: 6px; }
.nav .grp { margin: 1px 0; }
.nav .grp.open > .top .chev { transform: rotate(90deg); }
.nav .grp.open > .top [data-sum] { display: none; }
.nav .grp.here > .top { color: #fff; }
.nav .kids { display: none; margin: 2px 0 6px 19px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.12); }
.nav .grp.open > .kids { display: block; }
.nav .kids a { display: flex; align-items: center; gap: 8px; color: #b9c1d6; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.nav .kids a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav .kids a.on { color: #fff; font-weight: 600; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 0 var(--plum); }
.nav .sub-h { font-size: 11.5px; color: #7f8aa6; padding: 10px 10px 3px; }
.side-foot { padding: 6px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.side .foot { padding: 8px 8px 12px; font-size: 12px; color: #8792ad; display: flex; justify-content: space-between; gap: 8px; }
.linkish { background: none; border: 0; padding: 0; color: #aeb7cd; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkish:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) { .nav .chev { transition: none; } }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .grow { flex: 1; }
.menu-btn { display: none; }
.page { padding: 22px 24px 60px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .grow { flex: 1; }
.page-head p { margin: 4px 0 0; color: var(--mute); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); display: inline-block; }
.sync.off i { background: var(--amber); }
.sync.err i { background: var(--red); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--paper); border-radius: var(--r); padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--mute); }
.btn.primary { background: var(--plum); border-color: var(--plum); color: #fff; }
.btn.primary:hover { background: #8d1d4d; }
.btn.dark { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.danger { color: var(--red); border-color: #e7b4ae; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.lg { padding: 13px 20px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 10px; background: var(--paper); min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); }
textarea { min-height: 70px; resize: vertical; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; font-weight: 500; color: var(--mute); margin-bottom: 4px; }
label.chk { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; cursor: pointer; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row.r2 { grid-template-columns: 1fr 1fr; }
.row.r3 { grid-template-columns: 1fr 1fr 1fr; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters > *, .filters input, .filters select { width: auto; }
.filters input[type=search] { flex: 1; min-width: 220px; max-width: 440px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font-size: 14px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--indigo); color: #fff; }

/* ---------- Surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card .card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card .card-head h2 { margin: 0; flex: 1; }
.grid > .card, .grid > .stat { margin-top: 0 !important; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.g2 { grid-template-columns: 1fr 1fr; }
.grid.g3 { grid-template-columns: 2fr 1fr; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 700; color: var(--indigo); line-height: 1.2; }
.stat .l { color: var(--mute); font-size: 13px; }
.stat .s { font-size: 13px; margin-top: 4px; }
.stat.warn .v { color: var(--amber); }
.stat a { text-decoration: none; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; color: var(--mute); font-size: 13px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #f8f9fb; position: sticky; top: 0; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: #f7f8fb; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); background: #fafbfc; }
.tablewrap { overflow-x: auto; }
.empty { padding: 36px 20px; text-align: center; color: var(--mute); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eceef3; color: var(--mute); white-space: nowrap; }
.badge.ok { background: var(--teal-soft); color: var(--teal); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.acc { background: var(--plum-soft); color: var(--plum); }
.badge.dark { background: var(--indigo); color: #fff; }
.note { padding: 10px 12px; border-radius: var(--r); background: #eef1f7; color: var(--indigo); font-size: 14px; margin-bottom: 12px; }
.note.warn { background: var(--amber-soft); color: #6d3f05; }
.note.bad { background: var(--red-soft); color: var(--red); }
.note.ok { background: var(--teal-soft); color: var(--teal); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; }
.progress { height: 8px; border-radius: 99px; background: #e6e8ee; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--teal); }

/* ---------- Size run matrix (the signature element) ---------- */
.sizerun { display: block; }
.sizerun { overflow-x: auto; }
.sizerun table { border-collapse: separate; border-spacing: 5px; margin: -5px; width: auto; }
.sizerun td { padding: 0; width: 66px; }
.sizerun th { font-size: 13px; font-weight: 600; color: var(--mute); text-align: center; padding: 2px 4px; }
.sizerun th.cl { text-align: left; color: var(--ink); white-space: nowrap; padding-right: 10px; }
.cell { width: 64px; min-width: 58px; height: 52px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;  position: relative; padding: 2px 6px; transition: transform .08s; }
.cell .q { font-size: 17px; font-weight: 700; line-height: 1.1; }
.cell .sub { font-size: 11px; color: var(--mute); }
.cell.lvl0 { background: #f6f6f8; color: #a3a9b8; border-style: dashed; }
.cell.lvl1 { background: var(--amber-soft); border-color: #ecc98d; }
.cell.lvl2 { background: #eef6f4; border-color: #b8dcd6; }
.cell.lvl3 { background: var(--teal-soft); border-color: #8ccac1; }
.cell.neg { background: var(--red-soft); border-color: #eab0a9; color: var(--red); }
.cell:hover { border-color: var(--indigo); }
.cell:active { transform: scale(.96); }
.cell.sel { outline: 3px solid var(--plum); outline-offset: 1px; }
.cell.none { visibility: hidden; }
.cell input { width: 54px; text-align: center; border: 0; background: transparent; font-weight: 700; font-size: 16px; min-height: 0; padding: 0; }
.cell input:focus { box-shadow: none; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--mute); flex-wrap: wrap; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line-2); }
.legend .l0::before { background: #f6f6f8; } .legend .l1::before { background: var(--amber-soft); } .legend .l3::before { background: var(--teal-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 420px; height: 100vh; overflow: hidden; }
.pos-left { display: flex; flex-direction: column; min-width: 0; }
.pos-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--indigo); color: #fff; }
.pos-bar .grow { flex: 1; }
.pos-bar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.pos-bar .btn:hover { border-color: #fff; }
.pos-bar .till { font-weight: 600; }
.pos-bar .sync { color: #c7cee0; }
.scan { padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.scan input { font-size: 17px; min-height: 46px; }
.depts { padding: 10px 16px 0; }
.styles { flex: 1; overflow-y: auto; padding: 12px 16px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; align-content: start; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 104px; }
.tile:hover { border-color: var(--indigo); }
.tile .nm { font-weight: 600; line-height: 1.25; }
.tile .br { font-size: 12px; color: var(--mute); }
.tile .pr { margin-top: auto; font-weight: 700; color: var(--indigo); }
.tile .st { font-size: 12px; color: var(--mute); }
.tile img { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; background: var(--ground); }
.cart { background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.cart-head .cust { flex: 1; min-width: 0; }
.cart-head .cust b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lines { flex: 1; overflow-y: auto; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.line .nm { font-weight: 600; }
.line .meta { font-size: 13px; color: var(--mute); }
.line .tot { font-weight: 700;  text-align: right; }
.line .ctl { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); }
.qty button { border: 0; background: none; width: 32px; height: 30px; cursor: pointer; font-size: 18px; }
.qty span { min-width: 28px; text-align: center; font-weight: 600; }
.totals { padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfc; }
.totals .r { display: flex; justify-content: space-between; font-size: 14px; padding: 2px 0;  }
.totals .big { font-variant-numeric: normal; font-size: 26px; font-weight: 700; color: var(--indigo); padding-top: 6px; }
.cart-actions { padding: 12px 16px 16px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.cart-actions .pay { grid-column: 1 / -1; font-size: 18px; padding: 15px; }
.paygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.paygrid .btn { padding: 14px 8px; }
.paygrid .btn.on { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.notes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.due { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.due b { font-size: 30px; color: var(--indigo); }
.paid-list .r { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* ---------- Dialog & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 26, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; }
.dialog { background: var(--paper); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(20, 26, 42, .3); animation: pop .14s ease-out; }
.dialog.wide { max-width: 860px; }
.dialog.xwide { max-width: 1100px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.dialog header { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog header h2 { margin: 0; flex: 1; }
.dialog .body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.dialog footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--mute); line-height: 1; padding: 4px 8px; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--indigo); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; max-width: 90vw; }
.toast.bad { background: var(--red); }
.toast.ok { background: var(--teal); }

/* ---------- Sign-in ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.gate .art { background: var(--indigo); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.gate .art h1 { color: #fff; font-size: 40px; max-width: 12ch; line-height: 1.1; }
.gate .art p { color: #c3cadb; max-width: 40ch; font-size: 16px; }
.gate .art .rack { position: absolute; right: -40px; bottom: 60px; display: grid; grid-template-columns: repeat(6, 54px); gap: 8px; opacity: .9; }
.gate .art .rack i { height: 54px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 13px; color: #c3cadb; }
.gate .art .rack i.h { background: rgba(163,36,90,.55); color: #fff; border-color: transparent; }
.gate .art .rack i.m { background: rgba(255,255,255,.1); }
.gate .form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.gate .form .box { width: 100%; max-width: 360px; }
.gate .powered { font-size: 12px; color: #9aa4bd; }
.locked { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.locked .box { max-width: 460px; }

/* ---------- Receipt & labels (print) ---------- */
.receipt { font-size: 13px; width: 300px; margin: 0 auto; color: #000; }
.receipt.w58 { width: 210px; font-size: 12px; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .big { font-size: 16px; font-weight: 700; }
.receipt .it { margin: 3px 0; }
.labels { display: flex; flex-wrap: wrap; gap: 4mm; }
.label { width: 50mm; height: 30mm; border: 1px dashed #bbb; padding: 2mm 3mm; display: flex; flex-direction: column; justify-content: space-between; font-size: 9pt; overflow: hidden; color: #000; background: #fff; }
.label b { font-size: 10pt; line-height: 1.1; }
.label .p { font-size: 13pt; font-weight: 700; text-align: right; }
.label svg { width: 100%; height: 11mm; }
#print { display: none; }
@media print {
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; }
  body { background: #fff; }
  .label { border: 0; break-inside: avoid; }
  @page { margin: 4mm; }
}

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; max-width: 56px; background: var(--indigo-2); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .b:hover { background: var(--plum); }
.bars-x { display: flex; gap: 4px; font-size: 11px; color: var(--mute); margin-top: 4px; }
.bars-x span { flex: 1; max-width: 56px; text-align: center; overflow: hidden; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 100px; gap: 10px; align-items: center; font-size: 14px; padding: 4px 0; }
.hbar .track { background: #eceef3; border-radius: 4px; height: 12px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--indigo-2); }

/* ---------- Count screen ---------- */
.scanbig { font-size: 22px !important; min-height: 60px !important; text-align: center; }
.lastscan { font-size: 18px; padding: 14px; border-radius: var(--r); background: var(--teal-soft); color: var(--teal); text-align: center; margin: 10px 0; }
.lastscan.bad { background: var(--red-soft); color: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .pos { grid-template-columns: 1fr 360px; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .18s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(20,26,42,.4); }
  .menu-btn { display: inline-flex; }
  .page { padding: 16px 14px 60px; }
  .grid.g2, .grid.g3, .row.r2, .row.r3 { grid-template-columns: 1fr; }
  .pos { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .cart { border-left: 0; border-top: 1px solid var(--line); }
  .styles { max-height: 50vh; }
  .gate { grid-template-columns: 1fr; }
  .gate .art { padding: 28px; min-height: 220px; }
  .gate .art .rack { display: none; }
  .gate .art h1 { font-size: 28px; }
}
table.t th.n { text-align: right; }

/* ---------- A4 quotation ---------- */
.qdoc { width: 100%; max-width: 760px; margin: 0 auto; color: #111; font-size: 13px; line-height: 1.45; }
.qdoc .qhead { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 14px; border-bottom: 3px solid var(--indigo); }
.qdoc .qco { font-size: 20px; font-weight: 700; color: var(--indigo); margin-bottom: 4px; }
.qdoc .qtitle { text-align: right; }
.qdoc .qtitle > div { font-size: 26px; font-weight: 700; letter-spacing: .04em; color: var(--plum); margin-bottom: 6px; }
.qdoc .qtitle table { margin-left: auto; border-collapse: collapse; } .qdoc .qtitle td { padding: 1px 0 1px 14px; text-align: right; }
.qdoc .qtitle td:first-child { color: #555; }
.qdoc .qto { margin: 16px 0 10px; } .qdoc .lbl { font-size: 11px; color: #666; margin-bottom: 2px; }
.qdoc .qsubj { font-weight: 600; font-size: 15px; margin: 8px 0; }
.qdoc .qlines { width: 100%; border-collapse: collapse; margin-top: 8px; }
.qdoc .qlines th { background: var(--indigo); color: #fff; font-weight: 600; text-align: left; padding: 7px 8px; font-size: 12px; }
.qdoc .qlines td { padding: 7px 8px; border-bottom: 1px solid #ddd; vertical-align: top; }
.qdoc .qlines .n, .qdoc .qsum .n { text-align: right; white-space: nowrap; }
.qdoc .tc { font-size: 10px; color: #777; }
.qdoc .qsum { display: flex; justify-content: flex-end; margin-top: 8px; } .qdoc .qsum table { min-width: 300px; border-collapse: collapse; }
.qdoc .qsum td { padding: 4px 8px; } .qdoc .qsum .tot td { font-size: 16px; font-weight: 700; border-top: 2px solid var(--indigo); padding-top: 8px; }
.qdoc .qsum .muted td { color: #666; font-size: 12px; }
.qdoc .qblock { margin-top: 14px; } .qdoc .qblock.small { font-size: 11px; color: #444; }
.qdoc .qsign { display: flex; justify-content: space-between; gap: 24px; margin-top: 36px; font-size: 12px; }
@media print { .qdoc { max-width: none; } @page { size: A4; margin: 14mm; } }

/* ---------- Display type (Barlow Condensed) ---------- */
h1, h2, .stat .v, .due b, .totals .big, .brand b, .pos-bar .till, .gate .art h1, .pt-hello, .qdoc .qco, .qdoc .qtitle > div, .lb .amt { font-family: var(--font-display); letter-spacing: 0; }
h1 { font-size: 28px; } h2 { font-size: 20px; } .stat .v { font-size: 30px; } .due b { font-size: 34px; } .totals .big { font-size: 28px; }
.brand img { display: block; width: 100%; max-width: 100%; max-height: 84px; object-fit: contain; margin-bottom: 10px; background: #fff; border-radius: 8px; padding: 6px; box-sizing: border-box; }

/* ---------- Configuration ---------- */
.cfg { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.cfg-nav { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; position: sticky; top: 76px; }
.cfg-nav .grp { font-size: 12px; color: var(--mute); padding: 10px 10px 4px; }
.cfg-nav a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
.cfg-nav a:hover { background: var(--ground); }
.cfg-nav a.on { background: var(--indigo); color: #fff; font-weight: 600; }
.logo-box { width: 260px; height: 120px; padding: 8px; box-sizing: border-box; border: 1px dashed var(--line-2); border-radius: var(--r); display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--plum); }
.preview-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; max-height: 620px; overflow: auto; }
@media (max-width: 900px) { .cfg { grid-template-columns: 1fr; } .cfg-nav { position: static; } }

/* ---------- Branded documents ---------- */
.qdoc .qlogo { max-height: 96px; max-width: 260px; width: auto; height: auto; object-fit: contain; display: block; margin-bottom: 8px; }
.qdoc.f-barlow { font-family: 'Barlow', sans-serif; }
.qdoc.f-arial-narrow { font-family: 'Arial Narrow', 'Barlow Condensed', sans-serif; }
.qdoc.f-aptos { font-family: Aptos, Calibri, 'Segoe UI', sans-serif; }
.qdoc.f-serif { font-family: Georgia, 'Times New Roman', serif; }
.qdoc.f-geometric { font-family: 'Century Gothic', Futura, 'Avenir Next', 'Trebuchet MS', sans-serif; }
.qdoc.f-arial-narrow .qco, .qdoc.f-aptos .qco, .qdoc.f-serif .qco, .qdoc.f-geometric .qco, .qdoc.f-arial-narrow .qtitle > div, .qdoc.f-aptos .qtitle > div, .qdoc.f-serif .qtitle > div, .qdoc.f-geometric .qtitle > div { font-family: inherit; }
.qdoc .qhead { border-bottom-color: var(--doc-accent, var(--indigo)); }
.qdoc .qco { color: var(--doc-accent, var(--indigo)); }
.qdoc .qtitle > div { color: var(--doc-accent, var(--plum)); }
.qdoc .qlines th { background: var(--doc-accent, var(--indigo)); }
.qdoc .qsum .tot td { border-top-color: var(--doc-accent, var(--indigo)); }
.qdoc .qbank { margin-top: 14px; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; }
.qdoc .qfoot { margin-top: 20px; padding-top: 8px; border-top: 1px solid #ddd; font-size: 11px; color: #555; text-align: center; }
.receipt .rlogo { max-height: 72px; max-width: 92%; object-fit: contain; display: block; margin: 0 auto 6px; filter: grayscale(1) contrast(1.15); }
.cfg-docs { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.5fr); gap: 16px; align-items: start; }
.qdoc .qtitle td { white-space: nowrap; }
@media (max-width: 1200px) { .cfg-docs { grid-template-columns: 1fr; } }
.cfg-docs > .card { margin: 0; }

/* ---------- Accounting overview ---------- */
.sec-h { margin: 22px 0 10px; }
.stat.link { text-decoration: none; color: inherit; display: block; }
.stat.link:hover { border-color: var(--line-2); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.acc-grid > .card, .acc-card { margin: 0; }
.acc-card .acc-bal { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--indigo); margin-top: 4px; }
.acc-card.add { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; border: 1px dashed var(--line-2); background: transparent; cursor: pointer; font: inherit; color: var(--ink); min-height: 180px; }
.acc-card.add:hover { background: var(--paper); }
.mchart { display: flex; gap: 10px; align-items: flex-end; height: 190px; padding-top: 6px; }
.mcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.mcol .bars2 { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.mcol .bars2 span { width: 40%; max-width: 22px; border-radius: 3px 3px 0 0; min-height: 1px; }
.mcol .bi, .legend .li::before { background: var(--indigo); }
.mcol .be, .legend .le::before { background: var(--plum); }
.mcol .ml { font-size: 12px; color: var(--mute); }
.mcol .mp { font-size: 11.5px; font-weight: 600; }
.mcol .mp.neg { color: var(--bad, #b42318); }
.legend .li::before, .legend .le::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend.small { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.legend.small .muted::before { display: none; }

/* ---------- Customers board (kanban) ---------- */
.kanban-wrap { overflow-x: auto; padding-bottom: 6px; }
.kanban { display: flex; gap: 12px; align-items: flex-start; min-height: 60vh; }
.kcol { flex: 0 0 272px; background: #e9ecf2; border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.kcol.over { outline: 2px dashed var(--plum); outline-offset: -2px; background: #f3e6ec; }
.kcol header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.kcol h3 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--indigo); line-height: 1.15; }
.kcount { margin-left: auto; font-size: 12px; font-weight: 600; background: #fff; border-radius: 999px; padding: 2px 8px; color: var(--mute); }
.kbody { overflow-y: auto; padding: 0 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.kcard { display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; text-decoration: none; color: var(--ink); box-shadow: 0 1px 0 rgba(20,26,42,.04); }
.kcard:hover { border-color: var(--line-2); }
.kcard:focus-visible { outline: 2px solid var(--plum); outline-offset: 1px; }
.kcard[draggable="true"] { cursor: grab; }
.kcard.drag { opacity: .45; }
.kcard b { font-size: 14px; line-height: 1.25; }
.kmeta { font-size: 12px; color: var(--mute); }
.kmeta:empty { display: none; }
.kcontact { display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: #3d4660; word-break: break-all; }
.kcard .badge { align-self: flex-start; }
.kempty { font-size: 12px; color: var(--mute); text-align: center; padding: 18px 6px; border: 1px dashed var(--line-2); border-radius: 8px; }
.kmore { align-self: center; }

/* ---------- Thorium account page ---------- */
.th-tile { --s: 44px; width: var(--s); height: var(--s); flex: none; border-radius: calc(var(--s) * .16); background: var(--indigo); color: #fff; display: inline-grid; place-items: center; position: relative; font-family: var(--font-display); box-shadow: inset 0 0 0 calc(var(--s) * .04) rgba(255,255,255,.18); }
.th-tile b { font-size: calc(var(--s) * .46); font-weight: 700; line-height: 1; margin-top: calc(var(--s) * .08); }
.th-tile small { position: absolute; top: calc(var(--s) * .07); left: calc(var(--s) * .12); font-size: calc(var(--s) * .2); font-weight: 600; opacity: .75; font-family: var(--font); }
.th-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--ground); }
.th-head { display: flex; align-items: center; gap: 12px; padding: 22px 28px; }
.th-word { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--indigo); }
.th-word span { color: var(--plum); }
.th-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 18px 40px; }
.th-card { width: 100%; max-width: 420px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; box-shadow: 0 10px 30px rgba(20,26,42,.06); }
.th-card h1 { font-size: 30px; margin: 0 0 6px; }
.th-card p.muted { margin: 0 0 18px; }
.th-acct { display: block; }
.th-acct input { width: 100%; font-size: 17px; letter-spacing: .01em; }
.th-recent { margin-top: 22px; display: grid; gap: 8px; }
.th-acc { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.th-acc:hover { border-color: var(--line-2); background: var(--ground); }
.th-acc img { width: 74px; height: 34px; object-fit: contain; }
.th-acc span:last-child { display: flex; flex-direction: column; }
.th-acc small { color: var(--mute); font-size: 12px; }
.mono { width: 40px; height: 40px; border-radius: 10px; background: var(--brand, var(--indigo)); color: #fff; display: inline-grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 17px; flex: none; }
.mono.lg { width: 64px; height: 64px; font-size: 26px; border-radius: 16px; }
.th-foot { text-align: center; font-size: 12px; color: var(--mute); padding: 18px; }

/* ---------- Company sign-in window ---------- */
.login-page { min-height: 100vh; background: var(--ground); display: flex; justify-content: center; }
.login-wrap { width: 100%; max-width: 440px; padding: 7vh 18px 30px; display: flex; flex-direction: column; align-items: stretch; }
.login-card { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 14px; box-shadow: 0 12px 34px rgba(20,26,42,.08); overflow: hidden; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 28px 18px; text-align: center; }
.login-brand img { max-width: 100%; max-height: 104px; object-fit: contain; }
.login-brand b { font-family: var(--font-display); font-size: 24px; color: var(--indigo); }
.login-brand .mono { background: var(--brand); }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 28px; background: var(--ground); border-radius: 10px; padding: 4px; gap: 4px; }
.login-tabs button { border: 0; background: transparent; padding: 9px 8px; border-radius: 7px; font: inherit; font-weight: 600; color: var(--mute); cursor: pointer; }
.login-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,42,.12); }
.login-tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.login-card .box { max-width: none; padding: 16px 28px 24px; }
.login-lead { color: var(--mute); font-size: 14px; margin: 0 0 14px; }
.pw { position: relative; display: flex; }
.pw input { flex: 1; padding-right: 64px; }
.pw-t { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--mute); font: inherit; font-size: 13px; cursor: pointer; padding: 6px 8px; }
.pw-t:hover { color: var(--ink); }
.device-till { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.device-till span { display: flex; flex-direction: column; }
.device-till small { color: var(--mute); font-size: 12px; }
.device-till b { font-size: 16px; }
.login-links { margin: 14px 0 0; text-align: center; font-size: 14px; }
.login-under { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 14px; margin: 16px 0 0; color: var(--mute); }
.login-demo { margin-top: 18px; background: #fff; border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.login-power { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 26px 0 0; font-size: 12px; color: var(--mute); }
@media (max-width: 480px) { .login-brand, .login-card .box { padding-left: 18px; padding-right: 18px; } .login-tabs { margin: 0 18px; } .th-card { padding: 24px 18px; } }
@media (max-width: 480px) { .login-under { flex-direction: column; align-items: center; gap: 6px; } .login-under > span { display: none; } }
.lic-banner { background: #fff4e0; color: #7a4b00; border-bottom: 1px solid #f0d9a8; padding: 9px 22px; font-size: 14px; } .lic-banner a { color: inherit; font-weight: 600; }
/* ---------- Lay-by ---------- */
.lb-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--bg, #f3f4f7); border-radius: 10px; padding: 10px 12px; margin: 4px 0 14px; }
.lb-sum span { display: block; font-size: 12px; color: var(--mute); }
.lb-sum b { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; }
.lb-cust { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 12px; }
.lb-plan { font-size: 14px; margin: 0 0 14px; }
div.f { margin-bottom: 12px; } div.f > span { display: block; font-size: 13px; font-weight: 500; color: var(--mute); margin-bottom: 6px; }
.lb-m .chip { padding: 8px 14px; font-size: 14px; }
.bad-t { color: var(--bad); }
.lb-list { max-height: 60vh; overflow: auto; }
.lb-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.lb-row .who { flex: 1; min-width: 0; }
.lb-row .btns { display: flex; gap: 6px; flex-shrink: 0; }
.progress.sm { height: 5px; margin: 5px 0 3px; max-width: 280px; }
@media (max-width: 560px) { .lb-row { flex-direction: column; align-items: stretch; } .lb-sum b { font-size: 17px; } }
.lb-step { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px 4px; margin: 0 0 14px; }
.lb-step h3 { margin: 0 0 10px; font-size: 16px; }
input.code { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; letter-spacing: 6px; text-align: center; }
/* ---------- Staff sign-in: a dark work screen, clearly not the customer page ---------- */
.login-page.staff { background: #18203a; background-image: radial-gradient(circle at 50% -10%, #2a3560 0, transparent 55%); }
.login-page.staff .login-card { border-color: transparent; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.staff-tag { display: inline-flex; align-self: center; align-items: center; gap: 7px; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.08); color: #e8ebf5; font-weight: 600; font-size: 14px; }
.login-page.staff .login-under, .login-page.staff .login-power { color: #aab2cc; }
.login-page.staff .login-under a { color: #fff; }
.staff-note { text-align: center; color: #aab2cc; font-size: 13px; margin: 10px 0 0; }
.staff-note b { color: #fff; font-weight: 600; }
.login-page.staff .login-demo { background: rgba(255,255,255,.96); }

/* ---------- Showroom sign-in (staff and customers), from brand/theme.json ---------- */
  
  .shw { min-height: 100vh; display: flex; flex-wrap: wrap; font-family: var(--font-body, Barlow, sans-serif); color: #F1EEE9; }
  .shw-stage { flex: 999 1 560px; min-width: 0; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 64px 40px 120px; box-sizing: border-box; text-align: center; }
  .shw-stage > svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .shw-logo { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; }
  .shw-word { font-family: var(--font-display, 'Barlow Condensed', sans-serif); font-weight: 800; font-size: clamp(64px, 9vw, 104px); line-height: .9; letter-spacing: 1px; color: var(--brand); }
  .shw-lead { position: relative; margin: 22px 0 0; max-width: 460px; font-size: 18px; line-height: 1.5; color: #B7B2AA; }
  .shw-side { flex: 1 1 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 48px 32px; box-sizing: border-box; background: rgba(20,20,24,.55); border-left: 2px dashed rgba(242,168,119,.45); }
  .shw-side .cl-card { position: relative; width: 100%; max-width: 400px; background: #fff; color: var(--ink); border-radius: 18px; box-shadow: 0 30px 60px rgba(0,0,0,.45); }
  .shw-side .cl-card h2 { margin: 0 0 14px; font-family: var(--font-display, 'Barlow Condensed', sans-serif); font-size: 30px; color: var(--ink); }
  .shw-side .cl-browse { width: 100%; max-width: 400px; box-sizing: border-box; background: rgba(255,255,255,.06); border-color: rgba(242,168,119,.35); color: #F1EEE9; }
  .shw-side .cl-help, .shw-side .login-power { color: #AFA9A0; } .shw-side .cl-help a { color: #F2A877; }
  .shw .btn.primary { background: var(--brand); border-color: var(--brand); }
  .shw .login-tabs button[aria-selected="true"] { background: #1D1F24; color: #fff; }
  .shw-tape { position: absolute; left: -40px; right: -40px; bottom: 64px; height: 46px; transform: rotate(-3deg); overflow: hidden; }
  @media (max-width: 760px) { .shw-stage { padding: 40px 20px 100px; } .shw-stage .jk-box { transform: scale(.8); } .shw-lead { display: none; } .shw-side { border-left: 0; border-top: 2px dashed rgba(242,168,119,.45); } }

  /* stage light */
  .sr-beam{position:absolute;left:50%;top:-12%;width:560px;height:124%;margin-left:-280px;background:radial-gradient(ellipse 48% 58% at 50% 46%,rgba(255,214,150,.22),transparent 70%);transform-origin:50% 0;animation:srBeamOn 1.2s ease-out both, srSway 9s ease-in-out 4.5s infinite}
  .sr-floor{position:absolute;left:50%;bottom:-1px;width:900px;margin-left:-450px;height:220px;background:radial-gradient(ellipse 50% 70% at 50% 100%,rgba(217,167,72,.10),transparent 70%);animation:srBeamOn 1.6s ease-out .3s both}
  /* the jacket walks in: travel, step bob, lean — each on its own layer */
  .jk-walk{animation:jkAppear 1.4s cubic-bezier(.2,.8,.2,1) .3s both}
  .jk-lean{transform-origin:50% 92%;animation:jkBreathe 5s ease-in-out 1.8s infinite}
  /* the tie hangs still, then swings gently and settles, like cloth catching a little air */
  .jk-tie-walk{transform-origin:50% 2%;animation:jkTieSway 7s cubic-bezier(.37,0,.63,1) 2s infinite both}
  .jk-tie-idle{transform-origin:50% 3%}
  .jk-shadow{animation:jkAppear 1.4s ease-out .3s both}
  .jk-shadow i{display:block;width:210px;height:22px;margin:0 auto;border-radius:50%;background:radial-gradient(ellipse at center,rgba(0,0,0,.75),transparent 70%);}
  .jk-sheen{position:absolute;inset:0;-webkit-mask-image:var(--hero);mask-image:var(--hero);-webkit-mask-size:100% 100%;mask-size:100% 100%;background:linear-gradient(100deg,transparent 40%,rgba(255,206,120,.8) 50%,transparent 60%);background-size:300% 100%;background-position:120% 0;animation:srSheen 6s ease-in-out 2s infinite}
  /* wordmark slides out from behind the jacket */
  .sr-word{animation:srWipe 1s cubic-bezier(.6,0,.2,1) 1.2s both}
  .sr-line{transform-origin:center;animation:srDraw .9s cubic-bezier(.6,0,.2,1) 1.8s both}
  .sr-cycle{position:relative;height:28px;overflow:hidden}
  .sr-cycle span{position:absolute;left:0;right:0;opacity:0;animation:srCycle 7.5s ease-in-out infinite}
  .sr-fade{animation:srFade .8s ease-out both}
  /* custom background: dark suiting fabric with light-orange tailor's stitching */
  .sr-fabric{background-color:#141417;background-image:repeating-linear-gradient(45deg,rgba(255,255,255,.02) 0 1px,transparent 1px 5px),radial-gradient(ellipse 70% 60% at 30% 40%,#1D1C22,#121215)}
  .m-wipe{transform-box:fill-box;transform-origin:left center;animation:mWipe 2.8s cubic-bezier(.5,0,.3,1) .3s both}@keyframes mWipe{from{transform:scaleX(0)}to{transform:scaleX(1)}}.tape{animation:tapeRun 40s linear infinite}@keyframes tapeRun{to{transform:translateX(var(--tape,-1270px))}}
  .st{fill:none;stroke:#F2A877;stroke-width:2;stroke-linecap:round;stroke-dasharray:9 7}
  .st-faint{stroke-opacity:.28}.st-mid{stroke-opacity:.45}.st-hi{stroke-opacity:.7}
  .st-sew{stroke:#fff;stroke-width:8;fill:none;stroke-dasharray:1 1;stroke-dashoffset:1;animation:stSew 2.4s cubic-bezier(.5,0,.3,1) both}
  .st-crawl{animation:stCrawl 2.2s linear infinite}
  .card-stitch{position:absolute;inset:9px;border:2px dashed rgba(232,140,80,.55);border-radius:12px;pointer-events:none}
  @keyframes stSew{to{stroke-dashoffset:0}}
  @keyframes stCrawl{to{stroke-dashoffset:-32}}
  @keyframes srBeamOn{from{opacity:0}to{opacity:1}}
  @keyframes srSway{0%,100%{transform:rotate(-4deg)}50%{transform:rotate(4deg)}}
  @keyframes jkAppear{from{opacity:0;transform:scale(.94) translateY(10px);filter:brightness(.3)}to{opacity:1;transform:none;filter:none}}
  @keyframes jkTieSway{0%,30%{transform:rotate(0) skewX(0)}38%{transform:rotate(2.4deg) skewX(-.8deg)}47%{transform:rotate(-1.7deg) skewX(.6deg)}56%{transform:rotate(1.1deg) skewX(-.3deg)}65%{transform:rotate(-.6deg)}74%{transform:rotate(.3deg)}83%,100%{transform:rotate(0) skewX(0)}}
  @keyframes jkBreathe{0%,100%{transform:scale(1)}50%{transform:scale(1.012,1.018)}}
  @keyframes srSheen{0%,50%{background-position:120% 0}80%,100%{background-position:-20% 0}}
  @keyframes srWipe{from{clip-path:inset(0 100% 0 0);transform:translateX(-30px)}to{clip-path:inset(0 0 0 0);transform:none}}
  @keyframes srDraw{from{transform:scaleX(0)}to{transform:scaleX(1)}}
  @keyframes srCycle{0%{opacity:0;transform:translateY(100%)}4%,30%{opacity:1;transform:none}34%,100%{opacity:0;transform:translateY(-100%)}}
  @keyframes srFade{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
  @media (prefers-reduced-motion:reduce){.sr-beam,.sr-floor,.jk-walk,.jk-bob,.jk-lean,.jk-tie-walk,.jk-tie-idle,.jk-shadow,.jk-shadow i,.jk-sheen,.sr-word,.sr-line,.sr-fade{animation:none}.sr-cycle span{animation:none}.sr-cycle span:first-child{opacity:1}.st-sew{animation:none;stroke-dashoffset:0}.st-crawl{animation:none}.q-reveal,.m-wipe,.tape{animation:none}}

/* staff sign-in on the showroom design: the usual card, on the stitched right-hand side */
.staff-shw .shw-side .login-wrap { padding: 0; max-width: 420px; }
.staff-shw .shw-side .login-card { position: relative; border: 0; box-shadow: 0 30px 60px rgba(0,0,0,.45); }
.staff-shw .shw-side .login-card::after { content: ''; position: absolute; inset: 9px; border: 2px dashed rgba(232,140,80,.55); border-radius: 10px; pointer-events: none; }
.staff-shw .shw-side .login-under, .staff-shw .shw-side .login-power, .staff-shw .staff-note { color: #AFA9A0; }
.staff-shw .shw-side .login-under a { color: #fff; }
.staff-shw .btn.primary { background: var(--brand); border-color: var(--brand); }
.staff-shw .login-tabs button[aria-selected="true"] { background: #1D1F24; color: #fff; }
.staff-shw .login-brand { display: none; } 
/* Showroom pages are still: no animation, nothing hidden while waiting */
.shw .sr-beam, .shw .sr-floor, .shw .jk-shadow, .shw .jk-shadow i, .shw .sr-word, .shw .sr-line, .shw .sr-fade, .shw .m-wipe, .shw .tape, .shw .jk-tie-walk, .shw .jk-tie-idle { animation: none !important; }
.shw .jk-shadow i { width: 200px; }
/* Shop-location tape measure: plain HTML, animated only by transform (handled by the graphics card, so it never slows the page),
   starting a second after the page has shown. */
.shw .shw-tape { position: absolute; left: -60px; right: -60px; bottom: 70px; height: 44px; transform: rotate(-3deg); overflow: hidden; pointer-events: none; border-top: 1.5px dashed rgba(156,84,38,.7); border-bottom: 1.5px dashed rgba(156,84,38,.7); background: #ECBA8C; contain: layout paint; }
.shw .shw-tape-run { display: flex; width: max-content; height: 100%; align-items: center; will-change: transform;
  background: repeating-linear-gradient(90deg, #5A3418 0 1.2px, transparent 1.2px 20px) 0 0 / 100% 13px no-repeat, repeating-linear-gradient(90deg, rgba(90,52,24,.75) 0 1px, transparent 1px 10px) 0 0 / 100% 7px no-repeat;
}
.shw .shw-tape-item { display: inline-flex; align-items: flex-end; gap: 7px; padding: 12px 40px 0 0; font-family: var(--font-display, 'Barlow Condensed', sans-serif); font-weight: 600; font-size: 17px; color: #4A2510; white-space: nowrap; }
.shw .shw-tape-item.b { font-weight: 700; }
@keyframes shwTape { to { transform: translateX(-50%); } }
.shw .shw-tape-run { animation: shwTape 45s linear 1s infinite; }
@media (prefers-reduced-motion: reduce) { .shw .shw-tape-run { animation: none; } }
.staff-h { margin: 22px 28px 0; font-family: var(--font-display, 'Barlow Condensed', sans-serif); font-size: 30px; color: var(--ink); }
.staff-shw .staff-h { margin-top: 26px; }
/* Greeting after staff login */
.greet { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ground); padding: 24px; box-sizing: border-box; }
.greet.dark { color: #F1EEE9; }
.greet-box { text-align: center; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.greet-box img { margin-bottom: 14px; } .greet-box img.lg { max-height: 90px; max-width: 260px; background: #fff; border-radius: 12px; padding: 8px; }
.greet-day { margin: 0; font-size: 15px; color: var(--mute); } .greet.dark .greet-day { color: #AFA9A0; }
.greet-box h1 { margin: 4px 0 6px; font-family: var(--font-display, 'Barlow Condensed', sans-serif); font-size: clamp(40px, 6vw, 64px); line-height: 1; color: var(--brand); }
.greet-place { margin: 0; font-size: 22px; font-weight: 600; } .greet-place span { color: var(--mute); }
.greet-sub { margin: 0 0 22px; font-size: 15px; color: var(--mute); } .greet.dark .greet-sub { color: #AFA9A0; }
.greet .btn.primary { background: var(--brand); border-color: var(--brand); min-width: 200px; }
/* No grey tap flash and no blue selection on the showroom pages: the stage is a picture, not text to select;
   focus and selected text use the store's colour instead of the browser's blue. */
.shw, .greet { -webkit-tap-highlight-color: transparent; }
.shw-stage, .shw-stage *, .greet-box img, .shw .login-power, .shw .shw-tape { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.shw-stage img { -webkit-user-drag: none; pointer-events: none; }
.shw ::selection, .greet ::selection { background: rgba(216,106,43,.28); color: inherit; }
.shw input:focus, .shw select:focus, .shw textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(216,106,43,.22); outline: none; }
.shw button:focus-visible, .shw a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.shw .btn:focus:not(:focus-visible), .shw button:focus:not(:focus-visible) { outline: none; box-shadow: none; }

/* Customer-style card, shared by the customer page and the staff login */
.cl-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 34px rgba(20,26,42,.08); padding: 26px 26px 22px; }
.cl-card .cl-logo.small { display: none; justify-content: center; margin-bottom: 18px; }
.cl-card .cl-logo.small img { max-height: 70px; max-width: 240px; }
.cl-card .login-tabs { margin: 0 0 18px; }
.cl-card h2 { margin: 0 0 6px; }
.cl-intro { color: var(--mute); font-size: 14.5px; margin: 0 0 16px; }
.cl-links { text-align: center; font-size: 14px; margin: 14px 0 0; }
.cl-browse { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding: 13px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-size: 14px; }
.cl-browse:hover { border-color: var(--line-2); } .cl-browse span:last-child { font-size: 22px; color: var(--mute); }
.cl-help { text-align: center; font-size: 13px; color: var(--mute); margin: 14px 0 0; }
.shw-side .cl-card { padding: 30px 30px 24px; } .shw-side .cl-card h2 { margin: 0 0 6px; }
.shw-side .cl-browse { text-decoration: none; } .shw-side .cl-browse b { color: #fff; }
.shw .cl-links a { color: #A8481A; }

/* ---------- Back office: cleaner layout ---------- */
.btn.primary:hover { background: var(--plum); filter: brightness(.92); }
.brand { padding: 16px 16px 14px; display: flex; align-items: center; min-height: 64px; }
.brand img { max-height: 46px; max-width: 100%; background: #fff; border-radius: 8px; padding: 6px 8px; display: block; }
.brand b { font-size: 20px; }
.main > .top { min-height: 58px; padding: 8px 24px; gap: 14px; }
@media (min-width: 901px) { .main > .top .menu-btn { display: none !important; } }
.top .who { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); }
.top .who:hover { border-color: var(--line-2); }
.top .who .av { width: 32px; height: 32px; border-radius: 50%; background: var(--plum); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.top .who .nm { display: flex; flex-direction: column; line-height: 1.15; } .top .who .nm b { font-size: 14px; } .top .who .nm small { font-size: 12px; color: var(--mute); }
@media (max-width: 760px) { .top .who .nm { display: none; } .top .who { padding: 3px; } }
.page { padding: 26px 32px 64px; max-width: 1360px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 30px; margin: 0; }
.card { padding: 20px 22px; border-radius: 14px; box-shadow: 0 1px 2px rgba(31,42,68,.04); }
.card h2 { font-size: 20px; margin: 0 0 12px; }
.grid { gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { padding: 18px 20px; border-radius: 14px; box-shadow: 0 1px 2px rgba(31,42,68,.04); }
.stat a { display: block; color: inherit; }
.stat .v { font-size: 30px; }
.stat .l { font-size: 14px; color: var(--ink); font-weight: 600; margin-top: 2px; }
.stat .s { color: var(--mute); }
.stat:hover { border-color: var(--line-2); }
.todo { margin-top: 16px; }
.todo-row { display: grid; grid-template-columns: 48px 1fr 18px; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.todo-row:first-of-type { border-top: 0; }
.todo-row b { font-family: var(--font-display); font-size: 22px; color: var(--amber); text-align: center; background: var(--amber-soft); border-radius: 8px; padding: 2px 0; }
.todo-row span:last-child { color: var(--mute); font-size: 20px; }
.todo-row:hover span:nth-child(2) { color: var(--plum); }
.bars .b { background: var(--plum); opacity: .85; } .bars .b:hover { opacity: 1; }
.hbar .track i { background: var(--plum); opacity: .85; }
table th { font-weight: 600; }

/* =====================================================================
   Orange & white scheme (back office, till, dialogs) — Barlow throughout
   White surfaces, warm light-grey ground, one orange for actions and "you are here",
   charcoal for text. Orange text uses the deeper shade so it stays readable on white.
   ===================================================================== */
:root {
  --plum: #C2561D;        /* orange: buttons, active item, charts */
  --plum-soft: #FCEEE5;   /* orange tint: selected rows, active menu background */
  --orange-ink: #A8481A;  /* orange for text and links on white (readable) */
  --indigo: #23262D;      /* charcoal: headings, figures */
  --indigo-2: #3A3F4A;
  --ground: #F6F5F3;      /* warm light grey page background */
  --paper: #FFFFFF;
  --line: #E8E5E1;
  --line-2: #D6D2CC;
  --ink: #23262D;
  --mute: #6B6F78;
  --amber: #A8481A; --amber-soft: #FCEEE5;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}
body { background: var(--ground); color: var(--ink); font-family: var(--font); }
a { color: var(--orange-ink); }

/* Side menu: white, aligned to an 8px grid, orange marks where you are */
.side { background: #FFFFFF; color: var(--ink); border-right: 1px solid var(--line); }
.brand { border-bottom: 1px solid var(--line); }
.brand img { background: transparent; padding: 0; border-radius: 0; max-height: 44px; }
.brand b { color: var(--ink); }
.nav { padding: 12px 12px 16px; }
.nav .top, .side-foot .top { color: #3A3F4A; padding: 10px 12px; border-radius: 8px; font-weight: 500; min-height: 40px; }
.nav .top svg, .side-foot .top svg { color: #8A8F99; }
.nav .top:hover, .side-foot .top:hover { background: #F6F5F3; color: var(--ink); }
.nav .top.on, .side-foot .top.on { background: var(--plum-soft); color: var(--orange-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--plum); }
.nav .top.on svg, .side-foot .top.on svg, .nav .grp.here > .top svg { color: var(--plum); }
.nav .grp.here > .top { color: var(--ink); font-weight: 600; }
.nav .top:focus-visible, .nav .kids a:focus-visible, .side-foot .top:focus-visible { outline: 2px solid var(--plum); outline-offset: -2px; }
.nav .kids { margin: 2px 0 8px 22px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav .kids a { color: #5A5F69; padding: 7px 10px; font-size: 14px; }
.nav .kids a:hover { background: #F6F5F3; color: var(--ink); }
.nav .kids a.on { color: var(--orange-ink); background: var(--plum-soft); box-shadow: inset 3px 0 0 var(--plum); }
.nav .sub-h { color: #9A9EA6; }
.side-foot { border-top: 1px solid var(--line); }
.side .foot { color: #9A9EA6; } .side .foot .linkish { color: var(--mute); }

/* Header */
.main > .top { background: #FFFFFF; border-bottom: 1px solid var(--line); }
.top .who { border-color: var(--line); } .top .who .av { background: var(--plum); }

/* Buttons and fields */
.btn { border-radius: 8px; font-weight: 600; min-height: 40px; }
.btn.primary { background: var(--plum); border-color: var(--plum); color: #fff; }
.btn.primary:hover { filter: none; background: #A8481A; border-color: #A8481A; }
.btn:not(.primary):not(.danger):hover { border-color: var(--plum); color: var(--orange-ink); }
input:focus, select:focus, textarea:focus { border-color: var(--plum); box-shadow: 0 0 0 3px rgba(194,86,29,.18); }
.chip.on { background: var(--plum); border-color: var(--plum); color: #fff; }
.login-tabs button[aria-selected="true"] { color: var(--ink); }

/* Cards, figures and lists */
.card, .stat { border-color: var(--line); box-shadow: none; }
.stat .v { color: var(--ink); }
.stat:hover { border-color: var(--plum); }
.page-head h1, .card h2 { color: var(--ink); }
.todo-row b { color: var(--orange-ink); background: var(--plum-soft); }
.todo-row:hover span:nth-child(2) { color: var(--orange-ink); }
.badge.warn { background: var(--plum-soft); color: var(--orange-ink); }
.nav .badge, .badge.acc { background: var(--plum); color: #fff; }

/* Tables: quiet header, clear rows */
table.t th { background: #FAF9F7; color: #5A5F69; }
table.t tbody tr.click:hover td { background: #FDF6F1; }
table.t tfoot td { background: #FAF9F7; }

/* Charts */
.bars .b, .hbar .track i { background: var(--plum); opacity: 1; }
.hbar .track { background: #F1EEEA; }

/* Till: white work area, charcoal top bar with an orange pay button */
.pos-bar { background: var(--ink); }
.cart-actions .pay, .btn.pay { background: var(--plum); border-color: var(--plum); }

/* Dialogs */
.dialog header { border-bottom: 1px solid var(--line); } .dialog footer { border-top: 1px solid var(--line); background: #FAF9F7; }
input[type=checkbox], input[type=radio], progress { accent-color: var(--plum); }
.bars .b:hover { background: var(--orange-ink); }

/* ---------- Document layouts (same set as Thorium ERP): classic, modern, minimal, executive, bold, band, ledger, elegant ---------- */
.qdoc { --qa: var(--doc-accent, #1f2a44); --qs: var(--doc-soft, rgba(31,42,68,.08)); display: flex; flex-direction: column; min-height: 100%; }
.qdoc .lbl { text-transform: none; }
.qdoc .qfoot { margin-top: auto; padding-top: 12px; border-top: 1px solid #e4e8e6; text-align: center; color: #4b5550; }
.qdoc .qfoot-note { font-size: 11px; margin-bottom: 6px; color: #555; }
.qdoc .qfoot-co { font-size: 10px; line-height: 1.55; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 10px; }
.qdoc .qfoot-co b { flex-basis: 100%; font-size: 11px; color: var(--qa); }
.qdoc .qfoot-co span:not(:last-child)::after { content: '·'; margin-left: 10px; color: #b3b8b5; }
.qdoc > * + * { margin-top: 14px; }
.qdoc .qsign { margin-top: 30px; }

/* Classic: coloured header band */
.qdoc.t-classic .qhead { background: var(--qa); color: #fff; padding: 20px 22px; border-bottom: 0; border-radius: 4px; }
.qdoc.t-classic .qhead .qco, .qdoc.t-classic .qtitle > div { color: #fff; }
.qdoc.t-classic .qtitle td:first-child { color: rgba(255,255,255,.75); }
.qdoc.t-classic .qhead .qlogo { background: #fff; padding: 6px 8px; border-radius: 4px; }
.qdoc.t-classic .qlines th { background: var(--qs); color: #1b1f1d; }
/* Modern: side stripe, coloured column headings */
.qdoc.t-modern { border-left: 8px solid var(--qa); padding-left: 24px; }
.qdoc.t-modern .qhead { border-bottom: 2px solid var(--qa); }
.qdoc.t-modern .qlines th { background: var(--qa); color: #fff; }
.qdoc.t-modern .qto { background: var(--qs); padding: 12px 14px; border-radius: 6px; }
/* Minimal: black lines only */
.qdoc.t-minimal .qhead { border-bottom: 1px solid #1b1f1d; }
.qdoc.t-minimal .qtitle > div { color: #1b1f1d; font-weight: 600; letter-spacing: .18em; font-size: 18px; }
.qdoc.t-minimal .qlines th { background: transparent; color: #1b1f1d; border-bottom: 1.5px solid #1b1f1d; }
.qdoc.t-minimal .qsum .tot td { border-top: 1.5px solid #1b1f1d; border-bottom: 1.5px solid #1b1f1d; }
.qdoc.t-minimal .qfoot-co b { color: #1b1f1d; }
/* Executive: top rule, large light title, dark headings */
.qdoc.t-executive { border-top: 8px solid var(--qa); padding-top: 18px; }
.qdoc.t-executive .qtitle > div { font-size: 30px; font-weight: 300; letter-spacing: .01em; color: #111; }
.qdoc.t-executive .qhead { border-bottom: 1px solid #d9dedb; }
.qdoc.t-executive .qlines th { background: #16191b; color: #fff; }
.qdoc.t-executive .qsum .tot td { background: var(--qa); color: #fff; border-top: 0; }
/* Bold: big coloured title, striped rows, dark total */
.qdoc.t-bold .qhead { border-bottom: 0; }
.qdoc.t-bold .qtitle > div { font-size: 32px; font-weight: 800; color: var(--qa); }
.qdoc.t-bold .qto { border-left: 3px solid var(--qa); padding-left: 12px; }
.qdoc.t-bold .qlines th { background: transparent; color: #111; border-bottom: 3px solid var(--qa); }
.qdoc.t-bold .qlines tbody tr:nth-child(2n) td { background: #f6f8f7; }
.qdoc.t-bold .qsum .tot td { background: #111; color: #fff; border-top: 0; }
/* Band: tinted header band and coloured footer */
.qdoc.t-band .qhead { background: var(--qs); padding: 20px 22px 16px; border-bottom: 0; border-radius: 4px; }
.qdoc.t-band .qlines th { background: var(--qs); color: #111; border-bottom: 2px solid var(--qa); }
.qdoc.t-band .qfoot { background: var(--qa); color: #fff; border-top: 0; padding: 12px 18px 14px; border-radius: 4px; }
.qdoc.t-band .qfoot-co b, .qdoc.t-band .qfoot-note { color: #fff; } .qdoc.t-band .qfoot-co { color: rgba(255,255,255,.9); }
.qdoc.t-band .qfoot-co span:not(:last-child)::after { color: rgba(255,255,255,.6); }
/* Ledger: boxed sections and a fully ruled table */
.qdoc.t-ledger .qhead { border-bottom: 2px solid var(--qa); }
.qdoc.t-ledger .qto { border: 1px solid #cfd6d3; border-radius: 6px; padding: 10px 12px; }
.qdoc.t-ledger .qto .lbl { background: var(--qs); margin: -10px -12px 8px; padding: 6px 12px; border-radius: 6px 6px 0 0; }
.qdoc.t-ledger .qlines { border: 1px solid #cfd6d3; }
.qdoc.t-ledger .qlines th { background: var(--qs); color: #111; border: 1px solid #cfd6d3; }
.qdoc.t-ledger .qlines td { border: 1px solid #e1e6e4; }
.qdoc.t-ledger .qsum table { border: 1px solid #cfd6d3; border-radius: 6px; }
/* Elegant: hairlines and spaced capitals */
.qdoc.t-elegant .qhead { border-bottom: .5px solid #1b1f1d; }
.qdoc.t-elegant .qtitle > div { font-size: 15px; font-weight: 600; letter-spacing: .32em; color: #1b1f1d; }
.qdoc.t-elegant .lbl { color: var(--qa); letter-spacing: .2em; font-weight: 600; }
.qdoc.t-elegant .qlines th { background: transparent; border-top: .5px solid var(--qa); border-bottom: .5px solid var(--qa); color: var(--qa); letter-spacing: .14em; }
.qdoc.t-elegant .qlines td { border-bottom: .5px solid #e4e8e6; }
.qdoc.t-elegant .qsum .tot td { border-top: 3px double #1b1f1d; border-bottom: .5px solid #1b1f1d; }
/* Spacing */
.qdoc.d-compact { font-size: 12px; } .qdoc.d-compact > * + * { margin-top: 9px; } .qdoc.d-compact .qlines td, .qdoc.d-compact .qlines th { padding: 5px 8px; }
.qdoc.d-airy > * + * { margin-top: 22px; } .qdoc.d-airy .qlines td { padding: 11px 8px; }

/* Layout picker */
.tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tpl { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 600 13px var(--font); color: var(--ink); cursor: pointer; }
.tpl.on { border-color: var(--plum); box-shadow: 0 0 0 2px var(--plum-soft); color: var(--orange-ink, var(--plum)); }
.tpl:hover { border-color: var(--line-2); }
.mini { position: relative; width: 100%; height: 54px; border: 1px solid #e3e1dd; border-radius: 4px; background: #fff; overflow: hidden; }
.mini i, .mini b, .mini u, .mini s { position: absolute; left: 8px; right: 8px; display: block; }
.mini i { top: 6px; height: 6px; width: 40%; right: auto; background: var(--plum); }
.mini b { top: 18px; height: 3px; background: #d8d5d0; } .mini u { top: 26px; height: 3px; width: 60%; right: auto; background: #e6e3df; }
.mini s { top: 36px; height: 7px; background: var(--plum); opacity: .25; }
.m-classic i { left: 0; right: 0; top: 0; width: auto; height: 12px; } .m-classic b { top: 20px; }
.m-modern { border-left: 5px solid var(--plum); } .m-modern s { opacity: 1; }
.m-minimal i, .m-minimal s { background: #23262D; opacity: 1; height: 2px; } .m-minimal s { top: 38px; }
.m-executive { border-top: 5px solid var(--plum); } .m-executive i { background: #bbb; } .m-executive s { background: #16191b; opacity: 1; }
.m-bold i { height: 9px; width: 55%; } .m-bold s { background: #111; opacity: 1; left: 60%; }
.m-band i { left: 0; right: 0; width: auto; top: 0; height: 13px; background: var(--plum); opacity: .18; } .m-band s { top: auto; bottom: 0; left: 0; right: 0; height: 6px; opacity: 1; }
.m-ledger s { opacity: 1; background: transparent; border: 1px solid #bbb; height: 12px; } .m-ledger b { background: var(--plum); height: 2px; }
.m-elegant i { height: 2px; background: #23262D; } .m-elegant s { background: transparent; border-top: .5px solid var(--plum); border-bottom: .5px solid var(--plum); opacity: 1; }
.seg { display: inline-flex; background: #F1EEEA; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 8px; font: 600 14px var(--font); color: var(--mute); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
@media (max-width: 700px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cfg-nav a.on { background: var(--plum-soft); color: var(--orange-ink, var(--plum)); box-shadow: inset 3px 0 0 var(--plum); }
/* document header: logo side may shrink, title block never gets cut */
.qdoc .qhead > div:first-child { min-width: 0; flex: 1 1 auto; }
.qdoc .qhead .qtitle { flex: 0 0 auto; }
.qdoc .qhead .qlogo { max-height: 70px; max-width: 220px; }

/* Compact title block (all layouts): the word QUOTATION is the same size as Number / Date / Valid until, sitting at the top */
.qdoc .qhead { align-items: flex-start; }
.qdoc .qhead .qtitle { align-self: flex-start; margin-top: 0; padding-top: 0; }
.qdoc .qhead .qtitle > div,
.qdoc.t-minimal .qtitle > div, .qdoc.t-executive .qtitle > div, .qdoc.t-bold .qtitle > div, .qdoc.t-elegant .qtitle > div {
  font-family: inherit; font-size: 13px; line-height: 1.3; font-weight: 700; letter-spacing: .08em; margin: 0 0 2px; }
.qdoc .qhead .qtitle table { font-size: 12px; line-height: 1.3; }
.qdoc .qhead .qtitle td { padding: 0 0 0 12px; }
/* No vertical accent lines */
.qdoc.t-modern { border-left: 0; padding-left: 0; }
.qdoc.t-bold .qto { border-left: 0; padding-left: 0; }
.m-modern { border-left: 1px solid #e3e1dd; }
/* Company details in the footer: right-aligned */
.qdoc .qfoot { text-align: right; }
.qdoc .qfoot-co { justify-content: flex-end; text-align: right; }
.qdoc .qfoot-co { display: block; line-height: 1.5; }
.qdoc .qfoot-co b, .qdoc .qfoot-co span { display: block; }
.qdoc .qfoot-co span::after { content: none !important; }

/* ---------- Document preview and PDF ---------- */
.doc-paper { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px 30px; max-height: 70vh; overflow: auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.02); }
.pdf-stage { position: fixed; left: -10000px; top: 0; width: 760px; background: #fff; padding: 0; z-index: -1; }
.pdf-stage .qdoc { max-width: 760px; }
.qdoc .qlines td.dn-box { width: 90px; border-bottom: 1px solid #bbb; }
.qdoc .qlines tr, .qdoc .qsum, .qdoc .qsign, .qdoc .qbank { break-inside: avoid; }
@media (max-width: 640px) { .doc-paper { padding: 14px; } }

/* ---------- Company footer pinned to the bottom of the page ---------- */
.doc-paper .qdoc, #pv .qdoc { min-height: 1040px; }            /* preview shows a full A4 page: footer sits at the bottom */
.qdoc.qfix, .qdoc.qfix-pdf { min-height: 0; display: block; }
.qdoc.qfix .qfoot, .qdoc.qfix-pdf .qfoot { margin-top: 0; }
.pdf-stage .qfix-pdf { width: 760px; background: #fff; padding-top: 2px; }
.qprint { width: 100%; border-collapse: collapse; } .qprint > tbody > tr > td, .qprint > tfoot > tr > td { padding: 0; }
.qfoot-space { height: 0; }
@media print {
  #print .qfoot-space { height: 34mm; }                         /* repeats on every sheet, keeping room for the footer */
  #print .qfix { position: fixed; left: 0; right: 0; bottom: 0; max-width: none; background: #fff; }
  #print .qprint .qdoc { min-height: 0; }
}

/* Footer: Prepared by (with signature) on the left, company details on the right */
.qdoc .qfoot-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.qdoc .qfoot-by { text-align: left; font-size: 11px; min-width: 180px; }
.qdoc .qfoot-by .lbl { margin-bottom: 2px; }
.qdoc .qfoot-by .qsig { display: block; max-height: 46px; max-width: 200px; object-fit: contain; margin: 2px 0 2px; }
.qdoc .qfoot-by .qsig-line { width: 180px; height: 30px; border-bottom: 1px solid #999; margin-bottom: 3px; }
.qdoc .qfoot-by b { font-size: 11px; color: #1b1f1d; }
.qdoc.t-band .qfoot-by, .qdoc.t-band .qfoot-by b { color: #fff; } .qdoc.t-band .qfoot-by .qsig { background: #fff; border-radius: 3px; padding: 2px 4px; }
.qdoc .qfoot-row .qfoot-co { flex: 1; }
/* Signature pad */
.sig-now { min-height: 54px; display: flex; align-items: center; margin: 6px 0 10px; } .sig-now img { max-height: 60px; max-width: 260px; }
.sig-pad { position: relative; border: 1px dashed #b9b2a9; border-radius: 8px; background: #fff; max-width: 560px; }
.sig-pad canvas { display: block; width: 100%; aspect-ratio: 560 / 180; cursor: crosshair; }
.sig-hint { position: absolute; left: 14px; bottom: 10px; color: #b9b2a9; font-size: 12px; pointer-events: none; }
.sig-pad::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 30px; border-bottom: 1px solid #e6e1da; pointer-events: none; }

/* Footer, final design: accent rule across the page; signature block left, company block right */
.qdoc .qfoot { border-top: 2px solid var(--qa); padding-top: 10px; text-align: left; }
.qdoc .qfoot-note { text-align: center; font-style: italic; font-size: 10.5px; color: #6b716e; margin: 0 0 8px; }
.qdoc .qfoot-row { align-items: flex-end; }
.qdoc .qfoot-by .lbl { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: #8a8f8c; }
.qdoc .qfoot-co { text-align: right; font-size: 10px; color: #5b615e; }
.qdoc .qfoot-co b { font-size: 12px; color: var(--qa); margin-bottom: 1px; }
.qdoc.t-band .qfoot { border-top: 0; }

/* Login page: shopping-mall skyline silhouette along the bottom of the stage (static, no animation) */
.shw-stage > .shw-malls { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; max-height: 250px; z-index: 0; pointer-events: none;
  background: url('img/malls.svg') center bottom / auto 100% repeat-x; }
.shw-stage > :not(.shw-malls):not(.bg):not(.sr-beam):not(.sr-floor):not(.shw-tape):not(.shw-street):not(.shw-labels) { position: relative; z-index: 1; }
.shw-stage > .shw-tape { z-index: 2; }
@media (max-width: 760px) { .shw-stage > .shw-malls { height: 26%; } }
/* Phones: taglines stay on one line, clear of the location tape */
@media (max-width: 760px) {
  .shw-taglines { font-size: 13.5px !important; letter-spacing: .6px !important; white-space: nowrap; }
  .shw-stage { padding-bottom: 150px; }
}
@media (max-width: 360px) { .shw-taglines { font-size: 12px !important; letter-spacing: .2px !important; } }

/* Shops as mall buildings with name signs (replaces the scrolling tape) */
.shw-stage > .shw-street { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 980px); height: auto; z-index: 1; pointer-events: none; }
.shw-stage > .shw-malls { height: 26%; max-height: 220px; opacity: .9; }
.shw-stage { padding-bottom: 210px; }
@media (max-width: 760px) { .shw-stage { padding-bottom: 130px; } .shw-stage > .shw-street { width: 100%; } .shw-stage > .shw-malls { height: 18%; } }
.shw-stage > .shw-street.narrow { display: none; }
@media (max-width: 760px) {
  .shw-stage > .shw-street.wide { display: none; }
  .shw-stage > .shw-street.narrow { display: block; width: 100%; }
  .shw-stage { padding-bottom: 270px; }
}

/* Boutique fronts (final): no skyline block layer; stitched shop fronts sit on the bottom of the stage */
.shw-stage > .shw-malls { display: none; }
.shw-stage > .shw-street.wide { bottom: 18px; width: min(96%, 940px); }
.shw-stage { padding-bottom: 250px; }
@media (max-width: 760px) { .shw-stage > .shw-street.narrow { bottom: 10px; width: 100%; } .shw-stage { padding-bottom: 400px; } }
.shw-stage > .shw-street.wide { bottom: 14px; width: min(88%, 760px); }
.shw-stage { padding-top: 40px; padding-bottom: 205px; }
@media (max-height: 760px) and (min-width: 761px) { .shw-stage > .shw-street.wide { width: min(80%, 660px); } .shw-stage { padding-bottom: 180px; } .shw-stage .jk-box { transform: scale(.88); margin: -12px 0; } }
@media (max-width: 760px) { .shw-stage { padding-top: 32px; padding-bottom: 365px; } .shw-stage > .shw-street.narrow { bottom: 8px; } }

/* ---------- Shops as woven labels sewn into the cloth (replaces tape / skyline / shop fronts) ---------- */
.shw-stage > .shw-malls, .shw-stage > .shw-street { display: none !important; }
.shw-stage { padding-top: 48px; padding-bottom: 150px; }
.shw-stage > .shw-labels { position: absolute; left: 0; right: 0; bottom: 46px; z-index: 2; margin: 0; padding: 0 28px; list-style: none;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 16px 22px; pointer-events: none; }
.shw-label { position: relative; padding: 0 10px; }
/* the label itself: woven satin with a fine weave and a sewn border */
.shw-label .lbl-in { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px 9px 15px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px), repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px), linear-gradient(180deg, #2a231e, #1f1a17);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 -1px 0 rgba(0,0,0,.4) inset, 0 3px 6px rgba(0,0,0,.45);
  color: #F2C29A; }
.shw-label .lbl-in::before { content: ''; position: absolute; inset: 3px; border: 1.2px dashed rgba(242,168,119,.55); border-radius: 1px; }
.shw-label .lbl-name { font-family: var(--font-display, 'Barlow Condensed'), 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 13.5px; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.shw-label .lbl-pin { color: #D86A2B; flex: none; }
/* folded ends, tacked to the cloth with a few cross-stitches */
.shw-label::before, .shw-label::after { content: ''; position: absolute; top: 4px; bottom: 4px; width: 8px;
  background: repeating-linear-gradient(0deg, rgba(242,168,119,.7) 0 4px, transparent 4px 8px) center / 1.5px 100% no-repeat, linear-gradient(90deg, #15110f, #241e1a); }
.shw-label::before { left: 3px; border-radius: 2px 0 0 2px; }
.shw-label::after { right: 3px; border-radius: 0 2px 2px 0; transform: scaleX(-1); }
@media (max-width: 760px) {
  .shw-stage { padding-bottom: 150px; }
  .shw-stage > .shw-labels { bottom: 30px; gap: 12px 8px; padding: 0 12px; display: grid; grid-template-columns: 1fr 1fr; justify-items: center; }
  .shw-label .lbl-in { padding: 8px 12px 8px 11px; } .shw-label .lbl-name { font-size: 11.5px; letter-spacing: .14em; }
}
/* Quiet, seamless version of the labels: low contrast, one calm row, sewn in rather than stuck on */
.shw-stage { padding-top: 40px; padding-bottom: 120px; }
.shw-stage > .shw-labels { bottom: 44px; gap: 10px 14px; flex-wrap: nowrap; }
.shw-label { padding: 0 7px; }
.shw-label .lbl-in { padding: 6px 13px 6px 11px; gap: 6px; color: rgba(242,194,154,.78);
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px), linear-gradient(180deg, rgba(38,32,28,.85), rgba(30,25,22,.85));
  box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.shw-label .lbl-in::before { inset: 2.5px; border: 1px dashed rgba(242,168,119,.32); }
.shw-label .lbl-name { font-size: 11.5px; font-weight: 500; letter-spacing: .22em; text-shadow: none; }
.shw-label .lbl-pin { color: rgba(216,106,43,.75); width: 7px; height: 10px; }
.shw-label::before, .shw-label::after { width: 5px; top: 3px; bottom: 3px; opacity: .7;
  background: repeating-linear-gradient(0deg, rgba(242,168,119,.45) 0 3px, transparent 3px 6px) center / 1px 100% no-repeat, rgba(20,16,14,.9); }
@media (max-width: 760px) {
  .shw-stage { padding-bottom: 130px; }
  .shw-stage > .shw-labels { bottom: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px 6px; }
  .shw-label .lbl-name { font-size: 10.5px; letter-spacing: .14em; }
}
/* Labels aligned to the left, inside the stitched border */
.shw-stage > .shw-labels { justify-content: flex-start; padding: 0 0 0 48px; }
@media (max-width: 760px) { .shw-stage > .shw-labels { justify-items: start; padding: 0 0 0 22px; grid-template-columns: auto auto; justify-content: start; column-gap: 8px; } }
/* Labels stacked in one column at the bottom left, edges lined up */
.shw-stage > .shw-labels { display: flex; flex-direction: column; align-items: flex-start; flex-wrap: nowrap; gap: 8px; left: 48px; right: auto; bottom: 46px; padding: 0; }
.shw-stage { padding-bottom: 60px; }
@media (max-width: 760px) {
  .shw-stage > .shw-labels { display: flex; flex-direction: column; align-items: flex-start; left: 22px; bottom: 30px; gap: 7px; padding: 0; }
  .shw-stage { padding-bottom: 190px; }
}
/* Labels on the left side of the stage, vertically centred (not at the bottom) */
@media (min-width: 761px) {
  .shw-stage > .shw-labels { top: 50%; bottom: auto; left: 46px; transform: translateY(-50%); }
  .shw-stage { padding-bottom: 48px; }
}
/* Wide screens: logo, name and taglines on the left so the stitched K on the right stands clear; shops along the bottom */
@media (min-width: 761px) {
  .shw-stage { align-items: flex-start; text-align: left; padding: 44px 40px 110px 64px; }
  .shw-stage .shw-logo { align-items: flex-start; gap: 12px; }
  .shw-stage .jk-box { transform: scale(.86); transform-origin: left top; margin-bottom: -30px; }
  .shw-stage .sr-line { background: linear-gradient(90deg, #D9A748, transparent) !important; width: 300px !important; }
  .shw-stage .shw-taglines { font-size: 15px !important; letter-spacing: 1.6px !important; }
  .shw-stage .shw-lead { max-width: 330px; font-size: 16px; margin-top: 14px; }
  .shw-stage > .shw-labels { top: auto; bottom: 40px; left: 64px; transform: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 4px; max-width: calc(100% - 100px); }
}
@media (min-width: 761px) { .shw-stage > .shw-labels { max-width: 380px; bottom: 36px; } .shw-stage .sr-beam { left: 6% !important; right: auto !important; } }
@media (min-width: 761px) { .shw-stage > .shw-labels { display: grid; grid-template-columns: auto auto; justify-content: start; justify-items: start; gap: 9px 4px; max-width: none; } }
@media (min-width: 761px) { .shw-stage > .shw-labels { left: 58px; column-gap: 0; } }
/* Logo centred over the shop name (the whole block still sits on the left) */
@media (min-width: 761px) {
  .shw-stage .shw-logo { align-items: center; width: max-content; max-width: 100%; text-align: center; }
  .shw-stage .jk-box { transform-origin: center top; }
  .shw-stage .sr-line { background: linear-gradient(90deg, transparent, #D9A748, transparent) !important; }
}

/* Balanced pages: content centred on wide screens; My account as an even two-by-two grid */
.page { margin-left: auto; margin-right: auto; }
.acct-row { margin-top: 16px; align-items: stretch; }
.acct-row > .card, .acct-row > #subBox > .card { height: 100%; box-sizing: border-box; margin: 0; }
.acct-row .sig-pad { max-width: none; }
.acct-row .sig-now { min-height: 40px; margin: 4px 0 8px; }

/* ZRA Smart Invoice */
.zra-pre { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Consolas, monospace; background: var(--bg2, #f5f6f8); border: 1px solid var(--line, #e3e5ea); border-radius: 8px; padding: 12px; max-height: 50vh; overflow: auto; margin: 0; }
.zra-box { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line, #e3e5ea); border-left-width: 4px; border-radius: 8px; }
.zra-box .lbl { font-size: 12px; color: var(--muted, #6b7280); margin-bottom: 2px; }
.zra-box.pending { border-left-color: #d97706; } .zra-box.failed { border-left-color: #dc2626; } .zra-box.done { border-left-color: #16a34a; }
button.stat.zst { text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; }
button.stat.zst.on { outline: 2px solid var(--acc, #1f2a44); outline-offset: -2px; }
.btns.nowrap { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
.qzra { border-top: 1px dashed #c9ccd3; padding-top: 6px; }

/* Barcodes */
.bc-menu { display: grid; gap: 10px; }
.bc-opt { text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 14px 16px; cursor: pointer; font: inherit; color: inherit; display: grid; gap: 3px; min-height: 64px; }
.bc-opt:hover, .bc-opt:focus-visible { border-color: var(--indigo); }
.bc-opt span { color: var(--mute); font-size: 13px; }

/* Staff sign-in follows the store's own colour (Configuration → Logo & documents) */
.login-page.staff .btn.primary { background: var(--brand); border-color: var(--brand); }
.login-page.staff a, .login-page.staff .linkish { color: var(--brand); }
.login-page.staff input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
