/* ============================================================
   هدف‌یار — تم نیومورفیسم (سفید و نارنجی) + دارک/لایت مود
   ============================================================ */

:root {
  --font: "Vazirmatn", "Yekan", "Tahoma", sans-serif;

  /* ---- روشن (پیش‌فرض) ---- */
  --bg: #eaedf3;
  --surface: #eaedf3;
  --sh-dark: #c6cbd6;
  --sh-light: #ffffff;

  --c-text: #363b47;
  --c-text-2: #666c7b;
  --c-text-3: #969cab;

  --accent: #ff7a18;
  --accent-2: #ff9d3d;
  --accent-soft: rgba(255, 122, 24, .14);
  --accent-glow: 0 8px 20px rgba(255, 122, 24, .40);
  --on-accent: #ffffff;

  --c-primary: #ff7a18;
  --c-primary-2: #ff9d3d;
  --c-teal: #ff8a2a;

  --c-success: #16a34a;
  --c-warning: #e08600;
  --c-danger: #e0403a;
  --c-info: #ff7a18;

  --line: rgba(60, 64, 80, .09);

  --nm:      6px 6px 13px var(--sh-dark), -6px -6px 13px var(--sh-light);
  --nm-sm:   4px 4px 9px var(--sh-dark),  -4px -4px 9px var(--sh-light);
  --nm-in:   inset 4px 4px 9px var(--sh-dark), inset -5px -5px 10px var(--sh-light);
  --nm-in-sm: inset 3px 3px 6px var(--sh-dark), inset -3px -3px 6px var(--sh-light);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --sidebar-w: 264px;
}

:root[data-theme="dark"] {
  --bg: #272b33;
  --surface: #272b33;
  --sh-dark: #1c1f26;
  --sh-light: #32373f;

  --c-text: #e8eaf0;
  --c-text-2: #a9afbd;
  --c-text-3: #757b8a;

  --accent: #ff8a2a;
  --accent-2: #ffa54d;
  --accent-soft: rgba(255, 138, 42, .17);
  --accent-glow: 0 8px 22px rgba(255, 122, 24, .34);

  --c-primary: #ff8a2a;
  --c-primary-2: #ffa54d;
  --c-teal: #ff8a2a;

  --c-success: #35c46b;
  --c-warning: #f5a524;
  --c-danger: #f16b60;

  --line: rgba(255, 255, 255, .07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--c-text);
  min-height: 100vh;
  background: var(--bg);
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}

.hidden { display: none !important; }

/* پس‌زمینه‌ی حباب‌ها در نیومورفیسم استفاده نمی‌شود */
.bg-blobs { display: none; }

/* ---------- کارت نیومورفیک ---------- */
.glass {
  background: var(--surface);
  box-shadow: var(--nm);
  border-radius: var(--radius-lg);
}

/* ============================================================
   صفحه ورود
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 44px 36px;
  text-align: center;
  animation: rise .5s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-logo {
  width: 78px; height: 78px;
  margin: 0 auto 16px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--accent-glow);
}
.login-title { font-size: 30px; font-weight: 800; color: var(--accent); }
.login-subtitle { color: var(--c-text-2); margin: 6px 0 26px; font-size: 14px; }
.login-hint { font-size: 13px; color: var(--c-text-2); margin-bottom: 16px; }

.role-tabs {
  display: flex;
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
  border-radius: var(--radius-md);
  padding: 6px;
  margin-bottom: 22px;
  gap: 6px;
}
.role-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-2);
  cursor: pointer;
  transition: all .25s;
}
.role-tab.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: var(--accent-glow);
}

.login-member-list { display: flex; flex-direction: column; gap: 12px; max-height: 300px; overflow-y: auto; padding: 4px; }
.login-member-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--nm-sm);
  border: none;
  cursor: pointer;
  transition: all .22s;
  font-family: var(--font);
  font-size: 14px;
  color: var(--c-text);
  text-align: right;
}
.login-member-item:hover { transform: translateY(-2px); box-shadow: var(--nm); }
.login-member-item:active { box-shadow: var(--nm-in-sm); transform: none; }
.login-member-item .role { font-size: 12px; color: var(--c-text-3); }

/* ============================================================
   دکمه‌ها و فرم‌ها
   ============================================================ */
.btn {
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--c-text);
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn-primary:active { transform: none; box-shadow: 0 2px 8px rgba(255,122,24,.3); }
.btn-glass {
  background: var(--surface);
  color: var(--c-text);
  box-shadow: var(--nm-sm);
}
.btn-glass:hover { transform: translateY(-2px); box-shadow: var(--nm); }
.btn-glass:active { transform: none; box-shadow: var(--nm-in-sm); }
.btn-ghost { background: transparent; color: var(--c-text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn-danger { background: var(--surface); color: var(--c-danger); box-shadow: var(--nm-sm); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: var(--nm); }
.btn-danger:active { transform: none; box-shadow: var(--nm-in-sm); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 15px; font-size: 12.5px; border-radius: var(--radius-sm); }

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 13px;
  border: none;
  background: var(--surface);
  box-shadow: var(--nm-sm);
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all .2s;
  color: var(--c-text);
}
.icon-btn:hover { box-shadow: var(--nm); }
.icon-btn:active { box-shadow: var(--nm-in-sm); }

label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text-2); margin-bottom: 8px; }
input, textarea, select {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--c-text);
  padding: 12px 15px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
  outline: none;
  transition: box-shadow .22s;
}
input::placeholder, textarea::placeholder { color: var(--c-text-3); }
input:focus, textarea:focus, select:focus {
  box-shadow: var(--nm-in-sm), 0 0 0 2px var(--accent-soft);
}
select { appearance: none; -webkit-appearance: none; cursor: pointer; }
textarea { resize: vertical; min-height: 84px; }
input[type="time"]::-webkit-calendar-picker-indicator { filter: saturate(2); cursor: pointer; }
:root[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1) saturate(2); }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 22px; }

/* ============================================================
   پوسته برنامه
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  margin: 16px;
  margin-left: 0;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  z-index: 40;
}
.sidebar-header { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; }
.sidebar-logo {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--accent-glow);
}
.sidebar-title { font-size: 20px; font-weight: 800; color: var(--accent); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--c-text-2);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  text-align: right;
  width: 100%;
}
.nav-item:hover { color: var(--c-text); box-shadow: var(--nm-sm); }
.nav-item.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: var(--accent-glow);
}
.nav-item .nav-icon { font-size: 17px; }

.sidebar-footer { padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px 14px; font-size: 13.5px; font-weight: 700; }
.sidebar-user .u-role { display: block; font-size: 11.5px; color: var(--c-text-3); font-weight: 500; }

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--nm-sm);
}
.avatar-sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar-lg { width: 66px; height: 66px; font-size: 25px; }

.main-area { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  position: sticky;
  top: 16px;
  z-index: 30;
}
.topbar-title { font-size: 17px; font-weight: 800; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }

.sync-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c-text-3);
  display: inline-block;
  flex-shrink: 0;
}
.sync-dot.online { background: var(--c-success); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.sync-dot.offline { background: var(--c-danger); box-shadow: 0 0 0 3px rgba(224, 64, 58, .16); animation: pulse 1.6s ease infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.notif-badge {
  position: absolute;
  top: -4px; left: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: var(--c-danger);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(224, 64, 58, .4);
}

.content { flex: 1; animation: rise .4s ease both; }

/* ============================================================
   کارت‌ها و شبکه‌ها
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card { padding: 20px 22px; display: flex; align-items: center; gap: 16px; transition: transform .25s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-icon {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
}
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--c-text-2); }

.section-header { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 14px; flex-wrap: wrap; gap: 10px; }
.section-title { font-size: 16.5px; font-weight: 800; }

.card { padding: 22px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--c-text-3);
  font-size: 14px;
}
.empty-state .empty-icon { font-size: 42px; margin-bottom: 10px; opacity: .7; }

/* ---------- وضعیت اهداف ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ontrack { color: var(--c-success); }
.badge-attention { color: var(--c-warning); }
.badge-late { color: var(--c-danger); }
.badge-done { color: var(--accent); }
.badge-neutral { color: var(--c-text-2); }
.badge-neutral::before, .badge-plain::before { display: none; }
.badge-plain { color: var(--c-text-2); }

/* ---------- نوار پیشرفت ---------- */
.progress-track {
  height: 12px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
  overflow: hidden;
  padding: 2px;
}
.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .6s cubic-bezier(.2, .8, .3, 1);
}
.progress-fill.p-success { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress-fill.p-warning { background: linear-gradient(90deg, #e08600, #fbbf24); }
.progress-fill.p-danger { background: linear-gradient(90deg, #e0403a, #f87171); }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress-track { flex: 1; }
.progress-pct { font-size: 13px; font-weight: 800; min-width: 40px; text-align: left; }

/* ---------- کارت هدف ---------- */
.goal-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; transition: transform .25s, box-shadow .25s; cursor: pointer; }
.goal-card:hover { transform: translateY(-3px); }
.goal-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.goal-title { font-size: 15px; font-weight: 800; }
.goal-desc { font-size: 12.5px; color: var(--c-text-2); line-height: 1.9; }
.goal-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--c-text-3); }
.goal-meta span { display: inline-flex; align-items: center; gap: 5px; }
.goal-owner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--c-text-2); }

/* ---------- اعضا ---------- */
.member-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: transform .25s; }
.member-card:hover { transform: translateY(-3px); }
.member-head { display: flex; align-items: center; gap: 12px; }
.member-name { font-size: 15px; font-weight: 800; }
.member-role { font-size: 12px; color: var(--c-text-3); }
.member-stats { display: flex; gap: 14px; font-size: 12px; color: var(--c-text-2); }
.member-stats b { color: var(--c-text); }
.member-actions { display: flex; gap: 8px; }

/* ---------- تسک‌ها ---------- */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
  margin-bottom: 12px;
  transition: box-shadow .22s;
}
.task-item.done .task-title { text-decoration: line-through; color: var(--c-text-3); }
.task-check {
  width: 24px; height: 24px;
  border-radius: 8px;
  border: none;
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: #fff;
  transition: all .2s;
}
.task-item.done .task-check { background: linear-gradient(120deg, var(--c-success), #4ade80); box-shadow: 0 3px 8px rgba(22,163,74,.35); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13.5px; font-weight: 600; }
.task-desc { font-size: 12px; color: var(--c-text-2); line-height: 1.8; margin-top: 3px; }
.task-item.done .task-desc { color: var(--c-text-3); }
.task-completion {
  display: flex; flex-direction: column; gap: 5px; margin-top: 9px; padding: 9px 10px;
  border-radius: 10px; background: rgba(22, 163, 74, .09); color: var(--c-text-2); font-size: 12px; line-height: 1.75;
}
.task-completion b { color: var(--c-success); font-size: 11.5px; }
.task-completion img { width: min(160px, 100%); max-height: 130px; object-fit: cover; border-radius: 8px; margin-top: 2px; }
.task-completion-action {
  margin-top: 9px; padding: 6px 9px; width: fit-content; border: 0; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent); font: 700 11.5px var(--font); cursor: pointer;
}
.task-completion-action:hover { filter: brightness(.96); }
.accounting-report-form { display: grid; gap: 12px; margin-bottom: 14px; }
.accounting-report-form fieldset {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 14px;
  padding: 12px 12px 2px; background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.accounting-report-form legend { padding: 0 7px; color: var(--accent); font-size: 13px; font-weight: 900; }
.report-date-banner {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 12px;
  border-radius: 12px; background: var(--accent-soft); color: var(--c-text-2); font-size: 12px;
}
.report-date-banner b { color: var(--accent); }
.report-field { margin-bottom: 10px; }
.report-field label small { color: var(--c-text-3); font-weight: 500; }
.report-field textarea { min-height: 74px; }
.structured-report { display: grid; gap: 9px; margin-top: 4px; }
.structured-report-date { padding-bottom: 7px; border-bottom: 1px solid rgba(127,127,127,.16); }
.structured-report section { border-radius: 9px; background: rgba(255,255,255,.38); padding: 8px; }
[data-theme="dark"] .structured-report section { background: rgba(255,255,255,.035); }
.structured-report h5 { margin: 0 0 5px; color: var(--accent); font-size: 11.5px; }
.structured-report-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed rgba(127,127,127,.16); }
.structured-report-row:last-child { border-bottom: 0; }
.structured-report-row strong { color: var(--c-text); text-align: left; }
.structured-report-row small { font-weight: 500; color: var(--c-text-3); }
.form-hint { display: block; margin-top: 7px; color: var(--c-text-3); font-size: 11.5px; line-height: 1.7; }
.score-board { margin-bottom: 22px; }
.score-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px;
  border-radius: 999px; background: rgba(245, 158, 11, .13); color: #c17800; font-weight: 900;
}
.task-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ---------- انتخاب چند انجام‌دهنده ---------- */
.assignee-picker { display: flex; flex-wrap: wrap; gap: 9px; }
.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--nm-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-2);
  margin-bottom: 0;
  transition: all .2s;
  user-select: none;
}
.assignee-chip:hover { box-shadow: var(--nm); }
.assignee-chip input { display: none; }
.assignee-chip::before {
  content: "";
  width: 18px; height: 18px;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
  flex-shrink: 0;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff;
}
.assignee-chip.checked {
  color: var(--accent);
  box-shadow: var(--nm-sm), inset 0 0 0 1.5px var(--accent);
}
.assignee-chip.checked::before {
  content: "✓";
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 6px rgba(255, 122, 24, .4);
}
.task-note-btn.has-note { color: var(--accent); box-shadow: var(--nm-sm), inset 0 0 0 1.5px var(--accent); }
.task-sub { font-size: 11.5px; color: var(--c-text-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.prio { font-weight: 700; }
.prio-high { color: var(--c-danger); }
.prio-medium { color: var(--c-warning); }
.prio-low { color: var(--c-success); }

/* ---------- مراحل (milestones) ---------- */
.milestone-block { margin-bottom: 18px; }
.milestone-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 800;
  margin-bottom: 12px;
  color: var(--c-text-2);
}
.milestone-head .line { flex: 1; height: 2px; border-radius: 2px; background: var(--surface); box-shadow: var(--nm-in-sm); }

/* ---------- جدول ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table.glass-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.glass-table th {
  text-align: right; padding: 12px 14px;
  color: var(--c-text-2); font-size: 12px; font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.glass-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.glass-table tr:last-child td { border-bottom: none; }
.glass-table tbody tr { transition: background .2s; }
.glass-table tbody tr:hover { background: var(--accent-soft); }

/* ---------- فیلترها ---------- */
.filters-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filters-bar select { width: auto; min-width: 150px; }

/* ---------- نمودارها ---------- */
.chart-card { padding: 22px; }
.chart-title { font-size: 14.5px; font-weight: 800; margin-bottom: 18px; }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-visual {
  width: 100%; max-width: 46px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px rgba(255,122,24,.3);
  transition: height .7s cubic-bezier(.2,.8,.3,1);
  position: relative;
  min-height: 4px;
}
.bar-value { font-size: 11.5px; font-weight: 800; color: var(--c-text-2); }
.bar-label { font-size: 11px; color: var(--c-text-3); text-align: center; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--c-text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.donut-center { font-size: 22px; font-weight: 800; }

/* ---------- انتخابگر تاریخ شمسی ---------- */
.jdate { width: 100%; }
.jdate-btn {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--c-text);
  padding: 12px 15px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: box-shadow .22s;
}
.jdate-btn:hover { box-shadow: var(--nm-in-sm), 0 0 0 2px var(--accent-soft); }
.jdate-btn.empty span:first-child { color: var(--c-text-3); }
.jdate-ico { font-size: 15px; opacity: .8; }

.jalali-pop {
  position: fixed;
  z-index: 300;
  width: 290px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--nm);
  border-radius: var(--radius-md);
  animation: rise .18s ease both;
}
.jalali-pop.hidden { display: none; }
.jp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.jp-title { font-size: 14px; font-weight: 800; text-align: center; flex: 1; }
.jp-nav-group { display: flex; gap: 5px; flex-shrink: 0; }
.jp-nav {
  width: 34px; height: 34px;
  border-radius: 11px;
  border: none;
  background: var(--surface);
  box-shadow: var(--nm-sm);
  cursor: pointer;
  font-size: 18px;
  color: var(--accent);
  transition: all .2s;
}
.jp-nav:hover { box-shadow: var(--nm); }
.jp-nav:active { box-shadow: var(--nm-in-sm); }
.jp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.jp-weekdays { margin-bottom: 4px; }
.jp-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-3);
  padding: 4px 0;
}
.jp-cell { aspect-ratio: 1; }
.jp-empty { visibility: hidden; }
.jp-day {
  border: none;
  border-radius: 9px;
  background: transparent;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  transition: all .16s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jp-day:hover { color: var(--accent); box-shadow: var(--nm-sm); }
.jp-day.today { color: var(--accent); box-shadow: var(--nm-in-sm); }
.jp-day.sel {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: var(--accent-glow);
}
.jp-foot {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- تقویم کارها ---------- */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-weekdays { margin-bottom: 6px; }
.cal-weekday {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--c-text-3);
  padding: 6px 2px;
}
.cal-cell {
  min-height: 88px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--nm-in-sm);
  padding: 7px;
  font-size: 11px;
  overflow: hidden;
  transition: all .2s;
}
.cal-empty { background: transparent; box-shadow: none; }
.cal-has { cursor: pointer; }
.cal-has:hover { box-shadow: var(--nm-sm); transform: translateY(-2px); }
.cal-today {
  box-shadow: var(--nm-in-sm), inset 0 0 0 2px var(--accent);
}
.cal-daynum {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--c-text-2);
  margin-bottom: 4px;
}
.cal-today .cal-daynum { color: var(--accent); }
.cal-chip {
  border-radius: 6px;
  padding: 3px 6px;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-open { background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
.chip-done { background: #16a34a; opacity: .75; text-decoration: line-through; }
.chip-late { background: #e0403a; }
.chip-virtual {
  background: transparent;
  border: 1.5px dashed var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.cal-more { font-size: 10px; color: var(--c-text-3); font-weight: 700; }

@media (max-width: 700px) {
  .cal-cell { min-height: 54px; padding: 4px; }
  .cal-chip { display: none; }
  .cal-more { display: none; }
  .cal-has::after {
    content: "●";
    color: var(--accent);
    font-size: 9px;
    display: block;
  }
}

/* ---------- اعلان‌ها ---------- */
.notif-panel {
  position: fixed;
  top: 84px;
  left: 24px;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: 65vh;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--nm);
  border-radius: var(--radius-lg);
  animation: rise .3s ease both;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.notif-panel-header h3 { font-size: 15px; }
.notif-list { overflow-y: auto; padding: 10px 14px 16px; }
.notif-item {
  display: flex; gap: 12px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  transition: background .2s;
  align-items: flex-start;
}
.notif-item.unread { background: var(--accent-soft); }
.notif-icon { font-size: 20px; flex-shrink: 0; }
.notif-text { font-size: 12.5px; line-height: 1.8; }
.notif-time { font-size: 11px; color: var(--c-text-3); margin-top: 2px; }

/* ---------- مودال ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 22, 30, .5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--nm);
  border-radius: var(--radius-lg);
  animation: rise .3s ease both;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-body { padding: 20px 24px 24px; overflow-y: auto; }

/* ---------- توست ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--surface);
  box-shadow: var(--nm);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in .35s ease both;
  max-width: 340px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.out { animation: toast-out .3s ease both; }
@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px); }
}

/* ---------- پروفایل عضو ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; padding: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.profile-info { flex: 1; min-width: 180px; }
.profile-name { font-size: 20px; font-weight: 800; }
.profile-role { font-size: 13px; color: var(--c-text-2); margin-top: 3px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: none; border: none; cursor: pointer;
  font-family: var(--font);
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.back-link:hover { background: var(--accent-soft); }

/* ---------- جزئیات هدف ---------- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.kv-list { display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.kv-list .kv { display: flex; justify-content: space-between; gap: 10px; }
.kv-list .k { color: var(--c-text-3); }
.kv-list .v { font-weight: 700; text-align: left; }

/* ---------- گزارش پیشرفت ---------- */
.log-item {
  display: flex; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  align-items: flex-start;
}
.log-item:last-child { border-bottom: none; }
.log-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.log-date { font-size: 11.5px; color: var(--c-text-3); }

/* ---------- هدف ← کار روزانه ← پیشرفت خودکار ---------- */
.goal-auto-progress-note, .linked-goal-note {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; margin-bottom: 16px;
  border-radius: 14px; background: var(--accent-soft); color: var(--c-text-2);
}
.goal-auto-progress-note > span, .linked-goal-note > span { font-size: 22px; }
.goal-auto-progress-note b, .goal-auto-progress-note small,
.linked-goal-note b, .linked-goal-note small { display: block; }
.goal-auto-progress-note b, .linked-goal-note b { color: var(--c-text); font-size: 13px; }
.goal-auto-progress-note small, .linked-goal-note small { margin-top: 3px; font-size: 11.5px; line-height: 1.7; }
.goal-progress-explainer { margin-top: 10px; color: var(--c-text-3); font-size: 12px; }
.goal-progress-explainer b { color: var(--accent); }
.daily-section-header { align-items: flex-start; margin-bottom: 16px; }
.daily-section-header p { color: var(--c-text-3); font-size: 12px; margin-top: 5px; }
.daily-empty { padding: 26px !important; box-shadow: var(--nm-in-sm); }
.daily-page-intro {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px; margin-bottom: 22px;
}
.daily-page-intro > div { display: flex; align-items: center; gap: 14px; }
.daily-page-icon {
  width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center;
  border-radius: 16px; background: var(--accent-soft); font-size: 24px; box-shadow: var(--nm-in-sm);
}
.daily-page-intro h3 { font-size: 18px; margin-bottom: 5px; }
.daily-page-intro p { color: var(--c-text-2); font-size: 12.5px; line-height: 1.9; }
.daily-section { margin-bottom: 24px; }
.daily-list-title { margin-bottom: 12px; }
.daily-list-title > span { color: var(--c-text-3); font-size: 12px; font-weight: 700; }
.daily-goal-group { padding: 18px; margin-bottom: 14px; }
.daily-goal-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 2px 14px; margin-bottom: 12px; border-bottom: 1px dashed var(--line);
}
.daily-goal-head small, .daily-goal-head span { display: block; color: var(--c-text-3); font-size: 10.5px; }
.daily-goal-head button {
  display: block; margin: 4px 0; padding: 0; border: 0; background: none; color: var(--c-text);
  font: 800 14px/1.7 var(--font); cursor: pointer; text-align: right;
}
.daily-goal-head button:hover { color: var(--accent); }
.daily-goal-progress { text-align: left; flex: 0 0 auto; }
.daily-goal-progress b { display: block; color: var(--accent); font-size: 17px; }
.daily-goal-progress span { margin-top: 2px; }
.daily-section-empty { padding: 22px; color: var(--c-text-3); font-size: 13px; text-align: center; }

/* ---------- گفت‌وگوی تیم ---------- */
.chat-shell { max-width: 900px; margin: 6px auto 0; overflow: hidden; }
.chat-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 24px 18px; border-bottom: 1px solid var(--line);
}
.chat-header h3 { margin: 0; font-size: 17px; font-weight: 800; }
.chat-header p { margin: 5px 0 0; color: var(--c-text-3); font-size: 12.5px; }
.chat-members {
  flex-shrink: 0; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent); font-size: 12px; font-weight: 700;
}
.chat-tabs { display: flex; gap: 8px; padding: 14px 24px 0; }
.chat-tab {
  border: 0; background: transparent; color: var(--c-text-2); cursor: pointer; font-family: var(--font);
  font-size: 12.5px; font-weight: 700; padding: 9px 13px; border-radius: 11px; transition: .2s;
}
.chat-tab:hover { background: var(--accent-soft); color: var(--accent); }
.chat-tab.active { background: var(--accent-soft); color: var(--accent); box-shadow: var(--nm-in-sm); }
.chat-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.chat-people { padding: 10px 10px 16px; border-left: 1px solid var(--line); }
.chat-people.hidden { display: none; }
.chat-people.hidden + .chat-conversation { grid-column: 1 / -1; }
.chat-people-title { color: var(--c-text-3); font-size: 11px; font-weight: 700; margin: 6px 8px 8px; }
.chat-person {
  width: 100%; border: 0; background: transparent; color: var(--c-text); cursor: pointer; font-family: var(--font);
  display: flex; align-items: center; gap: 9px; text-align: right; padding: 9px; border-radius: 12px; transition: .2s;
}
.chat-person:hover, .chat-person.active { background: var(--accent-soft); }
.chat-person b, .chat-person small { display: block; }
.chat-person b { font-size: 12px; }
.chat-person small { margin-top: 2px; color: var(--c-text-3); font-size: 10.5px; }
.chat-no-people { padding: 14px 8px; color: var(--c-text-3); font-size: 11.5px; line-height: 1.8; }
.chat-conversation { min-width: 0; }
.chat-messages {
  min-height: 360px; max-height: min(58vh, 640px); overflow-y: auto;
  padding: 22px 24px; display: flex; flex-direction: column; gap: 18px;
}
.chat-message { display: flex; align-items: flex-start; gap: 10px; max-width: 78%; }
.chat-message.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-message-content { min-width: 0; }
.chat-message-meta { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 5px; }
.chat-message.mine .chat-message-meta { flex-direction: row-reverse; }
.chat-message-meta strong { font-size: 12.5px; }
.chat-message-meta span { color: var(--c-text-3); font-size: 10.5px; white-space: nowrap; }
.chat-bubble {
  background: var(--surface); box-shadow: var(--nm-sm); border-radius: 4px 17px 17px 17px;
  padding: 11px 14px; line-height: 1.9; font-size: 13.5px; overflow-wrap: anywhere;
}
.chat-bubble > span { display: block; white-space: pre-wrap; }
.chat-bubble > span + .chat-image { margin-top: 9px; }
.chat-image {
  display: block; max-width: min(100%, 360px); max-height: 360px; border-radius: 12px;
  object-fit: contain; background: rgba(0,0,0,.06);
}
.chat-voice { display: block; width: min(280px, 100%); height: 38px; margin-top: 3px; }
.chat-bubble > span + .chat-voice { margin-top: 9px; }
.chat-message.mine .chat-bubble {
  background: var(--accent); color: #fff; border-radius: 17px 4px 17px 17px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent);
}
.chat-empty { margin: auto; }
.chat-composer {
  display: flex; align-items: flex-end; gap: 12px; padding: 16px 24px 22px;
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 82%, transparent);
}
.chat-compose-main { flex: 1; min-width: 0; }
.chat-composer textarea { min-height: 52px; max-height: 140px; }
.chat-image-preview { position: relative; display: inline-block; margin: 0 0 8px; }
.chat-image-preview img { display: block; max-width: 110px; max-height: 84px; object-fit: cover; border-radius: 10px; box-shadow: var(--nm-sm); }
.chat-image-preview button {
  position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: var(--c-danger); color: #fff; cursor: pointer; font: 700 12px/1 var(--font);
}
.chat-voice-preview { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; }
.chat-voice-preview audio { width: min(220px, 100%); height: 34px; }
.chat-voice-preview button {
  width: 23px; height: 23px; flex: 0 0 23px; border: 0; border-radius: 50%; background: var(--c-danger);
  color: #fff; cursor: pointer; font: 700 12px/1 var(--font);
}
.chat-attach { flex-shrink: 0; width: 46px; height: 46px; font-size: 17px; }
.chat-voice-btn { flex-shrink: 0; width: 46px; height: 46px; font-size: 17px; }
.chat-voice-btn.recording { color: var(--c-danger); box-shadow: var(--nm-in-sm), 0 0 0 3px rgba(220,38,38,.13); animation: voice-pulse 1s ease-in-out infinite; }
@keyframes voice-pulse { 50% { transform: scale(.94); } }
.chat-send { min-height: 48px; flex-shrink: 0; }
.chat-send span { font-size: 16px; display: inline-block; transform: rotate(180deg); }

/* ============================================================
   واکنش‌گرا
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    margin: 0;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    transform: translateX(105%);
    transition: transform .32s cubic-bezier(.2,.8,.3,1);
    background: var(--surface);
    box-shadow: var(--nm);
  }
  .sidebar.open { transform: translateX(0); border-radius: 0; }
  .menu-toggle { display: inline-flex; }
  .detail-grid { grid-template-columns: 1fr; }
  .main-area { padding: 12px; }
  .topbar { top: 12px; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { flex-direction: column; text-align: center; gap: 8px; padding: 16px 10px; }
  .cards-grid { grid-template-columns: 1fr; }
  .notif-panel { left: 12px; top: 76px; }
  .chat-header { padding: 18px; }
  .chat-tabs { padding: 12px 14px 0; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-people { border-left: 0; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; }
  .chat-people.hidden { display: none; }
  .chat-people-title { display: none; }
  .chat-person { width: auto; min-width: max-content; padding: 7px 9px; }
  .chat-person small { display: none; }
  .chat-header p { display: none; }
  .chat-messages { min-height: 330px; padding: 18px 14px; }
  .chat-message { max-width: 92%; }
  .chat-composer { padding: 14px; gap: 8px; }
  .chat-composer .avatar { display: none; }
  .chat-send { padding: 10px 12px; font-size: 12px; }
  .daily-page-intro { align-items: stretch; flex-direction: column; padding: 18px; }
  .daily-page-intro > .btn { width: 100%; }
  .daily-goal-group { padding: 14px; }
  .daily-goal-head { align-items: flex-start; }
  .daily-section-header { flex-direction: column; }
}
