/* ============================================================
   Trenno — کامپوننت‌های ماژول‌ها (سبک وایرفریم سیاه‌وسفید)
   ============================================================ */

/* ---------- دراپ‌داون ---------- */
.wf-dropdown {
    border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hard);
    padding: 8px; min-width: 240px; background: var(--paper);
}
.wf-dropdown .dd-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.dd-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 700; color: var(--ink); font-size: 13.5px; }
.dd-item:hover { background: var(--hover); }
.dd-item .bi { font-size: 16px; }

/* ---------- مودال ---------- */
.wf-modal { border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--modal-shadow); background: var(--paper); overflow: hidden; }
.wf-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1.5px solid var(--line); }
.wf-modal-head h4 { font-size: 17px; }
.wf-modal-body { padding: 18px; max-height: 78vh; overflow-y: auto; }
.modal-backdrop.show { opacity: .35; }
.create-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.create-opt .bi { font-size: 24px; }

/* ---------- توست ---------- */
.toast-host { position: fixed; bottom: 20px; left: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.wf-toast { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hard); padding: 11px 15px; font-weight: 700; min-width: 240px; animation: toastIn .2s ease; }
.wf-toast.err { background: #fdf3f2; border-color: #c0392b; }
.wf-toast .bi { font-size: 18px; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- لودرِ سراسری (نشانگرِ «در حال انجام») ---------- */
.wf-loader { position: fixed; inset: 0; z-index: 4000; display: none; align-items: center; justify-content: center; background: transparent; pointer-events: none; transition: background .12s ease; }
/* قفلِ بی‌درنگِ کلیک روی کل صفحه به‌محضِ شروعِ درخواست (جلوگیری از ارسال/کلیکِ دوباره) — بدونِ تیره‌شدن */
.wf-loader.blocking { display: flex; pointer-events: auto; }
/* پس از تأخیرِ کوتاه: تیره‌شدنِ ملایم و نمایشِ جعبه‌ی چرخان */
.wf-loader.show { background: var(--overlay); }
.wf-loader-box { display: none; flex-direction: column; align-items: center; gap: 12px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hard); padding: 18px 26px; }
.wf-loader.show .wf-loader-box { display: flex; }
.wf-spinner { width: 32px; height: 32px; border: 3px solid var(--line-soft); border-top-color: var(--ink); border-radius: 50%; animation: wfspin .7s linear infinite; }
.wf-loader-text { font-weight: 700; font-size: 13px; color: var(--ink-2); }
@keyframes wfspin { to { transform: rotate(360deg); } }

/* ---------- اندازهٔ فونتِ سراسری (ترجیحِ کاربر) ---------- */
/* چون استایل‌ها بیشتر با px تعریف شده‌اند، از zoom استفاده می‌شود تا همهٔ متن‌ها واقعاً مقیاس بخورند */
html.fs-sm { zoom: 0.9; }
html.fs-lg { zoom: 1.14; }
/* دکمه‌های انتخابِ اندازهٔ فونت در تنظیمات */
.fs-opt.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* ---------- انتخابگرِ تمِ برنامه (کاغذی / مدرن / تیره) ---------- */
.theme-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .theme-opts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .theme-opts { grid-template-columns: 1fr; } }
.theme-opt {
    border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper);
    padding: 10px; cursor: pointer; text-align: center; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.theme-opt:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.theme-opt.active { border-color: var(--accent); box-shadow: var(--focus); }
.theme-opt .to-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 13.5px; }
.theme-opt .to-check { color: var(--accent); opacity: 0; transition: opacity .12s ease; }
.theme-opt.active .to-check { opacity: 1; }

/* پیش‌نمایشِ کوچکِ هر تم (رنگ‌های ثابتِ آن تم، مستقل از تمِ فعلی) */
.theme-swatch { height: 64px; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; margin-bottom: 9px; }
.theme-swatch .ts-top { height: 15px; flex: none; }
.theme-swatch .ts-main { flex: 1; padding: 7px; display: flex; gap: 6px; align-items: flex-start; }
.theme-swatch .ts-chip { width: 24px; height: 10px; border-radius: 999px; flex: none; }
.theme-swatch .ts-card { flex: 1; height: 27px; border-radius: 6px; }

.ts-paper { background: #eceae4; }
.ts-paper .ts-top { background: #fff; border-bottom: 1.5px solid #1b1b1a; }
.ts-paper .ts-card { background: #fff; border: 1.5px solid #1b1b1a; box-shadow: 2px 2px 0 #1b1b1a; }
.ts-paper .ts-chip { background: #1b1b1a; }

.ts-modern { background: #eef1f6; }
.ts-modern .ts-top { background: #fff; border-bottom: 1px solid #e2e6ee; }
.ts-modern .ts-card { background: #fff; border: 1px solid #e2e6ee; box-shadow: 0 4px 10px rgba(31,41,59,.14); }
.ts-modern .ts-chip { background: #4f46e5; }

.ts-dark { background: #15171c; }
.ts-dark .ts-top { background: #1e2128; border-bottom: 1px solid #333a46; }
.ts-dark .ts-card { background: #23262f; border: 1px solid #333a46; box-shadow: 0 4px 12px rgba(0,0,0,.6); }
.ts-dark .ts-chip { background: #6366f1; }

.ts-neo { background: #e9edf4; }
.ts-neo .ts-top { background: #e9edf4; box-shadow: 0 3px 7px rgba(163,177,198,.5); }
.ts-neo .ts-card { background: #e9edf4; box-shadow: 3px 3px 6px rgba(163,177,198,.6), -3px -3px 6px rgba(255,255,255,.95); }
.ts-neo .ts-chip { background: #5b7cfa; box-shadow: 2px 2px 4px rgba(163,177,198,.6); }

/* لیستِ گیرندگانِ اضافه‌ی یادآوری */
.rem-search { width: 100%; }
.rem-recip-list { max-height: 160px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 6px; }
.rem-recip { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 2px; cursor: pointer; border-radius: var(--radius-sm); }
.rem-recip:hover { background: var(--hover); }
.rem-recip input { margin: 0; }
.rem-recip input:checked + span { font-weight: 700; }

/* ورودیِ چیپِ شماره‌ی موبایلِ یادآوری: پیل‌های بوردردار + دکمه‌ی «+» (حسِ کاغذی) */
.phone-chips .pc-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.phone-chips .pc-list:empty { display: none; }
.pc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 700; }
.pc-chip .pc-num { direction: ltr; unicode-bidi: plaintext; }
.pc-chip .pc-x { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 50%; background: var(--hover); color: var(--ink); cursor: pointer; font-size: 11px; line-height: 1; }
.pc-chip .pc-x:hover { background: var(--ink); color: #fff; }
.pc-input-row { display: flex; gap: 6px; align-items: center; }
.pc-input-row .pc-entry { flex: 1; min-width: 0; }
.pc-input-row .pc-add { flex: 0 0 auto; }

/* دکمه/لینکِ در حالِ ارسال: متن پنهان و اسپینرِ کوچک داخلِ آن */
.is-loading { position: relative; }
button.is-loading, a.is-loading, input.is-loading { color: transparent !important; }
button.is-loading::after, a.is-loading::after, input.is-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 15px; height: 15px; margin: -8px 0 0 -8px;
    border: 2px solid rgba(27,27,26,.3); border-top-color: var(--ink); border-radius: 50%; animation: wfspin .7s linear infinite;
}

/* ============================================================
   داشبورد
   ============================================================ */
.recent-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.board-tile { display: block; overflow: hidden; }
.board-tile .tile-thumb { height: 96px; border-bottom: 1.5px solid var(--line); position: relative; }
.board-tile .tile-body { padding: 10px 12px; }
.board-tile .tile-title { font-weight: 800; font-size: 14px; }
.board-tile .tile-sub { font-size: 12px; color: var(--muted); }
.board-tile .star { position: absolute; top: 7px; left: 8px; font-size: 15px; }

.dash-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* آکاردئون فضاهای کاری */
.ws-accordion { }
.ws-acc-item { margin-bottom: 12px; }
.ws-acc-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.ws-acc-head .ws-ico { width: 30px; height: 30px; border: 1.5px solid var(--line); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; background: var(--paper); flex: none; }
.ws-acc-head .chev { margin-right: auto; transition: transform .15s; }
.ws-acc-item.open .ws-acc-head .chev { transform: rotate(180deg); }
.ws-acc-body { display: none; border-top: 1.5px solid var(--line); }
.ws-acc-item.open .ws-acc-body { display: block; }
.ws-board-row { display: grid; grid-template-columns: 1fr 120px auto; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.ws-board-row:last-child { border-bottom: 0; }
.ws-board-row:hover { background: var(--hover); }
.ws-board-row .b-name { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.ws-board-row .b-thumb { width: 30px; height: 24px; flex: none; }

/* سایدبار داشبورد (فضاهای کاری شما + فعالیت اخیر) */
.side-list a { display: flex; align-items: center; gap: 9px; padding: 8px 4px; font-weight: 700; }
.side-list a:hover { color: var(--ink); }
.side-list .ico { width: 26px; height: 26px; border: 1.5px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* فید فعالیت */
.activity-feed { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-item .act-ico { width: 28px; height: 28px; border: 1.5px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 13px; }
.activity-item .act-text { font-size: 13px; line-height: 1.7; }
.activity-item .act-time { font-size: 11.5px; color: var(--muted); }

/* ============================================================
   فضاهای کاری — مدیریت
   ============================================================ */
.ws-mng-item { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 14px; }
.ws-mng-item .ws-ico-lg { width: 48px; height: 48px; border: 1.5px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex: none; }
.ws-mng-item .ws-actions { display: flex; align-items: center; gap: 8px; margin-right: auto; flex-wrap: wrap; }
.ws-role { font-size: 12px; font-weight: 800; }

/* ============================================================
   نمای برد + کانبان
   ============================================================ */
.board-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1.5px solid var(--line); background: var(--paper); flex-wrap: wrap; }
.board-header .board-name { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.board-header .crumb { color: var(--muted); font-weight: 700; }
.board-header .star-btn { cursor: pointer; font-size: 18px; }
.board-header .head-actions { margin-right: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.board-body { display: flex; gap: 0; height: calc(100vh - 56px - 60px); }
.kanban { flex: 1; display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; overflow-x: auto; overflow-y: hidden; }
.kb-list {
    width: 274px; flex: none; background: var(--paper-2); border: 1.5px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-soft); max-height: 100%;
    display: flex; flex-direction: column;
}
.kb-list-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; font-weight: 800; }
.kb-list-head.list-drag-handle { cursor: grab; }
.kb-list-head.list-drag-handle:active { cursor: grabbing; }
.kb-list.dragging { opacity: .45; }
.kb-list-placeholder { flex: none; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--active); align-self: flex-start; }
.kb-list-head .count { font-size: 12px; color: var(--muted); font-weight: 800; border: 1.5px solid var(--line-soft); border-radius: 999px; padding: 0 7px; }
.kb-list-head .list-menu { margin-right: auto; cursor: pointer; color: var(--muted); }
.kb-cards { padding: 4px 10px 10px; overflow-y: auto; flex: 1; min-height: 10px; }
.kb-card {
    background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    padding: 10px; margin-bottom: 9px; cursor: pointer; box-shadow: var(--shadow-soft);
    transition: box-shadow .1s, transform .1s;
}
.kb-card:hover { box-shadow: var(--shadow-hard); transform: translate(-1px,-1px); }
.kb-card.dragging { opacity: .5; }
.kb-card .card-labels { display: flex; gap: 4px; margin-bottom: 7px; flex-wrap: wrap; }
/* برچسب کارت: پیش‌فرض فقط رنگ؛ با کلاس labels-expanded روی کانبان، اسم نمایش داده می‌شود */
.card-label {
    display: inline-flex; align-items: center; height: 16px; min-width: 40px;
    border: 1.5px solid rgba(0,0,0,.3); border-radius: 5px; cursor: pointer;
    overflow: hidden; box-sizing: border-box;
}
.card-label .ln { display: none; padding: 0 8px; font-size: 11px; font-weight: 800; white-space: nowrap; line-height: 1.6; }
.kanban.labels-expanded .card-label { min-width: 0; height: auto; }
.kanban.labels-expanded .card-label .ln { display: inline-block; }
/* چیپ تاریخِ کارت — رنگ ملایم و کم‌رنگ */
.card-due { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; font-size: 11.5px; font-weight: 800; border-radius: 6px; border: 1.5px solid; }
.card-due.due-soon { background: #fdf5df; color: #8a6a12; border-color: #e7d29a; }
.card-due.due-over { background: #fbe6e3; color: #b23b30; border-color: #ecb9b2; }
.card-due.due-done { background: #e7f5ed; color: #1f7a45; border-color: #bce1cb; }
.kb-card .card-title { font-weight: 700; font-size: 13.5px; line-height: 1.7; }
.kb-card .card-thumb { height: 74px; margin: -2px 0 8px; }
.kb-card .card-foot { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.kb-card .card-foot .grow { flex: 1; }
.kb-card.is-complete .card-title { text-decoration: line-through; color: var(--muted); }
.kb-add { padding: 8px 10px 12px; }
.kb-add-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 10px; border: 1.5px dashed var(--line-soft); border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); font-weight: 700; cursor: pointer; font-family: var(--font); }
.kb-add-btn:hover { border-color: var(--line); background: var(--hover); }
.kb-add form textarea { margin-bottom: 8px; }

.kb-list.add-list { background: transparent; border: 1.5px dashed var(--line-soft); }
.kb-list.add-list:hover { border-color: var(--line); }
.kb-drop-hint { border: 1.5px dashed var(--line-soft); border-radius: var(--radius-sm); min-height: 40px; }

/* placeholder هنگام درگ */
.kb-placeholder { background: var(--active); border: 1.5px dashed var(--line); border-radius: var(--radius-sm); margin-bottom: 9px; }

/* سایدبار برد */
.board-sidebar { width: 280px; flex: none; border-right: 1.5px solid var(--line); background: var(--paper); padding: 16px; overflow-y: auto; max-height: calc(100vh - 56px - 60px); min-height: 0; }
.board-sidebar h5 { font-size: 12px; letter-spacing: .5px; color: var(--muted); margin: 16px 0 8px; text-transform: uppercase; }
.board-sidebar h5:first-child { margin-top: 0; }
.sb-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; font-weight: 700; cursor: pointer; background: var(--paper); }
.sb-item:hover { background: var(--hover); box-shadow: var(--shadow-soft); }

/* انتخابگر پس‌زمینه‌ی برد */
.bg-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bg-swatch { height: 28px; border: 1.5px solid var(--line); border-radius: 6px; cursor: pointer; padding: 0; }
.bg-swatch:hover { transform: translateY(-1px); }
.bg-swatch.sel { box-shadow: var(--shadow-hard); }
.bg-upload { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1.5px dashed var(--line); border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 12.5px; }
.bg-upload:hover { background: var(--hover); }

/* ============================================================
   پشت کارت (جزئیات کارت)
   ============================================================ */
.card-back { display: grid; grid-template-columns: 1fr 240px; gap: 22px; }
@media (max-width: 780px) { .card-back { grid-template-columns: 1fr; } }
.cb-section { margin-bottom: 22px; }
.cb-section .cb-h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.cb-section .cb-h .bi { font-size: 17px; }
.cb-members { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cb-add-btn { width: 32px; height: 32px; border: 1.5px dashed var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: var(--paper); }
.cb-add-btn:hover { background: var(--hover); }

/* چک‌لیست */
.chk-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.chk-bar { flex: 1; height: 10px; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.chk-bar > span { display: block; height: 100%; background: var(--success); transition: width .2s ease; }
.chk-bar.full > span { background: var(--success); }
.chk-item { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-radius: var(--radius-sm); }
.chk-item:hover { background: var(--hover); }
.chk-item.done label { text-decoration: line-through; color: var(--muted); }
.chk-item label { cursor: pointer; }
.chk-item .grow { flex: 1; }
/* چیپ‌های مهلت/یادآوری آیتم چک‌لیست */
.ci-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; font-size: 11px; font-weight: 800; border: 1.5px solid var(--line-soft); border-radius: 6px; background: var(--paper); white-space: nowrap; }
.ci-chip.over { background: #fbe6e3; color: #b23b30; border-color: #ecb9b2; }
.ci-chip.rem { background: #eef4ff; color: #2f5fd0; border-color: #c2d4f5; }
/* پنل جزئیاتِ آیتم چک‌لیست */
.chk-item-detail { border: 1.5px dashed var(--line-soft); border-radius: var(--radius-sm); padding: 12px; margin: 4px 0 10px; background: var(--paper-2); }
.ci-mem { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; background: var(--paper); }
.ci-mem input { position: absolute; opacity: 0; width: 0; height: 0; }
.ci-mem:hover { background: var(--hover); }
.ci-mem:has(input:checked) { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.ci-mem:has(input:checked) .wf-avatar { box-shadow: 0 0 0 1.5px #fff; }

/* ویرایشگر متن ساختگی (تولبار) */
.rt-toolbar { display: flex; gap: 2px; padding: 6px; border: 1.5px solid var(--line); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--paper-2); flex-wrap: wrap; }
.rt-toolbar button { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; font-weight: 800; }
.rt-toolbar button:hover { background: var(--hover); }
.rt-body { border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important; }

/* پالت رنگ (به الگوهای سیاه‌وسفید) */
.color-palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.color-swatch { height: 30px; border: 1.5px solid var(--line); border-radius: 5px; cursor: pointer; }
.color-swatch.sel { box-shadow: var(--shadow-hard); }

/* پیوست */
.att-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.att-item .att-ico { width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone:hover { background: var(--hover); }
.dropzone .bi { font-size: 26px; }

/* دیدگاه‌ها */
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .c-body { flex: 1; }
.comment .c-bubble { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--paper); }
.comment .c-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   لایوت احراز هویت
   ============================================================ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-tabs { display: flex; border: 1.5px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.auth-tab { flex: 1; text-align: center; padding: 12px; font-weight: 800; background: var(--paper-2); cursor: pointer; border-left: 1.5px solid var(--line); color: var(--ink-2); }
.auth-tab:last-child { border-left: 0; }
.auth-tab.active { background: var(--paper); color: var(--ink); }
.auth-body { border: 1.5px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-hard); background: var(--paper); padding: 26px 24px; }
.auth-body h2 { text-align: center; margin-bottom: 20px; font-size: 22px; }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 800; margin: 18px 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1.5px; background: var(--line-soft); }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); font-weight: 700; margin-bottom: 10px; cursor: pointer; }
.social-btn:hover { background: var(--hover); box-shadow: var(--shadow-soft); }
.pw-meter { height: 6px; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: 6px; background: var(--paper); }
.pw-meter > span { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }
.demo-box { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 16px; font-size: 12.5px; background: var(--paper-2); }

/* مدیریت برچسب‌ها */
.label-manage-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.label-manage-row .lm-edit { display: flex; align-items: center; gap: 6px; flex: 1; }
.label-manage-row .lm-name { flex: 1; min-width: 0; }
.label-color-input { width: 34px; height: 34px; flex: 0 0 auto; padding: 2px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; }
.wf-icon-btn.danger { color: #c0392b; }
.wf-icon-btn.danger:hover { background: rgba(192,57,43,.1); }
.btn-paper.danger-btn { color: #c0392b; border-color: rgba(192,57,43,.45); margin-top: 6px; }
.btn-paper.danger-btn:hover { background: rgba(192,57,43,.08); border-color: #c0392b; }
.arch-card-row { display: flex; align-items: center; gap: 6px; padding: 8px 4px; border-bottom: 1px solid var(--line-soft); }
.arch-card-row .text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* چیپ‌های فیلتر */
.filter-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 12.5px; background: var(--paper); user-select: none; }
.filter-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.filter-chip:hover { background: var(--hover); }
.filter-chip:has(input:checked) { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); box-shadow: var(--shadow-hard); }
.filter-chip .wf-label-bar { width: 22px; }
/* حالت فعالِ دکمه‌ی فیلتر */
.filter-on { background: var(--accent) !important; color: var(--accent-contrast) !important; border-color: var(--accent) !important; }
.filter-on .bi { color: var(--accent-contrast); }

/* ردیف عضو در مودال مدیریت اعضا */
.member-row { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.member-row:last-child { border-bottom: 0; }
.member-row .mm-role { display: inline; }

/* اعلان‌ها (زنگوله) */
.notif-bell { position: relative; }
.notif-badge { position: absolute; top: 1px; left: 1px; min-width: 16px; height: 16px; padding: 0 3px; background: #e0564a; color: #fff; border: 1.5px solid var(--paper); border-radius: 999px; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.notif-dd { min-width: 320px; max-width: 340px; }
.notif-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm); }
.notif-item:hover { background: var(--hover); }
.notif-item.unread { background: var(--success-soft); }
.notif-item .notif-ico { width: 30px; height: 30px; border: 1.5px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.notif-item .notif-text { font-size: 13px; font-weight: 700; line-height: 1.6; }
.unread-dot { width: 9px; height: 9px; background: #e0564a; border-radius: 50%; flex: none; align-self: center; }
.dd-head-actions { display: inline-flex; align-items: center; gap: 12px; }
.linkish { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: var(--ink); font: inherit; font-weight: 700; }
.linkish:hover { text-decoration: underline; }

/* پنل مدیریت */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 8px; }
.admin-stats .stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.admin-stats .stat-ico { width: 42px; height: 42px; border: 1.5px solid var(--line); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; flex: none; }
.admin-stats .stat-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.admin-stats .stat-lbl { font-size: 12.5px; color: var(--muted); font-weight: 700; }

.wf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wf-table thead th { text-align: right; font-weight: 800; font-size: 12.5px; color: var(--muted); padding: 12px 14px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.wf-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.wf-table tbody tr:last-child td { border-bottom: 0; }
.wf-table tbody tr:hover { background: var(--hover); }

/* استیت خالی */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .bi { font-size: 40px; display: block; margin-bottom: 10px; }

/* اسکرول افقی کانبان اسکرول‌بار پایین */
.kanban::-webkit-scrollbar { height: 12px; }

/* ============================================================
   تسک‌ها — فهرستِ روزانه با هدرِ چسبانِ تاریخ
   ============================================================ */
.task-page { max-width: 780px; margin: 0 auto; }
.task-compose { display: flex; gap: 8px; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-hard); padding: 8px 10px; margin-bottom: 16px; }
.task-compose input[type=text] { flex: 1; border: 0; outline: 0; background: transparent; font-family: var(--font); font-size: 14px; font-weight: 700; color: var(--ink); }
.task-compose .due-mini { width: 118px; border: 1.5px solid var(--line-soft); border-radius: var(--radius-sm); padding: 5px 8px; font-size: 12.5px; font-weight: 700; background: var(--paper-2); color: var(--ink); }

.task-filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.task-filters a { border: 1.5px solid var(--line-soft); border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.task-filters a.on { border-color: var(--line); background: var(--accent); color: var(--accent-contrast); }

.day-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: baseline; gap: 8px; padding: 10px 4px 8px; margin-top: 10px; background: var(--bg); border-bottom: 1.5px solid var(--line-soft); }
.day-head .d-title { font-weight: 900; font-size: 14.5px; }
.day-head .d-week { font-size: 12px; color: var(--muted); font-weight: 700; }
.day-head .d-count { margin-inline-start: auto; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.day-head.is-today .d-title { color: var(--ink); }
.day-head.is-today::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.day-head.is-past .d-title { color: #b4372a; }

.task-row { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-soft); padding: 10px 12px; margin-top: 8px; transition: opacity .18s ease, background .18s ease; }
.task-row:hover { background: var(--hover); }
.task-row .t-title { flex: 1; font-weight: 700; font-size: 13.5px; color: var(--ink); text-align: start; background: none; border: 0; padding: 0; cursor: pointer; position: relative; font-family: var(--font); }
.task-row.done .t-title { color: var(--muted); }
.task-row.done { opacity: .72; }
.task-row .t-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.task-row .t-meta .bi { font-size: 13px; }

/* دایرهٔ تیک با انیمیشنِ پرشدن */
.tick { width: 22px; height: 22px; flex: 0 0 22px; border: 2px solid var(--line); border-radius: 50%; background: var(--paper); position: relative; cursor: pointer; padding: 0; display: grid; place-items: center; transition: border-color .2s ease; }
.tick::before { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .26s cubic-bezier(.34,1.56,.64,1); }
.tick .bi { position: relative; z-index: 1; font-size: 12px; color: var(--accent-contrast); opacity: 0; transform: scale(.5); transition: opacity .18s ease .08s, transform .18s ease .08s; }
.tick.on::before { transform: scale(1); }
.tick.on .bi { opacity: 1; transform: scale(1); }
.tick:disabled { cursor: default; opacity: .6; }

.task-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-weight: 700; }
.task-empty .bi { font-size: 34px; display: block; margin-bottom: 10px; }

/* ============================================================
   گزارشات — تقویمِ شمسی
   ============================================================ */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-head .cal-title-wrap { text-align: center; line-height: 1.5; }
.cal-head .cal-title { font-weight: 900; font-size: 17px; }
.cal-head .cal-sub { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); padding-bottom: 4px; }
.cal-dow.off { color: var(--holiday); }
.cal-cell { min-height: 76px; border: 1.5px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--paper); padding: 6px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.cal-cell.blank { border: 0; background: transparent; }
.cal-cell:hover { border-color: var(--line); }
.cal-cell .c-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.cal-cell .c-day { font-size: 19px; font-weight: 900; line-height: 1.1; }
.cal-cell .c-hijri { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.cal-cell .c-occ { font-size: 9.5px; font-weight: 700; line-height: 1.35; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cal-cell.holiday { background: var(--holiday-soft); border-color: var(--holiday); }
.cal-cell.holiday .c-day, .cal-cell.holiday .c-hijri, .cal-cell.holiday .c-occ { color: var(--holiday); }
.cal-cell.today { border-color: var(--line); box-shadow: var(--shadow-soft); }
.cal-cell.today .c-day { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-size: 15px; }
.cal-cell.today.holiday .c-day { background: var(--holiday); color: #fff; }
.cal-cell.selected { border-color: var(--line); background: var(--active); }
.cal-cell.selected.holiday { background: var(--holiday-soft); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.cal-legend .bi { font-size: 9px; vertical-align: middle; }

/* پانلِ مناسبت‌ها زیرِ تقویم */
.occ-panel .occ-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.occ-panel .occ-date { font-weight: 900; font-size: 14.5px; }
.occ-panel .occ-hijri { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.occ-panel .occ-badge { font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px; background: var(--holiday-soft); border: 1.5px solid var(--holiday); color: var(--holiday); }
.occ-panel.is-holiday { border-color: var(--holiday); }
.occ-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1.5px dashed var(--line-soft); font-size: 13px; font-weight: 700; color: var(--ink); }
.occ-row:first-of-type { border-top: 0; }
.occ-row .bi { color: var(--muted); font-size: 13px; }
.occ-row.hol, .occ-row.hol .bi { color: var(--holiday); }
.occ-row .occ-title { flex: 1; min-width: 0; }
.occ-row .occ-day { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--paper-2); border: 1.5px solid var(--line-soft); font-size: 12px; font-weight: 900; }
.occ-row.hol .occ-day { background: var(--holiday-soft); border-color: var(--holiday); }
.occ-row .occ-tag { font-size: 10px; font-weight: 800; color: var(--holiday); border: 1.5px solid var(--holiday); border-radius: 999px; padding: 1px 7px; }
.occ-summary { font-weight: 900; font-size: 14px; cursor: pointer; margin-bottom: 6px; }

/* در صفحه‌های باریک، متنِ مناسبت جا نمی‌شود؛ به‌جایش یک نقطه و متنِ کامل در پانلِ زیرِ تقویم */
.c-occ-dot { display: none; }
@media (max-width: 640px) {
    .cal-cell { min-height: 60px; padding: 5px 4px; }
    .cal-cell .c-day { font-size: 16px; }
    .cal-cell .c-occ { display: none; }
    .c-occ-dot { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 2px; }
    .cal-cell.holiday .c-occ-dot { background: var(--holiday); }
    .cal-pill { font-size: 9.5px; padding: 0 5px; }
}
.cal-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.cal-pill { font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 1px 7px; border: 1.5px solid var(--line-soft); }
.cal-pill.total { background: var(--paper-2); }
.cal-pill.done { background: var(--success-soft); border-color: var(--success); color: #1d7a46; }
.cal-pill.late { background: #fdf0ee; border-color: #c0392b; color: #a2342a; }

.work-item { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line-soft); border-radius: var(--radius); background: var(--paper); padding: 10px 12px; margin-top: 8px; }
.work-item .w-body { flex: 1; min-width: 0; }
.work-item .w-title { font-weight: 800; font-size: 13.5px; }
.work-item .w-sub { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.work-item.done .w-title { color: var(--muted); text-decoration: line-through; }
.kind-chip { font-size: 10.5px; font-weight: 800; border: 1.5px solid var(--line-soft); border-radius: 999px; padding: 2px 8px; background: var(--paper-2); white-space: nowrap; }

/* تگ‌کردنِ کاربر در گزارش/توضیحات */
.mention-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; border: 1.5px solid var(--line-soft); border-radius: 999px; padding: 1px 8px; background: var(--paper-2); }
.mention-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.mention-box .m-add { font-size: 11.5px; font-weight: 800; border: 1.5px dashed var(--line-soft); border-radius: 999px; padding: 2px 10px; background: transparent; color: var(--ink-2); }

/* ---------- ناوبریِ پایین (موبایلِ وب) ---------- */
.wf-bottomnav { position: fixed; inset-inline: 0; bottom: 0; z-index: 1030; display: flex; background: var(--paper); border-top: 1.5px solid var(--line); box-shadow: 0 -2px 0 rgba(27,27,26,.05); }
.wf-bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px calc(8px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 10.5px; font-weight: 800; }
.wf-bottomnav a .bi { font-size: 19px; }
.wf-bottomnav a.active { color: var(--ink); }
.wf-bottomnav a.active .bi { color: var(--ink); }
@media (max-width: 767.98px) { main { padding-bottom: 68px; } .wf-footer-min { margin-bottom: 60px; } }

/* ---------- انتخابِ بردِ مقصد برای انتقالِ تسک ---------- */
.move-list { max-height: 52vh; overflow-y: auto; }
.move-board { border: 1.5px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.move-board-head { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; background: var(--paper-2); border-bottom: 1.5px solid var(--line-soft); }
.move-list-btn { display: flex; align-items: center; gap: 6px; width: 100%; text-align: start; border: 0; background: transparent; padding: 8px 12px; font-family: var(--font); font-size: 13px; font-weight: 700; color: var(--ink); }
.move-list-btn:hover { background: var(--hover); }
.move-list-btn .bi { font-size: 17px; color: var(--muted); }

/* فیلترِ تاریخِ فهرستِ تسک‌ها */
.date-filters { align-items: center; }
.date-filters .range-form { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.move-list-btn.current { background: var(--active); }
/* عملیاتِ کامنت (ویرایش/حذف) */
.comment .c-actions { display: inline-flex; align-items: center; gap: 10px; opacity: 0; transition: opacity .15s ease; }
.comment:hover .c-actions, .comment:focus-within .c-actions { opacity: 1; }
.comment .c-actions form { margin: 0; }
.comment .c-edit { margin-top: 6px; }

/* ---------- ردیفِ تسک: تیکِ سبزِ پایان + نشانگرِ مهلت ---------- */
/* «انجام‌شده» با تیکِ سبز در انتهای ردیف نشان داده می‌شود (نه خط‌خوردنِ متن). */
.done-check {
    width: 22px; height: 22px; flex: none; display: grid; place-items: center;
    border-radius: 50%; background: var(--success-soft); color: var(--success);
    border: 1.5px solid var(--success);
    opacity: 0; transform: scale(.4) rotate(-25deg);
    transition: opacity .2s ease, transform .32s cubic-bezier(.34,1.56,.64,1);
}
.done-check .bi { font-size: 13px; font-weight: 900; }
.done-check.on { opacity: 1; transform: none; }

/* نشانگرِ مهلت: نارنجی = نزدیک، قرمز = گذشته (بحرانی) */
.due-flag {
    display: inline-flex; align-items: center; gap: 4px; flex: none;
    font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px;
    border: 1.5px solid currentColor;
}
.due-flag .bi { font-size: 12px; }
.due-flag.warn { color: #c9741d; background: #fdf4e7; }
.due-flag.critical { color: #b4372a; background: #fdeeec; animation: duePulse 1.8s ease-in-out infinite; }
@keyframes duePulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* پرشدنِ دایرهٔ تیک با یک «پاپ» کوتاه هنگام کلیک */
.tick.pop { animation: tickPop .32s cubic-bezier(.34,1.56,.64,1); }
@keyframes tickPop { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }
.task-row.done .t-title { color: var(--muted); }

/* ---------- نوارِ فیلترِ فشرده (گزارشات) ---------- */
.filter-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    border: 1.5px solid var(--line-soft); border-radius: 999px;
    background: var(--paper); padding: 7px 14px; margin-bottom: 6px;
}
.filter-bar .fb-label { color: var(--muted); display: inline-flex; }
.filter-bar .fb-sep { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.filter-bar .fb-count { margin-inline-start: auto; }
.filter-bar .wf-input { border-radius: var(--radius-sm); }
.filter-bar select.wf-input { min-width: 150px; }
.filter-bar input.wf-input { width: 116px; }

/* ---------- انتخابگرِ جمع‌شوندهٔ ستونِ مقصد در پشتِ کارت ---------- */
.move-toggle { display: flex; align-items: center; gap: 6px; text-align: start; }
.move-toggle .chev { margin-inline-start: auto; transition: transform .18s ease; }
.move-toggle.open .chev { transform: rotate(180deg); }

/* ---------- استخرِ «اعضای تسک‌ها» ---------- */
.member-pool { max-height: 240px; overflow-y: auto; }
.pool-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1.5px solid var(--line-soft); }
.pool-row:last-child { border-bottom: 0; }
