/* =========================================================
   تم تیره‌ی سامانه - رنگ‌ها برگرفته از پروژه‌ی اصلی (Node/React)
   ========================================================= */
:root {
  --color-background: #05060d;
  --color-foreground: #f2f3f8;
  --color-card: #0d0f1a;
  --color-card-foreground: #f2f3f8;
  --color-popover: #14172a;
  --color-primary: #4b82ff;
  --color-primary-hover: #6a97ff;
  --color-primary-foreground: #ffffff;
  --color-secondary: #1b1f30;
  --color-secondary-foreground: #d6d8e6;
  --color-muted: #171a28;
  --color-muted-foreground: #8b91aa;
  --color-accent: #4b82ff;
  --color-destructive: #e0524f;
  --color-destructive-hover: #ef6a67;
  --color-border: #1d2133;
  --color-input: #1b1f30;
  --color-ring: #4b82ff;
  --color-gold: #d9b45c;
  --color-neon: #4ade80;
  --color-teal: #2dd4bf;
  --color-badge-bg: #0b1328;
  --color-light-input-bg: #e8f0fe;
  --color-light-input-fg: #0b1220;
  --color-light-btn-bg: #f3f5f9;
  --color-light-btn-fg: #05070f;
  --sidebar-width: 290px;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
}

/* ---------- تم روشن ---------- */
[data-theme="light"] {
  --color-background: #f5f6fb;
  --color-foreground: #12141f;
  --color-card: #ffffff;
  --color-card-foreground: #12141f;
  --color-popover: #ffffff;
  --color-secondary: #eef0f7;
  --color-secondary-foreground: #2a2d3d;
  --color-muted: #eef0f7;
  --color-muted-foreground: #676c85;
  --color-border: #e2e5f0;
  --color-input: #eef0f7;
  --color-badge-bg: #eef1fb;
  --color-light-input-bg: #eef0f7;
  --color-light-input-fg: #12141f;
  --color-light-btn-bg: #eef0f7;
  --color-light-btn-fg: #12141f;
}
[data-theme="light"] body { background: var(--color-background); }
[data-theme="light"] .public-topbar-inner .btn-pill-light { background: #12141f; color: #fff; }

/* ---------- دکمه‌ی تغییر حالت روشن/تاریک ---------- */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-secondary);
  color: var(--color-foreground);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.theme-toggle:hover { background: var(--color-muted); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

* { box-sizing: border-box; }

html {
  direction: rtl;
}

body {
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: "Vazirmatn", "Tahoma", sans-serif;
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Public top bar (landing / auth pages) ---------- */
.public-topbar { padding: 1.25rem 0; }
.public-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand-logo {
  font-weight: 800;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-foreground);
}
.brand-logo .logo-badge {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
  display: block;
  border: 1px solid var(--color-border);
}
.btn-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all .15s;
}
.btn-pill-primary { background: var(--color-primary); color: #fff; }
.btn-pill-primary:hover { background: var(--color-primary-hover); }
.btn-pill-light { background: var(--color-light-btn-bg); color: var(--color-light-btn-fg); }
.btn-pill-light:hover { background: #ffffff; }

/* ---------- Legacy role badge (kept for member lists) ---------- */
.badge-role {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--color-secondary);
  color: var(--color-secondary-foreground);
  border: 1px solid var(--color-border);
}
.badge-role.admin { background: rgba(224,82,79,.15); color: #f28b89; border-color: rgba(224,82,79,.3); }
.badge-role.supervisor { background: rgba(217,180,92,.15); color: var(--color-gold); border-color: rgba(217,180,92,.3); }
.badge-role.student { background: rgba(75,130,255,.15); color: #a9c1ff; border-color: rgba(75,130,255,.3); }

/* ---------- Layout ---------- */
.page { padding: 2rem 0 4rem; }

/* ---------- App shell (dashboard/authenticated area) ---------- */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; padding: 1.75rem 2rem 3rem; }
.app-main .container { max-width: 1180px; margin: 0 auto; padding: 0; }

.app-topline { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.score-pill { font-size: 0.92rem; color: var(--color-muted-foreground); }
.score-pill b { color: var(--color-gold); font-weight: 800; }

.app-sidebar {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  background: var(--color-card);
  border-inline-end: 1px solid var(--color-border);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
}
.app-sidebar-brand {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.app-sidebar-user {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--color-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.5rem;
}
.app-sidebar-user .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--color-primary);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.app-sidebar-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.app-sidebar-user .name { font-size: 0.9rem; font-weight: 700; }
.app-sidebar-user .role { font-size: 0.75rem; color: var(--color-muted-foreground); }

.sidebar-nav { flex: 1 1 auto; overflow-y: auto; }
.sidebar-group-title {
  font-size: 0.72rem; color: var(--color-muted-foreground);
  padding: 0.9rem 0.6rem 0.4rem; text-transform: uppercase; letter-spacing: .04em;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--color-muted-foreground);
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  transition: background .15s, color .15s;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:hover { background: var(--color-secondary); color: var(--color-foreground); }
.sidebar-nav a.active { background: var(--color-primary); color: #fff; }
.sidebar-logout {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.sidebar-logout button {
  width: auto;
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(224,82,79,.08);
  border: 1px solid rgba(224,82,79,.25);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: #f28b89; font-size: 0.78rem; font-family: inherit; cursor: pointer;
  transition: background .15s;
}
.sidebar-logout button svg { width: 14px; height: 14px; }
.sidebar-logout button:hover { background: rgba(224,82,79,.18); }

/* ---------- نوار بالای موبایل و دکمه‌ی همبرگری ---------- */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .app-main { padding: 1.1rem 0.9rem 2.5rem; }
  .app-topline { display: none; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 260;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 0.7rem 1rem;
    margin: -1.1rem -0.9rem 1rem;
  }
  .mobile-topbar .hamburger-btn {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    background: var(--color-secondary); border: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-foreground); cursor: pointer;
  }
  .mobile-topbar .hamburger-btn svg { width: 20px; height: 20px; }
  .mobile-topbar .score-pill { margin: 0; }

  .app-sidebar {
    position: fixed; inset-inline-start: 0; top: 0;
    height: 100vh; width: 84%; max-width: 300px;
    z-index: 300;
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.45);
    border-inline-end: 1px solid var(--color-border);
  }
  .app-sidebar.open { transform: translateX(0); }

  .sidebar-backdrop.open {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 290;
  }
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 0.75rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; }

.stat-card { text-align: center; }
.stat-card .value { font-size: 2rem; font-weight: 800; color: var(--color-primary); }
.stat-card .label { color: var(--color-muted-foreground); font-size: 0.85rem; margin-top: 0.25rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.btn-primary { background: var(--color-primary); color: var(--color-primary-foreground); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { background: var(--color-secondary); color: var(--color-secondary-foreground); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-muted); }
.btn-destructive { background: var(--color-destructive); color: #fff; }
.btn-destructive:hover { background: var(--color-destructive-hover); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--color-secondary-foreground); }
.form-control {
  width: 100%;
  background: var(--color-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-foreground);
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.form-control:focus { outline: 2px solid var(--color-ring); outline-offset: 1px; }
.form-row { margin-bottom: 0.25rem; }
.helptext { font-size: 0.75rem; color: var(--color-muted-foreground); margin-top: -0.75rem; margin-bottom: 1rem; }
.errorlist { list-style: none; padding: 0; margin: 0 0 0.5rem; color: var(--color-destructive); font-size: 0.8rem; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.65rem 0.6rem; text-align: right; border-bottom: 1px solid var(--color-border); }
th { color: var(--color-muted-foreground); font-weight: 600; font-size: 0.8rem; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ---------- Badges / chips ---------- */
.chip { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.75rem; }
.chip-high { background: rgba(224,82,79,.15); color: #f28b89; }
.chip-medium { background: rgba(217,180,92,.15); color: var(--color-gold); }
.chip-low { background: rgba(74,222,128,.15); color: var(--color-neon); }
.chip-active { background: rgba(74,222,128,.15); color: var(--color-neon); }
.chip-archived, .chip-closed { background: var(--color-secondary); color: var(--color-muted-foreground); }
.chip-pending { background: rgba(217,180,92,.15); color: var(--color-gold); }

/* ---------- Misc ---------- */
.muted { color: var(--color-muted-foreground); }
.text-gold { color: var(--color-gold); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-muted-foreground); }

.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.messages li {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  border: 1px solid var(--color-border);
}
.messages li.success { background: rgba(74,222,128,.1); color: var(--color-neon); border-color: rgba(74,222,128,.3); }
.messages li.error { background: rgba(224,82,79,.1); color: #f28b89; border-color: rgba(224,82,79,.3); }
.messages li.info { background: rgba(109,95,253,.1); color: #a79bff; border-color: rgba(109,95,253,.3); }
.messages li.warning { background: rgba(217,180,92,.1); color: var(--color-gold); border-color: rgba(217,180,92,.3); }

.hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(75,130,255,.16), transparent 60%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--color-badge-bg);
  border: 1px solid rgba(75,130,255,.35);
  color: var(--color-primary);
  font-size: 0.82rem; font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.75rem;
}
.hero h1 { font-size: 2.6rem; line-height: 1.5; font-weight: 800; margin: 0 0 1.25rem; }
.hero h1 .grad-text {
  background: linear-gradient(90deg, var(--color-teal), var(--color-neon));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--color-muted-foreground); font-size: 1.05rem; max-width: 560px; margin: 0 auto 2.25rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3.5rem; }
.hero-actions .btn-pill-primary, .hero-actions .btn-pill-light { padding: 0.75rem 1.6rem; font-size: 0.92rem; }

.hero-stats {
  display: flex; justify-content: center; gap: 3.5rem; flex-wrap: wrap;
  padding-top: 2.5rem;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat .value { font-size: 1.8rem; font-weight: 800; color: var(--color-primary); }
.ltr-num { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---------- منوی کشویی انتخاب دوره (رتبه‌بندی) ---------- */
.course-select-wrap { position: relative; }
.course-select {
  appearance: none;
  background: var(--color-secondary);
  color: var(--color-foreground);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.55rem 2.2rem 0.55rem 1rem;
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8fa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.7rem center;
  background-size: 16px;
}
.course-select:focus { outline: none; border-color: var(--color-primary); }
.hero-stats .stat .label { color: var(--color-muted-foreground); font-size: 0.85rem; margin-top: 0.35rem; }

/* ---------- Landing CTA + footer ---------- */
.landing-cta-wrap { padding: 1rem 0 4rem; }
.landing-cta {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  padding: 3.25rem 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, #0e1c36 0%, #0a1f22 60%, #04170f 100%);
}
.landing-cta h2 { font-size: 1.75rem; font-weight: 800; margin: 0 0 0.75rem; }
.landing-cta p { color: var(--color-muted-foreground); margin: 0 0 1.75rem; }

.site-footer { border-top: 1px solid var(--color-border); padding: 2.25rem 0; text-align: center; }
.site-footer .brand-logo { justify-content: center; margin-bottom: 0.6rem; }
.site-footer .copyright { color: var(--color-muted-foreground); font-size: 0.85rem; }

.auth-wrap { max-width: 420px; margin: 3rem auto; }
.progress-bar-track { background: var(--color-muted); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar-fill { background: var(--color-primary); height: 100%; border-radius: 999px; }

.rank-1 { color: var(--color-gold); font-weight: 800; }
.rank-2 { color: #c7cbe0; font-weight: 700; }
.rank-3 { color: #cd8a4f; font-weight: 700; }

/* ---------- Tools section (landing page) ---------- */
.tools-section { padding: 2.5rem 0 1rem; }
.tools-title { text-align: center; font-size: 1.7rem; font-weight: 800; margin: 0 0 2rem; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 860px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--color-primary); transform: translateY(-2px); }

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.tool-icon svg { width: 20px; height: 20px; }

.icon-green  { background: rgba(74,222,128,.15);  color: #4ade80; }
.icon-gold   { background: rgba(217,180,92,.18);  color: var(--color-gold); }
.icon-blue   { background: rgba(59,130,246,.15);  color: #60a5fa; }
.icon-pink   { background: rgba(236,72,153,.15);  color: #ec4899; }
.icon-purple { background: rgba(168,85,247,.15);  color: #a855f7; }
.icon-orange { background: rgba(249,115,22,.15);  color: #fb923c; }

.tool-name { font-weight: 700; font-size: 1.02rem; margin-bottom: 0.5rem; }
.tool-desc { color: var(--color-muted-foreground); font-size: 0.85rem; line-height: 1.7; }

/* ---------- Auth split layout (login / register) ---------- */
.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) { .auth-split { grid-template-columns: 1fr; } }

.auth-visual {
  background: radial-gradient(circle at 30% 20%, rgba(75,130,255,.16), transparent 55%);
  padding: 3rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-visual .brand-logo { margin-bottom: 2.5rem; }
.auth-visual h1 { font-size: 2rem; font-weight: 800; line-height: 1.5; margin: 0 0 1rem; }
.auth-visual h1 .grad-text {
  background: linear-gradient(90deg, var(--color-teal), var(--color-neon));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-visual > p { color: var(--color-muted-foreground); max-width: 420px; margin: 0 0 2.5rem; line-height: 1.9; }
.auth-feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.auth-feature-list li { display: flex; align-items: center; gap: 0.65rem; font-size: 0.95rem; color: var(--color-secondary-foreground); }

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 3.5rem;
}
.auth-form-inner { max-width: 400px; width: 100%; margin: 0 auto; }
.auth-form-inner h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 0.4rem; }
.auth-form-inner .auth-sub { color: var(--color-muted-foreground); font-size: 0.9rem; margin: 0 0 1.75rem; }

.field-icon-wrap { position: relative; margin-bottom: 1.1rem; }
.field-icon-wrap label { margin-bottom: 0.45rem; }
.field-icon-wrap .form-control {
  background: var(--color-light-input-bg);
  color: var(--color-light-input-fg);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.8rem 2.6rem 0.8rem 1rem;
  margin-bottom: 0;
  font-size: 0.92rem;
}
.field-icon-wrap .field-icon {
  position: absolute;
  inset-inline-end: 0.9rem;
  top: calc(50% + 0.2rem);
  transform: translateY(-50%);
  color: #6b7a99;
  display: flex;
}
.field-icon-wrap .field-icon svg { width: 18px; height: 18px; }
.field-icon-wrap .toggle-pass {
  position: absolute;
  inset-inline-start: 0.9rem;
  top: calc(50% + 0.2rem);
  transform: translateY(-50%);
  color: #6b7a99;
  background: none; border: none; cursor: pointer; padding: 0; display: flex;
}
.field-icon-wrap .toggle-pass svg { width: 18px; height: 18px; }

.auth-form-inner .btn-block { padding: 0.85rem; font-size: 0.95rem; border-radius: var(--radius-md); }
.auth-form-inner .muted { text-align: center; display: block; margin-top: 1.5rem; }

/* ---------- Dashboard home (greeting + stats + widgets) ---------- */
.greeting-card {
  background: linear-gradient(120deg, rgba(75,130,255,.1), rgba(45,212,191,.06));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.5rem;
}
.greeting-card h2 { margin: 0 0 0.3rem; font-size: 1.2rem; font-weight: 700; }
.greeting-card p { margin: 0; color: var(--color-muted-foreground); font-size: 0.9rem; }

.home-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin-bottom: 1.5rem; }
@media (max-width: 760px) { .home-stats-grid { grid-template-columns: repeat(2, 1fr); } }
.home-stat {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.home-stat-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.home-stat-icon svg { width: 19px; height: 19px; }
.home-stat .value { font-size: 1.7rem; font-weight: 800; }
.home-stat .label { color: var(--color-muted-foreground); font-size: 0.85rem; margin-top: 0.2rem; }

.dash-widgets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: stretch; }
.dash-widgets-grid .card { display: flex; flex-direction: column; height: 100%; }
@media (max-width: 860px) { .dash-widgets-grid { grid-template-columns: 1fr; } }
.widget-card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.widget-card-title .title { font-weight: 700; font-size: 1rem; }
.widget-card-title a { color: var(--color-primary); font-size: 0.85rem; display: flex; align-items: center; gap: 0.3rem; }

.pending-task-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
}
.pending-task-row:last-child { border-bottom: none; }
.pending-task-row .task-title-group { display: flex; align-items: center; gap: 0.6rem; }
.pending-task-row .status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; }
.pill-points {
  background: rgba(217,180,92,.18);
  color: var(--color-gold);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

/* ---------- آواتار در جدول‌ها (رتبه‌بندی، اعضا) ---------- */
.table-user-cell { display: flex; align-items: center; gap: 0.6rem; }
.table-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-primary);
  color: #fff; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  border: 2px solid var(--color-border);
}
.table-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- کارت‌های «دوره‌های من» در داشبورد ---------- */
.my-course-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  position: relative;
}
.my-course-card .mc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.9rem; }
.my-course-card .mc-badge {
  font-size: 0.72rem; font-weight: 700;
  color: #4ade80; background: rgba(74,222,128,.14);
  border: 1px solid rgba(74,222,128,.3);
  padding: 0.2rem 0.6rem; border-radius: 999px;
}
.my-course-card .mc-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(75,130,255,.14); color: var(--color-primary);
}
.my-course-card .mc-icon svg { width: 18px; height: 18px; }
.my-course-card .mc-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.3rem; }
.my-course-card .mc-desc { color: var(--color-muted-foreground); font-size: 0.85rem; margin-bottom: 0.9rem; min-height: 1.3rem; }
.my-course-card .mc-meta { color: var(--color-muted-foreground); font-size: 0.8rem; display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.9rem; }
.my-course-card .mc-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%; padding: 0.6rem; border-radius: var(--radius-md);
  background: var(--color-secondary); color: var(--color-foreground);
  font-size: 0.85rem; font-weight: 600;
  transition: background .15s;
}
.my-course-card .mc-btn:hover { background: var(--color-muted); }

/* ---------- تقویم شمسی (بازطراحی‌شده) ---------- */
.jalali-field { position: relative; }
.jalali-display {
  cursor: pointer;
  background: var(--color-input);
  color: var(--color-foreground);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8fa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.85rem center;
  background-size: 17px;
  padding-inline-start: 2.4rem;
  transition: border-color .15s;
}
.jalali-display.is-open { border-color: var(--color-primary); }

.jalali-cal-popup {
  position: absolute; z-index: 200; top: calc(100% + 8px); inset-inline-start: 0;
  background: var(--color-popover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1rem;
  width: 300px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  display: none;
  opacity: 0; transform: translateY(-6px);
  transition: opacity .15s, transform .15s;
}
.jalali-cal-popup.open { display: block; animation: jalaliPopIn .15s ease forwards; }
@keyframes jalaliPopIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.jc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; }
.jc-title { font-weight: 800; font-size: 0.95rem; }
.jc-nav {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-secondary); border: 1px solid var(--color-border);
  color: var(--color-foreground);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.jc-nav:hover { background: var(--color-muted); }
.jc-nav svg { width: 15px; height: 15px; }

.jc-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 0.3rem; }
.jc-weekdays span { text-align: center; font-size: 0.68rem; font-weight: 700; color: var(--color-muted-foreground); padding: 0.25rem 0; }

.jc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.15rem; margin-bottom: 0.7rem; }
.jc-day {
  border: none; background: transparent; color: var(--color-foreground);
  aspect-ratio: 1; border-radius: 50%; cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, transform .1s;
}
.jc-day:hover { background: var(--color-secondary); }
.jc-day:active { transform: scale(0.9); }
.jc-day.is-selected { background: var(--color-primary); color: #fff; font-weight: 700; }
.jc-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1.5px var(--color-primary); color: var(--color-primary); font-weight: 700; }

.jc-time-row {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;
  background: var(--color-secondary); border-radius: var(--radius-md); padding: 0.5rem 0.75rem;
  color: var(--color-muted-foreground);
}
.jc-colon { font-weight: 700; }

/* ---------- انتخاب‌گر ساعت جدید (استپر + پیشنهاد سریع) ---------- */
.jc-time-box {
  background: var(--color-input); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem; margin-bottom: 0.75rem;
}
.jc-time-display { display: flex; align-items: center; justify-content: center; gap: 1.1rem; margin-bottom: 0.9rem; }
.jc-time-unit { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.jc-time-num {
  font-size: 2.1rem; font-weight: 800; color: var(--color-foreground);
  min-width: 58px; text-align: center; direction: ltr;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.jc-time-label { font-size: 0.68rem; color: var(--color-muted-foreground); margin-top: 0.15rem; }
.jc-time-sep { font-size: 1.9rem; font-weight: 800; color: var(--color-muted-foreground); align-self: center; margin-top: -1.2rem; }
.jc-stepper {
  width: 40px; height: 26px; border-radius: var(--radius-md);
  background: var(--color-secondary); border: 1px solid var(--color-border);
  color: var(--color-primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.jc-stepper:hover { background: var(--color-muted); border-color: var(--color-primary); }
.jc-stepper:active { transform: scale(0.9); }
.jc-stepper svg { width: 16px; height: 16px; }

.jc-time-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.jc-preset {
  background: var(--color-secondary); border: 1px solid var(--color-border);
  color: var(--color-muted-foreground);
  border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.72rem; font-family: inherit;
  cursor: pointer; transition: all .12s;
}
.jc-preset:hover { border-color: var(--color-primary); color: var(--color-foreground); }
.jc-preset.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.jc-footer { display: flex; gap: 0.5rem; }
.jc-btn {
  flex: 1; padding: 0.55rem; border-radius: var(--radius-md); border: none; cursor: pointer;
  font-family: inherit; font-size: 0.82rem; font-weight: 700; transition: filter .12s;
}
.jc-btn:hover { filter: brightness(1.08); }
.jc-btn-ghost { background: var(--color-secondary); color: var(--color-foreground); }
.jc-btn-primary { background: var(--color-primary); color: #fff; }

/* ---------- فرم مدیریت امتیاز اعضا ---------- */
.points-form { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.points-form .points-amount { width: 80px; margin: 0; }
.points-form .points-action { width: auto; margin: 0; padding: 0.5rem 0.6rem; }
.points-form .points-reason { width: 140px; margin: 0; }
.points-form .btn { margin: 0; }

/* ---------- کارت پروفایل عمومی ---------- */
.profile-hero-card {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: 1.5rem; margin-bottom: 1.25rem;
}
.profile-hero-avatar {
  width: 76px; height: 76px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700;
  border: 3px solid var(--color-border);
}
.profile-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero-info { flex: 1; min-width: 200px; }
.profile-hero-info h2 { margin: 0 0 0.2rem; font-size: 1.3rem; }
.profile-hero-username { color: var(--color-muted-foreground); font-size: 0.9rem; margin-bottom: 0.6rem; }
.profile-hero-meta { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; font-size: 0.85rem; }
.profile-hero-points { text-align: center; background: var(--color-secondary); border-radius: var(--radius-lg); padding: 0.75rem 1.5rem; }
.profile-hero-points .value { font-size: 1.6rem; font-weight: 800; color: var(--color-gold); }
.profile-hero-points .label { font-size: 0.78rem; color: var(--color-muted-foreground); }

.member-link { color: inherit; text-decoration: none; }
.member-link:hover .table-user-cell span { color: var(--color-primary); text-decoration: underline; }
.member-link:hover .table-avatar { filter: brightness(1.15); }

/* ---------- Task list page ---------- */
.task-toolbar { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.task-tabs { display: flex; align-items: center; gap: 0.35rem; background: var(--color-card); border: 1px solid var(--color-border); border-radius: 999px; padding: 0.3rem; }
.task-tabs button {
  border: none; background: transparent; color: var(--color-muted-foreground);
  font-family: inherit; font-size: 0.85rem; padding: 0.45rem 1.1rem; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.task-tabs button.active { background: var(--color-primary); color: #fff; }
.task-search { position: relative; flex: 1 1 260px; max-width: 340px; }
.task-search input {
  width: 100%; background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: 999px; padding: 0.6rem 2.5rem 0.6rem 1rem; color: var(--color-foreground); font-family: inherit; font-size: 0.88rem;
}
.task-search .search-icon { position: absolute; inset-inline-end: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--color-muted-foreground); display: flex; }
.task-search .search-icon svg { width: 16px; height: 16px; }
.task-progress { color: var(--color-muted-foreground); font-size: 0.9rem; display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1rem; }

.task-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.9rem;
}
.task-row.is-overdue { background: rgba(224,82,79,.06); border-color: rgba(224,82,79,.35); }
.task-row.is-done { opacity: 0.6; }
.task-row-right { display: flex; align-items: flex-start; gap: 0.85rem; flex: 1 1 auto; min-width: 0; }
.task-row-main { flex: 1 1 auto; min-width: 0; }
.task-row-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; }
.task-row-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--color-muted-foreground); }
.task-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  cursor: pointer;
  color: transparent;
}
.task-check.done { background: var(--color-neon); border-color: var(--color-neon); color: #06210f; }
.task-check svg { width: 15px; height: 15px; }

.chip-category { background: rgba(15,158,111,.18); color: #34d399; }
.chip-overdue { background: rgba(224,82,79,.16); color: #f28b89; display: inline-flex; align-items: center; gap: 0.3rem; }
.chip-overdue svg { width: 12px; height: 12px; }
/* ---------- بخش برنامه‌ریزی ---------- */
.planner-select-wrap { display: flex; justify-content: center; padding: 1rem 0; }
.planner-select-card {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: 1.75rem; width: 100%; max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.planner-select-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.planner-select-header h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }
.planner-select-badge {
  width: 54px; height: 54px; border-radius: var(--radius-lg);
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.15rem; flex-shrink: 0;
}
.planner-select-controls { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.planner-select-controls .course-select { flex: 1; }
.planner-grid { margin-bottom: 1.1rem; }
.planner-confirm-btn { width: 100%; padding: 0.75rem; font-size: 0.9rem; }

.planner-day-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  border-radius: var(--radius-xl); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; color: #fff;
}
.planner-day-title { font-size: 0.85rem; opacity: 0.85; }
.planner-day-date { font-size: 1.35rem; font-weight: 800; margin-top: 0.2rem; }
.planner-day-back {
  display: flex; align-items: center; gap: 0.35rem;
  background: rgba(255,255,255,.18); color: #fff; text-decoration: none;
  padding: 0.5rem 0.9rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}

.planner-activity-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.planner-activity-row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.85rem 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-secondary);
}
.planner-activity-row.is-done { opacity: 0.55; }
.planner-activity-row.is-done .planner-activity-title { text-decoration: line-through; }
.planner-check-form { margin: 0; }
.planner-check-circle {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--color-primary);
  background: transparent; color: #fff; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.planner-activity-row.is-done .planner-check-circle { background: var(--color-primary); }
.planner-check-circle svg { width: 14px; height: 14px; }
.planner-activity-info { flex: 1; min-width: 0; }
.planner-activity-title { font-weight: 700; font-size: 0.92rem; }
.planner-activity-time {
  display: flex; align-items: center; gap: 0.3rem;
  color: var(--color-muted-foreground); font-size: 0.78rem; margin-top: 0.2rem;
}
.planner-delete-form { margin: 0; }
.planner-delete-btn {
  width: 32px; height: 32px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--color-border); color: #f28b89;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.planner-delete-btn:hover { background: rgba(224,82,79,.12); }

.planner-add-toggle {
  width: 100%; padding: 0.75rem; border-radius: var(--radius-lg);
  border: 1.5px dashed var(--color-border); background: transparent; color: var(--color-primary);
  font-weight: 700; font-size: 0.88rem; cursor: pointer;
}
.planner-add-form { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.planner-add-label { font-size: 0.8rem; color: var(--color-muted-foreground); }

/* اصلاح ترتیب نمایش ساعت/دقیقه: ساعت سمت چپ، دقیقه سمت راست */
.jc-time-display { flex-direction: row-reverse; }
