/* Threadline — clothing shop management
   Indigo chrome (denim dye), cool paper surface, marigold for the one action
   that matters on each screen. One typeface, tabular figures on every amount. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --ink-900: #101a2f;
  --ink-800: #16233f;
  --ink-700: #1f3157;
  --ink-600: #2b4270;
  --ink-400: #5b6b88;
  --ink-300: #8592a8;

  --paper: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --hairline: #e3e8ef;
  --hairline-strong: #ccd5e0;

  --marigold: #f0a202;
  --marigold-dark: #d08d00;
  --marigold-soft: #fdf3dd;

  --green: #157a4a;
  --green-soft: #e6f4ec;
  --red: #b3261e;
  --red-soft: #fdeceb;
  --amber: #a15c00;
  --amber-soft: #fdf1df;
  --teal: #0e7490;
  --teal-soft: #e2f3f7;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(16, 26, 47, .06);
  --shadow-pop: 0 12px 32px rgba(16, 26, 47, .16);

  --rail: 64px;
  --sidebar: 236px;
  --topbar: 60px;

  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink-800);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body.is-print { background: #fff; }

a { color: var(--ink-600); text-decoration: none; }
a:hover { color: var(--ink-800); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .98rem; }

.num, td.num, .amount { font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 2px;
  border-radius: 4px;
}

.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; flex: none; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail);
  background: var(--ink-900);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}

.rail__mark {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--marigold);
  color: var(--ink-900);
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px;
  margin-bottom: 10px;
}

.rail__item {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: #93a3bf;
  transition: background .15s, color .15s;
}
.rail__item:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail__item.is-active { background: var(--ink-600); color: #fff; }
.rail__spacer { flex: 1; }

.sidebar {
  width: var(--sidebar);
  background: var(--ink-800);
  color: #cdd7e6;
  position: fixed;
  inset: 0 auto 0 var(--rail);
  padding: 14px 12px 24px;
  overflow-y: auto;
  z-index: 35;
}

.sidebar__shop {
  padding: 8px 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 12px;
}
.sidebar__shop strong { display: block; color: #fff; font-size: .98rem; }
.sidebar__shop span { font-size: .78rem; color: #8b9bb7; }

.sidebar__group { margin-bottom: 16px; }
.sidebar__label {
  font-size: .72rem;
  color: #7d8daa;
  padding: 0 10px 6px;
  letter-spacing: .02em;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #cdd7e6;
  font-size: .9rem;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.is-active { background: var(--ink-600); color: #fff; font-weight: 500; }
.nav-item .ico { width: 18px; height: 18px; }
.nav-item__count {
  margin-left: auto;
  background: rgba(255,255,255,.14);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: .72rem;
}

.main {
  flex: 1;
  margin-left: calc(var(--rail) + var(--sidebar));
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar);
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-weight: 600; font-size: 1.02rem; margin-right: auto; }
.topbar__search {
  position: relative;
  width: min(360px, 40vw);
  margin-right: auto;
}
.topbar__actions { display: flex; align-items: center; gap: 8px; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ink-600);
  color: #fff;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 600;
}

.content { padding: 20px; flex: 1; }
.content--wide { max-width: none; }

.page-head {
  display: flex; align-items: flex-start; gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head__text { flex: 1; min-width: 200px; }
.page-head__text p { margin: 4px 0 0; color: var(--ink-400); font-size: .9rem; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-800);
  padding: 9px 14px;
  border-radius: var(--radius);
  font: inherit; font-size: .9rem; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-300); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn--primary {
  background: var(--marigold);
  border-color: var(--marigold);
  color: var(--ink-900);
  font-weight: 600;
}
.btn--primary:hover { background: var(--marigold-dark); border-color: var(--marigold-dark); }

.btn--dark { background: var(--ink-800); border-color: var(--ink-800); color: #fff; }
.btn--dark:hover { background: var(--ink-700); border-color: var(--ink-700); }

.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgba(16,26,47,.06); border-color: transparent; }

.btn--danger { color: var(--red); border-color: #f0c8c5; background: var(--red-soft); }
.btn--danger:hover { background: #fbe0de; }

.btn--sm { padding: 6px 10px; font-size: .84rem; }
.btn--lg { padding: 13px 20px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 8px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card__head h2, .card__head h3 { margin-right: auto; }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--hairline);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 320px; }
.grid--pos { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }

/* ---------- Today band (dashboard hero) ---------- */
.band {
  background: var(--ink-800);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.band__item { padding-right: 12px; border-right: 1px solid rgba(255,255,255,.12); }
.band__item:last-child { border-right: 0; }
.band__label { font-size: .78rem; color: #9fb0cc; margin-bottom: 4px; }
.band__value { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.band__value--accent { color: var(--marigold); }
.band__sub { font-size: .78rem; color: #9fb0cc; margin-top: 2px; }

.stat {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px;
}
.stat__label { font-size: .8rem; color: var(--ink-400); display: flex; align-items: center; gap: 6px; }
.stat__value { font-size: 1.28rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat__sub { font-size: .78rem; color: var(--ink-400); margin-top: 2px; }
.stat--good .stat__value { color: var(--green); }
.stat--bad .stat__value { color: var(--red); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
table.data th {
  text-align: left;
  font-weight: 500;
  font-size: .8rem;
  color: var(--ink-400);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-sub { color: var(--ink-400); font-size: .8rem; }

.style-code {
  font-weight: 600;
  letter-spacing: .01em;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 500;
  background: #eef1f6;
  color: var(--ink-600);
  white-space: nowrap;
}
.badge--good { background: var(--green-soft); color: var(--green); }
.badge--bad { background: var(--red-soft); color: var(--red); }
.badge--warn { background: var(--amber-soft); color: var(--amber); }
.badge--info { background: var(--teal-soft); color: var(--teal); }
.badge--accent { background: var(--marigold-soft); color: var(--amber); }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: .84rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--ink-700);
}
.field__hint { font-size: .78rem; color: var(--ink-400); margin-top: 4px; }
.field__error { font-size: .8rem; color: var(--red); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=search], input[type=url], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-size: .92rem;
  color: var(--ink-800);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px rgba(43, 66, 112, .12);
}
input.has-error, select.has-error { border-color: var(--red); }
textarea { min-height: 84px; resize: vertical; }
input[type=number] { font-variant-numeric: tabular-nums; }

.input-money { position: relative; }
.input-money span {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-400); font-size: .85rem; pointer-events: none;
}
.input-money input { padding-left: 44px; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink-600); }

.segmented {
  display: inline-flex;
  background: #eaeef4;
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}
.segmented a, .segmented button {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: .85rem;
  border: 0; background: transparent; cursor: pointer;
  color: var(--ink-600); font-family: inherit;
}
.segmented a.is-active, .segmented button.is-active {
  background: var(--surface);
  color: var(--ink-800);
  font-weight: 500;
  box-shadow: var(--shadow-card);
}

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 14px;
}
.filters .field { margin-bottom: 0; }
.filters input, .filters select { min-width: 150px; }

/* ---------- Smart select ---------- */
.smart { position: relative; }
.smart__input { width: 100%; }
.smart__panel {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  z-index: 60;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}
.smart__panel.is-open { display: block; }
.smart__option {
  padding: 9px 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #f1f4f8;
}
.smart__option:last-child { border-bottom: 0; }
.smart__option.is-active, .smart__option:hover { background: #f2f6fc; }
.smart__option strong { font-size: .92rem; font-weight: 600; }
.smart__option small { display: block; color: var(--ink-400); font-size: .78rem; }
.smart__meta { margin-left: auto; font-size: .78rem; color: var(--ink-400); text-align: right; }
.smart__create { color: var(--ink-600); font-weight: 500; background: var(--marigold-soft); }
.smart__empty { padding: 12px; color: var(--ink-400); font-size: .86rem; }
.smart__chosen {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.smart__chosen strong { font-size: .92rem; }
.smart__chosen small { color: var(--ink-400); }
.smart__clear { margin-left: auto; }

.swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(16,26,47,.2);
  flex: none;
}

/* ---------- Size grid: the signature component ---------- */
.size-grid { display: grid; gap: 12px; }

.colour-row {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.colour-row__head {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline);
}
.colour-row__name { font-weight: 600; font-size: .92rem; }
.colour-row__total { margin-left: auto; font-size: .82rem; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.colour-row__body {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px;
}

.size-chip {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  min-width: 68px;
  padding: 7px 9px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.size-chip__size { font-size: .78rem; color: var(--ink-400); font-weight: 500; }
.size-chip__qty { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.size-chip:hover { border-color: var(--ink-600); }
.size-chip.is-selected { border-color: var(--ink-800); background: var(--ink-800); color: #fff; }
.size-chip.is-selected .size-chip__size { color: #b9c6dc; }
.size-chip.is-low .size-chip__qty { color: var(--amber); }
.size-chip.is-out { opacity: .5; }
.size-chip.is-out .size-chip__qty { color: var(--red); }
.size-chip[disabled] { cursor: not-allowed; }

.size-input {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 76px;
}
.size-input label { font-size: .76rem; color: var(--ink-400); text-align: center; font-weight: 500; }
.size-input input {
  text-align: center;
  padding: 7px 4px;
  font-variant-numeric: tabular-nums;
}
.size-input input:not(:placeholder-shown) {
  border-color: var(--ink-600);
  background: #f4f8ff;
  font-weight: 600;
}

/* ---------- POS ---------- */
.pos-search { position: relative; margin-bottom: 14px; }
.pos-search input { padding: 13px 14px 13px 42px; font-size: 1rem; }
.pos-search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-300); }

.cart { position: sticky; top: calc(var(--topbar) + 16px); }
.cart__lines { max-height: 40vh; overflow-y: auto; }
.cart__line {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
}
.cart__line-main { flex: 1; min-width: 0; }
.cart__line-main strong { font-size: .9rem; }
.cart__line-main small { display: block; color: var(--ink-400); font-size: .78rem; }
.cart__qty { display: flex; align-items: center; gap: 4px; }
.cart__qty input { width: 52px; text-align: center; padding: 5px; }
.qty-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem; line-height: 1;
  color: var(--ink-600);
}
.qty-btn:hover { background: var(--surface-2); }

.totals { padding: 12px 14px; }
.totals__row { display: flex; justify-content: space-between; font-size: .9rem; padding: 3px 0; }
.totals__row span:last-child { font-variant-numeric: tabular-nums; }
.totals__row--grand {
  border-top: 1px solid var(--hairline);
  margin-top: 8px; padding-top: 10px;
  font-size: 1.15rem; font-weight: 600;
}
.totals__row--due { color: var(--red); font-weight: 600; }

/* ---------- Photos ---------- */
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.photo {
  position: relative;
  width: 96px; height: 96px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo__remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(16,26,47,.75);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
}
.photo-add {
  width: 96px; height: 96px;
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius);
  display: grid; place-items: center;
  gap: 2px;
  background: var(--surface-2);
  color: var(--ink-400);
  cursor: pointer;
  font-size: .76rem;
  text-align: center;
}
.photo-add:hover { border-color: var(--ink-600); color: var(--ink-600); }

.camera-stage {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
}
.camera-stage video, .camera-stage canvas { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(16, 26, 47, .45);
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
  z-index: 80;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
.modal__head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center;
}
.modal__head h3 { margin-right: auto; }
.modal__body { padding: 18px; }
.modal__foot {
  padding: 13px 18px;
  border-top: 1px solid var(--hairline);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface-2);
}

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 90;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  background: var(--ink-800);
  color: #fff;
  padding: 11px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  font-size: .9rem;
  display: flex; gap: 9px; align-items: flex-start;
}
.toast--success { background: var(--green); }
.toast--error { background: var(--red); }
.toast__close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .8; padding: 0; }

/* ---------- Empty and loading states ---------- */
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--ink-400);
}
.empty .ico { width: 34px; height: 34px; color: var(--hairline-strong); margin-bottom: 10px; }
.empty h3 { color: var(--ink-700); margin-bottom: 5px; }
.empty p { margin: 0 0 16px; font-size: .9rem; }

.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
  height: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 190px; display: block; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.chart-bar { flex: 1; background: var(--ink-600); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart-bar--muted { background: var(--hairline-strong); }

.meter { height: 6px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.meter__fill { height: 100%; background: var(--ink-600); }

/* ---------- Misc ---------- */
.flash-stack { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  display: flex; gap: 9px; align-items: flex-start;
  border: 1px solid transparent;
}
.alert--success { background: var(--green-soft); color: #0f5c38; border-color: #bde3cd; }
.alert--error { background: var(--red-soft); color: #8d1e18; border-color: #f2c9c6; }
.alert--info { background: var(--teal-soft); color: #0b5c72; border-color: #bfe3ec; }
.alert--warn { background: var(--amber-soft); color: var(--amber); border-color: #f3ddb8; }

.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: .86rem;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.pagination .is-current { background: var(--ink-800); color: #fff; border-color: var(--ink-800); }

.kbd {
  font-size: .72rem;
  padding: 1px 6px;
  border: 1px solid var(--hairline-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-400);
  font-family: inherit;
}

.list-split { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.list-split:last-child { border-bottom: 0; }
.list-split__main { flex: 1; min-width: 0; }
.list-split__main strong { font-size: .9rem; display: block; }
.list-split__main small { color: var(--ink-400); font-size: .78rem; }
.list-split__value { font-variant-numeric: tabular-nums; font-weight: 500; }

.muted { color: var(--ink-400); }
.small { font-size: .84rem; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--tight { gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }

.bottom-nav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid--sidebar, .grid--pos { grid-template-columns: minmax(0, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cart { position: static; }
}

@media (max-width: 900px) {
  :root { --sidebar: 236px; }
  .rail { display: none; }
  .sidebar {
    left: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-pop);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after {
    content: '';
    position: fixed; inset: 0;
    background: rgba(16,26,47,.4);
    z-index: 34;
  }
  .main { margin-left: 0; }
  .topbar__search { width: auto; flex: 1; }
  .content { padding: 14px; padding-bottom: 84px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .band__item { border-right: 0; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--hairline);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 45;
  }
  .bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: .68rem;
    color: var(--ink-400);
    padding: 4px 0;
  }
  .bottom-nav a.is-active { color: var(--ink-800); font-weight: 600; }
  .bottom-nav a.is-sell {
    color: var(--ink-900);
  }
  .bottom-nav a.is-sell .ico {
    background: var(--marigold);
    border-radius: 10px;
    padding: 5px;
    width: 30px; height: 30px;
  }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
  .content { padding: 12px; padding-bottom: 84px; }
  .card { border-radius: var(--radius); }
  table.data th, table.data td { padding: 9px 10px; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  .filters .field { width: 100%; }
  .modal { border-radius: var(--radius); }
  .toasts { left: 12px; right: 12px; bottom: 80px; max-width: none; }

  /* Tables become stacked cards on a phone */
  table.stacked thead { display: none; }
  table.stacked tbody tr {
    display: block;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    margin-bottom: 8px;
    padding: 4px 0;
  }
  table.stacked td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    padding: 6px 12px;
    text-align: right;
  }
  table.stacked td::before {
    content: attr(data-label);
    color: var(--ink-400);
    font-size: .8rem;
    text-align: left;
  }
  table.stacked td.num { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Print ---------- */
@media print {
  .no-print, .rail, .sidebar, .topbar, .bottom-nav, .toasts { display: none !important; }
  body { background: #fff; }
  .main { margin: 0; }
  .content { padding: 0; }
}
