/* ============================================================
   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: 5px 5px 0 var(--ink); 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; } }

/* ============================================================
   داشبورد
   ============================================================ */
.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; }
.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(--ink); color: #fff; }
.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); }

/* چیپ‌های فیلتر */
.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(--ink); color: #fff; box-shadow: var(--shadow-hard); }
.filter-chip .wf-label-bar { width: 22px; }
/* حالت فعالِ دکمه‌ی فیلتر */
.filter-on { background: var(--ink) !important; color: #fff !important; }
.filter-on .bi { color: #fff; }

/* ردیف عضو در مودال مدیریت اعضا */
.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; }
