/* ==========================================================================
   کارنما — استایل پایه (RTL، فارسی، روشن/تاریک)
   پالت برند acc369: فیروزه‌ای #20ae9d + سبز تیره #23453f
   ========================================================================== */

/* ------------------------------------------------------------------ فونت‌ها
   همه محلی (از ایران CDN بیرونی قابل اتکا نیست).
   - Yekan Bakh FaNum (خریداری‌شده، بسته‌ی Pro+): متن کل پنل؛ ارقام فارسی.
   - Gulzar: فقط برای اسم «کارنما». زیرمجموعه‌ی همین ۵ حرف است (۱۸KB به‌جای
     ۹۴۰KB)؛ اگر اسم عوض شد باید دوباره ساخته شود:
       python -m fontTools.subset Gulzar-Regular.ttf --text="کارنما"
         --layout-features='*' --flavor=woff2 --output-file=Gulzar-karnama.woff2 */
@font-face {
  font-family: "Yekan Bakh FaNum"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/YekanBakhFaNum-Regular.58bcab2c58ee.woff2") format("woff2");
}
@font-face {
  font-family: "Yekan Bakh FaNum"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/YekanBakhFaNum-SemiBold.7fd15248fba3.woff2") format("woff2");
}
@font-face {
  font-family: "Yekan Bakh FaNum"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/YekanBakhFaNum-Bold.4578e1d89926.woff2") format("woff2");
}
@font-face {
  font-family: "Gulzar Karnama"; font-weight: 400; font-style: normal; font-display: block;
  src: url("../fonts/Gulzar-karnama.ca9a5a48f9c4.woff2") format("woff2");
}

:root {
  --brand: #20ae9d;
  --brand-dark: #189184;
  --brand-deep: #23453f;
  --accent: #e0a33a;

  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --border: #dfe6ea;
  --border-strong: #c7d3d9;
  --text: #16232a;
  --text-muted: #667e8a;
  --text-inverse: #ffffff;

  --ok: #1f9d55;
  --warn: #d98324;
  --danger: #cf3b3b;
  --info: #2b7fb8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(16, 35, 42, .07), 0 4px 16px rgba(16, 35, 42, .05);
  --shadow-lg: 0 8px 32px rgba(16, 35, 42, .14);
  --sidebar-w: 244px;

  /* نام‌های کوتاهی که در بخش‌های بعدیِ همین فایل استفاده شده‌اند ولی هرگز
     تعریف نشده بودند؛ نتیجه‌اش این بود که آن قسمت‌ها (تب‌ها، پیام‌ها،
     دسترسی‌ها) رنگ خاکستری و کادرشان را نمی‌گرفتند. چون این‌ها فقط نام
     دیگری برای متغیرهای موجودند، در حالت تاریک هم خودبه‌خود درست می‌شوند. */
  --line: var(--border);
  --muted: var(--text-muted);
}

body.theme-dark {
  --bg: #0f1719;
  --surface: #172226;
  --surface-2: #1d2b30;
  --border: #2a3b41;
  --border-strong: #3a4f57;
  --text: #e6eef1;
  --text-muted: #93a8b1;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Yekan Bakh FaNum", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  direction: rtl;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
body.theme-dark a { color: #4fd0be; }

h1, h2, h3, h4 { margin: 0 0 .6rem; font-weight: 700; line-height: 1.4; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .98rem; }

/* ------------------------------------------------------------- چیدمان */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--brand-deep);
  color: #dbe9e6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.brand-mark {
  /* بدون کادر سبز (خواسته‌ی کاربر، ۱۰ اکتبر) تا با اسم Gulzar هم‌تراز دیده شود. */
  width: 36px; height: 36px;
  display: grid; place-items: center; font-size: 1.5rem; flex: 0 0 auto;
}
.brand-text { color: #fff; }
/* اسم پنل با Gulzar (نستعلیق‌گونه؛ بلندتر از متن معمولی، پس line-height خودش را دارد). */
.brand-name { font-family: "Gulzar Karnama", "Yekan Bakh FaNum", serif; font-weight: 400; line-height: 1.9; }
.brand-text.brand-name { font-size: 1.65rem; line-height: 1.5; }
.brand-sub { font-size: .72rem; color: #9fbdb6; }

.nav { padding: .7rem .6rem; flex: 1; }
.nav-section { font-size: .7rem; color: #7fa39c; padding: .8rem .6rem .3rem; letter-spacing: .02em; }
.nav a {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .7rem; margin-bottom: .15rem;
  border-radius: var(--radius-sm); color: #cfe2de; font-size: .88rem;
}
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav a.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav .icon { width: 1.2rem; text-align: center; flex: 0 0 auto; }
.nav .badge-count {
  margin-inline-start: auto; background: rgba(255, 255, 255, .18);
  border-radius: 999px; padding: 0 .45rem; font-size: .72rem; min-width: 1.4rem; text-align: center;
}
.nav a.active .badge-count { background: rgba(0, 0, 0, .22); }

.sidebar-foot { padding: .8rem 1rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .78rem; color: #9fbdb6; }

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

.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: .6rem 1.2rem; display: flex; align-items: center; gap: .8rem;
  position: sticky; top: 0; z-index: 30; flex-wrap: wrap;
}
.topbar .spacer { flex: 1; }
.content { padding: 1.2rem; flex: 1; min-width: 0; }

.page-head {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.page-head .spacer { flex: 1; }
.page-head p.sub { margin: .1rem 0 0; color: var(--text-muted); font-size: .85rem; }

/* --------------------------------------------------------------- تایمر */

.timer-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; padding: .35rem .75rem; border-radius: 999px;
  font-size: .85rem; box-shadow: 0 2px 8px rgba(32, 174, 157, .35);
}
.timer-chip .dot {
  width: .55rem; height: .55rem; border-radius: 50%; background: #fff;
  animation: pulse 1.6s ease-in-out infinite;
}
.timer-chip.stale { background: linear-gradient(135deg, var(--warn), #b96c14); }
.timer-chip a { color: #fff; text-decoration: underline; }
.timer-clock { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .02em; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.timer-idle { color: var(--text-muted); font-size: .85rem; }

/* --------------------------------------------------------------- کارت‌ها */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem;
}
.card-head {
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.card-body { padding: 1rem; }
.card-body.tight { padding: .5rem; }

.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* KPI */
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--shadow);
}
.kpi .label { font-size: .78rem; color: var(--text-muted); }
.kpi .value { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
.kpi .hint { font-size: .75rem; color: var(--text-muted); }
.kpi.accent { border-inline-start: 4px solid var(--brand); }
.kpi.warn { border-inline-start: 4px solid var(--warn); }
.kpi.danger { border-inline-start: 4px solid var(--danger); }

/* --------------------------------------------------------------- دکمه‌ها */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .45rem .85rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-family: inherit; font-size: .85rem; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b12f2f; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: .25rem .55rem; font-size: .78rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-timer { min-width: 7.5rem; }
.btn-timer.running { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-timer.running:hover { background: #b96c14; }

.btn-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------- فرم‌ها */

.field { margin-bottom: .9rem; }
.field > label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; }
.field .help { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }
.field .errors { color: var(--danger); font-size: .78rem; margin-top: .25rem; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%; padding: .45rem .6rem; font-family: inherit; font-size: .87rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(32, 174, 157, .16);
}
textarea { resize: vertical; min-height: 4rem; }
input[type=color] { padding: .1rem; height: 2.2rem; }
input[type=checkbox] { width: auto; accent-color: var(--brand); }

.filters {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end;
}
.filters .field { margin-bottom: 0; min-width: 9rem; }
.filters .field.grow { flex: 1; min-width: 14rem; }

.inline-form { display: inline-flex; gap: .35rem; align-items: center; }

/* --------------------------------------------------------------- جدول */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: .85rem;
}
table.data th, table.data td {
  padding: .55rem .7rem; text-align: right; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  background: var(--surface-2); font-weight: 600; font-size: .8rem;
  color: var(--text-muted); white-space: nowrap;
}
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .actions { white-space: nowrap; text-align: left; }

/* --------------------------------------------------------------- بج‌ها */

.badge {
  display: inline-block; padding: .1rem .5rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; white-space: nowrap; line-height: 1.7;
}
.badge-queued { background: #e7edf0; color: #4c626c; }
.badge-in_progress { background: #d6f0eb; color: #10695e; }
.badge-done { background: #dcf0dd; color: #1c6b32; }
.badge-new { background: #e2eefa; color: #1f5c8a; }
.badge-approved { background: #d6f0eb; color: #10695e; }
.badge-rejected { background: #f6dede; color: #9a2b2b; }
.badge-archived { background: #ece7dd; color: #7a6a4d; }
.badge-manual { background: #f2e8f6; color: #6b3a80; }
.badge-review { background: #fbe6cf; color: #8a4d0e; }

body.theme-dark .badge-queued { background: #2a3b41; color: #a9c0c9; }
body.theme-dark .badge-in_progress { background: #14453f; color: #6fd8c7; }
body.theme-dark .badge-done { background: #1a4527; color: #7fd499; }
body.theme-dark .badge-new { background: #1b3a52; color: #86c3ec; }
body.theme-dark .badge-approved { background: #14453f; color: #6fd8c7; }
body.theme-dark .badge-rejected { background: #4a2222; color: #f0a0a0; }
body.theme-dark .badge-archived { background: #3a3428; color: #d3c19a; }
body.theme-dark .badge-manual { background: #3b2745; color: #d2a8e6; }
body.theme-dark .badge-review { background: #4a3312; color: #f0c183; }

.prio { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; }
.prio-dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.prio-1 .prio-dot { background: #9db3bd; }
.prio-2 .prio-dot { background: var(--info); }
.prio-3 .prio-dot { background: var(--warn); }
.prio-4 .prio-dot { background: var(--danger); }

.due-overdue { color: var(--danger); font-weight: 600; }
.due-soon { color: var(--warn); font-weight: 600; }

/* --------------------------------------------------------------- برد */

.board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.board-col {
  flex: 1 1 300px; min-width: 280px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem;
}
.board-col-head {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem;
  font-weight: 700; font-size: .9rem;
}
.board-col-head .count {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 .45rem; font-size: .75rem; font-weight: 600;
}
.board-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .65rem .75rem; margin-bottom: .6rem; box-shadow: var(--shadow);
  border-inline-start: 4px solid var(--brand);
}
.board-card h4 { margin: 0 0 .35rem; font-size: .9rem; }
.board-card .meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .75rem; color: var(--text-muted); }
.board-card .move { display: flex; gap: .25rem; margin-top: .5rem; flex-wrap: wrap; }

/* --------------------------------------------------------------- نمودار */

.bars { display: flex; flex-direction: column; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 4.5rem; gap: .6rem; align-items: center; font-size: .8rem; }
.bar-track { background: var(--surface-2); border-radius: 999px; height: .8rem; overflow: hidden; border: 1px solid var(--border); }
.bar-fill { background: linear-gradient(90deg, var(--brand), var(--brand-dark)); height: 100%; border-radius: 999px; }
.bar-value { text-align: left; font-variant-numeric: tabular-nums; color: var(--text-muted); }

.week-chart { display: flex; align-items: flex-end; gap: .5rem; height: 8rem; padding-top: .5rem; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; }
.week-bar { width: 100%; max-width: 2.4rem; background: linear-gradient(180deg, var(--brand), var(--brand-dark)); border-radius: 6px 6px 0 0; min-height: 3px; }
.week-col .lab { font-size: .68rem; color: var(--text-muted); white-space: nowrap; }
.week-col .val { font-size: .7rem; font-variant-numeric: tabular-nums; }
.week-col.today .week-bar { background: linear-gradient(180deg, var(--accent), #c1841f); }

/* --------------------------------------------------------------- چک‌لیست */

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; align-items: center; gap: .5rem; padding: .35rem .2rem;
  border-bottom: 1px dashed var(--border);
}
.checklist li:last-child { border-bottom: none; }
.checklist li.done .txt { text-decoration: line-through; color: var(--text-muted); }
.checklist .txt { flex: 1; }
.check-btn { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0 .2rem; color: var(--text-muted); }
.check-btn.on { color: var(--ok); }

.progress-track { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; height: .5rem; overflow: hidden; }
.progress-fill { background: var(--ok); height: 100%; }

/* --------------------------------------------------------------- کامنت */

.comment { display: flex; gap: .6rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); }
.comment:last-child { border-bottom: none; }
.avatar {
  width: 2.1rem; height: 2.1rem; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: .82rem; font-weight: 700;
}
.avatar.sm { width: 1.6rem; height: 1.6rem; font-size: .68rem; }
.avatar.lg { width: 5.5rem; height: 5.5rem; font-size: 1.9rem; }
/* وقتی <img> است باید قاب دایره را پر کند، نه کشیده شود. */
img.avatar { object-fit: cover; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: .74rem; color: var(--text-muted); display: flex; gap: .5rem; align-items: center; }
.comment-text { white-space: pre-wrap; word-break: break-word; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-inline-start: -.45rem; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-inline-start: 0; }

/* --------------------------------------------------------------- پیام‌ها */

.messages { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.msg {
  padding: .6rem .9rem; border-radius: var(--radius-sm); font-size: .86rem;
  border-inline-start: 4px solid var(--info); background: var(--surface); box-shadow: var(--shadow);
}
.msg.success { border-inline-start-color: var(--ok); }
.msg.warning { border-inline-start-color: var(--warn); }
.msg.error { border-inline-start-color: var(--danger); }

.empty {
  text-align: center; padding: 2.2rem 1rem; color: var(--text-muted);
}
.empty .big { font-size: 2rem; display: block; margin-bottom: .4rem; opacity: .6; }

.note-inline { color: var(--text-muted); font-size: .8rem; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }

.pagination {
  display: flex; gap: .3rem; justify-content: center; align-items: center;
  margin-top: 1rem; flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: .3rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); font-size: .82rem;
}
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* --------------------------------------------------------------- لاگین */

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(135deg, var(--brand-deep), #102623);
}
.login-card {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 2rem 1.8rem; width: 100%; max-width: 24rem;
}
.login-brand { text-align: center; margin-bottom: 1.4rem; }
.login-brand .mark {
  width: 56px; height: 56px; border-radius: 16px; background: var(--brand);
  display: grid; place-items: center; margin: 0 auto .7rem; font-size: 1.7rem;
}
.login-brand h1 { font-size: 1.2rem; margin: 0; }
.login-brand h1.brand-name { font-size: 2.2rem; }
.login-brand p { margin: .2rem 0 0; color: var(--text-muted); font-size: .82rem; }

/* --------------------------------------------------------------- ریسپانسیو */

.menu-toggle { display: none; }

@media (max-width: 1024px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; inset-inline-start: 0; top: 0; z-index: 60;
    transform: translateX(100%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50;
  }
  /* minmax(0,…): نمودار ۷ستونه‌ی «کار روزانه» با 1fr ساده کل ستون را از صفحه بیرون می‌زد. */
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .week-chart { overflow-x: auto; overflow-y: hidden; }
  .content { padding: .8rem; }
  .bar-row { grid-template-columns: 5.5rem 1fr 3.6rem; }
}

@media print {
  .sidebar, .topbar, .btn, .filters { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* --------------------------------------------- شبکه‌ی تیک (انتخاب اعضا) */
/* جایگزین <select multiple>: انتخاب چندتایی باید یک کلیک ساده باشد، نه
   Ctrl+کلیک که کاربر پیدایش نمی‌کند. */
.check-tools {
  display: flex; align-items: center; gap: .4rem; margin-bottom: .45rem;
}
.check-count { font-size: .76rem; color: var(--text-muted); margin-inline-start: auto; }
.check-count.empty { color: var(--warning, #b06a00); font-weight: 600; }
/* جنگو همه‌ی تیک‌ها را داخل یک <div> می‌پیچد؛ پس اگر شبکه را روی ظرف
   بیرونی بگذاریم فقط یک فرزند دارد و همیشه تک‌ستونی می‌ماند. شبکه باید
   روی همان بسته‌بندی داخلی بنشیند. */
.check-grid {
  max-height: 15rem; overflow-y: auto;
  border: 1px solid var(--border); border-radius: .5rem;
  padding: .5rem; background: var(--surface-2, transparent);
}
.check-grid > div {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: .3rem;
}
.check-grid div { min-width: 0; }
.check-grid label {
  display: flex; align-items: center; gap: .45rem; cursor: pointer;
  padding: .38rem .5rem; border-radius: .4rem; font-weight: 500;
  border: 1px solid transparent; transition: background .12s, border-color .12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.check-grid label:hover { background: var(--hover, rgba(0,0,0,.04)); }
.check-grid input[type="checkbox"] {
  width: 1.05rem; height: 1.05rem; accent-color: var(--brand); flex: 0 0 auto;
  margin: 0; cursor: pointer;
}
.check-grid input[type="checkbox"]:checked + span,
.check-grid label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft, rgba(32,174,157,.12)); }
.btn-mini { padding: .2rem .55rem; font-size: .74rem; line-height: 1.6; }

/* ------------------------------------------------------- عکس پروفایل */
.avatar-row {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
  padding-bottom: 1rem; border-bottom: 1px dashed var(--border);
}
.avatar-preview {
  width: 5.5rem; height: 5.5rem; border-radius: 50%; overflow: hidden;
  flex: 0 0 auto; background: var(--brand); display: grid; place-items: center;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-fallback { color: #fff; font-size: 1.9rem; font-weight: 700; }
.avatar-actions { min-width: 0; display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }
.avatar-name { font-weight: 700; font-size: 1.05rem; }
.avatar-role { font-size: .8rem; color: var(--text-muted); }

/* کاربر جاری در پایین سایدبار */
.side-user {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem;
  border-radius: .5rem; color: #cfe2de; text-decoration: none; min-width: 0;
}
.side-user:hover { background: rgba(255,255,255,.08); }
.side-user-name {
  font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- دسترسی‌ها ------------------------------------------------------ */
.perm-list { display: flex; flex-direction: column; gap: .55rem; }
.perm-row {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .6rem;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.perm-row:hover { background: var(--surface-2); border-color: var(--accent); }
.perm-row input { margin-top: .25rem; flex: none; width: 1.05rem; height: 1.05rem; }
.perm-row b { display: block; }
.perm-help { display: block; font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.perm-summary { font-size: .78rem; color: var(--muted); margin-top: .25rem; line-height: 1.5; }

/* زمان تیک‌خوردن زیرکار */
.check-done-meta {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  font-size: .78rem; color: var(--muted); margin-inline-start: .4rem;
}
.check-done-meta b { color: var(--text); font-weight: 600; }

/* تاریخ شمسی در نوار بالا */
.topbar-date {
  font-size: .85rem; color: var(--muted); white-space: nowrap;
  margin-inline-end: .6rem;
}
@media (max-width: 640px) { .topbar-date { display: none; } }

/* --- کلید بازه‌ی نمودار ---------------------------------------------- */
.range-switch { display: inline-flex; gap: .25rem; }
.range-btn {
  padding: .28rem .7rem; border-radius: .45rem; font-size: .82rem;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none;
  transition: all .12s;
}
.range-btn:hover { border-color: var(--accent); color: var(--text); }
.range-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.week-chart.dense .week-col .val { display: none; }
.week-chart.dense .week-col .lab { font-size: .62rem; }
.week-chart.dense { gap: .15rem; }

/* --- زیرکار: مالکیت ---------------------------------------------------- */
.checklist li.locked { opacity: .88; }
.check-btn.readonly { cursor: not-allowed; opacity: .55; background: none; border: none; }
.check-owner {
  font-size: .72rem; color: var(--muted); background: var(--surface-2);
  padding: .1rem .4rem; border-radius: .35rem; margin-inline-start: .35rem;
}

/* --- زیرکارها در پروژه‌ی تیمی: گروه‌بندی بر اساس عضو ------------------- */
.check-group {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .55rem .7rem .3rem; margin-bottom: .6rem; background: var(--surface);
}
.check-group.me { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.check-group-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .35rem; }
.check-group-head .spacer { flex: 1; }
.check-group-head .check-owner { margin-inline-start: 0; }
.progress-track.thin { height: 4px; margin-bottom: .3rem; }
.checklist li.empty-row { border: none; font-size: .85rem; }

/* --- پیام‌ها ----------------------------------------------------------- */
.tabs { display: flex; gap: .4rem; margin-bottom: .8rem; }
.tab {
  padding: .45rem .95rem; border-radius: .5rem .5rem 0 0; text-decoration: none;
  color: var(--muted); border: 1px solid transparent; font-size: .92rem;
}
.tab.on { color: var(--text); border-color: var(--border); border-bottom-color: transparent; background: var(--surface); }
.tab-badge {
  display: inline-block; min-width: 1.15rem; padding: 0 .3rem; margin-inline-start: .3rem;
  background: var(--danger, #c0392b); color: #fff; border-radius: 1rem;
  font-size: .72rem; text-align: center;
}
/* --muted و --line هرگز تعریف نشده بودند، پس نشان شمارنده‌ی تب‌های
   غیرفعال نامرئی می‌شد. نام درست: --text-muted و --border. */
.tab-badge.muted { background: var(--text-muted); }
.nav-badge {
  display: inline-block; min-width: 1.15rem; padding: 0 .3rem;
  background: var(--danger, #c0392b); color: #fff; border-radius: 1rem;
  font-size: .72rem; text-align: center; margin-inline-start: auto;
}
.filter-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.chip {
  padding: .25rem .7rem; border-radius: 1rem; font-size: .8rem;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-item { border-bottom: 1px solid var(--line); }
.msg-item:last-child { border-bottom: none; }
.msg-item.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.msg-link { display: block; padding: .8rem 1rem; text-decoration: none; color: inherit; }
.msg-link:hover { background: var(--surface-2); }
.msg-top { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.msg-title { font-weight: 600; }
.msg-meta { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.msg-excerpt { font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.msg-result { font-size: .82rem; color: var(--accent); margin-top: .35rem; }
.msg-result.big { font-size: .95rem; margin-top: 1rem; padding: .6rem .8rem;
  background: var(--surface-2); border-radius: .5rem; }
.msg-body { white-space: pre-wrap; line-height: 1.85; margin-top: .6rem; }
.msg-response {
  margin-top: 1rem; padding: .7rem .9rem; border-inline-start: 3px solid var(--accent);
  background: var(--surface-2); border-radius: .4rem; line-height: 1.8;
}
.dot-new {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--danger, #c0392b); display: inline-block;
}
.action-stack { display: flex; flex-direction: column; gap: .5rem; }
.btn.block { display: block; width: 100%; text-align: start; }
.btn-hint { display: block; font-size: .76rem; opacity: .75; font-weight: 400; margin-top: .15rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0 0 .8rem; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; }

.badge-pending { background: #b7791f; color: #fff; }
.badge-accepted { background: #2b6cb0; color: #fff; }
.badge-completed { background: #2f855a; color: #fff; }
.badge-rejected { background: #9b2c2c; color: #fff; }

/* --- ورود دومرحله‌ای --------------------------------------------------- */
.otp-input {
  font-size: 1.5rem; letter-spacing: .4em; text-align: center;
  font-family: ui-monospace, monospace; padding: .6rem;
}
.otp-qr {
  max-width: 220px; width: 100%; background: #fff; padding: .6rem;
  border-radius: .5rem;
}
.otp-secret {
  display: block; padding: .5rem .7rem; background: var(--surface-2);
  border-radius: .4rem; font-family: ui-monospace, monospace;
  letter-spacing: .1em; word-break: break-all; font-size: .9rem;
}
.backup-codes {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem;
}
.backup-codes li {
  font-family: ui-monospace, monospace; font-size: 1.05rem; letter-spacing: .08em;
  background: var(--surface-2); padding: .5rem; border-radius: .4rem;
  text-align: center;
}
.plain-list { margin: .4rem 0 .8rem; padding-inline-start: 1.2rem; line-height: 2; }
.msg.warn {
  border-inline-start: 3px solid #f0b429;
  background: color-mix(in srgb, #f0b429 12%, transparent);
}

/* ------------------------------------------------- اهداف و برنامه‌ی هفتگی */

.tabs-wrap { flex-wrap: wrap; }
.mini-num { width: 5.2rem; }

/* اولویت هدف: ۱ = مهم‌ترین (برعکس اولویت پروژه که ۴ = فوری است). */
.goal-prio {
  font-size: .74rem; padding: .05rem .5rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap;
}
.goal-prio.gp-1 { background: var(--danger); border-color: var(--danger); color: #fff; }
.goal-prio.gp-2 { background: var(--warn); border-color: var(--warn); color: #fff; }

.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.goal-card {
  display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  border-inline-start: 5px solid var(--goal-color, var(--brand)); box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
}
.goal-card:hover { text-decoration: none; border-color: var(--border-strong); border-inline-start-color: var(--goal-color, var(--brand)); }
.goal-card-head { display: flex; align-items: flex-start; gap: .5rem; justify-content: space-between; }
.goal-fill { background: var(--goal-color, var(--brand)); }
.goal-hours { font-size: .82rem; }
.goal-progress-lg { height: .8rem; }
.goal-swatch {
  display: inline-block; width: .9rem; height: .9rem; border-radius: 4px;
  background: var(--goal-color, var(--brand)); vertical-align: middle;
}
.goal-desc { white-space: pre-wrap; border-top: 1px dashed var(--border); padding-top: .6rem; margin-top: .4rem; }
.page-head .sub .badge, .page-head .sub .goal-prio { margin-inline-end: .25rem; }

.plain-rows { list-style: none; margin: 0; padding: 0; }
.plain-rows li {
  display: flex; flex-wrap: wrap; gap: .3rem .8rem; padding: .5rem 1rem;
  border-bottom: 1px dashed var(--border); font-size: .86rem;
}
.plain-rows li:last-child { border-bottom: none; }

tr.row-done td { color: var(--text-muted); }
tr.row-done strong { text-decoration: line-through; }
.shortfall { font-size: .76rem; color: var(--warn); font-weight: 600; }
.subgoal-add { display: flex; flex-wrap: wrap; gap: .4rem; padding: .8rem 1rem; border-top: 1px solid var(--border); }
.subgoal-add .grow { flex: 1; min-width: 12rem; }
.subgoal-add .jalali-date { width: 10rem; }

/* --- هفته ---------------------------------------------------------------- */

.plan-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem;
  margin-bottom: .8rem; font-size: .86rem; color: var(--text-muted);
}
.plan-summary strong { color: var(--text); }
.plan-remind { display: inline-flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.plan-remind[hidden], .plan-remind [hidden], #blockForm .field[hidden] { display: none !important; }

.plan-week {
  display: grid; grid-template-columns: repeat(7, minmax(8.5rem, 1fr)); gap: .55rem;
  overflow-x: auto; padding-bottom: .4rem; align-items: start;
}
.plan-day {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 10rem;
}
.plan-day.today { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.plan-day-head {
  display: flex; align-items: center; justify-content: space-between; gap: .3rem;
  padding: .45rem .6rem; border-bottom: 1px solid var(--border); font-size: .86rem;
}
.plan-day-head > div { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.plan-day-head .note-inline { font-size: .72rem; }
.plan-day.today .plan-day-head { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.plan-day-body { display: flex; flex-direction: column; gap: .45rem; padding: .45rem; flex: 1; }
.plan-day-foot { font-size: .74rem; color: var(--text-muted); padding: .3rem .6rem; border-top: 1px dashed var(--border); text-align: center; }
.plan-empty { color: var(--text-muted); text-align: center; padding: .8rem 0; font-size: .8rem; }

.plan-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  border-inline-start: 4px solid var(--goal-color, var(--brand));
  padding: .4rem .5rem; font-size: .8rem; line-height: 1.6;
}
.plan-block.overlap { outline: 1px dashed var(--warn); }
.plan-block.st-done { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.plan-block.st-partial { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.plan-block.st-skipped { opacity: .6; }
.plan-block.st-skipped .plan-title { text-decoration: line-through; }
.plan-block-top { display: flex; align-items: center; gap: .25rem; min-width: 0; }
.plan-time { font-weight: 700; font-size: .74rem; white-space: nowrap; }
.plan-flag { font-size: .72rem; color: var(--text-muted); }
.plan-flag.warn { color: var(--warn); }
.plan-title { display: block; font-weight: 600; color: var(--text); word-break: break-word; }
a.plan-title:hover { color: var(--brand-dark); }
.plan-sub { font-size: .72rem; color: var(--text-muted); word-break: break-word; }
.plan-state { display: flex; align-items: center; gap: .3rem; font-size: .74rem; color: var(--text-muted); margin-top: .2rem; }
.plan-block.st-done .plan-state { color: var(--ok); }
.plan-block.st-partial .plan-state { color: var(--warn); }

.plan-actions { display: flex; align-items: flex-start; gap: .2rem; margin-top: .3rem; flex-wrap: wrap; }
.plan-actions form { margin: 0; }
.pb {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.65rem; height: 1.65rem;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text);
  cursor: pointer; font-size: .8rem; list-style: none; padding: 0 .25rem;
}
.pb::-webkit-details-marker { display: none; }
.pb:hover { border-color: var(--border-strong); }
.pb-done:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.pb-skip:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.pb-partial[open] > summary { background: var(--warn); border-color: var(--warn); color: #fff; }
.pb-pop { display: flex; gap: .25rem; margin-top: .25rem; }
.pb-pop .mini-num { width: 4.2rem; padding: .15rem .35rem; }

.today-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .55rem; }

.readonly-bar { margin-bottom: 1rem; border-inline-start-color: var(--accent); }
.readonly-links { margin-inline-start: .5rem; white-space: nowrap; }

.plan-toast {
  position: fixed; bottom: 1rem; inset-inline-start: 1rem; z-index: 100; max-width: 22rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-inline-start: 5px solid var(--brand); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .7rem .9rem; padding-inline-end: 2.2rem; cursor: pointer; font-size: .86rem;
}
.plan-toast-close {
  position: absolute; top: .3rem; inset-inline-end: .4rem; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: .9rem;
}

@media (max-width: 760px) {
  /* موبایل: روزها زیر هم، صفحه از امروز شروع می‌شود (اسکریپت plan_week). */
  .plan-week { grid-template-columns: 1fr; overflow-x: visible; }
  .plan-day { min-height: 0; }
  .plan-remind { margin-inline-start: 0; }
}

/* ---------------------------------- تقویم ماهانه، glow، پیشرفت (۱۰ اکتبر) */

.mcal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.mcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.mcal-wd { text-align: center; font-size: .74rem; color: var(--text-muted); padding-bottom: .15rem; }
.mcal-day {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / .82; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: .86rem;
  transition: transform .12s ease, box-shadow .12s ease;
}
.mcal-day:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); z-index: 5; }
.mcal-day.out { opacity: .38; }
/* شدت رنگ = تعداد کارهای آن روز */
.mcal-day.lv-1 { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.mcal-day.lv-2 { background: color-mix(in srgb, var(--brand) 36%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 60%, var(--border)); }
.mcal-day.lv-3 { background: color-mix(in srgb, var(--brand) 58%, var(--surface)); border-color: var(--brand); color: #fff; }
.mcal-day.today { outline: 2px solid var(--accent); outline-offset: 1px; font-weight: 700; }
.mcal-tip {
  display: none; position: absolute; bottom: calc(100% + 6px); inset-inline-start: 50%;
  transform: translateX(50%); z-index: 30; width: max-content; max-width: 15rem;
  flex-direction: column; gap: .1rem; text-align: start; white-space: normal;
  background: var(--brand-deep); color: #fff; font-size: .74rem; line-height: 1.6;
  padding: .45rem .6rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.mcal-day:hover .mcal-tip, .mcal-day:focus .mcal-tip { display: flex; }

/* پاپ‌آپ تقویم کوچک روی تاریخ نوار بالا */
.topbar-cal { position: relative; cursor: default; }
.topbar-cal-pop {
  display: none; position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 80;
  width: 15.5rem; padding: .7rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.topbar-cal:hover .topbar-cal-pop, .topbar-cal:focus-within .topbar-cal-pop { display: block; }
.topbar-cal-pop:empty { min-height: 15rem; }  /* تا رسیدن تقویم (fetch) قد کادر نپرد */
.mcal.mini .mcal-head { justify-content: center; font-size: .86rem; }
.mcal.mini .mcal-grid { gap: .2rem; }
.mcal.mini .mcal-day { font-size: .74rem; aspect-ratio: 1; }
.mcal.mini .mcal-tip { max-width: 12rem; }

.dash-plan { align-items: start; }

/* روزِ انتخاب‌شده از تقویم */
@keyframes plan-glow {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 14px 2px color-mix(in srgb, var(--accent) 55%, transparent); }
  50% { box-shadow: 0 0 0 2px var(--accent), 0 0 26px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
}
.plan-day.focus { border-color: var(--accent); animation: plan-glow 1.6s ease-in-out 4; }
@media (prefers-reduced-motion: reduce) { .plan-day.focus { animation: none; box-shadow: 0 0 0 2px var(--accent); } }

/* پیشرفت روز و هفته */
.plan-day-foot { display: flex; flex-direction: column; gap: .2rem; }
.plan-day-foot .progress-track { display: block; height: .4rem; }
.plan-day-foot .progress-fill, .week-progress .progress-fill { display: block; }
.week-progress { display: inline-flex; align-items: center; gap: .4rem; }
.week-progress .progress-track { display: inline-block; width: 8rem; height: .55rem; }

/* توضیحات با هاور */
.plan-block { position: relative; }
.plan-block.has-note:hover::after {
  content: attr(data-note); position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 25;
  background: var(--brand-deep); color: #fff; font-size: .74rem; line-height: 1.6; white-space: pre-wrap;
  padding: .4rem .55rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); pointer-events: none;
}
.plan-block.st-postponed { opacity: .55; border-style: dashed; }
.plan-block.st-postponed .plan-title { text-decoration: line-through; }
.plan-block.timing { box-shadow: 0 0 0 2px var(--brand); }
.plan-flag.live { color: var(--brand); }
a.pb { text-decoration: none; }

.st-badge-planned { background: #e7edf0; color: #4c626c; }
.st-badge-done { background: #dcf0dd; color: #1c6b32; }
.st-badge-postponed { background: #fbe6cf; color: #8a4d0e; }
.st-badge-skipped { background: #f6dede; color: #9a2b2b; }

/* اهداف: نوار ابزار، فیلتر اولویت، نمای فهرست */
.goal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.goal-toolbar .filter-row { margin-bottom: 0; align-items: center; }
.chip-count { font-size: .7rem; opacity: .75; }
.goal-table td:first-child { white-space: normal; }
.goal-table .goal-swatch { margin-inline-end: .3rem; }
.goal-table-progress { min-width: 9rem; }
.goal-table-progress .progress-track { margin-bottom: .15rem; }

/* -------------------------------- جعبه‌ی جست‌وجو (combo.js) و «فقط مدت» */

.combo { position: relative; }
.combo-native { display: none !important; }
.combo-input {
  width: 100%; padding: .45rem .6rem; padding-inline-end: 2rem; font-family: inherit; font-size: .87rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.combo-input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
.combo-clear {
  position: absolute; top: 50%; inset-inline-end: .4rem; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .85rem; padding: .1rem .25rem;
}
.combo-clear[hidden] { display: none; }
.combo-list {
  position: absolute; inset-inline: 0; top: calc(100% + 3px); z-index: 40; max-height: 15rem; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.combo-list[hidden] { display: none; }
.combo-item { padding: .4rem .65rem; cursor: pointer; font-size: .86rem; border-bottom: 1px solid var(--border); }
.combo-item:last-child { border-bottom: none; }
.combo-item:hover, .combo-item.active { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.combo-item.on { font-weight: 700; color: var(--brand-dark); }
.combo-empty { padding: .5rem .65rem; color: var(--text-muted); font-size: .82rem; }

.plan-time.flex { font-weight: 700; font-size: .74rem; color: var(--brand-dark); white-space: nowrap; }
body.theme-dark .plan-time.flex { color: #4fd0be; }
#blockForm .field[data-field="time_mode"] ul, #blockForm .field[data-field="scope"] ul, #blockForm .field[data-field="frequency"] ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1rem; flex-wrap: wrap; }

/* -------------------------------------------- مرور آخر روز + کشیدن‌ورها کردن */

.review-banner {
  display: flex; align-items: center; gap: .8rem; justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 1rem; padding: .65rem 1rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border));
  color: var(--text); font-size: .9rem;
}
.review-banner:hover { border-color: var(--warn); text-decoration: none; }
.review-bar {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .6rem 1rem;
  position: sticky; top: .5rem; z-index: 5; margin-bottom: 1rem;
}
.review-all { display: flex; align-items: center; gap: .4rem; font-weight: 600; cursor: pointer; }
.review-row {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem 1rem;
  border-bottom: 1px solid var(--border); border-inline-start: 4px solid var(--goal-color);
}
.review-row:last-child { border-bottom: none; }
.review-time { font-size: .8rem; color: var(--text-muted); min-width: 5.5rem; }
.review-title { font-weight: 600; }
.review-actions { display: flex; gap: .3rem; }
.review-row .spacer { flex: 1; }

.plan-block.draggable { cursor: grab; }
.plan-block.dragging { opacity: .45; cursor: grabbing; }
.plan-day.drop-ok { outline: 2px dashed var(--brand); outline-offset: -2px;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.plan-day.drop-busy { opacity: .6; pointer-events: none; }
.plan-drop-hint {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--brand-deep); color: #fff; padding: .45rem 1rem; border-radius: 999px;
  font-size: .82rem; box-shadow: var(--shadow-lg);
}
.plan-drop-hint[hidden] { display: none; }
.install-btn { margin-bottom: .4rem; }
.install-btn[hidden] { display: none; }

/* -------------------------------------------------------------- ربات‌ها */

.bot-links { display: flex; flex-direction: column; gap: .7rem; }
.bot-link { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.bot-code { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; width: 100%; }
.bot-step { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; width: 100%; }
.bot-code-value { font-size: 1.05rem; font-weight: 700; letter-spacing: .15em; padding: .2rem .6rem;
  border-radius: var(--radius-sm); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); user-select: all; }
.bot-prefs td:not(:first-child), .bot-prefs th:not(:first-child) { text-align: center; width: 6rem; }

/* ---------------------------------------------- ورود با کد ربات */
.login-or { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 .6rem; color: var(--text-muted); font-size: .8rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------------------------------------------- ددلاین اهداف + مرتب‌سازی */
.deadline-list { list-style: none; margin: 0; padding: 0; }
.deadline-list li { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .5rem 1rem;
  border-bottom: 1px solid var(--border); border-inline-start: 4px solid var(--goal-color); }
.deadline-list li:last-child { border-bottom: none; }
.deadline-list a { flex: 1; min-width: 12rem; }
.deadline-title { font-weight: 600; }
.deadline-date { font-size: .82rem; color: var(--text-muted); }
.deadline-left { font-size: .8rem; min-width: 6.5rem; text-align: end; color: var(--text-muted); }
.deadline-list li.soon .deadline-left { color: var(--warn); font-weight: 700; }
.deadline-list li.overdue .deadline-left { color: var(--danger); font-weight: 700; }
.sort-th { color: inherit; white-space: nowrap; }
.sort-th.on { color: var(--brand-dark); }

/* ددلاین در تقویم کارها: نقطه‌ی نارنجی پایین خانه‌ی روز */
.mcal-dl { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #f28c28; box-shadow: 0 0 0 1.5px var(--surface); }
.mcal.mini .mcal-dl { width: 4px; height: 4px; bottom: 2px; }
.mcal-tip-dl { color: #e07a12; font-weight: 700; }

/* ---------------------------------------------- امضای مرخصی */
.sig-box { border: 1px dashed var(--border); border-radius: 8px; background: #fff; padding: .4rem;
  max-width: 600px; }
.sig-box canvas { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.sig-box img { display: block; max-width: 100%; max-height: 200px; margin: 0 auto; }

/* ---------------------------------------------- صفحه‌ی مرخصی */
.badge-withdrawn { background: #ece7dd; color: #7a6a4d; }
.leave-kpis { margin-bottom: 1rem; }
.leave-kpis .value { font-size: 1.15rem; }
.leave-table .leave-note { max-width: 22rem; }
.leave-table .leave-note div { white-space: pre-wrap; }
.leave-row.leave-withdrawn td, .leave-row.leave-rejected td { color: var(--text-muted); }
.leave-balance-line { margin-bottom: 1rem; }
#leaveForm .field[data-field="mode"] > div,
#leaveForm .field[data-field="kind"] > div { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; }
#leaveForm .field[data-field="mode"] label, #leaveForm .field[data-field="kind"] label { font-weight: 400; }
#leaveForm input[type=time] {
  padding: .45rem .6rem; font-family: inherit; font-size: .87rem; background: var(--surface);
  color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.leave-card.over { border-inline-start: 4px solid var(--warn); }
.leave-card .card-head .spacer { flex: 1; }
.leave-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .6rem 1rem; margin: 0 0 .8rem; }
.leave-facts .wide { grid-column: 1 / -1; }
.leave-facts dt { font-size: .75rem; color: var(--text-muted); }
.leave-facts dd { margin: .1rem 0 0; }
.leave-facts .wide dd { white-space: pre-wrap; }
.leave-decide { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.leave-decide input[type=text] { flex: 1; min-width: 12rem; width: auto; }
.leave-shortcuts { margin: 0; align-self: center; }
.leave-person { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 8px);
  margin-bottom: .5rem; }
.leave-person > summary { cursor: pointer; padding: .7rem 1rem; line-height: 1.8; }
.leave-person[open] > summary { border-bottom: 1px solid var(--border); }
.leave-person-body { padding: .7rem 1rem; }
.leave-person-body .btn-row { margin-bottom: .6rem; }
.leave-quota { margin: 0 0 .6rem; font-size: .85rem; }
@media (max-width: 860px) {
  .grid.cols-4.leave-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .leave-person > summary { padding: .6rem .7rem; font-size: .88rem; }
  .leave-person-body { padding: .6rem .5rem; }
  .leave-decide .btn-row { width: 100%; }
  .leave-decide .btn-row .btn { flex: 1; }
}

/* -------------------------------------------- حالت دیدن کارنمای دیگران */

.viewing-top { position: sticky; top: 0; z-index: 30; }
.viewing-banner {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap;
  padding: .5rem 1rem; background: #ffd84d; color: #3a2e00;
  border-bottom: 1px solid #e0b800; font-size: .92rem;
}
.viewing-banner form { margin: 0; }
body.theme-dark .viewing-banner { background: #6b5800; color: #fff6cc; border-bottom-color: #8f7700; }

/* -------------------------------------------- «⭐ نمای کلی» (people/overview.html) */

.ov-head { color: inherit; text-decoration: none; border-radius: var(--radius) var(--radius) 0 0; }
.ov-head:hover { background: var(--surface-2); text-decoration: none; }
.ov-head h2 { font-size: 1rem; }
.ov-open { font-size: .78rem; color: var(--brand-dark); white-space: nowrap; }
.ov-main .card-body { padding: .7rem .9rem; }
.ov-meta { margin: .4rem 0 .2rem; font-size: .78rem; color: var(--text-muted); }
.ov-main .progress-track { margin-top: .1rem; }
.ov-list { list-style: none; margin: 0; padding: 0; }
.ov-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: .6rem;
  padding: .32rem 0; border-bottom: 1px dashed var(--border); font-size: .86rem;
}
.ov-list li:last-child { border-bottom: none; }
.ov-list li > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-list li > :last-child { flex-shrink: 0; }
.ov-list li.ov-empty { color: var(--text-muted); justify-content: flex-start; white-space: normal; }
.ov-st { font-weight: 700; color: var(--text-muted); }
.ov-st.st-done { color: var(--ok); }
.ov-st.st-skipped { color: var(--danger); }
.ov-st.st-postponed { color: var(--warn); }
.badge-late { background: #f6dede; color: #9a2b2b; }
.ov-hours .kpi { box-shadow: none; }
/* نمودار در نیم‌ستون: برچسب روز دوخطی می‌شود؛ ۳۰ روزه در صفحه‌ی باریک افقی می‌لغزد. */
.overview .week-col .lab { white-space: normal; text-align: center; line-height: 1.2; }
.overview .week-chart { overflow-x: auto; overflow-y: hidden; }
@media (max-width: 860px) {
  /* 1fr ساده با متن nowrap/نمودار پهن، ستون را از صفحه بیرون می‌زد. */
  .overview .grid.cols-2, .overview .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .grid.cols-3.ov-hours { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .ov-hours .kpi { padding: .6rem .5rem; }
  .ov-hours .kpi .value { font-size: 1.1rem; }
}

/* فهرست «افراد مجموعه»: اسم = دکمه‌ی ورود به حالت دیدن (فرم POST) */
.person-link {
  background: none; border: 0; padding: 0; font: inherit; color: var(--brand-dark);
  cursor: pointer; text-align: start;
}
.person-link:hover { text-decoration: underline; }
.inactive-people { display: flex; flex-wrap: wrap; gap: .35rem; }
.person-chip { border: 0; font-family: inherit; cursor: pointer; }
.person-chip:hover { filter: brightness(.95); text-decoration: underline; }

/* بلوک خودکارِ ددلاین در برنامه‌ی هفتگی (هم‌رنگ نقطه‌ی ددلاین تقویم) */
.plan-block.deadline { border-inline-start: 4px solid var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--card, #fff)); }
.plan-block.deadline .plan-title::before { content: "⏰ "; }

/* ساعت گرد فرم بلوک (panel/js/clock-picker.js) */
.cp { margin-top: .75rem; max-width: 22rem; }
.cp-chips { display: flex; gap: .5rem; }
.cp-chip { flex: 1; padding: .6rem; border: 2px solid var(--border, #cfd5dc); border-radius: 12px;
  background: var(--surface-2, #f6f8fa); font: inherit; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, transform .15s ease; }
.cp-chip:active { transform: scale(.97); }
.cp-chip.on { border-color: var(--brand, #20ae9d); background: color-mix(in srgb, var(--brand, #20ae9d) 12%, transparent); }
.cp-bar { display: flex; justify-content: space-between; align-items: center; margin: .6rem 0 .3rem; font-size: .85rem; }
.cp-mode { color: var(--text-muted, #667e8a); transition: opacity .2s ease; }
.cp-seg { display: inline-flex; border: 1px solid var(--border, #cfd5dc); border-radius: 8px; overflow: hidden; }
.cp-seg button { border: 0; background: transparent; padding: .3rem .8rem; font: inherit; cursor: pointer;
  transition: background-color .2s ease, color .2s ease; }
.cp-seg button.on { background: var(--brand, #20ae9d); color: #fff; }
.cp-dial { width: 100%; max-width: 300px; display: block; margin: 0 auto; touch-action: none; user-select: none; cursor: pointer; }
.cp-face { transform-box: view-box; transform-origin: center; transition: opacity .16s ease, transform .16s ease; }
.cp-face.swap { opacity: 0; transform: scale(.9); }
.cp-bg { fill: var(--surface-2, #f1f3f6); }
.cp-wedge { animation: cpFade .28s ease both; }
.cp-busy { fill: #b9c0c8; }
.cp-pick { fill: color-mix(in srgb, var(--brand, #20ae9d) 45%, transparent); }
.cp-num { text-anchor: middle; font-size: 17px; font-weight: 700; fill: var(--text, #2a2f36); pointer-events: none; }
.cp-num.on { fill: #fff; }
.cp-sel { fill: var(--brand, #20ae9d); transform-box: fill-box; transform-origin: center; animation: cpPop .22s cubic-bezier(.2,.9,.3,1.3) both; }
.cp-hand { transform-box: view-box; transform-origin: 150px 150px; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s ease; pointer-events: none; }
.cp-hand-line { stroke: var(--brand, #20ae9d); stroke-width: 3; stroke-linecap: round; }
.cp-center { fill: var(--brand, #20ae9d); }
.cp-msg { min-height: 1.4rem; text-align: center; font-size: .85rem; margin-top: .3rem; transition: color .2s ease; }
.cp-msg.ok { color: var(--brand, #20ae9d); }
.cp-msg.bad { color: var(--danger, #cf3b3b); }
.cp-day { margin-top: .5rem; border-top: 1px solid var(--border, #e5e7eb); padding-top: .5rem; font-size: .85rem; line-height: 1.9; }
.cp-day-title { font-weight: 700; }
.cp-day-row { animation: cpFade .25s ease both; }
.cp-day-row::before { content: "⬜ "; }
.cp-day-row.flex::before { content: "⌛ "; }
.cp-day-row.deadline { color: var(--warn, #d98324); }
.cp-day-empty { color: var(--text-muted, #667e8a); }
@keyframes cpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cpPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cp-face, .cp-hand, .cp-wedge, .cp-sel, .cp-day-row { transition: none; animation: none; }
}

/* فرم بلوک: سه تب هدف / پروژه / یادآوری */
#blockForm .field[data-field="tab"] > label:first-child { display: none; }
#blockForm .field[data-field="tab"] > div { display: flex; gap: .4rem; background: var(--surface-2, #f8fafb);
  border: 1px solid var(--border, #dfe6ea); border-radius: 12px; padding: .3rem; }
#blockForm .field[data-field="tab"] > div > div { flex: 1; }
#blockForm .field[data-field="tab"] input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
#blockForm .field[data-field="tab"] label { display: block; text-align: center; padding: .55rem .4rem; border-radius: 9px;
  cursor: pointer; font-weight: 600; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
#blockForm .field[data-field="tab"] label:has(input:checked) { background: var(--surface, #fff); color: var(--brand, #20ae9d);
  box-shadow: var(--shadow); }
#blockForm .field[hidden] { display: none; }
#blockForm .field { animation: cpFade .2s ease backwards; }  /* نه both: انیمیشنِ ماندگار هر فیلد را stacking context می‌کند و فیلد بعدی روی فهرست کشویی می‌افتد */
.plan-block.reminder .plan-title::before { content: "🔔 "; }

/* پیوست ویس/عکس (attach.js، attachments/_list.html) */
.att-widget { margin-top: .5rem; }
.att-buttons { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.att-rec.recording { background: color-mix(in srgb, var(--danger, #cf3b3b) 14%, transparent); color: var(--danger, #cf3b3b); }
.att-timer { color: var(--danger, #cf3b3b); font-weight: 700; animation: attPulse 1s ease-in-out infinite; }
.att-status { font-size: .85rem; min-height: 1.2rem; color: var(--text-muted, #667e8a); }
.att-status.bad { color: var(--danger, #cf3b3b); }
.att-previews, .att-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.att-item { position: relative; display: flex; align-items: center; gap: .4rem; animation: cpFade .25s ease both; }
.att-item img, .att-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border, #dfe6ea); display: block; }
.att-voice { display: flex; align-items: center; gap: .4rem; background: var(--surface-2, #f8fafb); border: 1px solid var(--border, #dfe6ea);
  border-radius: 999px; padding: .2rem .6rem; }
.att-voice audio, .att-item audio { height: 34px; max-width: 220px; }
.att-dur { font-size: .8rem; color: var(--text-muted, #667e8a); }
.att-x, .att-del button { border: 0; background: rgba(0,0,0,.55); color: #fff; width: 22px; height: 22px; border-radius: 50%;
  cursor: pointer; font-size: 12px; line-height: 22px; padding: 0; }
.att-image .att-x, .att-image .att-del { position: absolute; top: 4px; inset-inline-end: 4px; }
.att-del { display: inline; margin: 0; }
@keyframes attPulse { 50% { opacity: .45; } }


/* -------------------------------- وضعیت حضور و بخش «جلسه» (views_meetings) */
:root { --st-green: #1f9d55; --st-red: #d64545; --st-yellow: #e0a33a; --st-grey: #8b98a0;
        --st-blue: #3e8ed0; --st-purple: #9b5de5; }
.st-dot { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; flex: none;
          background: var(--st-grey); }
.st-dot.green { background: var(--st-green); } .st-dot.red { background: var(--st-red); }
.st-dot.yellow { background: var(--st-yellow); } .st-dot.blue { background: var(--st-blue); }
.st-dot.purple { background: var(--st-purple); } .st-dot.grey { background: var(--st-grey); }
.st-chip { position: relative; }
.st-chip > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--border); border-radius: 99px; padding: .2rem .65rem; font-size: .8rem;
  background: var(--surface); color: var(--text); white-space: nowrap; }
.st-chip > summary::-webkit-details-marker { display: none; }
.st-chip > summary .st-until { color: var(--text-muted); font-size: .74rem; }
.st-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 60; width: 18rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .6rem; font-size: .85rem; }
.st-menu .st-opt { display: flex; align-items: center; gap: .5rem; padding: .35rem .45rem; border-radius: var(--radius-sm);
  cursor: pointer; }
.st-menu .st-opt input { position: absolute; opacity: 0; pointer-events: none; }
.st-menu .st-opt:has(input:checked) { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); font-weight: 700; }
.st-menu .st-label { font-size: .75rem; color: var(--text-muted); margin: .5rem 0 .3rem; }
.st-durs { display: flex; flex-wrap: wrap; gap: .3rem; }
.st-durs label { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .15rem .45rem;
  font-size: .76rem; cursor: pointer; }
.st-durs input { position: absolute; opacity: 0; pointer-events: none; }
.st-durs label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.st-menu input[type="text"], .st-menu input[type="number"] { width: 100%; margin-top: .35rem; padding: .3rem .45rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: .8rem; }
.st-menu .st-actions { display: flex; gap: .4rem; align-items: center; margin-top: .55rem; flex-wrap: wrap; }
.st-menu .st-actions a { font-size: .78rem; }
@media (max-width: 640px) {
  .st-chip > summary .st-text { display: none; }
  .st-chip > summary { padding: .3rem; }
  .st-chip > summary .st-dot { width: .95rem; height: .95rem; }
  .st-chip[open]::before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 59; }
  .st-menu { position: fixed; top: auto; bottom: 0; inset-inline: 0; width: auto; max-height: 85vh; overflow-y: auto;
    border-radius: 16px 16px 0 0; padding: .9rem 1rem 1.2rem; }
}

.mt-tabs { display: flex; gap: .3rem; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .25rem; margin-bottom: 1rem; overflow-x: auto; }
.mt-tabs a { flex: 1; text-align: center; padding: .45rem .7rem; border-radius: var(--radius-sm); white-space: nowrap;
  color: var(--text-muted); font-size: .86rem; text-decoration: none; }
.mt-tabs a.on { background: var(--surface); color: var(--brand-dark); font-weight: 700; box-shadow: var(--shadow); }
body.theme-dark .mt-tabs a.on { color: var(--brand); }
.mt-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: .7rem; }
.mt-person { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .7rem .8rem; display: flex; flex-direction: column; gap: .3rem; font-size: .84rem; }
.mt-person .mt-who { font-weight: 700; display: flex; align-items: center; gap: .45rem; }
.mt-person .mt-state { display: flex; align-items: center; gap: .4rem; }
.mt-person .mt-sub { color: var(--text-muted); font-size: .76rem; }
.mt-acts { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .2rem; }
.mt-acts form { display: inline; }
.mt-summary { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; font-size: .82rem;
  color: var(--text-muted); }
@media (max-width: 640px) {
  .mt-people { grid-template-columns: 1fr; gap: .4rem; }
  .mt-person { flex-direction: row; align-items: center; padding: .5rem .6rem; }
  .mt-person .mt-main { flex: 1; min-width: 0; }
  .mt-person .mt-acts { margin: 0; flex-wrap: nowrap; }
  .mt-acts .mt-long { display: none; }
}
.mt-acts .mt-short { display: none; }
@media (max-width: 640px) { .mt-acts .mt-short { display: inline; } }

.mt-list { display: flex; flex-direction: column; gap: .5rem; }
.mt-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .6rem .8rem; display: flex; gap: .7rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mt-row-main { flex: 1; min-width: 14rem; display: flex; flex-direction: column; gap: .25rem; }
.mt-row-title { font-weight: 700; color: var(--text); text-decoration: none; }
.mt-row.mt-st-cancelled { opacity: .65; }
.mt-sub { color: var(--text-muted); font-size: .78rem; }
.mt-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.mt-chip { font-size: .74rem; border: 1px solid var(--border); border-radius: 99px; padding: .05rem .5rem; color: var(--text-muted); }
.mt-chip.mt-r-accepted { border-color: var(--st-green); color: var(--st-green); }
.mt-chip.mt-r-declined, .mt-chip.mt-r-dropped { border-color: var(--st-red); color: var(--st-red); text-decoration-line: none; }
.mt-chip.mt-r-proposed { border-color: var(--st-yellow); color: var(--st-yellow); }
.mt-warn { font-size: .78rem; color: var(--warn); }
.mt-acts .mt-reason, .mt-inline-form input[type="text"] { width: 11rem; padding: .25rem .45rem; font-size: .8rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.mt-inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; font-size: .82rem; }
.mt-inline-form input[type="time"], .mt-num { width: 7rem; padding: .25rem .4rem; font-size: .8rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.mt-visiting { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; font-size: .82rem; }
.pagination-numbers { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.pagination-numbers a, .pagination-numbers .current { min-width: 2rem; text-align: center; padding: .2rem .5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; }
.pagination-numbers .current { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 640px) {
  .mt-row { flex-direction: column; align-items: stretch; }
  .mt-row .mt-acts { justify-content: flex-start; }
}

/* ⚙️ تنظیمات */
.settings-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0 .8rem; }
.settings-status input, .settings-form input[type="number"] { max-width: 9rem; }
.shift-table input { width: 5.5rem; }
.rule-item { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .6rem; }
.rule-item.on { border-color: var(--brand); }
.rule-shifts { list-style: none; margin: 0 0 .3rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.rule-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }

/* ------------------------------------------------------------------ حرکت نرم
   بی‌فریم‌ورک: جابه‌جایی صفحه با View Transitions خود مرورگر (کروم/اج؛ بقیه مثل قبل)،
   و چند حرکت کوچک. کسی که «کاهش حرکت» را در سیستمش روشن کرده هیچ‌کدام را نمی‌بیند. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .sidebar { view-transition-name: sidebar; }   /* منو و نوار بالا سر جایشان می‌مانند */
  .topbar { view-transition-name: topbar; }
  ::view-transition-old(root) { animation: vtOut .14s ease both; }
  ::view-transition-new(root) { animation: vtIn .22s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes vtOut { to { opacity: 0; } }
  @keyframes vtIn { from { opacity: 0; transform: translateY(6px); } }

  .btn:active { transform: scale(.97); }
  .nav a { transition: background .15s ease, color .15s ease; }
  table.data tbody tr { transition: background-color .12s ease; }
  .messages .msg { animation: popIn .28s cubic-bezier(.2, .8, .2, 1) both; }
  .topbar-cal:hover .topbar-cal-pop, .topbar-cal:focus-within .topbar-cal-pop,
  .st-chip[open] .st-menu { animation: popIn .18s cubic-bezier(.2, .8, .2, 1) both; }
  tr.seg-more:not([hidden]) { animation: cpFade .25s ease both; }
  @keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 640px) {
  .st-chip[open] .st-menu { animation: sheetUp .24s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
}

/* اهداف: خلاصه، جستجو، سرتیتر دسته‌ها در تب «همه» */
.goal-kpis { margin-bottom: 1rem; }
.goal-kpis .value { font-size: 1.25rem; }
.goal-search { display: flex; gap: .5rem; align-items: center; margin: .2rem 0 .8rem; }
.goal-search input[type="search"] { flex: 1 1 auto; width: auto; min-width: 0; max-width: 28rem; }
.goal-search .btn { flex: none; }
.goal-group-title { font-size: 1rem; font-weight: 600; color: var(--text-muted); margin: 1.2rem 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.goal-group-title:first-of-type { margin-top: .2rem; }
.goal-card .badge-late { font-size: .72rem; }
@media (max-width: 640px) {
  .grid.cols-4.goal-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .goal-kpis .kpi { padding: .55rem .7rem; }
  .goal-kpis .value { font-size: 1.1rem; }
  .goal-kpis .hint { display: none; }
}
.brand-logo-preview { max-height: 4rem; max-width: 12rem; display: block; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .3rem; }
