/* Elux (Omer) web app, iPad 10 inch first. Look = Zagros Clothes: grey page, white round cards, blue #1540E5, Rudaw. */

@font-face {
  font-family: "Rudaw";
  src: url("/fonts/rudaw.ttf") format("truetype");
  font-display: swap;
}

:root {
  --blue: #1540E5;
  --green: #128A4E;
  --red: #D9291F;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --text: #101828;
  --muted: #667085;
  --label: #344054;
  --line: #D0D5DD;
  --head: #14171C;
  --radius: 20px;
  --pad: 20px;
  --bar-glass: rgba(255, 255, 255, 0.72);
  --bar-edge: rgba(255, 255, 255, 0.9);
  --bar-shadow: 0 10px 34px rgba(16, 24, 40, 0.14), 0 1px 3px rgba(16, 24, 40, 0.08);
  --pick: rgba(16, 24, 40, 0.07);
  /* Screen height. Checked 12/11/2026 on the iPad home-screen app: with the "default" status bar the page starts
     UNDER the clock, so 100dvh = the real page (1148 of 1180) and 100vh is 32 too tall (pushed the bar off the edge).
     The Xira fix (100vh) was for "black-translucent" only: do not bring it back here. */
  --app-h: 100dvh;
  --font: "Rudaw", -apple-system, "SF Pro Rounded", "SF Arabic", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #8EA6FF;
    --green: #2FD16E;
    --red: #FF5A5A;
    --bg: #0E1015;
    --card: #1A1D24;
    --text: #F3F5F9;
    --muted: #9AA3B2;
    --label: #D0D5DD;
    --line: #3A404C;
    --head: #2A2F39;
    --bar-glass: rgba(40, 44, 54, 0.72);
    --bar-edge: rgba(255, 255, 255, 0.08);
    --bar-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
    --pick: rgba(255, 255, 255, 0.1);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: var(--app-h);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { overflow: hidden; }
button, input { font-family: inherit; }
button { touch-action: manipulation; cursor: pointer; }

/* ---------- app frame ---------- */

.app {
  position: fixed;
  top: var(--app-top, 0px); right: 0; left: 0;
  height: var(--app-h);
  overflow: hidden;
}

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding:
    calc(env(safe-area-inset-top, 0px) + 14px)
    calc(env(safe-area-inset-right, 0px) + var(--pad))
    calc(env(safe-area-inset-bottom, 0px) + 110px)
    calc(env(safe-area-inset-left, 0px) + var(--pad));
}

/* every page title: size 21 bold (Zagros Clothes rule) */
.title {
  margin: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
}

/* ---------- bottom bar (like the iPhone's own glass bar in Zagros Clothes) ---------- */

.tabbar {
  position: absolute;
  left: 50%;
  bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) - 2px));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  height: 68px;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  border-radius: 999px;
  background: var(--bar-glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--bar-edge);
  box-shadow: var(--bar-shadow);
  z-index: 60;
  user-select: none;
  -webkit-user-select: none;
}

.tab {
  border: 0;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.tab svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab span {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.tab[aria-current="page"] {
  color: var(--blue);
  background: var(--pick);
}
.tab:active { transform: scale(0.96); }

/* ---------- sign-in ---------- */

.signin {
  position: fixed;
  top: var(--app-top, 0px); right: 0; left: 0;
  height: var(--app-h);
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.08);
  display: flex;
  flex-direction: column;
}
.brand {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  align-self: center;
  margin: 0 0 16px;
}
.card h1 { margin: 0 0 24px; font-size: 24px; font-weight: 700; text-align: center; }
.card label { font-size: 16px; font-weight: 700; color: var(--label); margin: 0 0 8px; }
.card input {
  height: 54px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0 16px;
  font-size: 18px;
  margin: 0 0 18px;
  outline: none;
  background: var(--card);
  color: var(--text);
}
.card input:focus { border-color: var(--blue); }
.card button {
  height: 56px;
  border: 0;
  border-radius: 14px;
  background: #1540E5;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
}
.card button:disabled { opacity: 0.55; }
.msg { min-height: 22px; margin: 0 0 14px; color: var(--red); font-size: 15px; text-align: center; }

/* ---------- shared bits ---------- */

.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}
.page-art { width: 40px; height: 40px; object-fit: contain; }

svg { flex: none; }

.debt-pill {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(217, 41, 31, 0.1);
  color: var(--red);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

/* ---------- window (sheet) ---------- */

.sheet-wrap {
  position: fixed;
  top: var(--app-top, 0px); right: 0; left: 0;
  height: var(--app-h);
  z-index: 50;
}
.sheet-back { display: none; }
/* the window covers the whole screen (Yusf 13/11/2026); the bottom bar stays on top of it and keeps working */
.sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: sheetIn 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.sheet-wrap.closing .sheet { animation: sheetOut 0.18s ease both; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes sheetOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(60px); } }
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-back, .sheet-wrap.closing .sheet, .sheet-wrap.closing .sheet-back { animation-duration: 0.01s; }
}

.sheet-head {
  flex: none;
  width: 100%;
  max-width: 1100px;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) calc(env(safe-area-inset-right, 0px) + var(--pad)) 10px calc(env(safe-area-inset-left, 0px) + var(--pad));
}
.sheet-head h2 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
}
.round, .round-space { width: 42px; height: 42px; flex: none; }
/* the X sits on the RIGHT in every window (Yusf 15/11/2026; Kurdish = right to left, so it goes FIRST); a back arrow
   sits right beside it; the title stays in the exact middle whatever is on the sides */
.sheet-head { position: relative; }
.sheet-head > .round[aria-label="داخستن"] { order: -2; }
.sheet-head > .round[aria-label="گەڕانەوە"] { order: -1; }
.sheet-head > .round-space { order: 1; }
.sheet-head > h2 {
  position: absolute; inset-inline: 0; bottom: 10px; height: 42px; line-height: 42px;
  padding: 0 110px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.round {
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.1);
}
.round svg, .field svg, .quick-btn svg, .big-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.cust-change svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* bottom room under the lists = the bar (68) + its gap from the edge */
:root { --bar-room: calc(max(14px, env(safe-area-inset-bottom, 0px) - 2px) + 68px + 16px); }
.sheet-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 760px;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px calc(env(safe-area-inset-right, 0px) + var(--pad)) 0 calc(env(safe-area-inset-left, 0px) + var(--pad));
}
.sheet-body.wide { max-width: 1100px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick.one { grid-template-columns: 1fr; }
.quick-btn {
  height: 56px;
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.08);
}
.quick-btn.blue { background: #1540E5; color: #fff; box-shadow: 0 6px 16px rgba(21, 64, 229, 0.3); }
.quick-btn:active, .big-btn:active, .cust-row:active { transform: scale(0.98); }

.field {
  flex: none;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1.2px solid var(--line);
  color: var(--muted);
}
.field:focus-within { border-color: var(--blue); }
.field img { width: 26px; height: 26px; object-fit: contain; }
.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}
.field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.field-msg { margin: -4px 4px 0; min-height: 20px; color: var(--red); font-size: 15px; font-weight: 700; }
.field.bad { border-color: var(--red); }

.cust-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 calc(-1 * var(--pad));
  padding: 2px var(--pad) var(--bar-room);
}
.cust-row {
  flex: none;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid transparent;
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  text-align: start;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
}
.cust-row img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.cust-row .name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-row.picked { border-color: var(--blue); }
.cust-row .tick { width: 24px; height: 24px; flex: none; color: var(--blue); fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-note { margin: 30px 0; text-align: center; color: var(--muted); font-size: 16px; font-weight: 700; }

.big-btn {
  height: 58px;
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1540E5;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(21, 64, 229, 0.3);
}

/* ---------- home boxes (Zagros Clothes look, more per row on the iPad) ---------- */

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  max-width: 1100px;
}
.home-box {
  aspect-ratio: 1;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
}
.home-box img { width: 76px; height: 76px; object-fit: contain; }
.home-box span { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.home-box:active { transform: scale(0.97); }

/* ---------- products step: squares (Yusf 13/11/2026) ---------- */

.prod-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  margin: 0 calc(-1 * var(--pad));
  padding: 4px var(--pad) 20px;
}
.prod {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;      /* keeps every square truly square, even with a long name */
  overflow: hidden;
  border: 2.5px solid transparent;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(16, 24, 40, 0.07);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.prod:active { transform: scale(0.97); }
.prod .ico {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(21, 64, 229, 0.1);
  color: var(--blue);
  margin-bottom: 2px;
}
.prod .ico svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.prod .pname {
  width: 100%;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod .price { font-size: 17px; font-weight: 700; color: var(--blue); direction: ltr; font-variant-numeric: tabular-nums; }
.prod .stock { font-size: 12.5px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.prod .stock.none { color: var(--red); }
.prod.on { border-color: #1540E5; background: rgba(21, 64, 229, 0.06); }
.prod .tick-dot {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1540E5;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}
.prod.on .tick-dot { display: flex; }
.prod .tick-dot svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.prod:disabled { opacity: 0.5; }

/* Done sits above the bottom bar */
.sheet-foot {
  flex: none;
  width: 100%;
  max-width: 1100px;
  align-self: center;
  padding: 10px calc(env(safe-area-inset-right, 0px) + var(--pad)) var(--bar-room) calc(env(safe-area-inset-left, 0px) + var(--pad));
  background: linear-gradient(to top, var(--bg) 80%, transparent);
}
.sheet-foot .big-btn { width: 100%; }

.count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #1540E5;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
}
.count.light { background: rgba(255, 255, 255, 0.25); }

/* ---------- sale page = Zagros Clothes sale page (Yusf 13/11/2026) ---------- */

.debt-pill.small { padding: 3px 10px; font-size: 13px; }

.sale-page { overflow: hidden; display: flex; padding-bottom: 0; }
.sale-wrap { flex: 1; min-height: 0; width: 100%; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; }
.sale-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--gap, 14px);
  margin: 0 calc(-1 * var(--pad));
  padding: 0 var(--pad) 8px;
}
.sale-main .page-head { margin: 0; flex: none; }
.sale-side {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0 var(--bar-room);
}
@media (min-width: 1000px) {
  /* iPad held sideways: goods on one side, money + Save on the other */
  .sale-wrap { flex-direction: row; gap: 20px; }
  .sale-side { width: 380px; padding-top: 56px; overflow-y: auto; }
}

.no-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(21, 64, 229, 0.1);
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.zcard {
  flex: none;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.zfield {
  height: 50px;
  border-radius: 13px;
  background: var(--card);
  border: 1.2px solid var(--hair);
}
:root { --hair: #E9EAEE; }
@media (prefers-color-scheme: dark) { :root { --hair: #2A2F39; } }

.cust-line { display: flex; gap: 10px; }
.cust-field { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 4px 0 0; }
.cust-open {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  text-align: start;
}
.cust-open img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.cust-open .cust-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-open .cust-name.empty { color: var(--muted); font-weight: 400; }
.clear-x { width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.clear-x svg { width: 21px; height: 21px; fill: var(--muted); stroke: var(--card); stroke-width: 2.4; stroke-linecap: round; }
.plus-btn { width: 50px; flex: none; display: flex; align-items: center; justify-content: center; padding: 0; }
.plus-btn img { width: 26px; height: 26px; }

.pay-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 15px;
  background: var(--bg);
}
.pay-switch button {
  flex: 1;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.pay-switch button.on[data-kind="cash"] { background: #1540E5; color: #fff; }
.pay-switch button.on[data-kind="debt"] { background: #D9291F; color: #fff; }

/* the goods table: black head, rows, «+ add product» */
.table-card {
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--hair);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.07);
}
.table-card.empty { flex: 1; min-height: 260px; }
.t-head {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--head);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.c-name { flex: 1; min-width: 0; }
.c-qty { width: 76px; text-align: center; flex: none; }
.c-price { width: 120px; text-align: center; flex: none; }
.c-total { width: 120px; text-align: center; flex: none; }
/* line total = qty x price (Yusf 13/11/2026) */
.line .l-total {
  width: 120px;
  flex: none;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
  direction: ltr;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-wrap { position: relative; border-bottom: 1px solid var(--hair); overflow: hidden; }
.line-bin {
  position: absolute;
  inset: 0;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  direction: ltr;
  opacity: 0;
}
.line-bin svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card);
  touch-action: pan-y;
}
.line.snap { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.line .l-art {
  width: 46px; height: 46px; flex: none;
  border-radius: 12px;
  background: rgba(21, 64, 229, 0.1);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.line .l-art svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.line .l-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.line .l-name { max-width: 100%; font-size: 15px; font-weight: 700; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.unit-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(21, 64, 229, 0.1);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.unit-pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.num-box {
  height: 46px;
  border-radius: 11px;
  border: 1.2px solid var(--hair);
  background: var(--card);
  color: var(--text);
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  font-family: -apple-system, "SF Pro Rounded", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
}
.num-box:focus { border-color: var(--blue); border-width: 1.6px; }
.line .num-box.q { width: 76px; flex: none; }
.line .num-box.p { width: 120px; flex: none; }

.add-row {
  height: 58px;
  border: 0;
  background: rgba(21, 64, 229, 0.06);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}
.add-row img { width: 22px; height: 22px; }
.table-card.empty .add-row {
  flex: 1;
  background: transparent;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}
.table-card.empty .add-row img { width: 40px; height: 40px; }
.table-card.empty .add-row::before { content: none; }
.table-card.empty .add-row { position: relative; }
.table-card.empty .add-row span, .table-card.empty .add-row img { position: relative; z-index: 1; }
.table-card.empty .add-row::after {
  content: "";
  position: absolute;
  width: 150px; height: 150px;
  border-radius: 24px;
  background: rgba(21, 64, 229, 0.06);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* money card */
.money { gap: 12px; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.m-row > span { font-size: 16px; font-weight: 700; }
.m-row .num-box { width: 150px; height: 50px; font-size: 18px; border-radius: 13px; }
.m-total { font-size: 23px; font-weight: 700; color: var(--blue); }
.m-rest { font-size: 19px; font-weight: 700; color: var(--red); }
.hair { height: 1px; background: var(--hair); }
#saleDebtRows { display: flex; flex-direction: column; gap: 12px; }
.sale-side .big-btn { width: 100%; }

/* short message from the top */
.toast {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.toast.good { background: #128A4E; }
.toast.bad { background: #D9291F; }
.toast svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* unit list under a unit pill */
.unit-menu {
  position: absolute;
  z-index: 70;
  min-width: 210px;
  padding: 6px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 14px 40px rgba(16, 24, 40, 0.22);
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.unit-menu button {
  height: 46px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 700;
}
.unit-menu button small { color: var(--muted); font-size: 13px; font-weight: 700; }
.unit-menu button.on { background: rgba(21, 64, 229, 0.1); color: var(--blue); }
.unit-menu button:disabled { opacity: 0.4; }

/* new customer: name, mobile, old debt (Yusf 13/11/2026) */
.f-label { font-size: 15px; font-weight: 700; color: var(--label); margin: 6px 4px -4px; }
.field input.ltr { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.field .suffix { color: var(--muted); font-size: 15px; font-weight: 700; flex: none; }
.cust-row .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cust-row .who .name { flex: none; }
.cust-row .phone { font-size: 13px; font-weight: 700; color: var(--muted); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- gifts (Yusf 13/11/2026): button by the cash/debt switch, gift rows, gifts page ---------- */
:root { --purple: #7A5AF8; }
.pay-line { display: flex; gap: 10px; align-items: stretch; }
.pay-line .pay-switch { flex: 1; }
.gift-btn {
  flex: none;
  min-width: 120px;
  border: 1.5px solid rgba(122, 90, 248, 0.35);
  border-radius: 15px;
  background: rgba(122, 90, 248, 0.08);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
}
.gift-btn svg, .title-ico svg, .box-ico svg, .gift-tag svg {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.gift-btn svg { width: 20px; height: 20px; }
.gift-btn:active { transform: scale(0.97); }

.line.gift .l-art { background: rgba(122, 90, 248, 0.12); color: var(--purple); }
.l-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.gift-tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px;
  border-radius: 999px;
  background: var(--purple); color: #fff;
  font-size: 13px; font-weight: 700;
}
.gift-tag svg { width: 14px; height: 14px; }
.line .gift-price {
  width: 120px; flex: none; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(122, 90, 248, 0.08);
  color: var(--purple);
  font-size: 15px; font-weight: 700;
}
.line.gift .l-total { color: var(--purple); }

/* the products window when it picks gifts */
.sheet.gifting .prod.on { border-color: var(--purple); background: rgba(122, 90, 248, 0.07); }
.sheet.gifting .prod .tick-dot { background: var(--purple); }
.sheet.gifting #prodDone { background: var(--purple); box-shadow: 0 6px 16px rgba(122, 90, 248, 0.3); }

/* home box with a drawn icon (no 3D picture for gifts yet) */
.box-ico { width: 76px; height: 76px; border-radius: 22px; display: flex; align-items: center; justify-content: center; }
.box-ico svg { width: 40px; height: 40px; }
.box-ico.gift { background: rgba(122, 90, 248, 0.12); color: var(--purple); }
.title-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.title-ico svg { width: 24px; height: 24px; }
.title-ico.gift { background: rgba(122, 90, 248, 0.12); color: var(--purple); }
.page-head .round svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* gifts page */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 14px; max-width: 1100px; }
.stat {
  border-radius: var(--radius);
  padding: 14px 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 86px;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.12);
}
.stat span { font-size: 14px; font-weight: 700; opacity: 0.88; }
.stat strong { font-size: 24px; font-weight: 700; align-self: flex-end; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.blue { background: linear-gradient(135deg, #1540E5, #3D63F0); }
.stat.dark { background: linear-gradient(135deg, #14171C, #344054); }
.stat.purple { background: linear-gradient(135deg, #6941E8, #8F74FA); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button {
  height: 42px; padding: 0 18px;
  border: 1.2px solid var(--hair);
  border-radius: 999px;
  background: var(--card); color: var(--text);
  font-size: 15px; font-weight: 700;
}
.chips button.on { background: #1540E5; border-color: #1540E5; color: #fff; }
.range { display: flex; align-items: center; gap: 8px; }
.range-dash { color: var(--muted); font-weight: 700; }
.date-box {
  position: relative;
  height: 42px; min-width: 130px; padding: 0 14px;
  border-radius: 12px;
  border: 1.2px solid var(--hair);
  background: var(--card); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums;
}
/* the real date picker sits on top, see-through, so a tap opens the iPad's own calendar */
.date-box input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; }

.list-card {
  max-width: 1100px;
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--hair);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.07);
}
.g-head, .g-row { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.g-head { height: 44px; background: var(--head); color: #fff; font-size: 14px; font-weight: 700; }
.g-row { min-height: 58px; border-bottom: 1px solid var(--hair); font-size: 15px; }
.g-row:last-child { border-bottom: 0; }
.g-date { width: 96px; flex: none; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.g-no { width: 70px; flex: none; text-align: center; }
.g-who { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-item { flex: 1.2; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-qty { width: 96px; flex: none; text-align: center; }
.g-cost { width: 104px; flex: none; text-align: center; color: var(--purple); font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; }
.g-row .no-pill { padding: 4px 10px; font-size: 13px; }
.g-row .g-date { color: var(--muted); font-weight: 700; font-size: 14px; }
.g-head span { color: #fff; }

/* Save + WhatsApp PDF, half and half */
.save-line { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.save-line .big-btn { width: 100%; padding: 0 10px; white-space: nowrap; }
.big-btn.green { background: #128A4E; box-shadow: 0 6px 16px rgba(18, 138, 78, 0.3); }

/* keyboard on screen (Yusf 13/11/2026: the page slid up and looked broken): the frame shrinks to the part above the
   keyboard, the page never moves, and the bottom bar steps aside like in iPad apps while typing */
html, body { position: fixed; inset: 0; width: 100%; }
body.typing .tabbar { display: none; }
body.typing { --bar-room: 12px; }

/* gift button: solid purple (Yusf 13/11/2026), same height as the cash / debt switch */
.gift-btn {
  border: 0;
  background: #7A5AF8;
  color: #fff;
  min-height: 50px;
  box-shadow: 0 6px 14px rgba(122, 90, 248, 0.3);
}

/* ---------- product cards = Zagros Market cards (Yusf 13/11/2026): picture fills the top, name + price in a strip ---------- */
.prod {
  aspect-ratio: 1 / 1.12;
  padding: 0;
  gap: 0;
  justify-content: stretch;
  align-items: stretch;
  border-radius: 14px;
  border: 2px solid var(--hair);
}
.prod .p-pic {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F3F4F7;
  overflow: hidden;
}
.prod .p-pic img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.prod .p-foot {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 10px 9px;
  border-top: 1px solid var(--hair);
  background: var(--card);
}
.prod .pname { font-size: 14px; line-height: 1.3; -webkit-line-clamp: 1; white-space: nowrap; text-overflow: ellipsis; display: block; }
.prod .price { font-size: 15px; }
.prod .stock { font-size: 12px; }
.prod.on { border-color: #1540E5; }
.prod.on .p-foot { background: rgba(21, 64, 229, 0.06); }
.sheet.gifting .prod.on .p-foot { background: rgba(122, 90, 248, 0.07); }
.prod:disabled .p-pic img { filter: grayscale(1); opacity: 0.6; }
.prod .tick-dot { z-index: 2; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
@media (prefers-color-scheme: dark) { .prod .p-pic { background: #232731; } }

/* sale rows: the product picture */
.line .l-art { overflow: hidden; background: #F3F4F7; }
.line .l-art img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
@media (prefers-color-scheme: dark) { .line .l-art { background: #232731; } }

/* swipe back from the right edge (Yusf 13/11/2026) */
.edge-back { position: absolute; top: 0; bottom: 0; right: 0; width: 24px; z-index: 20; touch-action: none; }
.page.dragging { z-index: 6; background: var(--bg); box-shadow: 10px 0 30px rgba(16, 24, 40, 0.18); }
.page.under { z-index: 1; }
.page.snap { transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* the goods table reaches down to the money card (Yusf 13/11/2026); goods scroll inside it, «+» stays right under them */
.table-card { flex: 1 1 auto; min-height: 220px; }
#saleLines { flex: 0 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.table-card:not(.empty) .add-row { flex: none; }
@media (min-width: 1000px) {
  /* sideways: the table stops above the bottom bar too */
  .sale-main { padding-bottom: var(--bar-room); }
}
/* «+ زیادکردنی کاڵا» always at the bottom of the table, just above the money card (Yusf 13/11/2026) */
.table-card:not(.empty) #saleLines { flex: 1 1 auto; }
.table-card:not(.empty) .add-row { border-top: 1px solid var(--hair); }

/* ---------- receipts page (Yusf 13/11/2026) ---------- */
.stat.green { background: linear-gradient(135deg, #128A4E, #22B36B); }
.stat.red { background: linear-gradient(135deg, #C2261D, #EF4B3F); }
.field.grow { flex: 1; min-width: 240px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 15px; background: var(--card); border: 1.2px solid var(--hair); flex: none; }
.seg button { height: 44px; padding: 0 18px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 700; }
.seg button.on { background: #1540E5; color: #fff; }
.seg button.on[data-kind="debt"] { background: #D9291F; }

.r-head, .r-row { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.r-head { height: 44px; background: var(--head); color: #fff; font-size: 14px; font-weight: 700; }
.r-head span { color: #fff; }
.r-row {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  text-align: start;
}
.r-row:nth-child(even) { background: #FAFBFC; }
.r-row:active { background: rgba(21, 64, 229, 0.06); }
.r-row:last-child { border-bottom: 0; }
.r-no { width: 70px; flex: none; text-align: center; }
.r-date { width: 100px; flex: none; display: flex; flex-direction: column; align-items: flex-end; direction: ltr; font-variant-numeric: tabular-nums; }
.r-row .r-date b { font-size: 14px; font-weight: 700; color: var(--label); }
.r-row .r-date small { font-size: 12px; font-weight: 700; color: var(--muted); }
.r-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.r-who .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-who .gift-dot { width: 22px; height: 22px; flex: none; border-radius: 7px; background: rgba(122, 90, 248, 0.14); color: var(--purple); display: flex; align-items: center; justify-content: center; }
.r-who .gift-dot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.r-kind { width: 64px; flex: none; text-align: center; }
.r-num { width: 104px; flex: none; text-align: center; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-row .r-num.total { color: var(--blue); }
.r-row .r-num.paid { color: var(--green); }
.r-row .r-num.rest { color: var(--red); }
.r-row .r-num.rest.zero { color: var(--green); }
.kind-pill { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; background: #1540E5; }
.kind-pill.debt { background: #D9291F; }
@media (prefers-color-scheme: dark) { .r-row:nth-child(even) { background: #1E222A; } }

/* the receipt window */
.rc-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.rc-info { flex-direction: row; align-items: center; justify-content: space-between; }
.rc-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rc-who img { width: 40px; height: 40px; flex: none; object-fit: contain; }
.rc-who div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc-who strong { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-who .phone { font-size: 14px; font-weight: 700; color: var(--muted); direction: ltr; text-align: right; }
.rc-when { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.rc-date { font-size: 14px; font-weight: 700; color: var(--label); direction: ltr; font-variant-numeric: tabular-nums; }
.rc-head, .rc-line { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.rc-head { height: 44px; background: var(--head); color: #fff; font-size: 14px; font-weight: 700; }
.rc-head span { color: #fff; }
.rc-line { min-height: 58px; border-bottom: 1px solid var(--hair); font-size: 15px; }
.rc-line:last-child { border-bottom: 0; }
.rc-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.rc-item img { width: 40px; height: 40px; flex: none; border-radius: 10px; background: #F3F4F7; object-fit: contain; padding: 3px; }
.rc-item .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-unit { width: 80px; flex: none; text-align: center; color: var(--label); font-weight: 700; }
.rc-qty { width: 70px; flex: none; text-align: center; font-weight: 700; }
.rc-price, .rc-total { width: 110px; flex: none; text-align: center; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; }
.rc-line .rc-total { color: var(--blue); }
.rc-line.gift .rc-price, .rc-line.gift .rc-total { color: var(--purple); }
.rc-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.rc-buttons .big-btn { width: 100%; padding: 0 8px; white-space: nowrap; }
.big-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.big-btn.danger { background: var(--card); color: #D9291F; border: 1.5px solid rgba(217, 41, 31, 0.45); box-shadow: none; }
.big-btn.red { background: #D9291F; box-shadow: 0 6px 16px rgba(217, 41, 31, 0.3); }
.big-btn.plain { background: var(--card); color: var(--text); border: 1.5px solid var(--hair); box-shadow: none; }

/* sale page while a saved receipt is being changed */
.edit-chip { height: 36px; padding: 0 14px; border: 1.5px solid rgba(217, 41, 31, 0.4); border-radius: 999px; background: var(--card); color: #D9291F; font-size: 14px; font-weight: 700; }

/* our own yes / no window */
.ask-wrap { position: fixed; top: var(--app-top, 0px); left: 0; right: 0; height: var(--app-h); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(16, 24, 40, 0.45); animation: fadeIn 0.18s ease both; }
.ask { width: min(460px, 100%); background: var(--card); border-radius: 24px; padding: 26px 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; box-shadow: 0 24px 60px rgba(16, 24, 40, 0.3); animation: sheetIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.ask-badge { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(135deg, #C2261D, #EF4B3F); color: #fff; display: flex; align-items: center; justify-content: center; }
.ask-badge svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ask h3 { margin: 0; font-size: 19px; font-weight: 700; }
.ask-lines { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.ask-lines div { padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 15px; font-weight: 700; color: var(--label); }
.ask-btns { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.m-paid { font-size: 19px; font-weight: 700; color: var(--green); }

/* date filter = one bar from side to side, 4 equal parts (Yusf 14/11/2026); dates open under it, half and half */
.chips.period {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 15px;
  background: var(--card);
  border: 1.2px solid var(--hair);
}
.chips.period button { height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); padding: 0 6px; }
.chips.period button.on { background: #1540E5; color: #fff; box-shadow: 0 4px 10px rgba(21, 64, 229, 0.25); }
.filters .range { width: 100%; max-width: 1100px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.filters .range[hidden] { display: none !important; }
.filters .range .date-box { width: 100%; height: 50px; min-width: 0; border-radius: 13px; font-size: 16px; }
.filters { max-width: 1100px; }

/* ---------- warehouse page «کۆگا» (Yusf 14/11/2026) ---------- */
.box-ico.stock, .title-ico.stock { background: rgba(21, 64, 229, 0.12); color: #1540E5; }
.box-ico.stock svg, .title-ico.stock svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-cards.four { grid-template-columns: repeat(4, 1fr); }
.stat.orange { background: linear-gradient(135deg, #C2410C, #F97316); }
.add-btn {
  height: 54px; flex: none; padding: 0 20px; border: 0; border-radius: 14px;
  background: #1540E5; color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 16px rgba(21, 64, 229, 0.28);
}
.add-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.add-btn:active { transform: scale(0.97); }
.seg button[data-view] { padding: 0 16px; }

.st-head, .st-row { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.st-head { height: 44px; background: var(--head); color: #fff; font-size: 14px; font-weight: 700; }
.st-head span { color: #fff; }
.st-row { width: 100%; min-height: 66px; border: 0; border-bottom: 1px solid var(--hair); background: var(--card); color: var(--text); font-size: 15px; text-align: start; }
.st-row:nth-child(even) { background: #FAFBFC; }
.st-row:active { background: rgba(21, 64, 229, 0.06); }
.st-row:last-child { border-bottom: 0; }
.st-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.st-item img { width: 46px; height: 46px; flex: none; border-radius: 11px; background: #F3F4F7; object-fit: contain; padding: 3px; }
.st-item .nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-item .nm b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-item .nm small { font-size: 12px; font-weight: 700; color: var(--muted); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.st-stock { width: 150px; flex: none; text-align: center; font-weight: 700; font-size: 14px; line-height: 1.35; }
.st-stock.low { color: #C2410C; }
.st-stock.none { color: var(--red); }
.st-num { width: 92px; flex: none; text-align: center; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-row .st-num.cost { color: var(--label); }
.st-row .st-num.sell { color: var(--blue); }
.st-row .st-num.off { color: var(--muted); font-weight: 400; }
@media (prefers-color-scheme: dark) { .st-row:nth-child(even) { background: #1E222A; } .st-item img { background: #232731; } }

.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; max-width: 1100px; }
.stock-grid .prod.low .stock { color: #C2410C; }

/* add / edit product window */
.pf-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 14px; max-width: 860px; }
.pf-top { display: flex; gap: 16px; align-items: flex-start; }
.pf-photo { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pf-photo img { width: 150px; height: 150px; border-radius: 18px; background: #F3F4F7; object-fit: contain; padding: 8px; border: 1px solid var(--hair); }
.pf-photo-btns { display: flex; gap: 6px; }
.pf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pf-row { display: flex; gap: 10px; align-items: center; }
.pf-row .field.grow { min-width: 0; }
.mini-btn {
  height: 42px; padding: 0 14px; border: 1.2px solid var(--hair); border-radius: 12px;
  background: var(--card); color: var(--blue); font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
}
.mini-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mini-btn.red { color: var(--red); }
.mini-btn.dark { background: #14171C; color: #fff; border-color: #14171C; height: 54px; }
.pf-card { gap: 10px; }
.pf-h { margin: 0; font-size: 17px; font-weight: 700; }
.pf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pf-two > div, .pf-three > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pf-two .f-label, .pf-three .f-label, .pf-card > .f-label { margin: 2px 4px 0; }
.field.short { max-width: 220px; }
.pf-total { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--bg); font-weight: 700; }
.pf-total strong { font-size: 20px; color: var(--blue); direction: ltr; }
.u-head, .u-row { display: flex; align-items: center; gap: 8px; }
.u-head { height: 38px; padding: 0 10px; border-radius: 10px; background: var(--head); color: #fff; font-size: 13px; font-weight: 700; }
.u-head span { color: #fff; }
.u-row { min-height: 58px; padding: 0 10px; border-bottom: 1px solid var(--hair); }
.u-row.off .u-pcs, .u-row.off .u-sell, .u-row.off .u-cost { opacity: 0.35; pointer-events: none; }
.u-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.u-pcs { width: 130px; flex: none; text-align: center; }
.u-cost { width: 120px; flex: none; text-align: center; color: var(--muted); font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; }
.u-sell { width: 150px; flex: none; }
.u-pcs .num-box, .u-sell .num-box { width: 100%; }
.u-fixed { display: inline-block; font-weight: 700; color: var(--muted); }
.u-tick { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--line); background: var(--card); padding: 0; position: relative; }
.u-tick.on { background: #1540E5; border-color: #1540E5; }
.u-tick.on::after { content: ""; position: absolute; left: 7px; top: 3px; width: 7px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.seg.wide { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
.seg.wide button:disabled { opacity: 0.35; }
.pf-buttons { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.pf-buttons .big-btn { width: 100%; }
.pf-buttons .big-btn:only-child, .pf-buttons #pfDelete[hidden] + * { grid-column: 1 / -1; }
.ask-badge.blue { background: linear-gradient(135deg, #1540E5, #3D63F0); }
@media (max-width: 700px) { .pf-top { flex-direction: column; align-items: stretch; } .pf-photo { align-self: center; } }
.pf-buttons.single { grid-template-columns: 1fr; }
.num-box.bad { border-color: var(--red); border-width: 1.6px; }
/* long product names wrap to two lines in the warehouse table instead of being cut */
.st-item .nm b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }

/* ---------- product groups (Yusf 14/11/2026, like Blue Sky) ---------- */
.tool-btn {
  height: 54px; flex: none; padding: 0 16px; border-radius: 14px;
  border: 1.2px solid var(--hair); background: var(--card); color: #6941E8;
  font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.tool-btn svg, .field.pick svg, .gr-badge svg, .gr-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.group-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 0 2px; max-width: 1100px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.group-chips::-webkit-scrollbar { display: none; }
.group-chips button {
  flex: none; height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1.2px solid var(--hair); background: var(--card); color: var(--text);
  font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.group-chips button small { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.group-chips button.on { background: #6941E8; border-color: #6941E8; color: #fff; }
.group-chips button.on small { background: rgba(255, 255, 255, 0.22); color: #fff; }

.field.pick { width: 100%; cursor: pointer; color: #6941E8; text-align: start; font-family: inherit; }
.field.pick .pick-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field.pick .pick-name.empty { color: var(--muted); font-weight: 400; }
.field.pick .pick-down { color: var(--muted); }

.gr-card { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; background: var(--card); border-radius: 24px; padding: 18px; box-shadow: 0 24px 60px rgba(16, 24, 40, 0.3); animation: sheetIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.gr-head { display: flex; align-items: center; gap: 12px; }
.gr-head h3 { flex: 1; margin: 0; font-size: 19px; font-weight: 700; }
.gr-badge { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, #6941E8, #8F74FA); color: #fff; display: flex; align-items: center; justify-content: center; }
.gr-add { display: flex; gap: 10px; }
.gr-add .add-btn { background: #6941E8; box-shadow: 0 6px 16px rgba(105, 65, 232, 0.28); }
.gr-list { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.gr-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 14px; background: var(--bg); }
.gr-row.picked { outline: 2px solid #6941E8; }
.gr-pick { flex: 1; min-width: 0; height: 48px; border: 0; border-radius: 10px; background: transparent; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; font-size: 16px; font-weight: 700; text-align: start; }
.gr-pick small { color: var(--muted); font-size: 13px; font-weight: 700; flex: none; }
.gr-ico { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.gr-ico.edit { color: #1540E5; }
.gr-ico.del { color: #D9291F; }
.gr-ico.ok { color: #fff; background: #128A4E; }
.gr-row input { flex: 1; min-width: 0; height: 48px; border: 1.5px solid #6941E8; border-radius: 10px; padding: 0 12px; font-size: 16px; font-family: inherit; background: var(--card); color: var(--text); outline: none; }
/* Yusf's 3D gift picture on the purple button (14/11/2026) */
.gift-btn img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25)); }

/* ---------- expenses «خەرجییەکان» (Yusf 14/11/2026): orange = money spent, like Zagros Clothes ---------- */
:root { --orange: #E8590C; }
.add-btn.orange, .big-btn.orange { background: #E8590C; box-shadow: 0 6px 16px rgba(232, 89, 12, 0.28); }
.group-chips.orange button.on { background: #E8590C; border-color: #E8590C; }
.group-chips button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.e-head, .e-row { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.e-head { height: 44px; background: var(--head); color: #fff; font-size: 14px; font-weight: 700; }
.e-head span { color: #fff; }
.e-row { width: 100%; min-height: 62px; border: 0; border-bottom: 1px solid var(--hair); background: var(--card); color: var(--text); font-size: 15px; text-align: start; }
.e-row:nth-child(even) { background: #FAFBFC; }
.e-row:active { background: rgba(232, 89, 12, 0.06); }
.e-row:last-child { border-bottom: 0; }
.e-no { width: 74px; flex: none; text-align: center; }
.e-no .no-pill.ex { background: rgba(232, 89, 12, 0.12); color: #E8590C; }
.e-no .no-pill.gift { background: rgba(122, 90, 248, 0.12); color: var(--purple); }
.e-date { width: 96px; flex: none; direction: ltr; text-align: right; font-weight: 700; font-size: 14px; color: var(--label); font-variant-numeric: tabular-nums; }
.e-kind { width: 170px; flex: none; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.e-kind .k-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(232, 89, 12, 0.12); color: #E8590C; }
.e-kind .k-ico.gift { background: rgba(122, 90, 248, 0.12); color: var(--purple); }
.e-kind .k-ico svg, .ex-kind svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.e-note { flex: 1; min-width: 0; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-amt { width: 120px; flex: none; text-align: center; font-weight: 700; color: #E8590C; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.e-row.gift .e-amt { color: var(--purple); }
@media (prefers-color-scheme: dark) { .e-row:nth-child(even) { background: #1E222A; } }

.ex-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 14px; }
.ex-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ex-kind {
  height: 92px; border-radius: 16px; border: 2px solid var(--hair); background: var(--card); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 6px;
}
.ex-kind .k-ico { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: rgba(232, 89, 12, 0.12); color: #E8590C; }
.ex-kind svg { width: 22px; height: 22px; }
.ex-kind.on { border-color: #E8590C; background: rgba(232, 89, 12, 0.07); }
.ex-kinds.bad .ex-kind { border-color: rgba(217, 41, 31, 0.5); }
.field.big input { font-size: 24px; font-weight: 700; }
.ex-date { width: 220px; height: 54px; font-size: 17px; }
@media (max-width: 600px) { .ex-kinds { grid-template-columns: repeat(2, 1fr); } }

/* ---------- «دەرکردنی پارە - عومەر» (Yusf 14/11/2026): owner's own money out, teal (not an expense) ---------- */
.stat-cards.two { grid-template-columns: repeat(2, 1fr); }
.stat.teal { background: linear-gradient(135deg, #0E7C70, #14B8A6); }
.add-btn.teal, .big-btn.teal { background: #0E7C70; box-shadow: 0 6px 16px rgba(14, 124, 112, 0.28); }
.e-no .no-pill.wd { background: rgba(14, 124, 112, 0.12); color: #0E7C70; }
.e-row.wd .e-amt { color: #0E7C70; }
.e-row.wd:active { background: rgba(14, 124, 112, 0.06); }
.wd-who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06); }
.wd-who img { width: 56px; height: 56px; object-fit: contain; }
.wd-who strong { font-size: 20px; font-weight: 700; }
/* long Home names (e.g. «دەرکردنی پارە - عومەر») wrap to two lines instead of being cut */
.home-box span { white-space: normal; text-align: center; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- customers «کڕیارەکان» (Yusf 14/11/2026) ---------- */
.c-head, .c-row { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.c-head { height: 44px; background: var(--head); color: #fff; font-size: 14px; font-weight: 700; }
.c-head span { color: #fff; }
.c-row { width: 100%; min-height: 64px; border: 0; border-bottom: 1px solid var(--hair); background: var(--card); color: var(--text); font-size: 15px; text-align: start; }
.c-row:nth-child(even) { background: #FAFBFC; }
.c-row:active { background: rgba(21, 64, 229, 0.06); }
.c-row:last-child { border-bottom: 0; }
.c-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.c-who img { width: 38px; height: 38px; flex: none; object-fit: contain; }
.c-who .nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.c-who .nm b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-who .nm small { font-size: 13px; font-weight: 700; color: var(--muted); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.c-n { width: 70px; flex: none; text-align: center; font-weight: 700; color: var(--label); }
.c-money { width: 130px; flex: none; text-align: center; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-row .c-money.bought { color: var(--blue); }
.c-row .c-money.debt { color: var(--red); }
.c-row .c-money.debt.zero { color: var(--green); }
@media (prefers-color-scheme: dark) { .c-row:nth-child(even) { background: #1E222A; } }
.seg button[data-f] { padding: 0 14px; }

.cp-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 14px; }
.cp-top { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-btn.green { color: #128A4E; }
.cp-body .stat-cards { margin: 0; }
.wide-btn { width: 100%; }

/* ---------- receive money «وەرگرتنی پارە» (Yusf 14/11/2026): customers pay their debt, GREEN ---------- */
.add-btn.green { background: #128A4E; box-shadow: 0 6px 16px rgba(18, 138, 78, 0.28); }
.e-no .no-pill.pm { background: rgba(18, 138, 78, 0.12); color: var(--green); }
.e-row.pm .e-amt { color: var(--green); }
.e-row.pm:active { background: rgba(18, 138, 78, 0.06); }
.e-row .r-date b { font-size: 14px; font-weight: 700; color: var(--label); }
.e-row .r-date small { font-size: 12px; font-weight: 700; color: var(--muted); }
.e-head .r-date { align-items: center; }
.e-row .c-money.debt { color: var(--red); }
.e-row .c-money.debt.zero { color: var(--green); }
.pm-list .c-who { flex: 1.4; }
.field.pm-amount:focus-within { border-color: var(--green); }
.mini-btn.pay { background: #128A4E; color: #fff; border-color: #128A4E; }
.cust-list.debtors .debt-pill { background: #D9291F; color: #fff; }
.pm-who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06); }
.pm-who img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.pm-who .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-who .who strong { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-who .phone { font-size: 14px; font-weight: 700; color: var(--muted); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.pm-debt { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pm-debt span { font-size: 13px; font-weight: 700; color: var(--muted); }
.pm-debt strong { font-size: 19px; font-weight: 700; color: var(--red); direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pm-label { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.pm-label .f-label { margin: 0 4px; }
.all-pill { height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(18, 138, 78, 0.12); color: var(--green); font-size: 14px; font-weight: 700; }
.all-pill:active { transform: scale(0.96); }
.field.pm-amount { height: 70px; border-color: rgba(18, 138, 78, 0.45); background: rgba(18, 138, 78, 0.05); }
.field.pm-amount input { font-size: 30px; color: var(--green); text-align: center; }
.field.pm-amount.bad { border-color: var(--red); }
.pm-left { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; font-size: 15px; font-weight: 700; color: var(--label); }
.pm-left strong { font-size: 18px; color: var(--red); direction: ltr; font-variant-numeric: tabular-nums; }
.pm-left strong.zero { color: var(--green); }
.pm-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-buttons.three { grid-template-columns: 1fr 1fr 1fr; }
.pm-buttons .big-btn { width: 100%; padding: 0 8px; white-space: nowrap; }
.big-btn.wa { background: var(--card); color: var(--green); border: 1.5px solid rgba(18, 138, 78, 0.5); box-shadow: none; }
#cpPayCard .e-row { min-height: 56px; }

/* ---------- companies «کۆمپانیاکان» (Yusf 14/11/2026): what we owe = «چەند قەرزارین» ---------- */
.c-row .c-money.paid { color: var(--green); }
.e-no .no-pill.out { background: rgba(217, 41, 31, 0.1); color: var(--red); }
.e-row.out .e-amt { color: var(--green); }
.e-row.out:active { background: rgba(217, 41, 31, 0.05); }

/* ---------- send money «پارەدان» (Yusf 14/11/2026): we pay a company; RED page, paid money green ---------- */
.add-btn.red { background: #D9291F; box-shadow: 0 6px 16px rgba(217, 41, 31, 0.28); }
.mini-btn.payout { background: #D9291F; color: #fff; border-color: #D9291F; }
.field.pm-amount.out { border-color: rgba(217, 41, 31, 0.45); background: rgba(217, 41, 31, 0.04); }
.field.pm-amount.out input { color: var(--red); }
.field.pm-amount.out:focus-within { border-color: var(--red); }
.all-pill.out { background: rgba(217, 41, 31, 0.1); color: var(--red); }
/* long company / customer names wrap to two lines in the money tables */
.pm-list .c-who .nm b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.pm-list .e-note { flex: 0.8; }

/* ---------- cash box «قاسە» (Yusf 14/11/2026, like Xira): all money in and out; only here a minus may show ---------- */
.ca-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; max-width: 1100px; }
.ca-buttons .add-btn { width: 100%; justify-content: center; }
.ca-kind { width: 168px; flex: none; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.ca-kind img { width: 32px; height: 32px; flex: none; object-fit: contain; }
.ca-in, .ca-out { width: 112px; flex: none; text-align: center; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.e-row .ca-in { color: var(--green); }
.e-row .ca-out { color: var(--red); }
.ca-list .e-note { font-size: 14px; }
.e-no .no-pill.cm { background: rgba(16, 24, 40, 0.08); color: var(--text); }
.e-no .no-pill.ex { background: rgba(232, 89, 12, 0.12); color: #E8590C; }
.e-row.ca:active { background: rgba(21, 64, 229, 0.05); }
.cm-box strong { color: var(--text); }
.cm-box strong.minus { color: var(--red); }
@media (prefers-color-scheme: dark) { .e-no .no-pill.cm { background: rgba(255, 255, 255, 0.1); } }

/* ---------- buying «کڕین» (Yusf 14/11/2026): goods in from a company ---------- */
.no-pill.buy { background: rgba(79, 70, 229, 0.12); color: #4F46E5; }
.no-pill.rt { background: rgba(234, 88, 12, 0.12); color: #EA580C; }   /* returns R-n (15/11/2026) */
#rtWalk img { margin-inline-end: 8px; }
@media (prefers-color-scheme: dark) { .no-pill.buy { color: #A5B4FC; } }
.by-co .mini-btn { flex: none; }
.by-table { flex: none; }
.by-head, .by-line { display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.by-head { height: 44px; background: var(--head); color: #fff; font-size: 14px; font-weight: 700; }
.by-head span { color: #fff; }
.by-line { min-height: 70px; border-bottom: 1px solid var(--hair); }
.by-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.by-item img { width: 44px; height: 44px; flex: none; border-radius: 12px; object-fit: contain; background: #F3F4F7; padding: 3px; }
.by-item .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.by-unit { width: 196px; flex: none; display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: var(--bg); }
.by-head .by-unit { background: none; justify-content: center; }
.by-unit button { flex: 1; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; padding: 0 2px; }
.by-unit button.on { background: #1540E5; color: #fff; }
.by-qty { width: 76px; flex: none; text-align: center; }
.by-cost { width: 118px; flex: none; text-align: center; }
.by-line .num-box { height: 46px; border-radius: 12px; font-size: 16px; }
.by-line .num-box.bad { border-color: var(--red); border-width: 1.6px; }
.by-total { width: 112px; flex: none; text-align: center; font-weight: 700; color: var(--blue); direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.by-del { width: 38px; height: 38px; flex: none; border: 0; border-radius: 11px; background: rgba(217, 41, 31, 0.08); color: var(--red); display: flex; align-items: center; justify-content: center; padding: 0; }
.by-head .by-del { background: none; }
.by-del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.by-add { height: 56px; border: 0; border-top: 1px solid var(--hair); background: var(--card); color: var(--blue); font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.by-add svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.by-add:active { background: rgba(21, 64, 229, 0.05); }
.by-money { gap: 14px; }
.by-debt { display: flex; flex-direction: column; gap: 12px; }
.field.by-paid { width: 230px; height: 50px; }
.field.by-paid input { font-size: 18px; font-weight: 700; text-align: center; }
.by-money .date-box.ex-date { width: 230px; height: 50px; }
.pay-switch button:disabled { opacity: 0.35; }
.by-amt { color: var(--text) !important; }
@media (prefers-color-scheme: dark) { .by-item img { background: #232731; } }
@media (max-width: 700px) { .by-unit { width: 150px; } .by-cost { width: 96px; } .by-total { width: 86px; } }

/* ---------- report «ڕاپۆرت» (Yusf 15/11/2026) ---------- */
:root { --chart: #1540E5; --chart-on: #0D2DB0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart: #6D8BFF; --chart-on: #A9BBFF; } }
.rp-two { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 18px; max-width: 1100px; }
@media (min-width: 1000px) { .rp-two { grid-template-columns: 380px 1fr; } }
.rp-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.rp-head { margin: 4px 4px 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.rp-row > span { font-size: 15px; color: var(--label); }
.rp-row strong { font-size: 17px; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-plus { color: var(--blue); }
.rp-minus { color: var(--red); }
.rp-profit { color: var(--green); font-size: 21px !important; }
.rp-loss { color: var(--red); font-size: 21px !important; }
#rpMath { display: flex; flex-direction: column; gap: 6px; }
#rpMath .hair { height: 1px; background: var(--hair); margin: 4px 0; }
.rp-chart { position: relative; min-width: 0; }
.rp-chart-box { position: relative; direction: ltr; }
.rp-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.rp-grid { stroke: var(--hair); stroke-width: 1; }
.rp-base { stroke: var(--line); stroke-width: 1; }
.rp-axis { fill: var(--muted); font-size: 11px; font-weight: 700; font-family: inherit; }
.rp-bar { fill: var(--chart); }
.rp-bar.on { fill: var(--chart-on); }
.rp-hit { fill: transparent; cursor: pointer; }
.rp-empty { position: absolute; inset: 40% 0 auto; margin: 0; }
.rp-tip {
  position: absolute; transform: translateY(-100%); pointer-events: none; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border-radius: 12px;
  background: var(--card); color: var(--text); box-shadow: 0 6px 20px rgba(16, 24, 40, 0.18); border: 1px solid var(--hair); white-space: nowrap;
}
.rp-tip b { font-size: 13px; color: var(--muted); direction: ltr; }
.rp-tip span { font-size: 16px; font-weight: 700; }
.rp-rank { width: 34px; flex: none; text-align: center; font-weight: 700; color: var(--muted); }
.rp-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.rp-item img { width: 40px; height: 40px; flex: none; border-radius: 11px; object-fit: contain; background: #F3F4F7; padding: 3px; }
.rp-item .nm { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-qty { width: 190px; flex: none; text-align: center; font-weight: 700; color: var(--label); font-size: 14px; }
.rp-money { width: 120px; flex: none; text-align: center; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-top .rp-money.sales { color: var(--blue); }
.rp-top .rp-money.gain { color: var(--green); }
.rp-top .rp-money.gain.zero { color: var(--muted); }
.rp-top { cursor: default; }
@media (prefers-color-scheme: dark) { .rp-item img { background: #232731; } }
@media (max-width: 700px) { .rp-qty { width: 120px; } .rp-money { width: 96px; } }
@media (max-width: 999px) { .stat-cards.rp-now { grid-template-columns: repeat(2, 1fr); } }

/* ---------- settings «ڕێکخستن» (Yusf 15/11/2026) ---------- */
.st-two { display: grid; grid-template-columns: 1fr; gap: 14px; max-width: 1100px; }
@media (min-width: 1000px) { .st-two { grid-template-columns: 1fr 1fr; align-items: start; } }
.st-card { gap: 10px; }
.st-card .big-btn { width: 100%; margin-top: 4px; }
.st-card .f-label { margin: 4px 4px -2px; }
.st-card input:disabled { color: var(--muted); }
.st-user { display: flex; align-items: center; gap: 12px; padding: 8px 4px 4px; }
.st-user img { width: 48px; height: 48px; object-fit: contain; }
.st-user .who { display: flex; align-items: center; gap: 10px; }
.st-user strong { font-size: 19px; font-weight: 700; }
/* Settings = rows (Yusf 15/11/2026): a row opens its window; «چوونەدەرەوە» in its own red row */
.st-list { max-width: 1100px; margin: 0 0 16px; border-radius: var(--radius); background: var(--card); box-shadow: 0 4px 16px rgba(16, 24, 40, 0.08); overflow: hidden; }
.st-row { width: 100%; min-height: 72px; display: flex; align-items: center; gap: 14px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--hair); background: var(--card); color: var(--text); text-align: start; }
.st-row:last-child { border-bottom: 0; }
.st-row:active { background: rgba(21, 64, 229, 0.05); }
.st-ico { width: 44px; height: 44px; flex: none; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: rgba(21, 64, 229, 0.1); color: var(--blue); }
.st-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-text b { font-size: 17px; font-weight: 700; }
.st-text small { font-size: 14px; font-weight: 700; color: var(--muted); }
.st-chev { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.st-row.out { color: var(--red); }
.st-row.out .st-ico { background: rgba(217, 41, 31, 0.1); color: var(--red); }
.st-row.out:active { background: rgba(217, 41, 31, 0.05); }

/* ---------- customer profile: sales, payments and returns in ONE table + date filter (Yusf 15/11/2026) ---------- */
.cp-filters { margin: 0; flex-wrap: nowrap; }
.cp-filters .chips.period { flex: 1; min-width: 0; }
.cp-filters .add-btn { flex: none; }
.cp-filters:has(.range:not([hidden])) { flex-wrap: wrap; }
.cs-table .r-kind { width: 96px; }
.kind-pill.pm { background: #128A4E; }
.kind-pill.rt { background: #EA580C; }
.kind-pill.old { background: #667085; }
.cs-table .r-who { flex-wrap: wrap; row-gap: 0; }
.cs-table .r-who .nm { min-width: 0; }
.cs-back { width: 100%; font-size: 12px; font-weight: 700; color: var(--muted); }
.cs-table .r-num.amt { color: var(--blue); }
.cs-pin .r-num.amt { color: var(--green); }
.cs-ret .r-num.amt { color: #EA580C; }
.cs-open { cursor: default; background: var(--bg) !important; }
.cs-open .r-who { color: var(--muted); }
.r-no .no-pill.pm { background: rgba(18, 138, 78, 0.12); color: var(--green); }
.cs-table .r-who .nm { flex: 0 1 auto; max-width: calc(100% - 30px); }
/* company profile: buying B-n + money we paid O-n (paid money is green) */
.kind-pill.out { background: #D9291F; }
.r-no .no-pill.out { background: rgba(217, 41, 31, 0.1); color: var(--red); }
.cs-out .r-num.amt { color: var(--green); }
/* the report pages, shown exactly as they will be sent */
.cs-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; align-items: center; gap: 16px; }
.cs-page { width: 100%; max-width: 820px; height: auto; flex: none; border-radius: 10px; background: #fff; box-shadow: 0 6px 24px rgba(16, 24, 40, 0.14); }

/* ---------- live link (2026-11-18): first fill of a new iPad, server row in Settings, dot on the Settings tab ---------- */
.loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--bg, #F5F6F8); }
.loading[hidden] { display: none; }
.loading img { border-radius: 18px; }
.loading .spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(21, 64, 229, 0.18); border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.st-row.sync.ok .st-ico { background: rgba(18, 138, 78, 0.1); color: var(--green); }
.st-row.sync.wait .st-ico { background: rgba(232, 89, 12, 0.12); color: #E8590C; }
.st-row.sync.bad .st-ico { background: rgba(217, 41, 31, 0.1); color: var(--red); }
.st-text small.sync-ok { color: var(--green); }
.st-text small.sync-wait { color: #E8590C; }
.st-text small.sync-bad { color: var(--red); }
.tab.dot-wait, .tab.dot-bad { position: relative; }
.tab.dot-wait::after, .tab.dot-bad::after { content: ""; position: absolute; top: 6px; left: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: #E8590C; box-shadow: 0 0 0 2px var(--card); }
.tab.dot-bad::after { background: var(--red); }

/* ---------- PHONE (iPhone 17 / 17 Pro Max / 18 Pro Max, Yusf 19/11/2026) ----------
   Everything here is ONLY for screens under 600 px wide, so the iPad (744 px and up) never sees it.
   Tables keep their black head but show fewer columns; the rest is one tap away (the row opens its window).
   Every table row is a grid: --c = its columns; cells are placed by their order in the row. */
@media (max-width: 600px) {
  :root { --pad: 16px; --radius: 18px; }
  .page { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .title { font-size: 20px; }
  .page-head { margin-bottom: 12px; gap: 8px; }
  .page-art { width: 34px; height: 34px; }
  .round { width: 40px; height: 40px; }
  .sheet-head { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .sheet-head > h2 { font-size: 18px; padding: 0 96px; }

  /* home: 3 boxes a row */
  .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .home-box { gap: 6px; padding: 8px; min-width: 0; min-height: 0; overflow: hidden; }
  .home-box img { width: 58px; height: 58px; }
  .home-box span { font-size: 13.5px; }

  /* the coloured number cards: two a row, an odd last card takes the whole row */
  .stat-cards, .stat-cards.four, .stat-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
  .stat-cards > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat { min-height: 0; padding: 11px 13px; gap: 4px; }
  .stat span { font-size: 13px; }
  .stat strong { font-size: 20px; }
  .stat-cards.rp-now { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* filters: search takes the row, the switch and the add button share the next one */
  .filters { gap: 10px; margin-bottom: 12px; }
  .filters .field.grow { min-width: 100%; }
  .seg button { height: 40px; padding: 0 12px; font-size: 14px; }
  .seg button[data-f], .seg button[data-view] { padding: 0 10px; }
  .add-btn { height: 50px; padding: 0 14px; font-size: 15px; justify-content: center; }
  .filters .add-btn { flex: 1; white-space: nowrap; }
  .cp-filters .add-btn { flex: none; padding: 0 12px; }
  .cp-filters .chips.period button { padding: 0 2px; font-size: 13px; }
  .gr-add .field { flex: 1; min-width: 0; }
  .gr-card { padding: 14px; }
  .chips.period button { height: 40px; font-size: 14px; }
  .field { height: 50px; }
  .field input { font-size: 16px; }

  /* every table: rows as a grid */
  .r-head, .r-row, .c-head, .c-row, .e-head, .e-row, .g-head, .g-row, .rc-head, .rc-line,
  [data-page="stock"] .st-head, [data-page="stock"] .st-row {
    display: grid; grid-template-columns: var(--c); column-gap: 6px; row-gap: 2px; align-items: center; padding: 0 10px;
  }
  .r-row, .c-row, .e-row, .g-row, .rc-line, [data-page="stock"] .st-row { padding: 9px 10px; min-height: 60px; font-size: 14px; }
  .r-head, .c-head, .e-head, .g-head, .rc-head, [data-page="stock"] .st-head { font-size: 13px; height: 40px; }
  .r-head > *, .r-row > *, .c-head > *, .c-row > *, .e-head > *, .e-row > *, .g-head > *, .g-row > *,
  .rc-head > *, .rc-line > *, [data-page="stock"] .st-head > *, [data-page="stock"] .st-row > * { width: auto; min-width: 0; }
  .no-pill { padding: 4px 8px; font-size: 13px; }
  .r-row .r-date b { font-size: 13px; }
  .r-row .r-date small { font-size: 11px; }
  .kind-pill { height: 22px; padding: 0 8px; font-size: 12px; }
  .r-num, .c-money, .e-amt, .ca-in, .ca-out, .g-cost, .rc-total { font-size: 14px; }

  /* receipts, returns, buying: # | date | who + kind | total */
  .r-head, .r-row { --c: 50px 74px minmax(0, 1fr) 86px; column-gap: 10px; }
  .r-head > :nth-child(1), .r-row > :nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
  .r-head > :nth-child(2), .r-row > :nth-child(2) { grid-column: 2; grid-row: 1 / 3; }
  .r-head > :nth-child(3), .r-row > :nth-child(3) { grid-column: 3; grid-row: 1; }
  .r-head > :nth-child(4) { display: none; }
  .r-row > :nth-child(4) { grid-column: 3; grid-row: 2; justify-self: start; text-align: start; }
  .r-head > :nth-child(5), .r-row > :nth-child(5) { grid-column: 4; grid-row: 1 / 3; }
  .r-head > :nth-child(n+6), .r-row > :nth-child(n+6) { display: none; }
  .r-row > .r-kind .kind-pill { height: 20px; font-size: 11.5px; }
  .r-who { gap: 4px; }

  /* customer / company profile: # | what ..... amount | debt after
                                  # | kind pill | date (under the money) */
  .cs-table .r-head, .cs-table .r-row { --c: 50px minmax(0, 1fr) 78px 78px; }
  .cs-table .r-head > :nth-child(1), .cs-table .r-row > :nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
  .cs-table .r-head > :nth-child(2), .cs-table .r-head > :nth-child(3), .cs-table .r-head > :nth-child(6) { display: none; }
  .cs-table .r-row > :nth-child(2) { display: flex; grid-column: 3 / 5; grid-row: 2; justify-self: center; flex-direction: row; gap: 5px; align-items: baseline; }
  .cs-table .r-row > :nth-child(2) b { font-size: 12px; color: var(--muted); }
  .cs-table .r-row > :nth-child(3) { display: block; grid-column: 2; grid-row: 2; justify-self: start; width: auto; }
  .cs-table .r-head > :nth-child(4), .cs-table .r-row > :nth-child(4) { display: flex; grid-column: 2; grid-row: 1; justify-self: stretch; overflow: hidden; }
  .cs-table .r-head > :nth-child(5), .cs-table .r-row > :nth-child(5) { display: block; grid-column: 3; grid-row: 1; }
  .cs-table .r-row > :nth-child(6) { display: none; }
  .cs-table .r-head > :nth-child(7), .cs-table .r-row > :nth-child(7) { display: block; grid-column: 4; grid-row: 1; }
  .cs-table .r-kind { width: auto; }
  .cs-table .r-who .nm { max-width: 100%; }

  /* customers, companies: who | total | debt (the count is in the profile) */
  .c-head, .c-row { --c: minmax(0, 1fr) 88px 92px; }
  .c-head > :nth-child(2), .c-row > :nth-child(2) { display: none; }
  .c-who img { width: 34px; height: 34px; }

  /* expenses: # | kind + note | amount + date */
  [data-page="expenses"] .e-head, [data-page="expenses"] .e-row { --c: 56px minmax(0, 1fr) 96px; }
  [data-page="expenses"] .e-row > .e-no { grid-column: 1; grid-row: 1 / 3; }
  [data-page="expenses"] .e-row > .e-kind { grid-column: 2; grid-row: 1; }
  [data-page="expenses"] .e-row > .e-note { grid-column: 2; grid-row: 2; font-size: 12.5px; color: var(--muted); }
  [data-page="expenses"] .e-row > .e-amt { grid-column: 3; grid-row: 1; }
  [data-page="expenses"] .e-row > .e-date { grid-column: 3; grid-row: 2; text-align: center; font-size: 12px; color: var(--muted); }
  [data-page="expenses"] .e-head > .e-no { grid-column: 1; }
  [data-page="expenses"] .e-head > .e-kind { grid-column: 2; }
  [data-page="expenses"] .e-head > .e-amt { grid-column: 3; }
  [data-page="expenses"] .e-head > .e-date, [data-page="expenses"] .e-head > .e-note { display: none; }
  .e-kind .k-ico { width: 28px; height: 28px; border-radius: 8px; }
  .e-kind .k-ico svg { width: 16px; height: 16px; }
  .e-kind { gap: 6px; }

  /* Omer's own money out: # | date + note | amount */
  [data-page="owner"] .e-head, [data-page="owner"] .e-row { --c: 56px minmax(0, 1fr) 100px; }
  [data-page="owner"] .e-row > .e-no { grid-column: 1; grid-row: 1 / 3; }
  [data-page="owner"] .e-row > .e-date { grid-column: 2; grid-row: 1; }
  [data-page="owner"] .e-row > .e-note { grid-column: 2; grid-row: 2; font-size: 12.5px; color: var(--muted); }
  [data-page="owner"] .e-row > .e-amt { grid-column: 3; grid-row: 1 / 3; }
  [data-page="owner"] .e-head > .e-note { display: none; }

  /* cash box: # | kind + date | in | out */
  [data-page="cash"] .e-head, [data-page="cash"] .e-row { --c: 50px minmax(0, 1fr) 82px 82px; }
  [data-page="cash"] .e-row > .e-no { grid-column: 1; grid-row: 1 / 3; }
  [data-page="cash"] .e-row > .ca-kind { grid-column: 2; grid-row: 1; }
  [data-page="cash"] .e-row > .r-date { grid-column: 2; grid-row: 2; flex-direction: row; justify-content: flex-end; gap: 6px; }
  [data-page="cash"] .e-row > .e-note { display: none; }
  [data-page="cash"] .e-row > .ca-in { grid-column: 3; grid-row: 1 / 3; }
  [data-page="cash"] .e-row > .ca-out { grid-column: 4; grid-row: 1 / 3; }
  [data-page="cash"] .e-head > .e-no { grid-column: 1; }
  [data-page="cash"] .e-head > .ca-kind { grid-column: 2; }
  [data-page="cash"] .e-head > .ca-in { grid-column: 3; }
  [data-page="cash"] .e-head > .ca-out { grid-column: 4; }
  [data-page="cash"] .e-head > .r-date, [data-page="cash"] .e-head > .e-note { display: none; }
  .ca-kind { font-size: 13px; gap: 6px; }
  .ca-kind img { width: 26px; height: 26px; }

  /* receive money, send money: # | who + date | money | debt left */
  [data-page="payin"] .e-head, [data-page="payin"] .e-row,
  [data-page="payout"] .e-head, [data-page="payout"] .e-row { --c: 50px minmax(0, 1fr) 84px 84px; }
  :is([data-page="payin"], [data-page="payout"]) .e-row > .e-no { grid-column: 1; grid-row: 1 / 3; }
  :is([data-page="payin"], [data-page="payout"]) .e-row > .c-who { grid-column: 2; grid-row: 1; white-space: nowrap; overflow: hidden; }
  :is([data-page="payin"], [data-page="payout"]) .e-row > .c-who * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :is([data-page="payin"], [data-page="payout"]) .e-row > .r-date { grid-column: 2; grid-row: 2; flex-direction: row; justify-content: flex-end; gap: 6px; }
  :is([data-page="payin"], [data-page="payout"]) .e-row > .e-note { display: none; }
  :is([data-page="payin"], [data-page="payout"]) .e-row > .e-amt { grid-column: 3; grid-row: 1 / 3; }
  :is([data-page="payin"], [data-page="payout"]) .e-row > .c-money { grid-column: 4; grid-row: 1 / 3; }
  :is([data-page="payin"], [data-page="payout"]) .e-head > .e-no { grid-column: 1; }
  :is([data-page="payin"], [data-page="payout"]) .e-head > .c-who { grid-column: 2; }
  :is([data-page="payin"], [data-page="payout"]) .e-head > .e-amt { grid-column: 3; }
  :is([data-page="payin"], [data-page="payout"]) .e-head > .c-money { grid-column: 4; }
  :is([data-page="payin"], [data-page="payout"]) .e-head > .r-date, :is([data-page="payin"], [data-page="payout"]) .e-head > .e-note { display: none; }

  /* warehouse: product | stock | piece price */
  [data-page="stock"] .st-head, [data-page="stock"] .st-row { --c: minmax(0, 1fr) 92px 72px; }
  [data-page="stock"] .st-head > :nth-child(3), [data-page="stock"] .st-row > :nth-child(3),
  [data-page="stock"] .st-head > :nth-child(n+5), [data-page="stock"] .st-row > :nth-child(n+5) { display: none; }
  [data-page="stock"] .st-row { min-height: 62px; }
  .st-item img { width: 40px; height: 40px; }
  .st-stock { font-size: 13px; }
  .stock-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

  /* gifts: date | product + customer | pieces | cost */
  .g-head, .g-row { --c: 76px minmax(0, 1fr) 54px 84px; }
  .g-row > .g-date { grid-column: 1; grid-row: 1 / 3; font-size: 13px; }
  .g-row > .g-no { display: none; }
  .g-row > .g-item { grid-column: 2; grid-row: 1; }
  .g-row > .g-who { grid-column: 2; grid-row: 2; font-size: 12.5px; color: var(--muted); }
  .g-row > .g-qty { grid-column: 3; grid-row: 1 / 3; }
  .g-row > .g-cost { grid-column: 4; grid-row: 1 / 3; }
  .g-head > .g-date { grid-column: 1; }
  .g-head > .g-item { grid-column: 2; }
  .g-head > .g-qty { grid-column: 3; }
  .g-head > .g-cost { grid-column: 4; }
  .g-head > .g-no, .g-head > .g-who { display: none; }

  /* the receipt window lines: product | qty + unit | total + price */
  .rc-head, .rc-line { --c: minmax(0, 1fr) 62px 92px; }
  .rc-line > .rc-item { grid-column: 1; grid-row: 1 / 3; }
  .rc-line > .rc-qty { grid-column: 2; grid-row: 1; }
  .rc-line > .rc-unit { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--muted); }
  .rc-line > .rc-total { grid-column: 3; grid-row: 1; }
  .rc-line > .rc-price { grid-column: 3; grid-row: 2; font-size: 12px; color: var(--muted); }
  .rc-head > .rc-item { grid-column: 1; }
  .rc-head > .rc-qty { grid-column: 2; }
  .rc-head > .rc-total { grid-column: 3; }
  .rc-head > .rc-unit, .rc-head > .rc-price { display: none; }
  .rc-buttons { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

  /* report: best sellers = # | product + pieces | sales | profit */
  .e-head:has(.rp-rank), .e-row.rp-top { --c: 26px minmax(0, 1fr) 84px 84px; }
  .e-row.rp-top > .rp-rank { grid-column: 1; grid-row: 1 / 3; }
  .e-row.rp-top > .rp-item { grid-column: 2; grid-row: 1; }
  .e-row.rp-top > .rp-qty { grid-column: 2; grid-row: 2; text-align: start; font-size: 12px; color: var(--muted); }
  .e-row.rp-top > .rp-money:nth-child(4) { grid-column: 3; grid-row: 1 / 3; }
  .e-row.rp-top > .rp-money:nth-child(5) { grid-column: 4; grid-row: 1 / 3; }
  .e-head:has(.rp-rank) > .rp-qty { display: none; }
  .rp-item img { width: 34px; height: 34px; }

  /* ---------- sale page ---------- */
  .prod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .prod { min-width: 0; }
  /* product card: the picture keeps a fixed height, the name may take two lines under it */
  .prod { aspect-ratio: auto; }
  .prod .p-pic { flex: none; height: 92px; }
  .prod .p-foot { padding: 6px 6px 7px; }
  .prod .pname { font-size: 12.5px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.25; min-height: 2.5em; }
  .prod .price { font-size: 15px; }
  .prod .stock { font-size: 11.5px; }
  .prod .tick-dot { top: 6px; inset-inline-end: 6px; width: 24px; height: 24px; }
  .sale-main { --gap: 10px; }
  .zcard { padding: 12px; gap: 10px; }
  .zfield { height: 48px; }
  .pay-switch button { height: 40px; }
  .gift-btn { min-width: 0; padding: 0 12px; font-size: 15px; }
  .gift-btn img { width: 24px; height: 24px; }
  /* a goods line on two rows: picture | name ............ total
                                picture | unit | qty | price          */
  .t-head .c-qty, .t-head .c-price { display: none; }
  .t-head .c-total { width: 92px; }
  .line { display: grid; grid-template-columns: 44px auto 64px minmax(0, 1fr); column-gap: 8px; row-gap: 6px; padding: 10px 12px; }
  .line .l-art { grid-column: 1; grid-row: 1 / 3; width: 44px; height: 44px; align-self: start; }
  .line .l-info { display: contents; }
  .line .l-name { grid-column: 2 / 4; grid-row: 1; align-self: center; font-size: 14.5px; -webkit-line-clamp: 1; }
  .line .l-tags { grid-column: 2; grid-row: 2; align-self: center; }
  .line .l-total { grid-column: 4; grid-row: 1; width: auto; text-align: left; font-size: 15px; }
  .line .num-box.q { grid-column: 3; grid-row: 2; width: 100%; height: 42px; }
  .line .num-box.p, .line .gift-price { grid-column: 4; grid-row: 2; width: 100%; height: 42px; }
  .unit-pill { height: 30px; }
  /* money card: smaller, so the goods get the room */
  .sale-side { gap: 10px; padding-top: 8px; }
  .money { gap: 8px; padding: 10px 14px; }
  .m-row { min-height: 26px; }
  .m-row > span { font-size: 15px; }
  .m-total { font-size: 20px; }
  .m-rest { font-size: 17px; }
  .m-row .num-box { width: 140px; height: 44px; font-size: 17px; }
  /* debt sale: «پارەی دراو» and «ماوە» side by side under the total */
  #saleDebtRows { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 8px; border-top: 1px solid var(--hair); }
  #saleDebtRows .hair { display: none; }
  #saleDebtRows .m-row { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; min-height: 0; }
  #saleDebtRows .m-row > span { font-size: 13px; color: var(--muted); }
  #saleDebtRows .m-row .num-box { width: 100%; height: 42px; }
  #saleDebtRows .m-rest { height: 42px; display: flex; align-items: center; }
  .add-row { height: 48px; }
  .line { padding: 8px 12px; }
  .big-btn { height: 52px; font-size: 17px; }

  /* windows */
  .sheet-body { padding-top: 4px; gap: 10px; }
  .quick-btn { height: 52px; font-size: 16px; }
  .cust-row { min-height: 60px; padding: 8px 12px; }
  .ex-kind { height: 84px; font-size: 13px; }
  .ex-date { width: 100%; }
  .pf-three { gap: 8px; }
  /* buying + return windows: a line on two rows
       product name ............ | total |
       unit switch | qty | price         | bin */
  .by-head, .by-line { display: grid; grid-template-columns: 146px 54px minmax(0, 1fr) 36px; column-gap: 6px; row-gap: 8px; padding: 0 10px; }
  .by-line { padding: 10px; min-height: 0; }
  .by-head > *, .by-line > * { width: auto; min-width: 0; }
  .by-line > .by-item, .by-head > .by-item { grid-column: 1 / 3; grid-row: 1; }
  .by-line > .by-total, .by-head > .by-total { grid-column: 3; grid-row: 1; }
  .by-line > .by-unit { grid-column: 1; grid-row: 2; }
  .by-line > .by-qty { grid-column: 2; grid-row: 2; }
  .by-line > .by-cost { grid-column: 3; grid-row: 2; }
  .by-line > .by-del { grid-column: 4; grid-row: 1 / 3; align-self: center; width: 36px; }
  .by-head > .by-unit, .by-head > .by-qty, .by-head > .by-cost, .by-head > .by-del { display: none; }
  .by-line .num-box { width: 100%; height: 42px; font-size: 16px; }
  .by-item img { width: 36px; height: 36px; }
  .by-total { font-size: 15px; }

  /* customer / company profile: the action buttons share one full row */
  .cp-actions { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  .cp-actions .mini-btn { padding: 0 6px; gap: 4px; font-size: 13.5px; justify-content: center; white-space: nowrap; }
  .cp-actions .mini-btn svg { width: 16px; height: 16px; }

  /* product window: units table */
  .u-head, .u-row { gap: 6px; }
  .u-pcs { width: 62px; }
  .u-cost { width: 74px; font-size: 14px; }
  .u-sell { width: 104px; }
  .u-row .num-box { height: 42px; font-size: 16px; }
}

/* PHONE HELD SIDEWAYS (about 956 x 440): the sale page puts the goods on one side and the money + Save on the other,
   like the iPad held sideways, or the money card leaves no room for the goods */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 999px) {
  .sale-wrap { flex-direction: row; gap: 14px; }
  .sale-side { width: 320px; flex: none; padding-top: 50px; overflow-y: auto; gap: 10px; }
  .sale-main { --gap: 10px; }
  .money { gap: 8px; padding: 10px 14px; }
  .m-row .num-box { width: 130px; height: 44px; }
  .m-total { font-size: 20px; }
  .sale-side .big-btn { height: 50px; }
  .zcard { padding: 10px; gap: 8px; }
  .page { padding-top: calc(env(safe-area-inset-top, 0px) + 8px); }
}

/* ---------- WORKERS + USERS PAGE (Yusf 19/11/2026, like the newest Zagros Market) ---------- */
/* who made a paper: under its time in the tables, and in the receipt window */
.r-date small.by, .e-date small.by { color: var(--blue); font-size: 11.5px; font-weight: 700; direction: rtl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.e-date { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.rc-by { font-size: 13px; font-weight: 700; color: var(--blue); }
/* a paper's window opened by a worker who may not change it */
.sheet.view-only .sheet-foot { display: none !important; }
.sheet.view-only .sheet-body input, .sheet.view-only .sheet-body textarea, .sheet.view-only .sheet-body button,
.sheet.view-only .sheet-body label { pointer-events: none; }
.sheet.view-only .sheet-body input { color: var(--muted); }
/* a worker who may not see what goods cost */
body.no-cost [data-page="stock"] .st-head > :nth-child(3), body.no-cost [data-page="stock"] .st-row > :nth-child(3),
body.no-cost #pfSheet.editing #pfCostCard, body.no-cost #pfSheet.editing .u-cost, body.no-cost .stat:has(#stValue) { display: none !important; }
.pay-switch button:disabled { opacity: 0.35; }
.num-box[readonly] { background: var(--bg); color: var(--muted); }

/* the users table */
.us-head, .us-row { display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.us-head { height: 44px; background: var(--head); color: #fff; font-size: 14px; font-weight: 700; }
.us-head span { color: #fff; }
.us-row { min-height: 72px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.us-row:last-child { border-bottom: 0; }
.us-row:nth-child(even) { background: #FAFBFC; }
@media (prefers-color-scheme: dark) { .us-row:nth-child(even) { background: #1E222A; } }
.us-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.us-pages { width: 150px; flex: none; text-align: center; }
.us-acts { width: 150px; flex: none; display: flex; gap: 8px; justify-content: flex-end; }
.us-ava { width: 42px; height: 42px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #0E7C70, #14B8A6); box-shadow: 0 3px 10px rgba(16, 24, 40, 0.15); }
.us-ava svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.us-ava.owner { background: linear-gradient(135deg, #1540E5, #3D63F0); }
.us-ava.c1 { background: linear-gradient(135deg, #6941E8, #8F74FA); }
.us-ava.c2 { background: linear-gradient(135deg, #C2410C, #F97316); }
.us-ava.c3 { background: linear-gradient(135deg, #128A4E, #22B36B); }
.us-ava.c4 { background: linear-gradient(135deg, #BE185D, #EC4899); }
.us-ava.big { width: 52px; height: 52px; }
.us-ava.big svg { width: 26px; height: 26px; }
.us-nm { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.us-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.us-line b { font-size: 16.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-nm small { font-size: 13px; font-weight: 700; color: var(--muted); direction: ltr; text-align: right; }
.us-badge { flex: none; font-size: 12px; font-weight: 700; color: var(--blue); background: rgba(21, 64, 229, 0.1); border-radius: 999px; padding: 2px 10px; }
.us-badge.you { color: #7A5AF8; background: rgba(122, 90, 248, 0.12); }
.us-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 9px; background: var(--bg); color: var(--label); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.us-act { width: 38px; height: 38px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card); display: flex; align-items: center; justify-content: center; padding: 0; color: var(--muted); }
.us-act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.us-act.edit { color: var(--blue); }
.us-act.del { color: var(--red); }
.us-act:active { transform: scale(0.95); }

/* the add / edit window */
.us-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }
.us-top { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.us-top > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.us-top .f-label { margin-bottom: -6px; }
.us-perm-box { display: flex; flex-direction: column; gap: 10px; }
.us-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.us-presets button { height: 46px; border: 1.5px solid var(--hair); border-radius: 13px; background: var(--card); color: var(--label); font-size: 15px; font-weight: 700; }
.us-presets button.on { border-color: #1540E5; background: rgba(21, 64, 229, 0.08); color: var(--blue); }
.us-plist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.us-page { border: 1.5px solid var(--hair); border-radius: 14px; background: var(--card); overflow: hidden; transition: border-color 0.15s ease; }
.us-page.on { border-color: #1540E5; box-shadow: 0 2px 10px rgba(21, 64, 229, 0.1); }
.us-page-head { width: 100%; min-height: 60px; border: 0; background: transparent; color: var(--text); display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-align: start; }
.us-page-art { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; filter: grayscale(0.85); opacity: 0.55; }
.us-page.on .us-page-art { filter: none; opacity: 1; }
.us-page-art img { width: 38px; height: 38px; object-fit: contain; }
.us-page-ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(21, 64, 229, 0.1); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.us-page-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.us-page-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-page.on .us-page-title { color: var(--text); }
.us-count { flex: none; font-size: 12.5px; font-weight: 700; color: var(--blue); background: rgba(21, 64, 229, 0.08); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.us-dos { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 2px 12px 12px; }
.us-do { min-height: 42px; border: 0; border-radius: 10px; background: var(--bg); color: var(--label); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; font-size: 14px; font-weight: 700; text-align: start; }
.us-do.on { background: rgba(21, 64, 229, 0.08); color: var(--blue); }
/* the switch: on = blue, knob on the left (Kurdish reads right to left) */
.us-sw { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: #D5DAE3; transition: background-color 0.15s ease; }
.us-sw > span { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: right 0.15s ease; }
.us-sw.on { background: #1540E5; }
.us-sw.on > span { right: 21px; }
.us-do .us-sw { width: 36px; height: 21px; }
.us-do .us-sw > span { width: 15px; height: 15px; }
.us-do .us-sw.on > span { right: 18px; }
@media (prefers-color-scheme: dark) { .us-sw { background: #4A5163; } }
.us-who-card { justify-content: flex-start; }
@media (max-width: 760px) { .us-plist { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .us-top { grid-template-columns: 1fr; }
  .us-presets { grid-template-columns: repeat(2, 1fr); }
  .us-head, .us-row { padding: 0 10px; gap: 8px; }
  .us-pages { width: 84px; }
  .us-acts { width: auto; gap: 6px; }
  .us-act { width: 36px; height: 36px; }
  .us-chip { padding: 4px 8px; height: auto; min-height: 30px; font-size: 12px; white-space: normal; text-align: center; line-height: 1.3; }
  .us-pages { width: 70px; }
  .us-badge.you { display: none; }
  .us-line b { font-size: 15px; }
  .us-ava { width: 38px; height: 38px; }
}

/* SALE PAGE (Yusf 19/11/2026): gift in the customer row; «واصل / غير واصل» switch above Save */
.cust-line .gift-btn { flex: none; min-width: 0; padding: 0 16px; border-radius: 13px; }
.sale-pay { background: var(--card); box-shadow: 0 4px 16px rgba(16, 24, 40, 0.08); padding: 5px; border-radius: 16px; }
.sale-pay button { height: 46px; font-size: 17px; }
@media (max-width: 600px) {
  .cust-line { gap: 8px; }
  /* phone: the gift button is its picture only, so the customer's name keeps its room */
  .cust-line .gift-btn { width: 50px; padding: 0; gap: 0; font-size: 0; justify-content: center; }
  .cust-line .gift-btn img { width: 28px; height: 28px; }
  .cust-open { gap: 6px; padding: 0 8px; }
  .cust-open .debt-pill.small { padding: 2px 7px; font-size: 12px; }
  .cust-field .clear-x { width: 30px; }
  .sale-pay { padding: 4px; }
  .sale-pay button { height: 42px; font-size: 16px; }
}

/* units table (Yusf 19/11/2026): «10 دانە» in a taka, «10 تاکە» in a carton */
.u-pcs { display: flex; align-items: center; gap: 6px; }
.u-pcs .num-box { flex: 1; min-width: 0; width: auto; }
.u-pcs .u-fixed { flex: 1; text-align: center; }
.u-unit { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); }
@media (max-width: 600px) { .u-head, .u-row { gap: 5px; padding: 0 6px; } .u-name { gap: 6px; } .u-pcs { width: 78px; gap: 3px; } .u-cost { width: 64px; font-size: 12.5px; } .u-sell { width: 90px; } .u-unit { font-size: 11px; } }

/* LAPTOP + every big screen (Yusf 21/11/2026: "he will use it on a laptop too, all pages side to side"):
   the content of every PAGE uses the whole width, the same on every page (windows keep their centred width,
   and form fields stay short) */
.home-grid, .sale-wrap, .stat-cards, .list-card, .chips.period, .filters, .filters .range, .stock-grid, .group-chips,
.ca-buttons, .rp-two, .st-two, .st-list { max-width: none; }
/* «غير واصل» is longer than «قەرز»: the kind pill never breaks into two lines */
.kind-pill { white-space: nowrap; }
.r-kind { width: 88px; }
/* a window's head (X) and its buttons line up with its fields, also on a laptop (Yusf 21/11/2026) */
.sheet:has(> .sheet-body:not(.wide):not(.pf-body):not([hidden])) > .sheet-head,
.sheet:has(> .sheet-body:not(.wide):not(.pf-body):not([hidden])) > .sheet-foot:not([hidden]) { max-width: 760px; }
.sheet:has(> .pf-body:not([hidden])) > .sheet-head, .sheet:has(> .pf-body:not([hidden])) > .sheet-foot { max-width: 860px; }
/* laptop with a mouse: rows, boxes and buttons answer when the pointer is over them */
@media (hover: hover) and (pointer: fine) {
  .r-row:hover, .c-row:hover, .e-row:hover, [data-page="stock"] .st-row:hover, .us-row:hover, .cust-row:hover,
  .st-list .st-row:hover { background: rgba(21, 64, 229, 0.05); }
  .home-box, .prod, .quick-btn, .big-btn, .add-btn, .mini-btn, .tab, .round { transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease; }
  .home-box:hover, .prod:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 24, 40, 0.12); }
  .big-btn:hover, .add-btn:hover, .quick-btn:hover { filter: brightness(1.06); }
  .tab:not([aria-current]):hover { background: var(--pick); }
  .round:hover, .mini-btn:hover, .us-act:hover { box-shadow: 0 4px 12px rgba(16, 24, 40, 0.16); }
}
