
.chart {
  position: relative;
  width: 100%;
}
.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart__grid line {
  stroke: var(--border-soft);
  stroke-width: 1;
}
.chart__axis {
  font-size: 10.5px;
  fill: var(--text-3);
  font-family: 'Vazirmatn', sans-serif;
}
.chart__hover {
  fill: transparent;
  cursor: crosshair;
}
.chart__cursor {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0;
}
.chart.is-hover .chart__cursor {
  opacity: 1;
}
.chart path.series {
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart .bar {
  transition: opacity var(--dur-fast) var(--ease);
  cursor: pointer;
}
.chart .bar:hover {
  opacity: 0.78;
}
.chart .dot {
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.chart.is-hover .dot.is-on {
  opacity: 1;
}

/* Shown instead of a plot when every point is zero — a flat line pinned to the
   axis reads as "broken", not as "no data yet". */
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 160px;
  border-radius: var(--r-md);
  border: 1px dashed var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
  padding: var(--s-5);
}
/* `.chart svg` above stretches the plot to the card width, and the empty-state
   icon is an svg inside the same container — so without pinning it back to its
   own size a 26px icon rendered full-width and blew the card open. Qualified
   with .chart so it beats that rule on specificity rather than source order. */
.chart .chart-empty svg,
.chart-empty svg {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--border-strong);
}

.chart-tip {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--sh-3);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translate(50%, -50%);
  transition: opacity var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.chart-tip.is-on {
  opacity: 1;
}
.chart-tip__t {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 3px;
}
.chart-tip__r {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.9;
}
.chart-tip__r i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.chart-tip__r b {
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.legend {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.legend button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  transition: opacity var(--dur-fast) var(--ease);
}
.legend button.is-off {
  opacity: 0.4;
}
.legend i {
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  flex-shrink: 0;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
  justify-content: center;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}
.donut-center strong {
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.donut-center span {
  font-size: 11px;
  color: var(--text-3);
}
.donut-legend {
  flex: 1;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Rows are banded and padded so a legend of five transaction types reads as a
   list rather than a loose column of text floating beside the ring. */
.donut-legend__row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  transition: background var(--dur-fast) var(--ease);
}
.donut-legend__row:hover {
  background: var(--surface-2);
}
.donut-legend__row i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.donut-legend__row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.donut-legend__row b {
  margin-inline-start: auto;
  padding-inline-start: var(--s-2);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .donut-wrap {
    flex-direction: column;
  }
  .donut-legend {
    width: 100%;
  }
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-5);
}
.dash-grid > .c-3 {
  grid-column: span 3;
}
.dash-grid > .c-4 {
  grid-column: span 4;
}
.dash-grid > .c-5 {
  grid-column: span 5;
}
.dash-grid > .c-6 {
  grid-column: span 6;
}
.dash-grid > .c-7 {
  grid-column: span 7;
}
.dash-grid > .c-8 {
  grid-column: span 8;
}
.dash-grid > .c-12 {
  grid-column: span 12;
}

@media (max-width: 1280px) {
  .dash-grid > .c-3 {
    grid-column: span 6;
  }
  .dash-grid > .c-4,
  .dash-grid > .c-5,
  .dash-grid > .c-7,
  .dash-grid > .c-8 {
    grid-column: span 12;
  }
}
@media (max-width: 760px) {
  .dash-grid > .c-3,
  .dash-grid > .c-6 {
    grid-column: span 12;
  }
}

.hero-banner {
  position: relative;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(
      120deg,
      color-mix(in srgb, var(--primary) 16%, transparent),
      transparent 58%
    ),
    var(--surface);
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  inset-block-start: -70px;
  inset-inline-start: -50px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--violet-soft), transparent 68%);
  pointer-events: none;
}
.hero-banner__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
  position: relative;
}
.hero-stats {
  display: flex;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.hero-stat span {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
}
.hero-stat strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.bd {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px var(--s-3);
  align-items: center;
}
.bd__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}
.bd__label svg {
  flex-shrink: 0;
  color: var(--text-3);
}
.bd__value {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  justify-content: flex-end;
}
.bd__value b {
  font-size: 15px;
  font-weight: 700;
}
.bd__hint {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.bd__bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
}
.bd__bar span {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  transition: width 600ms var(--ease);
}
.bd--total {
  margin-top: var(--s-1);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--border);
}
.bd--total .bd__label {
  font-weight: 600;
  color: var(--text);
}
.bd--total .bd__value b {
  font-size: 17px;
  color: var(--primary-deep);
}

.live-list {
  display: flex;
  flex-direction: column;
}
.live-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--dur-fast) var(--ease);
}
.live-item:last-child {
  border-bottom: 0;
}
.live-item:hover {
  background: var(--surface-2);
}
.live-item__icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
}
.live-item__icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.live-item__body {
  flex: 1;
  min-width: 0;
  line-height: 1.55;
}
.live-item__t {
  font-size: 13px;
  font-weight: 500;
}
.live-item__s {
  font-size: 11.5px;
  color: var(--text-3);
}
.live-item__amt {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.rank-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.rank-item__no {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
}
.rank-item:nth-child(1) .rank-item__no {
  background: var(--warning-soft);
  color: var(--warning);
}
.rank-item:nth-child(2) .rank-item__no {
  background: var(--info-soft);
  color: var(--info);
}
.rank-item:nth-child(3) .rank-item__no {
  background: var(--violet-soft);
  color: var(--violet);
}
.rank-item__body {
  flex: 1;
  min-width: 0;
}

.filterbar {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-soft);
}
.filterbar__main {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.filterbar__search {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.filterbar__search svg {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-3);
  pointer-events: none;
}
.filterbar__search input {
  width: 100%;
  height: 40px;
  padding-inline: 40px var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
}
.filterbar__search input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.filterbar__chips {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .filterbar {
    padding: var(--s-4);
    gap: var(--s-3);
  }
  .filterbar__main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2);
  }
  .filterbar__search {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .filterbar__main > .xsel,
  .filterbar__main > .btn,
  .filterbar__main > .dd {
    max-width: none !important;
    width: 100%;
  }
  .filterbar__main > .dd {
    min-width: 0;
  }
  .filterbar__main > .dd .btn {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    justify-content: flex-start;
  }
  .filterbar__main > .dd .btn > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .filterbar__main > .dd .btn > svg,
  .filterbar__main > .dd .btn > i {
    flex-shrink: 0;
  }
  .filterbar__chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    margin-inline: calc(var(--s-4) * -1);
    padding-inline: var(--s-4);
  }
  .filterbar__chips::-webkit-scrollbar {
    display: none;
  }
  .filterbar__chips .chip {
    flex-shrink: 0;
  }
}

/* Stay two-up even on the narrowest phones so «فیلتر پیشرفته» and «مرتب‌سازی»
   share a row instead of becoming a tall stack. The trailing reset button is
   the odd one out, so it takes the full width as its own action. */
@media (max-width: 860px) {
  .filterbar__main > .btn:last-child {
    grid-column: 1 / -1;
  }
  .filterbar__main:has(> :nth-child(odd):last-child) > .btn:last-child {
    grid-column: auto;
  }
}

/* The result stats and the per-page picker sit on one line on desktop; on a
   phone they used to wrap into a ragged two-row block. Lay them out on purpose
   instead: stats as an even grid, then the picker on its own full-width row. */
@media (max-width: 640px) {
  .row.between:has(> .quickstats) {
    align-items: stretch;
    gap: var(--s-3);
  }
  .quickstats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2);
    width: 100%;
  }
  .quickstat {
    min-width: 0;
    gap: 6px;
    padding: var(--s-2);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
  }
  .quickstat i {
    flex-shrink: 0;
  }
  .row.between:has(> .quickstats) > .row {
    width: 100%;
    justify-content: space-between;
  }
}
.filterbar__adv {
  display: none;
  gap: var(--s-4);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: var(--s-4);
  border-top: 1px dashed var(--border-soft);
}
.filterbar__adv.is-open {
  display: grid;
  animation: fade-up var(--dur) var(--ease);
}
@media (max-width: 1100px) {
  .filterbar__adv {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .filterbar__adv {
    grid-template-columns: minmax(0, 1fr);
  }
}

.quickstats {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.quickstat {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.quickstat b {
  font-variant-numeric: tabular-nums;
}
.quickstat i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: var(--s-5);
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
}
.plan-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-2);
}
.plan-card.is-featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 10px 30px var(--primary-ring);
  padding-top: calc(var(--s-5) + 20px);
}
.plan-card__tag {
  position: absolute;
  top: -1px;
  inset-inline-start: var(--s-5);
  padding: 3px 10px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.plan-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.plan-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary);
}
.plan-card__icon svg {
  width: 21px;
  height: 21px;
}
.plan-card__price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: var(--s-4);
}
.plan-card__price strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.plan-card__price span {
  font-size: 12px;
  color: var(--text-3);
}
.plan-card__desc {
  margin-bottom: var(--s-4);
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-2);
}
.plan-card__foot {
  margin-top: auto;
  padding-top: var(--s-4);
  border-top: 1px dashed var(--border-soft);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.server-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
}
.server-card:hover {
  border-color: var(--border-strong);
}
.server-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.server-flag {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--surface-3);
  font-size: 19px;
  flex-shrink: 0;
}
.server-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.server-metric {
  text-align: center;
  line-height: 1.5;
}
.server-metric span {
  display: block;
  font-size: 10.5px;
  color: var(--text-3);
}
.server-metric strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-5);
  flex-wrap: wrap;
}
.profile-head__id {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-width: 0;
}
.profile-head__meta h2 {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  font-size: 19px;
}
.profile-head__meta p {
  font-size: 12.5px;
  color: var(--text-3);
}
.profile-head__stats {
  display: flex;
  gap: var(--s-5);
  margin-inline-start: auto;
  flex-wrap: wrap;
}
.profile-stat {
  text-align: center;
  min-width: 84px;
}
.profile-stat span {
  display: block;
  font-size: 11px;
  color: var(--text-3);
}
.profile-stat strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.edit-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: var(--s-5);
  align-items: start;
}
@media (max-width: 1080px) {
  .edit-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.settings-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}
.settings-nav {
  position: sticky;
  top: calc(var(--topbar-h) + var(--s-6));
  padding: var(--s-3);
}
/* On narrow screens the sidebar becomes a single dropdown (see .mnav) rather
   than a cramped sideways-scrolling strip. */
@media (max-width: 1024px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  /* `top` has to be cleared too, not just `position`: opening the dropdown makes
     the card `position: relative` (so the menu can escape the clip), which would
     otherwise re-activate the sticky offset and shove the nav down the page. */
  .settings-layout > .settings-nav {
    position: static;
    top: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .settings-nav .pillnav a {
    min-height: 44px;
    padding-inline: var(--s-3);
    white-space: nowrap;
  }
}

.fin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.fin-cell {
  padding: var(--s-5);
  background: var(--surface);
}
.fin-cell span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.fin-cell strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.bar-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: 6px;
  font-size: 12.5px;
}

.compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--s-5);
  align-items: start;
}
@media (max-width: 1080px) {
  .compose-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tg-preview {
  padding: var(--s-5);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, #17212b, #0e1621);
  border: 1px solid #24313f;
  min-height: 180px;
}
.tg-bubble {
  position: relative;
  max-width: 100%;
  padding: var(--s-3) var(--s-4);
  border-radius: 14px 14px 14px 4px;
  background: #182533;
  border: 1px solid #23303f;
  color: #e7eef5;
  font-size: 13.5px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
}
.tg-bubble__time {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  color: #6d8299;
  text-align: left;
}
.tg-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: var(--s-2);
}
.tg-btn {
  padding: 8px;
  border-radius: 8px;
  background: #22303f;
  color: #6ab3f3;
  font-size: 12.5px;
  text-align: center;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--s-2);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--surface-2);
  flex-wrap: wrap;
}
.toolbar button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}
.toolbar button:hover {
  background: var(--surface-3);
  color: var(--text);
}
.toolbar button svg {
  width: 15px;
  height: 15px;
}
.toolbar + .textarea {
  border-radius: 0 0 var(--r-md) var(--r-md);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-3);
}
.toggle-grid .toggle-row {
  gap: var(--s-3);
}
.toggle-grid .toggle-row__info {
  flex: 1;
  min-width: 0;
}
.toggle-grid .toggle-row__info .col {
  min-width: 0;
}
.toggle-grid .toggle-row__info b,
.toggle-grid .toggle-row__info span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
  padding: var(--s-5);
}
.svc-head__id {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-width: 0;
}
.svc-head__icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.svc-head__stats {
  display: flex;
  gap: var(--s-6);
  flex-wrap: wrap;
}

.table tbody tr.is-clickable {
  cursor: pointer;
}
.table tbody tr.is-clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.table tbody tr.is-clickable .col-actions {
  transition: transform var(--dur-fast) var(--ease);
}
.table tbody tr.is-clickable:hover .col-actions {
  transform: translateX(-3px);
  color: var(--primary-deep);
}

.gw-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.gw-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  transition: border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.gw-card__head {
  border-start-start-radius: var(--r-lg);
  border-start-end-radius: var(--r-lg);
}
.gw-card__foot {
  border-end-start-radius: var(--r-lg);
  border-end-end-radius: var(--r-lg);
}
.gw-card__head .tip::after {
  top: calc(100% + 7px);
  bottom: auto;
}
.gw-card:focus-within {
  border-color: var(--primary);
}
.gw-card.is-off {
  opacity: 0.66;
}

.gw-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.gw-card__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.gw-card__name {
  width: 100%;
  padding: 2px 6px;
  margin-inline-start: -6px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--dur-fast) var(--ease);
}
.gw-card__name:hover {
  border-color: var(--border);
  background: var(--surface-2);
}
.gw-card__name:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.gw-card__body {
  padding: var(--s-4);
}

.gw-card__foot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}
.gw-card__foot .badge {
  margin-inline-end: auto;
}

.val-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--s-4);
}
.val-card {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  transition: border-color var(--dur-fast) var(--ease);
}
.val-card:focus-within {
  border-color: var(--primary);
}
.val-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.val-card__head svg {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.charge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--s-5);
  align-items: start;
}
@media (max-width: 1080px) {
  .charge-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.charge-card {
  border-top: 3px solid var(--primary);
  transition: border-color var(--dur) var(--ease);
}
.charge-card.is-sub {
  border-top-color: var(--danger);
}

.charge-card__tabs {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5) 0;
}
.charge-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 52px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  transition: all var(--dur-fast) var(--ease);
}
.charge-tab svg {
  width: 18px;
  height: 18px;
}
.charge-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.charge-tab.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-deep);
}
.charge-tab[data-mode='sub'].is-active {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.input[type='number'].charge-amount {
  height: 48px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.val-card .input[type='number'] {
  text-align: center;
  font-weight: 600;
}

.charge-words {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-3);
  transition: all var(--dur) var(--ease);
}
.charge-words svg {
  flex-shrink: 0;
}
.charge-words.is-on {
  border-style: solid;
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.charge-words.is-on b {
  font-weight: 700;
}

.period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--s-4);
}
.period {
  position: relative;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.period:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.period__label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--s-3);
}
.period__label svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}
.period__amount {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.period__unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-inline-start: 4px;
}
.period__meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--border-soft);
  font-size: 11.5px;
  color: var(--text-3);
}
.period__meta b {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.range-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: var(--s-3);
}
.range-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  text-align: start;
  transition: all var(--dur-fast) var(--ease);
}
.range-opt:hover {
  border-color: var(--border-strong);
}
.range-opt__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.range-opt__value {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.range-opt.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.range-opt.is-active .range-opt__label {
  color: var(--primary-deep);
}
.range-opt.is-active .range-opt__value {
  color: var(--primary-deep);
  font-weight: 600;
}

.range-day {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding: var(--s-4);
  border-radius: var(--r-md);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
}

.daterange {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  align-items: end;
}
.daterange__field {
  min-width: 0;
}
.daterange .input-group__btn {
  inset-inline-end: 6px;
}
.daterange .input:not(:placeholder-shown) {
  padding-inline-end: 40px;
}

@media (max-width: 720px) {
  .range-day {
    align-items: stretch;
  }
  .range-day__label,
  .daterange,
  #dayShortcuts {
    width: 100%;
  }
  .daterange {
    gap: var(--s-2);
  }
  .daterange .field__label {
    font-size: 12px;
  }
}
.range-day__label {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text-2);
}
.range-day__label svg {
  flex-shrink: 0;
  color: var(--primary);
}
.range-day__controls {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.range-day__controls .field {
  gap: 0;
}
.datefilter__input {
  cursor: pointer;
  background-image: none;
}
.range-day .input-group {
  position: relative;
}
@media (max-width: 640px) {
  .range-day,
  .range-day__controls {
    align-items: stretch;
  }
  .range-day__controls .field {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
   .mnav — collapses a horizontal strip of options (filter chips, settings
   sections) into a dropdown on narrow screens instead of a sideways scroller.
   Above the breakpoint the list renders inline exactly as it did before.
   --------------------------------------------------------------------------- */
.mnav {
  position: relative;
}
.mnav__btn {
  display: none;
}

@media (max-width: 1024px) {
  .mnav__btn {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    width: 100%;
    min-height: 44px;
    padding: 0 var(--s-4);
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    text-align: start;
    transition: border-color var(--dur-fast) var(--ease),
      box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  }
  .mnav__btn > svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--primary);
  }
  .mnav__cur {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .mnav__chev {
    flex-shrink: 0;
    color: var(--text-3);
    transition: transform var(--dur-fast) var(--ease);
  }
  .mnav.is-open .mnav__btn {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
  }
  .mnav.is-open .mnav__chev {
    transform: rotate(180deg);
  }

  .mnav__list {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    z-index: var(--z-modal);
    max-height: 62dvh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--s-2);
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--sh-pop);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast) var(--ease),
      transform var(--dur-fast) var(--ease);
  }
  .mnav.is-open .mnav__list {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .mnav__list.filterbar__chips,
  .mnav__list.pillnav {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
    margin-inline: 0;
  }

  .mnav__list .chip {
    justify-content: flex-start;
    height: 42px;
    flex-shrink: 0;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    font-size: 13.5px;
    color: var(--text-2);
  }
  .mnav__list .chip svg {
    width: 16px;
    height: 16px;
    color: var(--text-3);
  }
  .mnav__list .chip.is-active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
  }
  .mnav__list .chip.is-active svg {
    color: var(--primary);
  }
}

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--s-5);
  background: radial-gradient(circle at 15% 0%, var(--primary-soft), transparent 42%),
    radial-gradient(circle at 85% 100%, var(--secondary-soft), transparent 42%), var(--bg);
}
.auth__box {
  width: 100%;
  max-width: 420px;
  padding: var(--s-8);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-3);
}
.auth__brand {
  text-align: center;
  margin-bottom: var(--s-6);
}
.auth__mark {
  width: 58px;
  height: 58px;
  margin: 0 auto var(--s-4);
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 22px var(--primary-ring);
}
.auth__brand h1 {
  font-size: 21px;
}
.auth__brand p {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}
.auth__foot {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--text-3);
  text-align: center;
}

/* ---------------------------------------------------------------------------
   Mobile form sizing — must be the last word in the last stylesheet.

   Mobile browsers zoom the viewport when a focused control computes to less
   than 16px. Several of the fields below (.filterbar__search input, .input)
   are declared at 13.5px earlier in this very file, so this block has to come
   after them to win on source order.
   --------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .input,
  .input.num,
  .input[type='number'],
  .input[type='search'],
  .select,
  .textarea,
  .xsel__btn,
  .gw-card__name,
  .jdp__sel,
  .topbar__search input,
  .filterbar__search input,
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* ---------------------------------------------------------------------------
   Print — used by «گزارش چاپی» on the financial report.

   The screen layout is built from a fixed sidebar, a sticky topbar and a fixed
   bottom nav, and every card clips its overflow. On paper that produced one
   truncated page: the content column kept its 258px margin, the fixed chrome
   painted over it, and anything past the first page was cut by the clip.
   --------------------------------------------------------------------------- */
@media print {
  @page {
    margin: 12mm;
  }

  html,
  body {
    background: #fff;
    height: auto;
  }

  /* Chrome that has no meaning on paper. */
  .sidebar,
  .topbar,
  .bottomnav,
  .sheet,
  .toasts,
  .skip-link,
  .page__actions,
  .breadcrumb,
  .range-picker,
  .range-day,
  .pagination,
  .filterbar,
  .row-actions,
  .col-actions {
    display: none !important;
  }

  .app {
    display: block;
    min-height: 0;
  }
  .main {
    margin-inline-start: 0 !important;
    padding-bottom: 0 !important;
    display: block;
  }
  .page {
    max-width: none;
    padding: 0;
  }

  /* Let content flow across pages instead of being clipped to the first one. */
  .card,
  .card--pop,
  .gw-card,
  .table-wrap,
  .fin-summary {
    overflow: visible !important;
    box-shadow: none !important;
    border-color: #ccc !important;
  }

  .card,
  .stat,
  .fin-cell,
  .period,
  .plan-card,
  .donut-wrap {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .dash-grid {
    display: block;
  }
  .dash-grid > section {
    margin-bottom: var(--s-5);
  }

  .chart svg,
  .donut-wrap svg {
    max-width: 100%;
    height: auto;
  }

  /* Hover-only affordances would otherwise print as empty boxes. */
  .chart-tip,
  .tip::after {
    display: none !important;
  }

  a[href]::after {
    content: '';
  }
}

.modal__box--wide {
  max-width: 1040px;
}

.remote-note {
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}

.remote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--s-3);
}

.remote-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.remote-card:hover {
  border-color: var(--secondary);
  box-shadow: var(--sh-1);
}
.remote-card.is-used {
  background: var(--surface-2);
}

.remote-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}
.remote-card__id {
  min-width: 30px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.remote-card__state {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.remote-card.is-used .remote-card__state {
  color: var(--warning);
}

.remote-card__name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}

.remote-card__price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.remote-card__price b {
  font-size: 15px;
}
.remote-card__price span {
  font-size: 11px;
  color: var(--text-3);
}
.remote-card__price s {
  font-size: 11px;
  color: var(--text-3);
}

.remote-card__cta {
  margin-top: var(--s-1);
  width: 100%;
}

@media (max-width: 520px) {
  .remote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2);
  }
  .remote-card {
    padding: var(--s-3);
  }
  .remote-card__name {
    font-size: 12.5px;
    min-height: 2.7em;
  }
}
