:root {
  --auth: #fd8a01;
  --auth-dark: #fd8a01;
  --navy: #fd8a01;
  --ink: #1c1917;
  --muted: #757575;
  --line: #e5e5e5;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --hover: #f3f3f3;
  --soft: #fff7f0;
  --soft-strong: #fff4ed;
  --thumb: #eeeeee;
  --flash-ok-bg: #ecfdf3;
  --flash-err-bg: #fef3f2;
  --flash-warn-bg: #fff8f7;
  --shadow: rgba(0, 0, 0, 0.12);
  --amber: #fd8a01;
  --danger: #b42318;
  --ok: #067647;
  --font: "Kantumruy Pro", "Inter", system-ui, sans-serif;
  --sidebar: 240px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --ink: #f5f5f4;
  --muted: #a8a29e;
  --line: #3f3f46;
  --bg: #18181b;
  --surface: #27272a;
  --surface-2: #3f3f46;
  --hover: #3f3f46;
  --soft: #3b2a1a;
  --soft-strong: #422006;
  --thumb: #3f3f46;
  --flash-ok-bg: #052e1c;
  --flash-err-bg: #450a0a;
  --flash-warn-bg: #431407;
  --shadow: rgba(0, 0, 0, 0.45);
  --ok: #34d399;
  --danger: #f87171;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); }
a { color: var(--navy); text-decoration: none; }

.nav-toggle { display: none; }
.nav-scrim { display: none; }
.nav-burger {
  display: none;
  width: 40px; height: 40px; border: 0; background: var(--auth);
  color: #fff; border-radius: 8px; font-size: 18px; cursor: pointer; align-items: center; justify-content: center;
}

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar);
  background: var(--auth); color: #fff;
  display: flex; flex-direction: column;
  z-index: 30;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 14px 16px 8px;
}
.sidebar-brand img {
  width: auto; max-width: 108px; height: auto;
}
.sidebar-nav { display: flex; flex-direction: column; padding: 8px 10px; gap: 2px; flex: 1; }
.sidebar-nav a {
  color: rgba(255,255,255,.88);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.sidebar-nav a:active { cursor: grabbing; }
.sidebar-nav a.dragging {
  opacity: 0.45;
}
.sidebar-nav a.drag-over {
  box-shadow: inset 0 2px 0 #fff;
}
.sidebar-nav a i { width: 18px; text-align: center; pointer-events: none; }
.sidebar-nav a.on, .sidebar-nav a:hover {
  background: #fff;
  color: var(--auth);
}
.sidebar-foot {
  padding: 12px 16px 16px;
  font-size: 12px;
  color: rgba(255,255,255,.85);
  border-top: 1px solid rgba(255,255,255,.18);
}
.sidebar-credit {
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: .02em;
  color: rgba(255,255,255,.9);
}
.sidebar-credit b { font-weight: 800; color: #fff; }
.sidebar-foot a { color: #fff; font-weight: 700; }
.sidebar-foot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-settings-btn {
  width: 30px;
  height: 30px;
  color: #fff;
  border-radius: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-settings-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.sidebar-user { margin-bottom: 8px; }
.sidebar-user b { display: block; color: #fff; font-size: 13px; }
.sidebar-user span { color: rgba(255,255,255,.75); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

.admin-shell { margin-left: var(--sidebar); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.admin-shell:has(.quote-wrap) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.admin-shell:has(.quote-wrap) .admin-page-foot { display: none; }
.admin-top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 4px 14px;
  display: flex; align-items: center; gap: 8px;
  position: sticky; top: 0; z-index: 20;
  min-height: 40px;
}
.admin-clock {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  line-height: 1.05;
}
.admin-clock time {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.admin-clock span {
  display: block;
  margin-top: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
}
.admin-top .who { font-size: 13px; color: var(--muted); }
.admin-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.admin-icon-wrap { position: relative; }
.admin-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  border-radius: 8px;
  text-decoration: none;
}
.admin-icon:hover { background: var(--hover); color: var(--auth); }
.admin-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 99px;
  background: var(--auth);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}
.admin-drop {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(92vw, 340px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 40;
  max-height: 60vh;
  overflow: auto;
}
.admin-drop.open { display: block; }
.admin-drop a {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}
.admin-drop a.drop-all { font-weight: 700; color: var(--auth); }
.chat-desk {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 70vh;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.chat-list { border-right: 1px solid var(--line); overflow: auto; max-height: 70vh; }
.chat-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 12px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.chat-row.on { background: var(--soft-strong); }
.chat-row .clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .pill {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--auth);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}
.chat-thread { display: flex; flex-direction: column; min-height: 70vh; }
.chat-thread-head { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.chat-thread-body { flex: 1; overflow: auto; padding: 14px; background: #fafafa; }
.bubble {
  max-width: 78%;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
}
.bubble.me { margin-left: auto; background: var(--auth); color: #fff; }
.bubble small { display: block; opacity: .7; font-size: 11px; margin-top: 4px; }
.chat-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.chat-compose .chat-send-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-compose .chat-send-row input[type=text] { flex: 1; }
.chat-compose .chat-clip {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  background: #f3f3f3;
}
.chat-compose .chat-pending,
.chat-desk .chat-pending {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  background: #fff7f0;
  border-radius: 8px;
  padding: 8px 10px;
}
.chat-pending button { border: 0; background: transparent; font-size: 18px; cursor: pointer; }
.chat-att-img img { max-width: 240px; width: 100%; height: auto; border-radius: 10px; display: block; margin-bottom: 6px; }
.chat-att-file {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 6px; border-radius: 10px;
  background: #f3f3f3; color: var(--ink); font-weight: 600; font-size: 13px;
}
.bubble.me .chat-att-file { background: rgba(255,255,255,.22); color: inherit; }
@media (max-width: 900px) {
  .chat-desk { grid-template-columns: 1fr; }
  .chat-list { max-height: 28vh; }
}

.wrap { padding: 20px 20px 56px; max-width: 1200px; flex: 1; width: 100%; }
.admin-page-foot {
  position: fixed;
  left: var(--sidebar);
  right: 0;
  bottom: 0;
  z-index: 18;
  margin: 0;
  padding: 10px 20px 12px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.admin-page-foot .admin-user {
  font-weight: 700;
  color: var(--ink);
}
h1 { font-size: 22px; margin: 0 0 16px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select, input[type=text], input[type=number], input[type=email], input[type=password], input[type=file], select, textarea {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink);
}
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.btn {
  display: inline-block; padding: 8px 12px; border-radius: 8px; border: 0; background: var(--navy);
  color: #fff; font: inherit; cursor: pointer; font-weight: 700;
}
.btn.secondary { background: var(--surface); color: var(--navy); border: 1.5px solid var(--navy); }
.btn.amber { background: var(--amber); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.flash.ok { background: var(--flash-ok-bg); color: var(--ok); }
.flash.err { background: var(--flash-err-bg); color: var(--danger); }
.quote-list-actions {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quote-list-del { display: inline; margin: 0; }
.quote-del-btn {
  min-width: 36px;
  padding: 8px 10px;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
  margin-bottom: 12px;
  border-radius: 10px;
}
.wrap.products-wrap {
  max-width: none !important;
  width: 100% !important;
  box-sizing: border-box;
  padding: 8px 14px 12px;
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-shell:has(.products-wrap) {
  width: auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.admin-shell:has(.products-wrap) .admin-page-foot {
  display: none;
}
.wrap.products-wrap > h1 {
  flex: 0 0 auto;
  font-size: 18px;
  margin: 0 0 2px;
  line-height: 1.2;
}
.wrap.products-wrap > .muted {
  flex: 0 0 auto;
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1.3;
}
.wrap.products-wrap > .toolbar {
  flex: 0 0 auto;
  gap: 6px;
  margin-bottom: 6px;
}
.wrap.products-wrap > .toolbar input,
.wrap.products-wrap > .toolbar select,
.wrap.products-wrap > .toolbar .btn {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  line-height: 1.2;
  min-height: 0;
}
.wrap.products-wrap > .toolbar form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  flex-wrap: wrap;
}
.wrap.products-wrap > .pager {
  flex: 0 0 auto;
  margin-top: 4px;
}
.wrap.products-wrap .table-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  overflow: auto;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.products-pricing-table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  overflow: visible !important;
  border-radius: 0;
}
.products-pricing-table th,
.products-pricing-table td {
  white-space: nowrap;
  padding: 6px 8px;
  font-size: 12px;
}
.products-pricing-table .price-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  padding: 4px 6px;
}
.products-pricing-table .price-pair {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.products-pricing-table .price-pct-wrap,
.products-pricing-table .price-usd-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.products-pricing-table .price-pct-input,
.products-pricing-table .price-usd-input {
  width: 58px;
  min-width: 52px;
  max-width: 72px;
  padding: 3px 4px;
  font: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
}
.products-pricing-table .price-pct-input {
  width: 48px;
  min-width: 44px;
  max-width: 56px;
  text-align: right;
}
.products-pricing-table .price-usd-input {
  text-align: right;
}
.products-pricing-table .price-pct-input:disabled {
  opacity: 0.45;
  background: var(--surface-2);
  cursor: not-allowed;
}
.products-pricing-table .price-pct-input::-webkit-outer-spin-button,
.products-pricing-table .price-pct-input::-webkit-inner-spin-button,
.products-pricing-table .price-usd-input::-webkit-outer-spin-button,
.products-pricing-table .price-usd-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.products-pricing-table .price-pct-input[type=number],
.products-pricing-table .price-usd-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
/* ---- Product edit: full screen, form left + history / statistics right ---- */
body.prod-full-frame {
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg, #f4f6f9);
}
body.prod-full-frame .admin-shell {
  margin-left: 0;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.prod-full-frame .wrap {
  max-width: none;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.prod-full-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  /* right padding clears the fixed close X */
  padding: 12px 72px 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.prod-full-img {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.prod-full-img-none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 22px;
}
.prod-full-title {
  min-width: 0;
  flex: 1;
}
.prod-full-title h1 {
  margin: 0;
  font-size: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prod-full-title p {
  margin: 2px 0 0;
  font-size: 13px;
}
.prod-full-kpis {
  display: flex;
  gap: 18px;
}
.prod-full-kpis div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.prod-full-kpis span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.prod-full-kpis b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.prod-full-actions {
  display: flex;
  gap: 8px;
}
.prod-full {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr);
}
.prod-full.prod-full-new {
  grid-template-columns: minmax(0, 1fr);
}
.prod-full-main,
.prod-full-side {
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 40px;
}
.prod-full-side {
  border-left: 1px solid var(--line);
  background: var(--surface-2, #f7f7f8);
}
.prod-panel h3 {
  margin-top: 0;
}
.prod-panel h3 .muted {
  font-weight: 400;
  font-size: 14px;
}
.prod-panel-scroll {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.prod-hist {
  width: 100%;
  margin: 0;
  font-size: 13px;
}
.prod-hist thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.prod-hist td {
  white-space: nowrap;
}
.prod-hist .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.prod-hist td .muted {
  font-size: 11px;
  margin-left: 4px;
}
.qty-neg { color: #b42318; }
.qty-pos { color: #067647; }
.prod-mv {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--soft);
  color: var(--ink);
}
.prod-mv-sale { background: #fef3f2; color: #b42318; }
.prod-mv-received { background: #ecfdf3; color: #067647; }
.prod-mv-sales-return { background: #eff8ff; color: #175cd3; }
.prod-mv-held-receipt,
.prod-mv-held-released { background: #f2f4f7; color: #475467; }
.prod-stat-trend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 13px;
}
.prod-stat-trend i {
  font-size: 18px;
}
.prod-trend-up i { color: #067647; }
.prod-trend-down i { color: #b42318; }
.prod-trend-flat i { color: var(--muted); }
.prod-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.prod-stat-group h4 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.prod-stat-group h4:not(:first-child) {
  margin-top: 12px;
}
.prod-stat-group dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  margin: 0;
  font-size: 13px;
}
.prod-stat-group dt {
  color: var(--muted);
}
.prod-stat-group dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.prod-stat-note {
  margin: 10px 0 0;
  font-size: 12px;
}
@media (max-width: 1100px) {
  body.prod-full-frame {
    height: auto;
    overflow: auto;
  }
  body.prod-full-frame .wrap {
    height: auto;
  }
  .prod-full {
    grid-template-columns: minmax(0, 1fr);
  }
  .prod-full-main,
  .prod-full-side {
    overflow: visible;
  }
  .prod-full-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .prod-full-head {
    flex-wrap: wrap;
  }
  .prod-stat-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
/* Product edit: rename / delete custom price types. */
.price-type-name {
  white-space: nowrap;
}
.price-type-actions {
  display: inline-flex;
  gap: 2px;
  margin-left: 8px;
  vertical-align: middle;
}
.price-type-actions[hidden],
.price-type-label[hidden] {
  display: none;
}
.price-type-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.price-type-icon:hover {
  border-color: var(--line);
  color: var(--auth);
  background: var(--soft);
}
.price-type-icon-del:hover {
  color: #b42318;
}
.price-type-rename {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  white-space: normal;
}
.price-type-rename input {
  width: 150px;
  margin: 0;
}
.price-type-err {
  margin: 6px 0 0;
  white-space: normal;
}
/* Product edit: add a custom price type under the pricing rows. */
.price-type-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.price-type-add[hidden] {
  display: none;
}
.price-type-add input {
  width: 220px;
  max-width: 100%;
  margin: 0;
}
.price-type-add-note {
  margin: 8px 0 0;
  font-size: 12px;
}
.price-type-add-row .flash {
  margin: 8px 0 0;
}
/* Product edit: % off Regular + price. Price stays in column 2 so rows align. */
.edit-price-pair {
  display: grid;
  grid-template-columns: 110px minmax(0, 220px);
  gap: 10px;
  align-items: center;
}
.edit-price-pct,
.edit-price-usd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.edit-price-usd {
  grid-column: 2;
}
.edit-price-pct input,
.edit-price-usd input {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
}
.products-pricing-table .price-cell.is-saving {
  opacity: 0.65;
}
.products-pricing-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--surface-2);
  box-shadow: 0 1px 0 var(--line);
  font-size: 11px;
  padding: 6px 8px;
}
.products-cols-wrap {
  position: relative;
  display: inline-flex;
}
.products-cols-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  max-width: min(320px, 90vw);
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.products-cols-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.products-cols-head strong {
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
}
.products-cols-head .btn {
  padding: 2px 8px;
  font-size: 11px;
}
.products-cols-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.products-cols-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.products-cols-item.is-locked {
  opacity: 0.7;
  cursor: default;
}
.products-cols-item input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--auth);
}
.products-pricing-table th.th-price span {
  display: block;
  font-weight: 800;
  color: var(--ink);
}
.products-pricing-table th.th-price small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
  text-transform: uppercase;
}
.products-pricing-table th:last-child,
.products-pricing-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--surface);
  box-shadow: -8px 0 12px rgba(15, 23, 42, 0.08);
  padding-right: 12px;
  min-width: 88px;
}
.products-pricing-table thead th:last-child {
  background: var(--surface-2);
  z-index: 7;
}
.products-pricing-table td:last-child .quote-list-actions {
  justify-content: flex-end;
}
.products-pricing-table td:last-child .btn {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
}
.products-pricing-table tbody.is-live-loading {
  opacity: 0.55;
  pointer-events: none;
}
.products-pricing-table td.cell-edit {
  cursor: pointer;
}
.products-pricing-table td.cell-edit:hover {
  background: rgba(253, 138, 1, 0.08);
  outline: 1px dashed rgba(253, 138, 1, 0.45);
  outline-offset: -1px;
}
.products-pricing-table td.is-editing {
  cursor: default;
  background: #fff7f0;
  outline: 1px solid var(--auth);
  outline-offset: -1px;
  padding: 4px 6px;
}
.products-pricing-table td.is-saving {
  opacity: 0.65;
}
.inline-input {
  width: 100%;
  min-width: 72px;
  max-width: 220px;
  padding: 4px 6px;
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
}
.inline-input[type=number]::-webkit-outer-spin-button,
.inline-input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inline-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.inline-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.inline-price .inline-input {
  width: 72px;
  min-width: 64px;
  max-width: 88px;
}
.inline-names {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  max-width: 280px;
}
.inline-names .inline-input {
  width: 100%;
  max-width: none;
}
.table-hscroll-bar {
  position: fixed;
  left: var(--sidebar);
  right: 0;
  bottom: 0;
  z-index: 35;
  height: 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}
.table-hscroll-bar[hidden] { display: none; }
.table-hscroll-track {
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  width: 100%;
}
.table-hscroll-spacer {
  height: 1px;
  pointer-events: none;
}
body.has-fixed-hscroll .admin-page-foot {
  bottom: 18px;
}
@media (max-width: 900px) {
  .table-hscroll-bar { left: 0; }
}
.hw-confirm {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hw-confirm[hidden] { display: none; }
.hw-confirm-card {
  background: var(--surface, #fff);
  border-radius: 14px;
  padding: 22px 20px 18px;
  width: min(400px, 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  text-align: center;
}
.hw-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--flash-err-bg, #fee2e2);
  color: var(--danger, #dc2626);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.hw-confirm-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--ink);
  text-transform: lowercase;
}
.hw-confirm-body {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-transform: lowercase;
}
.hw-confirm-body b {
  color: var(--ink);
  font-weight: 700;
  text-transform: none;
}
.hw-confirm-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.hw-confirm-btns .btn {
  min-width: 100px;
  text-transform: lowercase;
}
.products-cat-form {
  text-align: left;
  margin-top: 14px;
}
.products-cat-form label {
  display: block;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-transform: none;
}
.products-cat-form input[type=text] {
  display: block;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}
.products-cat-form .hw-confirm-btns {
  margin-top: 4px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card { background: var(--surface); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.card b { color: var(--auth); font-size: 22px; }
label { display: block; font-size: 12px; font-weight: 600; margin: 8px 0 4px; }
.pager { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.pager .btn {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  line-height: 1.2;
  min-height: 0;
}
.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.pager-jump-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}
.pager-page-input {
  width: 52px;
  padding: 3px 6px;
  font-size: 11px;
  border-radius: 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--thumb); }
.thumb-open {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 6px;
  line-height: 0;
}
.thumb-open:hover .thumb,
.thumb-open:focus-visible .thumb {
  outline: 2px solid var(--auth);
  outline-offset: 2px;
}
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
}
.img-lightbox.open { display: flex; }
.img-lightbox img {
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  background: #111;
}
.img-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.img-lightbox-close:hover,
.img-lightbox-close:focus-visible {
  background: var(--auth);
}

.muted { color: var(--muted); }

.wrap.dash-wrap { max-width: 1320px; }
.kpi {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.kpi .card {
  margin: 0;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  padding: 14px 14px 12px;
}
.kpi .card:hover { border-color: var(--auth); }
.kpi .card b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
}
.kpi-l {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.dash-card {
  margin: 0;
  border: 1px solid var(--line);
  padding: 16px;
}
.dash-card-h {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.dash-card-h a { color: inherit; }
.dash-card-h a:hover { color: var(--auth); }
.dash-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.dash-span-2 { grid-column: span 2; }
.dash-pies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.pie-wrap { display: flex; justify-content: center; padding: 4px 0 14px; }
.pie {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  position: relative;
}
.pie i {
  position: absolute;
  inset: 26px;
  background: #fff;
  border-radius: 50%;
}
.legend { list-style: none; margin: 0; padding: 0; }
.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
  color: var(--ink);
}
.legend span {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  flex-shrink: 0;
}
.legend b {
  margin-left: auto;
  font-size: 12px !important;
  color: var(--ink) !important;
  font-weight: 700;
}
.legend em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
  min-width: 28px;
  text-align: right;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 148px;
  padding-top: 4px;
}
.bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.bar span {
  display: block;
  width: 100%;
  max-width: 28px;
  background: var(--auth);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.bar small { font-size: 10px; color: var(--muted); }
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f2f2f2;
  font-size: 13px;
}
.stat-list li:last-child { border-bottom: 0; }
.stat-list span { color: var(--muted); }
.stat-list b {
  font-size: 13px !important;
  color: var(--ink) !important;
  font-weight: 700;
}
.rate-mini {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.rate-mini input { flex: 1; min-width: 0; }
.feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #f2f2f2;
  font-size: 13px;
}
.feed-row:last-child { border-bottom: 0; }
.feed-row a { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row a:hover { color: var(--auth); }
.feed-row span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row em { font-style: normal; color: var(--ink); font-weight: 600; white-space: nowrap; }
.stock-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.stock-strip div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.stock-strip b {
  display: block;
  font-size: 12px !important;
  color: var(--ink) !important;
  letter-spacing: .04em;
}
.stock-strip span {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--auth);
}
.stock-strip small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1100px) {
  .kpi { grid-template-columns: repeat(3, 1fr); }
  .dash-pies { grid-template-columns: repeat(2, 1fr); }
  .dash-row { grid-template-columns: 1fr 1fr; }
  .stock-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .kpi, .dash-pies, .dash-row { grid-template-columns: 1fr; }
  .dash-span-2 { grid-column: auto; }
  .stock-strip { grid-template-columns: 1fr 1fr; }
  .feed-row { grid-template-columns: 1fr auto; }
  .feed-row span { grid-column: 1 / -1; }
}

.a4 {
  width: 210mm;
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  background: #fff;
  padding: 12mm;
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  box-sizing: border-box;
  overflow: hidden;
}
.letterhead { display: flex; justify-content: space-between; border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 14px; gap: 12px; }
.letterhead > * { min-width: 0; }
.letterhead h2 { margin: 0; letter-spacing: .16em; color: var(--auth); }
.letterhead-logo {
  display: block;
  max-width: 180px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 0 4px;
}
.order-receipt-cell {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}
.order-receipt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.order-receipt-page {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}
.order-receipt-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.order-receipt-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.order-receipt-queue {
  display: inline;
  margin: 0;
}
.order-receipt-page .a4 {
  margin: 18px auto 40px;
  background: #fff;
  color: #111;
}
.order-receipt-page .flash {
  margin: 12px 18px 0;
}
@media print {
  .order-receipt-bar,
  .order-receipt-page .flash,
  .no-print {
    display: none !important;
  }
  .order-receipt-page {
    background: #fff;
  }
  .order-receipt-page .a4 {
    margin: 0;
    box-shadow: none;
    border: 0;
  }
}
.a4 table {
  font-size: 10px;
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-radius: 0;
}
.a4 th,
.a4 td {
  padding: 5px 4px;
  font-size: 10px;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 0;
}
.a4 .q-photo-col {
  width: 44px;
  max-width: 44px;
  vertical-align: middle;
}
.a4 .q-product {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}
.a4 .q-product-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.a4 .q-product-meta .btn {
  align-self: flex-start;
  margin-top: 4px;
}
.a4 th:nth-child(1),
.a4 td:nth-child(1) { width: 34%; }  /* product */
.a4 th:nth-child(2),
.a4 td:nth-child(2) { width: 18%; }  /* loc */
.a4 th:nth-child(3),
.a4 td:nth-child(3) { width: 9%; }   /* qty */
.a4 th:nth-child(4),
.a4 td:nth-child(4) { width: 13%; }  /* unit */
.a4 th:nth-child(5),
.a4 td:nth-child(5) { width: 16%; }  /* discount */
.a4 th:nth-child(6),
.a4 td:nth-child(6) { width: 10%; }  /* price */
.a4.no-discount th:nth-child(1),
.a4.no-discount td:nth-child(1) { width: 38%; }
.a4.no-discount th:nth-child(2),
.a4.no-discount td:nth-child(2) { width: 24%; }
.a4.no-discount th:nth-child(3),
.a4.no-discount td:nth-child(3) { width: 10%; }
.a4.no-discount th:nth-child(4),
.a4.no-discount td:nth-child(4) { width: 14%; }
.a4.no-discount th:nth-child(5),
.a4.no-discount td:nth-child(5) { width: 14%; }  /* price */
.a4 th:last-child,
.a4 td:last-child {
  text-align: right;
}
.a4 input,
.a4 select,
.a4 textarea {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.a4 .qty,
.a4 .unit,
.a4 .dmode,
.a4 .dval {
  height: 28px;
  min-height: 28px;
  padding: 0 6px;
  margin: 0;
  font-size: 11px;
  line-height: 26px;
  border-radius: 6px;
  width: 100%;
  vertical-align: middle;
}
.a4 .dmode {
  padding-right: 2px;
}
.a4 input { padding: 4px 6px; width: 100%; }
.a4 .line-usd {
  display: inline-flex;
  align-items: center;
  height: 28px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.a4 .q-line-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.a4 .q-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1;
}
.a4 .q-x:hover {
  color: var(--danger);
  background: var(--flash-err-bg, #fef2f2);
}
.a4 .btn {
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  font-size: 11px;
}
.a4 .totals {
  max-width: 100%;
  box-sizing: border-box;
}
.a4 .totals > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 6px 0;
}
.a4 .totals .grand {
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.a4 .totals .grand-amt {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.a4 .totals .grand-khr {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.a4.no-discount .q-col-disc,
.a4.no-discount .q-total-disc {
  display: none !important;
}
/* Keep discount editable on the draft sheet even when currently zero */
form#builder-form .a4.no-discount .q-col-disc {
  display: table-cell !important;
}
form#builder-form .a4.no-discount .q-total-disc {
  display: flex !important;
}
.a4 .q-expiry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.a4 .q-expiry input[type=date] {
  width: auto;
  min-width: 10.5em;
  max-width: 12em;
  height: 28px;
  padding: 0 8px;
  margin: 0;
}
.a4 input[type=number]::-webkit-outer-spin-button,
.a4 input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.a4 input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.no-print { margin: 16px auto; max-width: 210mm; }
.thread { background: #fafafa; border-radius: 8px; padding: 10px; max-height: 240px; overflow: auto; }
.thread .msg { margin: 8px 0; }
.thread .msg b { font-size: 12px; }

.quote-canvas {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.wrap.quote-wrap {
  max-width: none;
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.quote-studio {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.quote-studio-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 10px;
  min-height: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  margin: 0 !important;
  max-width: none !important;
}
.quote-studio-bar .btn {
  padding: 5px 10px;
  font-size: 12px;
}
.quote-studio-bar-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.quote-save-status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-transform: lowercase;
  min-height: 1em;
}
.quote-save-status.is-saving {
  color: var(--muted);
}
.quote-save-status.is-saved {
  color: var(--auth);
}
.quote-save-status.is-error {
  color: #b42318;
}
.quote-save-status[hidden] {
  display: none !important;
}
.quote-doc-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.quote-doc-type span {
  white-space: nowrap;
}
.quote-doc-type select {
  margin: 0;
  min-width: 7.5em;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.quote-doc-type.is-readonly {
  opacity: 0.75;
  cursor: default;
}
.quote-doc-type.is-readonly select {
  cursor: default;
}
.quote-studio-tools {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px 12px;
  padding: 6px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  margin: 0 !important;
  max-width: none !important;
  width: 100%;
  box-sizing: border-box;
}
.quote-studio-tool {
  min-width: 0;
}
.quote-studio-tool label {
  margin: 0 0 2px;
  font-size: 11px;
  line-height: 1.2;
}
.quote-studio-tool input[type=search],
.quote-studio-tool input[type=text],
.quote-studio-tool input:not([type]),
.quote-studio-tool select {
  padding: 5px 8px;
  font-size: 13px;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}
.quote-studio-tool .quote-add-row {
  margin-top: 4px;
  gap: 4px;
  max-width: 50%;
}
.quote-studio-tool .quote-add-row input,
.quote-studio-tool .quote-add-row select {
  flex: 1;
  min-width: 0;
  width: 100%;
}
.quote-studio-tool .quote-hits {
  margin-top: 4px;
  max-height: 110px;
  gap: 2px;
}
.quote-studio-tool .quote-hit {
  padding: 5px 8px;
  border-radius: 6px;
}
.quote-studio-thread {
  margin: 6px 10px 0 !important;
  max-width: none !important;
  max-height: 140px;
  padding: 8px;
}
.quote-studio .flash {
  margin: 6px 10px 0 !important;
  max-width: none !important;
  padding: 6px 10px;
}
.flash-toast {
  position: relative;
  padding-right: 36px;
}
.flash-toast .flash-x {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 2px 6px;
}
.flash-toast .flash-x:hover {
  opacity: 1;
}
.customers-add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.customers-add-head h2 {
  margin: 0;
}
#customers-add-panel[hidden] {
  display: none;
}
.customer-hero {
  margin-bottom: 12px;
}
.customer-hero h1 {
  margin: 0;
  font-size: 24px;
}
.customer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.customer-stat {
  margin: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.customer-stat b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.customer-stat small {
  font-size: 12px;
}
.customer-stat-warn b {
  color: var(--danger);
}
.customer-owe-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-weight: 600;
  cursor: pointer;
}
.customer-owe-check input {
  width: auto;
  margin: 0;
}
.pay-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.pay-row-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.pay-row-form {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  margin: 0;
}
.pay-process-form {
  margin-top: 16px;
  text-align: left;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.pay-process-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.pay-process-form input {
  width: 100%;
  margin-top: 6px;
}
.pay-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}
.pay-history-step {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}
.pay-history-step b {
  font-size: 12px;
  font-weight: 700;
}
.pay-history-step .muted {
  font-size: 11px;
}
.pay-history-step + .pay-history-step {
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.order-lines th.num,
.order-lines td.num {
  text-align: right;
  white-space: nowrap;
}
.order-totals {
  margin: 12px 0 24px auto;
  max-width: 280px;
  text-align: right;
}
.order-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0;
  font-size: 14px;
}
.order-totals-grand {
  font-weight: 800;
  font-size: 16px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
  color: var(--auth);
}
.order-filters {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.order-period-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
.order-period-btns .btn {
  padding: 5px 10px;
  font-size: 12px;
}
.order-custom-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: end;
  width: 100%;
}
.order-custom-dates[hidden] {
  display: none !important;
}
.order-custom-dates label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.order-custom-dates input[type=date] {
  display: block;
  margin-top: 4px;
  min-width: 10.5em;
}
.order-range-note {
  margin: 0 0 12px;
  font-size: 13px;
}
#customer-edit input[type=number]::-webkit-outer-spin-button,
#customer-edit input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#customer-edit input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
@media (max-width: 900px) {
  .customer-stats { grid-template-columns: 1fr 1fr; }
}
.quote-studio-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 !important;
  max-width: none !important;
}
.quote-studio-sheet > .quote-canvas,
.quote-studio > .quote-canvas,
.quote-new.quote-studio > .quote-canvas {
  flex: 1;
  min-height: 0;
}
@media (max-width: 900px) {
  .quote-studio-tools { grid-template-columns: 1fr; }
}
.quote-canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 2px 6px;
  min-height: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface);
  margin: 0 !important;
  max-width: none !important;
  flex-shrink: 0;
  order: 2;
}
.quote-canvas-toolbar .btn {
  min-width: 26px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.1;
  border-radius: 6px;
}
.quote-canvas-toolbar .btn.on {
  background: var(--auth);
  color: #fff;
  border-color: var(--auth);
}
.quote-zoom-label { min-width: 48px; font-variant-numeric: tabular-nums; }
.quote-zoom-hint { font-size: 10px; margin-left: 2px; opacity: .75; }
.quote-canvas-viewport {
  order: 1;
  position: relative;
  flex: 1;
  min-height: 480px;
  overflow: hidden;
  touch-action: none;
  cursor: default;
  background:
    linear-gradient(90deg, rgba(0,0,0,.03) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: #ececec;
}
html[data-theme="dark"] .quote-canvas-viewport {
  background-color: #121214;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
}
.quote-canvas-viewport.is-hand,
.quote-canvas-viewport.is-panning { cursor: grab; }
.quote-canvas-viewport.is-panning { cursor: grabbing; }
.quote-canvas-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.quote-canvas .a4 {
  width: 210mm !important;
  max-width: 210mm !important;
  min-width: 210mm;
  min-height: 297mm !important;
  margin: 0 !important;
  box-shadow: 0 10px 36px rgba(0,0,0,.18);
  overflow: hidden;
  box-sizing: border-box;
}

.login-page {
  min-height: 100vh; background: #fff; margin: 0;
  display: flex; flex-direction: column;
}
.login-head { padding: 40px 24px 12px; text-align: center; background: var(--auth); }
.login-head img {
  max-width: 220px;
}
.login-fold {
  height: 56px; background: var(--auth); position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 10px, 44px 100%, 0 100%);
}
.login-fold::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 56px;
  background: var(--auth-dark); clip-path: polygon(0 0, 0 100%, 100% 100%);
}
.login-box {
  max-width: 420px; margin: 0 auto; background: #fff; padding: 8px 28px 32px;
  width: 100%; flex: 1;
}
.login-box h1 { color: var(--auth); font-size: 32px; font-weight: 800; margin: 0 0 6px; }
.login-box p { color: var(--muted); margin: 0 0 18px; }
.login-box input { width: 100%; }
.login-box form p:last-child { margin: 22px 0 0; }
.login-box .btn { width: 100%; padding: 14px; }

@media print {
  body { background: #fff; }
  .sidebar, .admin-top, .admin-page-foot, .no-print, .toolbar, .thread, .flash, .nav-burger, .nav-scrim,
  .quote-canvas-toolbar { display: none !important; }
  body:not(.quote-print-open) .quote-print-modal { display: none !important; }
  body.quote-print-open .admin-shell,
  body.quote-print-open .sidebar,
  body.quote-print-open .admin-top,
  body.quote-print-open .admin-page-foot {
    display: none !important;
  }
  body.quote-print-open .quote-print-modal {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    background: #fff !important;
    z-index: auto !important;
  }
  body.quote-print-open .quote-print-modal-card {
    display: block !important;
    height: auto !important;
    background: #fff !important;
    overflow: visible !important;
  }
  body.quote-print-open .quote-print-modal-stage {
    overflow: visible !important;
    padding: 0 !important;
    display: block !important;
  }
  body.quote-print-open .quote-print-modal-bar,
  body.quote-print-open .quote-print-modal-x,
  body.quote-print-open .quote-print-anim {
    display: none !important;
  }
  body.quote-print-open .quote-print-modal-stage .a4,
  body.quote-print-open .quote-print-modal-stage .quote-print-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    max-width: none !important;
    pointer-events: auto !important;
  }
  .admin-shell { margin-left: 0; }
  .quote-canvas {
    border: 0 !important;
    background: transparent !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: block !important;
    flex: none !important;
  }
  .quote-canvas-viewport {
    overflow: visible !important;
    min-height: 0 !important;
    background: transparent !important;
    position: static !important;
  }
  .quote-canvas-world {
    position: static !important;
    transform: none !important;
  }
  .quote-canvas .a4,
  .a4 {
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    min-width: 0 !important;
  }
  @page { size: A4 portrait; margin: 12mm; }
}
@media (max-width: 900px) {
  .nav-burger { display: inline-flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 25;
  }
  .admin-shell { margin-left: 0; }
  .admin-page-foot { left: 0; }
  .admin-clock time { font-size: 13px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .a4 { width: auto; min-height: 0; padding: 16px; }
  .quote-canvas .a4 {
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 14mm !important;
  }
  .quote-canvas { min-height: 0; flex: 1; }
  .quote-canvas-viewport { min-height: 240px; }
  .quote-zoom-hint { display: none; }
}

html:has(body.pos-kiosk) { height: 100%; overflow: hidden; }
body.pos-kiosk {
  font-family: system-ui, "Segoe UI", sans-serif;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
body.pos-liquid-page {
  background: var(--surface);
  padding: 0;
  box-sizing: border-box;
}
html[data-theme="dark"] body.pos-liquid-page {
  background: var(--surface);
}
body.pos-liquid-page .admin-shell {
  margin-left: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--surface);
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-theme="dark"] body.pos-liquid-page .admin-shell {
  border-color: transparent;
  box-shadow: none;
}
body.pos-kiosk .admin-shell {
  margin-left: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body.pos-embed-frame {
  padding: 0;
  background: var(--bg, #f4f6f9);
}
body.pos-embed-frame .admin-shell {
  border-radius: 0;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--surface);
}
.settings-page {
  margin: 0;
}
.settings-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  min-height: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.settings-nav {
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  padding: 18px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-nav-brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
.settings-nav-brand .muted {
  margin: 4px 0 0;
  font-size: 13px;
}
.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.settings-nav-btn i {
  width: 18px;
  text-align: center;
  color: var(--muted);
  flex-shrink: 0;
}
.settings-nav-btn:hover {
  background: var(--hover);
}
.settings-nav-btn.on {
  background: var(--soft);
  color: var(--auth);
}
.settings-nav-btn.on i {
  color: var(--auth);
}
.settings-main {
  min-width: 0;
  padding: 20px 22px 28px;
  background: var(--surface);
}
.settings-panel[hidden] {
  display: none !important;
}
.settings-panel {
  display: block;
}
.settings-panel > .card:first-child,
.settings-panel > .muted:first-child {
  margin-top: 0;
}
html:has(body.settings-embed-frame) {
  height: 100%;
  overflow: hidden;
}
body.settings-embed-frame {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: var(--bg, #f4f6f9);
}
body.settings-embed-frame .admin-shell {
  margin-left: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: var(--surface);
}
body.settings-embed-frame .wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}
body.settings-embed-frame .settings-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.settings-embed-frame .settings-shell {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
body.settings-embed-frame .settings-nav {
  overflow: auto;
  padding-top: 20px;
  padding-bottom: 28px;
}
body.settings-embed-frame .settings-main {
  overflow: auto;
  padding: 20px 24px 40px;
}
.settings-page-embed {
  padding-top: 0;
}
/* ---- Customers: full-screen split (list left, hovered profile right) ---- */
body.cust-embed-frame,
body.cust-detail-embed {
  padding: 0;
  margin: 0;
  background: var(--surface);
}
body.cust-embed-frame .admin-shell,
body.cust-detail-embed .admin-shell {
  margin-left: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--surface);
  min-height: 0;
}
body.cust-embed-frame {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body.cust-embed-frame .admin-shell,
body.cust-embed-frame .wrap {
  height: 100%;
}
body.cust-embed-frame .wrap {
  max-width: none;
  padding: 0;
}
body.cust-detail-embed .wrap {
  max-width: none;
  padding: 0 4px 24px;
}
.cust-split {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 150px);
  min-height: 420px;
}
.cust-split.cust-split-embed {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  /* right padding clears the modal's fixed close X */
  padding: 16px 64px 16px 20px;
}
.cust-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.cust-left-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cust-left-head h1 {
  margin: 0;
}
.cust-left .flash {
  margin: 0;
}
.cust-search-form {
  margin: 0;
}
.cust-search-form input {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 12px;
  border: 2px solid var(--auth);
  border-radius: 8px;
  font-size: 15px;
  background: var(--surface);
  color: var(--ink);
}
.cust-search-form input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(253, 138, 1, 0.22);
}
.cust-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.cust-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}
.cust-row[hidden] {
  display: none;
}
.cust-row:hover,
.cust-row.on {
  border-color: var(--auth);
  background: var(--soft);
}
.cust-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cust-row-main b {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cust-row-main span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cust-row-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.cust-tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--auth);
}
.cust-tag-off {
  color: #b42318;
}
.cust-right {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.cust-detail-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  transition: opacity .12s;
}
.cust-detail-frame[hidden] {
  display: none;
}
.cust-detail-frame.is-loading {
  opacity: 0.55;
}
.cust-detail-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.cust-detail-empty[hidden] {
  display: none;
}
.cust-add {
  height: 100%;
  overflow: auto;
  padding: 16px 18px;
  box-sizing: border-box;
}
.cust-add[hidden] {
  display: none;
}
/* Vendor details: contact list. */
.vendor-dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}
.vendor-dl dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.vendor-dl dd {
  margin: 0;
}
#product-vendor-new {
  margin-top: 6px;
}
/* Order status split: wider list for totals + status, compact filters. */
.cust-split.ord-split {
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
}
.ord-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.ord-filters select {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.ord-range-note {
  margin: 0;
  font-size: 12px;
}
.ord-total {
  color: var(--auth);
  font-size: 14px;
}
.ord-status {
  font-weight: 700;
}
.ord-status-completed { color: #067647; }
.ord-status-cancelled { color: #b42318; }
.ord-status-pending,
.ord-status-confirmed { color: #b54708; }
@media (max-width: 760px) {
  .cust-split,
  .cust-split.cust-split-embed {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 40%) minmax(0, 1fr);
    padding-right: 16px;
  }
  .cust-split.cust-split-embed {
    padding-top: 60px;
  }
}
body.settings-embed-frame .pos-liquid-x {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 230;
}
@media (max-width: 860px) {
  .settings-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .settings-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
  }
  .settings-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .settings-nav-btn {
    width: auto;
    padding: 8px 12px;
  }
  body.settings-embed-frame .wrap,
  body.settings-embed-frame .settings-page,
  body.settings-embed-frame .settings-shell {
    overflow: auto;
  }
}
.pos-liquid-x {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 220;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}
.pos-liquid-x:hover {
  color: var(--auth);
  background: transparent;
  border-color: transparent;
}
.pos-liquid-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  box-sizing: border-box;
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.pos-liquid-modal[hidden] {
  display: none !important;
}
.pos-liquid-sheet {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface);
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-theme="dark"] .pos-liquid-modal {
  background: var(--surface);
}
html[data-theme="dark"] .pos-liquid-sheet {
  border-color: transparent;
  box-shadow: none;
}
.pos-liquid-sheet .pos-liquid-x {
  position: absolute;
  top: 12px;
  right: 12px;
}
.pos-liquid-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}
body.pos-kiosk .wrap.pos-wrap {
  flex: 1;
  min-height: 0;
  max-width: none;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wrap.pos-wrap { max-width: none; padding: 16px 18px 56px; }
.pos {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}
.pos-sidebar {
  width: 168px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: auto;
}
.pos-side-btn {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  box-sizing: border-box;
}
a.pos-side-btn {
  color: var(--ink);
  text-decoration: none;
}
.pos-held-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--auth);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.pos-held-badge[hidden] {
  display: none !important;
}
.pos-side-btn i {
  margin-top: 2px;
  color: var(--auth);
  width: 16px;
  text-align: center;
}
.pos-side-btn:hover,
.pos-side-btn.on {
  border-color: var(--auth);
  background: var(--soft);
}
.pos-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pos-panel-wide {
  width: min(560px, 100%);
}
.pos-held-hint {
  margin: 0 0 10px;
  padding: 0 2px;
}
.pos-held-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60vh, 480px);
  overflow: auto;
}
.pos-held-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.pos-held-row:hover,
.pos-held-row.on {
  border-color: var(--auth);
  background: #fff7f0;
}
/* Held receipts: list on the left, hovered receipt's details on the right. */
/* Full-screen panel: no backdrop gap, no rounded corners. */
.pos-panel.pos-panel-full {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
.pos-panel-card.pos-panel-held {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 20px;
}
.pos-held-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.pos-held-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.pos-held-search {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 12px;
  border: 2px solid var(--auth);
  border-radius: 8px;
  font-size: 15px;
  background: var(--surface);
  color: var(--ink);
}
.pos-held-search:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(253, 138, 1, 0.22);
}
.pos-held-split .pos-held-list {
  flex: 1;
  max-height: none;
  min-height: 0;
}
.pos-held-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
}
.pos-held-detail-empty {
  margin: auto;
  text-align: center;
}
.pos-held-detail-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pos-held-detail-head b {
  font-size: 16px;
  color: var(--ink);
}
.pos-held-detail-head span {
  font-size: 13px;
}
.pos-held-detail-items {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.pos-held-detail-items table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pos-held-detail-items th,
.pos-held-detail-items td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.pos-held-detail-items th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}
.pos-held-detail-items .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pos-held-detail-items td b {
  display: block;
  color: var(--ink);
  font-weight: 600;
}
.pos-held-detail-items td span {
  font-size: 11px;
}
.pos-held-detail-totals {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.pos-held-detail-totals div {
  display: flex;
  justify-content: space-between;
}
.pos-held-detail-grand {
  font-size: 16px;
  color: var(--auth);
}
.pos-held-detail-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.pos-liquid-x[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .pos-held-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .pos-held-split .pos-held-list {
    max-height: 34vh;
  }
}
.pos-held-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pos-held-main b {
  color: var(--ink);
  font-size: 14px;
}
.pos-held-main span {
  font-size: 13px;
}
.pos-held-row em {
  font-style: normal;
  font-weight: 800;
  color: var(--auth);
  white-space: nowrap;
}
.pos-held-banner {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7f0;
  border: 1px solid #f0c9a8;
  color: var(--ink);
  font-size: 13px;
}
.pos-held-banner i {
  color: var(--auth);
  margin-right: 6px;
}
.pos-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.pos-panel[hidden] { display: none; }
.pos-panel-card {
  width: min(520px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 20px 50px var(--shadow);
  padding: 16px 18px 18px;
}
.pos-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.pos-panel-head h2 {
  margin: 0;
  font-size: 18px;
}
.pos-panel-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}
.pos-panel-form label {
  display: block;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
}
.pos-panel-form input,
.pos-panel-form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}
.pos-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pos-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.pos-return-hits {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow: auto;
  margin: 0 0 10px;
}
.pos-return-hit {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.pos-return-hit:hover,
.pos-return-hit.on {
  border-color: var(--auth);
  background: var(--soft);
}
.pos-head {
  display: none;
}
.pos-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr);
  gap: 10px;
  flex-shrink: 0;
  /* Right padding clears the fixed .pos-liquid-x close button. */
  padding: 10px 64px 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.pos-top-scan,
.pos-top-cust {
  position: relative;
  min-width: 0;
}
.pos-top-scan .pos-search {
  display: block;
  margin: 0;
}
.pos-top-scan .pos-search input,
.pos-top-cust #pos-cust-q {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  border: 2px solid var(--auth);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  background: var(--surface);
  color: var(--ink);
}
.pos-top-scan .pos-search input:focus,
.pos-top-cust #pos-cust-q:focus {
  outline: none;
  border-color: var(--auth);
  box-shadow: 0 0 0 2px rgba(253, 138, 1, 0.22);
}
.pos-grid {
  display: none;
}
.pos-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  padding: 0;
}
.pos-left, .pos-right {
  margin: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pos-search { display: flex; gap: 8px; flex-shrink: 0; }
.pos-search input { flex: 1; min-width: 0; font-size: 16px; }
.pos-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  max-height: min(48vh, 360px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}
.pos-results[hidden] {
  display: none !important;
}
.pos-results > .muted {
  margin: 0;
  padding: 12px 14px;
}
.pos-hit {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f2f2f2;
  background: var(--surface);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.pos-hit:hover { background: var(--soft); }
.pos-hit-n { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pos-hit b { font-size: 12px; letter-spacing: .03em; color: var(--ink); }
.pos-hit span { font-size: 13px; color: var(--ink); }
.pos-hit em { font-style: normal; font-weight: 700; color: var(--auth); white-space: nowrap; }
.pos-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #f3f3f3;
  display: block;
}
.pos-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4c4c4;
  font-size: 16px;
}
.pos-cust {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.7fr) auto;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}
.pos-cust-search,
.pos-cust-type,
.pos-cust-new {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pos-cust-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pos-cust-input-wrap input {
  padding-right: 34px;
}
.pos-cust-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.pos-cust-clear:hover {
  color: var(--auth);
  background: transparent;
}
.pos-cust-clear[hidden] {
  display: none !important;
}
.pos-cust label {
  display: none;
}
.pos-cust select,
.pos-cust .btn {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 8px;
  line-height: 1.2;
  border: 1px solid var(--line);
  background: var(--surface);
}
.pos-cust-new .btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  min-width: 118px;
  font-weight: 700;
}
.pos-suggest {
  position: absolute;
  z-index: 32;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  width: min(420px, 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.pos-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--surface);
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
  border-bottom: 1px solid #f2f2f2;
}
.pos-suggest button:hover { background: var(--soft); }
.pos-new-cust {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 0;
  flex-shrink: 0;
}
.pos-new-cust[hidden] { display: none !important; }
.pos-new-cust input { flex: 1; min-width: 120px; height: 36px; }
.pos-cust-label {
  margin: 6px 0 0;
  font-size: 12px;
}
#pos-cust-label { flex-shrink: 0; }
.pos-lines {
  flex: 1;
  min-height: 0;
  margin: 0;
  border-top: 0;
  overflow: auto;
  background: var(--surface);
}
.pos-lines-empty {
  margin: 24px 16px;
}
.pos-line-block {
  border-bottom: 1px solid var(--line);
}
.pos-line-block:nth-child(even) .pos-line {
  background: var(--surface-2);
}
.pos-line-block.on {
  background: var(--auth);
}
.pos-line-block.on .pos-line {
  background: var(--auth);
  color: #fff;
}
.pos-line-block.on .pos-line-n b,
.pos-line-block.on .pos-line-sku,
.pos-line-block.on .pos-line-price,
.pos-line-block.on em {
  color: #fff;
}
.pos-line {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.6fr) 72px 88px 64px 96px 36px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 0;
  font-size: 13px;
  cursor: pointer;
}
.pos-line .pos-thumb { width: 40px; height: 40px; }
.pos-line-sku {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pos-line-n b { display: block; font-size: 13px; color: var(--ink); font-weight: 600; }
.pos-line-n small { color: var(--muted); }
.pos-line-price {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pos-line input { width: 100%; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); }
.pos-line-block.on .pos-line input {
  border-color: rgba(255,255,255,.55);
}
.pos input[type=number]::-webkit-outer-spin-button,
.pos input[type=number]::-webkit-inner-spin-button,
.pos-panel input[type=number]::-webkit-outer-spin-button,
.pos-panel input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pos input[type=number],
.pos-panel input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.pos-line em { font-style: normal; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pos-line-h {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  background: var(--surface-2);
  cursor: default;
  position: sticky;
  top: 0;
  z-index: 2;
}
.pos-line-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 12px;
  background: var(--auth);
  color: #fff;
}
.pos-line-tools .pos-thumb {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.25);
}
.pos-line-tools-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.pos-tool {
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.18);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pos-tool:hover {
  background: rgba(255,255,255,.28);
}
.pos-tool.danger {
  background: #fff;
  border-color: #fff;
  color: #b91c1c;
}
.pos-x {
  border: 0; background: transparent; color: inherit;
  font-size: 18px; cursor: pointer; line-height: 1; opacity: .75;
}
.pos-x:hover { opacity: 1; }
.pos-totals { border-top: 0; padding-top: 0; min-width: 220px; }
.pos-totals > div { display: flex; justify-content: space-between; gap: 24px; padding: 2px 0; font-size: 13px; }
.pos-totals b { font-size: 14px !important; color: var(--ink) !important; }
.pos-grand b { font-size: 18px !important; color: var(--auth) !important; }
.pos-amount-due {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
  margin: 6px 0 10px;
  color: var(--auth);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
}
.pos-amount-due b {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.pos-tender { margin: 10px 0; }
.pos-tender input { width: 100%; }
.pos-pay { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 0; justify-content: flex-end; }
.pos-pay .btn {
  flex: 0 1 auto;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 800;
}
.pos-pay #pos-hold,
.pos-pay #pos-clear,
.pos-pay #pos-pay-later {
  /* keep secondary btn look from .btn.secondary */
}
.pos-pay #pos-pay-now {
  min-width: 140px;
}
.pos-order-disc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}
.pos-order-disc > span { color: var(--ink); }
.pos-order-disc label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--muted);
}
.pos-order-disc input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pos-dock {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto;
  gap: 16px 24px;
  align-items: end;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
  box-shadow: 0 -8px 24px rgba(0,0,0,.06);
  z-index: 15;
}
.pos-dock-left { min-width: 0; }
.pos-dock-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: min(360px, 100%);
}
.pos-dock .pos-pay {
  margin: 0;
  flex-wrap: wrap;
  width: 100%;
}
.pos-dock .pos-pay .btn {
  min-width: 110px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
}
.pos-dock .pos-pay .btn[hidden] {
  display: none !important;
}
.pos-dock #pos-err { margin: 8px 0 0; }
.pos-held-banner {
  margin: 0;
  padding: 8px 14px;
  background: var(--soft);
  border-bottom: 1px solid #f0c9a8;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}
.pos-held-banner[hidden] { display: none !important; }
.pos-confirm {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pos-confirm[hidden] { display: none; }
.pos-confirm-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  text-align: center;
}
.pos-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fff7f0;
  color: var(--auth);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.pos-confirm-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--ink);
}
.pos-confirm-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.pos-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
}
.pos-confirm-actions .btn {
  flex: 1;
  padding: 12px;
  font-weight: 800;
}
.pos-dock .flash-toast {
  margin: 8px 0 0;
  text-align: left;
}
.pos-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
}
.pos-modal[hidden] { display: none; }
.pos-receipt-screen {
  position: fixed; inset: 0; z-index: 70;
  background: #f3f3f3;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.pos-receipt-screen[hidden] { display: none; }
.quote-print-modal-stage #pos-receipt {
  width: 100%;
  display: flex;
  justify-content: center;
}
.quote-print-modal-stage #pos-receipt .a4,
.quote-print-modal-stage #pos-receipt .quote-print-sheet {
  width: 210mm;
  max-width: min(210mm, calc(100vw - 32px));
  min-height: 297mm;
  margin: 0 auto;
  padding: 12mm;
  background: #fff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  box-sizing: border-box;
}
.quote-print-modal-bar .btn.secondary {
  background: rgba(255, 255, 255, 0.92);
}
.pos-pay-screen {
  position: fixed; inset: 0; z-index: 60;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.pos-pay-screen[hidden] { display: none; }
.pos-pay-close {
  position: absolute; top: 16px; right: 18px;
  width: 48px; height: 48px; border: 0;
  background: #f3f3f3; color: var(--ink);
  border-radius: 50%; font-size: 28px; line-height: 1;
  cursor: pointer;
}
.pos-pay-close:hover { background: #ececec; }
.pos-receipt-close { right: auto; left: 18px; }
.pos-pay-screen-inner {
  margin: auto;
  width: min(760px, 92vw);
  text-align: center;
  padding: 48px 16px 32px;
}
.pos-pay-screen-inner h1 { font-size: 28px; margin: 0 0 8px; }
.pos-pay-money {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
}
.pos-pay-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pos-pay-box {
  background: #f7f7f7;
  border-radius: 16px;
  padding: 16px 14px;
  text-align: center;
}
.pos-pay-box span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.pos-pay-box b {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  word-break: break-word;
}
.pos-pay-box-full b { color: var(--auth); }
.pos-cash-form {
  margin-top: 28px;
  text-align: left;
  background: #f7f7f7;
  border-radius: 14px;
  padding: 18px;
}
.pos-cash-form[hidden] { display: none; }
.pos-cash-form label { font-weight: 700; display: block; margin-bottom: 6px; }
.pos-cash-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.pos-cash-toggle button {
  border: 0;
  background: #fff;
  color: var(--ink);
  padding: 14px 12px;
  font-size: 18px;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
}
.pos-cash-toggle button.on {
  background: var(--ink);
  color: #fff;
}
.pos-cash-eq { font-weight: 700; margin: 8px 0; }
.settings-rate {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}
.settings-rate label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.settings-rate input { min-width: 160px; }
.pos-cash-form input {
  width: 100%;
  font-size: 28px;
  font-weight: 800;
  padding: 12px 14px;
  text-align: center;
}
.pos-cash-form .btn { width: 100%; margin-top: 14px; padding: 16px; font-size: 18px; font-weight: 800; }
.pos-cash-form .btn[hidden] { display: none; }
.pos-cash-bill {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 8px;
  font-size: 16px;
}
.pos-cash-bill span { color: var(--muted); }
.pos-cash-change {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
}
.pos-cash-change span { font-weight: 700; color: var(--muted); }
.pos-cash-change b { font-size: 32px; color: var(--auth); }
.pos-cash-change em { font-style: normal; font-size: 26px; font-weight: 800; }
.pos-cash-short { color: var(--danger); font-weight: 700; margin-top: 8px; }
.pos-receipt {
  margin: 56px auto 12px;
  width: 80mm;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 160px);
  overflow: auto;
  text-align: left;
  background: #fff;
  color: #111;
  font: 13px/1.3 "Segoe UI", system-ui, sans-serif;
  padding: 8px 8px 12px;
  border: 1px dashed #d4d4d4;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.pos-receipt h2 { display: none; }
.pos-ticket-brand {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .12em;
  margin: 0 0 4px;
}
.pos-ticket-logo {
  display: block;
  margin: 0 auto 8px;
  max-width: 72mm;
  max-height: 28mm;
  width: auto;
  height: auto;
  object-fit: contain;
}
.pos-ticket-meta, .pos-ticket-foot {
  text-align: center;
  font-size: 12px;
  margin: 0 0 8px;
}
.pos-ticket-line {
  padding: 5px 0;
  border-bottom: 1px dashed #bbb;
}
.pos-ticket-name {
  font-weight: 700;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.pos-ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-top: 2px;
}
.pos-ticket-row b { font-weight: 700; white-space: nowrap; }
.pos-ticket-tot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  padding-top: 8px;
}
.pos-ticket-mix { text-align: center; margin: 8px 0; font-weight: 700; }
.pos-receipt-cash { margin: 8px 0; text-align: center; }
.pos-receipt-change {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
}
.pos-receipt-change b { font-size: 22px; color: var(--ink); }
.pos-receipt-change em { font-style: normal; font-size: 18px; font-weight: 800; }
.pos-receipt-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px 16px 16px;
}
.pos-receipt-actions .btn { min-width: 110px; }
.pos-pay-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 18px;
  margin-top: 28px;
  align-items: center;
}
.pos-pay-type {
  padding: 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  position: relative;
}
.pos-pay-type:hover { filter: none; transform: scale(1.06); }
.pos-pay-type:disabled { opacity: 0.6; cursor: wait; transform: none; }
.pos-pay-type.on {
  filter: none;
  box-shadow: none;
  outline: 3px solid var(--auth);
  outline-offset: 6px;
}
.pos-pay-type:has(.pos-pay-type-icon) span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.pos-pay-type-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  display: block;
}
.settings-pay-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: #f3f3f3;
  padding: 4px;
  display: block;
}
.settings-pay-add input[type=file],
.settings-pay-row input[type=file] { max-width: 220px; }
.settings-pay-add { margin: 10px 0 14px; }
.settings-printer-modes { display: flex; gap: 18px; margin: 10px 0; }
.settings-lan { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.settings-lan[hidden] { display: none; }
.settings-lan label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.settings-lan input { min-width: 160px; }
.settings-a4-help,
.settings-thermal-block { margin-top: 10px; }
.settings-thermal-block[hidden],
.settings-a4-help[hidden] { display: none !important; }
.settings-token-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin: 12px 0;
}
.settings-token-wrap label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
}
.settings-token-wrap input {
  min-width: 280px;
  font-family: Consolas, "Courier New", monospace;
}
.settings-token { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
.settings-token label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.settings-token input { min-width: 280px; font-family: Consolas, "Courier New", monospace; }
.settings-receipt-logo {
  display: block;
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
  margin: 0 0 12px;
  background: #f3f3f3;
  padding: 8px;
  border-radius: 8px;
}
.settings-saving {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 25, 23, 0.35);
  backdrop-filter: blur(2px);
}
.settings-saving[hidden] {
  display: none !important;
}
.settings-saving-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 12px 40px var(--shadow);
}
.settings-saving-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--line);
  border-top-color: var(--auth);
  border-radius: 50%;
  animation: settings-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes settings-spin {
  to { transform: rotate(360deg); }
}
html.settings-is-saving,
html.settings-is-saving body {
  cursor: wait;
}
.settings-pay-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.settings-pay-row input[name=name] { min-width: 160px; }
.settings-pay-del { display: inline-block; margin-left: 6px; }
.settings-active { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pos-rcpt { width: 100%; text-align: left; }
.pos-rcpt td, .pos-rcpt th { border: 0; padding: 6px 0; }
.pos-rcpt td:last-child, .pos-rcpt th:last-child { text-align: right; }
@media (max-width: 900px) {
  .pos-topbar {
    grid-template-columns: 1fr;
    padding: 10px 60px 10px 12px;
  }
  .pos {
    flex-direction: column;
  }
  .pos-sidebar {
    width: 100%;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
  }
  .pos-side-btn {
    flex: 1;
    align-items: center;
    padding: 10px 8px;
    font-size: 12px;
  }
  .pos-dock {
    grid-template-columns: 1fr;
    padding: 10px 12px 12px;
  }
  .pos-dock-right {
    align-items: stretch;
    min-width: 0;
  }
  .pos-amount-due {
    justify-content: space-between;
  }
  .pos-dock .pos-pay { flex-wrap: wrap; }
  .pos-cust {
    grid-template-columns: 1fr 1fr;
  }
  .pos-cust-new {
    grid-column: 1 / -1;
  }
  .pos-line {
    grid-template-columns: 72px minmax(0, 1fr) 56px 64px 52px 72px 28px;
    gap: 4px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .pos-panel-row { grid-template-columns: 1fr; }
}

.report-group {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 10px;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.report-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
}
.report-card:hover { border-color: var(--auth); }
.report-card i { color: var(--auth); width: 22px; text-align: center; }
.report-card b {
  display: block;
  font-size: 15px !important;
  color: var(--ink) !important;
  font-weight: 700;
}
.report-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}
.report-table-wrap { overflow: auto; background: #fff; border-radius: 10px; }
.report-table { margin: 0; }
.report-total td { font-weight: 800; background: #fff7f0; }
.report-print { background: #fff; }
.report-print-bar { padding: 12px 16px; display: flex; gap: 8px; }
.report-logo { max-width: 132px; height: auto; }
.report-meta { text-align: right; font-size: 12px; color: var(--muted); }
.report-meta h2 { margin: 0 0 6px; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; }
.report-a4 { padding-top: 12mm; }
.quote-pdf .quote-pdf-sheet {
  margin: 16px auto;
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
}
.quote-pdf .q-notes-print {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
}
@media print {
  .report-print-bar { display: none !important; }
  body.report-print .a4,
  body.quote-pdf .a4 {
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-height: 0 !important;
    padding: 12mm !important;
  }
  thead { display: table-header-group; }
  tr { page-break-inside: avoid; }

  /* Builder Print A4: flatten editable controls to match PDF layout */
  .a4 input,
  .a4 select,
  .a4 textarea {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    color: inherit !important;
    font: inherit !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.3 !important;
  }
  .a4 .q-disc {
    display: inline-flex;
    gap: 4px;
    height: auto;
  }
  .a4 .q-disc .dmode,
  .a4 .q-disc .dval {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
  }
  .a4 .q-x,
  .a4 .q-loc-toggle { display: none !important; }
  .a4 .q-loc-print-only { display: inline !important; }
  .a4 .q-line-end { justify-content: flex-start; }
  .a4 .q-expiry input[type=date] {
    border: 0 !important;
    padding: 0 !important;
    font-weight: 700;
  }
  .a4 label { margin-top: 12px; }
}

.settings-keep ul, .card ul { margin: 8px 0 0; padding-left: 18px; }
.settings-keep h2, .card h2 { font-size: 16px; margin: 0 0 8px; }
.settings-table { margin: 12px 0; }
.settings-table td:first-child { width: 36px; }
.settings-actions { align-items: flex-end; }
.settings-actions label { margin: 0; }
.settings-actions input[type=text] { min-width: 220px; }
.settings-backup label { margin-top: 8px; }
.settings-restore { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.settings-danger h3 { margin: 16px 0 6px; font-size: 15px; }
.wipe-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 8px; }
.wipe-action {
  border: 1px solid #f0b4ae;
  background: #fff8f7;
  border-radius: 10px;
  padding: 14px;
}
.wipe-action p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.wipe-action h3 { margin: 0 0 6px; }
.wipe-modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.wipe-modal[hidden] { display: none; }
.wipe-modal-card {
  background: #fff; border-radius: 12px; padding: 20px;
  width: min(480px, 100%); box-shadow: 0 16px 40px rgba(0,0,0,.2);
}
.wipe-modal-card h2 { margin: 0 0 8px; color: var(--danger); }
.wipe-modal-card label { margin-top: 12px; }
.wipe-modal-card input[type=text] { width: 100%; }
.wipe-check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.wipe-modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 800px) {
  .wipe-actions { grid-template-columns: 1fr; }
}

.quote-hits { margin-top: 8px; max-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.quote-hit {
  display: flex; gap: 8px; align-items: center; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 10px; cursor: pointer; width: 100%;
}
.quote-hit:hover { background: #fff7f0; }
.quote-hit b { font-size: 12px; min-width: 64px; }
.quote-hit span { flex: 1; min-width: 0; font-size: 13px; }
.quote-hit em { font-style: normal; font-weight: 700; color: var(--auth); white-space: nowrap; }
.quote-picked { margin: 10px 0 0; }
.quote-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.quote-add-row input[type=search] { flex: 1; min-width: 180px; }
.quote-new hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.quote-new-tools { max-width: 210mm; margin: 16px auto; }
.a4 .q-disc {
  display: flex;
  gap: 4px;
  align-items: stretch;
  max-width: 100%;
  min-width: 0;
  height: 28px;
}
.a4 .q-disc .dmode {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  flex: 0 0 42px;
  margin: 0;
  padding: 0 2px;
  height: 28px;
}
.a4 .q-disc .dval {
  width: auto;
  flex: 1;
  min-width: 0;
  margin: 0;
  height: 28px;
}
.a4 .q-thumb {
  width: 36px;
  height: 36px;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}
.perm-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}
.perm-grid label:has(input:checked) {
  border-color: var(--auth);
  background: #fff7f0;
}
.staff-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.staff-split { display: grid; grid-template-columns: 1.4fr .9fr; gap: 14px; align-items: start; }
.badge-on { color: #157347; font-weight: 700; }
.badge-off { color: #b02a37; font-weight: 700; }
@media (max-width: 960px) {
  .staff-split { grid-template-columns: 1fr; }
}

.po-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--ink);
}
.po-status.po-pending { background: #fff7ed; color: #c2410c; }
.po-status.po-confirmed { background: #eff6ff; color: #1d4ed8; }
.po-status.po-received { background: #ecfdf3; color: #067647; }
.po-status.po-cancelled { background: #fef3f2; color: #b42318; }
html[data-theme="dark"] .po-status.po-pending { background: #431407; color: #fdba74; }
html[data-theme="dark"] .po-status.po-confirmed { background: #1e3a8a; color: #93c5fd; }
html[data-theme="dark"] .po-status.po-received { background: #052e1c; color: #6ee7b7; }
html[data-theme="dark"] .po-status.po-cancelled { background: #450a0a; color: #fca5a5; }
.po-status-card { margin-bottom: 14px; }
.po-form .card h2 { font-size: 16px; }

.q-photo-col { width: 56px; }
.q-loc-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.q-loc-toggle::after {
  content: " ⇄";
  font-weight: 600;
  opacity: .55;
  font-size: .85em;
}
.q-loc-print-only { display: none; }
@media print {
  .q-loc-toggle { display: none !important; }
  .q-loc-print-only { display: inline; }
}

.quote-print-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 9999 !important;
  background: #3a3f46;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.quote-print-modal[hidden] { display: none !important; }
.quote-print-modal-card {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #3a3f46;
  overflow: hidden;
}
.quote-print-modal-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 56px 16px 88px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}
.quote-print-modal-stage .quote-print-sheet,
.quote-print-modal-stage .a4 {
  width: 210mm;
  max-width: min(210mm, calc(100vw - 32px));
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  box-sizing: border-box;
}
.quote-print-modal-stage .q-print-val {
  font: inherit;
  color: inherit;
  display: inline;
}
.quote-print-modal-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45) 35%);
  pointer-events: none;
}
.quote-print-modal-bar .btn {
  pointer-events: auto;
  min-width: 160px;
}
.quote-print-modal-x {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.quote-print-modal-x:hover,
.quote-print-modal-x:focus-visible {
  background: var(--auth);
  color: #fff;
}
.quote-print-anim {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 24, 30, 0.72);
  backdrop-filter: blur(2px);
}
.quote-print-anim[hidden] { display: none !important; }
.quote-print-anim-box {
  text-align: center;
  color: #fff;
}
.quote-print-anim-text {
  margin: 18px 0 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
}
.hw-printer {
  width: 140px;
  margin: 0 auto;
  position: relative;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}
.hw-printer-top {
  height: 18px;
  margin: 0 18px;
  background: #cfd6df;
  border-radius: 8px 8px 0 0;
}
.hw-printer-slot {
  position: relative;
  height: 14px;
  margin: 0 10px;
  background: #1f2937;
  border-radius: 3px;
  overflow: hidden;
  z-index: 2;
}
.hw-printer-paper {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 72px;
  height: 90px;
  margin-left: -36px;
  background:
    repeating-linear-gradient(
      180deg,
      #fff 0 10px,
      #eef2f7 10px 12px
    );
  border: 1px solid #d6dde6;
  border-radius: 2px;
  transform-origin: top center;
  animation: hw-paper-out 1.4s ease-in-out infinite;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.hw-printer-body {
  position: relative;
  height: 70px;
  background: linear-gradient(180deg, #f4f6f8, #d7dde5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px;
  z-index: 3;
}
.hw-printer-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: hw-print-blink 1s ease-in-out infinite;
}
.hw-printer-btn {
  width: 18px;
  height: 10px;
  border-radius: 4px;
  background: #9aa6b2;
}
.hw-printer-tray {
  height: 10px;
  margin: 0 22px;
  background: #b8c0cb;
  border-radius: 0 0 6px 6px;
}
@keyframes hw-paper-out {
  0% { transform: translateY(-8px) scaleY(0.15); opacity: 0.4; }
  35% { transform: translateY(8px) scaleY(0.55); opacity: 1; }
  70% { transform: translateY(42px) scaleY(1); opacity: 1; }
  100% { transform: translateY(70px) scaleY(1); opacity: 0; }
}
@keyframes hw-print-blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); opacity: 1; }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); opacity: 0.7; }
}
body.quote-print-open {
  overflow: hidden !important;
}
.q-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 14px;
}
.q-thumb-empty { border: 1px solid var(--line); }
.quote-hit .q-thumb { width: 40px; height: 40px; }
@media print {
  .q-thumb { width: 36px; height: 36px; }
}
tr.row-highlight > td {
  background: var(--soft) !important;
  box-shadow: inset 3px 0 0 var(--auth);
}
@keyframes row-flash {
  0% { background: var(--soft); }
  100% { background: transparent; }
}

/* Dark mode: remap remaining light surfaces without touching print/A4 whites */
html[data-theme="dark"] .bubble:not(.me),
html[data-theme="dark"] .chat-compose,
html[data-theme="dark"] .chat-att-file,
html[data-theme="dark"] .dash-card,
html[data-theme="dark"] .pos-panel,
html[data-theme="dark"] .pos-cart,
html[data-theme="dark"] .pos-hit,
html[data-theme="dark"] .pos-suggest,
html[data-theme="dark"] .pos-suggest button,
html[data-theme="dark"] .pos-tender,
html[data-theme="dark"] .pos-pay-grid button,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .settings-pay-row,
html[data-theme="dark"] .settings-pay-add,
html[data-theme="dark"] .report-table-wrap,
html[data-theme="dark"] .report-print,
html[data-theme="dark"] .wipe-modal-card,
html[data-theme="dark"] .hw-confirm-card,
html[data-theme="dark"] .quote-hit,
html[data-theme="dark"] .perm-grid label,
html[data-theme="dark"] .login-box {
  background: var(--surface) !important;
  color: var(--ink);
}
html[data-theme="dark"] .chat-compose textarea,
html[data-theme="dark"] .pos-search,
html[data-theme="dark"] .pos-cust,
html[data-theme="dark"] .pos-pay-chip,
html[data-theme="dark"] .settings-lan,
html[data-theme="dark"] .settings-token,
html[data-theme="dark"] th,
html[data-theme="dark"] .pos-line-head,
html[data-theme="dark"] .pos-subhead {
  background: var(--surface-2) !important;
  color: var(--ink);
}
html[data-theme="dark"] .pos-hit:hover,
html[data-theme="dark"] .pos-suggest button:hover,
html[data-theme="dark"] .quote-hit:hover,
html[data-theme="dark"] .perm-grid label:has(input:checked),
html[data-theme="dark"] .chat-row.on,
html[data-theme="dark"] .report-total td {
  background: var(--soft) !important;
}
html[data-theme="dark"] .badge-on { color: #34d399; }
html[data-theme="dark"] .badge-off { color: #f87171; }
html[data-theme="dark"] .login-page { background: var(--bg); }
html[data-theme="dark"] .a4,
html[data-theme="dark"] .report-print .a4 {
  background: #fff !important;
  color: #1c1917;
}

/* Auto backup (on-premise POS2) */
.settings-auto-backup {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.settings-auto-backup h3 { margin: 0; font-size: 15px; }
.settings-auto-backup > label:not(.settings-active) {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
}
.settings-auto-backup input[type=time] { min-width: 140px; }
.settings-auto-backup input[type=text] { min-width: min(100%, 420px); width: 100%; max-width: 520px; }
.settings-auto-backup-now { margin-top: 4px; }
