/* ══════════════════════════════════════════════════════════════════════════
   کندول — تحول منو (گروه‌بندی‌شده) + انیمیشن‌های تازه
   ══════════════════════════════════════════════════════════════════════════
   چرا: منوی قبلی ۱۷ آیتم تخت بود و پیدا کردنش کند. الان ۵ گروه با تیتر
   دارد. این فایل فقط «چهرهٔ» منو را می‌سازد؛ ساختار از shell.php می‌آید.

   همه‌چیز محلی است — بدون CDN، بدون وابستگی بیرونی (شرط بقا در نت ملی).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── تیتر گروه ────────────────────────────────────────────────────────── */
.nav-group { width: 100%; margin-bottom: 2px; }

.nav-group-head {
  display: flex; align-items: center; gap: 8px;
  width: calc(100% - 25px);
  margin: 9px 10px 3px 15px;
  padding: 7px 11px;
  border: 0; border-radius: 9px;
  background: none; color: rgb(var(--colors-gray));
  font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; text-align: start;
  position: relative;
  transition: background .18s ease, color .18s ease;
}
.nav-group-head:hover { background: rgb(var(--colors-cold-gray) / .07); color: rgb(var(--colors-ghost-blue)); }
.nav-group-head:focus-visible { outline: 2px solid rgb(var(--colors-ghost-blue) / .5); outline-offset: 1px; }

.nav-group-ico { display: flex; opacity: .8; flex: none; }
.nav-group-title { flex: 1; letter-spacing: .2px; }

/* شمارندهٔ آیتم‌های گروه */
.nav-group-count {
  flex: none; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 100px; font-size: 11px; font-weight: 700;
  background: rgb(var(--colors-cold-gray) / .12);
  color: rgb(var(--colors-gray));
  font-variant-numeric: tabular-nums;
  transition: background .2s ease, color .2s ease;
}
/* فلش جمع‌شدن: در حالت باز به سمت بالا، در حالت بسته به راست (RTL) */
.nav-group-chev { display: flex; flex: none; opacity: .55; transition: transform .26s cubic-bezier(.2,.7,.3,1); }
.nav-group.closed .nav-group-chev { transform: rotate(90deg); }

/* ── بدنهٔ گروه: با انیمیشن ارتفاع باز/بسته می‌شود ───────────────────── */
.nav-group-body {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows .3s cubic-bezier(.2,.7,.3,1), opacity .24s ease;
  opacity: 1;
}
.nav-group-inner { min-height: 0; overflow: hidden; }
.nav-group.closed .nav-group-body { grid-template-rows: 0fr; opacity: 0; }
.nav-group.closed { margin-bottom: 0; }

/* ── آیتم منو: چهرهٔ تازه ─────────────────────────────────────────────── */
#nav .main-menu--item .menu-item {
  position: relative;
  transition: background .18s ease, box-shadow .2s ease, transform .16s cubic-bezier(.2,.7,.3,1);
}
#nav .main-menu--item .menu-item::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 50%;
  width: 3px; height: 0; border-radius: 100px;
  background: rgb(var(--colors-ghost-blue));
  transform: translateY(-50%);
  transition: height .26s cubic-bezier(.2,.7,.3,1);
}
#nav .main-menu--item:hover .menu-item::before { height: 42%; }
#nav .main-menu--item.on .menu-item::before { height: 62%; }

/* آیکون: کاشی کوچک رنگی که با هاور برجسته می‌شود */
#nav .main-menu--item .menu-item > span:first-child {
  border-radius: 8px;
  transition: background .2s ease, color .2s ease, transform .2s cubic-bezier(.2,.7,.3,1);
}
#nav .main-menu--item:hover .menu-item > span:first-child { transform: scale(1.06); }
#nav .main-menu--item.on .menu-item > span:first-child {
  background: rgb(var(--colors-ghost-blue) / .15);
}

/* آیتم فعال: پس‌زمینهٔ گرادیانی نرم به‌جای رنگ تخت */
#nav .main-menu--item.on .menu-item {
  background: linear-gradient(to left,
    rgb(var(--colors-ghost-blue) / .17), rgb(var(--colors-ghost-blue) / .05));
}
#nav .main-menu--item.on .title { font-weight: 700; }

/* ── نشان هشدار کنار آیتم (از panel.js پر می‌شود) ─────────────────────── */
.menu-badge {
  margin-inline-start: auto; flex: none;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 100px; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  animation: mb-pop .34s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes mb-pop { from { transform: scale(.4); opacity: 0; } }
.menu-badge[hidden] { display: none; }
.menu-badge.crit { background: rgb(var(--colors-red)); color: #fff;
  box-shadow: 0 0 0 0 rgb(var(--colors-red) / .5); animation: mb-pop .34s cubic-bezier(.2,.9,.3,1.4), mb-pulse 2.4s ease-in-out infinite .34s; }
.menu-badge.warn { background: rgb(var(--colors-orange)); color: #fff; }
.menu-badge.info { background: rgb(var(--colors-ghost-blue)); color: #fff; }
@keyframes mb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(var(--colors-red) / .45); }
  50%      { box-shadow: 0 0 0 5px rgb(var(--colors-red) / 0); }
}

/* ── نوار جستجو: درخشش هنگام فوکوس ───────────────────────────────────── */
#nav-search {
  transition: border-color .2s ease, box-shadow .2s ease;
}
#nav-search:focus {
  border-color: rgb(var(--colors-ghost-blue) / .55);
  box-shadow: 0 0 0 3px rgb(var(--colors-ghost-blue) / .12);
  outline: none;
}

/* جستجو: گروهی که نتیجه ندارد محو می‌شود (panel.js کلاس می‌دهد) */
.nav-group.no-match { display: none; }
.nav-group-body mark {
  background: rgb(var(--colors-ghost-blue) / .28);
  color: inherit; border-radius: 3px; padding: 0 2px;
}

/* ── تیتر بالای منو: نشانگر بخش جاری با اسلاید ────────────────────────── */
.menu-head { position: relative; overflow: hidden; }
.menu-head::after {
  content: ''; position: absolute; bottom: 0; inset-inline-start: 0;
  height: 2px; width: 100%;
  background: linear-gradient(90deg,
    transparent, rgb(var(--colors-ghost-blue)), transparent);
  opacity: .8;
  animation: mh-scan 4.5s ease-in-out infinite;
}
@keyframes mh-scan { 0%,100% { transform: translateX(-60%); } 50% { transform: translateX(60%); } }

/* ── موبایل: تیتر گروه‌ها کمی فشرده‌تر ─────────────────────────────────── */
@media (max-width: 1000px) {
  .nav-group-head { font-size: 11.5px; padding: 6px 10px; margin-top: 7px; }
  .nav-group-count { min-width: 18px; height: 18px; font-size: 10.5px; }
}

/* ── احترام به prefers-reduced-motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .nav-group-chev, .nav-group-body, #nav .main-menu--item .menu-item::before,
  .menu-head::after, .menu-badge, .menu-badge.crit {
    transition: none !important; animation: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   «فضای ابری» — مرورگر باگت، انتخاب گروهی، نوار ظرفیت
   ══════════════════════════════════════════════════════════════════════════ */

/* ── نوار ظرفیت با هشدار رنگی ─────────────────────────────────────────── */
.cb-gauge { display: flex; flex-direction: column; gap: 9px; }
.cb-gauge-bar { height: 12px; border-radius: 100px; overflow: hidden;
  background: rgb(var(--colors-cold-gray) / .13); }
.cb-gauge-bar > i { display: block; height: 100%; border-radius: 100px;
  transition: width .8s cubic-bezier(.2,.7,.3,1);
  background: linear-gradient(90deg, rgb(var(--colors-sea-green)), rgb(var(--colors-green))); }
.cb-gauge.cb-warn .cb-gauge-bar > i { background: linear-gradient(90deg, rgb(var(--colors-orange)), #d9a03a); }
.cb-gauge.cb-crit .cb-gauge-bar > i { background: linear-gradient(90deg, rgb(var(--colors-red)), #e0567c);
  animation: cb-low 2.4s ease-in-out infinite; }
@keyframes cb-low { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
.cb-gauge-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.cb-gauge-meta b { font-size: 19px; font-weight: 700; }
.cb-gauge-pct { font-variant-numeric: tabular-nums; font-weight: 700; }
.cb-alarm { color: rgb(var(--colors-red)); }
.cb-acts { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }

/* ── سر جدول + صافی ───────────────────────────────────────────────────── */
.cb-browser { overflow: hidden; }
.cb-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cb-head-acts { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.cb-filter { width: 190px; height: 34px; font-size: 12.5px; }
@media (max-width: 700px) { .cb-filter { width: 130px; } .cb-head-acts { margin-inline-start: 0; } }

/* ── مسیر راهنما (breadcrumb) ─────────────────────────────────────────── */
.cb-crumbs { display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
  padding: 9px 11px; border-radius: 10px; margin-bottom: 11px;
  background: rgb(var(--colors-cold-gray) / .06);
  border: 1px solid rgb(var(--colors-cold-gray) / .09);
  font-size: 12.5px; }
.cb-crumb { border: 0; background: none; color: rgb(var(--colors-ghost-blue));
  font: inherit; font-weight: 600; cursor: pointer; padding: 2px 5px; border-radius: 6px;
  transition: background .16s ease; direction: ltr; }
.cb-crumb:hover:not(:disabled) { background: rgb(var(--colors-ghost-blue) / .13); }
.cb-crumb.is-last { color: rgb(var(--colors-cold-gray)); cursor: default; font-weight: 700; }
.cb-crumb-sep { color: rgb(var(--colors-gray)); opacity: .55; }

/* ── ردیف‌های جدول ────────────────────────────────────────────────────── */
.cb-tbl td { padding-block: 9px; }
.cb-tick { width: 34px; text-align: center; }
.cb-tick input { width: 15px; height: 15px; accent-color: rgb(var(--colors-ghost-blue)); cursor: pointer; }
.cb-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cb-ico { display: flex; flex: none; color: rgb(var(--colors-gray)); }
.cb-ico.is-dir { color: rgb(var(--colors-ghost-blue)); }
.cb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.cb-size { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cb-count { white-space: nowrap; }
.cb-act { width: 74px; text-align: end; white-space: nowrap; }
.cb-btn { border: 0; background: rgb(var(--colors-cold-gray) / .09); color: rgb(var(--colors-cold-gray));
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer; display: inline-grid;
  place-items: center; margin-inline-start: 4px;
  transition: background .16s ease, color .16s ease, transform .16s ease; }
.cb-btn:hover { background: rgb(var(--colors-ghost-blue) / .18); color: rgb(var(--colors-ghost-blue)); transform: translateY(-1px); }
.cb-btn.crit:hover { background: rgb(var(--colors-red) / .2); color: rgb(var(--colors-red)); }

/* ردیف پوشه: قابل کلیک و متمایز */
.cb-tbl tr.crumb-row { cursor: pointer; }
.cb-tbl tr.crumb-row:hover { background: rgb(var(--colors-ghost-blue) / .07); }
.cb-tbl tr.crumb-row .cb-label { font-weight: 600; }
/* ردیف انتخاب‌شده */
.cb-tbl tr:has(.cb-check:checked) { background: rgb(var(--colors-ghost-blue) / .09); }

/* ── نوار انتخاب گروهی ────────────────────────────────────────────────── */
.cb-selbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 13px; margin-bottom: 11px; border-radius: 11px;
  background: rgb(var(--colors-ghost-blue) / .11);
  border: 1px solid rgb(var(--colors-ghost-blue) / .3);
  font-size: 12.5px; font-weight: 600;
  animation: cb-slide .28s cubic-bezier(.2,.7,.3,1);
}
@keyframes cb-slide { from { opacity: 0; transform: translateY(-6px); } }
.cb-selbar-acts { margin-inline-start: auto; display: flex; gap: 7px; flex-wrap: wrap; }

.cb-err { display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: rgb(var(--colors-red)); padding: 10px 12px; margin-bottom: 11px;
  background: rgb(var(--colors-red) / .09); border-radius: 10px;
  border: 1px solid rgb(var(--colors-red) / .28); }
.cb-foot { margin-top: 11px; padding-top: 10px;
  border-top: 1px solid rgb(var(--colors-cold-gray) / .1); }

/* اسکلت بارگذاری داخل جدول */
.cb-tbl .sk { animation: cv-shimmer 1.35s ease-in-out infinite; }

/* موبایل: ستون‌های کم‌اهمیت حذف، نام باریک‌تر */
/* ══ روی گوشی ستون «نام» باید واقعاً فضا بگیرد ══════════════════════════
   `table-layout:fixed` (که پیش‌تر از panel.css و با ترتیب اشتباه اعمال
   می‌شد) ستون نام را تا ۱۸px جمع می‌کرد و «backups» بُر می‌خورد.
   حالا چیدمان خودکار است، ستون‌های کم‌اهمیت حذف می‌شوند و نام باقی فضا را
   می‌گیرد؛ متن هم شکسته می‌شود تا هرگز از کارت بیرون نزند. */
@media (max-width: 700px) {
  .cb-tbl { table-layout: auto; }
  .cb-label { max-width: none; min-width: 0; }
  .cb-name { min-width: 90px; flex-wrap: wrap; row-gap: 2px; }
  .cb-size, .cb-count { white-space: normal; }
  .cb-tick { width: 26px; }
  .cb-act { width: auto; }
  .cb-selbar-acts { margin-inline-start: 0; width: 100%; }
  /* ستون‌های کم‌اهمیت جا باز کنند: تاریخ/تعداد در گوشی لازم نیست */
  .cb-tbl th:nth-child(n+3):not(:last-child),
  .cb-tbl td:nth-child(n+3):not(:last-child) { display: none; }
}
