/*
  Hanoun Sanitary Ware — back office
  Idea: the HANS mark on porcelain. White porcelain surfaces, chrome-grey lines,
  the logo's deep navy for actions, its gold only for small accents.
  Readability first: 16–17px text, tabular figures, 48px touch targets.
*/

/* ---------- fonts (IBM Plex Sans Arabic: one family for Arabic + Latin) ---------- */
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(/fonts/ar-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(/fonts/ar-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(/fonts/ar-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex'; font-weight: 700; font-display: swap; src: url(/fonts/ar-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(/fonts/la-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF, U+2212; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(/fonts/la-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF, U+2212; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(/fonts/la-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF, U+2212; }
@font-face { font-family: 'Plex'; font-weight: 700; font-display: swap; src: url(/fonts/la-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF, U+2212; }

/* ---------- tokens ---------- */
:root {
  --page: #f4f5f7;          /* cool porcelain */
  --surface: #ffffff;
  --sunk: #f8f9fa;          /* table heads, quiet fills */
  --ink: #15171c;
  --ink-2: #4a505c;         /* secondary text, still AA on white */
  --ink-3: #7b8290;         /* hints only */
  --line: #e1e4e9;          /* chrome hairline */
  --line-2: #c9ced6;        /* input borders */
  --cobalt: #232838;        /* brand navy, from the HANS logo: actions */
  --cobalt-ink: #131620;
  --cobalt-wash: #eef0f5;
  --gold: #a87b1f;          /* brand gold: small accents only (AA on white) */
  --gold-wash: #f8f1e1;
  --red: #b3261e; --red-wash: #fcebea;
  --green: #1d7348; --green-wash: #e7f3ec;
  --amber: #925400; --amber-wash: #fcf1df;
  --wa: #128c4b;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --sidebar: 256px; --topbar: 58px; --tabbar: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --focus: 0 0 0 3px rgba(168, 123, 31, .38);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 'Plex', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[dir=rtl] body { font-size: 16.5px; line-height: 1.65; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a.btn:hover, .side-nav a:hover, .tabbar a:hover, .list-item:hover, .stat:hover, .more-list a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 28px; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
[dir=rtl] h1, [dir=rtl] h2 { letter-spacing: 0; }
.num, bdi.num { unicode-bidi: isolate; direction: ltr; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.strong { font-weight: 600; }
.red { color: var(--red); } .green { color: var(--green); } .amber { color: var(--amber); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.gap16 { gap: 20px; }
.mt8 { margin-top: 6px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 20px; } .mt24 { margin-top: 28px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.i { width: 19px; height: 19px; }
[dir=rtl] .flip-rtl { transform: scaleX(-1); }

/* ---------- brand tile ---------- */
.tile { width: 40px; height: 40px; border-radius: 9px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 20px; line-height: 1; background: var(--cobalt); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18); }
.tile.lg { width: 56px; height: 56px; font-size: 27px; border-radius: 11px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar); background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.brand .shop { font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.brand .sub { font-size: 13px; color: var(--ink-2); }
.side-cta { padding: 4px 16px 14px; }
.side-nav { flex: 1; overflow-y: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; font-size: 15.5px; }
.side-nav a svg.i { color: var(--ink-3); }
.side-nav a:hover { background: var(--sunk); color: var(--ink); }
.side-nav a.active { background: var(--cobalt-wash); color: var(--cobalt-ink); font-weight: 600; }
.side-nav a.active svg.i { color: var(--gold); }
.side-nav .badge { margin-inline-start: auto; }
.side-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.side-user .who { color: var(--ink); font-weight: 600; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--sunk); border: 1px solid var(--line); color: var(--ink-2); display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.side-foot .row button { height: 38px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); display: flex; gap: 8px; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; font-weight: 500; padding: 0 12px; color: var(--ink-2); }
.side-foot .row button:hover { background: var(--sunk); color: var(--ink); }
.main { margin-inline-start: var(--sidebar); min-height: 100vh; }
.page { max-width: 1200px; margin: 0 auto; padding: 32px 36px 56px; }
.topbar, .tabbar { display: none; }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { margin-inline-start: 0; padding-top: var(--topbar); padding-bottom: calc(var(--tabbar) + var(--safe-b) + 12px); }
  .page { padding: 16px 16px 28px; }
  .topbar { display: flex; position: fixed; inset-inline: 0; top: 0; height: var(--topbar); z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); align-items: center; gap: 8px; padding-inline: 16px 10px; }
  .topbar .tile { width: 32px; height: 32px; font-size: 16px; border-radius: 7px; }
  .topbar .title { font-weight: 700; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar { display: grid; position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); height: calc(var(--tabbar) + var(--safe-b)); padding: 0 4px var(--safe-b); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12.5px; color: var(--ink-2); background: none; border: 0; cursor: pointer; position: relative; padding: 0; font-weight: 500; }
  .tabbar a.active, .tabbar button.active { color: var(--cobalt); font-weight: 600; }
  .tabbar a.active:not(.sell) svg.i { color: var(--gold); }
  .tabbar svg.i { width: 24px; height: 24px; }
  .tabbar .sell { align-self: center; height: 46px; margin: 0 4px; flex-direction: row; gap: 6px; background: var(--cobalt); color: #fff; border-radius: 23px; font-size: 15px; font-weight: 600; }
  .tabbar .sell svg.i { width: 20px; height: 20px; }
  .tabbar .sell.active { color: #fff; background: var(--cobalt-ink); }
  .tabbar .dot { position: absolute; top: 9px; inset-inline-end: calc(50% - 17px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
  .only-desktop { display: none !important; }
  h1 { font-size: 23px; }
}
@media (min-width: 900px) { .only-mobile { display: none !important; } }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head .sub { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 899px) {
  .page-head { margin-bottom: 16px; align-items: center; }
  .page-head.hide-title-mobile h1 { display: none; }
  .page-head.hide-title-mobile .titles { min-width: 0; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
}
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 15px; margin-bottom: 10px; cursor: pointer; background: none; border: 0; padding: 6px 0; }
.back-link:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 15.5px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
@media (hover: hover) { .btn:hover { background: var(--sunk); border-color: #b4bac4; } }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--cobalt-ink); border-color: var(--cobalt-ink); }
.btn.danger { color: var(--red); border-color: #e9b8b4; }
.btn.danger:hover { background: var(--red-wash); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.wa { color: #fff; background: var(--wa); border-color: var(--wa); font-weight: 600; }
.btn.wa:hover { background: #0e7a40; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--cobalt); }
.btn.ghost:hover { background: var(--cobalt-wash); }
.btn.sm { height: 38px; padding: 0 13px; font-size: 14.5px; }
.btn.lg { height: 52px; font-size: 17px; padding: 0 22px; }
.btn.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r-sm); display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn.wa { color: var(--wa); }
.icon-btn.wa:hover { background: var(--green-wash); }
.icon-btn.sm { width: 38px; height: 38px; }
.lang-btn { height: 38px; min-width: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; }

/* ---------- panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); min-height: 58px; }
.card-head h2 { flex: 1; display: flex; align-items: center; gap: 8px; }
.card-head a.small { font-weight: 500; }
.card-body { padding: 16px 20px; }
@media (max-width: 899px) { .card-pad { padding: 16px; } .card-head { padding: 12px 16px; min-height: 52px; } .card-body { padding: 14px 16px; } }
.grid { display: grid; gap: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.side-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1099px) { .two-col, .side-col { grid-template-columns: minmax(0, 1fr); } }

/* Key figures: one strip with ruled cells, not a pile of separate boxes */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stats > .stat, .stats > .card.stat { background: var(--surface); border: 0; border-radius: 0; box-shadow: 1px 0 0 var(--line), -1px 0 0 var(--line), 0 1px 0 var(--line); }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; position: relative; color: var(--ink); }
.stat .label { color: var(--ink-2); font-size: 14.5px; font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .foot { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.stat.accent-red .value { color: var(--red); }
.stat.accent-green .value { color: var(--green); }
.stat.link { cursor: pointer; }
@media (hover: hover) { .stat.link:hover { background: var(--sunk); } }
@media (max-width: 899px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > .stat:last-child:nth-child(odd), .stats .span-all-mobile { grid-column: 1 / -1; }
  .stat { padding: 14px 16px; }
  .stat .value { font-size: 23px; }
  .stat .label { font-size: 13.5px; }
  .stat .foot { font-size: 13px; }
}

.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 13px; font-weight: 600; background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.red { background: var(--red-wash); color: var(--red); border-color: transparent; }
.badge.green { background: var(--green-wash); color: var(--green); border-color: transparent; }
.badge.amber { background: var(--amber-wash); color: var(--amber); border-color: transparent; }
.badge.blue { background: var(--cobalt-wash); color: var(--cobalt-ink); border-color: transparent; }
.side-nav .badge.red { background: var(--red); color: #fff; height: 22px; min-width: 22px; justify-content: center; padding: 0 6px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r-sm); font-size: 15px; }
.alert.red { background: var(--red-wash); color: #7a1a14; }
.alert.amber { background: var(--amber-wash); color: #5e3700; }
.alert.green { background: var(--green-wash); color: #0f4a2d; }
.alert svg.i { margin-top: 2px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-text { font-size: 15px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 13.5px; color: var(--ink-2); }
.field .opt { font-weight: 400; color: var(--ink-3); }
.input, select.input, textarea.input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); outline: none; font-size: 16px; transition: border-color .12s, box-shadow .12s; min-width: 0; }
textarea.input { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }
.input::placeholder { color: var(--ink-3); }
select.input { padding-inline-end: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234a505c' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
[dir=rtl] select.input { background-position: left 13px center; }
.input:hover { border-color: #aab1bc; }
.input:focus { border-color: var(--cobalt); box-shadow: var(--focus); }
.input.money, .input.qty { font-variant-numeric: tabular-nums; }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.input-wrap .input { padding-inline-start: 30px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 599px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid.keep2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box svg.i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-inline-start: 44px; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; background: var(--surface); font-size: 15px; }
@media (hover: hover) { .check:hover { border-color: var(--line-2); background: var(--sunk); } }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cobalt); flex: none; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 14px; transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--cobalt); }
.switch input:checked + span::after { inset-inline-start: 21px; }
.switch input:focus-visible + span { box-shadow: var(--focus); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select.input { width: auto; min-width: 160px; }
@media (max-width: 899px) { .toolbar { gap: 8px; margin-bottom: 12px; } .toolbar select.input { flex: 1 1 calc(50% - 4px); min-width: 0; } .toolbar .search-box { flex-basis: 100%; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 15px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
@media (hover: hover) { .chip:hover { border-color: #aab1bc; color: var(--ink); } }
.chip.active { background: var(--cobalt-wash); color: var(--cobalt-ink); border-color: var(--cobalt); font-weight: 600; }
.chip.red.active { background: var(--red-wash); color: var(--red); border-color: var(--red); }

/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: start; font-weight: 600; color: var(--ink-2); font-size: 13.5px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--sunk); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
@media (hover: hover) { .table tbody tr.click:hover td { background: #f6f8fc; } }
.table .r { text-align: end; }
.table .c { text-align: center; }
.table td.r, .table th.r { font-variant-numeric: tabular-nums; }
.table tr.voided td { color: var(--ink-3); text-decoration: line-through; }
.table tr.voided td.keep { text-decoration: none; }
.table th:first-child, .table td:first-child { padding-inline-start: 20px; }
.table th:last-child, .table td:last-child { padding-inline-end: 20px; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); min-height: 68px; color: var(--ink); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; }
@media (hover: hover) { .list-item.click:hover { background: #f6f8fc; } }
.list-item.click:active { background: var(--cobalt-wash); }
.list-item .title { font-weight: 600; font-size: 16px; }
.list-item .meta { font-size: 14px; color: var(--ink-2); }
.list-item .end { text-align: end; flex: none; }
.list-item.voided .title, .list-item.voided .amount { text-decoration: line-through; color: var(--ink-3); }
@media (max-width: 899px) { .list-item { padding: 13px 16px; } }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 16px; }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-2); }
.empty svg.i { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: 15px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; }
.day-label { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 14px 20px 8px; background: var(--sunk); border-bottom: 1px solid var(--line); }
@media (max-width: 899px) { .day-label { padding: 10px 16px 6px; } }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar { width: 100%; max-width: 40px; background: #cfd3dd; border-radius: 4px 4px 0 0; min-height: 3px; }
.bar.today { background: var(--gold); }
.bar-col .lbl { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.bar-col .val { font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- sale screen ---------- */
.picker { position: relative; }
.picker-results { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 16px 40px rgba(21, 23, 28, .16); z-index: 15; max-height: 360px; overflow-y: auto; }
.picker-results .opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); min-height: 60px; }
.picker-results .opt:last-child { border-bottom: 0; }
.picker-results .opt:hover, .picker-results .opt.hl { background: var(--cobalt-wash); }
.picker-results .opt.disabled { opacity: .5; cursor: not-allowed; background: none; }
#ns-lines { container-type: inline-size; }
.line-item { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; background: var(--surface); }
.line-item .lname { font-weight: 600; font-size: 16px; }
.line-item .lhead { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-start; }
.line-item .field > label { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.line-item .ltotal { grid-column: 1 / -1; display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.line-item .ldel-wide { display: none; }
@container (min-width: 520px) {
  .line-item { grid-template-columns: minmax(150px, 1.3fr) 124px minmax(100px, 1fr) minmax(80px, .8fr); }
  .line-item .ltotal { grid-column: auto; border-top: 0; padding-top: 0; justify-content: flex-end; align-self: end; height: 48px; align-items: center; }
  .line-item .ltotal .lt-label { display: none; }
}
.qty-step { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); height: 48px; overflow: hidden; background: var(--surface); }
.qty-step button { width: 42px; height: 100%; border: 0; background: var(--sunk); cursor: pointer; font-size: 20px; color: var(--ink); flex: none; }
.qty-step button:hover { background: var(--line); }
.qty-step input { background: var(--surface); color: var(--ink); -webkit-appearance: none; appearance: none; border-radius: 0; padding: 0; width: 100%; min-width: 0; border: 0; text-align: center; height: 100%; outline: none; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; }
.summary-box { display: flex; flex-direction: column; gap: 12px; }
.sum-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 16px; }
.sum-row.big { font-size: 24px; font-weight: 700; padding-top: 12px; border-top: 1px solid var(--line); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.seg button { height: 40px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; font-weight: 500; font-size: 14.5px; color: var(--ink-2); padding: 0 6px; }
.seg button.active { background: var(--surface); color: var(--cobalt-ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(21,23,28,.08); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.cust-chosen { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--cobalt); background: var(--cobalt-wash); border-radius: var(--r-sm); }
.sticky-save { position: sticky; bottom: 0; }
@media (max-width: 899px) { .sticky-save { bottom: calc(var(--tabbar) + var(--safe-b)); background: var(--surface); padding: 10px 0 2px; } }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(21, 23, 28, .48); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(21, 23, 28, .25); animation: pop .16s ease-out; }
.modal.wide { max-width: 740px; }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.modal-head h2 { flex: 1; font-size: 20px; }
.modal-body { padding: 4px 20px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); justify-content: flex-end; }
@media (max-width: 599px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.narrow, .modal.wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; animation: up .2s ease-out; }
  .modal-foot { padding-bottom: calc(16px + var(--safe-b)); }
  .modal-foot .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.more-list { display: flex; flex-direction: column; }
.more-list a, .more-list button { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 4px; border: 0; background: none; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 17px; color: var(--ink); text-align: start; }
.more-list svg.i { color: var(--ink-2); }
.more-list a:last-child, .more-list button:last-child { border-bottom: 0; }
.more-list button.red, .more-list button.red svg.i { color: var(--red); }

/* ---------- toast ---------- */
#toast-root { position: fixed; inset-inline: 0; bottom: 28px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
@media (max-width: 899px) { #toast-root { bottom: calc(var(--tabbar) + var(--safe-b) + 14px); } }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-sm); box-shadow: 0 12px 30px rgba(21,23,28,.25); font-size: 15px; display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 32px); animation: up .2s; pointer-events: auto; }
.toast.err { background: var(--red); }
.toast svg.i { width: 19px; height: 19px; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background-color: var(--page);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; background-position: center top; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 28px 26px; box-shadow: 0 20px 50px rgba(21,23,28,.08); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-brand .shop { font-weight: 700; font-size: 18px; line-height: 1.25; }
.auth-brand .sub { font-size: 14px; color: var(--ink-2); }
.auth-top { display: flex; justify-content: flex-end; margin: -8px -6px 6px 0; }
.auth-card h1 { font-size: 24px; margin-bottom: 18px; }

/* ---------- documents / print ---------- */
.doc { background: var(--surface); }
.doc-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.doc-head .shopname { font-size: 21px; font-weight: 700; }
.doc-title { font-size: 19px; font-weight: 700; }
.doc table.table th { background: var(--sunk); }
.doc-totals { margin-inline-start: auto; width: 100%; max-width: 340px; }
.voided-banner { background: var(--red-wash); color: var(--red); padding: 12px 16px; border-radius: var(--r-sm); font-weight: 600; display: flex; gap: 8px; align-items: center; }
#print-root { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12.5pt; }
  #app, #modal-root, #toast-root { display: none !important; }
  #print-root { display: block !important; }
  .table th, .table td { padding: 6px 8px !important; }
  .table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- misc ---------- */
.perm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
@media (max-width: 599px) { .perm-grid { grid-template-columns: minmax(0, 1fr); } }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--cobalt); border-radius: 50%; animation: spin .7s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.loc-pill { font-size: 13px; background: var(--sunk); border: 1px solid var(--line); border-radius: 5px; padding: 1px 8px; color: var(--ink-2); white-space: nowrap; }
.loc-pill b { font-weight: 700; color: var(--ink); }
.qty-big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stock-loc { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.stock-loc:last-child { border-bottom: 0; }
.act-item { display: flex; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.act-item:last-child { border-bottom: 0; }
.act-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); }
.act-ico svg.i { width: 17px; height: 17px; }
.act-ico.sale { background: var(--cobalt-wash); color: var(--cobalt); border-color: transparent; }
.act-ico.pay { background: var(--green-wash); color: var(--green); border-color: transparent; }
.act-ico.stock { background: var(--amber-wash); color: var(--amber); border-color: transparent; }
.act-ico.del { background: var(--red-wash); color: var(--red); border-color: transparent; }
.act-text { flex: 1; min-width: 0; font-size: 15px; line-height: 1.5; }
.act-time { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 899px) { .act-item { padding: 12px 16px; } }
.statement-items { margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
@media (max-width: 899px) { .quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; } .quick .btn { padding: 0 10px; } }
.section-title { font-size: 18px; font-weight: 600; margin: 28px 0 12px; }
.table td.pname { min-width: 230px; }
.table td.faint { color: #b3b9c2; }

/* ---------- logo ---------- */
img.logo { width: 44px; height: 44px; border-radius: 10px; flex: none; display: block; object-fit: cover; }
img.logo.lg { width: 64px; height: 64px; border-radius: 14px; }
@media (max-width: 899px) { .topbar img.logo { width: 34px; height: 34px; border-radius: 8px; } }
.doc-brand { display: flex; gap: 12px; align-items: center; }
.doc-brand img { border-radius: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ---------- location ---------- */
.maps-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--gold); }
.maps-link svg.i { width: 17px; height: 17px; }
.auth-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pager:empty { display: none; }
.pager-nums { display: flex; gap: 4px; align-items: center; }
.pager-num { min-width: 44px; height: 44px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pager-num:hover { background: var(--surface); border-color: var(--line-2); }
.pager-num.active { background: var(--cobalt); color: #fff; }
.pager-gap { color: var(--ink-3); padding: 0 4px; }
.pager-info { color: var(--ink-2); font-size: 15px; font-weight: 500; }
.pager .btn:disabled { visibility: hidden; }

/* ---------- action rows ---------- */
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 899px) { .action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .action-row .btn { padding: 0 10px; } }

/* ---------- phones: iPhone notch / Samsung, roomy spacing ---------- */
@media (max-width: 899px) {
  .topbar { height: calc(var(--topbar) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(10px, env(safe-area-inset-right, 0px)); }
  .main { padding-top: calc(var(--topbar) + env(safe-area-inset-top, 0px)); }
  .page { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
  .two-col, .side-col, .stack.gap16 { gap: 16px; }
  .mt16 { margin-top: 16px; }
  .card-head h2 { font-size: 17px; }
  .page-head .actions .btn { min-width: 0; }
  .kv { grid-template-columns: minmax(0, auto) minmax(0, 1fr); }
}
@media (max-width: 380px) {
  body { font-size: 15.5px; }
  .page { padding-inline: 12px; }
  .stat { padding: 12px 13px; }
  .stat .value { font-size: 21px; }
  .tabbar a, .tabbar button { font-size: 11.5px; }
  .tabbar .sell { font-size: 14px; margin: 0 2px; }
  .btn { padding: 0 12px; font-size: 15px; }
  .seg button { font-size: 13.5px; }
}

/* never let anything push the page sideways on phones */
.main { overflow-x: clip; }
@media (max-width: 380px) { .chips.scroll { margin-inline: -12px; padding-inline: 12px; } }
.list-item .title { overflow-wrap: anywhere; }
.cust-chosen .small div + div { margin-top: 2px; }
@media (max-width: 899px) {
  .page-head .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .page-head .actions .btn.primary { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 899px) { .page-head .actions.cust-actions { grid-template-columns: 2fr 1fr 1fr; } }

/* ---------- expenses ---------- */
.month-nav { display: flex; align-items: center; gap: 8px; padding: 6px; }
.month-nav .month-label { flex: 1; text-align: center; font-size: 18px; font-weight: 700; }
.month-nav .icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.cat-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--sunk); border: 1px solid var(--line); color: var(--ink-2); }
.cat-ico svg.i { width: 20px; height: 20px; }
.meter { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; margin-top: 8px; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; background: var(--cobalt); border-radius: 4px; }
.cat-row:first-child .meter span { background: var(--gold); }
.act-ico.exp { background: var(--gold-wash); color: var(--gold); border-color: transparent; }
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cat-chip { min-height: 64px; padding: 8px 6px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: center; line-height: 1.25; }
.cat-chip svg.i { width: 22px; height: 22px; }
.cat-chip.active { border-color: var(--cobalt); background: var(--cobalt-wash); color: var(--cobalt-ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--cobalt); }
.cat-chip.active svg.i { color: var(--gold); }
@media (hover: hover) { .cat-chip:hover { border-color: #aab1bc; color: var(--ink); } }
.amount-input .input { height: 56px; font-size: 24px; font-weight: 700; }
.amount-input .prefix { font-size: 20px; }
@media (max-width: 1099px) { .exp-layout .exp-cats { order: -1; } }
@media (max-width: 899px) { .month-nav .month-label { font-size: 17px; } }

/* ---------- imports: shipments, cost sharing, suppliers ---------- */
a.list-item { color: inherit; }
.alert.blue { background: var(--cobalt-wash); color: var(--cobalt-ink); }
.mb12 { margin-bottom: 12px; }
.imp-tabs { max-width: 420px; }
.imp-tabs .num { font-weight: 500; margin-inline-start: 4px; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.btn.gold:hover { background: #8f6818; border-color: #8f6818; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.fee-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 12px; }
.fee-row label { font-size: 15px; font-weight: 500; color: var(--ink); }

#sh-lines { container-type: inline-size; }
.ship-line { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 14px; display: grid; gap: 14px; }
.ship-line.is-locked { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
[dir=rtl] .ship-line.is-locked { box-shadow: inset -3px 0 0 var(--gold); }
.sl-head { display: flex; gap: 10px; align-items: flex-start; }
.sl-head .lname { font-weight: 600; font-size: 16px; }
.sl-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; margin-top: 7px; }
.sl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.sl-grid .field > label, .sl-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.sl-static { height: 44px; display: flex; align-items: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.sl-share { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 8px; }
.is-locked .sl-share { background: var(--gold-wash); border-color: #ead9b2; }
.lock-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.lock-btn svg.i { width: 16px; height: 16px; }
.lock-btn.on { border-color: var(--gold); color: #6e4f10; background: #fff; font-weight: 600; }
.sl-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.sl-cell { display: grid; gap: 4px; min-width: 0; }
.sl-cell .amount { font-size: 17px; }
.input-wrap.sm .input { height: 40px; }
.amount.amber, .amber { color: var(--amber); }
@container (min-width: 620px) {
  .ship-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sl-head, [data-note] { grid-column: 1 / -1; }
  .sl-result { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
}
@container (max-width: 380px) { .sl-result { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .sl-result .sl-cell:nth-child(2) { grid-column: 1 / -1; order: 3; } }

/* the sharing bar sticks to the bottom so the total is always in view */
.alloc-bar { position: sticky; bottom: 0; z-index: 5; margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: 0 -6px 20px rgba(21, 23, 28, .06); display: grid; gap: 10px; }
.alloc-bar:empty { display: none; }
.alloc-bar.ro { position: static; box-shadow: none; }
@media (max-width: 899px) { .alloc-bar { bottom: calc(var(--tabbar) + var(--safe-b) + 6px); } }
.alloc-track { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--sunk); gap: 2px; }
.alloc-track span { min-width: 0; }
.alloc-track .gap { background: repeating-linear-gradient(45deg, var(--line) 0 4px, transparent 4px 8px); }
.alloc-track.over { outline: 2px solid var(--red); outline-offset: 1px; }
.alloc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alloc-text { flex: 1 1 240px; min-width: 0; }
.alloc-text svg.i { width: 16px; height: 16px; vertical-align: -3px; }
.alloc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alloc-head { display: flex; align-items: center; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; min-height: 32px; }
.alloc-head .btn.ghost { height: 32px; padding: 0 8px; margin-inline-end: -8px; font-size: 14px; }
.alloc-head .btn.ghost svg.i { width: 15px; height: 15px; }
@media (max-width: 599px) {
  .alloc-bar { padding: 10px 12px; gap: 8px; }
  .alloc-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .alloc-text { flex: none; width: 100%; }
  .alloc-text .strong { font-size: 15px; }
  .alloc-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; width: 100%; }
  .alloc-actions .btn { padding: 0 10px; height: 46px; }
  .fee-row { grid-template-columns: minmax(0, 1fr) 132px; }
}

/* profit ranking */
.rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--sunk); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.list-item:first-child .rank { background: var(--gold-wash); border-color: #ead9b2; color: #6e4f10; }
.meter.thin { height: 5px; margin-top: 7px; border: 0; max-width: 260px; }
.meter.thin span { background: var(--green); }
.profit-stat .label svg.i { width: 15px; height: 15px; vertical-align: -2px; }
@media (max-width: 1099px) { .ship-side { order: -1; } }

/* iOS Safari gives date inputs a fixed intrinsic width and centres the text; keep them inside their field */
input[type=date].input { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: start; line-height: 46px; }
input[type=date].input::-webkit-date-and-time-value { text-align: start; margin: 0; }
input[type=date].input::-webkit-calendar-picker-indicator { opacity: .6; }
html,body{overscroll-behavior-x:none}

html { color-scheme: light; }
.qty-step input:focus { background: var(--surface); color: var(--ink); }
.doc-phones { margin-top: 2px; }
.doc-phones .sep { margin: 0 6px; opacity: .5; }
.pdf-stage { position: fixed; left: -10000px; top: 0; width: 794px; padding: 36px 40px; background: #fff; color: #1b1e27; }
.pdf-stage .table-wrap { overflow: visible; }
.qty-step input::selection { background: #dfe3ec; color: var(--ink); }

/* ---------- invoice / statement document ---------- */
.inv { color: var(--ink); font-size: 14px; line-height: 1.45; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.inv-brand { display: flex; gap: 14px; align-items: center; }
.inv-brand img { border-radius: 12px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-shop { font-size: 22px; font-weight: 700; color: var(--cobalt); line-height: 1.2; }
.inv-shop2 { font-size: 15px; color: var(--ink-2); margin-top: 2px; }
.inv-titlebox { text-align: end; }
.inv-title { font-size: 30px; font-weight: 700; color: var(--cobalt); line-height: 1.1; }
.inv-meta { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 3px 14px; margin: 10px 0 0; font-size: 13px; }
.inv-meta dt { color: var(--ink-3); }
.inv-meta dd { margin: 0; font-weight: 600; text-align: end; }
.inv-rule { height: 3px; background: var(--cobalt); margin: 18px 0 22px; position: relative; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-rule span { position: absolute; inset-inline-start: 0; top: 0; height: 3px; width: 72px; background: var(--gold); }
.inv-void { display: inline-block; border: 2px solid var(--red); color: var(--red); font-weight: 700; padding: 4px 14px; border-radius: 6px; margin-bottom: 16px; }
.inv-parties { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.inv-by { text-align: end; }
.inv-label { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.inv-cust { font-size: 17px; font-weight: 700; }
.inv-sub { color: var(--ink-2); margin-top: 2px; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th { font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-align: start; padding: 10px 12px; border-bottom: 1.5px solid var(--cobalt); background: none; }
.inv-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv-table .r { text-align: end; }
.inv-table .n { width: 34px; color: var(--ink-3); padding-inline-end: 0; }
.inv-item { font-weight: 600; }
.inv-code { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.inv-bottom { display: flex; justify-content: space-between; gap: 24px; margin-top: 18px; flex-wrap: wrap; }
.inv-notes { flex: 1 1 220px; color: var(--ink-2); font-size: 13px; }
.inv-totals { flex: 0 1 320px; margin-inline-start: auto; }
.it-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 12px; color: var(--ink-2); }
.it-row.strong { color: var(--ink); }
.it-total { display: flex; justify-content: space-between; gap: 16px; padding: 12px; margin: 4px 0; background: var(--cobalt); color: #fff; border-radius: 6px; font-size: 18px; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.it-acc { border-top: 1px dashed var(--line-2); margin-top: 4px; padding-top: 10px; font-size: 13px; }
.inv-foot { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.inv-thanks { font-size: 14px; font-weight: 600; color: var(--cobalt); }
.inv-contact { display: flex; flex-direction: column; gap: 3px; text-align: end; }
.inv-contact span { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.inv-contact svg { width: 13px; height: 13px; color: var(--gold); }
.inv-contact .sep { font-style: normal; opacity: .45; }
@media (max-width: 599px) {
  .card .inv-head { flex-direction: column; gap: 14px; }
  .card .inv-titlebox { text-align: start; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; }
  .card .inv-title { font-size: 24px; }
  .card .inv-meta { margin: 0; }
  .card .inv-table .n { display: none; }
  .card .inv-table th, .card .inv-table td { padding: 10px 6px; }
  .card .inv-totals { flex-basis: 100%; }
  .card .inv-contact { text-align: start; }
  .card .inv-contact span { justify-content: flex-start; }
  .card .inv-by { text-align: start; }
}
@media print {
  .inv { font-size: 11pt; }
  .inv-table th, .inv-table td { padding: 8px 10px !important; }
  .inv-table th { background: none !important; }
}
