/* ===================================================================
   آرتاتسک — سیستم طراحی
   دارک‌مود پیش‌فرض، راست‌به‌چپ، فونت وزیرمتن
   =================================================================== */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ---------- توکن‌ها: تم تیره ---------- */
:root {
  --bg:            #15202b;
  --bg-elevated:   #1b2834;
  --surface:       rgba(255, 255, 255, 0.042);
  --surface-hover: rgba(255, 255, 255, 0.078);
  --surface-solid: #1d2b38;
  --border:        rgba(255, 255, 255, 0.088);
  --border-strong: rgba(255, 255, 255, 0.17);

  --text:          #e6edf3;
  --text-soft:     #b6c4d2;
  --muted:         #8396a8;
  --faint:         #5b6c7c;

  --accent:        #19c3b2;
  --accent-soft:   #5eead4;
  --accent-2:      #38bdf8;
  --accent-ink:    #04231f;
  --accent-wash:   rgba(25, 195, 178, 0.15);
  --accent-ring:   rgba(25, 195, 178, 0.4);

  --ok:      #34d399;
  --warn:    #fbbf24;
  --danger:  #fb7185;
  --info:    #60a5fa;

  --ok-wash:     rgba(52, 211, 153, 0.15);
  --warn-wash:   rgba(251, 191, 36, 0.15);
  --danger-wash: rgba(251, 113, 133, 0.15);
  --info-wash:   rgba(96, 165, 250, 0.15);

  --ok-ink:     #04291c;
  --warn-ink:   #2b1a00;
  --danger-ink: #2d0812;

  --r-xs: 7px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --sh-md: 0 6px 18px -6px rgba(0, 0, 0, 0.4);
  --sh-lg: 0 20px 48px -16px rgba(0, 0, 0, 0.52);
  --sh-glow: 0 10px 30px -14px rgba(25, 195, 178, 0.55);

  --sidebar-w: 248px;
  --topbar-h: 62px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --page-grad: radial-gradient(1100px 620px at 88% -8%, rgba(25, 195, 178, 0.13), transparent 62%),
               radial-gradient(900px 560px at 4% 4%, rgba(56, 189, 248, 0.09), transparent 58%);
  color-scheme: dark;
}

/* ---------- توکن‌ها: تم روشن ---------- */
[data-theme='light'] {
  --bg:            #f2f6f7;
  --bg-elevated:   #ffffff;
  --surface:       rgba(16, 38, 45, 0.036);
  --surface-hover: rgba(16, 38, 45, 0.065);
  --surface-solid: #ffffff;
  --border:        rgba(16, 38, 45, 0.095);
  --border-strong: rgba(16, 38, 45, 0.18);

  --text:          #14222b;
  --text-soft:     #3d525f;
  --muted:         #6a808e;
  --faint:         #9aacb8;

  --accent:        #0d9488;
  --accent-soft:   #14b8a6;
  --accent-2:      #0ea5e9;
  --accent-ink:    #ffffff;
  --accent-wash:   rgba(13, 148, 136, 0.11);
  --accent-ring:   rgba(13, 148, 136, 0.32);

  --ok:      #0f9f6e;
  --warn:    #c2740a;
  --danger:  #e11d48;
  --info:    #0284c7;

  --ok-wash:     rgba(15, 159, 110, 0.1);
  --warn-wash:   rgba(194, 116, 10, 0.1);
  --danger-wash: rgba(225, 29, 72, 0.1);
  --info-wash:   rgba(2, 132, 199, 0.1);

  --ok-ink:     #ffffff;
  --warn-ink:   #ffffff;
  --danger-ink: #ffffff;

  --sh-sm: 0 1px 2px rgba(20, 34, 43, 0.07);
  --sh-md: 0 6px 18px -8px rgba(20, 34, 43, 0.16);
  --sh-lg: 0 20px 48px -18px rgba(20, 34, 43, 0.22);
  --sh-glow: 0 10px 30px -14px rgba(13, 148, 136, 0.4);

  --page-grad: radial-gradient(1100px 620px at 88% -8%, rgba(13, 148, 136, 0.09), transparent 62%),
               radial-gradient(900px 560px at 4% 4%, rgba(14, 165, 233, 0.07), transparent 58%);
  color-scheme: light;
}

/* ---------- پایه ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  background: var(--bg);
  background-image: var(--page-grad);
  background-attachment: fixed;
  color: var(--text);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.5; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p  { margin: 0 0 10px; }

a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

::selection { background: var(--accent-ring); color: #fff; }

/* ---------- اسکرول‌بار ---------- */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

.scroll-y { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.scroll-x { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---------- کمک‌کلاس‌ها ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { display: flex; align-items: center; justify-content: center; }

.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.faint { color: var(--faint); }
.tiny { font-size: 11px; }
.small { font-size: 12px; }
.big { font-size: 16px; }
.bold { font-weight: 600; }
.heavy { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gradient-text {
  background: linear-gradient(110deg, var(--accent-soft), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hide { display: none !important; }

/* ---------- چیدمان اصلی ---------- */
.shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent 40%);
  border-inline-start: 1px solid var(--border);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 30;
}
[data-theme='light'] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--sh-glow);
  flex: 0 0 auto;
}
.brand-text { line-height: 1.25; min-width: 0; }
.brand-text b { font-size: 14.5px; display: block; }
.brand-text span { font-size: 10.5px; color: var(--muted); display: block; }

.sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: 10px 10px 14px; }

.nav-section {
  font-size: 10.5px;
  color: var(--faint);
  padding: 14px 10px 6px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
  text-decoration: none;
  position: relative;
  font-size: 13.5px;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--accent-wash);
  color: var(--text);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-item .ic { flex: 0 0 18px; opacity: 0.85; display: grid; place-items: center; }
.nav-item.active .ic { opacity: 1; color: var(--accent-soft); }
.nav-item .count {
  margin-inline-start: auto;
  font-size: 11px;
  background: var(--surface-hover);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.nav-item .count.hot { background: var(--danger); color: var(--danger-ink); }

.nav-project {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-soft);
  font-size: 13px;
  text-decoration: none;
}
.nav-project:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav-project.active { background: var(--surface-hover); color: var(--text); font-weight: 600; }
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.sidebar-foot { flex: 0 0 auto; padding: 10px; border-top: 1px solid var(--border); }

.main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px);
  z-index: 20;
}

.page { flex: 1 1 auto; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.page-pad { padding: 18px; }
.page-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 18px; }

.page-head { margin-bottom: 16px; }
.page-head h1 { margin-bottom: 2px; }

/* ---------- دکمه ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.08s var(--ease);
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: var(--sh-glow);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.08); border-color: transparent; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: transparent; }

.btn-danger { background: var(--danger-wash); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--danger-ink); }

.btn-ok { background: var(--ok-wash); border-color: transparent; color: var(--ok); }
.btn-ok:hover { background: var(--ok); color: var(--ok-ink); }

.btn-sm { height: 29px; padding: 0 10px; font-size: 12px; border-radius: var(--r-xs); }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  position: relative;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.sm { width: 27px; height: 27px; border-radius: var(--r-xs); }
.icon-btn.active { background: var(--accent-wash); color: var(--accent-soft); }

.icon-btn .pip {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: var(--danger-ink);
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- کارت ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  backdrop-filter: blur(8px);
}
.card-solid { background: var(--surface-solid); backdrop-filter: none; box-shadow: var(--sh-sm); }
.card-pad-0 { padding: 0; }
.card-hover { transition: border-color 0.16s var(--ease), transform 0.16s var(--ease); }
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-title { font-size: 13.5px; font-weight: 600; }

/* ---------- فرم ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.textarea { min-height: 86px; resize: vertical; line-height: 1.8; }
.select { appearance: none; cursor: pointer; padding-inline-end: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(10px) calc(50% - 2px), calc(15px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.input-flush {
  background: transparent;
  border-color: transparent;
  padding-inline: 0;
}
.input-flush:focus { box-shadow: none; border-color: transparent; }

.search-box { position: relative; }
.search-box .input { padding-inline-start: 34px; }
.search-box .ic {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.switch {
  width: 38px;
  height: 21px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background 0.18s var(--ease);
  flex: 0 0 auto;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2.5px;
  inset-inline-end: 2.5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s var(--ease);
  box-shadow: var(--sh-sm);
}
.switch.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch.on::after { transform: translateX(-17px); }
[dir='rtl'] .switch.on::after { transform: translateX(-17px); }

.checkbox {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease);
  color: transparent;
}
.checkbox:hover { border-color: var(--accent); }
.checkbox.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-ink);
}

/* ---------- تراشه و نشان ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--surface-hover);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 100%;
}
.chip.tint {
  background: color-mix(in srgb, currentColor 15%, transparent);
  color: var(--c, var(--accent-soft));
}
.chip-btn { cursor: pointer; border: none; font-family: inherit; }
.chip-btn:hover { filter: brightness(1.2); }
.chip.on { box-shadow: 0 0 0 1.5px currentColor inset; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: var(--r-xs);
  font-size: 10.5px;
  font-weight: 600;
  background: var(--surface-hover);
  color: var(--muted);
  white-space: nowrap;
}
.badge-ok     { background: var(--ok-wash);     color: var(--ok); }
.badge-warn   { background: var(--warn-wash);   color: var(--warn); }
.badge-danger { background: var(--danger-wash); color: var(--danger); }
.badge-info   { background: var(--info-wash);   color: var(--info); }
.badge-accent { background: var(--accent-wash); color: var(--accent-soft); }

/* ---------- آواتار ---------- */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 42px; height: 42px; font-size: 15px; }
.avatar.xl { width: 68px; height: 68px; font-size: 24px; }

.avatar-wrap { position: relative; flex: 0 0 auto; display: inline-block; }
.presence {
  position: absolute;
  bottom: -1px;
  inset-inline-end: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 2px var(--bg);
}
.presence.online { background: var(--ok); }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack > * { margin-inline-start: -7px; box-shadow: 0 0 0 2px var(--bg-elevated); }
.avatar-stack > *:first-child { margin-inline-start: 0; }
.avatar-stack .more {
  background: var(--surface-solid);
  color: var(--muted);
  font-size: 9.5px;
  border: 1px solid var(--border);
}

/* ---------- نوار پیشرفت ---------- */
.progress {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-hover);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s var(--ease);
}
.progress.thin { height: 4px; }
.progress.ok > i   { background: linear-gradient(90deg, #16a34a, var(--ok)); }
.progress.warn > i { background: linear-gradient(90deg, #d97706, var(--warn)); }

.ring { --p: 0; --size: 48px; --w: 5px; width: var(--size); height: var(--size); position: relative; flex: 0 0 auto; }
.ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-hover) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--w)), #000 calc(100% - var(--w)));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--w)), #000 calc(100% - var(--w)));
}
.ring > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- آمار ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 14px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c, var(--accent)), transparent);
  opacity: 0.7;
}
.stat .label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat .foot { font-size: 11px; color: var(--faint); }

/* ---------- کانبان ---------- */
.kanban {
  flex: 1 1 auto;
  display: flex;
  gap: 13px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
  scroll-snap-type: x proximity;
}

.kcol {
  width: 294px;
  flex: 0 0 294px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  max-height: 100%;
  scroll-snap-align: start;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.kcol.drop-on {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.kcol-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 13px 10px;
}
.kcol-head .name { font-weight: 600; font-size: 13.5px; }
.kcol-head .cnt {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-hover);
  padding: 0 7px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.kcol-head .cnt.over { background: var(--danger-wash); color: var(--danger); }
.kcol-bar { height: 3px; margin: 0 13px; border-radius: var(--r-pill); opacity: 0.85; }

.kcol-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 11px 6px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 60px;
}
.kcol-foot { flex: 0 0 auto; padding: 4px 11px 11px; }

.tcard {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  user-select: none;
}
.tcard:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.tcard.dragging { opacity: 0.4; transform: rotate(1.5deg) scale(0.98); }
.tcard.done { opacity: 0.6; }
.tcard.done .ttitle { text-decoration: line-through; text-decoration-color: var(--faint); }

.tcard .prio {
  position: absolute;
  inset-inline-start: 0;
  top: 13px;
  bottom: 13px;
  width: 3px;
  border-radius: var(--r-pill);
}
.ttitle { font-size: 13px; font-weight: 500; line-height: 1.65; }
.tcode { font-size: 10.5px; color: var(--faint); font-weight: 600; letter-spacing: 0.02em; }

.tmeta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.tmeta .mi { display: inline-flex; align-items: center; gap: 3px; }
.tmeta .mi.danger { color: var(--danger); }
.tmeta .mi.warn { color: var(--warn); }

.label-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.label-dot { height: 4px; width: 22px; border-radius: var(--r-pill); }

/* ---------- کشیدن و رها کردن ---------- */
.drop-line {
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  margin: -4px 0;
}

/* ---------- مودال ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 12, 0.66);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fade 0.16s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.2s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal.wide { max-width: 760px; }
.modal.narrow { max-width: 400px; }

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { flex: 1 1 auto; }
.modal-body { flex: 1 1 auto; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 9px;
  justify-content: flex-start;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- کشوی جزئیات ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 12, 0.6);
  backdrop-filter: blur(4px);
  z-index: 90;
  animation: fade 0.16s var(--ease);
}
.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(560px, 100vw);
  background: var(--bg-elevated);
  border-inline-end: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  z-index: 91;
  display: flex;
  flex-direction: column;
  animation: slide-in 0.24s var(--ease);
}
@keyframes slide-in { from { transform: translateX(-100%); } }
[dir='rtl'] .drawer { animation-name: slide-in-rtl; }
@keyframes slide-in-rtl { from { transform: translateX(100%); } }

/* ---------- توست ---------- */
.toasts {
  position: fixed;
  bottom: 18px;
  inset-inline-start: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
  max-width: 340px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  font-size: 13px;
  pointer-events: auto;
  animation: toast-in 0.22s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.toast .ic { flex: 0 0 auto; }
.toast.ok .ic     { color: var(--ok); }
.toast.err .ic    { color: var(--danger); }
.toast.warn .ic   { color: var(--warn); }
.toast.info .ic   { color: var(--info); }

/* ---------- منوی کشویی ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 190px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 5px;
  z-index: 60;
  animation: pop 0.14s var(--ease);
  max-height: 60vh;
  overflow-y: auto;
}
.menu.start { inset-inline-end: auto; inset-inline-start: 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  text-align: start;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-hover); color: var(--text); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-wash); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 0; }

/* ---------- تب ---------- */
.tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow-x: auto;
}
.tab {
  padding: 6px 13px;
  border-radius: var(--r-xs);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.on { background: var(--bg-elevated); color: var(--text); box-shadow: var(--sh-sm); }

/* ---------- جدول ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: start;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 1;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table tbody tr:hover td { background: var(--surface); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- تقویم ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.cal-dow {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  padding-bottom: 3px;
}
.cal-day {
  min-height: 102px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  transition: border-color 0.15s var(--ease);
}
.cal-day:hover { border-color: var(--border-strong); }
.cal-day.other { opacity: 0.4; }
.cal-day.today { border-color: var(--accent); background: var(--accent-wash); }
.cal-day.holiday .cal-num { color: var(--danger); }
.cal-num { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-soft); }
.cal-day.today .cal-num { color: var(--accent-soft); }
.cal-pill {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--surface-hover);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-inline-start: 2.5px solid var(--c, var(--accent));
  line-height: 1.6;
}
.cal-pill:hover { background: var(--border-strong); }

/* انتخابگر تاریخ شمسی */
.dp {
  width: 272px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 11px;
  z-index: 70;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 10px; color: var(--faint); padding: 3px 0; font-weight: 600; }
.dp-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-cell:hover { background: var(--surface-hover); color: var(--text); }
.dp-cell.other { color: var(--faint); opacity: 0.55; }
.dp-cell.today { box-shadow: 0 0 0 1px var(--accent) inset; color: var(--accent-soft); }
.dp-cell.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 700;
}

/* ---------- گانت ---------- */
.gantt { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.gantt-scroll { flex: 1 1 auto; overflow: auto; position: relative; }
.gantt-inner { position: relative; min-width: max-content; }

.gantt-head {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.gantt-names {
  position: sticky;
  inset-inline-start: 0;
  z-index: 6;
  width: 232px;
  flex: 0 0 232px;
  background: var(--bg-elevated);
  border-inline-end: 1px solid var(--border);
}
.gantt-day {
  width: 34px;
  flex: 0 0 34px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 5px 0;
  border-inline-end: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.gantt-day.weekend { background: var(--surface); color: var(--danger); }
.gantt-day.today { background: var(--accent-wash); color: var(--accent-soft); font-weight: 700; }

.gantt-row { display: flex; height: 40px; border-bottom: 1px solid var(--border); }
.gantt-row:hover { background: var(--surface); }
.gantt-row-name {
  position: sticky;
  inset-inline-start: 0;
  z-index: 4;
  width: 232px;
  flex: 0 0 232px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  background: var(--bg-elevated);
  border-inline-end: 1px solid var(--border);
  font-size: 12.5px;
}
.gantt-row:hover .gantt-row-name { background: var(--surface-solid); }
.gantt-track { display: flex; position: relative; flex: 1 1 auto; }
.gantt-cell { width: 34px; flex: 0 0 34px; border-inline-end: 1px solid var(--border); }
.gantt-cell.weekend { background: var(--surface); }
.gantt-cell.today { background: var(--accent-wash); }

.gantt-bar {
  position: absolute;
  top: 9px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--c, var(--accent));
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 10.5px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: filter 0.15s var(--ease), transform 0.15s var(--ease);
  white-space: nowrap;
}
.gantt-bar:hover { filter: brightness(1.14); transform: scale(1.015); }
.gantt-bar .fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  background: rgba(255, 255, 255, 0.28);
  border-radius: var(--r-pill);
}
.gantt-bar span { position: relative; z-index: 1; }

.gantt-ms {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--c, var(--danger));
  z-index: 3;
  opacity: 0.8;
}
.gantt-ms::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: -4px;
  width: 10px;
  height: 10px;
  background: var(--c, var(--danger));
  transform: rotate(45deg);
  border-radius: 2px;
}

/* ---------- چت ---------- */
.chat-shell { display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; }

.chat-list {
  width: 268px;
  flex: 0 0 268px;
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.chat-list-head { flex: 0 0 auto; padding: 12px; border-bottom: 1px solid var(--border); }
.chat-list-body { flex: 1 1 auto; overflow-y: auto; padding: 7px; }

.chan {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.chan:hover { background: var(--surface-hover); }
.chan.on { background: var(--accent-wash); }
.chan .nm { font-size: 13px; font-weight: 600; }
.chan .pv { font-size: 11px; color: var(--muted); }
.chan .un {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.chat-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.chat-head {
  flex: 0 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-foot { flex: 0 0 auto; padding: 11px 14px 14px; border-top: 1px solid var(--border); }

.day-sep { display: flex; align-items: center; gap: 10px; margin: 14px 2px 10px; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.day-sep span { font-size: 11px; color: var(--faint); }

.msg { display: flex; gap: 9px; margin-top: 10px; max-width: 78%; }
.msg.mine { margin-inline-start: auto; flex-direction: row-reverse; }
.msg.chained { margin-top: 2px; }
.msg.chained .avatar-wrap { visibility: hidden; height: 0; }

.bubble {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px 6px;
  position: relative;
  min-width: 0;
}
.msg.mine .bubble {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 86%, #000), var(--accent-2));
  border-color: transparent;
  color: var(--accent-ink);
}
.bubble .who { font-size: 11.5px; font-weight: 700; margin-bottom: 1px; }
.bubble .txt { font-size: 13px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .at {
  font-size: 10px;
  opacity: 0.65;
  margin-top: 2px;
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.bubble .reply-to {
  border-inline-start: 2.5px solid currentColor;
  padding-inline-start: 7px;
  margin-bottom: 5px;
  opacity: 0.75;
  font-size: 11.5px;
  max-height: 38px;
  overflow: hidden;
}
.bubble.deleted .txt { font-style: italic; opacity: 0.55; }

.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-hover);
  border: 1px solid transparent;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.reaction.mine { border-color: var(--accent); background: var(--accent-wash); }

.msg-tools {
  display: flex;
  gap: 2px;
  align-self: flex-end;
  opacity: 0;
  transition: opacity 0.14s var(--ease);
}
.msg:hover .msg-tools { opacity: 1; }

.typing { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); padding: 4px 2px; }
.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 5px 7px;
  transition: border-color 0.15s var(--ease);
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.composer textarea {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.8;
  max-height: 128px;
  min-height: 32px;
  padding: 5px 4px;
}
.composer textarea::placeholder { color: var(--faint); }

/* ---------- پیام صوتی ---------- */
.voice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 212px;
  padding: 2px 0;
}
.voice-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  background: var(--accent-wash);
  color: var(--accent-soft);
  transition: filter 0.15s var(--ease);
}
.msg.mine .voice-play { background: rgba(4, 35, 31, 0.17); color: var(--accent-ink); }
.voice-play:hover { filter: brightness(1.2); }

.wave {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  cursor: pointer;
  min-width: 0;
}
.wave > i {
  flex: 1 1 auto;
  min-width: 2px;
  border-radius: var(--r-pill);
  background: currentColor;
  opacity: 0.3;
  transition: opacity 0.12s linear, background 0.12s linear;
}
.wave > i.played { opacity: 1; }
.voice-time {
  font-size: 10.5px;
  opacity: 0.75;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.rec-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--danger-wash);
  border: 1px solid color-mix(in srgb, var(--danger) 36%, transparent);
  border-radius: var(--r-lg);
  padding: 9px 13px;
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.1s infinite;
  flex: 0 0 auto;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}
.rec-wave { flex: 1 1 auto; display: flex; align-items: center; gap: 2px; height: 26px; }
.rec-wave > i {
  flex: 1 1 auto;
  background: var(--danger);
  border-radius: var(--r-pill);
  opacity: 0.75;
  transition: height 0.08s linear;
}

/* ---------- خالی و بارگذاری ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 46px 18px;
  text-align: center;
  color: var(--muted);
}
.empty .ic {
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--faint);
  margin-bottom: 3px;
}
.empty b { color: var(--text); font-size: 14.5px; font-weight: 600; }

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}
.spinner.lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.skel {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- نمودار ---------- */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 128px; }
.bars .b { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 0; }
.bars .b > i {
  display: block;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  min-height: 2px;
  transition: height 0.4s var(--ease);
}
.bars .b > i.b2 { background: linear-gradient(180deg, var(--ok), #108d60); border-radius: 0 0 4px 4px; }
.bars .b > u { font-size: 9.5px; color: var(--faint); text-align: center; font-style: normal; }

.hbar { display: flex; align-items: center; gap: 10px; }
.hbar .track { flex: 1 1 auto; height: 8px; border-radius: var(--r-pill); background: var(--surface-hover); overflow: hidden; }
.hbar .track > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--c, var(--accent)); }

.donut { --size: 108px; width: var(--size); height: var(--size); border-radius: 50%; position: relative; flex: 0 0 auto; }
.donut::after {
  content: '';
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background: var(--bg-elevated);
}
.donut-mid {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* ---------- ورود ---------- */
.auth-wrap {
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.auth-card {
  width: 100%;
  max-width: 388px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-logo {
  width: 54px;
  height: 54px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-size: 24px;
  font-weight: 700;
  box-shadow: var(--sh-glow);
  margin: 0 auto 2px;
}

/* ---------- موبایل ---------- */
.mobile-tabbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  :root { --sidebar-w: 268px; }

  /*
    کشو باید به لبه راست بچسبد و بسته که شد از همان سمت بیرون برود.
    در راست‌به‌چپ، لبه راست یعنی inset-inline-start؛ اگر inset-inline-end بگذاریم
    کشو به چپ می‌چسبد و translateX مثبت آن را وسط صفحه رها می‌کند.
  */
  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 80;
    transform: translateX(100%);
    transition: transform 0.24s var(--ease);
    background: var(--bg-elevated);
    box-shadow: var(--sh-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 12, 0.6);
    z-index: 79;
    animation: fade 0.16s var(--ease);
  }

  .page-scroll, .page-pad { padding: 13px; padding-bottom: 78px; }
  .kanban { padding: 13px; padding-bottom: 78px; gap: 11px; }
  .kcol { width: 85vw; flex-basis: 85vw; }

  .chat-list {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 86vw;
    flex-basis: 86vw;
    z-index: 70;
    transform: translateX(100%);
    transition: transform 0.24s var(--ease);
    background: var(--bg-elevated);
    box-shadow: var(--sh-lg);
  }
  .chat-list.open { transform: translateX(0); }

  .msg { max-width: 90%; }
  .drawer { width: 100vw; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 9px; }
  .stat .value { font-size: 21px; }
  .cal-day { min-height: 70px; padding: 4px; }
  .gantt-names, .gantt-row-name { width: 142px; flex-basis: 142px; }
  .modal { max-height: 94vh; }
  .toasts { inset-inline: 13px; max-width: none; bottom: 76px; }

  .mobile-tabbar {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 75;
    height: 62px;
    background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-tabbar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 10px;
    text-decoration: none;
    position: relative;
  }
  .mobile-tabbar a.active { color: var(--accent-soft); }
  .mobile-tabbar a.active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 26px;
    height: 2.5px;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
  }
  .mobile-tabbar a .pip {
    position: absolute;
    top: 7px;
    inset-inline-end: 24%;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: var(--r-pill);
    background: var(--danger);
    color: var(--danger-ink);
    font-size: 9px;
    font-weight: 700;
    display: grid;
    place-items: center;
  }
  .hide-mobile { display: none !important; }
}

@media (min-width: 901px) {
  .only-mobile { display: none !important; }
}

/* ---------- دسترس‌پذیری ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
