/* Thorium Store — staff app + portal 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: #1f2a44;      /* denim ink: navigation, headings */
  --indigo-2: #2c3a5c;
  --plum: #a3245a;        /* accent: primary actions, selection */
  --plum-soft: #f8e8ef;
  --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; }
