/* استایل عمومی پلاگین مدیریت تسک تیم */

.ttm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #fff;
    background: #999;
    align-self: flex-start;
    width: fit-content;
}
/* وضعیت پروژه‌ها: شروع نشده=قرمز، در حال انجام=آبی، تکمیل شده=سبز، متوقف شده=خاکستری */
.ttm-status-not_started { background: #d63638; }
.ttm-status-in_progress { background: #2271b1; }
.ttm-status-completed   { background: #46b450; }
.ttm-status-on_hold     { background: #888; }

/* وضعیت تسک‌ها: منتظر اقدام=قرمز، در حال انجام=آبی، پایان یافته=سبز، متوقف شده=خاکستری */
.ttm-status-pending     { background: #d63638; }
.ttm-status-done        { background: #46b450; }
.ttm-status-blocked     { background: #888; }

.ttm-progress-outer {
    position: relative;
    background: #eee;
    border-radius: 10px;
    height: 18px;
    width: 100%;
    min-width: 100px;
    overflow: hidden;
}
.ttm-progress-inner {
    background: linear-gradient(90deg, #2271b1, #46b450);
    height: 100%;
}
.ttm-progress-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    line-height: 18px;
    color: #333;
}

.ttm-stats-boxes {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}.ttm-stat-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    min-width: 150px;
}
.ttm-stat-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #2271b1;
}
.ttm-stat-label {
    color: #666;
}

/* فرانت‌اند */
.ttm-frontend-wrap {
    font-family: inherit;
    text-align: right;
}
.ttm-projects-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}
.ttm-project-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}
.ttm-project-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}
.ttm-project-card-top h3 {
    font-size: 14px !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.ttm-project-badges-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.ttm-project-task-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #eef1f3;
    color: #555;
    border-radius: 10px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
    white-space: nowrap;
}
.ttm-project-card .ttm-badge {
    margin-bottom: 6px;
    font-size: 10.5px;
    padding: 2px 8px;
}
.ttm-project-card .ttm-dates-line {
    font-size: 11.5px;
    margin: 6px 0 0;
}
.ttm-project-timeline-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 11.5px;
    font-weight: bold;
    color: #2271b1 !important;
    text-decoration: none !important;
}
.ttm-project-timeline-link:hover {
    text-decoration: underline !important;
}
.ttm-archived-project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.ttm-archived-project-row .ttm-project-archive-btn {
    color: #2271b1;
    font-size: 12px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}
.ttm-tasks-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}
.ttm-task-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 0;
    box-sizing: border-box;
}
/* فلکس و ارتفاع صددرصد فقط برای کارت‌های داخل گرید لیست تسک‌ها لازم است، نه صفحه اختصاصی تسک */
.ttm-tasks-list .ttm-task-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.ttm-task-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, border-color .15s ease;
    height: 100%;
}
.ttm-task-card-link,
.ttm-task-card-link:hover,
.ttm-task-card-link:visited,
.ttm-task-card-link * {
    text-decoration: none !important;
}
.ttm-task-card-link:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    border-color: #2271b1;
}

/* واکنش‌گرا شدن گرید پروژه‌ها و تسک‌ها در صفحه‌های کوچک‌تر */
@media (max-width: 1400px) {
    .ttm-tasks-list { grid-template-columns: repeat(4, 1fr); }
    .ttm-projects-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
    .ttm-projects-grid { grid-template-columns: repeat(3, 1fr); }
    .ttm-tasks-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .ttm-projects-grid { grid-template-columns: repeat(2, 1fr); }
    .ttm-tasks-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .ttm-projects-grid { grid-template-columns: 1fr; }
    .ttm-tasks-list { grid-template-columns: 1fr; }
}
.ttm-view-more {
    display: inline-block;
    margin-top: 8px;
    color: #2271b1;
    font-size: 13px;
    font-weight: bold;
}
.ttm-back-link {
    display: inline-block;
    margin-bottom: 15px;
    text-decoration: none;
    color: #2271b1;
    font-weight: bold;
}
.ttm-task-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}
.ttm-task-toolbar .ttm-back-link {
    margin-bottom: 0;
}
.ttm-task-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ttm-frontend-wrap .ttm-delete-task-btn {
    color: #b3403f !important;
}
.ttm-frontend-wrap .ttm-delete-task-btn svg {
    stroke: #b3403f;
}
.ttm-task-detail h2 {
    margin-top: 0;
    display: inline-block;
    margin-left: 10px;
}
.ttm-reports-history {
    margin-top: 10px;
}
.ttm-report-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}
.ttm-report-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.ttm-report-date {
    color: #888;
    font-size: 12px;
}
.ttm-report-status-line {
    margin-bottom: 8px;
}
.ttm-report-item p {
    margin: 0 0 8px 0;
}
.ttm-report-attachment {
    margin-top: 8px;
}
.ttm-report-attachment img {
    max-width: 160px;
    height: auto;
    display: block;
    border-radius: 6px;
}
.ttm-task-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.ttm-task-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.ttm-task-title-row strong {
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* فضای ثابت و همیشه هم‌مکان برای بج‌های وضعیت/اولویت/زمان روی کارت تسک */
.ttm-task-badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 22px;
    margin-bottom: 8px;
    overflow: hidden;
}
.ttm-badge-sm {
    font-size: 10px !important;
    padding: 2px 7px !important;
}
.ttm-priority {
    font-size: 12px;
    color: #666;
}
.ttm-task-card-link .ttm-project-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ttm-card-assignee {
    color: #888;
    font-weight: normal;
}

/* ================= دکمه‌های تعویض نما (لیست/تایم‌لاین) - هم‌سبک با دکمه‌های افزودن ================= */
.ttm-view-toggle {
    display: inline-flex;
    gap: 6px;
    margin: 5px 0 18px;
}
.ttm-frontend-wrap .ttm-view-toggle-btn.ttm-view-active {
    background-color: #e9dcae !important;
    border-color: #cbb77e !important;
    color: #4f4227 !important;
}

/* ================= تایم‌لاین پروژه (شبه-گانت) - راست‌به‌چپ: شروع سمت راست، پیشرفت به سمت چپ ================= */
.ttm-timeline {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
}
.ttm-timeline-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    padding: 0 2px;
}
.ttm-timeline-body {
    position: relative;
    min-width: 600px;
}
.ttm-timeline-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #d63638;
    z-index: 2;
}
.ttm-timeline-today-line::after {
    content: "امروز";
    position: absolute;
    top: -18px;
    left: -18px;
    font-size: 10px;
    color: #d63638;
    direction: rtl;
    white-space: nowrap;
}
.ttm-timeline-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}
.ttm-timeline-label {
    direction: rtl;
    text-align: right;
    width: 160px;
    flex-shrink: 0;
    font-size: 12.5px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ttm-timeline-track {
    position: relative;
    flex: 1;
    height: 22px;
    background: #f7f7f7;
    border-radius: 4px;
}
.ttm-timeline-bar {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 4px;
    display: block;
    min-width: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
    transition: filter .12s ease;
}
.ttm-timeline-bar:hover {
    filter: brightness(1.1);
}
.ttm-timeline-empty,
.ttm-timeline-note {
    color: #888;
    font-size: 13px;
}

@media (max-width: 600px) {
    .ttm-timeline-label {
        width: 100px;
        font-size: 11.5px;
    }
}

/* ================= تابلوی کانبان ================= */
.ttm-kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    align-items: flex-start;
}
.ttm-kanban-column {
    background: #f7f7f7;
    border-radius: 10px;
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}
.ttm-kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px 10px 0 0;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
}
.ttm-kanban-count {
    background: rgba(255,255,255,.25);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
}
.ttm-kanban-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
    transition: background-color .12s ease;
}
.ttm-kanban-list.ttm-kanban-dragover {
    background: #eaf3fb;
    border-radius: 0 0 10px 10px;
}
.ttm-kanban-empty {
    color: #aaa;
    font-size: 12px;
    text-align: center;
    margin: 10px 0;
}
.ttm-kanban-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    transition: box-shadow .12s ease, opacity .12s ease;
}
.ttm-kanban-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.ttm-kanban-card.ttm-dragging {
    opacity: .4;
}
.ttm-kanban-card.ttm-kanban-locked {
    cursor: not-allowed;
    background: #fafafa;
}
.ttm-kanban-card-title {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #1d2327;
    text-decoration: none !important;
    margin-bottom: 6px;
}
.ttm-kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    font-size: 11px;
}
.ttm-kanban-card-assignee,
.ttm-kanban-card-due {
    font-size: 11px;
    color: #777;
    margin-bottom: 3px;
}
.ttm-kanban-status-select {
    width: 100%;
    margin-top: 6px;
    font-size: 11px !important;
    padding: 3px 6px !important;
}
.ttm-kanban-hint {
    color: #999;
    font-size: 11.5px;
    margin-top: 10px;
}

@media (max-width: 700px) {
    .ttm-kanban-column {
        width: 210px;
    }
}
.ttm-dates-line {
    color: #666;
    font-size: 13px;
}
.ttm-task-desc {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
}
.ttm-report-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 500px;
}
.ttm-report-form textarea,
.ttm-report-form select,
.ttm-report-form input[type="file"] {
    width: 100%;
    box-sizing: border-box;
}
.ttm-report-result {
    font-size: 13px;
    color: #46b450;
}

/* انتخاب‌گر تاریخ شمسی (نسخه قدیمی، دیگر استفاده نمی‌شود اما بی‌خطر باقی می‌ماند) */
.ttm-jalali-date-picker select {
    margin-left: 4px;
}

/* فیلد ورودی متصل به ویجت تقویم شمسی */
.ttm-jalali-input {
    cursor: pointer;
    background-color: #fff !important;
    max-width: 160px;
}

/* ================= ویجت تقویم شمسی (Jalali Datepicker) ================= */
.ttm-dp-popup {
    z-index: 999999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.15);
    padding: 12px;
    width: 280px;
    font-family: inherit;
    font-size: 13px;
    color: #333;
    box-sizing: border-box;
}
.ttm-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ttm-dp-title {
    font-weight: bold;
    font-size: 14px;
}
.ttm-dp-nav {
    background: #f2f2f2;
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    color: #333;
}
.ttm-dp-nav:hover {
    background: #e2e2e2;
}
.ttm-dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    color: #999;
    font-size: 11px;
    margin-bottom: 4px;
}
.ttm-dp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.ttm-dp-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
}
.ttm-dp-day:hover {
    background: #eaf3fb;
}
.ttm-dp-day-empty {
    cursor: default;
}
.ttm-dp-day-empty:hover {
    background: transparent;
}
.ttm-dp-today {
    border: 1px solid #2271b1;
    font-weight: bold;
}
.ttm-dp-selected {
    background: #2271b1 !important;
    color: #fff;
    font-weight: bold;
}
.ttm-dp-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}
.ttm-dp-footer-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}
.ttm-dp-footer-btn-muted {
    background: #eee;
    color: #555;
}

/* پس‌زمینه تیره پشت تقویم در حالت موبایل */
.ttm-dp-backdrop {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,.4);
    z-index: 999998;
}

/* حالت موبایل: تقویم به‌صورت پنجره ثابت و وسط‌چین با دکمه‌های بزرگ‌تر برای لمس آسان */
@media (max-width: 480px) {
    .ttm-dp-mobile {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        width: 92vw;
        max-width: 340px;
    }
    .ttm-dp-mobile .ttm-dp-day {
        height: 42px;
        font-size: 15px;
    }
    .ttm-dp-mobile .ttm-dp-nav {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .ttm-dp-mobile .ttm-dp-footer-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* تسک دارای تاخیر (از موعد مقرر گذشته) */
.ttm-task-overdue {
    background: #d9d9d9 !important;
    border-color: #b0b0b0 !important;
}
.ttm-task-overdue .ttm-task-desc {
    background: #e6e6e6;
}
.ttm-overdue-flag {
    display: inline-block;
    margin-top: 6px;
    color: #7a1f1f;
    font-size: 12px;
    font-weight: bold;
}

/* تسک قفل (پیش‌نیازهایش هنوز تکمیل نشده) */
.ttm-task-locked {
    background: #ececec !important;
    border-color: #cfcfcf !important;
    filter: grayscale(.4);
}
.ttm-task-locked .ttm-task-desc {
    background: #e2e2e2;
}
.ttm-lock-flag {
    display: inline-block;
    margin-top: 6px;
    color: #555;
    font-size: 12px;
    font-weight: bold;
}
.ttm-lock-banner {
    background: #fff8e1;
    border: 1px solid #f0d999;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 15px;
    color: #6b5a15;
    font-size: 14px;
}
.ttm-lock-banner ul {
    margin: 6px 0 0 0;
    padding-right: 20px;
}
.ttm-lock-manager-note {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    color: #8a6d00;
}

/* فاصله انتهای صفحه اختصاصی تسک از فوتر */
.ttm-single-task {
    margin-bottom: 50px;
}

/* کارت‌های پروژه قابل کلیک برای فیلتر تسک‌ها */
.ttm-project-card {
    cursor: pointer;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.ttm-project-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    border-color: #2271b1;
}
.ttm-project-card.active {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,.25);
}
.ttm-hint {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

/* دکمه بازنشانی فیلتر پروژه و نوار مرتب‌سازی */
.ttm-reset-filter-btn {
    font-size: 12px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 14px;
    padding: 3px 10px;
    cursor: pointer;
    color: #333;
    margin-right: 10px;
    vertical-align: middle;
}
.ttm-reset-filter-btn:hover {
    background: #e2e2e2;
}
.ttm-tasks-toolbar {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ttm-search-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 6px 12px;
    color: #888;
    flex-shrink: 0;
}
.ttm-frontend-wrap .ttm-search-control input[type="text"] {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 12.5px;
    color: #333;
    width: 170px;
    max-width: 45vw;
}
.ttm-frontend-wrap .ttm-search-control input[type="text"]:focus {
    outline: none;
    box-shadow: none !important;
}
.ttm-sort-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 5px 12px;
    color: #666;
}
.ttm-sort-icon {
    flex-shrink: 0;
    opacity: .6;
}
.ttm-sort-control select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    font-size: 12.5px;
    color: #444;
    cursor: pointer;
    padding: 2px 16px 2px 0;
    max-width: 220px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: left 0 center;
}
.ttm-sort-control select:focus {
    outline: none;
}
@media (max-width: 480px) {
    .ttm-frontend-wrap .ttm-search-control input[type="text"] {
        width: 120px !important;
    }
}
.ttm-recurring-flag {
    font-size: 13px;
    flex-shrink: 0;
}

/* ================= بخش گفتگو (کامنت‌ها) روی هر تسک ================= */
.ttm-comments-section {
    margin-top: 5px;
    margin-bottom: 15px;
}
.ttm-comments-empty {
    color: #888;
    font-size: 13px;
}
.ttm-comment-item {
    background: #f9fafb;
    border: 1px solid #eceff1;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.ttm-comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.ttm-comment-header strong {
    font-size: 13px;
    color: #1d2327;
}
.ttm-comment-date {
    font-size: 11.5px;
    color: #999;
}
.ttm-comment-item p {
    margin: 4px 0;
    font-size: 13px;
    color: #333;
}
.ttm-comment-mentions {
    font-size: 12px;
    color: #2271b1;
}
.ttm-comment-attachment {
    margin-top: 6px;
}
.ttm-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ttm-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f2f2f2;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 3px 4px 3px 10px;
    max-width: 220px;
}
.ttm-attachment-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    color: #333 !important;
    overflow: hidden;
}
.ttm-attachment-view img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}
.ttm-attachment-icon {
    font-size: 15px;
    flex-shrink: 0;
}
.ttm-attachment-name {
    font-size: 11.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ttm-attachment-chip:hover .ttm-attachment-name {
    text-decoration: underline;
}
.ttm-attachment-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    color: #2271b1 !important;
    font-size: 11px;
    text-decoration: none !important;
    flex-shrink: 0;
}
.ttm-attachment-download:hover {
    background: #2271b1;
    color: #fff !important;
}
.ttm-comment-form select[multiple] {
    height: auto;
}

/* ================= ویجت زمان صرف‌شده (نفرساعت) ================= */
.ttm-time-widget {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 18px;
    max-width: 480px;
    margin-bottom: 25px;
}
.ttm-time-current {
    margin: 0 !important;
    font-size: 13px;
    color: #444;
}
.ttm-time-current strong {
    color: #2271b1;
}
.ttm-time-hint {
    margin: 4px 0 0 !important;
    font-size: 11.5px;
    color: #999;
}
.ttm-report-time-fields {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ttm-report-time-fields input[type="number"] {
    width: 80px !important;
}
.ttm-project-total-time {
    color: #555;
    font-size: 13px;
    margin: 8px 0 0 !important;
}
.ttm-project-total-time strong {
    color: #2271b1;
}
.ttm-export-buttons {
    display: flex;
    gap: 8px;
    margin: 10px 0 5px;
}

/* ================= دراپ‌داون منشن @ داخل متن گفتگو ================= */
.ttm-mention-wrap {
    position: relative;
}
.ttm-mention-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 10000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
    margin-top: 4px;
    max-height: 180px;
    overflow-y: auto;
}
.ttm-mention-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}
.ttm-mention-item:hover,
.ttm-mention-item.ttm-mention-active {
    background: #eaf3fb;
    color: #2271b1;
}
.ttm-project-link {
    color: #2271b1;
    text-decoration: none;
    font-weight: bold;
}
.ttm-project-link:hover {
    text-decoration: underline;
}

/* ==================================================================
   ریست استایل مستقل از قالب سایت (برای جلوگیری از بهم‌ریختگی فرم‌ها و عنوان‌ها)
   ================================================================== */

.ttm-frontend-wrap h1,
.ttm-frontend-wrap h2,
.ttm-frontend-wrap h3,
.ttm-frontend-wrap h4 {
    position: static !important;
    float: none !important;
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
    font-weight: bold !important;
    clear: both;
}

.ttm-frontend-wrap * {
    box-sizing: border-box;
}

.ttm-frontend-wrap input[type="text"],
.ttm-frontend-wrap input[type="file"],
.ttm-frontend-wrap select,
.ttm-frontend-wrap textarea {
    display: block;
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    padding: 9px 12px;
    border: 1px solid #d5d5d5 !important;
    border-radius: 6px !important;
    background-color: #fff !important;
    box-shadow: none !important;
    line-height: 1.5;
    appearance: none;
    -webkit-appearance: none;
}

.ttm-frontend-wrap select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 30px;
    cursor: pointer;
}

.ttm-frontend-wrap textarea {
    resize: vertical;
    min-height: 80px;
}

.ttm-frontend-wrap input:focus,
.ttm-frontend-wrap select:focus,
.ttm-frontend-wrap textarea:focus {
    border-color: #2271b1 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(34,113,177,.15) !important;
}

.ttm-frontend-wrap label {
    font-size: 13px;
    font-weight: bold;
    color: #444;
    margin-top: 4px;
}

.ttm-single-task h3 {
    margin-top: 25px !important;
}

/* فرم‌های افزودن پروژه/تسک (داخل بدنه مودال) */
.ttm-add-project-form,
.ttm-add-task-form,
.ttm-comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* دکمه «افزودن پروژه/تسک» - بهینه‌شده با آیکون */
.ttm-frontend-wrap .ttm-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #f5efe0 !important;
    color: #6b5b3a !important;
    border: 1px solid #e6dcc3 !important;
    border-radius: 16px !important;
    padding: 4px 12px 4px 10px !important;
    font-size: 11.5px !important;
    font-weight: bold;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: background-color .15s ease;
    vertical-align: middle;
    line-height: 1.6;
}
.ttm-frontend-wrap .ttm-add-btn svg {
    flex-shrink: 0;
    stroke: #6b5b3a;
}
.ttm-frontend-wrap .ttm-add-btn:hover {
    background-color: #eee3c8 !important;
    color: #4f4227 !important;
}
.ttm-frontend-wrap .ttm-add-btn:active {
    transform: scale(.96);
}

/* ================= سیستم مودال پاپ‌آپ (افزودن پروژه/تسک) ================= */
.ttm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 30, .5);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity .18s ease;
}
.ttm-modal-overlay.ttm-modal-visible {
    opacity: 1;
}
.ttm-modal-box {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    transform: translateY(14px) scale(.98);
    transition: transform .18s ease;
}
.ttm-modal-overlay.ttm-modal-visible .ttm-modal-box {
    transform: translateY(0) scale(1);
}
.ttm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 12px 12px 0 0;
}
.ttm-modal-header h3 {
    margin: 0 !important;
    font-size: 16px;
}
.ttm-modal-close {
    background: #f2f2f2;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ttm-modal-close:hover {
    background: #e2e2e2;
    color: #222;
}
.ttm-modal-body {
    padding: 18px 20px 22px;
}

/* جلوگیری از اسکرول پس‌زمینه وقتی مودال باز است */
body.ttm-modal-open {
    overflow: hidden;
}

/* واکنش‌گرایی موبایل: مودال به عرض کامل نزدیک‌تر و فاصله کمتر از لبه‌ها */
@media (max-width: 600px) {
    .ttm-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .ttm-modal-box {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }
    .ttm-modal-overlay.ttm-modal-visible .ttm-modal-box {
        transform: translateY(0);
    }
    .ttm-modal-header {
        border-radius: 16px 16px 0 0;
    }
}

/* صفحه‌بندی لیست تسک‌ها */
.ttm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
}
.ttm-page-btn {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}
.ttm-page-btn:hover:not(:disabled) {
    background: #eef4fa;
    border-color: #2271b1;
    color: #2271b1;
}
.ttm-page-btn:disabled {
    opacity: .4;
    cursor: default;
}
.ttm-page-info {
    font-size: 13px;
    color: #666;
}

/* ویجت اتصال تلگرام */
.ttm-telegram-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #eaf6fd;
    border: 1px solid #cfe9f7;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 13px;
}
.ttm-telegram-status {
    font-weight: bold;
    color: #333;
}
.ttm-telegram-connected {
    color: #1e7e34;
}
.ttm-telegram-hint {
    color: #555;
}

/* پنل کاربری */
.ttm-profile-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px 18px;
    max-width: 480px;
    margin-bottom: 25px;
}
.ttm-profile-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.ttm-profile-row:last-child {
    border-bottom: none;
}
.ttm-profile-label {
    color: #888;
    font-size: 13px;
}
.ttm-profile-value {
    font-weight: bold;
    color: #333;
    font-size: 13px;
}
.ttm-telegram-widget-status {
    max-width: 480px;
}

/* ================= تصویر پروفایل (آواتار) ================= */
.ttm-avatar-box {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 18px;
    max-width: 480px;
    margin-bottom: 25px;
}
.ttm-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
    flex-shrink: 0;
}
.ttm-avatar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.ttm-avatar-upload-label {
    display: inline-block;
    cursor: pointer;
}
.ttm-avatar-actions .ttm-reset-filter-btn {
    font-size: 11.5px;
    color: #b3403f;
}

/* ================= اعلان مرورگر (Web Push) ================= */
.ttm-webpush-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 18px;
    max-width: 480px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.ttm-webpush-status {
    margin: 0;
    font-size: 13px;
    color: #444;
    flex: 1;
    min-width: 180px;
}

/* گروه دکمه‌های شناور (پروفایل + زنگوله اعلان) - گوشه سمت چپ بالای صفحه */
.ttm-fab-group {
    position: fixed;
    top: 40px;
    left: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ttm-profile-fab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2271b1;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 30px;
    box-shadow: 0 3px 12px rgba(0,0,0,.2);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: bold;
    transition: background-color .15s ease, box-shadow .15s ease;
}
.ttm-profile-fab:hover {
    background: #135e96;
    box-shadow: 0 4px 16px rgba(0,0,0,.28);
    color: #fff !important;
}
.ttm-profile-fab svg {
    flex-shrink: 0;
}

/* زنگوله اعلان - هم‌سبک با دکمه‌های افزودن پروژه/تسک */
.ttm-frontend-wrap .ttm-bell-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background-color: #f5efe0 !important;
    color: #6b5b3a !important;
    border: 1px solid #e6dcc3 !important;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: none !important;
    transition: background-color .15s ease;
}
.ttm-frontend-wrap .ttm-bell-fab svg {
    stroke: #6b5b3a;
}
.ttm-frontend-wrap .ttm-bell-fab:hover {
    background-color: #eee3c8 !important;
}
.ttm-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #d63638;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 17px;
    height: 17px;
    line-height: 1;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .ttm-fab-group {
        top: 56px;
        left: 16px;
        gap: 8px;
    }
    .ttm-profile-fab {
        padding: 10px 14px;
    }
    .ttm-profile-fab span {
        display: none;
    }
    .ttm-bell-fab {
        width: 32px;
        height: 32px;
    }
}

/* لیست اعلان‌ها داخل مودال */
.ttm-notif-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
}
.ttm-notif-empty {
    color: #888;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}
.ttm-notif-item {
    display: block;
    text-decoration: none !important;
    background: #f9fafb;
    border: 1px solid #eceff1;
    border-radius: 8px;
    padding: 10px 14px;
    transition: background-color .12s ease;
}
.ttm-notif-item:hover {
    background: #eef4fa;
}
.ttm-notif-item.ttm-notif-unread {
    border-right: 3px solid #2271b1;
    background: #eef6fd;
}
.ttm-notif-message {
    display: block;
    font-size: 13px;
    color: #1d2327;
    margin-bottom: 4px;
}
.ttm-notif-date {
    display: block;
    font-size: 11.5px;
    color: #999;
}

.ttm-frontend-wrap .ttm-btn {
    display: inline-block;
    background-color: #2271b1 !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 22px !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: bold !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    transition: background-color .15s ease;
    width: auto;
}
.ttm-frontend-wrap .ttm-btn:hover,
.ttm-frontend-wrap .ttm-btn:focus {
    background-color: #135e96 !important;
    color: #fff !important;
}
.ttm-frontend-wrap .ttm-btn:disabled {
    opacity: .6;
    cursor: default;
}

/* حفظ ظاهر ظریف کادر مرتب‌سازی (اولویت بالاتر از ریست عمومی select) */
.ttm-frontend-wrap .ttm-sort-control select {
    display: inline-block !important;
    width: auto !important;
    border: none !important;
    background-color: transparent !important;
    padding: 2px 16px 2px 0 !important;
    font-size: 12.5px !important;
    color: #444;
    max-width: 220px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: left 0 center;
}
.ttm-frontend-wrap .ttm-sort-control select:focus {
    box-shadow: none !important;
    border: none !important;
}
.ttm-reports-history {
    margin-top: 5px;
    clear: both;
    overflow: hidden;
}
.ttm-report-item {
    position: static !important;
    overflow: hidden;
}

/* ================= ویجت پیشخوان «تسک‌های من» ================= */
.ttm-dash-widget-link {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
}
.ttm-dash-widget {
    max-width: 900px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    direction: rtl;
    text-align: right;
    transition: opacity .15s ease;
}
.ttm-dash-widget-link:hover .ttm-dash-widget {
    opacity: .92;
}
.ttm-dash-empty {
    color: #666;
    padding: 30px 4px;
    text-align: center;
    font-size: 13px;
}
.ttm-dash-row {
    padding: 8px 2px;
    border-bottom: 1px solid #f0f0f1;
}
.ttm-dash-row:first-child {
    padding-top: 2px;
}
.ttm-dash-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}
.ttm-dash-title {
    font-weight: 600;
    color: #1d2327;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ttm-dash-widget .ttm-badge {
    font-size: 10.5px;
    padding: 2px 8px;
    flex-shrink: 0;
}
.ttm-dash-priority {
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
}
.ttm-dash-row-bottom {
    display: flex;
    gap: 14px;
    color: #777;
    font-size: 11.5px;
}
.ttm-dash-overdue {
    color: #b32d2e;
    font-weight: bold;
}
.ttm-dash-footer {
    margin-top: auto;
    padding-top: 10px;
    font-size: 12px;
    font-weight: bold;
    color: #2271b1;
    text-align: left;
}
.ttm-dash-widget-link:hover .ttm-dash-footer {
    text-decoration: underline;
}

@media (max-width: 782px) {
    .ttm-dash-row-top {
        flex-wrap: wrap;
    }
    .ttm-dash-row-bottom {
        flex-wrap: wrap;
        gap: 8px;
    }
}
