/* ==========================================================================
   Dukandari — register-inspired design system
   ========================================================================== */
:root {
  --ink: #173c33;
  --ink-2: #1f4c40;
  --ink-3: #2e6253;
  --ink-soft: #4f7a6c;
  --paper: #fbf6e9;
  --paper-2: #f6eedc;
  --paper-3: #eee2c7;
  --paper-4: #e6d7b7;
  --desk: #2b241b;
  --desk-2: #1d1913;
  --red: #b23a2b;
  --red-soft: #c96455;
  --gold: #b8893f;
  --gold-2: #d6b36d;
  --gold-soft: #f0e1c1;
  --green: #2f7d5e;
  --green-soft: #e0efe7;
  --blue: #376d8e;
  --blue-soft: #e3eef4;
  --text: #2c352f;
  --muted: #71796f;
  --muted-2: #979d92;
  --line: #e4d8bf;
  --line-2: #d6c7a7;
  --rule: rgba(53, 87, 74, 0.19);
  --rule-2: rgba(53, 87, 74, 0.34);
  --shadow-sm: 0 1px 2px rgba(46, 32, 12, 0.08);
  --shadow: 0 10px 30px -12px rgba(46, 32, 12, 0.28);
  --shadow-lg: 0 28px 70px -22px rgba(23, 16, 6, 0.5);
  --radius: 14px;
  --radius-sm: 9px;
  --sans: "Segoe UI", "Nirmala UI", Tahoma, Arial, sans-serif;
  --urdu: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", "Nirmala UI", "Urdu Typesetting", "Segoe UI", Tahoma, serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --sidebar-w: 258px;
  --gold-line: rgba(214, 179, 109, 0.28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background: var(--desk);
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; font-family: var(--sans); }
button { color: inherit; }
a { color: var(--ink-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, .urdu-display { font-family: var(--urdu); line-height: 1.75; }
img, svg { display: block; }
::selection { background: var(--gold-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- shared atoms ---------- */
.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.urdu-display { font-family: var(--urdu); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dot { margin: 0 5px; opacity: 0.5; }

.icon { width: 19px; height: 19px; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 24px; height: 24px; }

::placeholder { color: #a5a89f; opacity: 1; }

/* ---------- boot ---------- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background:
    radial-gradient(900px 500px at 50% 20%, rgba(77, 130, 108, 0.28), transparent 70%),
    linear-gradient(160deg, #102d26, #0a1e19 65%, #081813);
  color: var(--paper);
  transition: opacity 0.45s ease, visibility 0.45s;
}
.boot-screen.done { opacity: 0; visibility: hidden; }
.boot-mark { width: 86px; height: 86px; color: var(--gold-2); filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.35)); }
.boot-name { font-family: var(--urdu); font-size: 36px; line-height: 1.6; color: #fbf3dd; }
.boot-sub { color: #b9c6bb; font-size: 13px; letter-spacing: 0.05em; }
.boot-loader { width: 130px; height: 2px; background: rgba(255, 255, 255, 0.16); margin-top: 14px; overflow: hidden; border-radius: 2px; }
.boot-loader span { display: block; width: 45%; height: 100%; background: var(--gold-2); animation: load 1.2s infinite ease-in-out; }
@keyframes load { 0% { transform: translateX(-120%); } 100% { transform: translateX(280%); } }
.boot-status { font-size: 11.5px; color: #8fa398; letter-spacing: 0.04em; }
.boot-screen.error .boot-loader { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fffdf6;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: #fff; box-shadow: var(--shadow-sm); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fbf5e5; }
.btn-primary:hover { background: var(--ink-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #241a08; }
.btn-gold:hover { background: var(--gold-2); }
.btn-danger { background: #fff5f2; border-color: #e8bcb2; color: var(--red); }
.btn-danger:hover { background: #ffece7; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(23, 60, 51, 0.07); }
.btn-paper { background: rgba(255, 253, 246, 0.7); border-color: var(--line-2); }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn .icon { width: 17px; height: 17px; }
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; color: var(--paper);
  animation: spin 0.7s linear infinite;
}
.btn-primary.btn-loading::after { color: var(--paper); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}
.icon-btn:hover { background: rgba(23, 60, 51, 0.07); }
.icon-btn.paper { background: #fffdf6; border-color: var(--line); }
.icon-btn.danger { color: var(--red); }
.text-btn {
  border: 0; background: none; padding: 4px 2px; color: var(--ink-3);
  font-size: 12.5px; font-weight: 650; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: rgba(46, 98, 83, 0.35);
}
.text-btn:hover { color: var(--ink); }
.link-btn { border: 0; background: none; color: var(--blue); cursor: pointer; font-weight: 650; padding: 0; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span, .field-label {
  font-size: 12px; font-weight: 650; color: #5d665d; letter-spacing: 0.01em;
}
.field small { color: var(--muted); font-size: 11.5px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fffdf7;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: 0; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 137, 63, 0.16);
}
.input.ltr { direction: ltr; text-align: left; }
.input-amount { font-size: 24px; font-weight: 750; letter-spacing: 0.01em; min-height: 58px; font-variant-numeric: tabular-nums; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-start: 42px; }
.input-icon {
  position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.input-action {
  position: absolute; inset-inline-end: 5px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.input-action:hover { background: var(--paper-2); color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error {
  background: #fff1ee; color: #8e2f23; border: 1px solid #edc1b8;
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px;
}
.form-hint { color: var(--muted); font-size: 12px; }
.segmented {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 4px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
}
.segmented button {
  flex: 1; min-width: 92px; border: 0; background: transparent; color: #5f685f;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.segmented button.active { background: #fffdf6; color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented button .icon { width: 15px; height: 15px; }
.checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--ink); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #cabfa8; border-radius: 30px;
  cursor: pointer; transition: 0.2s;
}
.switch span::before {
  content: ""; position: absolute; width: 19px; height: 19px; border-radius: 50%;
  inset-inline-start: 3px; top: 3px; background: #fff; transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch input:checked + span { background: var(--ink-3); }
.switch input:checked + span::before { transform: translateX(-19px); }
[dir="ltr"] .switch input:checked + span::before { transform: translateX(19px); }

/* ---------- login ---------- */
.login-view {
  min-height: 100dvh;
  padding: clamp(16px, 3vw, 38px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 560px at 80% 0%, rgba(72, 122, 103, 0.3), transparent 60%),
    radial-gradient(700px 500px at 15% 100%, rgba(184, 137, 63, 0.16), transparent 65%),
    linear-gradient(145deg, #122e27, #0a1f1a 55%, #071712);
  color: var(--text);
}
.login-wrap {
  width: min(1220px, 100%);
  min-height: min(760px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 460px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.login-story {
  position: relative;
  padding: clamp(30px, 4vw, 54px);
  color: #f7f0df;
  background:
    linear-gradient(160deg, rgba(17, 54, 45, 0.96), rgba(10, 36, 29, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(214, 179, 109, 0.06) 31px 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.login-story::before {
  content: ""; position: absolute; inset: 18px; border: 1px solid rgba(214, 179, 109, 0.18);
  border-radius: 14px; pointer-events: none;
}
.login-story::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 179, 109, 0.13), transparent 65%);
  inset-inline-start: -140px; bottom: -160px; pointer-events: none;
}
.story-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.brand-mark {
  width: 48px; height: 48px; color: var(--gold-2); border: 1px solid var(--gold-line);
  border-radius: 12px; padding: 8px; background: rgba(255, 255, 255, 0.03);
}
.story-brand strong { display: block; font-family: var(--urdu); font-size: 25px; line-height: 1.5; color: #fbf4df; }
.story-brand span { display: block; font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: #a8b8ab; }
.story-copy { position: relative; z-index: 1; max-width: 520px; }
.story-copy .kicker { color: var(--gold-2); }
.story-copy h1 { font-size: clamp(34px, 3.8vw, 52px); line-height: 1.65; color: #fdf8ea; margin: 10px 0 14px; font-weight: 500; }
.story-copy p:not(.kicker) { color: #b8c5b9; max-width: 440px; font-size: 14.5px; }
.story-register {
  position: relative; z-index: 1; width: min(470px, 100%); align-self: flex-start;
  background: #f6ecd6; color: #2b3a31; border-radius: 8px 14px 14px 8px;
  padding: 17px 19px 19px; box-shadow: 0 22px 50px -18px rgba(0, 0, 0, 0.6);
  transform: rotate(-1.4deg); border-inline-start: 9px solid #ceb98e;
}
.sr-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid rgba(178, 58, 43, 0.55); padding-bottom: 6px; font-family: var(--urdu); font-size: 16px; }
.sr-head span:last-child { font-size: 10px; font-family: var(--sans); color: #6e756b; }
.sr-row { display: grid; grid-template-columns: 1.5fr 0.7fr 0.7fr 0.8fr; gap: 5px; font-size: 11.5px; padding: 5px 0; border-bottom: 1px solid rgba(47, 93, 80, 0.16); }
.sr-row span:nth-child(n+2) { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.sr-head-row { color: #6b746a; font-size: 9.5px; font-weight: 700; border-bottom: 1px solid rgba(47, 93, 80, 0.3); }
.sr-total { display: flex; justify-content: space-between; padding-top: 8px; font-size: 12px; font-weight: 700; color: var(--red); }
.sr-pin { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #20352c; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.5); }
.pin-a { top: 18px; inset-inline-start: 9px; }
.pin-b { bottom: 18px; inset-inline-start: 9px; }
.story-points { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 10px; position: relative; z-index: 1; }
.story-points li { display: flex; gap: 10px; align-items: center; color: #c2cfc2; font-size: 13px; }
.story-points li span {
  width: 25px; height: 25px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--gold-line); border-radius: 50%; font-size: 10px; color: var(--gold-2);
}
.login-card {
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(247, 239, 222, 0.99)),
    repeating-linear-gradient(0deg, transparent 0 41px, rgba(47, 93, 80, 0.06) 41px 42px);
  display: flex; flex-direction: column; position: relative; padding: 22px 30px;
}
.login-card-inner { width: 100%; max-width: 350px; margin: auto; }
.login-topline {
  display: flex; align-items: center; gap: 7px; justify-content: flex-end;
  font-size: 11px; color: var(--muted); padding-bottom: 42px;
}
.login-topline .text-btn { margin-inline-start: auto; }
.login-topline .login-lang-btn { margin-inline-start: 0; color: var(--ink); }
.login-lang-btn { font-weight: 700; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47, 125, 94, 0.14); }
.live-dot.off { background: var(--red); box-shadow: 0 0 0 3px rgba(178, 58, 43, 0.12); }
.login-heading { margin-bottom: 24px; }
.login-heading .kicker { color: var(--gold); }
.login-heading h2 { font-size: 36px; color: var(--ink); margin: 5px 0 4px; line-height: 1.5; }
.login-heading p:not(.kicker) { color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 15px; }
.login-form .field > span { color: #4b554c; }
.login-foot { margin-top: 26px; font-size: 11.5px; color: var(--muted-2); text-align: center; }
.login-legal { margin-top: auto; padding-top: 24px; text-align: center; font-size: 10.5px; color: #a5aa9d; }
.demo-hint {
  margin-top: 19px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #f2e7cd; border: 1px dashed #cfbc93; border-radius: 10px; padding: 9px 12px;
  font-size: 11.5px; color: #6c624d;
}
.demo-hint strong { display: block; font-size: 10.5px; color: var(--ink); }
.demo-hint span { font-family: var(--mono); direction: ltr; }
.noscript { padding: 40px; text-align: center; background: var(--paper); }

/* ---------- app shell ---------- */
.app-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  background: var(--desk-2);
}
.sidebar {
  position: sticky; top: 0; height: 100dvh; z-index: 30;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px 16px;
  background:
    radial-gradient(500px 300px at 50% 0%, rgba(76, 125, 106, 0.24), transparent 70%),
    linear-gradient(180deg, #14382f, #0c251f 72%, #091d18);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
  color: #e9e2d1;
  overflow: hidden auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 8px; }
.sidebar-brand .brand-mark { width: 39px; height: 39px; border-radius: 10px; padding: 6px; }
.sidebar-brand strong { display: block; font-family: var(--urdu); font-size: 22px; line-height: 1.45; color: #f9f1de; }
.sidebar-brand small { display: block; color: #8fa69a; font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; }
.shop-chip {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border: 1px solid rgba(214, 179, 109, 0.18); background: rgba(255, 255, 255, 0.035);
  border-radius: 10px; color: #f0e8d6; font-size: 12px;
}
.shop-chip .shop-avatar {
  width: 30px; height: 30px; border-radius: 8px; background: var(--gold); color: #231a09;
  display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none;
}
.shop-chip div { min-width: 0; }
.shop-chip strong { display: block; font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-chip small { color: #91a69a; font-size: 10px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow-y: auto; padding-inline-end: 2px; scrollbar-width: thin; scrollbar-color: rgba(214, 179, 109, 0.35) transparent; }
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(214, 179, 109, 0.3); border-radius: 4px; }
.nav-group { margin-top: 9px; padding: 0 9px 3px; font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: #728c7e; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: 9px; color: #c8d4c9; font-size: 12.5px;
  border: 1px solid transparent; transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.055); color: #fff8e8; text-decoration: none; }
.nav-link.active {
  background: var(--paper); color: var(--ink); border-color: #e8ddc5;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.55);
}
.nav-link.active .nav-icon { color: var(--ink); }
.nav-link .nav-icon { width: 18px; height: 18px; color: #9db4a7; flex: none; }
.nav-link .nav-label { flex: 1; }
.nav-link .nav-sub { display: none; font-size: 9px; color: #7f9588; letter-spacing: 0.04em; }
.nav-link.active .nav-sub { color: #8c8f82; }
.nav-badge {
  min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center;
  background: var(--red); color: #fff; border-radius: 9px; font-size: 10px; font-weight: 700;
}
.nav-link.active .nav-badge { background: var(--red); }
.sidebar-foot { margin-top: auto; display: grid; gap: 9px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 6px 7px; border-radius: 9px; }
.sidebar-user:hover { background: rgba(255, 255, 255, 0.05); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, #d6b36d, #aa7d35); color: #2b1f09;
  font-weight: 800; font-size: 12px; flex: none; border: 1px solid rgba(255, 255, 255, 0.15);
}
.sidebar-user div { min-width: 0; }
.sidebar-user strong { display: block; font-size: 12px; color: #f1e9d8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { color: #8da296; font-size: 10px; }
.sidebar-actions { display: flex; gap: 5px; }
.sidebar-action {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 6px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px;
  background: rgba(255, 255, 255, 0.035); color: #afc1b4; font-size: 10.5px; cursor: pointer;
}
.sidebar-action:hover { color: #fff5e1; background: rgba(255, 255, 255, 0.08); }
.sidebar-action .icon { width: 14px; height: 14px; }

.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; position: relative; }
.app-main::before {
  content: ""; position: fixed; inset: 0; inset-inline-start: var(--sidebar-w); z-index: 0;
  background:
    radial-gradient(800px 500px at 70% -10%, rgba(255, 248, 231, 0.11), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #3b3224, #241e16 65%);
  pointer-events: none;
}
.topbar {
  position: sticky; top: 0; z-index: 25;
  min-height: 68px; display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(16px, 2.6vw, 34px);
  background: rgba(247, 240, 225, 0.94);
  border-bottom: 1px solid rgba(116, 93, 54, 0.18);
  backdrop-filter: blur(12px);
}
.topbar-title { min-width: 0; }
.topbar-title .crumb { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #8c8f7f; }
.topbar-title strong { display: block; font-family: var(--urdu); font-size: 21px; line-height: 1.9; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-block: 3px; }
.topbar-date {
  display: flex; align-items: center; gap: 7px; margin-inline-start: 10px; padding: 6px 11px;
  background: rgba(255, 253, 246, 0.75); border: 1px solid var(--line); border-radius: 9px;
  color: #657065; font-size: 11.5px; white-space: nowrap;
}
.topbar-date .icon { width: 14px; height: 14px; color: var(--gold); }
.topbar-search {
  flex: 1; max-width: 390px; margin-inline-start: auto;
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px;
  background: #fffdf7; border: 1px solid var(--line); border-radius: 10px;
  color: #969b90; font-size: 12px; cursor: text; text-align: start;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.topbar-search:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.topbar-search .icon { width: 16px; height: 16px; color: var(--ink-3); }
.topbar-search kbd {
  margin-inline-start: auto; font-family: var(--sans); font-size: 9.5px; color: #9a9d92;
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 4px; padding: 1px 4px;
}
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-actions .icon-btn { width: 36px; height: 36px; border-radius: 9px; }
.topbar-actions .icon-btn:hover { background: rgba(23, 60, 51, 0.07); }
.online-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 20px;
  background: #e8f2ea; color: #2f6b4d; font-size: 10px; font-weight: 650; white-space: nowrap;
}
.online-pill.off { background: #f9e9e5; color: var(--red); }
.online-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin: 0; }
.user-menu-btn { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; cursor: pointer; padding: 3px; border-radius: 20px; }
.user-menu-btn:hover { background: rgba(23, 60, 51, 0.06); }
.user-menu-btn .avatar { width: 31px; height: 31px; font-size: 11px; }
.user-menu-btn span { font-size: 11px; color: #5f685f; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page-host {
  position: relative; z-index: 1;
  flex: 1;
  padding: clamp(14px, 2.4vw, 30px) clamp(12px, 2.6vw, 36px);
  perspective: 2200px;
  min-width: 0;
}
.leaf {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.97), rgba(250, 244, 231, 0.99)),
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(53, 87, 74, 0.045) 43px 44px);
  border: 1px solid rgba(110, 86, 46, 0.22);
  border-radius: 4px 14px 14px 4px;
  box-shadow: 0 24px 55px -22px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255, 255, 255, 0.7) inset;
  min-height: calc(100dvh - 140px);
  padding: clamp(16px, 2.4vw, 32px);
  transform-origin: right center;
  animation: leafIn 0.42s cubic-bezier(0.2, 0.75, 0.25, 1);
  overflow: hidden;
}
.leaf::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 15px;
  background: linear-gradient(90deg, rgba(78, 58, 28, 0.12), transparent);
  border-inline-end: 1px solid rgba(110, 86, 46, 0.12); pointer-events: none;
}
.leaf::after {
  content: ""; position: absolute; inset-inline-end: 0; bottom: 0; width: 54px; height: 54px;
  background: linear-gradient(135deg, transparent 50%, rgba(229, 216, 190, 0.7) 50%);
  border-start-start-radius: 8px; pointer-events: none;
}
.leaf.flip-out { animation: leafOut 0.34s ease-in forwards; }
.leaf.no-anim { animation: none; }
/* A real page-roll: the old sheet lifts from the spine and turns over,
   revealing the new sheet underneath. */
.leaf.flip-out {
  z-index: 8;
  transform-origin: right center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  animation: pageRollNext 1.05s cubic-bezier(0.23, 0.7, 0.24, 1) forwards;
  pointer-events: none;
}
[dir="ltr"] .leaf.flip-out {
  transform-origin: left center;
  animation-name: pageRollNextLtr;
}
.leaf.page-arriving {
  animation: pageArrive 1.05s cubic-bezier(0.23, 0.7, 0.24, 1);
}
.page-host.turning::after {
  content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none;
  background: linear-gradient(90deg, rgba(28, 18, 6, 0.46), rgba(28, 18, 6, 0.14) 34%, transparent 62%);
  animation: turnShadow 1.05s ease-out forwards;
}
[dir="ltr"] .page-host.turning::after {
  background: linear-gradient(270deg, rgba(28, 18, 6, 0.46), rgba(28, 18, 6, 0.14) 34%, transparent 62%);
}
@keyframes leafIn {
  from { opacity: 0; transform: rotateY(-9deg) translateX(20px) scale(0.995); }
  to { opacity: 1; transform: rotateY(0) translateX(0) scale(1); }
}
@keyframes leafOut {
  to { opacity: 0; transform: rotateY(12deg) translateX(-22px) scale(0.995); }
}
@keyframes pageRollNext {
  0% { transform: rotateY(0) translateX(0) translateY(0); box-shadow: 0 24px 55px -22px rgba(0, 0, 0, 0.55); }
  22% { transform: rotateY(-26deg) translateX(-10px) translateY(-18px); box-shadow: -34px 42px 70px -24px rgba(0, 0, 0, 0.62); }
  50% { transform: rotateY(-74deg) translateX(-5px) translateY(-10px); box-shadow: -54px 30px 80px -26px rgba(0, 0, 0, 0.65); }
  78% { transform: rotateY(-108deg) translateX(-1px) translateY(-3px); box-shadow: -64px 8px 90px -28px rgba(0, 0, 0, 0.55); }
  100% { transform: rotateY(-128deg) translateX(0) translateY(0); opacity: 0.04; box-shadow: -70px 0 100px -30px rgba(0, 0, 0, 0.45); }
}
@keyframes pageRollNextLtr {
  0% { transform: rotateY(0) translateX(0) translateY(0); box-shadow: 0 24px 55px -22px rgba(0, 0, 0, 0.55); }
  22% { transform: rotateY(26deg) translateX(10px) translateY(-18px); box-shadow: 34px 42px 70px -24px rgba(0, 0, 0, 0.62); }
  50% { transform: rotateY(74deg) translateX(5px) translateY(-10px); box-shadow: 54px 30px 80px -26px rgba(0, 0, 0, 0.65); }
  78% { transform: rotateY(108deg) translateX(1px) translateY(-3px); box-shadow: 64px 8px 90px -28px rgba(0, 0, 0, 0.55); }
  100% { transform: rotateY(128deg) translateX(0) translateY(0); opacity: 0.04; box-shadow: 70px 0 100px -30px rgba(0, 0, 0, 0.45); }
}
@keyframes pageArrive {
  0% { filter: brightness(0.68) saturate(0.86); }
  40% { filter: brightness(0.88); }
  100% { filter: brightness(1); }
}
@keyframes turnShadow {
  0% { opacity: 0; }
  16% { opacity: 1; }
  68% { opacity: 0.6; }
  100% { opacity: 0; }
}
.desk-footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 4px clamp(16px, 2.6vw, 34px) 18px;
  color: rgba(247, 239, 219, 0.42); font-size: 10.5px; letter-spacing: 0.03em;
}
.desk-footer .dot { color: var(--gold); }

/* ---------- page headings ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line);
}
.page-head-main { min-width: 0; }
.page-eyebrow { display: flex; align-items: center; gap: 7px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; }
.page-eyebrow .icon { width: 14px; height: 14px; }
.page-title { font-size: clamp(24px, 2.8vw, 34px); line-height: 1.55; color: var(--ink); margin-top: 3px; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions .btn { flex: none; }

/* ---------- register sheet ---------- */
.register-head {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 2px 0 17px; border-bottom: 3px double var(--ink);
  flex-wrap: wrap;
}
.register-title { display: flex; align-items: center; gap: 14px; }
.register-seal {
  width: 50px; height: 50px; border-radius: 50%; border: 1.5px solid var(--gold);
  display: grid; place-items: center; color: var(--gold); background: rgba(214, 179, 109, 0.08);
  font-family: var(--urdu); font-size: 20px; flex: none;
}
.register-title h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.45; color: var(--ink); }
.register-title .register-en { display: block; font-family: var(--sans); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: #8e9388; margin-top: 1px; }
.register-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 7px; font-size: 10.5px; color: #6e756a;
  background: rgba(255, 253, 246, 0.6);
}
.meta-chip strong { color: var(--ink); font-weight: 700; }
.meta-chip .icon { width: 13px; height: 13px; color: var(--gold); }
.stamp {
  display: inline-flex; align-items: center; gap: 5px; border: 2px solid var(--red);
  color: var(--red); border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 750;
  letter-spacing: 0.08em; transform: rotate(-3deg); opacity: 0.8;
}
.stamp.open { border-color: var(--green); color: var(--green); transform: rotate(2deg); }

.summary-ribbon {
  display: grid; grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden;
  margin: 16px 0 18px; background: rgba(255, 252, 243, 0.7);
}
.summary-cell { padding: 9px 12px; border-inline-end: 1px dashed var(--line-2); min-width: 0; }
.summary-cell:last-child { border-inline-end: 0; }
.summary-cell .k { display: block; font-size: 9.5px; color: #858b7e; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-cell .v { display: block; font-size: 16px; font-weight: 750; color: var(--ink); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-cell .v.red { color: var(--red); }
.summary-cell .v.green { color: var(--green); }
.summary-cell .v.muted { color: var(--muted); font-weight: 600; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 246, 0.6); }
.daybook-mobile-wrap { display: none; }
.table-wrap.flush { border: 0; border-radius: 0; background: transparent; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: start; padding: 9px 10px; background: #f0e7d4;
  color: #6d7468; font-size: 10px; font-weight: 750; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line-2); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
th .th-en { display: block; font-size: 8px; font-weight: 500; color: #9a9d90; letter-spacing: 0.08em; text-transform: uppercase; }
td { padding: 8px 10px; border-bottom: 1px solid rgba(53, 87, 74, 0.12); font-size: 12.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: rgba(240, 231, 212, 0.24); }
tbody tr:hover td { background: rgba(214, 179, 109, 0.12); }
td.num, th.num { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.center, th.center { text-align: center; }
td.credit { color: var(--red); font-weight: 650; }
td.debit { color: var(--green); font-weight: 650; }
td.balance { color: var(--ink); font-weight: 750; background: rgba(214, 179, 109, 0.08) !important; }
td.desc { min-width: 180px; }
td.desc strong { display: block; font-weight: 650; color: #2f3a32; }
td.desc small { display: block; font-size: 10px; color: #979c90; margin-top: 1px; }
.table-date { font-size: 10.5px; color: #7d8479; white-space: nowrap; }
.table-actions { display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.table-actions .icon-btn { width: 28px; height: 28px; border-radius: 7px; }
.table-actions .icon { width: 14px; height: 14px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 2px 0; }
.table-totals { font-size: 12px; color: #6d7468; }
.table-totals strong { color: var(--ink); }
.empty-state { text-align: center; padding: 48px 18px; color: var(--muted); }
.empty-state .empty-icon { width: 48px; height: 48px; margin: 0 auto 10px; color: var(--gold); opacity: 0.65; }
.empty-state h3 { font-size: 19px; color: var(--ink); margin-bottom: 3px; }
.empty-state p { font-size: 12px; max-width: 340px; margin: 0 auto 13px; }
.empty-state .btn { margin: 0 auto; }

/* ---------- badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 20px;
  font-size: 9.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.badge .icon { width: 11px; height: 11px; }
.badge-green { background: #e4f1e9; color: #2c6a4b; border-color: #c7e2d3; }
.badge-red { background: #fbe9e5; color: #9a3326; border-color: #eecbc3; }
.badge-gold { background: #f6ecd4; color: #8a6423; border-color: #e7d3a8; }
.badge-blue { background: #e8f0f5; color: #37617c; border-color: #cfdee8; }
.badge-gray { background: #f0eee7; color: #6f7469; border-color: #e1ddd0; }
.badge-dark { background: var(--ink); color: #f9f1de; }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- cards / panels ---------- */
.panel {
  background: rgba(255, 252, 243, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px 10px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { font-size: 17px; color: var(--ink); line-height: 1.5; display: flex; align-items: center; gap: 7px; }
.panel-head .icon { color: var(--gold); width: 17px; height: 17px; }
.panel-head .panel-sub { font-size: 10.5px; color: var(--muted); }
.panel-body { padding: 14px 15px; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 10px 15px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255, 253, 246, 0.62); min-width: 0;
}
.kpi .k { font-size: 9.5px; color: #81887b; display: flex; align-items: center; gap: 5px; }
.kpi .k .icon { width: 13px; height: 13px; color: var(--gold); }
.kpi .v { font-size: 21px; font-weight: 750; color: var(--ink); direction: ltr; text-align: right; margin-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi .m { font-size: 10px; color: #9a9e92; margin-top: 2px; }
.kpi.red .v { color: var(--red); }
.kpi.green .v { color: var(--green); }

/* ---------- dashboard ---------- */
.dashboard-hero {
  position: relative; overflow: hidden; color: #f9f1de; border-radius: 14px;
  background:
    radial-gradient(550px 250px at 88% -20%, rgba(214, 179, 109, 0.3), transparent 65%),
    linear-gradient(125deg, #173c33, #0f2d25 65%, #0b241d);
  border: 1px solid rgba(214, 179, 109, 0.25);
  padding: 20px 22px;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: center;
  margin-bottom: 15px;
  box-shadow: 0 16px 40px -22px rgba(23, 60, 51, 0.7);
}
.dashboard-hero::after {
  content: ""; position: absolute; inset: 10px; border: 1px solid rgba(214, 179, 109, 0.20);
  border-radius: 9px; pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; }
.hero-copy .kicker { color: var(--gold-2); }
.hero-copy h2 { font-size: clamp(24px, 2.5vw, 32px); line-height: 1.55; color: #fdf7e8; margin: 3px 0 4px; }
.hero-copy p { font-size: 12px; color: #b6c7b9; max-width: 430px; }
.hero-balance { text-align: center; position: relative; z-index: 1; padding: 4px 0; }
.hero-balance .label { font-size: 10px; color: #b5c5b8; letter-spacing: 0.06em; }
.hero-balance .value { font-size: clamp(34px, 4vw, 48px); font-weight: 800; letter-spacing: -0.02em; color: var(--gold-2); direction: ltr; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 2px 0; }
.hero-balance .sub { font-size: 10.5px; color: #a7b9ab; }
.hero-diff { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; padding: 3px 9px; border-radius: 20px; font-size: 10px; background: rgba(255, 255, 255, 0.08); color: #e4d7b9; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 15px; }
.quick-action {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 252, 243, 0.7); cursor: pointer;
  text-align: start; color: var(--ink); transition: transform 0.12s, box-shadow 0.15s;
}
.quick-action:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); background: #fffdf6; text-decoration: none; }
.quick-action .qa-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #efe4cc; color: var(--ink); flex: none; }
.quick-action:nth-child(2) .qa-icon { background: #e4efe8; color: var(--green); }
.quick-action:nth-child(3) .qa-icon { background: #f5e8e4; color: var(--red); }
.quick-action:nth-child(4) .qa-icon { background: #e8edf4; color: var(--blue); }
.quick-action strong { display: block; font-size: 12px; font-weight: 700; }
.quick-action small { display: block; font-size: 9.5px; color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.dash-side { display: grid; gap: 14px; }
.mini-list { display: grid; }
.mini-row { display: flex; align-items: center; gap: 9px; padding: 9px 15px; border-bottom: 1px solid rgba(53, 87, 74, 0.1); }
.mini-row:last-child { border: 0; }
.mini-row .mini-avatar { width: 30px; height: 30px; border-radius: 8px; background: #efe4cc; color: var(--ink); display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.mini-row div { min-width: 0; flex: 1; }
.mini-row strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row small { display: block; font-size: 10px; color: var(--muted); }
.mini-row .amt { font-size: 12px; font-weight: 750; color: var(--red); direction: ltr; }
.mini-row .amt.green { color: var(--green); }
.chart-panel { padding: 14px 15px 10px; }
.chart-legend { display: flex; gap: 12px; font-size: 10px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--ink-3); }
.legend-dot.red { background: var(--red-soft); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; align-items: end; height: 126px; padding-top: 12px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; align-items: end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.bar { width: 10px; min-height: 2px; border-radius: 3px 3px 1px 1px; background: var(--ink-3); transition: height 0.3s; }
.bar.out { background: var(--red-soft); }
.bar-col .day { font-size: 8.5px; color: #929689; white-space: nowrap; }
.chart-empty { text-align: center; color: var(--muted); font-size: 11px; padding: 30px 0; }

/* ---------- parties / khata ---------- */
.party-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.party-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 252, 243, 0.72); cursor: pointer; transition: box-shadow 0.15s, transform 0.1s;
  text-align: start;
}
.party-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); text-decoration: none; }
.party-card.over { border-color: #e4b9ae; background: #fff8f4; }
.party-top { display: flex; align-items: center; gap: 9px; }
.party-avatar {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #efe2c6, #ddc8a1); color: #4d3b1d; font-weight: 800; font-size: 12px; flex: none;
}
.party-top div { min-width: 0; flex: 1; }
.party-top strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-top small { display: block; font-size: 10px; color: var(--muted); direction: ltr; text-align: right; }
.party-balance { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.party-balance .amount { font-size: 20px; font-weight: 800; color: var(--red); direction: ltr; font-variant-numeric: tabular-nums; }
.party-balance .amount.clear { color: var(--green); }
.party-balance .label { font-size: 9.5px; color: var(--muted); }
.party-meter { height: 4px; border-radius: 3px; background: #eee3cc; overflow: hidden; }
.party-meter span { display: block; height: 100%; background: var(--ink-3); border-radius: 3px; }
.party-meter span.warn { background: var(--gold); }
.party-meter span.over { background: var(--red); }
.party-foot { display: flex; justify-content: space-between; font-size: 9.5px; color: #8f9488; gap: 6px; }
.khata-hero {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden; margin-bottom: 15px;
}
.khata-hero > div { padding: 13px 15px; background: rgba(255, 252, 243, 0.8); }
.khata-hero .k { font-size: 9.5px; color: var(--muted); }
.khata-hero .v { font-size: 24px; font-weight: 800; color: var(--red); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.khata-hero .v.green { color: var(--green); }
.khata-hero .v.gold { color: var(--gold); }
.khata-hero .s { font-size: 10px; color: var(--muted); }
.wa-btn { background: #e7f5eb; color: #1f6b43; border-color: #c7e6d2; }

/* ---------- POS ---------- */
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; align-items: start; }
.pos-toolbar { display: flex; gap: 8px; margin-bottom: 11px; }
.pos-search { flex: 1; position: relative; }
.pos-search .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.pos-search input { padding-inline-start: 39px; padding-inline-end: 42px; height: 46px; font-size: 14px; }
.pos-search .scan-btn { position: absolute; inset-inline-end: 5px; top: 50%; transform: translateY(-50%); }
.category-scroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; margin-bottom: 10px; scrollbar-width: none; }
.category-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  border: 1px solid var(--line); background: rgba(255, 252, 243, 0.6); color: #667064;
  padding: 5px 11px; border-radius: 20px; font-size: 10.5px; white-space: nowrap; cursor: pointer;
}
.cat-chip.active { background: var(--ink); color: #fbf3de; border-color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; }
.product-tile {
  position: relative; display: flex; flex-direction: column; gap: 5px; text-align: start;
  padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 253, 246, 0.8); cursor: pointer; min-height: 92px;
  transition: border-color 0.12s, background 0.12s;
}
.product-tile:hover { border-color: var(--gold); background: #fffdf6; }
.product-tile:disabled { opacity: 0.45; cursor: not-allowed; }
.product-tile .p-cat { font-size: 8.5px; color: var(--gold); letter-spacing: 0.05em; text-transform: uppercase; }
.product-tile strong { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-tile .p-bottom { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: auto; }
.product-tile .p-price { font-size: 13px; font-weight: 800; color: var(--ink); direction: ltr; }
.product-tile .p-stock { font-size: 9px; color: var(--muted); }
.product-tile .p-stock.low { color: var(--red); }
.cart-panel { position: sticky; top: 82px; background: rgba(255, 252, 243, 0.92); border: 1px solid var(--line-2); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow-sm); }
.cart-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.cart-head h3 { font-size: 18px; color: var(--ink); }
.cart-head .badge { background: var(--ink); color: #f9f1de; }
.cart-items { max-height: 280px; overflow: auto; }
.cart-row { display: flex; gap: 8px; padding: 9px 13px; border-bottom: 1px solid rgba(53, 87, 74, 0.1); align-items: center; }
.cart-row:last-child { border: 0; }
.cart-row .ci-main { flex: 1; min-width: 0; }
.cart-row .ci-main strong { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-row .ci-main small { display: block; font-size: 9.5px; color: var(--muted); direction: ltr; text-align: right; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.qty-control button { width: 23px; height: 23px; border: 0; background: var(--paper-2); cursor: pointer; font-weight: 800; line-height: 1; color: var(--ink); }
.qty-control span { min-width: 22px; text-align: center; font-size: 11px; font-weight: 700; direction: ltr; }
.cart-empty { padding: 32px 15px; text-align: center; color: var(--muted); font-size: 11.5px; }
.cart-empty .icon { width: 34px; height: 34px; margin: 0 auto 7px; opacity: 0.45; }
.cart-summary { padding: 10px 14px; border-top: 1px solid var(--line); display: grid; gap: 5px; background: rgba(240, 231, 212, 0.4); }
.cart-line { display: flex; justify-content: space-between; font-size: 11.5px; color: #6f766a; }
.cart-line.total { font-size: 18px; font-weight: 800; color: var(--ink); border-top: 1px dashed var(--line-2); padding-top: 6px; margin-top: 2px; }
.cart-line .num { font-weight: 700; }
.cart-controls { padding: 10px 14px 13px; display: grid; gap: 8px; }
.cart-controls .field { gap: 4px; }
.cart-controls .field > span { font-size: 10px; }
.cart-controls .input, .cart-controls .select { min-height: 37px; padding: 6px 9px; font-size: 12px; border-radius: 8px; }
.cart-controls .btn { min-height: 44px; }
.cart-payment-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cart-change { font-size: 10.5px; color: var(--green); font-weight: 650; text-align: center; }
.receipt { width: 300px; max-width: 100%; background: #fffdf7; padding: 18px; border: 1px dashed #c9b692; font-size: 11.5px; color: #323a33; }
.receipt-head { text-align: center; border-bottom: 1px dashed #c9b692; padding-bottom: 8px; margin-bottom: 8px; }
.receipt-head h3 { font-size: 21px; }
.receipt-head p { font-size: 9.5px; color: var(--muted); }
.receipt-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.receipt-row.total { border-top: 1px dashed #c9b692; margin-top: 6px; padding-top: 7px; font-size: 14px; font-weight: 800; }
.receipt-items { margin: 6px 0; }
.receipt-items .ri { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; padding: 2px 0; }
.receipt-foot { text-align: center; margin-top: 10px; font-size: 9.5px; color: var(--muted); border-top: 1px dashed #c9b692; padding-top: 7px; }

/* ---------- inventory ---------- */
.inventory-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 13px; }
.stock-low { color: var(--red); font-weight: 700; }
.stock-ok { color: var(--green); font-weight: 650; }
.barcode { font-family: var(--mono); font-size: 10px; direction: ltr; letter-spacing: 0.04em; color: #777f74; }

/* ---------- forms in modal / purchase builder ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 18px; background: rgba(17, 23, 19, 0.6); backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(720px, 100%); max-height: min(88dvh, 900px); display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, #fffdf7, #f9f1df),
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(53, 87, 74, 0.045) 43px 44px);
  border: 1px solid #d8c8a8; border-radius: 15px; box-shadow: var(--shadow-lg);
  animation: modalIn 0.24s cubic-bezier(0.2, 0.8, 0.25, 1); overflow: hidden;
}
.modal.wide { width: min(940px, 100%); }
.modal.narrow { width: min(470px, 100%); }
.modal.receipt-modal { width: auto; background: transparent; border: 0; box-shadow: none; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 17px 19px 12px; border-bottom: 1px solid var(--line); }
.modal-head .modal-title { flex: 1; min-width: 0; }
.modal-head .kicker { color: var(--gold); }
.modal-head h2 { font-size: 24px; line-height: 1.5; color: var(--ink); }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.modal-head .icon-btn { margin-top: -3px; }
.modal-body { padding: 16px 19px; overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 19px 15px; border-top: 1px solid var(--line); background: rgba(246, 238, 220, 0.55); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.modal-section-title { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 750; margin: 16px 0 7px; }
.modal-section-title:first-child { margin-top: 0; }
.purchase-lines { display: grid; gap: 7px; }
.purchase-line { display: grid; grid-template-columns: 1.7fr 0.6fr 0.8fr 0.7fr 30px; gap: 6px; align-items: center; }
.purchase-line .input, .purchase-line .select { min-height: 38px; padding: 6px 8px; font-size: 12px; }
.purchase-line .line-total { font-size: 12px; font-weight: 700; direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.purchase-line .icon-btn { width: 30px; height: 30px; }
.line-add { margin-top: 6px; }
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px; margin-top: 12px; }
.pay-summary div { min-width: 0; }
.pay-summary .k { display: block; font-size: 9.5px; color: var(--muted); }
.pay-summary .v { display: block; font-size: 15px; font-weight: 800; color: var(--ink); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- command palette ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 120; padding: 8vh 16px 16px;
  background: rgba(17, 23, 19, 0.55); backdrop-filter: blur(5px);
  display: flex; justify-content: center; align-items: flex-start; animation: fadeIn 0.15s;
}
.search-box {
  width: min(660px, 100%); max-height: 74dvh; display: flex; flex-direction: column;
  background: #fffdf7; border: 1px solid #d8c8a8; border-radius: 15px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.search-input-row { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.search-input-row > .icon { color: var(--gold); width: 20px; height: 20px; }
.search-input-row input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 4px 0; }
.search-input-row .mic-btn { color: var(--ink); }
.search-input-row .mic-btn.listening { background: #fbe9e5; color: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(178, 58, 43, 0.12); } }
.search-hint { display: flex; gap: 8px; align-items: center; padding: 6px 14px; border-bottom: 1px solid var(--line); color: #91968a; font-size: 9.5px; }
.search-hint span { display: inline-flex; align-items: center; gap: 4px; }
.search-results { overflow: auto; padding: 6px; }
.search-group-label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: #9a9e91; padding: 8px 9px 4px; }
.search-result { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.search-result:hover, .search-result.active { background: #f4ead5; border-color: #e7d6b5; }
.search-result .sr-icon { width: 29px; height: 29px; border-radius: 7px; background: #f1e5cc; color: var(--ink); display: grid; place-items: center; flex: none; }
.search-result .sr-icon .icon { width: 15px; height: 15px; }
.search-result div { min-width: 0; flex: 1; }
.search-result strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result small { display: block; font-size: 9.5px; color: var(--muted); }
.search-result .sr-side { font-size: 10px; color: var(--red); font-weight: 700; direction: ltr; }
.search-empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 12px; }
.search-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 8px 9px; border-bottom: 1px dashed var(--line); }
.search-suggestions > span { color: #8b9083; font-size: 9.5px; margin-inline-end: 2px; }
.suggestion-chip {
  border: 1px solid #dfcfac; background: #f7edd8; color: #6b5527;
  border-radius: 20px; padding: 3px 9px; font-size: 10px; cursor: pointer;
}
.suggestion-chip:hover { background: #f0dfbe; color: var(--ink); }

/* ---------- toasts / banners ---------- */
.toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 7px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 10px;
  background: #163b32; color: #f9f1de; box-shadow: var(--shadow-lg); font-size: 12.5px;
  animation: toastIn 0.25s ease; pointer-events: auto; border: 1px solid rgba(214, 179, 109, 0.25);
}
.toast.error { background: #7e2d23; border-color: #a64d40; }
.toast.success { background: #1f5c43; }
.toast .icon { width: 17px; height: 17px; color: var(--gold-2); flex: none; }
.toast.error .icon { color: #f4b7ac; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.offline-banner {
  position: fixed; bottom: 16px; inset-inline-end: 16px; z-index: 90; max-width: 360px;
  display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 9px;
  background: #7b4a1e; color: #fdf0d8; font-size: 11px; box-shadow: var(--shadow);
}
.offline-banner .icon { width: 16px; height: 16px; flex: none; }
.net-banner {
  padding: 7px 11px; margin-bottom: 12px; border-radius: 8px; font-size: 11.5px;
  background: #f5ead4; border: 1px solid #e5d2a8; color: #7d5d21;
  display: flex; align-items: center; gap: 7px;
}
.net-banner .icon { width: 14px; height: 14px; }

/* ---------- settings ---------- */
.settings-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-tabs { display: grid; gap: 4px; position: sticky; top: 82px; }
.settings-tab {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: #667064; cursor: pointer;
  text-align: start; font-size: 12px;
}
.settings-tab .icon { width: 15px; height: 15px; color: var(--gold); }
.settings-tab.active { background: #fffdf6; border-color: var(--line); color: var(--ink); font-weight: 700; }
.settings-panel { min-width: 0; }
.settings-section { margin-bottom: 18px; }
.settings-section:last-child { margin-bottom: 0; }
.module-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.module-row:last-child { border: 0; }
.module-row .module-info { flex: 1; min-width: 0; }
.module-row strong { display: block; font-size: 12.5px; }
.module-row small { display: block; font-size: 10.5px; color: var(--muted); }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.permission-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: rgba(255, 253, 246, 0.5); }
.permission-group h4 { font-family: var(--sans); font-size: 11px; color: var(--ink); margin-bottom: 5px; }
.permission-item { display: flex; align-items: flex-start; gap: 6px; padding: 3px 0; font-size: 10.5px; color: #5f685f; }
.permission-item input { accent-color: var(--ink); margin-top: 2px; }
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.role-card { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 246, 0.6); }
.role-card strong { display: block; font-size: 12.5px; }
.role-card small { display: block; font-size: 10px; color: var(--muted); }
.role-card .role-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 7px; }

/* ---------- orders / report ---------- */
.order-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.order-col { background: rgba(240, 231, 212, 0.38); border: 1px solid var(--line); border-radius: 11px; padding: 9px; min-height: 130px; }
.order-col-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; color: #5f685f; padding: 2px 3px 8px; }
.order-card { background: #fffdf7; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 7px; box-shadow: var(--shadow-sm); }
.order-card strong { display: block; font-size: 11.5px; }
.order-card small { display: block; font-size: 9.5px; color: var(--muted); }
.order-card .order-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.order-card select { min-height: 27px; padding: 2px 5px; font-size: 9.5px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper-2); }
.report-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.report-filters .input { width: auto; min-height: 37px; padding: 5px 9px; font-size: 12px; }
.report-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-bottom: 13px; }
.report-stats .kpi .v { font-size: 18px; }
.big-chart { height: 200px; display: flex; align-items: flex-end; gap: 7px; padding-top: 16px; overflow-x: auto; }
.big-chart .bc { flex: 1; min-width: 18px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.big-chart .bc .bars2 { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 100%; justify-content: center; }
.big-chart .bc .b1, .big-chart .bc .b2 { width: 6px; border-radius: 2px 2px 0 0; min-height: 2px; }
.big-chart .bc .b1 { background: var(--ink-3); }
.big-chart .bc .b2 { background: var(--red-soft); }
.big-chart .bc span { font-size: 8px; color: #989c8f; white-space: nowrap; transform: rotate(-35deg); }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.rank-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid rgba(53, 87, 74, 0.1); }
.rank-row:last-child { border: 0; }
.rank-num { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: #f0e4cb; color: #7b6028; font-size: 9px; font-weight: 800; flex: none; }
.rank-row div { flex: 1; min-width: 0; }
.rank-row strong { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row small { font-size: 9.5px; color: var(--muted); }
.rank-row .amt { font-size: 11.5px; font-weight: 750; direction: ltr; color: var(--ink); }
.expense-bar { height: 6px; border-radius: 3px; background: #eee3cc; overflow: hidden; margin-top: 3px; }
.expense-bar span { display: block; height: 100%; background: var(--gold); }

/* ---------- misc ---------- */
.info-strip {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 8px;
  background: #f5ead4; border: 1px solid #e6d3aa; color: #775a22; font-size: 10.5px; margin-bottom: 12px;
}
.info-strip .icon { width: 14px; height: 14px; flex: none; }
.danger-strip { background: #fbece8; border-color: #ecc7bd; color: #8d3427; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 5px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { flex: 1; min-width: 180px; max-width: 360px; position: relative; }
.toolbar .search .icon { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 15px; height: 15px; }
.toolbar .search input { padding-inline-start: 33px; min-height: 38px; font-size: 12px; }
.toolbar .select { width: auto; min-height: 38px; font-size: 12px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination .page-num { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; font-size: 11px; border: 1px solid var(--line); background: #fffdf6; }
.pagination .page-num.active { background: var(--ink); color: #f9f1de; border-color: var(--ink); }
.page-turn-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: #95998c; }
.page-turn-hint .icon { width: 12px; height: 12px; }
.page-corner {
  position: absolute; bottom: 0; inset-inline-end: 0; width: 38px; height: 38px;
  border: 0; background: linear-gradient(135deg, transparent 48%, #e8dcc2 50%);
  cursor: pointer; z-index: 2; border-end-end-radius: 12px;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
.status-dot.on { background: var(--green); }
.status-dot.warn { background: var(--gold); }
.status-dot.off { background: var(--red); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 8px 13px; color: #777f74; font-size: 12px; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.code { font-family: var(--mono); font-size: 10.5px; direction: ltr; background: #f3e9d5; border: 1px solid #e5d6b8; padding: 1px 5px; border-radius: 4px; }
.mobile-only { display: none !important; }
.mobile-credit { display: none; }

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

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --sidebar-w: 228px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .party-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .report-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .login-wrap { grid-template-columns: 1fr; min-height: auto; }
  .login-story { display: none; }
  .login-card { min-height: min(680px, calc(100dvh - 32px)); }
  .login-topline { padding-bottom: 28px; }
  .summary-ribbon { grid-template-columns: repeat(3, 1fr); }
  .summary-cell:nth-child(3n) { border-inline-end: 0; }
  .summary-cell { border-bottom: 1px dashed var(--line-2); }
  .summary-cell:nth-last-child(-n+3) { border-bottom: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .dashboard-hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { text-align: center; }
  .hero-copy p { margin: 0 auto; }
  .pos-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .settings-shell { grid-template-columns: 1fr; }
  .settings-tabs { position: static; display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .settings-tab { white-space: nowrap; }
  .permission-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .khata-hero { grid-template-columns: 1fr 1fr; }
  .khata-hero > div:first-child { grid-column: 1 / -1; }
  .inventory-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .app-view { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .app-main::before { inset-inline-start: 0; }
  .topbar { min-height: 58px; padding: 8px 13px; gap: 8px; }
  .topbar-title .crumb { display: none; }
  .topbar-title strong { font-size: 18px; }
  .topbar-date { display: none; }
  .topbar-search { max-width: none; flex: 1; height: 35px; }
  .topbar-search kbd { display: none; }
  .topbar-actions .online-pill { display: none; }
  .topbar-actions .user-menu-btn span:not(.avatar) { display: none; }
  .page-host { padding: 11px 10px 84px; }
  .leaf { min-height: calc(100dvh - 170px); padding: 14px 12px; border-radius: 3px 10px 10px 3px; }
  .leaf::before { width: 8px; }
  .desk-footer { display: none; }
  .mobile-nav {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(247, 240, 225, 0.97); border-top: 1px solid var(--line-2);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(12px); box-shadow: 0 -8px 24px -16px rgba(0, 0, 0, 0.4);
  }
  .mnav-link {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 5px 2px; border-radius: 8px; color: #6f776d; font-size: 9px;
    border: 0; background: transparent; cursor: pointer; min-width: 0;
  }
  .mnav-link .icon { width: 20px; height: 20px; }
  .mnav-link.active { color: var(--ink); background: rgba(214, 179, 109, 0.16); font-weight: 700; }
  .mnav-link .mnav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  .page-title { font-size: 26px; }
  .register-head { padding-bottom: 12px; }
  .register-title h1 { font-size: 27px; }
  .register-seal { width: 40px; height: 40px; font-size: 16px; }
  .register-meta { justify-content: flex-start; }
  .party-grid { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .order-board { grid-template-columns: 1fr; }
  .report-stats { grid-template-columns: repeat(2, 1fr); }
  .modal { max-height: 92dvh; }
  .modal-backdrop { padding: 8px; align-items: end; }
  .modal { border-radius: 16px 16px 0 0; }
  .toast-root { bottom: 84px; }
  .offline-banner { bottom: 80px; inset-inline: 12px; max-width: none; font-size: 10.5px; }
  .receipt { width: 100%; }
}
@media (max-width: 620px) {
  .login-view { padding: 10px; }
  .login-wrap { border-radius: 16px; min-height: calc(100dvh - 20px); }
  .login-card { padding: 18px 20px; }
  .login-heading h2 { font-size: 30px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; gap: 10px; margin-bottom: 12px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .summary-ribbon { grid-template-columns: repeat(2, 1fr); }
  .summary-cell:nth-child(3n) { border-inline-end: 1px dashed var(--line-2); }
  .summary-cell:nth-child(2n) { border-inline-end: 0; }
  .summary-cell:nth-last-child(-n+3) { border-bottom: 1px dashed var(--line-2); }
  .summary-cell:nth-last-child(-n+2) { border-bottom: 0; }
  .summary-cell .v { font-size: 15px; }
  .dashboard-hero { padding: 16px 14px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-action { padding: 9px; }
  .quick-action .qa-icon { width: 29px; height: 29px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .kpi { padding: 9px 10px; }
  .kpi .v { font-size: 18px; }
  .khata-hero { grid-template-columns: 1fr 1fr; }
  .khata-hero .v { font-size: 19px; }
  .table-wrap { border-radius: 8px; }
  th { padding: 7px 6px; font-size: 9px; }
  td { padding: 7px 6px; font-size: 11px; }
  td.desc { min-width: 120px; }
  th .th-en { display: none; }
  .summary-cell { padding: 7px 8px; }
  .register-title { gap: 9px; }
  .register-title h1 { font-size: 24px; }
  .register-seal { width: 36px; height: 36px; font-size: 14px; }
  .meta-chip { font-size: 9.5px; padding: 4px 7px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .product-tile { min-height: 84px; padding: 8px; }
  .product-tile strong { font-size: 11px; }
  .product-tile .p-price { font-size: 12px; }
  .cart-items { max-height: 230px; }
  .report-stats { grid-template-columns: 1fr 1fr; }
  .toolbar .search { max-width: none; flex: 1 1 100%; }
  .purchase-line { grid-template-columns: 1.6fr 0.55fr 0.7fr 0.65fr 28px; gap: 4px; }
  .purchase-line .input, .purchase-line .select { font-size: 10.5px; padding: 5px 5px; }
  .pay-summary { grid-template-columns: 1fr 1fr; }
  .settings-tabs { gap: 2px; }
  .settings-tab { padding: 7px 8px; font-size: 10.5px; }
  .role-grid { grid-template-columns: 1fr; }
  .modal-head { padding: 13px 14px 10px; }
  .modal-head h2 { font-size: 21px; }
  .modal-body { padding: 13px 14px; }
  .modal-foot { padding: 10px 14px 13px; }
  .modal-foot .btn { flex: 1; }
  .topbar-search span.search-label { display: none; }
  .topbar-search { flex: 0 0 auto; width: 36px; padding: 0; justify-content: center; }
  .topbar-search .icon { width: 18px; height: 18px; }
  .topbar-title strong { max-width: 150px; }
  .page-turn-hint { display: none; }
  .table-actions .icon-btn { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- inline add-new for list-of-values ---------- */
.lov-row { display: flex; gap: 6px; align-items: center; }
.lov-row .select { flex: 1; min-width: 0; }
.lov-add { flex: none; width: 30px; height: 30px; padding: 0; justify-content: center; border: 1px dashed var(--gold); color: var(--ink); background: #fffdf6; }
.lov-add:hover { background: #f3e6c8; border-style: solid; }
.lov-add .icon { width: 14px; height: 14px; }

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .mobile-nav, .desk-footer, .toast-root, .offline-banner,
  .page-actions, .page-head .page-actions, .toolbar, .page-turn-hint, .table-actions,
  .leaf::before, .leaf::after { display: none !important; }
  .app-view { display: block !important; background: #fff; }
  .app-main::before { display: none; }
  .app-main { display: block; }
  .page-host { padding: 0; perspective: none; }
  .leaf { box-shadow: none; border: 0; min-height: 0; padding: 8mm; border-radius: 0; animation: none; }
  .leaf.flip-out { display: none !important; }
  .table-wrap { overflow: visible; border-color: #999; }
  th { background: #eee !important; position: static; }
  .receipt-modal { display: block !important; position: static; background: #fff; }
  .receipt-modal .modal { box-shadow: none; border: 0; }
  .receipt { width: 80mm; }
}

/* ---------- traditional two-page roznamcha ---------- */
.view-toggle { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); }
.view-toggle button {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent;
  padding: 5px 9px; border-radius: 6px; color: #747b70; font-size: 10px; cursor: pointer;
}
.view-toggle button .icon { width: 13px; height: 13px; }
.view-toggle button.active { background: #fffdf6; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 700; }
.daybook-views[data-view="register"] .daybook-digital,
.daybook-views[data-view="digital"] .register-spread { display: none; }
.leaf[data-daybook-view="register"] .register-head,
.leaf[data-daybook-view="register"] .summary-ribbon { display: none; }

.register-spread {
  position: relative;
  padding: 14px 18px 12px;
  margin: 2px 0 14px;
  background:
    linear-gradient(90deg, rgba(158, 96, 31, 0.14), transparent 12px, transparent calc(100% - 12px), rgba(158, 96, 31, 0.14)),
    #efe6d3;
  border: 1px solid #d4c4a5;
  border-radius: 7px;
  box-shadow: 0 22px 50px -24px rgba(53, 38, 16, 0.6), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  overflow: hidden;
}
.register-spread::before {
  content: "";
  position: absolute; inset: 0 7px;
  border: 1px solid rgba(133, 91, 36, 0.35);
  border-radius: 3px;
  pointer-events: none;
}
.register-cover-edge {
  position: absolute; top: 8px; bottom: 8px; width: 7px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #b7652b, #8e4620);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.register-cover-edge.edge-right { inset-inline-end: 2px; border-radius: 2px 4px 4px 2px; }
.register-cover-edge.edge-left { inset-inline-start: 2px; border-radius: 4px 2px 2px 4px; }
.register-spread-top {
  display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: center;
  gap: 8px; padding: 0 3px 8px; margin-bottom: 7px;
  border-bottom: 3px double rgba(183, 65, 50, 0.65);
}
.rst-title { grid-column: 1; text-align: start; font-family: var(--urdu); font-size: 22px; line-height: 1.5; color: #2e3b34; }
.rst-month { grid-column: 2; text-align: center; color: #6d6a59; font-size: 9.5px; }
.rst-month b { color: #4b493b; font-weight: 650; }
.rst-page { grid-column: 3; text-align: end; color: #8d8774; font-size: 9px; direction: ltr; }
.register-pages { position: relative; display: grid; grid-template-columns: 1fr 14px 1fr; column-gap: 0; }
.register-spine {
  position: relative; align-self: stretch; width: 14px; min-height: 100%;
  background: linear-gradient(90deg, transparent, rgba(128, 108, 74, 0.16) 45%, rgba(128, 108, 74, 0.26) 50%, rgba(128, 108, 74, 0.16) 55%, transparent);
  pointer-events: none; z-index: 2;
}
.register-page {
  position: relative; z-index: 1;
  padding: 9px 12px 8px;
  background: #ffffff;
  border: 1px solid #e9e2d3;
  min-width: 0;
  box-shadow: none;
}
.register-page.register-income { border-radius: 2px 5px 5px 2px; }
.register-page.register-expense { border-radius: 5px 2px 2px 5px; }
.register-page-head { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 5px; padding-bottom: 5px; border-bottom: 2px solid rgba(183, 65, 50, 0.55); margin-bottom: 3px; }
.register-page-head .rp-title { grid-column: 1; text-align: start; font-family: var(--urdu); font-size: 17px; color: #303c35; }
.register-page-head .rp-month { grid-column: 2; text-align: center; font-size: 8px; color: #7a7566; }
.register-page-head .rp-month b { display: block; font-size: 9px; color: #4b493d; }
.register-page-head .rp-page { grid-column: 3; text-align: end; font-size: 8px; color: #8c8675; direction: ltr; }
.register-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: transparent; }
.register-table th {
  position: static; padding: 4px 4px 5px; background: transparent; border: 0;
  border-bottom: 1.5px solid rgba(183, 65, 50, 0.55);
  color: #3b453f; font-family: var(--urdu); font-size: 11px; font-weight: 650;
  white-space: nowrap; text-align: center;
}
.register-table td {
  height: 31px; padding: 2px 4px; border: 0;
  color: #3b423b; font-size: 10.5px; vertical-align: middle;
}
.register-table .rt-date { width: 52px; text-align: center; color: #6d7268; font-size: 9px; direction: ltr; white-space: nowrap; }
.register-table .rt-amount, .register-table .rt-total { width: 70px; text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.register-table .rt-total { font-weight: 700; color: #283c31; }
.register-table .rt-desc { min-width: 0; }
.rt-desc-main { display: block; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rt-ref { display: block; color: #94998c; font-size: 8px; direction: ltr; text-align: start; }
.rt-credit { display: inline-block; margin-top: 1px; color: var(--red); font-size: 8px; }
.rt-credit-amount { color: #a16a35; font-style: italic; }
.register-table .rt-empty td { color: transparent; }
.register-table tfoot td { height: 30px; border-top: 1.5px solid rgba(183, 65, 50, 0.5); border-bottom: 0; color: #7b4a2e; font-weight: 700; font-size: 10px; }
.register-table tfoot td:nth-child(2) { text-align: end; }
.register-balance-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-top: 8px; border-top: 1px solid #d7c7a8; background: #ffffff;
}
.register-balance-strip span { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; padding: 7px 9px; border-inline-end: 0; font-size: 9px; color: #807a69; }
.register-balance-strip i { font-style: normal; }
.register-balance-strip b { color: #37453c; font-size: 11px; direction: ltr; font-variant-numeric: tabular-nums; }
.register-balance-strip .expected b { color: #24624b; }
.register-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 0 4px; }
.register-pager span { font-size: 10px; color: #6d6a59; direction: ltr; font-variant-numeric: tabular-nums; }
.register-pager .icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: #fffdf6; }
.register-pager .icon-btn:disabled { opacity: 0.35; cursor: default; }

@media (max-width: 860px) {
  .register-spread { padding: 10px; }
  .register-pages { grid-template-columns: 1fr; gap: 8px; }
  .register-spine { display: none; }
  .register-page.register-income, .register-page.register-expense { border: 1px solid #e9e2d3; border-radius: 3px; }
  .register-spread-top { grid-template-columns: 1fr; gap: 1px; }
  .rst-title { grid-column: 1; grid-row: 1; font-size: 19px; }
  .rst-month { grid-column: 1; grid-row: 2; text-align: start; font-size: 8.5px; }
  .rst-page { display: none; }
  .register-table th { font-size: 10px; }
  .register-table td { height: 29px; font-size: 9.5px; }
  .register-table .rt-date { width: 40px; font-size: 8px; }
  .register-table .rt-amount, .register-table .rt-total { width: 58px; font-size: 9px; }
  .register-balance-strip { grid-template-columns: 1fr 1fr; }
  .register-balance-strip span:nth-child(2) { border-inline-end: 0; }
  .register-balance-strip span:nth-child(-n+2) { border-bottom: 1px dashed #d7c7a8; }
}
@media (max-width: 620px) {
  .register-spread { padding: 7px; margin-inline: -2px; }
  .register-page { padding: 7px 6px; }
  .register-page-head .rp-title { font-size: 15px; }
  .register-page-head .rp-month b { font-size: 8px; }
  .register-table th { font-size: 9px; padding: 3px 2px; }
  .register-table td { padding: 2px; }
  .register-table .rt-date { width: 34px; }
  .register-table .rt-amount, .register-table .rt-total { width: 52px; }
  .rt-desc-main { font-size: 9px; }
  .register-balance-strip span { padding: 6px; font-size: 8px; }
  .register-balance-strip b { font-size: 9.5px; }
  .view-toggle button { padding: 4px 7px; font-size: 9px; }
  .daybook-toolbar .badge, .daybook-toolbar .spacer { display: none; }
  .daybook-toolbar { gap: 5px; flex-wrap: nowrap; overflow-x: auto; }
  .daybook-toolbar .btn { flex: none; }
}

/* ---------- traditional two-page roznamcha end ---------- */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: stretch;
  padding: 22px;
  margin-bottom: 14px;
  color: #fbf4e3;
  border-radius: 15px;
  background:
    radial-gradient(600px 280px at 92% -20%, rgba(214, 179, 109, 0.28), transparent 65%),
    linear-gradient(125deg, #173c33, #0e2b23 62%, #0a211b);
  border: 1px solid rgba(214, 179, 109, 0.24);
  box-shadow: 0 16px 40px -22px rgba(23, 60, 51, 0.7);
  overflow: hidden;
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(214, 179, 109, 0.16);
  border-radius: 10px;
  pointer-events: none;
}
.home-hero-copy { position: relative; z-index: 1; min-width: 0; }
.home-kicker {
  display: flex; align-items: center; gap: 6px;
  color: var(--gold-2); font-size: 10px; font-weight: 750;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.home-kicker .icon { width: 14px; height: 14px; }
.home-hero h1 {
  font-family: var(--urdu);
  font-size: clamp(27px, 3.2vw, 40px);
  line-height: 1.55;
  color: #fdf8ea;
  margin: 7px 0 5px;
}
.home-hero p { color: #b9c9bc; font-size: 12.5px; max-width: 520px; }
.home-shop-line { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 16px; color: #aebfb2; font-size: 10.5px; }
.home-shop-line span { display: inline-flex; align-items: center; gap: 5px; }
.home-shop-line .icon { width: 13px; height: 13px; color: var(--gold-2); }
.home-voice-card {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 15px;
  border: 1px solid rgba(214, 179, 109, 0.25);
  border-radius: 12px;
  background: rgba(255, 253, 246, 0.96);
  color: var(--ink);
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.55);
}
.home-voice-title { font-size: 12px; font-weight: 750; color: var(--ink); }
.home-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 49px; padding: 7px 11px;
  border: 1px solid #d9c9a9; border-radius: 10px;
  background: #fffdf7; color: #898f83; text-align: start; cursor: pointer;
}
.home-search:hover { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 137, 63, 0.12); }
.home-search-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #f2e8d4; color: var(--ink); flex: none; }
.home-search-placeholder { flex: 1; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-search kbd { font-family: var(--sans); font-size: 8px; color: #9b9e92; background: #f1e8d6; padding: 2px 4px; border-radius: 4px; border: 1px solid #e4d6b8; }
.home-voice-actions { display: flex; align-items: center; gap: 8px; }
.home-speak {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  min-height: 33px; padding: 5px 11px; border: 0; border-radius: 20px;
  background: var(--ink); color: #fbf4e3; font-size: 10.5px; font-weight: 700; cursor: pointer;
}
.home-speak:hover { background: var(--ink-2); }
.home-speak .icon { width: 14px; height: 14px; }
.home-voice-hint { color: #8e9386; font-size: 8.5px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.dashboard-area-card {
  display: block; width: 100%; padding: 0; margin-bottom: 14px;
  text-align: start; cursor: pointer; overflow: hidden;
  background: linear-gradient(120deg, #fdf8ec, #f4e8d0);
  border: 1px solid #dfcfac; border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.15s;
}
.dashboard-area-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.dac-head { display: flex; align-items: center; gap: 11px; padding: 14px 15px 10px; }
.dac-head .area-icon { background: var(--ink); color: var(--gold-2); }
.dac-copy { flex: 1; min-width: 0; }
.dac-copy strong { display: block; color: var(--ink); font-family: var(--urdu); font-size: 21px; line-height: 1.55; }
.dac-open { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--gold); font-size: 9.5px; font-weight: 650; }
.dac-open .icon { width: 12px; height: 12px; }
.dac-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px dashed #d9c9a9; background: rgba(255, 253, 246, 0.52);
}
.dac-stats > div { padding: 9px 13px; border-inline-end: 1px dashed #dccdad; min-width: 0; }
.dac-stats > div:last-child { border-inline-end: 0; }
.dac-stats span { display: block; color: #8b8e80; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dac-stats strong { display: block; color: var(--ink); font-size: 15px; font-weight: 800; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.home-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 2px 9px; }
.home-section-head h2 { font-family: var(--urdu); font-size: 21px; color: var(--ink); line-height: 1.5; }
.home-section-head span { color: #969a8d; font-size: 9.5px; }
.home-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.area-card {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 12px; text-align: start; cursor: pointer;
  background: rgba(255, 253, 246, 0.78); border: 1px solid var(--line);
  border-radius: 11px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
}
.area-card:hover { transform: translateY(-1px); border-color: #d8c5a2; box-shadow: var(--shadow-sm); }
.area-icon {
  display: grid; place-items: center; flex: none;
  width: 37px; height: 37px; border-radius: 10px;
  background: #efe4cd; color: var(--ink);
}
.area-icon .icon { width: 18px; height: 18px; }
.area-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.area-kicker { color: #8f9486; font-size: 8.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-copy strong { color: var(--ink); font-size: 12.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-stat { color: #8b9083; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-stat b { color: var(--ink); font-weight: 800; direction: ltr; unicode-bidi: isolate; }
.area-arrow { color: #b1a88f; flex: none; }
.area-arrow .icon { width: 15px; height: 15px; }
.area-card.tone-green .area-icon { background: #e4efe8; color: #2f6f52; }
.area-card.tone-red .area-icon { background: #f7e6e1; color: var(--red); }
.area-card.tone-gold .area-icon { background: #f5ebd4; color: #98712c; }
.area-card.tone-blue .area-icon { background: #e6eef5; color: #376d8e; }
.home-bottom-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.home-language-card, .home-quick-card {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  text-align: start; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 253, 246, 0.6); cursor: pointer;
}
.home-language-card:hover, .home-quick-card:hover { background: #fffdf6; box-shadow: var(--shadow-sm); }
.home-language-card > span:nth-child(2), .home-quick-card > span:nth-child(2) { flex: 1; min-width: 0; }
.home-language-card strong, .home-quick-card strong { display: block; color: var(--ink); font-size: 11px; }
.home-language-card small, .home-quick-card small { display: block; color: #8e9385; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: rgba(255, 253, 246, 0.7);
  color: var(--ink); font-size: 10px; font-weight: 650; cursor: pointer;
}
.lang-btn:hover { background: #fffdf6; border-color: var(--gold); }
.lang-btn .icon { width: 14px; height: 14px; color: var(--gold); }
.language-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.language-option {
  position: relative; display: grid; grid-template-columns: 37px 1fr; gap: 2px 9px;
  align-items: center; padding: 10px 11px; text-align: start;
  border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; cursor: pointer;
}
.language-option:hover { border-color: var(--gold); background: #fffaf0; }
.language-option.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; background: #fbf3e1; }
.language-code {
  grid-row: 1 / 3; display: grid; place-items: center; width: 35px; height: 35px;
  border-radius: 9px; background: #efe4cc; color: var(--ink); font-size: 9px; font-weight: 800;
}
.language-name { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.language-en { font-size: 9px; color: #929789; }
.language-dir { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); font-size: 8px; color: #b0aa9a; }
.language-check { position: absolute; inset-inline-end: 8px; top: 7px; color: var(--green); }
.language-check .icon { width: 14px; height: 14px; }

[dir="ltr"] .leaf { transform-origin: left center; border-radius: 14px 4px 4px 14px; }
[dir="ltr"] .leaf::before {
  inset-inline-start: auto; inset-inline-end: 0;
  background: linear-gradient(270deg, rgba(78, 58, 28, 0.12), transparent);
  border-inline-end: 0; border-inline-start: 1px solid rgba(110, 86, 46, 0.12);
}
[dir="ltr"] .sidebar { border-inline-end: 1px solid rgba(255, 255, 255, 0.06); }
[data-language="hi"] body, [data-language="bn"] body, [data-language="si"] body, [data-language="ar"] body {
  font-family: "Nirmala UI", "Segoe UI", "Noto Sans", Tahoma, Arial, sans-serif;
}
[data-language="ar"] h1, [data-language="ar"] h2, [data-language="ar"] h3, [data-language="ar"] .urdu-display {
  font-family: "Segoe UI", "Traditional Arabic", "Noto Naskh Arabic", Tahoma, sans-serif;
}
[data-language="en"] h1, [data-language="en"] h2, [data-language="en"] h3 {
  font-family: "Segoe UI", "Nirmala UI", Tahoma, sans-serif;
  letter-spacing: -0.01em;
}
[data-language="hi"] h1, [data-language="hi"] h2, [data-language="hi"] h3 {
  font-family: "Nirmala UI", "Mangal", "Segoe UI", sans-serif;
  line-height: 1.55;
}
[data-language="bn"] h1, [data-language="bn"] h2, [data-language="bn"] h3 {
  font-family: "Nirmala UI", "Vrinda", "Segoe UI", sans-serif;
  line-height: 1.6;
}
[data-language="si"] h1, [data-language="si"] h2, [data-language="si"] h3 {
  font-family: "Nirmala UI", "Iskoola Pota", "Segoe UI", sans-serif;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .home-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-voice-card { max-width: 560px; }
  .dac-stats { grid-template-columns: 1fr 1fr; }
  .dac-stats > div:nth-child(2) { border-inline-end: 0; }
  .dac-stats > div:nth-child(-n+2) { border-bottom: 1px dashed #dccdad; }
}
@media (max-width: 860px) {
  .lang-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .lang-btn span { display: none; }
  .home-hero { padding: 16px; }
  .home-hero h1 { font-size: 25px; }
  .home-card-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .area-card { padding: 10px 9px; gap: 8px; }
  .area-icon { width: 33px; height: 33px; }
  .area-copy strong { font-size: 11px; }
  .dashboard-area-card .dac-copy strong { font-size: 19px; }
  .language-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .topbar { gap: 5px; }
  .topbar-title { flex: 1 1 auto; min-width: 78px; }
  .topbar-title strong { font-size: 18px; max-width: 100%; line-height: 2; padding-block: 4px; overflow: visible; text-overflow: clip; }
  .topbar-actions { flex: none; gap: 1px; }
  #topbar-mic { display: none !important; }
  .topbar-actions .icon-btn { width: 34px; height: 34px; }
  .user-menu-btn .avatar { width: 31px; height: 31px; }
  .home-search kbd { display: none; }
  .home-hero { padding: 14px 12px; gap: 12px; border-radius: 12px; }
  .home-hero h1 { font-size: 23px; line-height: 1.5; }
  .home-hero p { font-size: 11px; }
  .home-shop-line { gap: 5px 10px; margin-top: 10px; font-size: 9px; }
  .home-voice-card { padding: 10px; gap: 6px; }
  .home-voice-title { font-size: 10.5px; }
  .home-search { min-height: 44px; }
  .home-search-placeholder { font-size: 9.5px; }
  .home-voice-actions { gap: 6px; }
  .home-speak { min-height: 30px; padding: 4px 9px; font-size: 9.5px; }
  .home-voice-hint { font-size: 8px; }
  .home-card-grid { grid-template-columns: 1fr; }
  .area-card { padding: 12px 11px; gap: 10px; }
  .area-copy strong { font-size: 12.5px; }
  .area-kicker { font-size: 8.5px; }
  .area-icon { width: 38px; height: 38px; }
  .dashboard-area-card { border-radius: 12px; }
  .dac-head { padding: 12px 11px 9px; gap: 9px; }
  .dac-copy strong { font-size: 18px; }
  .dac-stats > div { padding: 8px 10px; }
  .dac-stats span { font-size: 8px; }
  .dac-stats strong { font-size: 13px; }
  .home-section-head h2 { font-size: 18px; }
  .home-bottom-strip { grid-template-columns: 1fr; }
  .language-grid { grid-template-columns: 1fr; }
}

.entry-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 16px; }
.entry-type {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; text-align: start;
  border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 253, 246, 0.65);
  cursor: pointer; min-width: 0;
}
.entry-type:hover { border-color: var(--line-2); background: #fffdf6; }
.entry-type.active { border-color: var(--ink); background: #fffdf6; box-shadow: 0 0 0 1px var(--ink) inset; }
.entry-type .et-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: #efe4cc; color: var(--ink); }
.entry-type .et-icon.green { background: #e3efe8; color: var(--green); }
.entry-type .et-icon.red { background: #f7e5e1; color: var(--red); }
.entry-type .et-icon.gold { background: #f5ebd5; color: var(--gold); }
.entry-type .et-icon .icon { width: 16px; height: 16px; }
.entry-type strong { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-type small { display: block; font-size: 9px; color: var(--muted); }
.entry-main-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.8fr); gap: 18px; align-items: start; }
.entry-primary { display: grid; gap: 9px; }
.entry-side { display: grid; gap: 10px; }
.entry-box { padding: 11px 12px; border: 1px dashed var(--line-2); border-radius: 9px; background: rgba(246, 238, 220, 0.38); }
.entry-note { display: flex; gap: 8px; padding: 10px 11px; border-radius: 9px; background: #f3ead6; color: #6b5c3b; font-size: 10.5px; line-height: 1.7; }
.entry-note-icon .icon { width: 15px; height: 15px; color: var(--gold); }
.entry-preview { border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; background: #fffdf7; min-height: 58px; display: grid; gap: 5px; }
.entry-preview:empty { display: none; }
.preview-line { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.preview-line strong { font-size: 15px; color: var(--ink); }
.preview-effect { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--green); }
.preview-effect .icon { width: 13px; height: 13px; }
.amount-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: -2px; }
.amount-chips button {
  border: 1px solid var(--line); background: var(--paper-2); color: #6e7568;
  border-radius: 20px; padding: 2px 9px; font-size: 10px; cursor: pointer;
}
.amount-chips button:hover { background: #fffdf6; color: var(--ink); }
.input-action.listening, .mic-btn.listening { background: #fbe9e5 !important; color: var(--red) !important; animation: pulse 1.2s infinite; }
.modal-foot-hint { display: inline-flex; align-items: center; gap: 5px; color: #8b9185; font-size: 9.5px; }
.modal-foot-hint .icon { width: 12px; height: 12px; }
.close-summary { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fffdf7; }
.close-summary > div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 11px; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.close-summary > div:last-child { border: 0; }
.close-summary > div.total { background: var(--paper-2); font-size: 14px; font-weight: 750; }
.close-summary > div.total strong { color: var(--ink); }
.close-diff { margin-top: 9px; padding: 7px 10px; border-radius: 7px; background: var(--paper-2); color: #797c70; font-size: 11px; text-align: center; }
.close-diff.ok { background: #e4f1e9; color: #2c6a4b; }
.close-diff.short { background: #fbe9e5; color: #9a3326; }
.close-diff.excess { background: #f6ecd4; color: #8a6423; }
.invoice-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.invoice-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-top: 12px; }
.invoice-totals > div { padding: 8px 10px; background: #fffdf7; }
.invoice-totals span { display: block; font-size: 9px; color: var(--muted); }
.invoice-totals strong { display: block; font-size: 14px; color: var(--ink); direction: ltr; text-align: right; }
.invoice-totals strong.red { color: var(--red); }
.user-card { display: flex; align-items: center; gap: 12px; }
.user-card strong { display: block; font-size: 14px; }
.user-card span { display: block; font-size: 11px; color: var(--muted); }
.user-card small { display: block; font-size: 10px; color: var(--muted-2); direction: ltr; text-align: right; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.more-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf7; color: var(--text); font-size: 11.5px; }
.more-item:hover { background: var(--paper-2); text-decoration: none; }
.more-item .icon { width: 16px; height: 16px; color: var(--gold); }
.topbar-dot { position: absolute; top: 7px; inset-inline-end: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); border: 1px solid var(--paper); }
.date-nav { display: inline-flex; align-items: center; gap: 4px; }
.date-nav .input { width: 132px; min-height: 37px; padding: 5px 7px; font-size: 10.5px; direction: ltr; }
.date-nav .icon-btn { width: 34px; height: 34px; }
.ledger-table tbody.page-flip-out { animation: rowsOut 0.16s ease-in forwards; }
.ledger-table tbody.page-flip-in { animation: rowsIn 0.28s ease-out; }
@keyframes rowsOut { to { opacity: 0; transform: translateX(-9px); } }
@keyframes rowsIn { from { opacity: 0; transform: translateX(9px); } }
.total-row td { background: #f3e8d2 !important; border-top: 2px solid var(--line-2); border-bottom: 0 !important; font-weight: 650; }
.table-wrap .total-row td { position: sticky; bottom: 0; }

@media (max-width: 960px) {
  .entry-main-grid { grid-template-columns: 1fr; }
  .entry-type-grid { grid-template-columns: repeat(2, 1fr); }
  .invoice-totals { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .entry-type { padding: 7px 8px; }
  .entry-type strong { font-size: 10.5px; }
  .entry-type .et-icon { width: 26px; height: 26px; }
  .entry-type-grid { gap: 5px; }
  .more-grid { grid-template-columns: 1fr; }
  .date-nav .input { width: 122px; }
  .date-nav { flex-wrap: wrap; }
  .invoice-totals { grid-template-columns: 1fr 1fr; }
  .daybook-desktop-wrap { display: none; }
  .daybook-mobile-wrap { display: block; }
  .daybook-mobile-table { table-layout: fixed; width: 100%; }
  .daybook-mobile-table th, .daybook-mobile-table td { padding: 6px 4px; font-size: 10px; }
  .daybook-mobile-table td.desc { min-width: 0 !important; }
  .daybook-mobile-table td.desc strong { font-size: 10px; line-height: 1.5; }
  .daybook-mobile-table td.desc small { font-size: 8.5px; line-height: 1.7; }
  .daybook-mobile-table td.num { font-size: 10px; white-space: nowrap; }
  .daybook-mobile-table tfoot td { padding: 6px 4px; font-size: 9.5px; }
  .mobile-credit { display: inline !important; color: var(--red); font-weight: 650; }
}
