/* ══════════════════════════════════════════════════════════════════
   کندول — لایهٔ تکمیلی روی ps.css (زبان طراحی پنل پارس‌پک)
   همهٔ مقادیر از همان توکن‌های --colors-* فایل مرجع گرفته شده‌اند.
   ══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: iranyekan, iranyekanFaNum, system-ui, -apple-system, Segoe UI, Tahoma, sans-serif;
  background: rgb(var(--colors-body));
  color: rgb(var(--colors-cold-gray));
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
b, strong { font-weight: 700; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgb(var(--colors-scrollbar-color) / .22);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover { background: rgb(var(--colors-scrollbar-color) / .38); }

/* ═══ پنل کناری — آیتم منو (همان رفتار مرجع: hover به رنگ ghost-blue) ═══ */
.main-menu--item { opacity: .92; }
.main-menu--item:hover .menu-item { background: rgb(var(--colors-cold-gray) / .08); }
.main-menu--item:hover .title   { color: rgb(var(--colors-ghost-blue)); }
.main-menu--item:hover svg      { color: rgb(var(--colors-ghost-blue)); }
.main-menu--item.on .menu-item {
  background: rgb(var(--colors-ghost-blue) / .14);
  box-shadow: inset 3px 0 0 rgb(var(--colors-ghost-blue));
}
.main-menu--item.on .title,
.main-menu--item.on svg { color: rgb(var(--colors-ghost-blue)); }
.main-menu--item svg { color: rgb(var(--colors-cold-gray)); transition: color .15s ease; }
.title { transition: color .15s ease; }
.main-menu--item[hidden] { display: none; }

/* ═══ هدر ═══ */
.header-container { padding-inline: 12px; }
.breadcrumb-url {
  color: rgb(var(--colors-gray));
  transition: color .15s ease;
  font-size: 12px;
}
.breadcrumb-url:hover { color: rgb(var(--colors-ghost-blue)); }
.last-item { color: rgb(var(--colors-cold-gray)); font-weight: 500; }
#hdr-status, #hdr-up, #btn-theme, #btn-logout { cursor: pointer; transition: all .15s ease; }
#hdr-status:hover, #hdr-up:hover { background: rgb(var(--colors-ghost-blue) / .15); }
#btn-theme:hover { background: rgb(var(--colors-cold-gray) / .12); }
#btn-logout:hover { background: rgb(var(--colors-red) / .16); }
.status-bullet__ring { animation: ps-pulse 2s cubic-bezier(.4,0,.6,1) infinite; }

/* ═══ ورودی‌ها ═══ */
.ps-input {
  background: rgb(var(--colors-body));
  border: 1px solid rgb(var(--colors-cold-gray) / .14);
  color: rgb(var(--colors-cold-gray));
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ps-input::placeholder { color: rgb(var(--colors-gray) / .7); }
.ps-input:focus {
  border-color: rgb(var(--colors-ghost-blue) / .6);
  box-shadow: 0 0 0 3px rgb(var(--colors-ghost-blue) / .12);
}
select.ps-input { cursor: pointer; }

/* ═══ دکمه — بازتولید ps-button با گوشهٔ اسکوئرکل (بدون وابستگی SVG mask) ═══ */
.ps-button {
  position: relative;
  gap: 7px;
  min-height: 40px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  border-radius: 12px;
  corner-shape: squircle;
  transition: transform .12s ease, filter .15s ease, box-shadow .2s ease;
}
.ps-button .label { white-space: nowrap; }
.ps-button--style-fill.ps-button--color-ghost-blue {
  background: rgb(var(--colors-ghost-blue));
  box-shadow: var(--button-shadow) rgb(var(--colors-ghost-blue) / .35);
}
.ps-button--style-fill.ps-button--color-sea-green {
  background: rgb(var(--colors-sea-green));
  box-shadow: var(--button-shadow) rgb(var(--colors-sea-green) / .35);
}
.ps-button--style-fill.ps-button--color-red {
  background: rgb(var(--colors-red));
  box-shadow: var(--button-shadow) rgb(var(--colors-red) / .35);
}
.ps-button--style-fill.ps-button--color-orange {
  background: rgb(var(--colors-orange));
  box-shadow: var(--button-shadow) rgb(var(--colors-orange) / .35);
}
.ps-button--style-fill.ps-button--color-green {
  background: rgb(var(--colors-green));
  box-shadow: var(--button-shadow) rgb(var(--colors-green) / .35);
}
.ps-button--style-outline {
  background: transparent;
  border: 1px solid rgb(var(--colors-cold-gray) / .25);
  color: rgb(var(--colors-cold-gray));
  box-shadow: none;
}
.ps-button--style-soft {
  background: rgb(var(--colors-ghost-blue) / .14);
  color: rgb(var(--colors-ghost-blue));
  box-shadow: none;
}
.ps-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.ps-button:active { transform: translateY(0); }
.ps-button:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.ps-button.sm { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
.ps-button.xs { min-height: 26px; padding: 0 9px; font-size: 11px; border-radius: 8px; }

/* ═══ کارت (ویجت مرجع) ═══ */
.ps-card {
  background: rgb(var(--colors-widget));
  border-radius: 20px;
  box-shadow: var(--3xl-shadow) rgb(var(--colors-dark-blue-5) / .18);
  padding: 20px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.ps-card.hover:hover {
  box-shadow: var(--3lg-shadow) rgb(var(--colors-dark-blue-5) / .26);
  transform: translateY(-2px);
}
.ps-card-title {
  color: rgb(var(--colors-cold-gray));
  font-weight: 500;
  font-size: 15px;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ps-card-title svg { color: rgb(var(--colors-ghost-blue)); }

/* ═══ کاشی آمار ═══ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 16px;
}
.stat-tile { position: relative; overflow: hidden; }
.stat-tile .ico-wrap {
  width: 42px; height: 42px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: rgb(var(--colors-ghost-blue) / .13);
  color: rgb(var(--colors-ghost-blue));
  margin-bottom: 12px;
}
.stat-tile .val {
  font-size: 26px; font-weight: 700;
  color: rgb(var(--colors-cold-gray));
  line-height: 1.25;
  font-feature-settings: "ss02";
}
.stat-tile .val small { font-size: 13px; font-weight: 400; opacity: .6; margin-inline-start: 3px; }
.stat-tile .lbl { font-size: 12px; color: rgb(var(--colors-gray)); margin-top: 3px; }
.stat-tile .sub { font-size: 11px; color: rgb(var(--colors-gray)); opacity: .8; margin-top: 8px; }
.stat-tile .spark { position: absolute; inset-inline: 0; bottom: 0; height: 34px; opacity: .5; }
.stat-tile.ok    .ico-wrap { background: rgb(var(--colors-green) / .14); color: rgb(var(--colors-green)); }
.stat-tile.warn  .ico-wrap { background: rgb(var(--colors-orange) / .14); color: rgb(var(--colors-orange)); }
.stat-tile.crit  .ico-wrap { background: rgb(var(--colors-red) / .14); color: rgb(var(--colors-red)); }
.stat-tile.cloud .ico-wrap { background: rgb(var(--colors-sea-green) / .14); color: rgb(var(--colors-sea-green)); }

/* نوار پیشرفت */
.bar { height: 7px; border-radius: 100px; background: rgb(var(--colors-cold-gray) / .13); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 100px;
  background: rgb(var(--colors-ghost-blue));
  transition: width .7s cubic-bezier(.4,0,.2,1);
}
.bar.warn > i { background: rgb(var(--colors-orange)); }
.bar.crit > i { background: rgb(var(--colors-red)); }
.bar.ok   > i { background: rgb(var(--colors-green)); }

/* ═══ جدول ═══ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: right; padding: 10px 12px;
  color: rgb(var(--colors-gray));
  font-weight: 500; font-size: 12px;
  border-bottom: 1px solid rgb(var(--colors-cold-gray) / .12);
  white-space: nowrap;
}
.tbl td {
  padding: 10px 12px;
  color: rgb(var(--colors-cold-gray));
  border-bottom: 1px solid rgb(var(--colors-cold-gray) / .07);
  vertical-align: middle;
}
.tbl tbody tr { transition: background .13s ease; }
.tbl tbody tr:hover { background: rgb(var(--colors-cold-gray) / .05); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.mono {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-size: 12px; direction: ltr; text-align: left; display: inline-block;
  unicode-bidi: embed;
}

/* ═══ برچسب ═══ */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 7px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.ok   { background: rgb(var(--colors-green) / .14);  color: rgb(var(--colors-green)); }
.tag.warn { background: rgb(var(--colors-orange) / .14); color: rgb(var(--colors-orange)); }
.tag.crit { background: rgb(var(--colors-red) / .14);    color: rgb(var(--colors-red)); }
.tag.info { background: rgb(var(--colors-ghost-blue) / .14); color: rgb(var(--colors-ghost-blue)); }
.tag.mute { background: rgb(var(--colors-gray) / .14);   color: rgb(var(--colors-gray)); }
.tag.plain::before { display: none; }

/* ═══ گیج ═══ */
.gauge { position: relative; width: 216px; height: 216px; margin: 0 auto; }
.gauge svg { transform: rotate(-90deg); display: block; }
.gauge .trk { fill: none; stroke: rgb(var(--colors-cold-gray) / .13); stroke-width: 13; }
.gauge .arc {
  fill: none; stroke-width: 13; stroke-linecap: round;
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1);
}
.gauge .mid {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
  color: rgb(var(--colors-cold-gray));
}
.gauge .mid b { font-size: 42px; font-weight: 700; line-height: 1; display: block; }
.gauge .mid b span { font-size: 20px; }
.gauge .mid .cap { font-size: 17px; font-weight: 700; margin-top: 7px; display: block; }
.gauge .mid .cap i { font-style: normal; opacity: .5; margin-inline-start: 4px; }

/* ═══ نمودار ═══ */
.chart-box { position: relative; width: 100%; height: 220px; }
.chart-box.tall { height: 300px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; color: rgb(var(--colors-gray)); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ═══ شبکهٔ چیدمان ═══ */
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid.s2 { grid-template-columns: 1fr 1fr; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt-1{margin-top:4px} .mt-2{margin-top:8px} .mt-3{margin-top:12px} .mt-4{margin-top:16px}
.mt-5{margin-top:20px} .mb-2{margin-bottom:8px} .mb-3{margin-bottom:12px} .mb-4{margin-bottom:16px}
.hidden { display: none !important; }
.muted { color: rgb(var(--colors-gray)); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.pos { color: rgb(var(--colors-green)); }
.neg { color: rgb(var(--colors-red)); }

/* ═══ خالی/خطا ═══ */
.empty {
  padding: 34px 16px; text-align: center;
  color: rgb(var(--colors-gray)); font-size: 13px;
}
.empty .ico { opacity: .35; margin-bottom: 10px; display: flex; justify-content: center; }
.empty .ico svg { width: 34px; height: 34px; }

/* ═══ حالت خوشه‌ای/کارت لیست ═══ */
.tile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile {
  background: rgb(var(--colors-body));
  border: 1px solid rgb(var(--colors-cold-gray) / .1);
  border-radius: 14px; padding: 14px;
  transition: border-color .15s ease, transform .15s ease;
}
.tile:hover { border-color: rgb(var(--colors-ghost-blue) / .4); transform: translateY(-2px); }
.tile .nm { font-weight: 500; color: rgb(var(--colors-cold-gray)); display: flex; align-items: center; gap: 7px; }
.tile .meta { font-size: 11px; color: rgb(var(--colors-gray)); margin-top: 7px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ═══ کد رنگ سرویس ═══ */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.ok{background:rgb(var(--colors-green))} .dot.warn{background:rgb(var(--colors-orange))}
.dot.crit{background:rgb(var(--colors-red))} .dot.mute{background:rgb(var(--colors-gray))}

/* ═══ تب ═══ */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 7px 14px; border-radius: 10px; cursor: pointer;
  font-size: 12px; font-weight: 500;
  color: rgb(var(--colors-gray));
  background: rgb(var(--colors-cold-gray) / .07);
  transition: all .15s ease; border: none; font-family: inherit;
}
.tab:hover { color: rgb(var(--colors-cold-gray)); background: rgb(var(--colors-cold-gray) / .13); }
.tab.on { background: rgb(var(--colors-ghost-blue) / .16); color: rgb(var(--colors-ghost-blue)); }

/* ═══ مودال و توست ═══ */
.modal-wrap {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgb(0 0 0 / .55); backdrop-filter: blur(3px);
  animation: ps-fadeIn .16s ease;
}
.modal-box { width: min(430px, calc(100vw - 40px)); animation: ps-zoomIn .2s cubic-bezier(.2,0,.2,1); }
.toast-wrap { position: fixed; top: 18px; inset-inline-start: 18px; z-index: 70; display: grid; gap: 9px; }
.toast {
  background: rgb(var(--colors-widget));
  border-radius: 13px; padding: 11px 15px;
  box-shadow: var(--3xl-shadow) rgb(var(--colors-dark-blue-5) / .3);
  font-size: 13px; color: rgb(var(--colors-cold-gray));
  display: flex; align-items: center; gap: 9px;
  max-width: 380px; animation: ps-slideIn .22s cubic-bezier(.2,0,.2,1);
  border-inline-start: 3px solid rgb(var(--colors-ghost-blue));
}
.toast.ok   { border-inline-start-color: rgb(var(--colors-green)); }
.toast.crit { border-inline-start-color: rgb(var(--colors-red)); }
.toast.warn { border-inline-start-color: rgb(var(--colors-orange)); }

/* ═══ ورود ═══ */
.auth-wrap { padding: 24px; background: rgb(var(--colors-body)); }
.auth-card { max-width: 420px; }
.ps-auth .auth-card { animation: ps-slideIn .3s cubic-bezier(.2,0,.2,1); }

/* ═══ لاگ ═══ */
.logbox {
  background: rgb(var(--colors-body));
  border: 1px solid rgb(var(--colors-cold-gray) / .1);
  border-radius: 12px; padding: 14px;
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px;
  line-height: 1.75; direction: ltr; text-align: left;
  max-height: 480px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
  color: rgb(var(--colors-gray));
  unicode-bidi: plaintext;
}
.logbox .l-err { color: rgb(var(--colors-red)); }
.logbox .l-warn { color: rgb(var(--colors-orange)); }
.logbox .l-ok { color: rgb(var(--colors-green)); }
.logbox .l-ts { color: rgb(var(--colors-ghost-blue)); opacity: .85; }

/* ═══ اسکلت بارگذاری ═══ */
.skel {
  background: linear-gradient(90deg,
    rgb(var(--colors-cold-gray) / .07),
    rgb(var(--colors-cold-gray) / .14),
    rgb(var(--colors-cold-gray) / .07));
  background-size: 200% 100%;
  animation: ps-shimmer 1.3s infinite;
  border-radius: 8px; height: 13px;
}

/* ═══ تم روشن (همان توکن‌ها، بدون .theme-dark) ═══ */
/* ═══ تم روشن ═════════════════════════════════════════════════════════
   پیش‌تر فقط ۴ قاعده داشت و هیچ توکنی را بازتعریف نمی‌کرد، پس متن‌های
   ثانویه روی پس‌زمینهٔ روشن نسبت کنتراست ۲.۸۵ می‌گرفتند (حد استاندارد
   ۴.۵). حالا همهٔ توکن‌های رنگ به مقادیر مناسب روشن وصل می‌شوند تا همان
   کلاس‌های رنگی سراسر پنل خودکار درست شوند. */
html.light {
  color-scheme: light;
  --colors-body:        233 237 247;
  --colors-widget:      245 248 254;
  --colors-cold-gray:    38  52  66;
  --colors-gray:         88 106 124;
  --colors-dark-blue:   214 222 234;
  --colors-ghost-blue:    0  92 190;
  --colors-green:        10 130 112;
  --colors-orange:      176 100   8;
  --colors-red:         190  34  74;
  --colors-sea-green:    40  74 186;
}
html.light body { background: rgb(var(--colors-body)); color: rgb(var(--colors-cold-gray)); }
html.light .ps-bg-widget,
html.light .ps-card,
html.light .modal-box,
html.light .prime-panel > div,
html.light .tile { background: rgb(var(--colors-widget)); }
html.light .menu-head { background: rgb(96 112 130); }
html.light .menu-head .label { color: #fff !important; }
html.light .tbl th { background: rgb(226 232 241); color: rgb(70 88 106); }
html.light .tbl tbody tr:hover { background: rgb(var(--colors-ghost-blue) / .06); }
html.light .logbox { background: rgb(var(--colors-widget)); color: rgb(30 42 54); }
html.light .tag { background: rgb(var(--colors-gray) / .16); color: rgb(48 62 78); }
html.light .tag.ok   { background: rgb(var(--colors-green)  / .18); color: rgb(8 98 84); }
html.light .tag.crit { background: rgb(var(--colors-red)    / .16); color: rgb(158 24 60); }
html.light .tag.warn { background: rgb(var(--colors-orange) / .20); color: rgb(140 78 6); }
html.light .tag.info { background: rgb(var(--colors-ghost-blue) / .16); color: rgb(0 74 154); }
html.light .tabs .tab { background: rgb(var(--colors-widget)); border-color: rgb(var(--colors-dark-blue)); color: rgb(70 88 106); }
html.light .tabs .tab.on { background: rgb(var(--colors-ghost-blue)); color: #fff; }
html.light .ps-input { background: #fff; border-color: rgb(var(--colors-dark-blue)); color: rgb(var(--colors-cold-gray)); }
html.light .ps-input::placeholder { color: rgb(122 140 158); }
html.light .hdr-btn { background: rgb(var(--colors-widget)); border-color: rgb(var(--colors-dark-blue)); color: rgb(70 88 106); }
html.light .hdr-btn:hover { background: rgb(var(--colors-dark-blue)); }
html.light .header-container { background: rgb(var(--colors-widget)); }
html.light .bar { background: rgb(210 220 233); }
html.light .gauge .trk { stroke: rgb(210 220 233); }
html.light .dot { box-shadow: 0 0 0 2px rgb(var(--colors-widget)); }
html.light body { color: rgb(61 80 92); }

/* ═══ ریتم یکدست منوی سایدبار ════════════════════════════════════════
   یک آیتم («فضا و پاک‌سازی») تیتر بلندتری دارد و چون ارتفاع با padding
   محتوا تعیین می‌شد، از بقیه فشرده‌تر دیده می‌شد. */
#nav .main-menu--item .menu-item { min-height: 38px; box-sizing: border-box; }
#nav .main-menu--item .title { line-height: 1.5; }
/* ═══ صیقل نهایی (پس از بازبینی تصویری) ═════════════════════════════ */

/* ۱) پاصفحهٔ سایدبار: v2 و «کندول» به لبه چسبیده و فشرده بودند */
#nav-version-row { align-items: center; }
#nav-version-row > span { line-height: 1.6; }
aside.prime-panel > div > div:last-child { padding-block: 14px !important; }

/* ۲) برچسب محور Y نمودار به لبه می‌چسبید — فضای نفس‌کشیدن بیشتر */
.chart-box { padding-inline-start: 6px; }

/* ۳) کادر هشدار یک‌خطی نازک و کم‌ارتفاع بود */
.alert-strip {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 14px 16px;
  border-radius: 16px;
  background: rgb(var(--colors-widget));
  box-shadow: 0 10px 30px -22px rgb(0 0 0 / .5);
}
.alert-strip > svg { flex: 0 0 auto; }
.alert-strip > span {
  font-size: 13px; line-height: 1.75;
  overflow-wrap: anywhere;
}
/* ═══ پدینگ بدنهٔ محتوا ══════════════════════════════════════════════
   در فایل مرجع، ps-px-[30px] فقط با پیشوند md: (min-width:1000px) تعریف
   شده بود. یعنی زیر ۱۰۰۰px هیچ‌وقت اعمال نمی‌شد و کارت‌ها به لبه چسبیده
   بودند. این‌جا بی‌قید تعریف می‌شود و در موبایل کم می‌شود. */
#content { padding-inline: 30px; }
@media (max-width: 1100px) {
  .grid.s2, .grid.c2 { grid-template-columns: 1fr; }
  #content { padding-inline: 22px; }
}
/* 901-1100px: the sidebar used to stay at 234px here, squeezing the content to
   ~667px. Give the tiles two columns max so they do not turn into postage stamps. */
@media (max-width: 1100px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  #content { padding-inline: 14px; padding-top: 14px; }
}
@media (max-width: 480px) {
  #content { padding-inline: 11px; }
}

/* ═══ ریسپانسیو ══════════════════════════════════════════════════════
   ریشهٔ باگ قبلی: media query نوشته شده بود ولی شرط فروپاشی سایدبار به
   `.prime-panel` تکیه داشت که در ps.css قاعدهٔ `.main-menu{position:static}`
   را فقط برای min-width:1000px دارد، و مهم‌تر: خودِ سایدبار با
   `ps-w-[234px] ps-min-w-[234px]` عرض ثابت گرفته بود که media query من
   آن را override نمی‌کرد → روی گوشی ۳۶۰px، سایدبار ۲۳۴px باز می‌ماند و
   فقط ۱۲۶px برای محتوا می‌ماند. حالا در حالت موبایل عرض آزاد و آف‌اسکرین
   می‌شود و محتوا تمام‌عرض می‌گیرد. */
@media (max-width: 1100px) {
  /* سایدبار: بسته و بیرون از کادر دید، نه ۲۳۴px ثابت باز */
  aside.prime-panel {
    position: fixed !important;
    top: 0; bottom: 0; right: 0; left: auto;
    z-index: 60;
    width: 264px !important; min-width: 0 !important;
    max-width: 86vw;
    padding: 0 !important;
    background: transparent;
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.2,0,.2,1);
    will-change: transform;
  }
  html[data-nav="open"] aside.prime-panel { transform: translateX(0); }

  /* کارت چسبیده به لبهٔ راست؛ فقط گوشه‌های چپ گرد */
  aside.prime-panel > div {
    width: 100% !important; min-width: 0 !important;
    height: 100dvh !important;
    border-radius: 16px 0 0 16px !important;
    box-shadow: -18px 0 45px -20px rgb(0 0 0 / .65) !important;
  }

  /* لایهٔ تاریک پشت سایدبار — لمس = بستن */
  #nav-overlay {
    position: fixed; inset: 0; z-index: 55;
    background: rgb(0 0 0 / .5);
    opacity: 0; visibility: hidden;
    transition: opacity .22s ease, visibility .22s;
  }
  html[data-nav="open"] #nav-overlay { opacity: 1; visibility: visible; }

  /* محتوا تمام‌عرض: هیچ عرض ثابتی از سایدبار باقی نمی‌ماند */
  .main-content { width: 100% !important; }


  #nav-toggle { display: inline-flex !important; }
  .header-container { padding-inline: 8px; }
  #hdr-up, #hdr-status { display: none !important; }
  .profile { width: auto !important; padding-inline: 6px; }
  .header-actions { width: auto !important; flex: 1; }

  /* هدف لمسی بزرگ‌تر */
  .main-menu--item .menu-item { min-height: 44px; }
  .ps-button.sm, .ps-button.xs { min-height: 36px; }
  .tabs .tab { min-height: 38px; padding-block: 8px; }
  .gauge svg { width: 178px; height: 178px; }
  .gauge .mid b { font-size: 34px; }
  .logbox { max-height: 380px; font-size: 11px; }
  .ps-card { padding: 16px; }
  .hdr-btn { width: 40px; height: 40px; min-width: 40px; }
}

/* ── موبایل: گریدها یک‌ستونه، جدول‌ها خوانا ── */
@media (max-width: 700px) {
  .grid.c3, .grid.c4 { grid-template-columns: 1fr 1fr; }
  .grid.c3 > *, .grid.c4 > * { min-width: 0; }
  .stat-tile .val { font-size: 22px; }
  .stat-tile .ico-wrap { width: 36px; height: 36px; border-radius: 11px; }
  .tile-list { grid-template-columns: 1fr; }
  /* ستون‌های کم‌اهمیت تا عرض صفحه را نشکنند */
  .sm-hide { display: none; }
  .tbl { font-size: 12.5px; }
  .tbl th, .tbl td { padding: 9px 8px; }
  .tbl-scroll { margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
  .logbox { max-height: 320px; }
  /* تاریخچه در گوشی: جدول‌ها با کمترین ستون */
  .card-body-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  #crumb, .breadcrumb-url, .sep { display: none; }
  .header-container { height: 54px; }
  .ps-card { padding: 14px; border-radius: 14px; }
  .main-content .ps-px-\[30px\] { padding-inline: 11px; }
  .tbl-scroll { margin: 0 -14px; padding: 0 14px; }
  .toast-wrap { inset-inline: 10px; }
  .toast { max-width: none; }
}

@media (min-width: 1101px) {
  #nav-toggle, #nav-overlay { display: none !important; }
}

/* نوار اسکرول نازک برای جدول‌های افقی */
.tbl-scroll::-webkit-scrollbar { height: 6px; }
.tbl-scroll::-webkit-scrollbar-thumb { background: rgb(var(--colors-cold-gray) / .28); border-radius: 3px; }
.tbl-scroll::-webkit-scrollbar-track { background: transparent; }

/* ═══ انیمیشن‌ها ═══ */
@keyframes ps-fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes ps-zoomIn  { from { opacity: 0; transform: scale(.94) } to { opacity: 1; transform: scale(1) } }
@keyframes ps-slideIn { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: none } }
@keyframes ps-shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
@keyframes ps-pulse {
  0%, 100% { opacity: .35; transform: scale(1) }
  50%      { opacity: .8;  transform: scale(1.35) }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ═══ اندازهٔ کنترل‌های هدر ════════════════════════════════════════════
   کلاس‌های ps-w-9/ps-h-9 در ps.css مرجع وجود ندارند؛ دکمه‌های هدر بدون
   این قواعد بی‌عرض می‌شدند (دکمهٔ منو ۲۰px در می‌آمد). */
.hdr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-width: 36px; flex: 0 0 auto;
  border-radius: 9px; cursor: pointer;
  border: 1px solid rgb(var(--colors-cold-gray) / .12);
  background: rgb(var(--colors-cold-gray) / .05);
  color: rgb(var(--colors-cold-gray));
  transition: background .15s ease, color .15s ease;
}
.hdr-btn:hover { background: rgb(var(--colors-cold-gray) / .12); }
.hdr-btn.danger { color: rgb(var(--colors-red)); background: rgb(var(--colors-red) / .07);
                  border-color: rgb(var(--colors-red) / .16); }
.hdr-btn.danger:hover { background: rgb(var(--colors-red) / .15); }
@media (max-width: 480px) { .hdr-btn { width: 34px; height: 34px; min-width: 34px; } }

/* آدرس‌های بلند (مثل 127.0.0.53%lo:53) ستون را از عرض صفحه بیرون می‌بردند */
.tbl td.mono, .tbl th {
  overflow-wrap: anywhere; word-break: break-word;
}
.tbl td.mono { max-width: 260px; }
@media (max-width: 700px) { .tbl td.mono { max-width: 150px; } }

/* ═══ خوانایی روی گوشی ══════════════════════════════════════════════
   متن توضیحی کارت‌ها (۱۱px) روی صفحهٔ کوچک ریز بود. */
@media (max-width: 700px) {
  .stat-tile .sub { font-size: 12px; line-height: 1.7; }
  .stat-tile .lbl { font-size: 13px; }
  .muted.small, .small { font-size: 12.5px; }
  .xsmall { font-size: 11.5px; }
  .ps-card-title { font-size: 14px; }
  .row.between .mono.small { font-size: 12px; }
}
@media (max-width: 480px) {
  .stat-tile .sub { font-size: 12.5px; }
}


/* ══════════════════════════════════════════════════════════════════════════
   کلاس‌های ps-* کاربردی که در اسنپ‌شات مرجع تعریف نشده بودند
   ─────────────────────────────────────────────────────────────────────────
   ریشهٔ باگ: فایل مرجع خروجی build شدهٔ Tailwind است، پس فقط کلاس‌هایی را
   دارد که در مارک‌آپ خودِ پنل پارس‌پک استفاده شده بودند (۴۴ کلاس از ۱۵۱).
   ۶۸ کلاس دیگر در هیچ فایلی قاعده نداشتند → بی‌اثر بودند: فاصله‌ها صفر
   می‌شد، ارتفاع/عرض صفر، متن‌ها هم‌اندازه. این‌ها الان معادل دقیق
   Tailwind خودشان را دارند تا مارک‌آپ همان‌طور که نوشته شده دیده شود.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── فاصله‌ها (spacing scale = 4px) ── */
.ps-m-\[0\] { margin: 0 }
.ps-p-\[0\] { padding: 0 }
.ps-mb-2 { margin-bottom: 8px }
.ps-mb-4 { margin-bottom: 16px }
.ps-mt-\[12px\] { margin-top: 12px }
.ps-mt-\[25px\] { margin-top: 25px }
.ps-mb-\[5px\] { margin-bottom: 5px }
.ps-mx-\[7px\] { margin-inline: 7px }
.ps-py-2 { padding-block: 8px }
.ps-py-3 { padding-block: 12px }
.ps-pt-5 { padding-top: 20px }
.ps-pt-6 { padding-top: 24px }
.ps-pb-3 { padding-bottom: 12px }
.ps-pb-8 { padding-bottom: 32px }
.ps-py-20 { padding-block: 80px }
.ps-py-\[10px\] { padding-block: 10px }
.ps-px-\[6px\] { padding-inline: 6px }
.ps-px-\[28px\] { padding-inline: 28px }
.ps-px-\[30px\] { padding-inline: 30px }
.ps-pb-\[28px\] { padding-bottom: 28px }
.ps-pb-\[24px\] { padding-bottom: 24px }
.ps-pt-\[16px\] { padding-top: 16px }
.ps-ps-0 { padding-inline-start: 0 }
.ps-ps-12px { padding-inline-start: 12px }
.ps-gap-2 { gap: 8px }

/* ── اندازه‌ها ── */
.ps-w-\[6px\]  { width: 6px }   .ps-h-\[6px\]  { height: 6px }
.ps-w-\[12px\] { width: 12px }  .ps-h-\[12px\] { height: 12px }
.ps-w-\[14px\] { width: 14px }  .ps-h-\[14px\] { height: 14px }
.ps-w-\[16px\] { width: 16px }  .ps-h-\[16px\] { height: 16px }
.ps-w-\[18px\] { width: 18px }  .ps-h-\[18px\] { height: 18px }
.ps-w-\[20px\] { width: 20px }  .ps-h-\[20px\] { height: 20px }
.ps-w-\[24px\] { width: 24px }  .ps-h-\[24px\] { height: 24px }
.ps-w-\[28px\] { width: 28px }  .ps-h-\[28px\] { height: 28px }
.ps-h-\[30px\] { height: 30px }
.ps-h-\[46px\] { height: 46px }
.ps-w-\[234px\] { width: 234px }
.ps-min-w-\[234px\] { min-width: 234px }
.ps-min-w-0 { min-width: 0 }
.ps-w-\[300px\] { width: 300px }
.ps-h-\[calc\(100dvh-32px\)\] { height: calc(100dvh - 32px) }
.ps-h-\[100dvh\] { height: 100dvh }
.ps-min-h-\[100dvh\] { min-height: 100dvh }
.ps-w-\[calc\(100\%_-_32px\)\] { width: calc(100% - 32px) }
.ps-w-\[calc\(100\%_-_25px\)\] { width: calc(100% - 25px) }

/* ── تایپوگرافی ── */
.ps-text-sm  { font-size: 13px; line-height: 1.6 }
.ps-text-xxs { font-size: 11px; line-height: 1.6 }
.ps-text-xxxs{ font-size: 10px; line-height: 1.5 }
.ps-leading-\[17px\] { line-height: 17px }
.ps-leading-\[28px\] { line-height: 28px }

/* ── شفافیت ── */
.ps-opacity-40 { opacity: .4 }
.ps-opacity-60 { opacity: .6 }
.ps-opacity-70 { opacity: .7 }
.ps-opacity-75 { opacity: .75 }

/* ── رفتار ── */
.ps-overflow-y-auto { overflow-y: auto; overflow-x: hidden }
.ps-cursor-auto { cursor: auto }
.ps-border-t { border-top: 1px solid rgb(var(--colors-cold-gray) / .12) }

/* ── رنگ‌های شفاف (توکن‌های مرجع با آلفا) ── */
.ps-border-cold-gray\/10 { border-color: rgb(var(--colors-cold-gray) / .10) }
.ps-bg-cold-gray\/5       { background-color: rgb(var(--colors-cold-gray) / .05) }
.ps-bg-ghost-blue\/15     { background-color: rgb(var(--colors-ghost-blue) / .15) }
.ps-bg-green\/20          { background-color: rgb(var(--colors-green) / .20) }

/* ── دکمهٔ خاکستری (در مرجع نبود، از همان توکن‌های رنگ ساخته شد) ── */
.ps-button--color-cold-gray.ps-button--style-fill {
  background: rgb(var(--colors-cold-gray) / .14); color: rgb(var(--colors-cold-gray));
}
.ps-button--color-cold-gray.ps-button--style-fill:hover {
  background: rgb(var(--colors-cold-gray) / .22);
}
.ps-button--color-cold-gray.ps-button--style-soft {
  background: rgb(var(--colors-cold-gray) / .08); color: rgb(var(--colors-cold-gray));
}
.ps-button--color-cold-gray.ps-button--style-outline {
  border: 1px solid rgb(var(--colors-cold-gray) / .2); color: rgb(var(--colors-cold-gray));
}

/* ── هدف لمسی روی صفحات کوچک: دکمه‌های هدر و دکمه‌های ریز ── */
@media (max-width: 1100px) {
  .hdr-btn { width: 44px !important; height: 44px !important; min-width: 44px !important; }
  /* هدف لمسی استاندارد ۴۴px روی صفحهٔ لمسی. انتخابگر scoped + !important چون
     .ps-button.xs پایه در ps.css هم‌مقدمت است و بی‌آن، قاعدهٔ موبایل می‌بازد. */
  #content .ps-button.xs,
  #modal .ps-button.xs { min-height: 44px !important; padding-inline: 14px !important; font-size: 12px; }
  #content .ps-button.sm,
  #modal .ps-button.sm { min-height: 44px !important; padding-inline: 15px !important; }
  #content .ps-button:not(.xs):not(.sm) { min-height: 46px !important; }
  #content .ps-input { height: 46px; font-size: 14px; }
  .tabs .tab { min-height: 44px !important; padding-block: 11px !important; }
  #content .tbl td .ps-button { min-width: 74px; justify-content: center; }
  /* فاصلهٔ ستون دکمه‌های ردیف جدول تا ستون‌های قبلی تنگ نباشد */
  #content .tbl td:last-child { padding-inline-start: 10px; white-space: nowrap; }
}

/* ══ باگ چیدمان واقعی روی گوشی: ps-button و ps-input قاعدهٔ عرض نداشتند
   پس دکمه‌ها به اندازهٔ متن جمع می‌شدند و در کنار هم از کارت بیرون می‌زدند. */
.ps-button { display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; white-space: nowrap; max-width: 100%; }
.ps-button .label { display: inline-block; }
.ps-input {
  width: 100%; min-width: 0;
  height: 42px; padding-inline: 13px;
  border-radius: 12px;
  background: rgb(var(--colors-cold-gray) / .06);
  border: 1px solid rgb(var(--colors-cold-gray) / .14);
  color: rgb(var(--colors-cold-gray));
  font-family: inherit; font-size: 13.5px;
}
.ps-input::placeholder { color: rgb(var(--colors-cold-gray) / .5) }
.ps-input:focus { outline: none; border-color: rgb(var(--colors-ghost-blue) / .5);
  background: rgb(var(--colors-cold-gray) / .09); }

/* ══ سرریز افقی واقعی: کارت‌ها و جدول‌ها در گرید به min-width صفر نیاز دارند
   وگرنه محتوای بلند (مسیر فایل، کلید شیء) گرید را پهن‌تر از صفحه می‌کند. */
.grid > * { min-width: 0; }
.ps-card { min-width: 0; }
.tbl-scroll { max-width: 100%; overflow-x: auto; }
.tbl { width: 100%; }


/* ══════════════════════════════════════════════════════════════════════════
   آخرین صیقل ریسپانسیو (پس از سنجش واقعی روی ۳۶۰/۳۹۰/۷۶۸/۱۰۲۴/۱۳۶۶/۱۶۰۰)
   ══════════════════════════════════════════════════════════════════════════ */

/* سرریز واقعی در دید رویدادها: متن کلید/مسیر بلند داخل span.mono باید بشکند،
   وگرنه جدول را پهن‌تر از کارت می‌کند (sw573 در عرض 260 دیده شد). */
.mono { overflow-wrap: anywhere; word-break: break-word; }
.tbl td .mono, .tbl th .mono { max-width: 100%; }

/* جدول گوشی: ستون‌های کم‌اهمیت مخفی، ستون موضوع کشسان می‌شود */
@media (max-width: 1100px) {
  .tbl th, .tbl td { white-space: normal; }
}
/* نمایشگر افقی جدول باید معلوم باشد که اسکرول دارد */
.tbl-scroll { scrollbar-width: thin; }
.tbl-scroll::-webkit-scrollbar { height: 7px; }
.tbl-scroll::-webkit-scrollbar-thumb { background: rgb(var(--colors-cold-gray) / .34); }
/* هش: لبهٔ محو برای اینکه کاربر بفهمد ستون دیگری هم هست */
@media (max-width: 1100px) {
  .tbl-scroll {
    background:
      linear-gradient(to left, rgb(var(--colors-widget)) 30%, rgb(var(--colors-widget) / 0)) left center / 22px 100% no-repeat,
      linear-gradient(to right, rgb(var(--colors-widget)) 30%, rgb(var(--colors-widget) / 0)) right center / 22px 100% no-repeat,
      radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / .45), rgb(0 0 0 / 0)) left center / 12px 100% no-repeat,
      radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / .45), rgb(0 0 0 / 0)) right center / 12px 100% no-repeat;
    background-attachment: local, local, scroll, scroll;
  }
}

/* ردیف دکمه‌های عملیات در جدول: روی گوشی تمام‌عرض و راحت‌لمس */
@media (max-width: 700px) {
  #content .tbl td:last-child .row { gap: 8px !important; }
  #content .tbl td .ps-button { min-width: 78px; }
  /* ستون تاریخ/جزئیات در گوشی لازم نیست */
  .tbl .sm-hide { display: none !important; }
}

/* ── گِیج و نمودار روی صفحهٔ کوچک: بدون بریدگی و با نسبت درست ── */
@media (max-width: 700px) {
  .gauge { margin-inline: auto; }
  .gauge svg { width: 176px; height: 176px; }
  .gauge .mid b { font-size: 32px; }
  .chart-box { height: 190px !important; }
  .chart-box.tall { height: 230px !important; }
  .legend { flex-wrap: wrap; gap: 8px 14px; }
}

/* ── لپ‌تاپ باریک (۱۰۲۴): چهار کارت آماری دو در دو بماند نه چهار در یک ── */
@media (min-width: 701px) and (max-width: 1180px) {
  .grid.c4 { grid-template-columns: 1fr 1fr; }
  .grid.c3 { grid-template-columns: 1fr 1fr; }
}
/* ── تبلت: دو ستونه ── */
@media (min-width: 1101px) and (max-width: 1300px) {
  .grid.s2 { grid-template-columns: 1fr; }
}
/* ── صفحهٔ بزرگ: گرید ۴ ستونه شکسته و کشیده نشود ── */
@media (min-width: 1500px) {
  #content { max-width: 1500px; margin-inline: auto; }
}

/* روی تبلت هم ستون‌های کم‌اهمیت باید بروند تا جدول از کارت بیرون نزند
   (پیش‌تر فقط زیر ۷۰۰px مخفی می‌شد و در ۷۶۸px سرریز می‌داد). */
@media (max-width: 1100px) {
  .sm-hide { display: none !important; }
}
/* ستون خروجی کارها: متن خام shell (با کدهای رنگ ANSI) فوراً بُر می‌خورد */
#task-body td.mono.xsmall {
  max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  font-size: 10.5px; line-height: 1.65; color: rgb(var(--colors-cold-gray) / .78);
}
/* سقف عرض قدیمی .mono متن را وسط کلمه قطع می‌کرد؛ حالا فقط شکستن */
.tbl td.mono { max-width: none; }

/* ── باگ واقعی گوشی: در جدول سرویس‌ها دو دکمهٔ «ری‌لود/ری‌استارت» کنار هم
   جا نمی‌شدند و در RTL دکمهٔ دوم ۲۴px بیرون کادر می‌افتاد؛ کاربر باید افقی
   اسکرول می‌کرد تا آن را ببیند. زیر ۷۰۰px عمودی روی هم می‌نشینند. */
@media (max-width: 700px) {
  #content .tbl td:last-child .row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px !important;
  }
  #content .tbl td:last-child .ps-button { width: 100%; min-width: 0 !important; }
  /* ستون سرویس آزاد تا نام‌های بلند در یک خط جا شوند */
  #content .tbl td:first-child { min-width: 0; }
  #content .tbl td:first-child .row { flex-wrap: wrap; row-gap: 4px; }
}

/* ══ تور اطمینان ضد قفل اسکرول ══════════════════════════════════════════
   پوستهٔ والد `position:fixed;inset:0` است. اگر به هر دلیلی اسکرول‌کنندهٔ
   داخلی از کار بیفتد (هندسهٔ غیرمنتظره، افزونه، یا media query دیگر)،
   خودِ همین کادر باید اسکرول شود تا کارِ کاربر هرگز قفل نشود.
   `overflow:auto` روی عنصر fixed بی‌خطر است: وقتی محتوا جا شود،
   اسکرول‌باری نشان داده نمی‌شود. */
div.ps-fixed.ps-inset-0 { overflow: visible; }
@supports (height: 100dvh) {
  div.ps-fixed.ps-inset-0 { overflow: hidden auto; overscroll-behavior: contain; }
}

/* روی صفحهٔ لمسی، آیتم منو و دکمه‌ها مقصد لمس ۴۴px را حفظ کنند */
@media (pointer: coarse) {
  .main-menu--item, .main-menu--item .menu-item { min-height: 46px !important; }
}


/* ══════════════════════════════════════════════════════════════════════════
   معماری اسکرول — یک منبع حقیقت، مستقل از عرض صفحه
   ══════════════════════════════════════════════════════════════════════════
   ریشهٔ باگ «اسکرول کار نمی‌کند» دو چیز بود:

   ۱. کلاس `ps-h-screen` در ps.css **تعریف نشده** — یک no-op. پس ردیف فلکس
      هیچ ارتفاعی نداشت و به اندازهٔ محتوا رشد می‌کرد (۱۰۸۴px در کادر ۹۰۰px).
   ۲. پوستهٔ والد `position:fixed; inset:0` است و پیش‌تر روی موبایل
      `display:block; height:auto` می‌گرفت. نتیجه: محتوا داخل یک کادر با
      `overflow:visible` کش می‌آمد؛ html/body به اندازهٔ ویوپورت می‌ماندند
      (scrollHeight == clientHeight) و `<main>` هم اسکرول‌کننده نبود.
      پس هیچ عنصری اسکرول نمی‌شد — حتی `window.scrollTo(0,600)` صفر می‌ماند.

   راه‌حل: ارتفاع را از والد `fixed` با درصد بگیر (نه vh/dvh که با نوار آدرس
   موبایل می‌جنگد)، و در هر سطح `min-height:0` بگذار تا فلکس‌آیتم‌ها مجبور
   به کوچک‌شدن شوند. اسکرول‌کنندهٔ واحد: `main.main-content`. */

/* پوستهٔ والد: کادر قطعی هم‌اندازهٔ ویوپورت */
div.ps-fixed.ps-inset-0 { height: 100%; overflow: hidden; }

/* ردیف فلکس: ارتفاع صددرصد والد قطعی، بدون رشد با محتوا */
.ps-flex.ps-h-screen {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* سایدبار: ستون مستقل با اسکرول داخلی خودش */
aside.prime-panel { min-height: 0; }
aside.prime-panel .main-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ستون محتوا: باید بتواند کوچک شود وگرنه فرزندش را بزرگ می‌کند */
.main-content.ps-flex-col { min-height: 0; }

/* اسکرول‌کنندهٔ یگانه */
main.main-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* روی گوشی سایدبار آف‌کانواس است، پس اسکرول داخلی لازم ندارد */
@media (max-width: 1100px) {
  aside.prime-panel { height: 100dvh; }
  aside.prime-panel .main-menu { overflow-y: auto; overscroll-behavior: contain; }
}

/* هیچ حالتی نباید اسکرول را قفل کند: اگر چیدمان عوض شد، پوستهٔ والد هم اسکرول می‌شود */
@supports (overflow: clip) {
  div.ps-fixed.ps-inset-0 { overflow: clip; }
}
div.ps-fixed.ps-inset-0:has(> .ps-flex.ps-h-screen > .main-content > main) { overflow: hidden; }

/* ═══ هدف لمسی: هیچ عنصر تعاملی زیر ۳۲px نباشد ══════════════════════
   ممیزی نشان داد ردیف‌های تعاملی (تب‌ها، دکمه‌های ریز داخل کارت) می‌توانند
   تا ۱۹px فشرده شوند. روی صفحهٔ لمسی این زیر حد استاندارد است. */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs .tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding-block: 6px;
}
@media (pointer: coarse) {
  .tabs .tab { min-height: 40px; }
  .ps-button.sm, .ps-button.xs { min-height: 38px; }
}
/* مسیر راهنما هم یک لینک است؛ ۱۹px ارتفاع داشت. */
.breadcrumb-url { display: inline-flex; align-items: center; min-height: 26px; padding-inline: 2px; }

/* ═══ تم روشن: خوانایی متن‌های ضعیف ══════════════════════════════════
   ممیزی تصویری نشان داد placeholder جستجو و زیرنویس کارت‌ها در تم روشن
   کمرنگ‌تر از حد مطلوب‌اند. هر دو رنگ هاردکد داشتند. */
html.light ::placeholder { color: rgb(96 114 132); opacity: 1; }
html.light .stat-tile .sub,
html.light .stat-tile .lbl,
html.light .muted.small,
html.light .small,
html.light .xsmall { color: rgb(72 90 108); }
html.light .chart-box .legend span { color: rgb(56 72 88); }
