/* داشبورد مدیریت — بدون هیچ منبع بیرونی.
   رنگ‌ها از پوستهٔ تلگرام خوانده می‌شوند (اگر داده شده باشد) وگرنه از
   تنظیم روشن/تاریک خود دستگاه. هیچ فونت یا اسکریپتی از اینترنت گرفته
   نمی‌شود تا زیر فیلترینگ هم بی‌نقص باز شود. */

:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #12141a;
  --muted: #6d7480;
  --line: #e4e6eb;
  --accent: #2f6fed;
  --accent-soft: #e8effd;
  --ok: #16a34a;
  --ok-soft: #e4f6ea;
  --warn: #d97706;
  --warn-soft: #fdf0dc;
  --bad: #dc2626;
  --bad-soft: #fdeaea;
  --shadow: 0 1px 2px rgba(16, 20, 30, .06), 0 8px 24px rgba(16, 20, 30, .05);
  --radius: 16px;
  --tab-h: 62px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116;
    --surface: #1a1d24;
    --surface-2: #22262f;
    --text: #eef0f4;
    --muted: #8f97a4;
    --line: #2b303a;
    --accent: #6d9bff;
    --accent-soft: #1d2740;
    --ok: #4ade80;
    --ok-soft: #16281d;
    --warn: #fbbf24;
    --warn-soft: #2c2312;
    --bad: #f87171;
    --bad-soft: #2e1a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

/* وقتی تلگرام پوسته‌اش را داده باشد، همان حاکم است. */
html[data-theme="dark"] {
  --bg: #0f1116;
  --surface: #1a1d24;
  --surface-2: #22262f;
  --text: #eef0f4;
  --muted: #8f97a4;
  --line: #2b303a;
  --accent: #6d9bff;
  --accent-soft: #1d2740;
  --ok: #4ade80;
  --ok-soft: #16281d;
  --warn: #fbbf24;
  --warn-soft: #2c2312;
  --bad: #f87171;
  --bad-soft: #2e1a1a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

html[data-theme="light"] {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #12141a;
  --muted: #6d7480;
  --line: #e4e6eb;
  --accent: #2f6fed;
  --accent-soft: #e8effd;
  --ok: #16a34a;
  --ok-soft: #e4f6ea;
  --warn: #d97706;
  --warn-soft: #fdf0dc;
  --bad: #dc2626;
  --bad-soft: #fdeaea;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Vazirmatn, "IRANSans", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ------------------------------------------------------------ اسکلت --- */

#shell { min-height: 100%; display: flex; flex-direction: column; }

#topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

#topbar .titles { flex: 1; min-width: 0; }
#title { font-size: 17px; font-weight: 700; line-height: 1.4; }
#subtitle { font-size: 12px; line-height: 1.4; }

.icon-btn {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  font-size: 16px;
  transition: transform .12s ease, background .12s ease;
}
.icon-btn:active { transform: scale(.92); background: var(--surface-2); }
.icon-btn[hidden] { display: none; }

.chev { width: 9px; height: 9px; border-top: 2px solid currentColor;
        border-left: 2px solid currentColor; transform: rotate(135deg); margin-left: 3px; }

#view {
  flex: 1;
  padding: 14px 14px calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* [hidden] از استایل پیش‌فرض مرورگر ضعیف‌تر از این قاعده است، پس بدون
   این خط، مخفی کردن نوار تب اثری ندارد و تیم دکمه‌های مدیر را می‌بیند. */
#tabs[hidden] { display: none; }

#tabs {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  /* تعداد تب‌ها ثابت نیست؛ ستون‌ها خودشان تقسیم می‌شوند تا با اضافه شدن
     یک تب تازه، نوار به خط دوم نیفتد و روی محتوا نیاید. */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1px;
  padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 1px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  min-width: 0;
  white-space: nowrap;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.tab .ico { font-size: 17px; line-height: 1.25; }
.tab > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab.on { color: var(--accent); background: var(--accent-soft); }
.tab:active { transform: scale(.95); }

/* ------------------------------------------------------------- کارت --- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card.pad0 { padding: 0; overflow: hidden; }

.card-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.card-title h2 { margin: 0; font-size: 14px; font-weight: 700; }
.card-title .muted { font-size: 12px; }

.section-title {
  margin: 20px 2px 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.section-title:first-child { margin-top: 2px; }

.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- عددهای بالا --- */

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  box-shadow: var(--shadow);
}
.kpi .k-label { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.kpi .k-value { font-size: 22px; font-weight: 800; letter-spacing: -.4px; line-height: 1.35; }
.kpi .k-foot { font-size: 11px; color: var(--muted); line-height: 1.4; }
.kpi.accent { background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #7c3aed)); border-color: transparent; }
.kpi.accent .k-label, .kpi.accent .k-foot { color: rgba(255,255,255,.8); }
.kpi.accent .k-value { color: #fff; }

/* -------------------------------------------------------------- سطر --- */

.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .label { font-size: 13px; color: var(--muted); }
.row .value { font-weight: 600; font-variant-numeric: tabular-nums; }

.item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: right;
  padding: 11px 14px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.item:last-child { border-bottom: 0; }
.item:active { background: var(--surface-2); }
.item .grow { flex: 1; min-width: 0; }
.item .t1 { font-weight: 650; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item .t2 { font-size: 12px; color: var(--muted); }
.item .end { text-align: left; flex: none; }
.item .end .e1 { font-weight: 700; font-variant-numeric: tabular-nums; }
.item .end .e2 { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .arrow { flex: none; color: var(--muted); font-size: 15px; opacity: .55; }

.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.avatar.off { background: var(--surface-2); color: var(--muted); }

/* ------------------------------------------------------------- نشان --- */

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 650; line-height: 1.75;
  background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.chip.ok   { background: var(--ok-soft);   color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad  { background: var(--bad-soft);  color: var(--bad); }
.chip.info { background: var(--accent-soft); color: var(--accent); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ------------------------------------------------------------- دکمه --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px; font-weight: 650;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.ok      { background: var(--ok);     border-color: transparent; color: #fff; }
.btn.bad     { background: var(--bad);    border-color: transparent; color: #fff; }
.btn.ghost   { background: transparent; }
.btn.sm      { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn.block   { width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row.split > * { flex: 1; }

/* برچسب روزِ برد رزرو: «سه‌شنبه 4 مرداد»، کنار دکمه‌های پیمایش. */
.board-nav { align-items: center; }
.board-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-inline-end: auto; /* دکمه‌ها کنار هم، تاریخ آن سرِ ردیف */
  white-space: nowrap;
}
.board-date.today { color: var(--accent); }

/* ------------------------------------------------------------- فرم --- */

.field { margin-bottom: 11px; }
.field > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s ease;
}
.input:focus { border-color: var(--accent); }
.input.ltr { direction: ltr; text-align: left; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
textarea.input { min-height: 74px; resize: vertical; line-height: 1.7; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg .btn.on { background: var(--accent); border-color: transparent; color: #fff; }

/* --------------------------------------------------- فیلد قابل کپی --- */

.copy-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.copy-row:last-child { border-bottom: 0; }
.copy-row .cr-label { flex: none; width: 78px; font-size: 12px; color: var(--muted); }
.copy-row .cr-value {
  flex: 1; min-width: 0;
  direction: ltr; text-align: left;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.copy-row .cr-value.fa { direction: rtl; text-align: right; font-family: inherit; font-size: 14px; }
.copy-row .cr-btn {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; font-size: 13px; cursor: pointer;
}
.copy-row .cr-btn:active { transform: scale(.9); }
.copy-row .cr-btn.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* ------------------------------------------------------------ نمودار --- */

.chart { display: flex; align-items: flex-end; gap: 6px; height: 108px; padding-top: 6px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.chart .bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.chart .bar {
  width: 100%; border-radius: 7px 7px 3px 3px;
  background: var(--accent); opacity: .85; min-height: 3px;
  transition: height .35s cubic-bezier(.2,.8,.2,1);
}
.chart .col.today .bar { opacity: 1; box-shadow: 0 0 0 2px var(--accent-soft); }
.chart .col.future .bar { background: var(--line); }
.chart .cap { font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart .val { font-size: 10px; font-variant-numeric: tabular-nums; color: var(--muted); }

.split-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 4px 0 8px; }
.split-bar > i { display: block; height: 100%; }

/* ------------------------------------------------------- برد رزرو --- */

.board-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.board-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  /* کل شبانه‌روز ۴۸ ردیف است؛ داخل یک قاب می‌ماند تا صفحه بلند نشود
     و خودش روی ساعت جاری می‌ایستد. */
  max-height: 62vh;
}
.board { min-width: 100%; }

.board-head, .board-line {
  display: grid;
  grid-template-columns: 54px repeat(var(--cols), minmax(84px, 1fr));
}
.board-head {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.board-head > div {
  padding: 7px 4px; font-size: 11.5px; font-weight: 700; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-inline-start: 1px solid var(--line);
}
.board-head > div:first-child { border-inline-start: 0; position: sticky; inset-inline-start: 0; background: var(--surface-2); z-index: 6; }

.board-line { border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.board-line.hour { border-bottom-color: var(--line); }
.board-line.now { background: color-mix(in srgb, var(--accent) 8%, transparent); }

.board-time {
  position: sticky; inset-inline-start: 0; z-index: 3;
  background: var(--surface);
  padding: 0 4px;
  font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  border-inline-end: 1px solid var(--line);
}
.board-line.hour .board-time { color: var(--text); font-weight: 700; }
.board-line.now .board-time { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }

.cell {
  height: 30px;
  border: 0; border-inline-start: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background: transparent;
  font-size: 11px; font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}
.cell:active { opacity: .6; }
.cell.taken { background: var(--accent-soft); color: var(--accent); }
.cell.taken.run-top { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.cell.closed { background: repeating-linear-gradient(135deg, transparent, transparent 5px, color-mix(in srgb, var(--line) 45%, transparent) 5px, color-mix(in srgb, var(--line) 45%, transparent) 10px); }
.cell.mid { color: transparent; }

/* دو ستون: فهرستِ اکانت‌ها (راست) + بردِ همان اکانت (چپ). اولین فرزند در
   راست‌به‌چپ سمتِ راست می‌نشیند. */
.board-md {
  display: grid;
  grid-template-columns: clamp(128px, 32%, 220px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.acc-list {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  overflow: auto; -webkit-overflow-scrolling: touch;
  max-height: 62vh;
}
.acc-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px;
  border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--text);
  font: inherit; font-size: 13px; text-align: right;
  cursor: pointer;
}
.acc-item:first-child { border-top: 0; }
.acc-item:active { opacity: .7; }
.acc-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
/* dir=auto: اسمِ لاتین چپ‌به‌راست می‌ماند و اگر جا نشد از *آخرش* بریده
   می‌شود، نه از اولش. */
.acc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.acc-hm { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.acc-item.on .acc-hm { color: var(--accent); }
.acc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.acc-dot.on { background: var(--ok); }
.acc-dot.full { background: var(--warn); }
.acc-dot.free { background: color-mix(in srgb, var(--muted) 55%, transparent); }
/* گوشی: ستونِ فهرست باریک است؛ ساعت زیرِ اسم می‌رود تا اسم جا شود. */
@media (max-width: 560px) {
  .acc-item { flex-wrap: wrap; row-gap: 2px; padding: 8px 10px; }
  .acc-name { flex-basis: calc(100% - 16px); }
  .acc-hm { margin-inline-start: 16px; font-size: 11px; }
}
.board-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 10px; padding: 0 4px;
  font-size: 12px; color: var(--muted);
}
.board-legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------- شیت --- */

#sheet-host {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6, 8, 14, .5);
  animation: fade .18s ease;
}
#sheet-host[hidden] { display: none; }
@keyframes fade { from { opacity: 0 } }

.sheet {
  width: 100%; max-width: 620px;
  max-height: 88vh; overflow-y: auto;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 18px);
  animation: rise .24s cubic-bezier(.2,.9,.25,1);
}
@keyframes rise { from { transform: translateY(24px); opacity: .6 } }

.sheet .grab {
  display: block; width: 38px; height: 4px; border-radius: 999px;
  background: var(--line); border: 0; padding: 0;
  margin: 4px auto 10px; cursor: pointer;
}
.sheet-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.sheet h3 { margin: 0 0 3px; font-size: 16px; font-weight: 700; }
.sheet .sub { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ------------------------------------------------------------ وضعیت --- */

.state { text-align: center; padding: 56px 18px; color: var(--muted); }
.state h2 { color: var(--text); font-size: 16px; margin: 0 0 6px; }
.state.error h2 { color: var(--bad); }

.empty { text-align: center; padding: 26px 12px; color: var(--muted); font-size: 13px; }

.spinner {
  width: 26px; height: 26px; margin: 0 auto 12px;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

#toast-host {
  position: fixed; inset-inline: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
}
.toast {
  max-width: 88%;
  padding: 9px 16px; border-radius: 999px;
  background: #1c1f27; color: #fff;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 22px rgba(0,0,0,.28);
  animation: toast-in .2s ease;
}
.toast.bad { background: var(--bad); }
.toast.ok  { background: var(--ok); color: #06210f; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0 } }

.fade-in { animation: fade .2s ease; }

/* وقتی نوار تب نیست (نمای تیم)، فضای پایین صفحه لازم نیست. */
body.no-tabs #view { padding-bottom: 24px; }

/* ------------------------------------------------------ فاکتور هفتگی --- */

/* برگهٔ حساب‌کتابِ شرکا: سرِ رنگی با بازهٔ هفته، خط‌های حساب، و دو
   جعبهٔ سهم. عمداً شبیه یک فاکتورِ واقعی است، نه یک جدول دیگر — چیزی
   که بشود همان‌طور که هست فرستاد یا ازش عکس گرفت. */

.invoice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
}

.inv-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 13px 14px;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #7c3aed));
  color: #fff;
}
.inv-name { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
.inv-sub { font-size: 11.5px; opacity: .82; margin-top: 2px; }
.inv-when { font-size: 12px; line-height: 1.8; text-align: left; }
.inv-when .inv-greg { font-size: 11px; opacity: .8; }

.inv-lines { padding: 2px 14px; }
.inv-line {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.inv-line:last-child { border-bottom: 0; }
.inv-line .l { font-size: 13.5px; }
.inv-line .v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-line .v.plus { color: var(--ok); }
.inv-line .v.minus { color: var(--bad); }

/* خط‌های زیرمجموعه: تک‌تک هزینه‌ها، زیر جمعشان. */
.inv-line.sub { padding: 4px 0; border-bottom: 0; }
.inv-line.sub .l { font-size: 12.5px; color: var(--muted); padding-inline-start: 12px; }
.inv-line.sub .v { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.inv-total {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px;
  background: var(--surface-2);
  border-top: 2px solid var(--line);
}
.inv-total .l { font-weight: 700; }
.inv-total .v { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; }
.inv-total .v.neg { color: var(--bad); }

.inv-shares { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px; }
.share {
  border: 1px solid var(--line); border-radius: 13px;
  padding: 10px 11px; background: var(--surface);
}
.share.first { border-color: transparent; background: var(--accent-soft); }
.share .s-name {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.share .s-val { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.share.first .s-val { color: var(--accent); }

.inv-note {
  padding: 0 14px 13px;
  font-size: 12.5px; color: var(--muted); line-height: 1.8;
}

/* فرمِ هزینه‌ها: عنوان و مبلغ کنار هم، با دکمهٔ حذفِ همان خط. */
.exp-row { display: flex; gap: 7px; align-items: center; margin-bottom: 7px; }
.exp-row .t { flex: 1; min-width: 0; }
.exp-row .a { flex: none; width: 96px; }
.exp-row .x { flex: none; }
