/* BECOOL — mock UI styles. Plain CSS, no build step, no @layer.
   Colours only through the tokens below (light + dark). */

/* Palette = the BECOOL logo: black on white (dark mode = white on black).
   Colour is used only where it carries meaning: green = good / paid, red = out of stock / due,
   amber = low stock, WhatsApp green on the WhatsApp button. */
:root {
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --surface-2: #F1F1F1;
  --surface-3: #E8E8E8;
  --border: #E4E4E4;
  --border-strong: #CFCFCF;
  --text: #0A0A0A;
  --text-2: #4A4A4A;
  --text-3: #838383;

  --primary: #0A0A0A;
  --primary-hover: #2B2B2B;
  --primary-50: #EFEFEF;
  --primary-100: #DADADA;
  --on-primary: #FFFFFF;

  --success: #15803D;  --success-50: #E8F6ED;
  --danger: #C62828;   --danger-50: #FCEBEB;
  --warning: #A65A07;  --warning-50: #FDF2E2;
  --info: #0A0A0A;     --info-50: #EFEFEF;
  --violet: #0A0A0A;   --violet-50: #EFEFEF;
  --wa: #179C4B;       --wa-50: #E7F6EC;  --wa-hover: #12823E;

  --c1: #0A0A0A; --c2: #5A5A5A; --c3: #9C9C9C; --c4: #CCCCCC;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px -16px rgba(0, 0, 0, .18);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .35);
  --ring: 0 0 0 3px rgba(10, 10, 10, .18);
  --logo-filter: none;
  --logo-blend: multiply;

  --sidebar-w: 252px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0A; --surface: #141414; --surface-2: #1C1C1C; --surface-3: #242424;
    --border: #262626; --border-strong: #3B3B3B;
    --text: #F5F5F5; --text-2: #B0B0B0; --text-3: #7A7A7A;
    --primary: #FFFFFF; --primary-hover: #E2E2E2; --primary-50: #222222; --primary-100: #353535; --on-primary: #0A0A0A;
    --success: #4ACB7A; --success-50: #0F2619; --danger: #F07070; --danger-50: #2E1414;
    --warning: #F0A74A; --warning-50: #2C1E0C; --info: #F5F5F5; --info-50: #222222;
    --violet: #F5F5F5; --violet-50: #222222; --wa: #3CCB73; --wa-50: #0E2618; --wa-hover: #52D885;
    --c1: #F5F5F5; --c2: #A5A5A5; --c3: #6A6A6A; --c4: #3E3E3E;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
    --ring: 0 0 0 3px rgba(255, 255, 255, .25);
    --logo-filter: invert(1);
    --logo-blend: screen;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0A; --surface: #141414; --surface-2: #1C1C1C; --surface-3: #242424;
  --border: #262626; --border-strong: #3B3B3B;
  --text: #F5F5F5; --text-2: #B0B0B0; --text-3: #7A7A7A;
  --primary: #FFFFFF; --primary-hover: #E2E2E2; --primary-50: #222222; --primary-100: #353535; --on-primary: #0A0A0A;
  --success: #4ACB7A; --success-50: #0F2619; --danger: #F07070; --danger-50: #2E1414;
  --warning: #F0A74A; --warning-50: #2C1E0C; --info: #F5F5F5; --info-50: #222222;
  --violet: #F5F5F5; --violet-50: #222222; --wa: #3CCB73; --wa-50: #0E2618; --wa-hover: #52D885;
  --c1: #F5F5F5; --c2: #A5A5A5; --c3: #6A6A6A; --c4: #3E3E3E;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  --ring: 0 0 0 3px rgba(255, 255, 255, .25);
  --logo-filter: invert(1);
  --logo-blend: screen;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }
:focus-visible { outline: none; box-shadow: var(--ring); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-hover); border-color: var(--wa-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-block { width: 100%; }
.btn-lg { height: 48px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
  height: 46px; width: 100%; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: var(--ring); }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.error-text { color: var(--danger); font-size: 13px; font-weight: 500; display: flex; gap: 6px; align-items: center; }

/* ---------- logo (the shop's own BECOOL artwork, a JPG on white) ----------
   multiply hides the white box on light backgrounds; dark mode / black panels
   invert it to white-on-black and use screen to hide the black box. */
.brand-logo { display: block; height: 36px; width: auto; filter: var(--logo-filter); mix-blend-mode: var(--logo-blend); user-select: none; -webkit-user-drag: none; }
.on-black .brand-logo { filter: invert(1); mix-blend-mode: screen; }
.logo-tag { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.logo { display: block; color: var(--text); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.chip-success { background: var(--success-50); color: var(--success); }
.chip-danger  { background: var(--danger-50);  color: var(--danger); }
.chip-warning { background: var(--warning-50); color: var(--warning); }
.chip-info    { background: var(--info-50);    color: var(--info); }
.chip-violet  { background: var(--violet-50);  color: var(--violet); }
.chip-primary { background: var(--primary-50); color: var(--primary); }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: #111111; color: #F2F2F2; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.45;
  animation: toast-in .2s ease-out; pointer-events: auto;
}
.toast .ic { color: #FFFFFF; margin-top: 1px; }
.toast-error .ic { color: #FF8A8A; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* =========================================================
   LOGIN
   ========================================================= */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.05fr); }
.login-brand {
  position: relative; overflow: hidden; padding: 40px 48px; color: #F2F2F2;
  background: #0A0A0A;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand::before, .login-brand::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255,255,255,.09);
}
.login-brand::before { width: 520px; height: 520px; right: -200px; top: -160px; }
.login-brand::after  { width: 360px; height: 360px; right: -120px; top: -80px; }
.login-brand .logo { position: relative; display: block; }
.login-brand .brand-logo { height: 54px; }
.login-brand .logo-tag { color: rgba(242,242,242,.55); }
.brand-copy { position: relative; max-width: 440px; }
.brand-copy h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.8px; font-weight: 800; }
.brand-copy p { margin-top: 12px; color: rgba(242,242,242,.78); font-size: 15px; }
.brand-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.brand-points li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.brand-points .pt { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.12); }
.brand-preview {
  position: relative; margin-top: 36px; max-width: 400px; padding: 16px; border-radius: 16px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px);
}
.brand-preview .row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: rgba(242,242,242,.8); }
.brand-preview .big { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -.5px; margin-top: 2px; }
.brand-preview .bars { display: flex; align-items: flex-end; gap: 6px; height: 48px; margin-top: 12px; }
.brand-preview .bars span { flex: 1; border-radius: 4px 4px 2px 2px; background: rgba(255,255,255,.28); }
.brand-preview .bars span:last-child { background: #FFFFFF; }
.brand-foot { position: relative; font-size: 12.5px; color: rgba(242,242,242,.6); }

.login-main { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 380px; }
.login-card .logo { display: none; margin-bottom: 28px; }
.login-card .brand-logo { height: 46px; }
.login-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.login-card .sub { color: var(--text-2); margin-top: 6px; }
.login-form { display: grid; gap: 20px; margin-top: 28px; }

.phone-input {
  display: flex; align-items: center; height: 50px; border: 1px solid var(--border-strong);
  border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.phone-input:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.phone-input .cc { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 14px; height: 100%; border-right: 1px solid var(--border); color: var(--text-2); font-weight: 600; }
.phone-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; padding: 0 14px; font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.phone-input.invalid, .pin-row.invalid .pin-box { border-color: var(--danger); }

.pin-head { display: flex; justify-content: space-between; align-items: center; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--primary); font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.link-btn:hover { text-decoration: underline; }
.pin-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pin-box {
  width: 100%; aspect-ratio: 1 / 1.08; max-height: 58px; text-align: center; font-size: 22px; font-weight: 700;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pin-box:focus { border-color: var(--primary); box-shadow: var(--ring); }
.pin-box.filled { background: var(--primary-50); border-color: var(--primary-100); }
.pin-row.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.check { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.demo-hint {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); color: var(--text-2); font-size: 13px; margin-top: 24px;
}
.demo-hint b { color: var(--text); }
.login-foot { margin-top: 28px; text-align: center; font-size: 12.5px; color: var(--text-3); }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-main { align-items: start; padding-top: 56px; background: var(--bg); }
  .login-card { background: var(--surface); padding: 28px 22px; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
  .login-card .logo { display: block; }
  .pin-row { gap: 8px; }
}

/* =========================================================
   APP SHELL
   ========================================================= */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px 14px;
}
.sidebar .logo { padding: 6px 8px 20px; display: block; }
.sidebar .brand-logo { height: 40px; }
.sidebar .new-sale { margin: 0 2px 16px; height: 44px; }
.nav { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.nav-group { margin-bottom: 14px; }
.nav-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-50); color: var(--primary); font-weight: 650; }
.nav a .count { margin-left: auto; font-size: 11.5px; font-weight: 700; background: var(--danger-50); color: var(--danger); padding: 1px 7px; border-radius: 99px; }
.side-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-100); color: var(--primary); font-weight: 700; font-size: 13px; }
.side-foot .who { flex: 1; min-width: 0; line-height: 1.3; }
.side-foot .who b { display: block; font-size: 13.5px; }
.side-foot .who span { font-size: 12px; color: var(--text-3); }
.scrim { display: none; }

.main { margin-left: var(--sidebar-w); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-btn, .topbar .logo { display: none; }
.search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text-3);
}
.search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); }
.search kbd { font: 600 11px var(--font); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--text-3); background: var(--surface-2); }
.topbar .spacer { flex: 1; }
.date-chip { font-size: 13px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 8px; padding-right: 6px; }

.content { padding: 26px 28px 48px; max-width: 1360px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); display: grid; gap: 4px; position: relative;
}
.kpi-top { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.kpi-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.kpi-ic { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.kpi-val { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin-top: 8px; line-height: 1.15; }
.kpi-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }
.owner-only { position: absolute; top: 14px; right: 14px; }

.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.mini {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: inherit;
  transition: border-color .15s;
}
.mini:hover { border-color: var(--border-strong); }
.mini .kpi-ic { width: 40px; height: 40px; border-radius: 11px; }
.mini .txt { flex: 1; min-width: 0; }
.mini .lbl { font-size: 13px; color: var(--text-2); font-weight: 600; }
.mini .val { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.mini .sub { font-size: 12px; color: var(--text-3); }
.mini > .ic:last-child { color: var(--text-3); }

/* ---------- cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; display: flex; flex-direction: column; }
.span-2 { grid-column: span 2; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; }
.card-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.card-body { padding: 10px 18px 16px; flex: 1; }
.card-link { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* bar chart */
.chart-sum { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-sum .v { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.chart-sum .l { font-size: 12px; color: var(--text-3); font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 210px; padding-top: 28px; border-bottom: 1px solid var(--border); position: relative; }
.bars .gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); pointer-events: none; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar i { display: block; width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: var(--primary-100); transition: background .15s; }
.bar.today i { background: var(--primary); }
.bar:hover i { background: var(--primary); }
.bar .tip {
  position: absolute; bottom: calc(var(--h) + 6px); padding: 3px 7px; border-radius: 7px; font-size: 11.5px; font-weight: 700;
  background: var(--text); color: var(--surface); white-space: nowrap; opacity: 0; transform: translateY(4px); transition: .15s; pointer-events: none;
}
.bar:hover .tip, .bar.today .tip { opacity: 1; transform: none; }
.bar-labels { display: flex; gap: 8px; margin-top: 8px; }
.bar-labels span { flex: 1; min-width: 0; text-align: center; font-size: 11.5px; color: var(--text-3); font-weight: 500; overflow: hidden; }
.bar-labels span.today { color: var(--primary); font-weight: 700; }
.bars.many { gap: 3px; }
.bars.many .bar i { border-radius: 3px 3px 1px 1px; }
.bar-labels.many { gap: 3px; }

/* payment split */
.split-total { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.split-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin: 12px 0 16px; gap: 3px; }
.split-bar span { display: block; height: 100%; }
.legend { display: grid; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-row .nm { flex: 1; color: var(--text-2); font-weight: 500; }
.legend-row .pc { color: var(--text-3); font-size: 12.5px; width: 38px; text-align: right; }
.legend-row .am { font-weight: 700; min-width: 72px; text-align: right; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.note .ic { color: var(--primary); margin-top: 1px; }

/* recent bills list */
.bill-list { list-style: none; margin: 0; padding: 0; }
.bill {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) 140px auto; gap: 14px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--border);
}
.bill:hover { background: var(--surface-2); }
.bill .no { font-weight: 700; font-size: 13.5px; }
.bill .tm { font-size: 12px; color: var(--text-3); }
.bill .cust { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bill .cust span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill .items { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill .amt { font-weight: 800; font-size: 15px; text-align: right; }
.bill .pay { display: flex; justify-content: flex-end; margin-top: 3px; }
.bill .acts { display: flex; gap: 6px; justify-content: flex-end; }
.wa-btn {
  height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px;
  background: var(--wa-50); color: var(--wa); font-weight: 700; font-size: 13px;
}
.wa-btn:hover { background: var(--wa); color: #fff; }
.wa-btn:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.sm-btn { height: 34px; width: 34px; border-radius: 9px; display: inline-grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.sm-btn:hover { color: var(--text); border-color: var(--border-strong); }
.wa-ic { width: 16px; height: 16px; fill: currentColor; stroke: none; }

/* simple lists */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.rows li:first-child { border-top: 0; }
.thumb { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.rows .t { flex: 1; min-width: 0; }
.rows .t b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .t span { font-size: 12px; color: var(--text-3); }
.rows .r { text-align: right; }
.rows .r b { display: block; font-weight: 700; }
.rows .r span { font-size: 12px; color: var(--text-3); }

.hbar { display: grid; gap: 12px; }
.hbar-row .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.hbar-row .top span { color: var(--text-2); font-weight: 500; }
.hbar-row .top b { font-weight: 700; }
.hbar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }

.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.tabs button { border: 0; background: none; height: 38px; padding: 0 4px; margin-right: 14px; font-weight: 600; font-size: 13px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--primary); }

/* ---------- dialog ---------- */
dialog.dlg {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border);
  border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.dlg::backdrop { background: rgba(8, 18, 20, .5); backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.dlg-head .wa-badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--wa-50); color: var(--wa); }
.dlg-head .wa-badge .wa-ic { width: 22px; height: 22px; }
.dlg-head h3 { font-size: 16px; font-weight: 750; }
.dlg-head p { font-size: 12.5px; color: var(--text-3); }
.dlg-head .icon-btn { margin-left: auto; }
.dlg-body { padding: 18px 20px; display: grid; gap: 16px; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.to-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.to-card .t { flex: 1; min-width: 0; }
.to-card b { display: block; }
.to-card span { font-size: 12.5px; color: var(--text-3); }
.pdf-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--border-strong); }
.pdf-card .pdf { width: 36px; height: 42px; border-radius: 6px; background: var(--danger-50); color: var(--danger); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.pdf-card .t { flex: 1; min-width: 0; font-size: 13px; }
.pdf-card .t b { display: block; }
.pdf-card .t span { color: var(--text-3); font-size: 12px; }

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
  .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(8, 18, 20, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-grid; }
}
@media (max-width: 760px) {
  body.app { padding-bottom: 76px; }
  .topbar { padding: 0 12px; height: 58px; gap: 6px; }
  .topbar .logo { display: flex; }
  .topbar .brand-logo { height: 22px; }
  .topbar .search, .date-chip, .topbar .menu-btn { display: none; }
  .content { padding: 18px 16px 32px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 22px; }
  .quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .quick .btn { flex-direction: column; height: auto; padding: 12px 4px; gap: 6px; font-size: 12px; border-radius: 14px; }
  .quick .btn .ic { width: 20px; height: 20px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-val { font-size: 20px; margin-top: 4px; }
  .kpi-top { font-size: 12px; }
  .kpi-top .kpi-ic { display: none; }
  .owner-only { display: none; }
  .mini-kpis { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .bars { height: 170px; gap: 6px; }
  .chart-sum { gap: 16px; }
  .chart-sum .v { font-size: 16px; }
  .chart-sum .l { font-size: 11px; }
  .bill { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; }
  .bill .c-no { grid-column: 1; grid-row: 2; display: flex; gap: 8px; align-items: baseline; }
  .bill .c-cust { grid-column: 1; grid-row: 1; }
  .bill .c-amt { grid-column: 2; grid-row: 1 / 3; }
  .bill .c-acts { grid-column: 1 / -1; grid-row: 3; margin-top: 6px; }
  .bill .no { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
  .bill .items { display: none; }
  .bill .acts { justify-content: flex-start; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    height: calc(66px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--text-3); font-size: 11px; font-weight: 600;
  }
  .bottom-nav .active { color: var(--primary); }
  .bottom-nav .fab span.circle {
    width: 50px; height: 50px; margin-top: -22px; border-radius: 16px; display: grid; place-items: center;
    background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--primary) 70%, transparent);
    border: 4px solid var(--surface);
  }
  .bottom-nav .fab { color: var(--primary); }
  .toasts { bottom: 86px; }
  dialog.dlg { margin-bottom: 0; border-radius: 20px 20px 0 0; width: 100vw; max-width: 100vw; }
}

/* =========================================================
   VENDORS
   ========================================================= */
.req { color: var(--danger); }
.opt { font-weight: 500; color: var(--text-3); }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input.invalid { border-color: var(--danger); }
.phone-input.sm { height: 46px; border-radius: 11px; }
.phone-input.sm input { font-size: 15px; letter-spacing: .3px; }
.money-input { display: flex; align-items: center; height: 46px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.money-input:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.money-input span { padding: 0 4px 0 14px; color: var(--text-3); font-weight: 600; }
.money-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; padding: 0 14px 0 4px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
dialog.dlg-wide { width: min(620px, calc(100vw - 24px)); }
dialog.dlg form { display: contents; }
.dlg-head .kpi-ic { width: 40px; height: 40px; border-radius: 12px; }

.quick-one { display: flex; gap: 8px; }
.list-card { margin-top: 14px; }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.toolbar .search { max-width: 380px; }

.v-head-row, .v-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 150px 140px 24px; gap: 16px; align-items: center; padding: 0 18px; }
.v-head-row { height: 38px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); }
.r { text-align: right; }
.v-list { list-style: none; margin: 0; padding: 0; }
.v-list li + li { border-top: 1px solid var(--border); }
.v-row { min-height: 70px; padding-top: 12px; padding-bottom: 12px; color: inherit; transition: background .12s; }
.v-row:hover { background: var(--surface-2); }
.v-row.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 40% { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--primary); } 100% { background: transparent; } }
.v-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.v-name .t { min-width: 0; }
.v-name b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-name .t > span { font-size: 12.5px; color: var(--text-3); }
.v-mob { color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.v-buy b { display: block; }
.v-buy span { font-size: 12px; color: var(--text-3); }
.due { color: var(--danger); }
.v-go { color: var(--text-3); display: grid; justify-items: end; }
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty .thumb { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 6px; }
.empty p { font-size: 13px; color: var(--text-3); }

/* vendor page */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.crumbs a:hover { color: var(--text); }
.crumbs > span:last-child { color: var(--text); font-weight: 600; }
.v-hero { padding: 20px; }
.v-hero-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar.xl { width: 56px; height: 56px; font-size: 19px; border-radius: 16px; background: var(--primary); color: var(--on-primary); }
.v-hero-name { flex: 1; min-width: 200px; }
.v-hero-name h1 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.v-hero-name p { display: flex; align-items: center; gap: 6px; color: var(--text-2); margin-top: 3px; }
.v-hero-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.v-contact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.c-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.c-line .c-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); flex: none; }
.c-line .t { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.c-line .t > span { font-size: 12px; }
.c-line .t b { font-size: 14px; display: grid; font-weight: 600; }
.c-line.addr .t b .muted { font-size: 12.5px; font-weight: 500; }
.wa-sq { color: var(--wa); }
.wa-sq:hover { background: var(--wa); color: #fff; border-color: var(--wa); }
.kpi-due.is-due .kpi-val { color: var(--danger); }

.big-tabs { padding: 0 18px; }
.big-tabs button { height: 50px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.tab-n { font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.tabs button.on .tab-n { background: var(--primary); color: var(--on-primary); }
.tab-panel { padding: 6px 0 8px; }

/* purchase bills (goods received) */
.pb-list { padding: 8px 18px 10px; display: grid; gap: 10px; }
details.pb { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
details.pb[open] { border-color: var(--border-strong); }
.pb summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.pb summary::-webkit-details-marker { display: none; }
.pb summary:hover { background: var(--surface-2); }
.pb-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.pb-main { flex: 1; min-width: 0; display: grid; }
.pb-main b { font-size: 14px; }
.pb-main span { font-size: 12.5px; color: var(--text-3); }
.pb-amt { font-weight: 800; font-size: 15px; }
.pb-chev { color: var(--text-3); transition: transform .15s; display: grid; }
details.pb[open] .pb-chev { transform: rotate(90deg); }
.lines { border-top: 1px solid var(--border); background: var(--surface); }
.ln, .it { display: grid; grid-template-columns: minmax(0, 1fr) 70px 90px 110px; gap: 12px; align-items: center; padding: 10px 14px; font-size: 13.5px; }
.it { grid-template-columns: minmax(0, 1fr) 100px 100px 110px 100px; padding: 11px 18px; border-top: 1px solid var(--border); }
.ln + .ln { border-top: 1px dashed var(--border); }
.ln-head, .it-head { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding-top: 9px; padding-bottom: 9px; }
.it-head { border-top: 0; }
.ln-item { min-width: 0; display: grid; }
.ln-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-item span { font-size: 12px; color: var(--text-3); }
.ln-extra { color: var(--text-2); }
.ln-total { background: var(--surface-2); font-weight: 800; border-top: 1px solid var(--border) !important; }

/* account statement */
.ac-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px 14px; }
.ac-top > div { display: grid; }
.ac-top .muted { font-size: 12.5px; font-weight: 600; }
.ac-top b { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.ac { display: grid; grid-template-columns: 110px minmax(0, 1fr) 110px 110px 120px; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.ac-head { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding-top: 9px; padding-bottom: 9px; }
.ac-date { color: var(--text-2); font-weight: 500; }
.ac-what { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ac-what > span:last-child { display: grid; min-width: 0; }
.ac-what b { font-weight: 600; }
.ac-what > span:last-child > span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.ac-ic.pay { background: var(--success-50); color: var(--success); }
.ac-minus { color: var(--success); font-weight: 600; }
.ac-plus { font-weight: 600; }
.ac-open { background: var(--surface-2); }

/* pay dialog */
.due-box { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }
.due-box span { color: var(--text-2); font-weight: 600; }
.due-box b { font-size: 22px; font-weight: 800; }
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.pill:hover { border-color: var(--text-3); color: var(--text); }
.pill.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

@media (max-width: 1024px) {
  .v-contact { grid-template-columns: 1fr 1fr; }
  .v-contact .addr { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .quick-one { width: 100%; }
  .quick-one .btn { flex: 1; height: 46px; }
  .toolbar { padding: 12px 14px; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .v-head-row { display: none; }
  .v-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; }
  .v-row .v-name { grid-column: 1; grid-row: 1; }
  .v-row .v-mob { grid-column: 1; grid-row: 2; padding-left: 48px; font-size: 12.5px; }
  .v-row .v-due { grid-column: 2; grid-row: 1; }
  .v-row .v-buy { grid-column: 2; grid-row: 2; }
  .v-row .v-buy span { display: none; }
  .v-row .v-buy b { font-weight: 500; font-size: 12.5px; color: var(--text-3); }
  .v-row .v-go { display: none; }
  .v-hero { padding: 16px; }
  .v-hero-name h1 { font-size: 20px; }
  .v-hero-acts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .v-hero-acts .btn-primary { grid-column: 1 / -1; order: -1; height: 46px; }
  .v-contact { grid-template-columns: 1fr; }
  .big-tabs { padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
  .big-tabs button { white-space: nowrap; margin-right: 10px; }
  .pb-list { padding: 8px 12px 10px; }
  .ln, .it, .ac { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 14px; }
  .ln-head, .it-head, .ac-head { display: none; }
  .ln .ln-item, .it .ln-item, .ac .ac-what { grid-column: 1 / -1; }
  .ln .r, .it .r, .ac .r { text-align: left; }
  .ln [data-l]::before, .it [data-l]::before, .ac [data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
  .ln-extra, .ln-total { grid-template-columns: minmax(0, 1fr) auto; }
  .ln-extra span:empty, .ln-total span:empty { display: none; }
  .ln-total > span:nth-child(2) { display: none; }
  .ln-extra .r, .ln-total .r { text-align: right; }
  .it .r:last-child { grid-column: auto; }
  .ac-date { grid-column: 1 / -1; grid-row: 1; font-size: 12px; color: var(--text-3); }
  .ac .ac-what { grid-row: 2; }
  .ac span:empty { visibility: hidden; }
  .ac-top b { font-size: 20px; }
}
.due-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; margin: -4px -8px; padding: 4px 8px; border-radius: 10px; }
.due-link:hover { background: var(--surface-2); }
.v-mob { display: grid; white-space: nowrap; }
.v-mob .muted { font-size: 12px; }
@media (max-width: 760px) { .v-row .v-mob .muted { display: none; } }
.field { align-content: start; }
dialog.dlg[open] { display: flex; flex-direction: column; }
dialog.dlg .dlg-head, dialog.dlg .dlg-foot { flex: none; }
dialog.dlg .dlg-body { overflow-y: auto; min-height: 0; }
.nowrap { white-space: nowrap; }
.c-line { padding-left: 14px; }
.c-line.addr { padding-left: 10px; }

/* =========================================================
   CATEGORIES · PURCHASE BILL · SALE
   ========================================================= */
.content.narrow { max-width: 860px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); background: var(--danger); border-color: var(--danger); }
.sm-btn:disabled { opacity: .4; cursor: not-allowed; }
.okc { color: var(--success); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.newc { color: var(--text-2); font-weight: 600; }
.tiny { display: block; font-size: 11px; margin-top: 3px; }
.center { text-align: center; }
.c { text-align: center; }
.pad { padding: 18px; }
.sec-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.g1 { grid-template-columns: 1fr; gap: 12px; }
.with-btn { display: flex; gap: 8px; }
.with-btn .input { flex: 1; min-width: 0; }
.with-btn .btn { height: 46px; padding: 0 12px; }
.ok-ic { background: var(--success-50) !important; color: var(--success) !important; border-color: transparent !important; }
.code-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 7px; font: 700 12.5px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); white-space: nowrap; }

/* categories */
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 84px; gap: 12px; align-items: center; padding: 10px 18px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { border-top: 1px solid var(--border); }
.cat-head { height: 40px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.cat-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cat-name .thumb { width: 34px; height: 34px; border-radius: 10px; }
.cat-name b { font-weight: 600; font-size: 14.5px; }
.cat-acts { display: flex; gap: 6px; justify-content: flex-end; }

/* two-column document layout (bill + summary) */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.doc-main { min-width: 0; }
.sticky { position: sticky; top: 80px; }
.sum-rows { display: grid; gap: 10px; font-size: 14px; }
.sum-rows > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sum-rows > div > span, .sum-input label { color: var(--text-2); }
.sum-rows b { font-weight: 700; }
.sum-input .money-input { width: 130px; }
.money-input.sm { height: 40px; border-radius: 9px; }
.money-input.sm span { padding-left: 10px; }
.money-input.sm input { font-size: 14.5px; padding-right: 10px; }
.money-input.invalid, .input.invalid { border-color: var(--danger) !important; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.sum-total span { font-weight: 700; }
.sum-total b { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.paid-box { display: grid; gap: 10px; margin: 14px 0 16px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.paid-box .money-input { background: var(--surface); }
.paid-box .pill { height: 34px; padding: 0 12px; font-size: 13px; }
.due-line { font-size: 13px; color: var(--text-2); min-height: 18px; }
.hint.center { margin-top: 8px; }

/* purchase item rows */
.input.sm { height: 40px; border-radius: 9px; padding: 0 10px; font-size: 14px; }
select.input.sm { padding-right: 30px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }
.code-in { text-transform: uppercase; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; letter-spacing: .03em; }
.code-in::placeholder { text-transform: none; font-family: var(--font); font-weight: 400; letter-spacing: 0; }
.pl { display: grid; grid-template-columns: 26px 120px 140px minmax(150px, 1fr) 70px 120px 120px 100px 34px; gap: 8px; align-items: start; padding: 10px 18px; border-top: 1px solid var(--border); }
.pl > span { min-width: 0; }
.pl-head { align-items: center; padding-top: 8px; padding-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.pl-n { color: var(--text-3); font-weight: 600; font-size: 13px; padding-top: 11px; }
.pl-amt { font-weight: 800; padding-top: 10px; }
.pl-status, .pl-margin { display: block; font-size: 11.5px; margin-top: 4px; min-height: 15px; }
.pl.is-old { background: color-mix(in srgb, var(--success-50) 45%, transparent); }
.pl .pl-del { margin-top: 3px; }
.pl input.r { text-align: right; }
.pl-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.items-err { padding: 10px 18px 0; }
.code-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.code-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.code-list .num { color: var(--text-2); font-size: 12.5px; }

/* purchase bills list */
.pbl { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px 80px 120px 24px; gap: 14px; align-items: center; padding: 12px 18px; color: inherit; }
a.pbl:hover { background: var(--surface-2); }
.pbl-head { height: 38px; padding-top: 0; padding-bottom: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); }
.pbl-date { color: var(--text-2); font-weight: 500; }
.pbl-main { display: grid; min-width: 0; }
.pbl-main span { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* sale */
.bill-no { font-size: 15px; font-weight: 700; color: var(--text-3); margin-left: 8px; letter-spacing: 0; vertical-align: middle; }
.code-bar { position: relative; display: flex; gap: 8px; margin-top: 8px; }
.code-box { flex: 1; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px; border: 2px solid var(--text); border-radius: 13px; background: var(--surface); color: var(--text-3); }
.code-box:focus-within { box-shadow: var(--ring); }
.code-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text); font: 700 18px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; text-transform: uppercase; }
.code-box input::placeholder { font: 400 14.5px var(--font); letter-spacing: 0; text-transform: none; color: var(--text-3); }
.code-box kbd { font: 600 11px var(--font); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; background: var(--surface-2); }
.code-bar > .btn { height: 54px; border-radius: 13px; padding: 0 18px; }
.sugg { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 13px; box-shadow: var(--shadow-lg); max-height: 330px; overflow: auto; }
.sugg li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 80px; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.sugg li:hover, .sugg li.on { background: var(--surface-2); }
.sg-name { display: grid; font-weight: 600; min-width: 0; }
.sg-name span { font-size: 12px; color: var(--text-3); font-weight: 500; }
.sg-st { font-size: 12.5px; color: var(--text-2); }
.sg-pr { text-align: right; font-weight: 700; }
.found { margin-top: 14px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.found-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.found-main > span { display: grid; }
.found-main > span > span { font-size: 12.5px; color: var(--text-3); }
.found-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.fs { display: grid; min-width: 110px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.fs span { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.fs b { font-size: 18px; font-weight: 800; }
.fs i { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.fs-warn b { color: var(--warning); }
.fs-bad b { color: var(--danger); }

.sl { display: grid; grid-template-columns: 82px minmax(0, 1fr) 70px 100px 118px 118px 100px 34px; gap: 10px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); }
.sl-head { padding-top: 8px; padding-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.hide-buy .sl { grid-template-columns: 82px minmax(0, 1fr) 70px 118px 118px 100px 34px; }
.hide-buy .buy-col { display: none !important; }
.sl-prod { display: grid; min-width: 0; }
.sl-prod b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-prod span { font-size: 12px; color: var(--text-3); }
.sl .money-input.sm input { text-align: right; }
.sl-amt b { font-weight: 800; }
.sl.flash { animation: flash 1.6s ease-out; }
.stepper { display: inline-flex; align-items: center; height: 40px; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.stepper button { width: 34px; height: 100%; border: 0; background: var(--surface-2); font-size: 18px; font-weight: 600; color: var(--text); }
.stepper button:hover { background: var(--surface-3); }
.stepper button:disabled { color: var(--text-3); cursor: not-allowed; }
.stepper input { width: 44px; height: 100%; border: 0; outline: none; text-align: center; font-weight: 700; background: transparent; }
.profit-line { font-size: 13px; color: var(--text-2); }

@media (max-width: 1240px) {
  .doc-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .pl { grid-template-columns: 26px 110px 130px minmax(120px, 1fr) 64px 110px 110px 90px 34px; }
}
@media (max-width: 900px) {
  .form-grid.g3 { grid-template-columns: 1fr 1fr; }
  .form-grid.g3 > .field:first-child { grid-column: 1 / -1; }
  .pl-head, .sl-head, .pbl-head { display: none !important; }
  .pl { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 10px; padding: 14px 16px; position: relative; }
  .pl > .pl-n { position: absolute; left: 16px; top: 14px; padding: 0; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 11.5px; }
  .pl > span:nth-child(2) { grid-column: 1 / 4; padding-left: 28px; }
  .pl > span:nth-child(3) { grid-column: 4 / 7; }
  .pl > span:nth-child(4) { grid-column: 1 / -1; }
  .pl > span:nth-child(5) { grid-column: 1 / 3; }
  .pl > span:nth-child(6) { grid-column: 3 / 5; }
  .pl > span:nth-child(7) { grid-column: 5 / 7; }
  .pl > .pl-amt { grid-column: 1 / 6; text-align: left; padding-top: 4px; }
  .pl > .pl-amt::before { content: "Amount  "; font-weight: 500; color: var(--text-3); font-size: 12.5px; }
  .pl > span:last-child { grid-column: 6 / 7; justify-self: end; }
  .pl > span:nth-child(5)::before, .pl > span:nth-child(6)::before, .pl > span:nth-child(7)::before { display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 3px; }
  .pl > span:nth-child(5)::before { content: "Qty"; }
  .pl > span:nth-child(6)::before { content: "Purchase price"; }
  .pl > span:nth-child(7)::before { content: "Selling price"; }
  .pl input.r { text-align: left; }
  .sl, .hide-buy .sl { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 8px 12px; padding: 12px 16px; }
  .sl .sl-code { grid-column: 1 / 3; grid-row: 1; }
  .sl .sl-prod { grid-column: 1 / -1; grid-row: 2; }
  .sl > span:last-child { grid-column: 3; grid-row: 1; justify-self: end; }
  .sl [data-l] { text-align: left; }
  .sl [data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 3px; }
  .sl .c { text-align: left; }
  .pbl { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; }
  .pbl .pbl-main { grid-column: 1; grid-row: 1; }
  .pbl .pbl-date { grid-column: 1; grid-row: 2; font-size: 12.5px; color: var(--text-3); }
  .pbl .pbl-amt { grid-column: 2; grid-row: 1; }
  .pbl [data-l="Items"], .pbl .v-go { display: none; }
  .pbl [data-l="Pieces"] { grid-column: 2; grid-row: 2; font-size: 12.5px; color: var(--text-3); }
  .pbl [data-l="Pieces"]::after { content: " pcs"; }
  .cat-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .cat-head { display: none; }
  .cat-row [data-l] { font-size: 12.5px; color: var(--text-3); }
  .cat-row [data-l="Products"]::after { content: " products"; }
  .cat-row [data-l="Products"] { display: none; }
  .found-stats { width: 100%; }
  .fs { flex: 1; min-width: 0; }
  .sugg li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sg-st { display: none; }
}
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .form-grid.g3 { grid-template-columns: 1fr; }
  .code-bar > .btn { padding: 0 14px; }
  .code-bar > .btn span:not(:first-child) { display: none; }
  .code-box kbd { display: none; }
  .page-head .check { width: 100%; }
}
/* vendor page: 5-column bill lines, 6-column items (desktop; mobile rules below) */
@media (min-width: 761px) {
  .ln { grid-template-columns: minmax(0, 1fr) 60px 110px 100px 110px; }
  .it { grid-template-columns: minmax(0, 1fr) 90px 90px 120px 100px 90px; }
}
.ln-item span { display: flex; align-items: center; gap: 6px; }
.code-chip.sm { height: 19px; padding: 0 6px; font-size: 11px; border-radius: 5px; }
.warnc { color: var(--warning); font-weight: 700; }
@media (max-width: 760px) {
  .ln, .it { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ln-extra, .ln-total { grid-template-columns: minmax(0, 1fr) auto; }
}
/* purchase bill: the item table needs the full width, so the summary sits under it */
.doc-layout.one-col { grid-template-columns: 1fr; }
.doc-layout.one-col .doc-side { display: flex; justify-content: flex-end; }
.doc-layout.one-col .doc-side .card { width: 100%; max-width: 440px; position: static; }
@media (min-width: 1680px) {
  .doc-layout.one-col { grid-template-columns: minmax(0, 1fr) 340px; }
  .doc-layout.one-col .doc-side .card { position: sticky; }
}
/* sale lines: tighter number columns so the product name has room (desktop only — the mobile card layout above must keep winning) */
@media (min-width: 901px) {
  .sl { grid-template-columns: 74px minmax(0, 1fr) 58px 88px 104px 112px 84px 34px; gap: 8px; }
  .hide-buy .sl { grid-template-columns: 74px minmax(0, 1fr) 58px 104px 112px 84px 34px; }
}
.sl-prod b { white-space: normal; overflow: visible; line-height: 1.3; }
.sl .stepper button { width: 30px; }
.sl .stepper input { width: 38px; }
.code-box { min-width: 0; }
@media (max-width: 760px) {
  .code-box { height: 50px; padding: 0 12px; }
  .code-bar > .btn { height: 50px; width: 50px; padding: 0; }
  .code-box input { font-size: 16px; }
  .fs { padding: 8px 10px; }
  .fs span { font-size: 10.5px; letter-spacing: .02em; }
  .fs b { font-size: 16px; }
}
/* sale line as a card on phones / small tablets — explicit places so nothing overlaps */
@media (max-width: 900px) {
  .sl, .hide-buy .sl { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
  .sl .sl-code { grid-column: 1 / 3; grid-row: 1; align-self: center; }
  .sl > span:last-child { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; }
  .sl .sl-prod { grid-column: 1 / -1; grid-row: 2; }
  .sl [data-l="In stock"] { grid-column: 1; grid-row: 3; }
  .sl [data-l="Barcode no."] { grid-column: 2; grid-row: 3; }
  .sl [data-l="Selling price"] { grid-column: 3; grid-row: 3; }
  .hide-buy .sl [data-l="Selling price"] { grid-column: 2 / 4; }
  .sl [data-l="Qty"] { grid-column: 1 / 3; grid-row: 4; }
  .sl [data-l="Amount"] { grid-column: 3; grid-row: 4; text-align: right; align-self: center; }
  .sl [data-l="Amount"]::before { text-align: right; }
  .sl .money-input.sm span { padding-left: 8px; }
}

/* =========================================================
   INVENTORY · PRODUCT
   ========================================================= */
.inv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mini-btn { text-align: left; font: inherit; cursor: pointer; width: 100%; }
.warn-ic { background: var(--warning-50) !important; color: var(--warning) !important; border-color: transparent !important; }
.tool-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool-right select.input.sm { width: auto; min-width: 150px; }
.iv { display: grid; grid-template-columns: 84px minmax(0, 1.6fr) 110px 90px 90px 110px 100px minmax(0, 1fr) 20px; gap: 12px; align-items: center; padding: 11px 18px; color: inherit; font-size: 13.5px; }
a.iv:hover { background: var(--surface-2); }
.iv-head { height: 38px; padding-top: 0; padding-bottom: 0; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); }
.iv-foot { border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.iv-prod { display: grid; min-width: 0; }
.iv-prod b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-prod span { font-size: 12px; color: var(--text-3); }
.iv-stock { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.iv-stock b { font-size: 15px; }
.iv-stock .chip { height: 20px; font-size: 11px; padding: 0 7px; }
.iv i { font-style: normal; font-size: 11.5px; }
.iv-last { display: grid; color: var(--text-2); min-width: 0; }
.iv-last i { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-chip.xl { height: 56px; padding: 0 16px; font-size: 18px; border-radius: 14px; background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.mv { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px 70px 100px; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.mv-head { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding-top: 9px; padding-bottom: 9px; }
.mv .ac-what a { color: inherit; }
.mv .ac-what a:hover b { text-decoration: underline; }
.mv-note { background: var(--surface-2); }
.ac-ic.sale { background: var(--danger-50); color: var(--danger); }
.ac-ic.adj { background: var(--warning-50); color: var(--warning); }
.ln-item a { color: inherit; }
.ln-item a:hover b { text-decoration: underline; }

@media (max-width: 1240px) {
  .inv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iv { grid-template-columns: 80px minmax(0, 1.5fr) 100px 84px 84px 100px 90px 20px; }
  .iv .iv-last, .iv-head > span:nth-child(8), .iv-foot > span:nth-child(8) { display: none; }
}
@media (max-width: 900px) {
  .iv-head, .iv-foot { display: none !important; }
  .iv { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; }
  .iv > span:first-child { grid-column: 1; grid-row: 1; }
  .iv .iv-prod { grid-column: 1 / -1; grid-row: 2; }
  .iv .iv-stock { grid-column: 2; grid-row: 1; }
  .iv [data-l="Purchase"], .iv [data-l="Margin"], .iv [data-l="Value"], .iv .v-go { display: none; }
  .iv [data-l="Selling"] { grid-column: 1 / -1; grid-row: 3; text-align: left; color: var(--text-2); font-size: 12.5px; }
  .iv [data-l="Selling"]::before { content: "Selling price "; color: var(--text-3); }
  .tool-right { width: 100%; }
  .tool-right select.input.sm { flex: 1; min-width: 0; }
  .tool-right .seg { width: 100%; }
  .tool-right .seg button { flex: 1; }
  .mv { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 14px; }
  .mv-head { display: none; }
  .mv .ac-date { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); }
  .mv .ac-what { grid-column: 1 / -1; }
  .mv .r { text-align: left; }
  .mv [data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
  .mv span:empty { display: none; }
}
@media (max-width: 760px) {
  .inv-kpis { gap: 10px; }
  .inv-kpis .mini { padding: 12px; gap: 10px; }
  .inv-kpis .mini .kpi-ic { display: none; }
  .inv-kpis .mini > .ic:last-child { display: none; }
  .inv-kpis .val { font-size: 17px; }
  .code-chip.xl { height: 44px; font-size: 15px; }
}
/* sale: discount type + round off */
.seg-sm { padding: 2px; border-radius: 8px; }
.seg-sm button { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.disc-ctl { display: inline-flex; align-items: center; gap: 6px; }
.disc-ctl .money-input { width: 104px; }
.disc-line { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-3); margin-top: -4px; }
.disc-line b { color: var(--success); font-weight: 700; }
.sum-rows .check { color: var(--text-2); font-size: 14px; }
#ro-amt { font-weight: 700; }
.ro-box { display: flex !important; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: -2px; }
.ro-box[hidden] { display: none !important; }
.ro-box select.input.sm { width: auto; height: 34px; }
#disc-over { font-size: 12px; }
.ro-box { flex-wrap: nowrap; justify-content: space-between; }
.ro-box .seg-sm button { padding: 0 8px; }
.ro-box select.input.sm { width: 86px; flex: none; padding-left: 8px; }
/* sale lines with product-wise discount (barcode no. sits under the code, stock under the name) */
.bc-no { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; letter-spacing: .04em; }
.ld { display: inline-flex; align-items: center; height: 40px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); overflow: hidden; width: 104px; }
.ld:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.ld-t { width: 34px; height: 100%; border: 0; border-right: 1px solid var(--border); background: var(--surface-2); font-weight: 700; color: var(--text); flex: none; }
.ld-t:hover { background: var(--surface-3); }
.ld input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; text-align: right; padding: 0 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ld-note { min-height: 14px; }
.sl-amt s.was { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
@media (min-width: 901px) {
  .sl, .hide-buy .sl { grid-template-columns: 84px minmax(0, 1fr) 108px 108px 112px 92px 30px; gap: 8px; }
}
@media (max-width: 900px) {
  .sl, .hide-buy .sl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sl .sl-code { display: flex; align-items: center; gap: 8px; }
  .sl .bc-no { margin-top: 0; }
  .sl [data-l="Selling price"], .hide-buy .sl [data-l="Selling price"] { grid-column: 1 / 2; grid-row: 3; }
  .sl [data-l="Discount"] { grid-column: 2 / 4; grid-row: 3; }
  .sl [data-l="Discount"] .ld { width: 100%; }
  .sl [data-l="Qty"] { grid-column: 1 / 3; grid-row: 4; }
  .sl [data-l="Amount"] { grid-column: 3; grid-row: 4; }
}

/* ---- sale lines follow the width of their own card (not the window) ----
   wide card  : one row per product
   medium card: two rows — code · product · amount / selling price · discount · qty
   phone      : the stacked card layout above (max-width 760px) */
.lines-card { container-type: inline-size; }
@container (min-width: 761px) {
  .sl, .hide-buy .sl { grid-template-columns: 76px minmax(140px, 1fr) 100px 104px 106px 88px 30px; gap: 8px; }
  .sl .ld { width: 100%; }
}
@container (min-width: 440px) and (max-width: 760px) {
  .sl-head { display: none !important; }
  .sl, .hide-buy .sl { grid-template-columns: 76px repeat(3, minmax(0, 1fr)) 32px; gap: 8px 10px; align-items: end; padding: 12px 16px; }
  .sl .sl-code { grid-column: 1; grid-row: 1 / 3; align-self: start; display: block; }
  .sl .bc-no { margin-top: 4px; }
  .sl .sl-prod { grid-column: 2 / 4; grid-row: 1; align-self: center; }
  .sl .sl-prod b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sl [data-l="Amount"] { grid-column: 4; grid-row: 1; align-self: center; text-align: right; }
  .sl > span:last-child { grid-column: 5; grid-row: 1; align-self: center; justify-self: end; }
  .sl [data-l="Selling price"], .hide-buy .sl [data-l="Selling price"] { grid-column: 2; grid-row: 2; text-align: left; }
  .sl [data-l="Discount"] { grid-column: 3; grid-row: 2; text-align: left; }
  .sl [data-l="Qty"] { grid-column: 4; grid-row: 2; text-align: left; }
  .sl [data-l="Selling price"]::before, .sl [data-l="Discount"]::before, .sl [data-l="Qty"]::before {
    content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
  .sl [data-l="Amount"]::before { content: none; }
  .sl .ld, .sl .money-input.sm { width: 100%; }
  .sl .stepper { width: 100%; justify-content: space-between; }
  .sl .stepper input { flex: 1; width: auto; min-width: 0; }
}
.ld-note { min-height: 0; display: block; }
.ld-note:empty { display: none; }
@container (min-width: 440px) and (max-width: 760px) { .sl, .hide-buy .sl { align-items: start; } }

/* =========================================================
   SALE BILLS · CUSTOMERS · MONEY · SETTINGS
   ========================================================= */
.wa-ic-box { background: var(--wa-50) !important; color: var(--wa) !important; border-color: transparent !important; }
.wa-ic-box .wa-ic { width: 22px; height: 22px; }
.sm-btn .wa-ic { width: 16px; height: 16px; }
.btn .wa-ic { width: 17px; height: 17px; }

/* sale bills */
.sb { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1.3fr) 150px 96px 150px; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.sb-head { height: 38px; padding-top: 0; padding-bottom: 0; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border-top: 0; border-bottom: 1px solid var(--border); }
.sb-day { display: flex; justify-content: space-between; padding: 9px 18px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--text-2); border-top: 1px solid var(--border); }
.sb-no, .sb-cust, .sb-items { display: grid; min-width: 0; }
.sb-no span, .sb-cust span { font-size: 12px; color: var(--text-3); }
.sb-cust a { color: inherit; } .sb-cust a:hover b { text-decoration: underline; }
.sb-items span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.sb-items i { font-style: normal; font-size: 12px; color: var(--text-3); }
.sb-pay { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-amt b { font-size: 15px; font-weight: 800; }
.sb-acts { display: flex; gap: 6px; justify-content: flex-end; }
.is-cx { opacity: .55; }
.is-cx .sb-amt b { text-decoration: line-through; }

/* customers */
.cu { display: grid; grid-template-columns: 30px minmax(0, 1.6fr) 100px 110px 120px 100px 20px; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.cu.on { background: var(--primary-50); }
.cu-head { height: 38px; padding-top: 0; padding-bottom: 0; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border-top: 0; border-bottom: 1px solid var(--border); }
.cu input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; cursor: pointer; }
.cu-name { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; }
.cu-name .t { display: grid; min-width: 0; }
.cu-name b { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-name .t > span { font-size: 12px; color: var(--text-3); }
.cu-name:hover b { text-decoration: underline; }
.chip.reg { height: 20px; font-size: 11px; padding: 0 7px; }
.cu i { font-style: normal; font-size: 12px; color: var(--text-3); display: block; }
.cu [data-l="Last visit"] { display: grid; }
.sel-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 18px; background: var(--primary); color: var(--on-primary); }
.sel-bar .link-btn { color: var(--on-primary); opacity: .85; }
.sel-bar .spacer { flex: 1; }
.sel-bar .btn:not(.btn-wa) { background: transparent; color: var(--on-primary); border-color: color-mix(in srgb, var(--on-primary) 40%, transparent); }
.toolbar .check { white-space: nowrap; }
.rcpt-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.rcpt { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.rcpt li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.rcpt .t { flex: 1; min-width: 0; display: grid; }
.rcpt .t span { font-size: 12px; color: var(--text-3); }
.cb { display: grid; grid-template-columns: 130px minmax(0, 1fr) 140px 100px 20px; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--border); color: inherit; font-size: 13.5px; }
.cb:hover { background: var(--surface-2); }
.cb .ac-date { display: grid; } .cb .ac-date i { font-style: normal; font-size: 12px; color: var(--text-3); }
.cb-main { display: grid; min-width: 0; } .cb-main span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* income & expense */
.month-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.month-bar b { font-size: 16px; min-width: 150px; text-align: center; }
.month-bar .icon-btn { border: 1px solid var(--border); background: var(--surface); }
.month-bar .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.money-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi-net { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.kpi-net .kpi-top, .kpi-net .kpi-foot { color: color-mix(in srgb, var(--on-primary) 75%, transparent); }
.kpi-net .kpi-ic { background: color-mix(in srgb, var(--on-primary) 14%, transparent); color: var(--on-primary); border-color: transparent; }
.money-grid { grid-auto-flow: dense; }
.me { display: grid; grid-template-columns: 70px minmax(0, 1fr) 120px 76px; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.me-amt b { font-weight: 800; }
.wide-seg { display: flex; width: 100%; }
.wide-seg button { flex: 1; height: 38px; }

/* settings */
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.set-nav { position: sticky; top: 80px; display: grid; gap: 2px; }
.set-nav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.set-nav a:hover { background: var(--surface); color: var(--text); }
.set-nav a.on { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.set-main { display: grid; gap: 14px; min-width: 0; }
.set-card { scroll-margin-top: 80px; }
.set-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.set-head h2 { font-size: 17px; font-weight: 750; }
.set-logo { height: 44px; }
.set-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.set-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; height: 46px; cursor: pointer; font-size: 14px; color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 42px; height: 24px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--on-primary); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.pin-in { letter-spacing: .4em; font-weight: 700; }

@media (max-width: 1240px) {
  .money-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sb { grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr) 130px 90px 150px; }
  .cu { grid-template-columns: 30px minmax(0, 1.6fr) 90px 100px 110px 90px 20px; }
}
@media (max-width: 1024px) {
  .set-layout { grid-template-columns: 1fr; }
  .set-nav { position: static; display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .set-nav a { white-space: nowrap; flex: none; background: var(--surface); border: 1px solid var(--border); }
  .sb { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .sb-head { display: none !important; }
  .sb .sb-cust { grid-column: 1; grid-row: 1; }
  .sb .sb-amt { grid-column: 2; grid-row: 1; }
  .sb .sb-no { grid-column: 1; grid-row: 2; display: flex; gap: 8px; align-items: baseline; }
  .sb .sb-no b { font-size: 12.5px; color: var(--text-2); }
  .sb .sb-pay { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .sb .sb-items { grid-column: 1 / -1; grid-row: 3; }
  .sb .sb-acts { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; margin-top: 4px; }
  .cu { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 4px 12px; }
  .cu-head { display: none !important; }
  .cu > span:first-child { grid-row: 1 / 3; align-self: center; }
  .cu .cu-name { grid-column: 2; grid-row: 1; }
  .cu [data-l="Spent"] { grid-column: 3; grid-row: 1; }
  .cu [data-l="Bills"] { grid-column: 2; grid-row: 2; text-align: left; padding-left: 48px; font-size: 12.5px; color: var(--text-2); }
  .cu [data-l="Bills"] b::after { content: " bills"; font-weight: 500; }
  .cu [data-l="Bills"] i { display: inline; }
  .cu [data-l="Udhaar"] { grid-column: 3; grid-row: 2; }
  .cu [data-l="Last visit"], .cu .v-go { display: none; }
}
@media (max-width: 760px) {
  .money-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .money-kpis .kpi-net { grid-column: 1 / -1; }
  .me { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 14px; }
  .me .ac-date { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); }
  .me .ac-what { grid-column: 1; }
  .me .me-amt { grid-column: 2; grid-row: 2; }
  .me .cat-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .cb { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 14px; }
  .cb .ac-date { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); display: flex; gap: 8px; }
  .cb .cb-main { grid-column: 1; } .cb > span:nth-child(4) { grid-column: 2; grid-row: 2; }
  .cb > span:nth-child(3) { grid-column: 1; } .cb .v-go { display: none; }
  .sel-bar { padding: 10px 14px; gap: 10px; }
  .sel-bar .spacer { display: none; }
  .sel-bar .btn { flex: 1; }
  .set-foot .btn { width: 100%; }
}
.wrap-p { flex-wrap: wrap; }
.wrap-p .nowrap { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 760px) {
  .tool-right { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tool-right select.input.sm { width: 100%; min-width: 0; }
  .tool-right .seg, .tool-right .check { grid-column: 1 / -1; }
  .chip.reg { padding: 0 5px; font-size: 0; gap: 0; }
  .chip.reg .ic { width: 13px; height: 13px; }
}
@media (max-width: 760px) { .quick:has(> :nth-child(2):last-child) { grid-template-columns: 1fr 1fr; } }
/* income & expense: inline add category + money in hand strip */
.cat-add { display: flex; gap: 8px; margin-top: 8px; }
.cat-add .input { flex: 1; min-width: 0; }
.cat-add .btn { height: 46px; }
.bal-strip { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; }
.bal-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 220px; }
.bal-main .kpi-ic { width: 42px; height: 42px; border-radius: 12px; }
.bal-main > div { display: grid; }
.bal-main .muted { font-size: 12.5px; font-weight: 600; }
.bal-main b { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.bal-part { display: grid; padding: 0 18px; border-left: 1px solid var(--border); }
.bal-part span { font-size: 12px; color: var(--text-3); font-weight: 600; }
.bal-part b { font-size: 16px; font-weight: 700; }
.bal-note { flex-basis: 100%; margin: -6px 0 0 54px; }
@media (max-width: 760px) {
  .bal-part { padding: 0 12px 0 0; border-left: 0; }
  .bal-strip .btn { width: 100%; }
  .bal-note { margin-left: 0; }
}
/* reports */
.mini-kpis.mini-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.today-strip { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.today-strip > span:nth-child(2) { display: grid; flex: 1; min-width: 160px; }
.today-strip .muted { font-size: 12.5px; font-weight: 600; }
.today-strip b { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.bar.future i { background: var(--surface-2); }
.month-bar select.input.sm { width: auto; min-width: 170px; font-weight: 700; }
.page-head .month-bar { flex-wrap: nowrap; }
@media (max-width: 1240px) { .mini-kpis.mini-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .mini-kpis.mini-4 { grid-template-columns: 1fr; }
  .page-head .month-bar { width: 100%; }
  .page-head .month-bar select { flex: 1; }
  .today-strip .btn { width: 100%; }
}
.today-strip.card, .bal-strip.card { flex-direction: row; }
/* credit bill: paid now + udhaar */
.credit-box { display: grid; gap: 10px; margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.credit-box .money-input { background: var(--surface); }
.credit-box .pill { height: 34px; padding: 0 12px; font-size: 13px; }
.cb-due { display: flex; justify-content: space-between; align-items: baseline; }
.cb-due span { font-weight: 600; color: var(--text-2); }
.cb-due b { font-size: 20px; font-weight: 800; color: var(--danger); }
/* udhaar */
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.nav a .count.soft { background: var(--surface-3); color: var(--text); }
.rc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.rc-facts > div { display: grid; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.rc-facts span { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.rc-facts b { font-size: 17px; font-weight: 800; }
.ud { display: grid; grid-template-columns: 110px minmax(0, 1fr) 100px 120px 110px 90px 190px; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.ud-head { height: 38px; padding-top: 0; padding-bottom: 0; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border-top: 0; border-bottom: 1px solid var(--border); }
.ud.is-paid { opacity: .7; }
.ud-due b { font-size: 15px; }
.open-bills { margin: 12px 18px 4px; padding: 12px; border-radius: 12px; border: 1px dashed var(--border-strong); display: grid; gap: 8px; }
.ob-title { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.ob-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; font-size: 13.5px; }
.ob-row .muted { font-size: 12.5px; }
@media (max-width: 1240px) { .ud { grid-template-columns: 100px minmax(0, 1fr) 90px 110px 100px 80px 170px; } }
@media (max-width: 1024px) {
  .ud-head { display: none !important; }
  .ud { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .ud .sb-cust { grid-column: 1; grid-row: 1; }
  .ud .ud-due { grid-column: 2; grid-row: 1; }
  .ud .sb-no { grid-column: 1; grid-row: 2; display: flex; gap: 8px; align-items: baseline; }
  .ud .sb-no b { font-size: 12.5px; color: var(--text-2); }
  .ud .ud-days { grid-column: 2; grid-row: 2; justify-self: end; }
  .ud [data-l="Bill total"], .ud [data-l="Paid"] { grid-row: 3; text-align: left; font-size: 12.5px; color: var(--text-2); }
  .ud [data-l="Bill total"] { grid-column: 1; } .ud [data-l="Paid"] { grid-column: 2; text-align: right; }
  .ud [data-l="Bill total"]::before { content: "Total "; color: var(--text-3); }
  .ud [data-l="Paid"]::before { content: "Paid "; color: var(--text-3); }
  .ud .sb-acts { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; margin-top: 4px; }
  .ud .sb-acts .btn-primary { margin-left: auto; }
}
@media (max-width: 760px) {
  .open-bills { margin: 10px 12px 4px; }
  .ob-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ob-row > span { grid-column: 1 / -1; }
  .ob-row .btn { justify-self: end; }
}
.sb-cust span, .sb-cust b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1025px) and (max-width: 1240px) { .ud { grid-template-columns: 92px minmax(0, 1fr) 84px 96px 92px 76px 160px; gap: 10px; } }
@media (min-width: 1025px) {
  .sb { grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.2fr) 150px 90px 230px; }
}
/* returns & exchange */
.bill-pick { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.bp-hint { font-size: 12.5px; color: var(--text-3); padding: 2px 2px 0; }
.bp { width: 100%; display: grid; grid-template-columns: 90px minmax(0, 1fr) auto auto; grid-template-areas: "no meta chip amt" "no items chip amt"; gap: 2px 14px; align-items: center;
  text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; }
.bp:hover { border-color: var(--text); }
.bp > b:first-child { grid-area: no; }
.bp > span:nth-of-type(1) { grid-area: meta; font-size: 13px; color: var(--text-2); }
.bp .bp-items { grid-area: items; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp .chip { grid-area: chip; }
.bp > b.num { grid-area: amt; font-size: 15px; }
.warn-note { margin: 0 18px 10px; background: var(--warning-50); color: var(--warning); }
.warn-note .ic { color: var(--warning); }
.rl { display: grid; grid-template-columns: minmax(0, 1fr) 60px 100px 130px 90px; gap: 10px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.rl.on { background: var(--primary-50); }
.rl-head { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding-top: 8px; padding-bottom: 8px; }
.rl-out { grid-template-columns: minmax(0, 1fr) 110px 130px 90px 34px; padding-left: 0; padding-right: 0; }
.re { display: grid; grid-template-columns: 110px 100px 150px minmax(0, 1fr) 170px; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
.re-items { display: grid; gap: 2px; min-width: 0; color: var(--text-2); }
.re-items i { font-style: normal; color: var(--text-3); font-weight: 600; }
.re-money { display: grid; justify-items: end; }
.re-money span { font-size: 12px; color: var(--text-3); }
.tag-chip { height: 19px; font-size: 10.5px; padding: 0 7px; vertical-align: 1px; }
a.chip { color: inherit; }
@media (max-width: 1024px) {
  .re { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .re .sb-no { grid-column: 1; grid-row: 1; display: flex; gap: 8px; align-items: baseline; }
  .re > span:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  .re .sb-cust { grid-column: 1; grid-row: 2; }
  .re .re-money { grid-column: 2; grid-row: 2; }
  .re .re-items { grid-column: 1 / -1; grid-row: 3; }
}
@media (max-width: 760px) {
  .bp { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "no amt" "meta meta" "items items" "chip chip"; }
  .bp .chip { justify-self: start; }
  .rl-head { display: none; }
  .rl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 12px 14px; }
  .rl .sl-prod { grid-column: 1 / -1; }
  .rl [data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 3px; }
  .rl .r, .rl .c { text-align: left; }
  .rl [data-l="Coming back"], .rl-out [data-l="Qty"] { grid-column: 1 / 3; }
  .rl-out { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 0; padding-right: 0; }
  .rl-out > span:last-child { grid-column: 3; grid-row: 1; justify-self: end; }
  .warn-note { margin: 0 14px 10px; }
}
@media (max-width: 760px) {
  .rl-out .sl-prod { grid-column: 1 / 3; grid-row: 1; }
  .rl-out > span:last-child { grid-column: 3; grid-row: 1; }
}
/* cash & bank */
.cash-top { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 14px; }
.cash-card { padding: 16px 18px; gap: 6px; }
.cc-top { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.cc-val { font-size: 28px; font-weight: 800; letter-spacing: -.6px; }
.cc-sub { font-size: 12.5px; color: var(--text-3); }
.cash-main { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.cash-main .cc-top, .cash-main .cc-sub { color: color-mix(in srgb, var(--on-primary) 75%, transparent); }
.cash-main .cc-sub a { color: var(--on-primary); text-decoration: underline; }
.cash-main .kpi-ic { background: color-mix(in srgb, var(--on-primary) 14%, transparent); color: var(--on-primary); border-color: transparent; }
.cc-rows { display: grid; gap: 4px; margin: 4px 0 6px; }
.cc-rows > div { display: flex; justify-content: space-between; font-size: 14px; }
.cc-rows span { color: var(--text-2); }
.cash-card .btn-sm, .cash-card .chip { align-self: flex-start; }
.lg { display: grid; grid-template-columns: 90px minmax(0, 1fr) 110px 110px 120px; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13.5px; color: inherit; }
a.lg:hover { background: var(--surface-2); }
.lg-head { height: 36px; padding-top: 0; padding-bottom: 0; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.lg .ac-date { display: grid; } .lg .ac-date i { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.mv-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv-t { display: grid; text-align: left; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.mv-t span { font-size: 12px; color: var(--text-3); }
.mv-t.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-50); }
.cl-diff { min-height: 24px; }
/* search */
.big-search { height: 56px; }
.sr-group { margin-bottom: 14px; }
.sr { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 18px; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); color: inherit; }
.sr:hover { background: var(--surface-2); }
.sr .t { display: grid; min-width: 0; }
.sr .t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr .t span { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr .r { display: grid; justify-items: end; gap: 2px; }
.sr .r span:not(.chip) { font-size: 11.5px; color: var(--text-3); }
.sr > .ic:last-child { color: var(--text-3); }
.sr mark { background: var(--warning-50); color: inherit; border-radius: 3px; padding: 0 1px; }
.sr-more { padding: 10px 18px 14px; }
#s-tabs { flex-wrap: wrap; }
@media (max-width: 1024px) { .cash-top { grid-template-columns: 1fr 1fr; } .cash-top .cash-main { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .cash-top { grid-template-columns: 1fr; gap: 10px; }
  .lg { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 14px; }
  .lg-head { display: none !important; }
  .lg .ac-date { grid-column: 1 / -1; display: flex; gap: 8px; font-size: 12px; color: var(--text-3); }
  .lg .ac-what { grid-column: 1; grid-row: 2 / 4; }
  .lg [data-l="In"], .lg [data-l="Out"] { grid-column: 2; grid-row: 2; }
  .lg [data-l="In"]:empty, .lg [data-l="Out"]:empty { display: none; }
  .lg [data-l="Balance"], .lg [data-l="Account"] { grid-column: 2; grid-row: 3; font-size: 12px; }
  .mv-types { grid-template-columns: 1fr; }
  #s-tabs { display: flex; overflow-x: auto; flex-wrap: nowrap; }
  #s-tabs button { white-space: nowrap; }
  .sr { padding: 10px 14px; grid-template-columns: 34px minmax(0, 1fr) auto; }
  .sr > .ic:last-child { display: none; }
}
.big-search input { text-transform: none; font: 600 16px var(--font); letter-spacing: 0; }
@media (max-width: 760px) {
  .card-head { flex-wrap: wrap; }
  .card-head .tool-right { width: 100%; }
  .tool-right .month-bar { grid-column: 1 / -1; justify-content: space-between; }
}
/* hide amounts + password lock */
.hide-nums .content .num, .hide-nums .content .kpi-val, .hide-nums .content .val, .hide-nums .content .cc-val, .hide-nums .content .split-total,
.hide-nums .content .chart-sum .v, .hide-nums .content .due, .hide-nums .content .bal-main b, .hide-nums .content .tip { filter: blur(7px); user-select: none; }
.hide-nums .content .bars { filter: blur(5px); }
.eye-btn { gap: 6px; }
.is-locked .main .content, .is-locked .bottom-nav { visibility: hidden; }
dialog.lock-dlg { width: min(380px, calc(100vw - 24px)); }
dialog.lock-dlg::backdrop { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); }
.lock-body { display: grid; gap: 12px; padding: 26px 24px 20px; text-align: center; justify-items: center; }
.lock-body .input, .lock-body .btn, .lock-body .error-text { width: 100%; }
.lock-body .input { text-align: center; letter-spacing: .3em; font-weight: 700; }
.lock-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.lock-body h3 { font-size: 18px; font-weight: 800; }
.chk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.chk { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.chk:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--text); }
@media (max-width: 760px) { .chk-grid { grid-template-columns: 1fr 1fr; } dialog.lock-dlg { margin: auto; border-radius: 18px; width: calc(100vw - 32px); } }
.rw-box { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--warning-50); color: var(--warning); font-size: 12.5px; font-weight: 600; }
.rw-box > span:nth-child(2) { flex: 1; }
.hide-nums .content .kpi-foot, .hide-nums .content .mini .sub, .hide-nums .content .cc-sub, .hide-nums .content .cc-rows b, .hide-nums .content .legend .am, .hide-nums .content .rows .r { filter: blur(6px); user-select: none; }
/* barcode no. under the product code: easy for the owner to read */
.bc-no { font-size: 12px; font-weight: 600; color: var(--text-2); }
