/* ==========================================================================
   TEST/css/app.css — FINAL RECONSTRUCTED + COMPOSITION RECOVERED
   View-specific composition + protected systems + floating glass nav.
   Visual Grammar (VG) owns shared component geometry: the three vg-*.css
   files are linked after this one in index.html, so on shared selectors
   their rules win the cascade tie-break over this file's, by design.
   This file owns page composition, containers, spacing, grouping, and view-specific layout.
   ========================================================================== */

/* --------------------------------------------------------------------------
   00. LOCAL FONT
   The bundled variable Vazirmatn font is explicitly registered so the app
   does not depend on Vazirmatn being installed on the device.
   -------------------------------------------------------------------------- */
@font-face{
  font-family:'Vazirmatn';
  src:url('../fonts/Vazirmatn[wght].woff2') format('woff2');
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
}

/* --------------------------------------------------------------------------
   01. TOKENS / LEGACY ALIASES
   Only aliases required by protected systems (not owned by VG).
   -------------------------------------------------------------------------- */
:root{
  --olive-dark:#0070D2;
  --gold:#FF5C35;
  --ink:#1F2937;
  --ink-soft:#667085;
  --card:#FFFFFF;
  --line:rgba(31,41,55,.08);
  --accent-dark:#D94725;
  --accent-soft:#FFF0EC;
}

/* --------------------------------------------------------------------------
   02. RESET / FOUNDATION
   Base environment not covered by VG.
   -------------------------------------------------------------------------- */
*,
*::before,
*::after{
  box-sizing:border-box;
  -webkit-tap-highlight-color:transparent;
}
html{
  -webkit-text-size-adjust:100%;
  background:var(--vg-color-bg);
}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text','SF Pro Display','Helvetica Neue',Arial,sans-serif;
  background:var(--vg-color-bg);
  color:var(--vg-color-text);
  min-height:100vh;
  font-size:16px;
  line-height:1.55;
  font-variant-numeric:tabular-nums;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  max-width:100vw;
  overscroll-behavior-y:contain;
  touch-action:manipulation;
  -webkit-overflow-scrolling:touch;
}
img{
  max-width:100%;
  height:auto;
}
a{
  color:inherit;
  text-decoration:none;
}

/* --------------------------------------------------------------------------
   03. TYPOGRAPHY (View-specific hierarchy)
   -------------------------------------------------------------------------- */
h2.section-title{
  margin:4px 0 14px;
  font-size:1.05rem;
  font-weight:600;
  color:var(--vg-color-text);
  display:flex;
  align-items:center;
  gap:8px;
  letter-spacing:-.2px;
}
h2.section-title::after{
  content:"";
  flex:1;
  border-bottom:1px solid rgba(31,41,55,.08);
}
h3.sub-title{
  font-size:.88rem;
  margin:16px 0 10px;
  color:var(--vg-color-text);
  font-weight:600;
}

/* Shared card typography hierarchy (used across list/detail/report cards) */
.label{
  font-size:.68rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  line-height:1.35;
  margin:0 0 5px;
}
.value{
  font-size:1.02rem;
  font-weight:700;
  color:var(--vg-color-text);
  line-height:1.35;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.2px;
}
.value + .sub,
.label + .value{
  margin-top:0;
}

/* --------------------------------------------------------------------------
   04. GLOBAL LAYOUT (Header / Main / Navigation)
   -------------------------------------------------------------------------- */
/* [chrome] header / app-back / header-date moved to css/00-chrome.css */

/* Bottom-nav geometry (.bottom-nav / .bottom-nav-item / .bn-indicator) is
   owned entirely by css/visual-grammar-components.css — see that file's
   "Floating Glass Bottom Navigation" + "iOS-native Bottom Navigation
   Indicator" sections. Do not add bottom-nav rules here: this file loads
   before the VG files, so anything defined here for these selectors is
   dead weight that only wins for properties VG doesn't set. */

/* Main page frame (base mobile composition) */
main{
  position:relative;
  z-index:1;
  max-width:720px;
  margin:0 auto;
  padding:14px 14px calc(88px + env(safe-area-inset-bottom,0px));
}

/* Shared page composition (recovered from old app.css) */
main > *:first-child{
  margin-top:0;
}
main .section-title{
  position:relative;
  margin-bottom:14px;
}
main .tx-hint,
main > p.tx-hint{
  margin-top:-6px;
  margin-bottom:16px;
}
main > .field{
  margin-bottom:12px;
}
main > .chip-row{
  margin-bottom:12px;
}
main > .tx-toolbar{
  margin:0 0 14px;
}
main > .btn-row{
  margin-bottom:12px;
}
main .empty{
  margin:14px 0;
}

/* Cards grid (composition) */
.cards{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}
.card.wide{
  grid-column:1/-1;
}

/* Toolbars / action groups (composition, not geometry) */
.btn-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.tx-toolbar{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  margin:12px 0 14px;
  min-height:44px;
}
.tx-toolbar-select{
  width:auto;
  min-width:112px;
  max-width:150px;
  min-height:44px;
  margin:0;
  flex:0 0 auto;
}
.tx-toolbar-label{
  flex:0 0 auto;
  font-size:.72rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
  line-height:1.2;
}

/* More menu (composition + visibility) */
.more-overlay{
  position:fixed;
  inset:0;
  background:rgba(11,31,58,.45);
  z-index:45;
  opacity:0;
  transition:opacity .2s;
}
.more-overlay.show{
  opacity:1;
}
.more-sheet{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:46;
  background:var(--vg-color-surface);
  border-radius:20px 20px 0 0;
  padding:10px 16px calc(16px + env(safe-area-inset-bottom,0px));
  max-height:78vh;
  overflow-y:auto;
  transform:translateY(110%);
  transition:transform .28s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow:0 -10px 34px rgba(31,41,55,.12);
  -webkit-overflow-scrolling:touch;
}
.more-sheet.show{
  transform:translateY(0);
}
.more-sheet-handle{
  width:40px;
  height:4px;
  border-radius:999px;
  background:rgba(31,41,55,.08);
  margin:4px auto 12px;
}
.more-sheet-title{
  font-size:1rem;
  font-weight:600;
  color:var(--vg-color-text);
  margin:0 0 12px;
  text-align:center;
}
.more-sheet-list{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:12px;
}
.more-sheet-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:12px;
  text-decoration:none;
  color:var(--vg-color-text);
  font-weight:600;
  font-size:.92rem;
  background:var(--vg-color-surface);
  border:1px solid rgba(31,41,55,.08);
}
.more-sheet-item.active{
  background:var(--vg-color-primary-soft);
  border-color:#0070D2;
  color:var(--vg-color-primary);
}
/* Leading icon tile — iOS Settings-style list row: a small tinted squircle
   holding the icon, label filling the remaining width, trailing chevron
   for disclosure affordance. Icons come from AppIcons (js/icons.js). */
.more-sheet-item-ico{
  flex:none;
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:rgba(0,112,210,.10);
  color:var(--vg-color-icon);
}
.more-sheet-item.active .more-sheet-item-ico{
  background:rgba(0,112,210,.16);
}
.more-sheet-item-ico svg{
  width:18px;
  height:18px;
}
.more-sheet-item-label{
  flex:1 1 auto;
  min-width:0;
}
.more-sheet-item-chevron{
  flex:none;
  color:#B4BCC7;
}
.more-sheet-item.active .more-sheet-item-chevron{
  color:var(--vg-color-primary);
}
.more-sheet-close{
  width:100%;
  margin-top:4px;
}

/* Keyboard / modal behaviour */
body.keyboard-open .bottom-nav,
body.keyboard-open .fab{
  opacity:0;
  pointer-events:none;
}
body.modal-open .bottom-nav,
body.modal-open .fab{
  opacity:0;
  pointer-events:none;
}

/* Shared modal infrastructure: lock page scroll while sheet is open.
   openSheet() is expected to toggle body.modal-open (ui.js). */
body.modal-open{
  overflow:hidden;
  overscroll-behavior:none;
}

/* Pull-to-refresh indicator (Phase 10). JS drives `transform` directly while
   dragging/spinning, so the resting position is expressed via `left`, not
   `transform: translateX(-50%)`, which would otherwise be clobbered the
   moment the drag handler sets an inline transform. */
#ptr-indicator{
  position:fixed;
  top:calc(env(safe-area-inset-top,0px) + 6px);
  left:calc(50% - 17px);
  width:34px;
  height:34px;
  border-radius:50%;
  background:rgba(255,255,255,.88);
  backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  box-shadow:0 4px 14px rgba(31,41,55,.16);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  transform:translateY(-40px);
  z-index:35;
  pointer-events:none;
  transition:opacity 160ms ease;
}
#ptr-indicator.show{
  opacity:1;
}
#ptr-indicator:not(.show){
  transform:translateY(-40px);
}
html[data-theme="dark"] #ptr-indicator{
  background:rgba(24,26,31,.92);
  box-shadow:0 4px 14px rgba(0,0,0,.4);
}
html[data-theme="dark"] .ptr-spinner{
  border-color:rgba(74,163,255,.28);
  border-top-color:var(--vg-color-primary);
}
.ptr-spinner{
  width:16px;
  height:16px;
  border-radius:50%;
  border:2px solid rgba(0,112,210,.22);
  border-top-color:#0070D2;
}
#ptr-indicator.ptr-spinning .ptr-spinner{
  animation:ptr-spin .7s linear infinite;
}
@keyframes ptr-spin{
  to{ transform:rotate(360deg); }
}
@media (prefers-reduced-motion: reduce){
  #ptr-indicator.ptr-spinning .ptr-spinner{
    animation:none;
  }
}

/* Shared sheet composition (not Invoice V6 full-screen host) */
.overlay{
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.overlay .sheet:not(.inv-sheet-host),
.sheet:not(.inv-sheet-host){
  max-height:min(88vh, calc(100dvh - env(safe-area-inset-top,0px) - 12px));
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  width:100%;
  max-width:720px;
  padding:14px 16px calc(18px + env(safe-area-inset-bottom,0px));
  box-sizing:border-box;
}

/* Restrained touch feedback (targeted transitions only) */
.chip,
.chip-opt{
  transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .12s ease;
}
.chip:active,
.chip-opt:active{
  transform:scale(.97);
}

/* --------------------------------------------------------------------------
   05. TRANSACTION / LEDGER (Composition)
   -------------------------------------------------------------------------- */
.tx-list{
  margin-top:0;
}
.ledger-row,
.tx-row,
.customer-list-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 2px;
  min-height:52px;
  cursor:pointer;
}
.ledger-row .filler,
.tx-row .filler{
  flex:1;
  min-width:6px;
  height:0;
}
/* Disclosure chevron (Phase 8 / iOS list rows): every ledger-row that is a
   real <a> — i.e. genuinely navigates to a detail screen (customer,
   supplier, invoice, prospect...) — gets a trailing chevron, the same
   affordance iOS Settings/Mail/Messages use to say "this row goes
   somewhere". Rows built as <div> (ledger/history entries that do not
   navigate) are correctly left without one — this only targets real links,
   not row shape, so it can't mislabel a non-navigating row as navigable.
   Reuses the same chevron glyph as .more-sheet-item-chevron for one
   consistent disclosure indicator across the whole app. */
a.ledger-row:not(.action-row)::after{
  content:'';
  flex:none;
  width:14px;
  height:14px;
  margin-inline-start:2px;
  opacity:.38;
  background-color:currentColor;
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  -webkit-mask-size:contain;
  mask-size:contain;
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
  -webkit-mask-position:center;
  mask-position:center;
  align-self:center;
}
.ledger-row:last-child,
.tx-row:last-child{
  border-bottom-color:transparent;
}
.ledger-row .name,
.tx-row .name,
.customer-list-row .name{
  font-weight:600;
  font-size:1rem;
  color:var(--vg-color-text);
  min-width:0;
  line-height:1.35;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
}
.tx-row-title{
  font-weight:600;
  font-size:1rem;
  color:var(--vg-color-text);
  line-height:1.35;
}
.ledger-row .name > .tx-row-title,
.tx-row .name > .tx-row-title{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  display:block;
  max-width:100%;
}
/* Generic metadata hierarchy used across lists (not always under .ledger-row .name) */
.sub{
  font-size:.72rem;
  color:var(--vg-color-text-muted);
  display:block;
  font-weight:400;
  margin-top:0;
  line-height:1.45;
}
.ledger-row .sub,
.tx-row-meta,
.tx-row .sub,
.customer-list-row .sub{
  font-size:.72rem;
  color:var(--vg-color-text-muted);
  display:block;
  font-weight:400;
  margin-top:0;
  line-height:1.45;
}
.ledger-row .name,
.tx-row .name{
  gap:4px;
}
.ledger-row .amount,
.tx-row-total,
.tx-row-amount,
.customer-row-balance-value{
  font-weight:700;
  font-size:.9rem;
  color:var(--vg-color-text);
  white-space:nowrap;
  text-align:left;
  flex-shrink:0;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.2px;
  line-height:1.35;
}
.invoice-row-summary,
.product-row-summary{
  gap:4px;
}
.invoice-row-label,
.product-row-label{
  margin-bottom:1px;
}
a.ledger-row:active,
a.tx-row:active{
  background:rgba(31,41,55,.04);
  border-radius:10px;
}

/* Customer row composition — 2-group / 2-line shared vertical rhythm */
.customer-list-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-width:0;
}
.customer-row-main{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  line-height:1.3;
}
.customer-row-title-line{
  display:block;
  min-width:0;
  min-height:1.35em;
}
.customer-row-name,
.customer-row-name.tx-row-title{
  display:block;
  min-width:0;
  font-weight:600;
  font-size:1rem;
  color:var(--vg-color-text);
  line-height:1.35;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.customer-row-meta-line{
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  justify-content:flex-start;
  gap:6px;
  min-width:0;
  max-width:100%;
  min-height:1.35em;
}
.customer-row-status{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1.2;
  min-height:22px;
  font-size:.7rem;
  font-weight:600;
  border-radius:999px;
  padding:2px 7px;
  white-space:nowrap;
  max-width:5.5rem;
  overflow:hidden;
  text-overflow:ellipsis;
}
.customer-row-meta,
.customer-list-row .customer-row-meta{
  flex:0 1 auto;
  min-width:0;
  font-size:.72rem;
  color:var(--vg-color-text-muted);
  font-weight:400;
  line-height:1.35;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.customer-row-watch{
  flex:0 0 auto;
  width:16px;
  height:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#F5A131;
}
.customer-row-watch svg{
  width:16px;
  height:16px;
  stroke:currentColor;
  fill:none;
}
.customer-row-balance{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-end;
  gap:4px; /* same as identity: shared vertical rhythm */
  line-height:1.3;
  white-space:nowrap;
}
.customer-row-balance-label{
  font-size:.66rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
  white-space:nowrap;
  line-height:1.35;
  min-height:1.35em;
}
.customer-row-balance-value{
  font-size:.86rem;
  font-weight:var(--vg-weight-value);
  white-space:nowrap;
  line-height:1.35;
  min-height:1.35em;
}

/* Invoice / product row composition (for lists) */
.invoice-row-summary{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:5px;
  min-width:118px;
}
.invoice-row-total,
.invoice-row-remain,
.invoice-row-paid{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  line-height:1.15;
}
.invoice-row-total .tx-row-total{
  font-size:.92rem;
  font-weight:var(--vg-weight-value);
  color:var(--vg-color-text);
}
.invoice-row-remain .tx-row-meta,
.invoice-row-paid .tx-row-meta{
  font-size:.78rem;
  font-weight:var(--vg-weight-label);
}
.invoice-row-main .tx-row-title{
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
}
.product-row-summary{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  min-width:112px;
  white-space:normal;
}
.product-row-value,
.product-row-qty{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  line-height:1.2;
}
.product-row-label,
.invoice-row-label{
  font-size:var(--vg-type-meta);
  font-weight:var(--vg-weight-label);
  color:var(--vg-color-text-muted);
  white-space:nowrap;
}
.product-row-qty-value{
  font-size:.76rem;
  font-weight:700;
  white-space:nowrap;
}

/* tx-specific styles (not owned by VG) */
.tx-hint{
  font-size:.78rem;
  color:var(--vg-color-text-muted);
  margin:4px 0 12px;
}
.tx-inline-link{
  color:var(--vg-color-primary);
  text-decoration:underline;
}
.tx-identity-title{
  font-size:1.15rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.tx-identity{
  margin-bottom:12px;
}
.tx-identity-meta{
  font-size:.85rem;
  color:var(--vg-color-text-muted);
  margin-top:4px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.tx-dot{
  margin:0 2px;
  color:var(--vg-color-text-muted);
}
.tx-details{
  margin-top:10px;
  background:#F9FAFB;
  border-radius:12px;
  padding:8px 12px;
}
.tx-details summary{
  cursor:pointer;
  font-weight:500;
  color:var(--vg-color-text);
  padding:8px 0;
}
.tx-row-amount{
  text-align:left;
}

/* --------------------------------------------------------------------------
   06. ACTION GROUPS / CUSTOMER DETAIL
   -------------------------------------------------------------------------- */
.cust-actions-primary,
.cust-actions-secondary{
  gap:8px;
  margin-bottom:8px;
}
.cust-actions-secondary .btn{
  min-height:44px;
  background:rgba(31,41,55,.04);
  color:var(--vg-color-text-secondary);
  border-color:rgba(31,41,55,.06);
  box-shadow:none;
}
.cust-actions-secondary .btn:active{
  transform:translateY(1px);
  background:#E8EBEF;
}
.cust-summary{
  background:var(--vg-color-surface);
  border:1px solid rgba(31,41,55,.08);
  border-inline-start:3px solid transparent;
  border-radius:16px;
  padding:12px 14px;
  margin-bottom:14px;
  box-shadow:0 3px 10px rgba(26,38,52,.04);
}
.cust-summary-story{
  font-size:.92rem;
  line-height:1.75;
  color:var(--vg-color-text);
}
.cust-summary-action{
  font-size:.88rem;
  line-height:1.75;
  color:var(--vg-color-text);
  margin-top:6px;
  padding-top:6px;
  border-top:1px dotted rgba(31,41,55,.1);
}
.cust-recommended-action{
  margin:0 0 14px;
  padding:12px;
  border:1px solid rgba(31,41,55,.08);
  border-radius:16px;
  background:var(--vg-color-surface);
}
.cust-recommended-action-label{
  font-size:.72rem;
  color:var(--vg-color-text-muted);
  font-weight:500;
  margin-bottom:7px;
}
.cust-recommended-action-btn{
  width:100%;
  min-height:48px;
  line-height:1.5;
}
.customer-behavior-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:6px 0;
  cursor:pointer;
  font-weight:600;
  color:var(--vg-color-primary);
  list-style:none;
}
.customer-behavior-summary::after{
  content:'';
  width:16px;
  height:16px;
  flex:none;
  background-color:currentColor;
  color:var(--vg-color-text-muted);
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  -webkit-mask-size:contain;
  mask-size:contain;
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
  -webkit-mask-position:center;
  mask-position:center;
  transition:transform .15s ease;
}
details[open] > .customer-behavior-summary::after{
  transform:rotate(180deg);
}
/* --------------------------------------------------------------------------
   07. DASHBOARD (Consolidated - no duplicate geometry)
   -------------------------------------------------------------------------- */
.dashboard-shell{
  display:flex;
  flex-direction:column;
  gap:0;
}
.dashboard-eyebrow{
  font-size:.7rem;
  color:#6F767C;
  font-weight:600;
  margin:2px 0 14px;
}
.dashboard-block{
  margin-bottom:20px;
}
.dashboard-block-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}
.dash-section-label{
  font-size:.82rem;
  font-weight:600;
  color:var(--vg-color-text);
  display:flex;
  align-items:center;
  gap:7px;
}
.dash-section-label::after{
  display:none;
}
.dash-section-ico{
  width:24px;
  height:24px;
  flex:0 0 24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--vg-color-icon);
  border-radius:0;
  background:transparent;
}
.dash-section-ico svg{
  max-width:21px;
  max-height:21px;
}
.dash-risk-badge{
  display:inline-flex;
  align-items:center;
  padding:2px 7px;
  border-radius:999px;
  font-size:.62rem;
  font-weight:600;
  color:#D52B36;
  background:var(--vg-color-danger-soft);
  border:1px solid #FFF0EC;
}
/* Financial health — three substantial KPI cards.
   Typography hierarchy preserved; values fit via fluid sizing (no ellipsis, no card shrink). */
.dash-health{
  margin-bottom:20px;
}
.dash-health-surface{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  background:transparent;
  border:none;
  box-shadow:none;
  overflow:visible;
}
.dash-health-row{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:6px;
  padding:14px 12px;
  min-height:76px;
  background:var(--vg-color-surface);
  border:1px solid rgba(31,41,55,.08);
  border-radius:14px;
  box-shadow:var(--vg-shadow-group);
  text-decoration:none;
  color:inherit;
  min-width:0;
  overflow:visible;
}
.dash-health-label{
  font-size:.64rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  line-height:1.3;
  letter-spacing:.01em;
}
.dash-health-value{
  /* Primary value: readable floor, fluid scale for long Toman amounts */
  font-size:clamp(.82rem, 3.4vw, 1.02rem);
  font-weight:600;
  color:var(--vg-color-text);
  font-variant-numeric:tabular-nums;
  letter-spacing:-.3px;
  line-height:1.25;
  white-space:nowrap;
  overflow:visible;
  max-width:100%;
  width:100%;
}
.dash-health-value.debt{
  color:#D52B36;
}
.dash-health-link:active{
  transform:scale(.98);
  background:#F8FAFC;
}
@media(max-width:360px){
  .dash-health-surface{gap:6px;}
  .dash-health-row{padding:13px 10px;min-height:72px;}
  .dash-health-value{font-size:clamp(.78rem, 3.6vw, .94rem);}
}
/* Monthly target block */
.dash-target-block{
  position:relative;
  margin:0 0 14px;
}
.dash-target-fab-row{
  position:absolute;
  left:4px;
  top:-30px;
  height:0;
  width:auto;
  display:flex;
  justify-content:flex-start;
  align-items:center;
  z-index:5;
  pointer-events:none;
}
.dash-target-fab{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  padding:0;
  border:none;
  background:transparent;
  cursor:pointer;
  pointer-events:auto;
}
.dash-target-fab svg{
  width:26px;
  height:26px;
  display:block;
  color:var(--vg-color-text);
}
.dash-monthly-target{
  display:block;
  position:relative;
  overflow:hidden;
  text-decoration:none;
  color:var(--vg-color-icon);
  background:var(--vg-color-surface);
  border-radius:16px;
  padding:11px 14px 12px;
  margin:0;
  box-shadow:0 1px 2px rgba(0,0,0,.04),0 6px 18px rgba(0,0,0,.06);
  border:.5px solid rgba(60,60,67,.12);
}
.dash-monthly-target.is-done{
  border-color:rgba(0,160,104,.22);
}
.dmt-top{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  margin-bottom:8px;
}
.dmt-heading{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.dmt-title{
  font-size:.92rem;
  font-weight:700;
  color:var(--vg-color-primary);
  letter-spacing:-.2px;
}
.dmt-growth{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  color:#FF5C35;
}
.dmt-growth svg{
  width:100%;
  height:100%;
}
.dmt-figures{
  margin:0 0 9px;
  font-size:.71rem;
  font-weight:500;
  color:#8E8E93;
}
.dmt-figures-num{
  color:#3A3A3C;
  font-weight:600;
}
.dmt-figures-unit{
  margin-inline-start:3px;
}
.dmt-row{
  display:flex;
  align-items:center;
  gap:12px;
}
.dmt-progress{
  flex:1;
  min-width:0;
}
.dmt-bar{
  height:10px;
  border-radius:999px;
  background:rgba(60,60,67,.12);
  overflow:hidden;
}
.dmt-bar>span{
  display:block;
  height:100%;
  border-radius:999px;
  background:#FF5C35;
}
.dmt-pct{
  font-size:1.12rem;
  font-weight:800;
  color:#FF5C35;
  line-height:1;
  flex:none;
  min-width:2.5em;
  text-align:left;
}
.dmt-status-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  margin-top:9px;
}
.dmt-status-chip{
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:3px 8px;
  border-radius:999px;
  font-size:.65rem;
  font-weight:700;
}
.dmt-status-behind{
  color:#D52B36;
  background:rgba(250,57,70,.08);
  border-color:rgba(250,57,70,.18);
}
.dmt-status-ontrack{
  color:#9A5B00;
  background:rgba(245,161,49,.12);
}
.dmt-status-ahead{
  color:#007A50;
  background:rgba(0,160,104,.1);
}
.dmt-pace{
  font-size:.66rem;
  color:#8E8E93;
}
/* Business status */
.biz-status{
  margin-bottom:16px;
}
.biz-status-secondary{
  display:flex;
  align-items:stretch;
  margin-top:8px;
  background:var(--vg-color-surface);
  border:1px solid rgba(31,41,55,.08);
  border-radius:14px;
  box-shadow:0 3px 10px rgba(26,38,52,.04);
  overflow:hidden;
}
.biz-stat{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:10px 12px;
  text-decoration:none;
  color:inherit;
  border-inline-start:1px solid rgba(31,41,55,.05);
}
.biz-stat:first-child{
  border-inline-start:none;
}
.biz-stat-label{
  font-size:.66rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
}
.biz-stat-value{
  font-size:.92rem;
  font-weight:700;
  color:var(--vg-color-text);
  display:flex;
  align-items:baseline;
  gap:3px;
}
.biz-stat-value.debt{
  color:#D52B36;
}
/* Quick actions — compact card geometry; SVG modestly larger (not the card) */
.dash-quick-actions-block{
  margin-bottom:16px;
}
.dash-qa-bar{
  display:flex;
  flex-wrap:nowrap;
  overflow-x:auto;
  gap:6px;
  padding:0;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.dash-qa-bar::-webkit-scrollbar{
  display:none;
}
.dash-qa-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  flex:1 0 auto;
  min-width:62px;
  padding:8px 6px;
  background:var(--vg-color-surface);
  border:0;
  border-radius:var(--vg-radius-soft);
  box-shadow:var(--vg-shadow-group);
  text-decoration:none;
  color:var(--vg-color-text);
  font-family:inherit;
  text-align:center;
  cursor:pointer;
}
.dash-qa-btn:active{
  transform:scale(.96);
  opacity:.88;
  background:#F2F2F7;
}
/* Modest icon well — not a giant container */
.dash-qa-ico{
  width:26px;
  height:26px;
  border-radius:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  color:var(--vg-color-icon);
}
/* Actual SVG size (~24px) — the primary optical correction */
.dash-qa-ico svg{
  max-width:24px;
  max-height:24px;
  display:block;
}
.dash-qa-label{
  font-size:.64rem;
  font-weight:500;
  color:#3A3A3C;
  line-height:1.2;
}
/* Action queue */
.dash-action-queue{
  padding:3px 11px 4px;
}
.action-row{
  position:relative;
  align-items:flex-start;
  gap:10px;
  padding:11px 2px;
  min-height:0;
  border-bottom:1px solid var(--vg-color-divider);
}
.action-row::after{
  content:"";
  position:absolute;
  inset-inline-start:-11px;
  top:9px;
  bottom:9px;
  width:3px;
  border-radius:2px;
  background:rgba(31,41,55,.08);
}
.action-row-critical::after{
  background:#FA3946;
}
.action-row-high::after{
  background:#F5A131;
}
/* Suggested actions hierarchy: name > action > reason > meta */
.action-person{
  display:inline;
  color:var(--vg-color-text);
  font-size:.82rem;
  font-weight:550;
}
.action-badge{
  display:inline-flex;
  padding:2px 6px;
  border-radius:999px;
  font-size:.58rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  background:rgba(31,41,55,.05);
}
.action-main{
  display:block;
  margin-top:4px;
  color:var(--vg-color-text);
  font-size:.76rem;
  font-weight:500;
  line-height:1.4;
}
.action-why,
.action-why-now{
  display:block;
  margin-top:3px;
  color:var(--vg-color-text-muted);
  font-size:.63rem;
  font-weight:400;
  line-height:1.45;
}
.action-why-now{
  color:var(--accent-dark);
  font-weight:500;
}
.action-urgency{
  height:32px;
  width:32px;
  min-width:32px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
}
.action-urgency svg{
  width:16px;
  height:16px;
}
.action-urgency-critical{
  color:#D52B36;
  background:rgba(250,57,70,.12);
}
.action-urgency-high{
  color:var(--accent-dark);
  background:rgba(255,92,53,.12);
}
.action-urgency-medium{
  color:var(--vg-color-primary);
  background:rgba(0,112,210,.1);
}
.action-urgency-low{
  color:var(--vg-color-neutral);
  background:rgba(107,114,128,.12);
}
.dash-action-more[hidden]{
  display:none;
}
.dash-action-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:100%;
  margin-top:2px;
  padding:9px 6px;
  border:1px dashed rgba(31,41,55,.15);
  border-radius:999px;
  background:transparent;
  color:var(--accent-dark);
  font-size:.72rem;
  font-weight:600;
  cursor:pointer;
}
.dash-action-toggle-ico{
  transform:rotate(90deg);
}
.dash-action-toggle.is-open .dash-action-toggle-ico{
  transform:rotate(-90deg);
}
/* Activity sections — list-row weight, not headline typography */
.dash-activity{
  padding:2px 10px 4px;
}
.dash-activity .ledger-row{
  min-height:48px;
  padding:9px 2px;
}
.dash-activity .ledger-row .name{
  font-size:.86rem;
  font-weight:500;
  line-height:1.35;
  gap:2px;
}
.dash-activity .ledger-row .sub{
  font-size:.68rem;
  font-weight:400;
  color:var(--vg-color-text-muted);
  line-height:1.4;
}
.dash-activity .ledger-row .amount{
  font-size:.8rem;
  font-weight:550;
  color:var(--vg-color-text);
}
.dash-activity-group{
  margin-bottom:18px;
}
.dash-activity-section{
  background:var(--vg-color-surface);
  border:1px solid rgba(31,41,55,.06);
  border-radius:16px;
  box-shadow:var(--vg-shadow-group);
  overflow:hidden;
  margin-bottom:10px;
  padding:4px 12px 6px;
}
.dash-activity-section .dashboard-block-head{
  margin:8px 2px 4px;
}
/* Watch summary compact */
.dash-watch-compact{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border:1px solid rgba(31,41,55,.08);
  border-radius:16px;
  background:var(--vg-color-surface);
  box-shadow:0 4px 12px rgba(26,38,52,.05);
  text-decoration:none;
}
.dash-watch-compact-ico{
  width:38px;
  height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:var(--vg-color-warning-soft);
  color:var(--vg-color-icon);
}
.dash-watch-compact-body{
  flex:1;
  min-width:0;
}
.dash-watch-compact-count{
  font-size:1.05rem;
  font-weight:800;
  color:var(--vg-color-text);
}
.dash-watch-compact-label{
  font-size:.72rem;
  color:var(--vg-color-text-muted);
}
.dash-watch-compact-chevron{
  font-size:1.2rem;
  color:var(--vg-color-text-muted);
}
/* --------------------------------------------------------------------------
   08. CUSTOMERS (Composition continued)
   -------------------------------------------------------------------------- */
.customer-list-row{
  /* composition already defined above */
}
/* Scoped visual polish for Customers list rows */
#customer-list .customer-list-row .name{
  font-weight:var(--vg-weight-label);
}

/* Scoped visual polish for Customer Detail data rows */
#main.customer-detail-view .tx-row-title{
  font-weight:var(--vg-weight-label);
}

#main.customer-detail-view .tx-row-total{
  font-weight:var(--vg-weight-value);
}

/* (No extra needed - all rules covered) */

/* --------------------------------------------------------------------------
   09. PRODUCTS / INVENTORY
   -------------------------------------------------------------------------- */
/* (No extra needed - .product-row-summary defined above) */

/* --------------------------------------------------------------------------
   10. SUPPLIERS
   -------------------------------------------------------------------------- */
.supplier-purchase-item-row .name{
  min-width:0;
}
.supplier-purchase-item-row .tx-row-title{
  white-space:normal;
}

/* --------------------------------------------------------------------------
   11. INVOICES V6 (PROTECTED)
   -------------------------------------------------------------------------- */
/* openSheet() sets inline position:relative — fixed+inset must win for full viewport cover */
.sheet.inv-sheet-host{
  position:fixed !important;
  inset:0 !important;
  width:auto !important;
  max-width:none !important;
  height:auto !important;
  max-height:none !important;
  margin:0 !important;
  border-radius:0 !important;
  padding:0;
  display:flex;
  flex-direction:column;
  box-shadow:none;
  overflow:hidden;
  background:var(--vg-color-bg);
  z-index:1;
}
/* This is a full-screen page-like host, not a card sheet — no grabber,
   no swipe-to-dismiss affordance (display:none also stops touch events
   from reaching bindSheetDragToDismiss's listener, so this alone is
   enough to disable the gesture here, no JS branch needed). */
.sheet.inv-sheet-host .sheet-handle{
  display:none;
}
.inv-sheet-v2{
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:0;
  overflow:hidden;
}
.inv-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  width:100%;
  max-width:none;
  margin:0;
  box-sizing:border-box;
  padding-top:calc(10px + env(safe-area-inset-top,0px));
  padding-bottom:10px;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  box-shadow:0 1px 0 rgba(15,23,42,.07),0 8px 22px rgba(15,23,42,.05);
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding-inline:14px;
}
.inv-header-btn{
  flex:0 0 auto;
  min-height:36px;
  padding:6px 12px;
  border:0;
  border-radius:999px;
  background:rgba(31,41,55,.05);
  color:var(--vg-color-text-muted);
  font-family:inherit;
  font-size:.84rem;
  font-weight:600;
  cursor:pointer;
}
.inv-header-title{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  min-width:0;
}
.inv-header-title-main{
  font-size:.95rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.inv-header-title-sub{
  font-size:.7rem;
  color:var(--vg-color-text-muted);
}
button.inv-header-save.btn{
  flex:0 0 auto;
  min-height:36px;
  padding:7px 16px;
  border-radius:999px;
  font-size:.86rem;
  font-weight:700;
  background:#0070D2;
  color:#fff;
}
.inv-body{
  flex:1 1 auto;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding:calc(72px + env(safe-area-inset-top,0px)) 14px calc(28px + env(safe-area-inset-bottom,0px));
  max-width:720px;
  width:100%;
  margin:0 auto;
  box-sizing:border-box;
}
.inv-section{
  margin-bottom:24px;
}
.inv-section-title{
  font-size:.8rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
  margin:0 0 10px;
}
.inv-section-title-optional{
  font-weight:400;
  color:var(--vg-color-text-muted);
  opacity:.75;
}
.inv-payment-section{
  margin-bottom:16px;
}
.inv-items-section{
  margin-bottom:18px;
}
/* Customer identity block at the top of the New Invoice sheet. These
   classes existed in the markup with no rules at all, so the avatar
   rendered as a bare unstyled initial letter and the name/meta had no
   grouping — this is the "unexplained standalone A" and the weak
   customer-identity issue in the same pass. */
.inv-customer-context{
  display:flex;
  align-items:center;
  min-height:56px;
  padding:12px 16px;
  background:var(--vg-color-surface);
  border-radius:var(--vg-radius-soft);
}
.inv-customer-info{
  min-width:0;
  flex:1 1 auto;
}
.inv-customer-name{
  font-size:.96rem;
  font-weight:700;
  color:var(--vg-color-text);
  line-height:1.35;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.inv-customer-meta{
  font-size:.78rem;
  color:var(--vg-color-text-muted);
  margin-top:2px;
  line-height:1.3;
}
/* Invoice details: inset-grouped rows, label at the start, value at the end.
   Date rows lay the existing .shamsi-date field over the whole row so the entire
   row opens the picker (the picker is bound to the field, not to the label). */
.inv-rows{
  background:var(--vg-color-surface);
  border-radius:var(--vg-radius-soft);
  overflow:hidden;
}
.inv-row{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:52px;
  padding:0 16px;
}
.inv-row + .inv-row{
  border-top:1px solid var(--vg-color-divider);
}
.inv-row-label{
  margin:0;
  font-size:var(--vg-type-secondary);
  font-weight:var(--vg-weight-regular);
  color:var(--vg-color-text);
}
.inv-row-label small{
  margin-inline-start:6px;
  font-size:var(--vg-type-label);
  color:var(--vg-color-text-muted);
}
.inv-row-value{
  font-size:var(--vg-type-secondary);
  color:var(--vg-color-text-muted);
  font-variant-numeric:tabular-nums;
}
.inv-row-date .shamsi-date{
  position:absolute;
  inset:0;
}
.inv-row-date::after{
  content:"";
  position:absolute;
  inset-inline-end:16px;
  top:50%;
  width:16px;
  height:16px;
  margin-top:-8px;
  background-color:var(--vg-color-text-muted);
  opacity:.55;
  pointer-events:none;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 6-6 6 6 6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 6-6 6 6 6'/%3E%3C/svg%3E") center/contain no-repeat;
}
html .inv-sheet-v2 .inv-row-date input.shamsi-date-field{
  width:100%;
  height:100%;
  min-height:0;
  box-sizing:border-box;
  padding:0 16px;
  padding-inline-end:44px;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:transparent;
  color:var(--vg-color-primary);
  font:inherit;
  font-size:var(--vg-type-secondary);
  text-align:end;
  cursor:pointer;
}
html .inv-sheet-v2 .inv-row-date input.shamsi-date-field:focus-visible{
  outline:0;
  box-shadow:inset 0 0 0 2px var(--vg-color-primary-soft);
}
/* iOS-style switch (native checkbox underneath, so label/keyboard/a11y keep working) */
.inv-switch{
  -webkit-appearance:none;
  appearance:none;
  position:relative;
  flex:none;
  width:51px;
  height:31px;
  margin:0;
  border-radius:999px;
  background:rgba(120,120,128,.32);
  cursor:pointer;
  transition:background-color .2s ease;
}
.inv-switch::before{
  content:"";
  position:absolute;
  top:2px;
  inset-inline-start:2px;
  width:27px;
  height:27px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 4px rgba(0,0,0,.22);
  transition:inset-inline-start .2s ease;
}
.inv-switch:checked{
  background:var(--vg-color-success);
}
.inv-switch:checked::before{
  inset-inline-start:22px;
}
.inv-switch:focus-visible{
  outline:2px solid var(--vg-color-primary);
  outline-offset:2px;
}
@media (prefers-reduced-motion:reduce){
  .inv-switch,
  .inv-switch::before{transition:none;}
}
.inv-items-card{
  background:var(--vg-color-surface);
  border-radius:var(--vg-radius-soft);
  overflow:hidden;
  padding:0;
}
/* Title now sits above the card surface (More-page pattern) — see markup
   in js/app.js renderSheet(), where .inv-items-card-head was moved out of
   .inv-items-card. */
.inv-items-card-head{
  padding:0 4px 8px;
}
.inv-items-card-label{
  font-size:.72rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
}
.inv-line{
  position:relative;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.inv-line + .inv-line::before{
  content:"";
  position:absolute;
  top:0;
  left:14px;
  right:14px;
  height:1px;
  background:rgba(15,23,42,.06);
}
.inv-line-empty{
  padding:0!important;
}
.inv-line-view-active{
  display:none;
}
.inv-line.is-active .inv-line-view-active{
  display:block;
}
.inv-line.is-active .inv-line-collapsed{
  display:none;
}
.inv-line-collapsed{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  min-height:56px;
  padding:10px 14px;
  box-sizing:border-box;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.inv-line-collapsed:focus{
  outline:none;
}
.inv-line-body{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  text-align:right;
}
.inv-line-collapsed .inv-line-name{
  display:block;
  width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  border:0!important;
  background:transparent!important;
  padding:0!important;
  margin:0!important;
  min-height:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  color:var(--vg-color-text)!important;
  font-size:15px!important;
  font-weight:600!important;
  line-height:1.35;
}
/* Zoho-style figures column: line total on top, "qty × unit price" beneath it,
   both aligned to the end edge (left in RTL). */
.inv-line-figures{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
  text-align:left;
}
.inv-line-calc{
  font-size:12.5px;
  font-weight:500;
  color:var(--vg-color-text-muted);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.inv-line-collapsed .inv-line-amount{
  flex:0 0 auto;
  min-width:0;
  text-align:left;
  font-size:16px;
  line-height:1.35;
  font-weight:700;
  color:var(--vg-color-text);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.inv-line-main{
  position:relative;
  display:flex;
  align-items:center;
  min-width:0;
  padding:12px 14px 4px;
}
.inv-line-view-active{
  background:#FBFCFE;
}
.inv-line-view-active .row-product-search.inv-line-name{
  flex:1 1 auto;
  min-width:0;
  width:100%;
  padding:0 40px 0 34px!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  outline:none!important;
  min-height:38px!important;
  color:var(--vg-color-text)!important;
  font-size:15px!important;
  font-weight:600!important;
  line-height:1.4;
  text-align:right;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  cursor:pointer;
  -webkit-appearance:none;
  appearance:none;
  -webkit-tap-highlight-color:transparent;
}
.inv-line-view-active .row-product-search.inv-line-name:focus{
  outline:none!important;
  box-shadow:none!important;
  border-color:transparent!important;
}
.inv-line-chevron{
  color:var(--vg-color-text-muted);
  font-size:1.05rem;
  opacity:.7;
  position:absolute;
  left:14px;
}
.inv-line-sub{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:4px 14px 0;
}
.inv-line-qtyrate{
  display:flex;
  align-items:center;
  gap:6px;
  direction:rtl;
  font-size:.8rem;
  color:var(--vg-color-text-muted);
  font-weight:500;
}
.inv-mini-input{
  direction:ltr;
  width:48px;
  min-width:48px;
  height:40px;
  box-sizing:border-box;
  border:1px solid rgba(15,23,42,.12);
  background:var(--vg-color-surface);
  padding:4px 5px;
  font-size:14px;
  font-family:inherit;
  font-weight:600;
  color:var(--vg-color-text);
  text-align:center;
  border-radius:9px;
  box-shadow:none;
  outline:none;
  -webkit-appearance:none;
  appearance:none;
}
.inv-mini-input-price{
  width:96px;
  min-width:96px;
}
.sheet.inv-sheet-host .inv-mini-input:focus{
  outline:none;
  border-color:rgba(15,23,42,.22);
  box-shadow:0 0 0 2px rgba(15,23,42,.04);
}
.sheet.inv-sheet-host .inv-discount-block input:focus,
.sheet.inv-sheet-host .inv-payment-panel > input:focus{
  outline:none;
  border-color:rgba(0,112,210,.45);
  box-shadow:0 0 0 3px rgba(0,112,210,.18);
}
.inv-line-x,
.inv-line-unit{
  color:var(--vg-color-text-muted);
  font-weight:500;
}
.inv-line-del{
  position:absolute;
  top:50%;
  left:14px;
  transform:translateY(-50%);
  width:28px;
  height:28px;
  min-width:28px;
  padding:0;
  border-radius:50%;
  border:0;
  background:rgba(31,41,55,.05);
  color:#D52B36;
  font-size:1rem;
  line-height:28px;
  text-align:center;
  cursor:pointer;
  flex:0 0 auto;
  opacity:.9;
  z-index:2;
  -webkit-tap-highlight-color:transparent;
}
.inv-line-avg-cost{
  display:inline-flex;
  align-items:center;
  gap:5px;
  margin:5px 14px 0;
  padding:5px 8px;
  border-radius:8px;
  background:rgba(31,41,55,.035);
  font-size:11.5px;
  font-weight:550;
  color:#475467;
  line-height:1.35;
  font-variant-numeric:tabular-nums;
}
.inv-line-avg-cost::before{
  content:'میانگین خرید';
  color:var(--vg-color-text-muted);
  font-weight:500;
}
.inv-line-avg-cost.is-below{
  background:rgba(250,57,70,.07);
  color:#B42318;
}
.inv-line-market-details{
  margin:4px 14px 12px;
  padding:0;
  color:var(--vg-color-text-muted);
  font-size:12.5px;
}
.inv-line-market-details summary{
  list-style:none;
  cursor:pointer;
  padding:5px 0;
  color:#475467;
  font-weight:600;
  -webkit-tap-highlight-color:transparent;
}
.inv-line-market-details summary::-webkit-details-marker{
  display:none;
}
.inv-line-market-details summary::before{
  content:'';
  display:inline-block;
  width:7px;
  height:7px;
  margin-inline-end:8px;
  border-inline-start:1.5px solid currentColor;
  border-block-end:1.5px solid currentColor;
  transform:rotate(45deg) translateY(-1px);
  transition:transform .15s ease;
}
.inv-line-market-details[open] summary::before{
  transform:rotate(135deg) translate(-1px,-1px);
}
.inv-line-market-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  padding:6px 0;
  border-top:1px solid rgba(15,23,42,.05);
}
.inv-line-market-row span{
  color:var(--vg-color-text-muted);
  font-weight:500;
}
.inv-line-market-row strong{
  color:var(--vg-color-text);
  font-weight:600;
  font-variant-numeric:tabular-nums;
  text-align:left;
  white-space:nowrap;
}
.inv-profit-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
  padding:13px 16px;
  background:var(--vg-color-surface);
  border-radius:var(--vg-radius-soft);
  font-size:.82rem;
  color:#475467;
}
.inv-profit-summary .name{
  font-weight:600;
  color:#475467;
}
.inv-profit-summary .amount{
  font-size:1rem;
  font-weight:700;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
@media(max-width:360px){
  .inv-line-collapsed{padding-inline:12px;gap:10px;}
  .inv-line-main,.inv-line-sub,.inv-line-avg-cost{padding-inline:12px;}
  .inv-line-market-details{margin-inline:12px;}
  .inv-mini-input{width:46px;min-width:46px;}
  .inv-mini-input-price{width:88px;min-width:88px;}
  .inv-line-del{left:12px;}
  .inv-discount-block{grid-template-columns:1fr;gap:7px;}
  .inv-discount-type{width:100%;}
}

/* Product picker panel (Invoice V6) — markup from openProductDrop; CSS was missing */
.prod-drop{
  position:fixed;
  z-index:90;
  box-sizing:border-box;
}
.prod-drop[hidden]{display:none!important;}
.prod-drop-panel{
  display:flex;
  flex-direction:column;
  max-height:inherit;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(15,23,42,.08);
  border-radius:18px;
  box-shadow:0 16px 40px rgba(15,23,42,.14),0 2px 10px rgba(15,23,42,.05);
  overflow:hidden;
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.prod-drop-search-wrap{
  flex:0 0 auto;
  padding:10px 12px;
  background:rgba(248,250,252,.9);
  border-bottom:1px solid rgba(15,23,42,.06);
}
.prod-drop-search{
  width:100%;
  box-sizing:border-box;
  min-height:42px;
  padding:8px 12px;
  border:1px solid rgba(15,23,42,.09);
  border-radius:12px;
  background:var(--vg-color-surface);
  font-family:inherit;
  font-size:.88rem;
  color:var(--vg-color-text);
  outline:none;
}
.prod-drop-search:focus{
  border-color:rgba(0,112,210,.32);
  box-shadow:0 0 0 3px rgba(0,112,210,.08);
}
.prod-drop-list{
  flex:1 1 auto;
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  max-height:inherit;
}
.prod-drop-item{
  display:flex;
  align-items:center;
  min-height:54px;
  gap:10px;
  padding:7px 12px;
  border-bottom:1px solid rgba(15,23,42,.055);
  cursor:pointer;
  background:transparent;
  -webkit-tap-highlight-color:transparent;
}
.prod-drop-item:last-child{border-bottom:none;}
.prod-drop-item:active,.prod-drop-item:focus{
  background:#F2F6FA;
  outline:none;
}
.prod-drop-ico{
  flex:0 0 auto;
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:#F1F6FB;
  color:var(--vg-color-primary);
}
.prod-drop-ico svg{width:18px;height:18px;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;}
.prod-drop-name{
  flex:1 1 auto;
  min-width:0;
  font-size:.9rem;
  font-weight:600;
  color:var(--vg-color-text);
  line-height:1.35;
}
.prod-drop-stock{
  flex:0 0 auto;
  min-width:28px;
  text-align:left;
  font-size:.72rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  white-space:nowrap;
}
.prod-drop-stock::before{content:'موجودی ';color:#98A2B3;}
.prod-drop-chevron{
  flex:0 0 auto;
  color:#B4BCC7;
  font-size:1.1rem;
  line-height:1;
}
.prod-drop-empty{
  padding:24px 14px;
  text-align:center;
  font-size:.85rem;
  color:var(--vg-color-text-muted);
}

.inv-add-line{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  width:100%;
  min-height:52px;
  margin:0;
  padding:12px 16px;
  box-shadow:inset 0 1px 0 var(--vg-color-divider);
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--vg-color-primary);
  font-family:inherit;
  font-size:.88rem;
  font-weight:600;
  cursor:pointer;
}
.inv-add-line-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:50%;
  background:var(--vg-color-primary);
  color:#fff;
  font-size:1.05rem;
  font-weight:500;
  line-height:1;
}
.inv-payment-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.inv-payment-total{
  min-width:1px;
  font-size:.8rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.inv-payment-actions{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0;
  background:var(--vg-color-surface);
  border-radius:var(--vg-radius-soft);
  overflow:hidden;
}
.inv-payment-action + .inv-payment-action{
  border-inline-start:1px solid var(--vg-color-divider);
}
.inv-payment-action{
  min-height:60px;
  padding:8px 6px;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--vg-color-text);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  font-family:inherit;
  font-size:.72rem;
  font-weight:600;
  cursor:pointer;
}
.inv-payment-action.is-active{
  background:var(--vg-color-primary-soft);
  color:var(--vg-color-primary);
}
.inv-payment-action-icon{
  width:22px;
  height:22px;
}
.inv-payment-action-icon svg{
  width:20px;
  height:20px;
  display:block;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.inv-payment-backdrop{
  position:fixed;
  inset:0;
  z-index:79;
  background:rgba(15,23,42,.18);
  pointer-events:auto;
}
.inv-payment-backdrop[hidden]{display:none!important;}
.inv-payment-panel{
  position:fixed;
  left:50%;
  bottom:calc(18px + env(safe-area-inset-bottom,0px) + var(--keyboard-height,0px));
  transform:translateX(-50%);
  width:min(400px,calc(100vw - 28px));
  max-height:calc(100vh - var(--keyboard-height,0px) - 40px);
  overflow:auto;
  z-index:80;
  margin:0;
  padding:16px;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  border-radius:22px;
  background:rgba(255,255,255,.99);
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 20px 50px rgba(15,23,42,.2),0 0 0 100vmax rgba(15,23,42,.18);
}
.inv-payment-panel[hidden]{
  display:none!important;
}
.inv-payment-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
  font-size:.9rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.inv-payment-panel-head > div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.inv-payment-panel-head small{
  font-size:.72rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
}
.inv-payment-close{
  width:32px;
  height:32px;
  border:0;
  border-radius:50%;
  background:rgba(31,41,55,.05);
  color:var(--vg-color-text-muted);
  font-size:1.15rem;
  cursor:pointer;
}
.inv-payment-panel > label,
.inv-payment-check-due > label{
  display:block;
  margin-bottom:6px;
  font-size:.72rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
}
.inv-payment-panel > input,
.inv-payment-check-due input{
  display:block;
  width:100%;
  min-height:46px;
  padding:11px 13px;
  border:1px solid rgba(15,23,42,.1);
  border-radius:14px;
  background:var(--vg-color-surface);
  color:var(--vg-color-text);
  font-family:inherit;
  font-size:16px;
  box-sizing:border-box;
}
.inv-payment-panel > input:focus,
.inv-payment-check-due input:focus{
  outline:none;
  border-color:#D94725;
  box-shadow:0 0 0 3px #FFF0EC;
}
.inv-payment-action-value{
  min-height:15px;
  font-size:.68rem;
  font-weight:700;
  color:var(--vg-color-primary);
  font-variant-numeric:tabular-nums;
}
.inv-payment-action-value:not(.is-filled){visibility:hidden;}
.inv-payment-confirm{
  position:static;
  display:block;
  flex:0 0 auto;
  width:100%;
  min-height:44px;
  margin:12px 0 0;
  box-sizing:border-box;
  border:0;
  border-radius:12px;
  background:#0070D2;
  color:#FFFFFF;
  font-family:inherit;
  font-size:.84rem;
  font-weight:700;
  cursor:pointer;
}
.inv-payment-confirm:active{transform:scale(.985);}
.inv-discount-block{
  display:grid;
  grid-template-columns:auto minmax(112px,1fr) minmax(92px,120px);
  align-items:center;
  gap:10px;
  margin:14px 0 4px;
  padding:8px 12px;
  border-radius:var(--vg-radius-soft);
  background:var(--vg-color-surface);
}
.inv-discount-label{
  font-size:.76rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
}
.inv-discount-type{
  display:flex;
  min-height:36px;
  padding:2px;
  border-radius:10px;
  background:#F2F4F7;
}
.inv-discount-type-btn{
  flex:1 1 50%;
  min-width:0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--vg-color-text-muted);
  font-family:inherit;
  font-size:.78rem;
  font-weight:600;
  cursor:pointer;
}
.inv-discount-type-btn.is-active{
  background:var(--vg-color-surface);
  color:var(--vg-color-primary);
  box-shadow:0 1px 4px rgba(15,23,42,.08);
}
.inv-discount-block input{
  width:100%;
  min-height:36px;
  box-sizing:border-box;
  padding:0 9px;
  border:1px solid rgba(15,23,42,.1);
  border-radius:10px;
  background:#F8FAFC;
  font-family:inherit;
  font-size:14px;
  font-weight:600;
  text-align:center;
  direction:ltr;
}

.inv-summary-section{
  margin-top:8px;
  margin-bottom:0;
  padding:14px 16px 12px;
  background:var(--vg-color-surface);
  border-radius:var(--vg-radius-soft);
}
.inv-summary-section #calc-summary .ledger-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  padding:6px 0;
  border-bottom:none;
  min-height:auto;
  cursor:default;
}
.inv-summary-section #calc-summary .ledger-row .name{
  font-weight:500;
  color:#475467;
}
.inv-summary-section #calc-summary .ledger-row .amount{
  font-weight:600;
  font-variant-numeric:tabular-nums;
  color:var(--vg-color-text);
  white-space:nowrap;
}
.inv-summary-section #calc-summary .inv-total-row{
  margin-top:3px;
  padding-top:9px;
  border-top:1px solid rgba(15,23,42,.06);
}
.inv-summary-section #calc-summary .inv-total-row .name,
.inv-summary-section #calc-summary .inv-total-row .amount{
  font-size:1rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.inv-summary-section #calc-summary .inv-discount-row{
  padding:5px 0 6px;
}
.inv-summary-section #calc-summary .inv-discount-row .name{
  color:var(--vg-color-text-muted);
  font-size:.78rem;
}
.inv-summary-section #calc-summary .inv-discount-row .amount{
  color:var(--vg-color-text-muted);
  font-size:.8rem;
}
.inv-summary-discount{
  margin:-1px 0 4px;
  padding-inline-start:2px;
  font-size:11.5px;
  color:var(--vg-color-text-muted);
  text-align:right;
}
.inv-summary-section #calc-summary .inv-remain-row{
  margin-top:4px;
  padding:10px 0 2px;
  border-top:1px solid rgba(15,23,42,.08);
}
.inv-summary-section #calc-summary .inv-remain-row .name,
.inv-summary-section #calc-summary .inv-remain-row .amount{
  font-size:1.08rem;
  font-weight:800;
}

/* Unique V4 compatibility radius */
.sheet.inv-sheet-host .inv-section{
  border-radius:18px;
}
/* --------------------------------------------------------------------------
   12. PAYMENTS / CHECKS (Already covered via ledger row composition)
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   13. VISITS
   -------------------------------------------------------------------------- */
.visit-precontext{
  margin-bottom:12px;
  padding:10px 12px;
  border:1px solid rgba(31,41,55,.08);
  border-radius:12px;
  background:rgba(31,41,55,.03);
}
.visit-precontext-title{
  font-weight:700;
  color:var(--vg-color-text);
  margin-bottom:6px;
}
.visit-precontext-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:3px;
  color:var(--vg-color-text-muted);
  font-size:.74rem;
  line-height:1.6;
}

/* --------------------------------------------------------------------------
   14. REPORTS / SETTINGS (Composition)
   -------------------------------------------------------------------------- */
.report-summary-title{
  font-size:.82rem;
  font-weight:600;
  color:var(--vg-color-text);
  margin:0 0 10px;
  letter-spacing:-.15px;
}
.report-summary{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0;
  margin-bottom:18px;
  padding:0;
  overflow:hidden;
  background:var(--vg-color-surface);
  border:1px solid var(--vg-color-border);
  border-radius:var(--vg-radius-raised);
  box-shadow:var(--vg-shadow-group);
}
.report-summary-card{
  padding:12px 13px;
  position:relative;
  overflow:hidden;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.report-summary-card::before{
  display:none;
}
.report-summary-card.sales::before{
  background:#0070D2;
}
.report-summary-card.profit::before{
  background:#00A068;
}
.report-summary-card.debt::before{
  background:#FA3946;
}
.report-summary-card.inventory::before{
  display:none;
}
.report-summary-card:nth-child(odd){
  border-inline-end:1px solid var(--vg-color-divider);
}
.report-summary-card:nth-child(-n+2){
  border-bottom:1px solid var(--vg-color-divider);
}
.report-summary-label{
  font-size:.68rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  margin:0 0 5px;
  line-height:1.3;
}
.report-summary-value{
  font-size:1.05rem;
  font-weight:700;
  color:var(--vg-color-text);
  line-height:1.3;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.2px;
}
.report-summary-value.sales{
  color:var(--vg-color-primary);
}
.report-summary-value.profit{
  color:#007A50;
}
.report-summary-value.debt{
  color:#D52B36;
}
.report-summary-meta{
  font-size:.66rem;
  color:var(--vg-color-text-muted);
  margin-top:5px;
  line-height:1.4;
  font-weight:400;
}
.report-summary-meta.up{
  color:#007A50;
}
.report-summary-meta.down{
  color:#D52B36;
}
.report-period-note{
  background:var(--vg-color-danger-soft);
  border:1px solid rgba(31,41,55,.08);
  border-radius:12px;
  padding:9px 11px;
  color:var(--vg-color-text-muted);
  font-size:.68rem;
  line-height:1.5;
  margin-bottom:12px;
}
.report-accordion-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  background:var(--vg-color-surface);
  border:1px solid rgba(31,41,55,.08);
  padding:0 12px;
  min-height:44px;
  border-radius:12px;
  cursor:pointer;
}
.report-accordion-header h3{
  margin:0;
  font-size:.85rem;
  font-weight:600;
  color:var(--vg-color-text);
}
.report-accordion-chevron{
  flex:0 0 auto;
  width:20px;
  height:20px;
  position:relative;
}
.report-accordion-chevron::before{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:8px;
  height:8px;
  margin:-5px 0 0 -5px;
  border-right:2px solid #667085;
  border-bottom:2px solid #667085;
  transform:rotate(45deg);
  transition:transform .15s;
}
.report-accordion-header.is-open .report-accordion-chevron::before{
  transform:rotate(-135deg);
}
.report-accordion-content{
  margin-top:10px;
}
.report-accordion-content[hidden]{
  display:none;
}
.report-accordion-header.is-open{
  border-radius:12px 12px 0 0;
  border-bottom:none;
}
.report-accordion-content{
  border:1px solid rgba(31,41,55,.08);
  border-top:none;
  border-radius:0 0 12px 12px;
  background:var(--vg-color-surface);
  padding:12px;
}
.settings-section{
  margin-bottom:0;
  background:var(--vg-color-surface);
  border:1px solid var(--vg-color-border);
  border-radius:var(--vg-radius-raised);
  padding:14px;
  box-shadow:var(--vg-shadow-group);
}
/* Avoid a "card inside a card" look: a couple of settings sections wrap
   their content in a plain .card (as a content box, not a second surface) —
   now that .settings-section itself is the card, flatten the inner one. */
.settings-section .card{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
}
.settings-warn{
  margin:0 0 12px;
  padding:10px 12px;
  font-size:.8rem;
  line-height:1.55;
  color:var(--accent-dark);
  background:var(--vg-color-warning-soft);
  border:0;
  border-radius:10px;
  text-align:right;
}
.mgmt-section{
  margin-bottom:22px;
}
/* Quiet title sitting above the card surface — same convention as the
   More page (.more-group-title / .more-group-card), applied consistently
   across every settings section instead of putting the title inside the
   card. */
.mgmt-section-title{
  margin:0 4px 8px;
  padding:0;
  font-size:.78rem;
  font-weight:var(--vg-weight-label);
  color:var(--vg-color-text-muted);
  line-height:1.35;
  letter-spacing:.01em;
  text-align:start;
}
.auto-backup-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 0;
  border-bottom:1px solid rgba(31,41,55,.05);
}
.auto-backup-row:last-child{
  border-bottom:none;
}
.tech-label{
  font-weight:500;
  color:var(--vg-color-text);
}
.tech-chevron{
  color:var(--vg-color-text-muted);
}

/* Settings secondary actions that read as plain text before this pass:
   add a quiet chevron, using the existing .btn.secondary surface already
   in place — no new button style. */
.settings-action-link{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.settings-action-link::after{
  content:'';
  width:11px;
  height:11px;
  flex:none;
  opacity:.5;
  background-color:currentColor;
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  -webkit-mask-size:contain;
  mask-size:contain;
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
}

/* --------------------------------------------------------------------------
   15. PROSPECTSCOUT / EVALUATION (Protected)
   -------------------------------------------------------------------------- */
/* Prospect list: clear gap under action buttons (overlap fix) */
.prospect-subnav{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}
#prospect-target.cards{
  margin-top:0;
  margin-bottom:14px;
}

/* Prospect daily evaluation target — Compact Stacked Hero (presentation only) */
#prospect-target.cards > .prospect-daily-target{
  grid-column:1 / -1;
}
.prospect-daily-target{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  padding:12px 14px 12px;
  border-radius:16px;
  background:var(--vg-color-surface);
  border:1px solid rgba(31,41,55,.08);
  box-shadow:0 1px 3px rgba(26,38,52,.04),0 4px 12px rgba(26,38,52,.035);
  color:var(--vg-color-text);
  min-width:0;
  box-sizing:border-box;
}
.prospect-daily-target.is-unset{
  gap:8px;
  padding:14px;
}
.prospect-daily-target.is-idle{
  opacity:1;
  background:var(--vg-color-surface);
  border-color:rgba(31,41,55,.08);
}
.prospect-daily-target .pdt-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
  margin-bottom:8px;
}
.prospect-daily-target .pdt-label{
  flex:1 1 auto;
  min-width:0;
  font-size:.78rem;
  font-weight:600;
  color:var(--vg-color-text);
  letter-spacing:-.1px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.prospect-daily-target .pdt-pct{
  flex:none;
  font-size:.72rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
  font-variant-numeric:tabular-nums;
  letter-spacing:-.1px;
}
.prospect-daily-target .pdt-hero{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:2px;
  padding:2px 0 6px;
  line-height:1.2;
}
.prospect-daily-target .pdt-count{
  font-size:2rem;
  font-weight:700;
  color:var(--vg-color-text);
  letter-spacing:-.6px;
  font-variant-numeric:tabular-nums;
  line-height:1.05;
}
.prospect-daily-target .pdt-caption{
  font-size:.72rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  margin:0;
}
.prospect-daily-target .pdt-of{
  font-size:.78rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  font-variant-numeric:tabular-nums;
}
.prospect-daily-target .pdt-bar-wrap{
  width:100%;
  min-width:0;
  margin:6px 0 8px;
}
.prospect-daily-target .pdt-bar{
  height:5px;
  border-radius:999px;
  background:rgba(31,41,55,.08);
  overflow:hidden;
}
.prospect-daily-target .pdt-bar>span{
  display:block;
  height:100%;
  border-radius:999px;
  background:#FF5C35;
  min-width:0;
}
.prospect-daily-target.is-idle .pdt-bar{
  height:5px;
  background:rgba(31,41,55,.08);
}
.prospect-daily-target.is-idle .pdt-bar>span{
  width:0!important;
}
.prospect-daily-target .pdt-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.prospect-daily-target .pdt-remain{
  flex:1 1 auto;
  min-width:0;
  font-size:.72rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  margin:0;
}
.prospect-daily-target .pdt-unset-msg{
  font-size:.84rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
}
.prospect-daily-target .pdt-meta{
  font-size:.78rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
}
.prospect-daily-target .pdt-edit{
  flex:none;
  border:none;
  background:transparent;
  color:var(--vg-color-primary);
  font-family:inherit;
  font-size:.78rem;
  font-weight:600;
  padding:4px 2px;
  border-radius:0;
  cursor:pointer;
  min-height:28px;
  line-height:1.2;
  box-shadow:none;
}
.prospect-daily-target .pdt-edit:active{
  opacity:.65;
  background:transparent;
  transform:none;
}
.rank-pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  color:#fff;
  font-weight:700;
  font-size:.72rem;
  /* FIX (discovered during Evaluation V2 work): without this, the bidi
     algorithm reorders "A+" to display as "+A" inside RTL pages. This
     pill is reused heavily by the new V2 rank badges, so fixing it here
     benefits every rank pill in the app (legacy included), not just V2. */
  direction:ltr;
  unicode-bidi:isolate;
}
.rank-pill-A\+{
  background:#00A068;
}
.rank-pill-A{
  background:#0070D2;
}
.rank-pill-B{
  background:#F5A131;
}
.rank-pill-C{
  background:#FF5C35;
}
.rank-pill-D{
  background:#6B7280;
}
.converted-banner{
  background:#0070D2;
  color:#fff;
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:12px;
  font-weight:600;
  font-size:.9rem;
}
.prospect-result-card{
  padding:11px 13px;
}
.prospect-result-title{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:.82rem;
  font-weight:600;
  color:var(--vg-color-primary);
}
.prospect-result-title span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#FF5C35;
  color:#fff;
  font-size:.7rem;
}
.prospect-result-content{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.prospect-result-chip{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 9px;
  border:1px solid rgba(31,41,55,.08);
  border-radius:999px;
  background:rgba(31,41,55,.03);
  color:var(--vg-color-text);
  font-size:.72rem;
}
.evaluation-answers-card{
  padding:5px 13px;
}
.answer-row{
  display:grid;
  grid-template-columns:minmax(118px,.72fr) minmax(0,1.28fr);
  gap:10px;
  padding:11px 0;
  border-bottom:1px solid rgba(31,41,55,.05);
}
.answer-q{
  display:flex;
  align-items:flex-start;
  gap:7px;
  color:var(--vg-color-primary);
  font-size:.76rem;
  font-weight:600;
}
.answer-index{
  direction:ltr;
  color:var(--vg-color-text-muted);
  font-size:.67rem;
}
.answer-a{
  color:var(--vg-color-text);
  font-size:.77rem;
  line-height:1.65;
}
.snapshot-answer-row{
  width:100%;
  appearance:none;
  background:transparent;
  border:0;
  border-bottom:1px solid rgba(31,41,55,.05);
  font:inherit;
  text-align:right;
}
.snapshot-answer-row:last-child{
  border-bottom:0;
}
.visit-history-edit{
  margin-top:6px;
  min-height:34px;
}
.eval-location-context{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:48px;
  padding:8px 10px;
}
.eval-location-context-text{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:550;
}
.visit-card-stage{
  min-height:120px;
  margin:8px 0 4px;
}
.visit-card-enter{
  animation:visitCardIn .36s cubic-bezier(.22,.61,.36,1);
}
@keyframes visitCardIn{
  from{opacity:0;transform:translateX(-8px);}
  to{opacity:1;transform:translateX(0);}
}
.q-title{
  font-weight:650;
  margin:0 0 12px;
  font-size:.9rem;
  line-height:1.65;
  color:var(--vg-color-primary);
}
.q-block{
  margin-bottom:16px;
  padding-bottom:14px;
  border-bottom:1px dashed rgba(31,41,55,.08);
}
.eval-q-opt{
  width:100%;
  text-align:right;
}
.chip-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

/* --------------------------------------------------------------------------
   16. GAME CENTER (Protected)
   -------------------------------------------------------------------------- */
.gc-page{
  padding:2px 0 28px;
  max-width:640px;
  margin:0 auto;
}
.gc-header{
  margin:0 0 16px;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
  background:transparent!important;
  border:none!important;
  color:inherit!important;
}
.gc-title-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.gc-title{
  margin:0;
  font-size:1.15rem;
  font-weight:700;
  color:var(--vg-color-text)!important;
}
.gc-title-line{
  flex:1;
  height:1px;
  background:rgba(0,0,0,.1);
}
.gc-title-mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  color:#FF5C35;
}
.gc-title-mark svg{
  width:28px;
  height:28px;
}
.gc-seg{
  display:inline-flex;
  align-self:flex-start;
  gap:2px;
  padding:2px;
  background:rgba(0,0,0,.06);
  border-radius:999px;
}
.gc-seg-btn{
  min-width:72px;
  min-height:30px;
  padding:4px 14px;
  border:none;
  border-radius:999px;
  background:transparent;
  color:var(--vg-color-text-muted);
  font-family:inherit;
  font-size:.78rem;
  font-weight:600;
  cursor:pointer;
}
.gc-seg-btn.is-active{
  background:var(--vg-color-surface);
  color:var(--vg-color-text);
  box-shadow:0 1px 2px rgba(0,0,0,.08);
}
.gc-section{
  margin-bottom:18px;
}
.gc-section-head{
  display:flex;
  align-items:center;
  gap:7px;
  margin-bottom:8px;
}
.gc-section-ico{
  display:flex;
  color:var(--vg-color-icon);
}
.gc-section-title{
  margin:0;
  font-size:.9rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.gc-panel{
  background:var(--vg-color-surface);
  border:1px solid var(--vg-color-border);
  border-radius:var(--vg-radius-soft);
  padding:12px 14px;
  box-shadow:var(--vg-shadow-group);
}
.gc-panel-inline{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.gc-missions{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.gc-mission{
  background:var(--vg-color-surface);
  border:1px solid var(--vg-color-border);
  border-radius:var(--vg-radius-soft);
  padding:12px 14px;
  box-shadow:none;
}
.gc-mission.is-dormant{
  opacity:.78;
}
.gc-mission.is-active{
  border-color:rgba(255,92,53,.32);
}
.gc-mission.is-complete{
  border-color:rgba(0,160,104,.35);
  background:rgba(0,160,104,.035);
}
.gc-mission-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.gc-mission-icon{
  width:32px;
  height:32px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.04);
  color:var(--vg-color-icon);
}
.gc-mission.is-active .gc-mission-icon{
  background:rgba(255,92,53,.12);
  color:var(--accent-dark);
}
.gc-mission.is-complete .gc-mission-icon{
  background:rgba(0,160,104,.12);
  color:#007A50;
}
.gc-mission-body{
  flex:1;
  min-width:0;
}
.gc-mission-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  margin-bottom:8px;
}
.gc-mission-title{
  font-size:.9rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.gc-mission-count{
  font-size:.88rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
}
.gc-track{
  height:8px;
  border-radius:999px;
  background:rgba(0,0,0,.07);
  overflow:hidden;
}
.gc-track-fill{
  height:100%;
  width:0;
  border-radius:999px;
  background:#FF5C35;
  transition:width .28s ease;
}
.gc-mission.is-complete .gc-track-fill{
  background:#00A068;
}
.gc-monthly-pct{
  text-align:center;
  font-size:1.55rem;
  font-weight:700;
  color:var(--vg-color-text);
  margin-bottom:8px;
}
.gc-monthly-amounts{
  text-align:center;
  font-size:.88rem;
  font-weight:600;
  color:var(--vg-color-text);
}
.gc-line{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:9px 0;
  border-bottom:1px solid rgba(0,0,0,.05);
  font-size:.88rem;
}
.gc-line-last{
  border-bottom:0;
}
.gc-line-lab{
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-weight:500;
  color:var(--vg-color-text);
}
.gc-line-val{
  font-weight:700;
  color:var(--vg-color-text);
}
.gc-line-val.is-ok{
  color:#007A50;
}
.gc-soft{
  font-size:.75rem;
  color:var(--vg-color-text-muted);
  text-align:center;
}
.gc-muted-strong{
  color:var(--vg-color-text-muted);
}
.gc-hint{
  font-size:.76rem;
  color:var(--vg-color-text-muted);
  margin-top:2px;
}
.gc-hero{
  display:flex;
  align-items:baseline;
  gap:6px;
}
.gc-hero-num{
  font-size:1.75rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.gc-hero-lab{
  font-size:.85rem;
  font-weight:600;
  color:var(--vg-color-text-muted);
}
.gc-pill{
  display:inline-flex;
  align-items:center;
  font-size:.72rem;
  padding:3px 9px;
  border-radius:999px;
  background:rgba(0,0,0,.05);
  color:var(--vg-color-text-muted);
}
.gc-pill.is-on{
  background:rgba(0,160,104,.12);
  color:#007A50;
}
.gc-xp-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.gc-xp-num{
  font-size:1.35rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.gc-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  margin-bottom:6px;
}
.gc-kpi{
  text-align:center;
  padding:8px 4px;
  border-radius:0;
  background:transparent;
}
.gc-kpi-num{
  font-size:1.15rem;
  font-weight:700;
  color:var(--vg-color-text);
}

/* --------------------------------------------------------------------------
   17. WATCH / RADAR (Protected)
   -------------------------------------------------------------------------- */
.watch-page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.watch-page-hint{
  font-size:.72rem;
  color:var(--vg-color-text-muted);
}
.watch-total-count{
  min-width:32px;
  height:32px;
  padding:0 8px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(31,41,55,.05);
  border:1px solid rgba(31,41,55,.08);
  font-size:.78rem;
  font-weight:700;
}
.watch-customer-group{
  margin:0 0 10px;
  border:1px solid rgba(31,41,55,.08);
  border-radius:14px;
  background:var(--vg-color-surface);
  overflow:hidden;
}
.watch-customer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:9px 12px;
  background:rgba(31,41,55,.03);
  border-bottom:1px solid rgba(31,41,55,.08);
}
.watch-customer-name{
  font-size:.82rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.watch-customer-count{
  font-size:.68rem;
  color:var(--vg-color-text-muted);
}
.watch-customer-items{
  padding:0 10px;
}
.watch-list-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:43px;
  padding:7px 2px;
  border-bottom:1px solid rgba(31,41,55,.05);
}
.watch-list-row:last-child{
  border-bottom:none;
}
.watch-list-main{
  flex:1;
  min-width:0;
}
.watch-list-title{
  font-size:.8rem;
  font-weight:600;
  color:var(--vg-color-text);
}
.watch-list-sub{
  font-size:.66rem;
  color:var(--vg-color-text-muted);
}
.watch-list-meta{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
}
.watch-severity-badge{
  font-size:.72rem;
  font-weight:600;
  padding:2px 5px;
  border-radius:6px;
}
.watch-severity-high{
  color:#D52B36!important;
  background:rgba(250,57,70,.08);
}
.watch-severity-medium{
  color:var(--accent-dark)!important;
  background:rgba(255,92,53,.1);
}
.watch-severity-low{
  color:var(--vg-color-neutral)!important;
  background:rgba(107,114,128,.1);
}
.watch-reviewed-badge{
  font-size:.62rem;
  color:var(--vg-color-icon);
}
.watch-reviewed-badge.is-reviewed{
  color:#007A50;
}
.watch-detail-card{
  position:relative;
  padding:14px;
  background:var(--vg-color-surface);
  border:1px solid rgba(31,41,55,.08);
  border-radius:12px;
  margin-bottom:12px;
  box-shadow:0 3px 10px rgba(26,38,52,.04);
}
.watch-detail-kicker{
  font-size:.65rem;
  color:var(--vg-color-text-muted);
}
.watch-detail-customer-name{
  font-size:1rem;
  font-weight:700;
  color:var(--vg-color-text);
}
.watch-detail-block{
  margin-top:10px;
}
.watch-detail-block .label{
  font-size:.7rem;
  font-weight:500;
  color:var(--vg-color-text-muted);
  margin-bottom:4px;
}
.watch-detail-value{
  font-size:.88rem;
  color:var(--vg-color-text);
  line-height:1.7;
}
.watch-detail-reason .watch-detail-value{
  background:var(--vg-color-warning-soft);
  border-radius:10px;
  padding:10px 12px;
  color:#9A5B00;
}
.watch-detail-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:8px;
}
.watch-detail-footnote{
  font-size:.68rem;
  color:var(--vg-color-text-muted);
  text-align:center;
}

/* --------------------------------------------------------------------------
   18. PIN / SECURITY (Protected)
   -------------------------------------------------------------------------- */
#pin-lock-overlay{
  position:fixed;
  inset:0;
  z-index:99999;
  background:linear-gradient(160deg,#005AAB 0%,#0070D2 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 18px;
  font-family:inherit;
}
#pin-lock-overlay[hidden]{
  display:none!important;
}
#pin-lock-overlay .pin-box{
  width:100%;
  max-width:360px;
  background:var(--vg-color-surface);
  border-radius:24px;
  padding:36px 24px 28px;
  box-shadow:0 20px 56px rgba(0,0,0,.32);
  text-align:center;
}
#pin-lock-overlay .pin-lock-icon{
  width:72px;
  height:72px;
  margin:0 auto 20px;
  border-radius:50%;
  background:var(--vg-color-danger-soft);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--vg-color-icon);
}
#pin-lock-overlay .pin-title{
  font-size:1.25rem;
  font-weight:700;
  color:var(--vg-color-text);
  margin:0 0 8px;
}
#pin-lock-overlay .pin-sub{
  font-size:.85rem;
  color:var(--vg-color-text-muted);
  margin:0 0 28px;
}
#pin-lock-overlay .pin-cells-wrap{
  position:relative;
  margin:0 auto 8px;
  max-width:320px;
}
#pin-lock-overlay .pin-cells{
  display:flex;
  gap:12px;
  justify-content:center;
  direction:ltr;
}
#pin-lock-overlay .pin-cell{
  width:46px;
  height:56px;
  border-radius:14px;
  border:2px solid rgba(31,41,55,.1);
  background:rgba(31,41,55,.03);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.35rem;
  font-weight:600;
  color:var(--vg-color-text);
  transition:border-color .15s,background .15s,box-shadow .15s;
}
#pin-lock-overlay .pin-cell.filled{
  border-color:#1C1C1E;
  background:var(--vg-color-danger-soft);
}
#pin-lock-overlay .pin-cell.active{
  border-color:#1C1C1E;
  background:var(--vg-color-surface);
  box-shadow:0 0 0 4px #FFF0EC;
}
#pin-lock-overlay .pin-cell .dot{
  width:12px;
  height:12px;
  border-radius:50%;
  background:#1F2937;
}
#pin-lock-overlay .pin-cell .digit{
  opacity:1;
}
#pin-lock-overlay .pin-input-real{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:.01;
  border:0;
  background:transparent;
  color:transparent;
  font-size:16px;
  z-index:2;
  outline:none;
}
#pin-lock-overlay .pin-err{
  color:#D52B36;
  font-size:.85rem;
  min-height:1.3em;
  margin:16px 0 0;
}
#pin-lock-overlay .pin-btn{
  width:auto;
  min-width:120px;
  margin:20px auto 0;
  padding:10px 28px;
  border:none;
  border-radius:12px;
  background:#0070D2;
  color:#fff;
  font-weight:600;
  font-size:.9rem;
  min-height:44px;
  cursor:pointer;
}
#pin-lock-overlay .pin-btn:disabled{
  opacity:.35;
  background:#9AA3B2;
  cursor:not-allowed;
}
#pin-lock-overlay .pin-powered{
  font-size:.7rem;
  color:var(--vg-color-text-muted);
  margin:18px 0 0;
}
@keyframes pinShake{
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-6px)}
  40%{transform:translateX(6px)}
  60%{transform:translateX(-4px)}
  80%{transform:translateX(4px)}
}
#pin-lock-overlay .pin-box.shake{
  animation:pinShake .4s ease;
}

/* --------------------------------------------------------------------------
   19. FAB (Protected)
   -------------------------------------------------------------------------- */
.fab{
  position:fixed;
  inset-inline-end:16px;
  bottom:calc(88px + env(safe-area-inset-bottom,0px));
  width:56px;
  height:56px;
  border-radius:50%;
  background:#00A068;
  color:#fff;
  font-size:1.75rem;
  border:none;
  box-shadow:0 8px 22px rgba(47,107,69,.28);
  cursor:pointer;
  z-index:41;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.fab:active{
  transform:scale(.94);
}

/* --------------------------------------------------------------------------
   20. RESPONSIVE (View-specific)
   -------------------------------------------------------------------------- */
@media(max-width:360px){
  .dash-kpi-value,
  .biz-stat-value{
    font-size:.98rem;
  }
  main{
    padding:12px 10px calc(84px + env(safe-area-inset-bottom,0px));
  }
  .customer-list-row{
    gap:10px;
  }
  .tx-toolbar-select{
    min-width:100px;
  }
}
@media(max-width:419px){
  .cards{
    gap:8px;
  }
  .dash-qa-btn{
    padding:7px 5px;
    min-width:58px;
  }
  .dash-qa-label{
    font-size:.6rem;
  }
  .inv-payment-actions{
    gap:5px;
  }
  .inv-payment-action{
    font-size:.68rem;
  }
  .inv-discount-block{
    grid-template-columns:auto 76px minmax(88px,1fr);
    gap:6px;
  }
  .dmt-title{
    font-size:.84rem;
  }
  .dmt-growth{
    width:36px;
    height:36px;
  }
  .dash-target-fab{
    width:36px;
    height:36px;
  }
  .dash-target-fab svg{
    width:24px;
    height:24px;
  }
}
@media(max-width:768px){
  .dashboard-block-head .section-action{
    font-size:.7rem;
  }
}
@media(min-width:768px) and (max-width:900px){
  main{
    padding:20px 20px calc(88px + env(safe-area-inset-bottom,0px));
  }
  .cards{
    gap:12px;
  }
}
@media(min-width:901px){
  .bottom-nav{
    display:none!important;
  }
  main{
    padding:20px 20px 40px;
  }
  header h1{
    font-size:1.12rem;
  }
}

/* --------------------------------------------------------------------------
   21. PRINT / EXPORT (Protected)
   -------------------------------------------------------------------------- */
#printArea{
  position:fixed;
  left:-99999px;
  top:0;
  width:0;
  height:0;
  overflow:hidden;
}
.inv-doc{
  font-family:'Vazirmatn',Tahoma,sans-serif;
  color:#0070D2;
  direction:rtl;
  text-align:right;
  background:#fff;
  padding:12px 14px;
  box-sizing:border-box;
}
.inv-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:2px solid #0070D2;
  padding-bottom:10px;
  margin-bottom:12px;
}
.inv-logo img{
  max-height:64px;
  max-width:140px;
}
.inv-brand{
  flex:1;
  text-align:center;
}
.inv-brand-name{
  font-weight:800;
  font-size:1.05rem;
}
.inv-doc-title{
  font-weight:600;
  font-size:.95rem;
}
.inv-meta{
  font-size:.82rem;
  line-height:1.6;
}
.inv-customer{
  font-size:.88rem;
  line-height:1.7;
  margin-bottom:12px;
}
.inv-table{
  width:100%;
  border-collapse:collapse;
  font-size:.82rem;
  margin-bottom:12px;
}
.inv-table th,
.inv-table td{
  border:1px solid #E0E4E8;
  padding:6px 8px;
  text-align:center;
}
.inv-table th{
  background:#F0F2F5;
  font-weight:700;
}
.inv-totals{
  width:100%;
  border-collapse:collapse;
  font-size:.88rem;
  margin-top:4px;
}
.inv-totals td{
  padding:5px 8px;
  border-bottom:1px solid #E0E4E8;
}
.inv-totals .inv-final td{
  font-weight:800;
  border-bottom:2px solid #0070D2;
}
.inv-signatures{
  display:flex;
  justify-content:space-between;
  gap:24px;
  margin-top:28px;
}
.inv-signatures > div{
  flex:1;
  text-align:center;
}
.inv-sig-line{
  margin-top:36px;
  border-bottom:1px solid #0070D2;
}
@media print{
  body *{
    visibility:hidden!important;
  }
  #printArea,
  #printArea *{
    visibility:visible!important;
  }
  #printArea{
    display:block!important;
    position:absolute;
    left:0;
    top:0;
    width:100%;
    height:auto;
    overflow:visible;
    padding:8px;
    background:#fff;
  }
  .overlay,.sheet,header,nav,.fab,.toast,.bottom-nav,button.app-back,main,#ptr-indicator{
    display:none!important;
  }
  body{
    background:#fff!important;
  }
}

/* ============================================================================
   iOS 26 / LIQUID-GLASS INTERACTION POLISH — TEST ONLY
   Interaction layer only. Visual Grammar geometry remains the source of truth.
   Timing targets: ~120ms touch response, ~220-260ms navigation/presentation,
   ~360ms spring-like active-state settling.
   Tokens (--ios-ease-out, --ios-touch, --ios-glass, etc.) now live in
   css/visual-grammar.css :root, loaded before this file, so this file has
   exactly one place it reads them from instead of redefining them here.
   ============================================================================ */

/* Route changes (Navigation Motion Patch): restrained iOS-style horizontal
   push/pop. #main is the incoming layer; .route-ghost is a static snapshot
   of the outgoing page created by router.js, stacked above/below #main via
   z-index depending on direction. Both animate on transform only. */
main.route-push-enter,
main.route-pop-enter{
  will-change:transform;
  background-color:var(--vg-color-bg);
}
main.route-push-enter.route-anim-run,
main.route-pop-enter.route-anim-run{
  transition:transform var(--ios-route) var(--ios-route-ease);
}

html.vg-canvas-white main.route-push-enter,
html.vg-canvas-white main.route-pop-enter{
  background-color:var(--vg-color-bg-system);
}
main.route-push-enter{ transform:translateX(-100%); }
main.route-pop-enter{ transform:translateX(27%); }
main.route-push-enter.route-anim-run,
main.route-pop-enter.route-anim-run{ transform:translateX(0); }

.route-ghost{
  position:fixed;
  overflow:hidden;
  pointer-events:none;
  will-change:transform;
  transform:translateX(0);
  transition:transform var(--ios-route) var(--ios-route-ease);
  background:var(--vg-color-bg);
}
html[data-theme="dark"] .route-ghost{
  background:var(--vg-color-bg);
}
html[data-theme="dark"] .route-ghost.route-ghost-canvas-white{
  background:var(--vg-color-bg-system);
}
/* PUSH: outgoing page shifts subtly right in RTL. */
.route-ghost-under{ z-index:0; }
.route-ghost-under.route-anim-run{ transform:translateX(27%); }

/* POP: outgoing page slides fully off to the left. */
.route-ghost-over{ z-index:2; }
.route-ghost-over.route-anim-run{ transform:translateX(-100%); }
/* .bottom-nav / .bottom-nav-item stacking + material now live only in
   css/visual-grammar-components.css (single canonical definition). */

/* Buttons and capsules: immediate tactile response, then a slightly longer material settle. */
.btn{
  transition:transform var(--ios-touch) var(--ios-ease-out),
             box-shadow var(--ios-control) var(--ios-ease-out),
             background-color var(--ios-control) ease,
             border-color var(--ios-control) ease;
}
.btn:active{
  transform:scale(.975) translateY(1px);
}
.btn.secondary,
.chip,
.chip-opt,
.gc-seg-btn,
.tx-toolbar-select,
input[type="search"],
input[placeholder*="جستجو"]{
  background:var(--ios-glass);
  border-color:var(--ios-glass-border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.62),
             0 1px 3px rgba(26,38,52,.035);
  backdrop-filter:saturate(150%) blur(12px);
  -webkit-backdrop-filter:saturate(150%) blur(12px);
}
.chip,
.chip-opt,
.gc-seg-btn{
  transition:transform var(--ios-touch) var(--ios-ease-out),
             background-color var(--ios-control) ease,
             border-color var(--ios-control) ease,
             color var(--ios-control) ease,
             box-shadow var(--ios-control) var(--ios-ease-out);
}
.chip:active,
.chip-opt:active,
.gc-seg-btn:active{
  transform:scale(.975);
}

/* Search controls: focused but not over-decorated. */
input[type="search"],
input[placeholder*="جستجو"]{
  transition:transform var(--ios-touch) var(--ios-ease-out),
             border-color var(--ios-control) ease,
             box-shadow var(--ios-control) var(--ios-ease-out),
             background-color var(--ios-control) ease;
}
input[type="search"]:focus,
input[placeholder*="جستجو"]:focus{
  border-color:rgba(0,112,210,.34);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72),
             0 0 0 3px rgba(0,112,210,.075),
             0 4px 14px rgba(0,112,210,.045);
}

/* Icon controls and floating action button get the same native-feeling tap response. */
.close-x,
.icon-btn,
.icon-button,
.fab,
button.app-back,
.prospect-daily-target .pdt-edit{
  transition:transform var(--ios-touch) var(--ios-ease-out),
             background-color var(--ios-control) ease,
             box-shadow var(--ios-control) var(--ios-ease-out),
             opacity var(--ios-touch) ease;
}
.close-x:active,
.icon-btn:active,
.icon-button:active,
.fab:active,
button.app-back:active,
.prospect-daily-target .pdt-edit:active{
  transform:scale(.95);
}

/* Only interactive cards/list rows lift on touch; static cards remain calm. */
a.card:active,
button.card:active,
[role="button"].card:active,
a.tx-row:active,
a.ledger-row:active,
.customer-list-row:active,
.gc-mission:active{
  transform:scale(.992);
  box-shadow:0 5px 16px rgba(26,38,52,.065);
  transition:transform var(--ios-touch) var(--ios-ease-out),
             box-shadow var(--ios-control) var(--ios-ease-out),
             background-color var(--ios-touch) ease;
}

/* More sheet / modal presentation: same short spring family as native sheets. */
.more-overlay{
  transition:opacity 220ms var(--ios-ease-out);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
}
.more-sheet{
  transition:transform 270ms var(--ios-ease-spring),
             box-shadow 220ms var(--ios-ease-out);
  background:rgba(255,255,255,.88);
  backdrop-filter:saturate(170%) blur(22px);
  -webkit-backdrop-filter:saturate(170%) blur(22px);
  box-shadow:0 -12px 34px rgba(31,41,55,.12),
             inset 0 1px 0 rgba(255,255,255,.7);
}
.more-sheet-item{
  transition:transform var(--ios-touch) var(--ios-ease-out),
             background-color var(--ios-control) ease,
             border-color var(--ios-control) ease,
             box-shadow var(--ios-control) var(--ios-ease-out);
}
.more-sheet-item:active{
  transform:scale(.985);
  background:rgba(247,248,250,.9);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}

/* Generic bottom sheet (openSheet()/closeModal() in js/ui.js) — brought up to
   the same native presentation as the More sheet: starts translated off-
   screen + transparent, animates in via .show, real glass material, and a
   drag handle wired to the shared bindSheetDragToDismiss() gesture.
   Excluded for .inv-sheet-host, which is a full-screen page host, not a
   card sheet (see the .sheet-handle display:none rule near its block). */
.overlay:not(.more-overlay){
  opacity:0;
  transition:opacity 270ms var(--ios-ease-out);
}
.overlay.show{
  opacity:1;
}
.sheet:not(.inv-sheet-host){
  transform:translateY(110%);
  transition:transform 270ms var(--ios-ease-spring),
             box-shadow 220ms var(--ios-ease-out);
  background:rgba(255,255,255,.9);
  backdrop-filter:saturate(170%) blur(22px);
  -webkit-backdrop-filter:saturate(170%) blur(22px);
  box-shadow:0 -12px 34px rgba(31,41,55,.12),
             inset 0 1px 0 rgba(255,255,255,.7);
}
.sheet.show{
  transform:translateY(0);
}
.sheet-handle{
  width:40px;
  height:4px;
  border-radius:999px;
  background:rgba(31,41,55,.12);
  margin:4px auto 8px;
  flex:none;
}
.sheet .close-x{
  position:absolute;
  top:10px;
  inset-inline-end:10px;
}

/* Dashboard quick actions: glass surface only — do not enlarge cards/icons. */
.dash-qa-btn{
  transition:transform var(--ios-touch) var(--ios-ease-out),
             box-shadow var(--ios-control) var(--ios-ease-out),
             background-color var(--ios-control) ease;
  background:rgba(255,255,255,.74);
  border:1px solid rgba(255,255,255,.62);
  backdrop-filter:saturate(165%) blur(14px);
  -webkit-backdrop-filter:saturate(165%) blur(14px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7),
             0 3px 12px rgba(26,38,52,.055);
}
.dash-qa-btn:active{
  transform:scale(.965) translateY(1px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55),
             0 1px 5px rgba(26,38,52,.06);
}
.dash-qa-ico{
  background:transparent;
}

/* Cards: slightly more elevated, without turning the content layer into glass. */
.card,
.report-summary-card,
.gc-panel,
.prospect-result-card{
  box-shadow:var(--vg-shadow-group);
}

/* Respect reduced-motion users; iOS does the same for motion-sensitive settings.
   router.js already skips the whole push/pop mechanism when this is set —
   this is a defense-in-depth fallback in case a class is ever applied anyway. */
@media (prefers-reduced-motion:reduce){
  main.route-push-enter,
  main.route-pop-enter,
  .route-ghost{
    transition:none!important;
    transform:none!important;
  }
}

/* ==========================================================================
   FINAL UI/UX PATCH (Issues 1–24 + Jelly) — minimal, composition-only
   ========================================================================== */

/* 1 — Customers: identity group + financial group (see composition block) */

/* 2 — Products: reduce visual weight of total value */
.product-row-value .tx-row-total{
  font-size:.88rem;
  font-weight:var(--vg-weight-value);
  color:var(--vg-color-text);
}
.product-row-value .product-row-label{
  font-size:var(--vg-type-meta);
  font-weight:var(--vg-weight-label);
}

/* 3 — Product detail profit % readability */
.product-profit-pct{
  padding:0;
  margin:0 0 10px;
  font-size:.88rem;
  font-weight:600;
  color:#1F2937;
  text-align:right;
  background:rgba(0,112,210,.06);
  border-radius:10px;
}

/* 4 — Price history spacing */
.product-price-history .ledger-row{
  padding:8px 2px;
  min-height:40px;
  align-items:flex-start;
  gap:8px;
}
.product-price-history .ledger-row .amount{
  font-size:.78rem;
  font-weight:500;
  white-space:normal;
  text-align:left;
  line-height:1.4;
  max-width:62%;
}

/* 6 — Inventory summary hierarchy: value card slightly quieter */
#main .cards .card .value{
  font-weight:600;
}
.inv-summary-quiet .value{
  font-size:.95rem;
  font-weight:600;
  color:#4B5563;
}

/* 7 — Supplier payment delete: smaller, less aggressive */
.tx-list .btn.danger.small.tx-status-btn,
.tx-row .btn.danger.small[data-sup-pay-del]{
  min-height:32px;
  padding:4px 8px;
  font-size:.72rem;
  border-radius:8px;
}

/* 8 — Return purchase qty inputs */
.ret-item-qty{
  min-height:40px;
  padding:8px 10px;
  font-size:.9rem;
}

/* 9 — Visits primaryCtx single-line clamp */
.tx-row-ctx{
  display:block;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.35;
}

/* 10 — Visit product compact grid */
.visit-product-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(108px, 1fr));
  gap:6px;
}
.visit-product-grid .chip-opt{
  width:100%;
  min-height:40px;
  padding:8px 6px;
  font-size:.78rem;
  font-weight:600;
  text-align:center;
  line-height:1.25;
  border-radius:10px;
  white-space:normal;
  word-break:break-word;
}

/* 11 — Evaluation answer chips compact */
.eval-q-options .eval-q-opt,
.chip-wrap.eval-q-options .chip-opt,
.eval-q-opt{
  min-height:40px;
  padding:8px 12px;
  font-size:.84rem;
  border-radius:10px;
}
.eval-q-options{
  gap:8px;
  margin-top:4px;
}
.eval-back-row{
  margin-top:14px;
  padding-top:2px;
}

/* 12 — Prospect score less dominant */
.field-score-row{
  display:flex;
  align-items:baseline;
  gap:8px;
  margin-top:8px;
}
.field-score-value{
  font-size:1.35rem;
  font-weight:700;
  color:#1F2937;
  letter-spacing:-.3px;
  line-height:1.2;
}
.field-score-meta{
  font-size:.78rem;
  font-weight:500;
  color:#667085;
}

/* 13–16 — Monthly target: layering, light surface, spacing, bar */
.dash-target-block{
  position:relative;
  z-index:1;
}
.dash-target-fab-row{
  z-index:3;
}
.dash-monthly-target{
  position:relative;
  z-index:1;
  background:rgba(255,255,255,.88);
  border:.5px solid rgba(60,60,67,.1);
  box-shadow:var(--vg-shadow-group);
}
.dmt-top{
  margin-bottom:6px;
}
.dmt-figures{
  margin:0 0 8px;
  line-height:1.35;
}
.dmt-row{
  gap:10px;
  margin-top:2px;
}
.dmt-progress{
  position:relative;
  z-index:0;
}
.dmt-bar{
  height:6px;
  border-radius:999px;
  background:rgba(60,60,67,.1);
  overflow:hidden;
}
.dmt-bar>span{
  display:block;
  height:100%;
  border-radius:999px;
  background:#FF5C35;
  min-width:0;
}
.dmt-pct{
  font-size:1rem;
  font-weight:700;
  min-width:2.2em;
}
.dmt-status-row{
  margin-top:8px;
  gap:6px;
}

/* 17–18 — Reports notes + profit hierarchy */
.report-note{
  font-size:.72rem;
  line-height:1.45;
  color:#667085;
  margin-top:6px;
}
.report-profit-primary .value{
  font-size:1.12rem;
  font-weight:700;
}
.report-profit-secondary .value{
  font-size:.95rem;
  font-weight:600;
  color:#4B5563;
}
.report-profit-secondary .label{
  font-weight:500;
}

/* 19 — Settings warn lighter */
.settings-warn{
  padding:8px 10px;
  font-size:.76rem;
  line-height:1.5;
  color:#9A5B00;
  background:rgba(245,161,49,.08);
  border:1px solid rgba(245,161,49,.18);
  border-radius:8px;
}

/* 20 — File input alignment */
#import-file,
input[type="file"]#import-file{
  display:block;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  padding:10px 12px;
  min-height:44px;
  font-family:inherit;
  font-size:.84rem;
  color:#1F2937;
  background:#F8FAFC;
  border:1px solid rgba(31,41,55,.1);
  border-radius:12px;
}

/* 21 — save-tx as standard primary button (not FAB) */
#save-tx.btn,
button#save-tx{
  width:100%;
  min-height:48px;
  border-radius:12px;
  font-size:.95rem;
  font-weight:600;
}

/* Evaluation V2 — optional follow-up date: keep native iOS date picker, replace only the empty-state placeholder visually. */
.ff-date-field {
  position: relative;
  min-height: 44px;
}

.ff-date-field .shamsi-date{
  width:100%;
}
.ff-date-field .shamsi-date-field{
  width:100%;
  min-height:44px;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:10px 12px;
  font:inherit;
  color:#1F2937;
  background:#F8FAFC;
  border:1px solid rgba(31,41,55,.1);
  border-radius:12px;
  text-align:right;
}
.ff-date-field.is-empty .shamsi-date-field{
  color:var(--vg-color-text-muted);
}

/* ==========================================================================
   PROSPECT EVALUATION V2 — scoped additions (Profile step, incomplete
   state, Unknown option, Snapshot/Visit-History detail). Reuses existing
   .card/.btn/.chip-opt/.field/.rank-pill grammar wherever possible; only
   adds what those components genuinely don't cover.
   ========================================================================== */
.eval-step-label{
  font-weight:600;
  font-size:.88rem;
  color:#0070D2;
  margin-bottom:8px;
}
.eval-progress-bar{
  height:4px;
  border-radius:4px;
  background:rgba(31,41,55,.08);
  overflow:hidden;
  margin-bottom:14px;
}
.eval-progress-fill{
  height:100%;
  background:var(--vg-color-primary);
  border-radius:4px;
  transition:width .18s ease;
}
.eval-profile-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:6px;
}
.eval-profile-card{
  min-height:64px;
  padding:14px 10px;
  border-radius:14px;
  background:var(--vg-color-surface);
  border:1px solid var(--vg-color-border);
  color:var(--vg-color-text);
  font-weight:600;
  font-size:.9rem;
  cursor:pointer;
  transition:background .15s,border-color .15s,color .15s,transform .1s;
}
.eval-profile-card:active{
  transform:scale(.98);
}
.eval-profile-card.selected{
  background:var(--vg-color-primary);
  border-color:var(--vg-color-primary);
  color:#fff;
}
.eval-q-hint{
  margin:-2px 0 10px;
  font-size:.74rem;
  line-height:1.5;
}
/* Unknown must read as a normal, first-class option — not an error state
   (spec §21). A quieter dashed border is enough to set it apart. */
.eval-q-opt-unknown{
  border-style:dashed;
}
.eval-incomplete-note{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(31,41,55,.04);
  border:1px solid rgba(31,41,55,.08);
}
.eval-incomplete-title{
  font-weight:600;
  font-size:.86rem;
  color:#4B5563;
  margin-bottom:2px;
}
/* Incomplete rank badge: calm and muted, not alarming (spec §24-§25) —
   deliberately NOT reusing rank-pill-D's tone since it isn't a negative
   rank, it's an absence of enough data to rank at all. */
.rank-pill-incomplete{
  background:rgba(31,41,55,.08);
  color:#4B5563;
}
.snapshot-meta-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:8px 0 2px;
}
.visit-edit-note,
.visit-next-note,
.visit-note-text{
  display:block;
  color:var(--vg-color-text-muted);
}
.eval-summary-identity-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.answer-row-editable{
  cursor:pointer;
}
.answer-edit-hint{
  color:var(--vg-color-primary);
  font-size:.72rem;
  margin-inline-start:6px;
}
.snapshot-edit-option.selected{
  background:rgba(0,112,210,.08);
  border-color:rgba(0,112,210,.24);
  color:#1F2937;
}

/* In-app confirmation layer; sits above an existing sheet without replacing it. */
.confirm-overlay{
  position:fixed;
  inset:0;
  z-index:120;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(11,31,58,.42);
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
}
.confirm-card{
  width:min(100%,420px);
  box-sizing:border-box;
  padding:18px;
  border-radius:18px;
  background:rgba(255,255,255,.96);
  box-shadow:0 12px 32px rgba(31,41,55,.18);
}
.confirm-message{
  white-space:pre-wrap;
  line-height:1.7;
  color:var(--vg-color-text);
  margin-bottom:14px;
}


/* ============================================================
   DARK MODE ELEVATED OVERLAYS / FLOATING ACTION
   Scoped to Dark Mode only. Ordinary cards are flattened above;
   overlays and FAB retain elevation where it communicates depth.
   ============================================================ */
html[data-theme="dark"] .confirm-overlay {
  background: rgba(0,0,0,.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
html[data-theme="dark"] .confirm-card {
  background: var(--vg-color-surface);
  box-shadow: var(--vg-shadow-overlay);
}
html[data-theme="dark"] .confirm-message {
  color: var(--vg-color-text);
}
html[data-theme="dark"] .fab {
  background: #007A50;
}

/* --------------------------------------------------------------------------
   Input clear (×) button — iOS-style, shared floating control (see ui.js)
   -------------------------------------------------------------------------- */
.input-clear-btn{
  position:fixed;
  z-index:100000;
  width:30px;
  height:30px;
  margin:0;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  direction:ltr;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  -webkit-user-select:none;
  user-select:none;
}
.input-clear-btn[hidden]{display:none}
.input-clear-btn svg{width:18px;height:18px;display:block;pointer-events:none}
input.has-input-clear{padding-inline-end:34px !important}
/* narrow fields (invoice quantity, 74-76px): 22px button + 3px gap. Content
   box stays >= 41px (74px at <=360) so a 5-digit quantity (~40px) never touches the button. */
input.has-input-clear.has-input-clear-sm{padding-inline-end:26px !important}
@media print{.input-clear-btn{display:none !important}}

/* ============================================================
   Visit form — customer product list (محصولات این مشتری)
   Touch-first: 52–56px targets, 12px gaps, destructive/back actions
   visually separated. Uses vg tokens only (light + dark).
   ============================================================ */
.visit-card .vp-head{margin:0 0 14px;}
.visit-card .vp-head .q-title{margin:0 0 4px;}
.visit-card .vp-sub{font-size:.74rem;line-height:1.6;color:var(--vg-color-text-muted);}
.visit-card .vp-rows{display:flex;flex-direction:column;gap:10px;margin:0 0 14px;}
.visit-card .vp-row{display:flex;align-items:stretch;gap:12px;}
.visit-card .vp-row-main{
  flex:1 1 auto;min-width:0;min-height:56px;
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;
  padding:10px 14px;margin:0;
  background:var(--vg-color-surface);
  border:1px solid var(--vg-color-border);
  border-radius:var(--vg-radius-soft);
  color:var(--vg-color-text);
  font:inherit;text-align:start;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:background .15s,border-color .15s;
}
.visit-card .vp-row-main:active{background:var(--vg-color-surface-soft);}
.visit-card .vp-row.is-done .vp-row-main{background:var(--vg-color-surface-soft);}
.visit-card .vp-row-name{font-size:.9rem;font-weight:var(--vg-weight-title);line-height:1.45;word-break:break-word;}
.visit-card .vp-row-meta{font-size:.7rem;line-height:1.5;color:var(--vg-color-text-muted);}
.visit-card .vp-purchase-cycle{display:inline-flex;align-items:center;gap:5px;max-width:100%;white-space:nowrap;padding:2px 8px;border-radius:var(--vg-radius-pill);font-size:.7rem;line-height:1.55;font-weight:var(--vg-weight-title);}
.visit-card .vp-purchase-dot{width:5px;height:5px;border-radius:50%;background:currentColor;flex:none;}
.visit-card .vp-purchase-cycle.is-muted{background:var(--vg-color-surface-soft);color:var(--vg-color-text-muted);}
.visit-card .vp-purchase-cycle.is-primary{background:var(--vg-color-primary-soft);color:var(--vg-color-primary);}
.visit-card .vp-purchase-cycle.is-warning{background:var(--vg-color-warning-soft);color:var(--vg-color-warning);}
.visit-card .vp-purchase-cycle.is-danger{background:var(--vg-color-danger-soft);color:var(--vg-color-danger);}
.visit-card .vp-purchase-cycle.is-success{background:var(--vg-color-success-soft);color:var(--vg-color-success);}
.visit-card .vp-row-main.has-cycle{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;}
.visit-card .vp-row-main.has-cycle .vp-row-name{min-width:0;flex:0 1 auto;}
.visit-card .vp-row-main.has-cycle .vp-purchase-cycle{flex:0 0 auto;}
.visit-card .vp-row-main.has-cycle .vp-row-meta{flex:1 0 100%;}

.visit-card .vp-status{
  display:inline-block;padding:2px 10px;border-radius:var(--vg-radius-pill);
  font-size:.72rem;font-weight:var(--vg-weight-title);line-height:1.6;
}
.visit-card .vp-status.is-success{background:var(--vg-color-success-soft);color:var(--vg-color-success);}
.visit-card .vp-status.is-warning{background:var(--vg-color-warning-soft);color:var(--vg-color-warning);}
.visit-card .vp-status.is-danger{background:var(--vg-color-danger-soft);color:var(--vg-color-danger);}
.visit-card .vp-row-del{
  flex:0 0 auto;min-width:64px;min-height:56px;padding:0 14px;margin:0;
  background:transparent;border:1px solid var(--vg-color-border);
  border-radius:var(--vg-radius-soft);
  color:var(--vg-color-danger);font:inherit;font-size:.78rem;font-weight:var(--vg-weight-title);
  cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.visit-card .vp-row-del:active{background:var(--vg-color-danger-soft);}
.visit-card .vp-count{margin:0 0 10px;font-size:.72rem;color:var(--vg-color-text-muted);}
.visit-card .vp-empty{
  margin:0 0 14px;padding:16px 14px;text-align:center;
  font-size:.8rem;line-height:1.7;color:var(--vg-color-text-muted);
  background:var(--vg-color-surface-soft);border-radius:var(--vg-radius-soft);
}
.visit-card .vp-add{
  display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:52px;margin:0;padding:0 14px;
  background:var(--vg-color-primary-soft);
  border:1px dashed var(--vg-color-primary);
  border-radius:var(--vg-radius-soft);
  color:var(--vg-color-primary);font:inherit;font-size:.88rem;font-weight:var(--vg-weight-title);
  cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.visit-card .vp-opts{display:grid;gap:12px;margin:0;}
.visit-card .vp-opts.is-2col{grid-template-columns:1fr 1fr;}
.visit-card .chip-opt.vp-opt{
  width:100%;min-height:52px;padding:10px 12px;margin:0;
  border-radius:var(--vg-radius-soft);
  font-size:.88rem;font-weight:var(--vg-weight-title);line-height:1.4;text-align:center;
  white-space:normal;word-break:break-word;
  -webkit-tap-highlight-color:transparent;
}
.visit-card .vp-footer{
  margin-top:22px;padding-top:12px;
  border-top:1px solid var(--vg-color-divider);
  display:flex;justify-content:flex-start;
}
.visit-card .vp-back{
  min-height:46px;min-width:96px;padding:0 18px;margin:0;
  background:transparent;border:0;border-radius:var(--vg-radius-soft);
  color:var(--vg-color-text-secondary);font:inherit;font-size:.84rem;font-weight:var(--vg-weight-title);
  cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.visit-card .vp-back:active{background:var(--vg-color-surface-soft);}

/* ============================================================
   Expandable row details (supplier purchase items / visit offers)
   <details class="row-details"> inside a ledger row. Tokens only.
   ============================================================ */
.ledger-row.has-row-details{align-items:flex-start;}
/* the name column takes the free width so the expanded list uses the whole row */
.ledger-row.has-row-details > .name{flex:1 1 0;min-width:0;}
.ledger-row.has-row-details > .filler{flex:0 0 0;min-width:0;}
/* Rows whose details is a direct child (supplier purchases): the title/amount stay on
   the first line and the details takes its own full-width line below. */
.ledger-row.row-details-wrap{flex-wrap:wrap;}
.ledger-row.row-details-wrap > .row-details{flex:0 0 100%;order:9;margin-top:0;}
.row-details{align-self:stretch;width:100%;margin:2px 0 0;padding:0;font-weight:var(--vg-weight-regular);}
.row-details > summary{
  list-style:none;display:flex;align-items:center;min-height:36px;padding:4px 0;
  color:var(--vg-color-primary);font-size:.78rem;font-weight:var(--vg-weight-title);
  cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.row-details > summary::-webkit-details-marker{display:none;}
.row-details > summary::before{
  content:'';display:inline-block;flex:none;width:7px;height:7px;margin-inline-end:8px;
  border-inline-start:1.5px solid currentColor;border-block-end:1.5px solid currentColor;
  transform:rotate(45deg) translateY(-1px);
  transition:transform .15s ease;
}
.row-details[open] > summary::before{transform:rotate(135deg) translate(-1px,-1px);}
.row-details-list{display:flex;flex-direction:column;margin:2px 0 4px;}
.row-details-item{
  display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:2px;
  align-items:baseline;padding:8px 0;
  border-top:1px solid var(--vg-color-divider);
}
.row-details-item > .row-details-name,
.row-details-item > .row-details-meta{grid-column:1;}
.row-details-item > .row-details-name:only-child,
.row-details-item > .row-details-meta:last-child:not(:nth-child(2)){grid-column:1 / -1;}
.row-details-total{
  grid-column:2;grid-row:1;
  font-size:.82rem;font-weight:var(--vg-weight-value);color:var(--vg-color-text);
  font-variant-numeric:tabular-nums;white-space:nowrap;
}
.row-details-name{
  font-size:.84rem;font-weight:var(--vg-weight-title);line-height:1.45;
  color:var(--vg-color-text);white-space:normal;overflow-wrap:anywhere;
}
.row-details-meta{
  font-size:.72rem;font-weight:var(--vg-weight-regular);line-height:1.5;
  color:var(--vg-color-text-muted);white-space:normal;overflow-wrap:anywhere;
}
@media (prefers-reduced-motion:reduce){
  .row-details > summary::before{transition:none;}
}
/* Visits rows are <div data-visit-customer> (so a <details> can live inside);
   keep the same disclosure chevron and pressed state as navigating <a> rows. */
.ledger-row[data-visit-customer]::after{
  content:'';flex:none;width:14px;height:14px;margin-inline-start:2px;opacity:.38;
  background-color:currentColor;align-self:center;
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  -webkit-mask-size:contain;mask-size:contain;
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:center;mask-position:center;
}
.ledger-row[data-visit-customer]:active{background:var(--vg-color-surface-soft);border-radius:10px;}
.ledger-row[data-visit-customer]:focus-visible{outline:2px solid var(--vg-color-primary);outline-offset:-2px;border-radius:10px;}
