﻿.kt, .ktq {
    --kt-p: #4f46e5;
    --kt-p2: #7c3aed;
    --kt-text: #1e1b4b;
    --kt-muted: #6b7280;
    --kt-border: #eceef5;
    --kt-soft: #f5f6fc;
    --kt-red: #e11d48;
    --kt-orange: #f97316;
    --kt-blue: #0ea5e9;
    --kt-green: #10b981;
    --kt-radius: 18px;
    color: var(--kt-text);
    text-align: right;
}

    /* site.css رنگ و چینش را روی همه المان‌ها (*) می‌گذارد؛ داخل این بخش به ارث برسد */
    .kt *, .ktq * {
        color: inherit;
        text-align: inherit;
        box-sizing: border-box;
    }

    .kt svg, .ktq svg {
        fill: currentColor;
    }

.kt {
    padding: 6px 2px 40px;
}

.kt-grow {
    flex: 1;
    min-width: 0;
}

.kt-muted {
    color: var(--kt-muted) !important;
}

.kt-red {
    color: var(--kt-red) !important;
}

/* ---------------- هیرو ---------------- */
.kt-hero {
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
    border-radius: 22px;
    padding: 22px 22px 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(79, 70, 229, .28);
    animation: ktIn .5s ease both;
}

    .kt-hero::before, .kt-hero::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        pointer-events: none;
    }

    .kt-hero::before {
        width: 260px;
        height: 260px;
        left: -80px;
        top: -90px;
        background: radial-gradient(circle, rgba(253, 230, 138, .35), transparent 70%);
        animation: ktFloat 7s ease-in-out infinite;
    }

    .kt-hero::after {
        width: 200px;
        height: 200px;
        left: 30%;
        bottom: -120px;
        background: radial-gradient(circle, rgba(236, 72, 153, .35), transparent 70%);
        animation: ktFloat 9s ease-in-out infinite reverse;
    }

.kt-hero-top {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.kt-hero-ico {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .16);
    display: grid;
    place-items: center;
    transform: rotate(-8deg);
    animation: ktWiggle 4s ease-in-out infinite;
}

.kt-title {
    color: white !important;
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
}

.kt-sub {
    color: #e0e7ff !important;
    font-size: .92rem;
    margin-top: 3px;
}

.kt-scope {
    display: flex;
    background: rgba(0, 0, 0, .22);
    border-radius: 13px;
    padding: 4px;
    gap: 4px;
    flex-wrap: wrap;
}

    .kt-scope button {
        border: 0;
        background: transparent;
        color: #e0e7ff !important;
        padding: 8px 14px;
        border-radius: 10px;
        font-weight: 700;
        font-size: .86rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: .2s;
        font-family: inherit;
    }

        .kt-scope button svg {
            width: 18px;
            height: 18px;
            fill: #e0e7ff !important;
        }

        .kt-scope button:hover {
            background: rgba(255, 255, 255, .12);
        }

        .kt-scope button.on {
            background: white;
            color: #3730a3 !important;
            box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
        }

            .kt-scope button.on svg {
                fill: #4f46e5 !important;
            }

.kt-badge {
    background: #e0e7ff;
    color: #3730a3 !important;
    border-radius: 999px;
    padding: 0 7px;
    font-size: .72rem;
    min-width: 20px;
    text-align: center !important;
    line-height: 18px;
}

.kt-badge-hot {
    background: #f97316;
    color: white !important;
    animation: ktPulse 1.6s infinite;
}

.kt-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 18px;
    position: relative;
    z-index: 1;
}

.kt-kpi {
    background: rgba(255, 255, 255, .12);
    border: 1.5px solid rgba(255, 255, 255, .18);
    border-radius: 15px;
    padding: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform .18s, background .18s, border-color .18s;
    font-family: inherit;
    animation: ktIn .45s ease both;
}

    .kt-kpi:nth-child(2) {
        animation-delay: .04s
    }

    .kt-kpi:nth-child(3) {
        animation-delay: .08s
    }

    .kt-kpi:nth-child(4) {
        animation-delay: .12s
    }

    .kt-kpi:nth-child(5) {
        animation-delay: .16s
    }

    .kt-kpi:nth-child(6) {
        animation-delay: .2s
    }

    .kt-kpi:nth-child(7) {
        animation-delay: .24s
    }

    .kt-kpi:hover {
        background: rgba(255, 255, 255, .2);
        transform: translateY(-3px);
    }

    .kt-kpi.on {
        background: rgba(255, 255, 255, .28);
        border-color: white;
    }

    .kt-kpi.hot {
        animation: ktIn .45s ease both, ktGlow 1.8s 0.5s infinite;
    }

    .kt-kpi > span:last-child {
        display: flex;
        flex-direction: column;
    }

.kt-kpi-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.kt-kpi-val {
    color: white !important;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.kt-kpi-lbl {
    color: #e0e7ff !important;
    font-size: .76rem;
    white-space: nowrap;
}

.kt-hero-note {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    color: #c7d2fe !important;
    font-size: .8rem;
}

    .kt-hero-note b {
        color: white !important;
    }

.kt-hint {
    color: #a5b4fc !important;
}

/* ---------------- کارت‌ها ---------------- */
.kt-card {
    background: white;
    border-radius: var(--kt-radius);
    padding: 14px;
    box-shadow: 0 2px 14px rgba(30, 27, 75, .06);
    border: 1px solid var(--kt-border);
    margin-top: 14px;
    animation: ktIn .5s .1s ease both;
}

/* ---------------- ثبت سریع ---------------- */
.kt-quick {
    transition: box-shadow .25s, border-color .25s;
}

    .kt-quick.focus, .kt-quick:focus-within {
        border-color: #c7d2fe;
        box-shadow: 0 10px 30px rgba(79, 70, 229, .15);
    }

.kt-quick-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kt-quick-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    animation: ktSpark 3s ease-in-out infinite;
}

.kt-quick-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    font-size: 1rem;
    padding: 10px 4px;
    background: transparent;
    font-family: inherit;
    color: var(--kt-text) !important;
}

    .kt-quick-input::placeholder {
        color: #9ca3af;
    }

.kt-quick-preview {
    margin-top: 10px;
    border-top: 1px dashed var(--kt-border);
    padding-top: 10px;
    animation: ktDrop .25s ease both;
}

.kt-qp-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .95rem;
    margin-bottom: 8px;
}

    .kt-qp-title svg {
        width: 18px;
        height: 18px;
        color: var(--kt-p);
    }

.kt-qp-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kt-qp-f {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--kt-soft);
    border: 1.5px solid var(--kt-border);
    border-radius: 11px;
    padding: 3px 8px;
    margin: 0;
    transition: .2s;
}

    .kt-qp-f svg {
        width: 17px;
        height: 17px;
        color: var(--kt-muted);
    }

    .kt-qp-f select {
        border: 0;
        background: transparent;
        font-family: inherit;
        font-size: .85rem;
        padding: 5px 2px;
        max-width: 220px;
        outline: 0;
        color: var(--kt-text) !important;
    }

    .kt-qp-f.hit {
        border-color: #a5b4fc;
        background: #eef2ff;
        animation: ktPop .35s ease;
    }

        .kt-qp-f.hit svg {
            color: var(--kt-p);
        }

    .kt-qp-f.miss {
        border-color: #fca5a5;
        background: #fff1f2;
    }

.kt-qp-pr {
    padding: 3px;
    gap: 3px;
}

    .kt-qp-pr .kt-pv {
        padding: 4px 10px;
        border-radius: 8px;
        font-size: .8rem;
        cursor: pointer;
        color: var(--kt-muted) !important;
        transition: .15s;
        user-select: none;
    }

        .kt-qp-pr .kt-pv.on.kt-p1 {
            background: #0ea5e9;
            color: white !important;
        }

        .kt-qp-pr .kt-pv.on.kt-p2 {
            background: #f97316;
            color: white !important;
        }

        .kt-qp-pr .kt-pv.on.kt-p3 {
            background: #e11d48;
            color: white !important;
        }

.kt-qp-warn {
    margin-top: 8px;
    font-size: .82rem;
    color: #b45309 !important;
}

.kt-qp-err {
    margin-top: 8px;
    font-size: .85rem;
    color: var(--kt-red) !important;
    font-weight: 700;
    animation: ktShake .35s;
}

.kt-qp-help {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    font-size: .75rem;
    color: var(--kt-muted) !important;
}

    .kt-qp-help code {
        background: #eef2ff;
        color: #4338ca !important;
        border-radius: 6px;
        padding: 1px 6px;
        font-family: inherit;
        direction: rtl;
        unicode-bidi: isolate;
        display: inline-block;
    }

/* ---------------- دکمه‌ها ---------------- */
.kt-btn {
    border: 0;
    border-radius: 11px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: .87rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform .15s, box-shadow .15s, background .15s;
    font-family: inherit;
    text-decoration: none !important;
    white-space: nowrap;
}

    .kt-btn svg {
        width: 18px;
        height: 18px;
    }

    .kt-btn:active {
        transform: scale(.96);
    }

    .kt-btn[disabled] {
        opacity: .55;
        cursor: default;
    }

.kt-btn-pri {
    background: linear-gradient(135deg, var(--kt-p), var(--kt-p2));
    color: white !important;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
}

    .kt-btn-pri span {
        color: white !important;
    }

.kt-btn-soft {
    background: var(--kt-soft);
    color: #3730a3 !important;
    border: 1.5px solid var(--kt-border);
}

    .kt-btn-soft.on {
        background: #eef2ff;
        border-color: #c7d2fe;
    }

.kt-btn-ghost {
    background: transparent;
    color: var(--kt-muted) !important;
    border: 1.5px dashed var(--kt-border);
}

.kt-btn-green {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, .35);
}

    .kt-btn-green span {
        color: white !important;
    }

.kt-btn-red {
    background: linear-gradient(135deg, #fb7185, #e11d48);
    color: white !important;
}

    .kt-btn-red span {
        color: white !important;
    }

.kt-btn-lg {
    padding: 11px 20px;
    font-size: .95rem;
}

.kt-spin {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .4);
    border-top-color: white;
    animation: ktRot .7s linear infinite;
    display: inline-block;
}

    .kt-spin.dark {
        border-color: #c7d2fe;
        border-top-color: var(--kt-p);
    }

/* ---------------- نوار ابزار، تب‌ها، فیلترها ---------------- */
.kt-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.kt-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
}

.kt-tab {
    border: 0;
    background: transparent;
    padding: 7px 13px;
    border-radius: 9px;
    font-weight: 700;
    font-size: .87rem;
    color: #64748b !important;
    cursor: pointer;
    transition: .18s;
    font-family: inherit;
}

    .kt-tab:hover {
        color: #3730a3 !important;
    }

    .kt-tab.on {
        background: white;
        color: #3730a3 !important;
        box-shadow: 0 2px 8px rgba(79, 70, 229, .14);
    }

.kt-search {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--kt-soft);
    border: 1.5px solid var(--kt-border);
    border-radius: 12px;
    padding: 0 10px;
    transition: .2s;
}

    .kt-search:focus-within {
        border-color: #a5b4fc;
        background: white;
        box-shadow: 0 0 0 4px #eef2ff;
    }

    .kt-search svg {
        width: 20px;
        height: 20px;
        color: #9ca3af;
    }

    .kt-search input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        padding: 9px 0;
        font-family: inherit;
        font-size: .88rem;
        color: var(--kt-text) !important;
    }

.kt-x {
    cursor: pointer;
    color: #9ca3af !important;
    font-size: 1.2rem;
    line-height: 1;
}

.kt-select {
    border: 1.5px solid var(--kt-border);
    background: var(--kt-soft);
    border-radius: 12px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: .85rem;
    outline: 0;
    color: var(--kt-text) !important;
}

.kt-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    background: var(--kt-soft);
    border-radius: 14px;
    align-items: end;
    animation: ktDrop .25s ease both;
}

    .kt-filters label {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin: 0;
        font-size: .78rem;
        color: var(--kt-muted) !important;
    }

        .kt-filters label > span {
            color: var(--kt-muted) !important;
        }

    .kt-filters select, .kt-filters input {
        border: 1.5px solid var(--kt-border);
        background: white;
        border-radius: 10px;
        padding: 8px;
        font-family: inherit;
        font-size: .85rem;
        outline: 0;
        color: var(--kt-text) !important;
    }

    .kt-filters input {
        direction: ltr;
        text-align: right !important;
    }

.kt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.kt-chip {
    background: #eef2ff;
    color: #3730a3 !important;
    border-radius: 999px;
    padding: 4px 6px 4px 12px;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: ktPop .3s ease;
}

    .kt-chip i {
        font-style: normal;
        cursor: pointer;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #c7d2fe;
        display: grid;
        place-items: center;
        font-size: .8rem;
        line-height: 1;
    }

.kt-result {
    font-size: .78rem;
    color: var(--kt-muted) !important;
    margin: 10px 2px 4px;
    min-height: 1em;
}

/* ---------------- لیست ---------------- */
.kt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kt-group {
    font-size: .8rem;
    font-weight: 800;
    margin: 10px 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b !important;
}

    .kt-group::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--kt-border);
    }

.kt-group-late {
    color: var(--kt-red) !important;
}

.kt-group-today {
    color: #b45309 !important;
}

.kt-group-tomorrow, .kt-group-week {
    color: #4338ca !important;
}

.kt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 1.5px solid var(--kt-border);
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .18s, box-shadow .18s, border-color .18s;
    animation: ktIn .4s ease both;
}

    .kt-row::before {
        content: "";
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        background: #38bdf8;
    }

    .kt-row.kt-p2::before {
        background: var(--kt-orange);
    }

    .kt-row.kt-p3::before {
        background: var(--kt-red);
    }

    .kt-row:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(30, 27, 75, .09);
        border-color: #c7d2fe;
    }

    .kt-row.late {
        background: linear-gradient(90deg, #fff, #fff5f6);
        border-color: #fecdd3;
    }

    .kt-row.ok {
        opacity: .8;
    }

    .kt-row.leaving {
        animation: ktLeave .55s ease forwards;
        pointer-events: none;
    }

        .kt-row.leaving .kt-check {
            background: var(--kt-green);
            border-color: var(--kt-green);
            transform: scale(1.15);
        }

            .kt-row.leaving .kt-check svg {
                opacity: 1;
                transform: scale(1);
            }

.kt-check {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #c7d2fe;
    background: white;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: .2s;
    padding: 0;
}

    .kt-check svg {
        width: 18px;
        height: 18px;
        opacity: 0;
        transform: scale(.4);
        transition: .2s;
    }

    .kt-check:hover {
        border-color: var(--kt-green);
        background: #d1fae5;
    }

        .kt-check:hover svg {
            opacity: 1;
            transform: scale(1);
            fill: #059669 !important;
        }

.kt-check-ok {
    border-color: #fdba74;
}

    .kt-check-ok svg {
        opacity: .9;
        transform: scale(.9);
        fill: #f97316 !important;
    }

    .kt-check-ok:hover {
        background: #ffedd5;
        border-color: var(--kt-orange);
    }

.kt-state {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

    .kt-state svg {
        width: 22px;
        height: 22px;
        color: #cbd5e1;
    }

    .kt-state.v1 svg {
        color: var(--kt-orange);
    }

    .kt-state.v2 svg {
        color: var(--kt-green);
    }

.kt-main {
    flex: 1;
    min-width: 0;
}

.kt-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kt-name {
    font-weight: 700;
    font-size: .95rem;
}

.kt-row.ok .kt-name {
    text-decoration: line-through;
    text-decoration-color: #94a3b8;
}

.kt-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 8px;
}

    .kt-pill svg {
        width: 14px;
        height: 14px;
    }

    .kt-pill.kt-p2 {
        background: #ffedd5;
        color: #c2410c !important;
    }

    .kt-pill.kt-p3 {
        background: #ffe4e6;
        color: #be123c !important;
        animation: ktPulse 1.6s infinite;
    }

.kt-pill-wait {
    background: #fef3c7;
    color: #92400e !important;
}

.kt-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 5px;
    font-size: .78rem;
    color: var(--kt-muted) !important;
}

    .kt-meta > span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .kt-meta svg {
        width: 15px;
        height: 15px;
    }

.kt-due.late {
    color: var(--kt-red) !important;
    font-weight: 800;
}

.kt-due.today {
    color: #b45309 !important;
    font-weight: 800;
}

.kt-person small {
    color: #9ca3af !important;
}

.kt-proj {
    background: #f0f9ff;
    color: #0369a1 !important;
    border-radius: 8px;
    padding: 1px 7px;
}

.kt-cat i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.kt-msg.new {
    color: var(--kt-p) !important;
    font-weight: 800;
}

    .kt-msg.new svg {
        animation: ktWiggle 1.4s infinite;
    }

.kt-id {
    color: #cbd5e1 !important;
    direction: ltr;
}

.kt-go svg {
    width: 22px;
    height: 22px;
    color: #cbd5e1;
    transition: .2s;
}

.kt-row:hover .kt-go svg {
    color: var(--kt-p);
    transform: translateX(-4px);
}

.kt-av {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    position: relative;
    vertical-align: middle;
}

    .kt-av img {
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }

    .kt-av b {
        color: white !important;
        font-size: .7rem;
        font-weight: 800;
    }

.kt-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 11px;
    border-radius: 13px;
    border: 1.5px dashed #c7d2fe;
    background: #f8f9ff;
    color: #4338ca !important;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: .2s;
}

    .kt-more:hover {
        background: #eef2ff;
    }

/* اسکلت بارگذاری */
.kt-skel {
    cursor: default;
}

    .kt-skel > span {
        width: 30px;
        height: 30px;
        border-radius: 50%;
    }

    .kt-skel > div {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .kt-skel i {
        height: 12px;
        border-radius: 6px;
        display: block;
    }

        .kt-skel i:first-child {
            width: 55%;
        }

        .kt-skel i:last-child {
            width: 30%;
        }

    .kt-skel > span, .kt-skel i, .ktq-skel {
        background: linear-gradient(90deg, #eef0f6 25%, #f8f9fc 50%, #eef0f6 75%);
        background-size: 200% 100%;
        animation: ktShimmer 1.2s infinite;
    }

    .kt-skel::before {
        background: #e5e7eb !important;
    }

/* حالت خالی */
.kt-empty {
    text-align: center !important;
    padding: 36px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: ktIn .4s ease both;
}

.kt-empty-ico {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    background: linear-gradient(135deg, #34d399, #6366f1);
    display: grid;
    place-items: center;
    animation: ktBounce 2.4s ease-in-out infinite;
    box-shadow: 0 12px 26px rgba(99, 102, 241, .3);
}

.kt-empty b {
    font-size: 1.05rem;
    margin-top: 8px;
}

.kt-empty p {
    color: var(--kt-muted) !important;
    margin: 0;
    font-size: .88rem;
}

/* ---------------- پنل کشویی جزئیات ---------------- */
.ktq-back {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    z-index: 1300;
    animation: ktFade .2s ease both;
}

.ktq {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(520px, 100vw);
    background: #f8f9fc;
    z-index: 1301;
    display: flex;
    flex-direction: column;
    box-shadow: 20px 0 50px rgba(15, 23, 42, .25);
    animation: ktSlide .3s cubic-bezier(.2, .9, .3, 1.1) both;
}

.ktq-head {
    background: linear-gradient(135deg, #312e81, #4f46e5 60%, #7c3aed);
    padding: 18px 20px 16px;
    position: relative;
}

.ktq.kt-p2 .ktq-head {
    background: linear-gradient(135deg, #9a3412, #f97316);
}

.ktq.kt-p3 .ktq-head {
    background: linear-gradient(135deg, #881337, #e11d48);
}

.ktq-close {
    position: absolute;
    left: 14px;
    top: 14px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 0;
    background: rgba(255, 255, 255, .18);
    cursor: pointer;
    display: grid;
    place-items: center;
}

    .ktq-close:hover {
        background: rgba(255, 255, 255, .3);
    }

.ktq-id {
    color: #e0e7ff !important;
    font-size: .78rem;
}

.ktq-title {
    color: white !important;
    margin: 4px 0 14px;
    font-size: 1.2rem;
    font-weight: 800;
    padding-left: 40px;
    line-height: 1.6;
}

.ktq-skel {
    height: 60px;
    border-radius: 12px;
    opacity: .3;
}

.ktq-steps {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .ktq-steps span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: .75rem;
        color: rgba(255, 255, 255, .6) !important;
        background: rgba(0, 0, 0, .18);
        padding: 4px 9px;
        border-radius: 999px;
    }

        .ktq-steps span svg {
            width: 15px;
            height: 15px;
            fill: rgba(255, 255, 255, .6) !important;
        }

        .ktq-steps span.on {
            background: rgba(255, 255, 255, .95);
            color: #3730a3 !important;
        }

            .ktq-steps span.on svg {
                fill: #4f46e5 !important;
            }

    .ktq-steps i {
        flex: 1;
        height: 3px;
        background: rgba(255, 255, 255, .2);
        border-radius: 3px;
    }

        .ktq-steps i.on {
            background: white;
        }

.ktq-body {
    flex: 1;
    overflow: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ktq-facts {
    background: white;
    border-radius: 15px;
    border: 1px solid var(--kt-border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    overflow: hidden;
}

    .ktq-facts > div {
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        background: white;
        outline: 1px solid var(--kt-border);
    }

    .ktq-facts small {
        color: var(--kt-muted) !important;
        font-size: .72rem;
    }

    .ktq-facts span {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: .86rem;
        font-weight: 700;
    }

    .ktq-facts svg {
        width: 16px;
        height: 16px;
        color: var(--kt-p);
    }

.ktq-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.ktq-sec {
    background: white;
    border-radius: 15px;
    border: 1px solid var(--kt-border);
    padding: 12px 14px;
    animation: ktIn .35s ease both;
}

    .ktq-sec h4 {
        margin: 0 0 8px;
        font-size: .9rem;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .ktq-sec h4 svg {
            width: 18px;
            height: 18px;
            color: var(--kt-p);
        }

.ktq-desc {
    font-size: .9rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

    .ktq-desc img {
        max-width: 100%;
        height: auto;
    }

.ktq-msg {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

    .ktq-msg .kt-av {
        width: 30px;
        height: 30px;
    }

    .ktq-msg > div {
        background: var(--kt-soft);
        border-radius: 4px 14px 14px 14px;
        padding: 8px 12px;
        max-width: 85%;
    }

    .ktq-msg.me {
        flex-direction: row-reverse;
    }

        .ktq-msg.me > div {
            background: #eef2ff;
            border-radius: 14px 4px 14px 14px;
        }

    .ktq-msg small {
        color: var(--kt-muted) !important;
        font-size: .72rem;
    }

    .ktq-msg p {
        margin: 2px 0 0;
        font-size: .88rem;
        white-space: pre-line;
    }

.ktq-write {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 6px;
}

    .ktq-write textarea, .ktq-return textarea {
        flex: 1;
        width: 100%;
        border: 1.5px solid var(--kt-border);
        border-radius: 12px;
        padding: 8px 10px;
        font-family: inherit;
        font-size: .88rem;
        resize: vertical;
        outline: 0;
        color: var(--kt-text) !important;
    }

        .ktq-write textarea:focus, .ktq-return textarea:focus {
            border-color: #a5b4fc;
        }

.ktq-return {
    border-color: #fecdd3;
    background: #fff7f8;
    animation: ktDrop .25s ease both;
}

.ktq-foot {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid var(--kt-border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------------- کانفتی ---------------- */
.kt-confetti {
    position: fixed;
    top: -12px;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    z-index: 2000;
    pointer-events: none;
    animation: ktFall linear forwards;
}

.kt-popped {
    animation: ktPop .4s ease;
}

/* ---------------- انیمیشن‌ها ---------------- */
@keyframes ktIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes ktFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ktDrop {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes ktSlide {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: none;
    }
}

@keyframes ktLeave {
    0% {
        transform: none;
    }

    35% {
        transform: scale(1.02);
        background: #ecfdf5;
        border-color: #6ee7b7;
    }

    100% {
        transform: translateX(60px);
        opacity: 0;
    }
}

@keyframes ktPop {
    0% {
        transform: scale(.9);
    }

    60% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ktPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, .5);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(249, 115, 22, 0);
    }
}

@keyframes ktGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(254, 202, 202, .6);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(254, 202, 202, 0);
    }
}

@keyframes ktShimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes ktRot {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ktFloat {
    0%, 100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 14px);
    }
}

@keyframes ktWiggle {
    0%, 100% {
        transform: rotate(-8deg);
    }

    50% {
        transform: rotate(4deg);
    }
}

@keyframes ktSpark {
    0%, 100% {
        transform: scale(1) rotate(0);
    }

    50% {
        transform: scale(1.08) rotate(8deg);
    }
}

@keyframes ktBounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes ktShake {
    0%, 100% {
        transform: none;
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes ktFall {
    to {
        transform: translateY(105vh) rotate(720deg);
    }
}

/* کسی که در ویندوز/گوشی «کاهش حرکت» را روشن کرده */
@media (prefers-reduced-motion: reduce) {
    .kt *, .ktq *, .kt, .ktq, .kt-hero::before, .kt-hero::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------------- موبایل ---------------- */
@media (max-width: 700px) {
    .kt-hero {
        padding: 16px;
        border-radius: 18px;
    }

    .kt-title {
        font-size: 1.25rem;
    }

    .kt-hero-ico {
        width: 46px;
        height: 46px;
    }

    .kt-scope {
        width: 100%;
    }

        .kt-scope button {
            flex: 1;
            justify-content: center;
            padding: 8px 4px;
            font-size: .78rem;
            white-space: nowrap;
            gap: 4px;
        }

            .kt-scope button svg {
                display: none;
            }

    .kt-kpis {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 4px;
    }

    .kt-kpi {
        min-width: 128px;
        scroll-snap-align: start;
    }

    .kt-bar {
        gap: 8px;
    }

    .kt-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .kt-tab {
        flex: 1;
        white-space: nowrap;
    }

    .kt-search {
        min-width: 100%;
        order: 3;
    }

    .kt-select {
        flex: 1;
    }

    .kt-row {
        padding: 11px 12px;
        gap: 10px;
    }

    .kt-go, .kt-id {
        display: none !important;
    }

    .kt-qp-f select {
        max-width: 150px;
    }

    .kt-qp-help {
        display: none;
    }

    .ktq {
        width: 100vw;
    }

    .ktq-facts {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   مرحله ۲ — صفحه کامل وظیفه  (/tasks/{id})
   ===================================================================== */
.kt-d {
    max-width: 1240px;
    margin: 0 auto;
}

.kt-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--kt-muted) !important;
    font-weight: 700;
    font-size: .85rem;
    text-decoration: none !important;
    margin-bottom: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 10px;
    transition: .2s;
}

    .kt-back svg {
        width: 18px;
        height: 18px;
        transition: transform .2s;
    }

    .kt-back:hover {
        color: var(--kt-p) !important;
        background: #eef2ff;
    }

        .kt-back:hover svg {
            transform: translateX(3px);
        }

/* ---------- هیرو ---------- */
.kt-dhero {
    border-radius: 22px;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    color: white !important;
    background: linear-gradient(135deg, #0c4a6e 0%, #0284c7 50%, #4f46e5 100%);
    box-shadow: 0 14px 34px rgba(2, 132, 199, .28);
    animation: ktIn .45s ease both;
}

    .kt-dhero.kt-p2 {
        background: linear-gradient(135deg, #7c2d12 0%, #ea580c 50%, #db2777 100%);
        box-shadow: 0 14px 34px rgba(234, 88, 12, .28);
    }

    .kt-dhero.kt-p3 {
        background: linear-gradient(135deg, #4c0519 0%, #e11d48 55%, #9333ea 100%);
        box-shadow: 0 14px 34px rgba(225, 29, 72, .32);
    }

    .kt-dhero::before {
        content: "";
        position: absolute;
        width: 280px;
        height: 280px;
        left: -90px;
        top: -110px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
        animation: ktFloat 8s ease-in-out infinite;
        pointer-events: none;
    }

    .kt-dhero > * {
        position: relative;
        z-index: 1;
    }

.kt-dhero-top {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.kt-dhero-id {
    color: rgba(255, 255, 255, .78) !important;
    font-size: .8rem;
    font-weight: 700;
}

.kt-dhero-link {
    border: 0;
    background: rgba(255, 255, 255, .16);
    color: white !important;
    border-radius: 10px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    transition: .2s;
}

    .kt-dhero-link svg {
        width: 17px;
        height: 17px;
    }

    .kt-dhero-link:hover {
        background: rgba(255, 255, 255, .28);
    }

.kt-dhero-title {
    color: white !important;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 8px 0 12px;
    line-height: 1.45;
    word-break: break-word;
}

.kt-dhero-people {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

    .kt-dhero-people > span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(0, 0, 0, .2);
        border-radius: 999px;
        padding: 4px 12px 4px 5px;
        font-size: .85rem;
        font-weight: 700;
        color: white !important;
    }

        .kt-dhero-people > span small {
            color: rgba(255, 255, 255, .7) !important;
            font-weight: 400;
        }

    .kt-dhero-people .kt-av {
        width: 26px;
        height: 26px;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, .6);
    }

    .kt-dhero-people svg {
        width: 17px;
        height: 17px;
    }

    .kt-dhero-people > span.kt-dhero-due, .kt-dhero-people > span.kt-dhero-chip {
        padding: 5px 12px;
    }

.kt-dhero-due.late {
    background: #fff1f2 !important;
    color: #be123c !important;
    animation: ktPulse 1.6s infinite;
}

    .kt-dhero-due.late svg {
        fill: #e11d48 !important;
    }

.kt-dhero-bottom {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
}

    .kt-dhero-bottom .ktq-steps {
        flex: 1;
        max-width: 520px;
    }

.kt-dhero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.kt-btn-glass {
    background: rgba(255, 255, 255, .16);
    color: white !important;
    border: 1.5px solid rgba(255, 255, 255, .3);
}

    .kt-btn-glass span {
        color: white !important;
    }

    .kt-btn-glass:hover {
        background: rgba(255, 255, 255, .26);
    }

.kt-btn-sm {
    padding: 5px 10px;
    font-size: .78rem;
    border-radius: 9px;
}

    .kt-btn-sm svg {
        width: 15px;
        height: 15px;
    }

.kt-dreturn {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 12px;
    background: rgba(255, 255, 255, .95);
    border-radius: 14px;
    padding: 10px;
    animation: ktDrop .25s ease both;
}

    .kt-dreturn textarea {
        flex: 1;
        border: 1.5px solid #fecdd3;
        border-radius: 10px;
        padding: 8px 10px;
        font-family: inherit;
        font-size: .88rem;
        resize: vertical;
        outline: 0;
        color: var(--kt-text) !important;
    }

.kt-dskel {
    height: 150px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(255,255,255,.08) 25%, rgba(255,255,255,.2) 50%, rgba(255,255,255,.08) 75%);
    background-size: 200% 100%;
    animation: ktShimmer 1.2s infinite;
}

/* حلقه پیشرفت (بدون جاوااسکریپت؛ با conic-gradient) */
.kt-ring {
    --p: 0;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: conic-gradient(#fde68a calc(var(--p) * 1%), rgba(255, 255, 255, .2) 0);
    animation: ktPop .6s .2s ease both;
}

    .kt-ring b {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: rgba(15, 23, 42, .35);
        display: grid;
        place-items: center;
        color: white !important;
        font-size: .9rem;
        font-weight: 800;
    }

/* ---------- چیدمان دو ستونه ---------- */
.kt-dgrid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 14px;
    align-items: start;
}

.kt-dmain, .kt-dside {
    min-width: 0;
}

.kt-dside {
    position: sticky;
    top: 76px;
}

.kt-dgrid .kt-card {
    margin-top: 14px;
}

.kt-dside .kt-card:nth-child(2) {
    animation-delay: .15s;
}

.kt-dside .kt-card:nth-child(3) {
    animation-delay: .2s;
}

.kt-dmain .kt-card:nth-child(2) {
    animation-delay: .15s;
}

.kt-dmain .kt-card:nth-child(3) {
    animation-delay: .2s;
}

.kt-sec {
    padding: 16px;
}

.kt-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

    .kt-sec-head h3 {
        margin: 0;
        font-size: 1rem;
        font-weight: 800;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .kt-sec-head h3 small {
            font-weight: 400;
            font-size: .78rem;
        }

.kt-sec-ic {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

    .kt-sec-ic svg {
        width: 18px;
        height: 18px;
    }

.kt-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.kt-desc {
    font-size: .92rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

    .kt-desc img {
        max-width: 100%;
        height: auto;
        border-radius: 10px;
    }

    .kt-desc table {
        max-width: 100%;
        display: block;
        overflow-x: auto;
    }

/* ---------- دکمه آیکنی کوچک ---------- */
.kt-ibtn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    color: var(--kt-muted) !important;
    transition: .15s;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

    .kt-ibtn svg {
        width: 19px;
        height: 19px;
    }

    .kt-ibtn:hover {
        background: #eef2ff;
        color: var(--kt-p) !important;
    }

    .kt-ibtn.red:hover {
        background: #fff1f2;
        color: var(--kt-red) !important;
    }

/* ---------- چک‌لیست ---------- */
.kt-bar-prog {
    height: 7px;
    background: #eef0f6;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
}

    .kt-bar-prog i {
        display: block;
        height: 100%;
        border-radius: 99px;
        background: linear-gradient(90deg, #34d399, #10b981);
        transition: width .5s cubic-bezier(.2, .8, .2, 1);
    }

.kt-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .kt-check-list li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 7px 8px;
        border-radius: 11px;
        transition: background .15s;
        animation: ktIn .3s ease both;
    }

        .kt-check-list li:hover {
            background: var(--kt-soft);
        }

.kt-cbox {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid #c7d2fe;
    background: white;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: .2s;
}

    .kt-cbox svg {
        width: 16px;
        height: 16px;
        opacity: 0;
        transform: scale(.3);
        transition: .2s;
    }

    .kt-cbox:hover {
        border-color: var(--kt-green);
    }

.kt-check-list li.done .kt-cbox {
    background: var(--kt-green);
    border-color: var(--kt-green);
}

    .kt-check-list li.done .kt-cbox svg {
        opacity: 1;
        transform: scale(1);
    }

.kt-check-list li.pop .kt-cbox {
    animation: ktPop .35s ease;
}

.kt-check-title {
    flex: 1;
    min-width: 0;
    font-size: .9rem;
    overflow-wrap: anywhere;
    cursor: text;
}

.kt-check-list li.done .kt-check-title {
    text-decoration: line-through;
    text-decoration-color: #94a3b8;
    color: var(--kt-muted) !important;
}

.kt-check-who {
    font-size: .72rem;
    white-space: nowrap;
}

.kt-check-tools {
    display: flex;
    opacity: 0;
    transition: opacity .15s;
}

    .kt-check-tools .kt-ibtn {
        width: 28px;
        height: 28px;
    }

.kt-check-list li:hover .kt-check-tools {
    opacity: 1;
}

.kt-inline {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #a5b4fc;
    border-radius: 9px;
    padding: 5px 9px;
    font-family: inherit;
    font-size: .9rem;
    outline: 0;
    color: var(--kt-text) !important;
}

.kt-check-add {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 10px;
    border: 1.5px dashed #c7d2fe;
    border-radius: 12px;
    transition: .2s;
}

    .kt-check-add:focus-within {
        border-style: solid;
        border-color: #a5b4fc;
        background: #f8f9ff;
    }

    .kt-check-add svg {
        width: 19px;
        height: 19px;
        color: var(--kt-p);
        flex-shrink: 0;
    }

    .kt-check-add input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        font-family: inherit;
        font-size: .88rem;
        padding: 5px 0;
        color: var(--kt-text) !important;
    }

/* ---------- گفتگو ---------- */
.kt-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 560px;
    overflow-y: auto;
    padding: 4px 2px 8px;
    scroll-behavior: smooth;
}

.kt-thread-empty {
    text-align: center !important;
    padding: 18px 0;
    margin: 0;
    font-size: .88rem;
}

.kt-legacy {
    align-self: center;
    font-size: .72rem;
    color: var(--kt-muted) !important;
    background: var(--kt-soft);
    border-radius: 999px;
    padding: 2px 12px;
}

.kt-cm {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    animation: ktIn .3s ease both;
}

    .kt-cm > .kt-av {
        width: 34px;
        height: 34px;
    }

.kt-cm-body {
    background: var(--kt-soft);
    border-radius: 4px 16px 16px 16px;
    padding: 8px 12px 10px;
    max-width: 80%;
    min-width: 120px;
}

.kt-cm.me {
    flex-direction: row-reverse;
}

    .kt-cm.me .kt-cm-body {
        background: #eef2ff;
        border-radius: 16px 4px 16px 16px;
    }

.kt-cm.sys .kt-cm-body {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.kt-cm.new .kt-cm-body {
    box-shadow: 0 0 0 2px #a5b4fc;
    animation: ktPop .4s ease;
}

.kt-cm-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .kt-cm-head b {
        font-size: .84rem;
    }

    .kt-cm-head small {
        color: var(--kt-muted) !important;
        font-size: .72rem;
    }

    .kt-cm-head .kt-ibtn {
        width: 24px;
        height: 24px;
        margin-inline-start: auto;
        opacity: 0;
    }

        .kt-cm-head .kt-ibtn svg {
            width: 16px;
            height: 16px;
        }

.kt-cm:hover .kt-cm-head .kt-ibtn {
    opacity: 1;
}

.kt-cm-body p {
    margin: 4px 0 0;
    font-size: .9rem;
    line-height: 1.8;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.kt-at {
    color: var(--kt-p) !important;
    background: #e0e7ff;
    border-radius: 6px;
    padding: 0 4px;
    font-weight: 700;
}

.kt-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.kt-thumb {
    display: block;
    width: 120px;
    height: 90px;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--kt-border);
    background: white;
    transition: transform .2s;
}

    .kt-thumb:hover {
        transform: scale(1.04);
    }

    .kt-thumb img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        display: block;
    }

.kt-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 10px;
    padding: 5px 9px;
    font-size: .8rem;
    text-decoration: none !important;
    max-width: 100%;
    transition: .15s;
}

    .kt-file-chip svg {
        width: 17px;
        height: 17px;
        color: var(--kt-p);
        flex-shrink: 0;
    }

    .kt-file-chip small {
        color: var(--kt-muted) !important;
        direction: ltr;
    }

    .kt-file-chip i {
        font-style: normal;
        cursor: pointer;
        color: var(--kt-red) !important;
        font-weight: 800;
        padding: 0 3px;
    }

a.kt-file-chip:hover {
    border-color: #a5b4fc;
    background: #f8f9ff;
}

.kt-compose {
    margin-top: 12px;
    border: 1.5px solid var(--kt-border);
    border-radius: 15px;
    padding: 8px;
    position: relative;
    transition: .2s;
}

    .kt-compose:focus-within {
        border-color: #a5b4fc;
        box-shadow: 0 8px 24px rgba(79, 70, 229, .12);
    }

    .kt-compose textarea {
        width: 100%;
        border: 0;
        outline: 0;
        resize: vertical;
        font-family: inherit;
        font-size: .9rem;
        padding: 4px 6px;
        background: transparent;
        color: var(--kt-text) !important;
        min-height: 60px;
    }

.kt-compose-bar {
    display: flex;
    align-items: center;
    gap: 4px;
}

    .kt-compose-bar label.kt-ibtn {
        margin: 0;
    }

.kt-pending {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 6px;
}

.kt-mention {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 8px;
    width: 260px;
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(30, 27, 75, .16);
    padding: 8px;
    z-index: 20;
    animation: ktDrop .2s ease both;
}

    .kt-mention input {
        width: 100%;
        border: 1.5px solid var(--kt-border);
        border-radius: 9px;
        padding: 6px 9px;
        font-family: inherit;
        font-size: .85rem;
        outline: 0;
        color: var(--kt-text) !important;
    }

.kt-mention-list {
    max-height: 220px;
    overflow-y: auto;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
}

    .kt-mention-list button {
        display: flex;
        align-items: center;
        gap: 8px;
        border: 0;
        background: transparent;
        padding: 6px;
        border-radius: 9px;
        cursor: pointer;
        font-family: inherit;
        font-size: .85rem;
    }

        .kt-mention-list button:hover {
            background: #eef2ff;
        }

/* ---------- مشخصات ---------- */
.kt-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
    margin: 0;
    font-size: .87rem;
}

    .kt-facts dt {
        color: var(--kt-muted) !important;
        font-weight: 400;
    }

    .kt-facts dd {
        margin: 0;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .kt-facts .kt-pill.kt-p1 {
        background: #e0f2fe;
        color: #0369a1 !important;
    }

.kt-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .kt-form label, .kt-form-l {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin: 0;
    }

        .kt-form label > span, .kt-form-l > span {
            font-size: .78rem;
            color: var(--kt-muted) !important;
            font-weight: 700;
        }

    .kt-form input, .kt-form select {
        width: 100%;
        border: 1.5px solid var(--kt-border);
        border-radius: 10px;
        padding: 8px 10px;
        font-family: inherit;
        font-size: .88rem;
        outline: 0;
        background: white;
        color: var(--kt-text) !important;
        transition: border-color .15s;
    }

        .kt-form input:focus, .kt-form select:focus {
            border-color: #a5b4fc;
        }

        .kt-form input.ltr {
            direction: ltr;
            text-align: left !important;
        }

.kt-form-2 {
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 8px;
}

.kt-form .kt-qp-pr {
    align-self: flex-start;
}

/* ---------- پیشرفت دستی ---------- */
.kt-range {
    --p: 0%;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 99px;
    outline: 0;
    margin: 6px 0 10px;
    background: linear-gradient(90deg, #0ea5e9 var(--p), #eef0f6 var(--p));
    direction: ltr;
}

    .kt-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: white;
        border: 3px solid #0ea5e9;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(14, 165, 233, .4);
    }

    .kt-range::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: white;
        border: 3px solid #0ea5e9;
        cursor: pointer;
    }

/* ---------- تاریخچه ---------- */
.kt-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

    .kt-timeline::before {
        content: "";
        position: absolute;
        right: 13px;
        top: 6px;
        bottom: 6px;
        width: 2px;
        background: #eef0f6;
    }

    .kt-timeline li {
        display: flex;
        gap: 10px;
        padding: 6px 0;
        position: relative;
        animation: ktIn .3s ease both;
    }

        .kt-timeline li > i {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #a5b4fc;
            display: grid;
            place-items: center;
            flex-shrink: 0;
            z-index: 1;
            box-shadow: 0 0 0 3px white;
        }

            .kt-timeline li > i svg {
                width: 15px;
                height: 15px;
            }

        .kt-timeline li.a-done > i {
            background: #10b981;
        }

        .kt-timeline li.a-approve > i {
            background: #059669;
        }

        .kt-timeline li.a-reopen > i {
            background: #f43f5e;
        }

        .kt-timeline li.a-priority > i {
            background: #f97316;
        }

        .kt-timeline li.a-due > i, .kt-timeline li.a-start > i {
            background: #0ea5e9;
        }

        .kt-timeline li.a-assignee > i {
            background: #8b5cf6;
        }

        .kt-timeline li.a-old > i {
            background: #cbd5e1;
        }

        .kt-timeline li > div {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
            padding-top: 3px;
        }

    .kt-timeline b {
        font-size: .84rem;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .kt-timeline small {
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

.kt-diff {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: .76rem;
}

    .kt-diff svg {
        width: 14px;
        height: 14px;
        color: var(--kt-muted);
    }

    .kt-diff del {
        color: #be123c !important;
        background: #fff1f2;
        border-radius: 5px;
        padding: 0 5px;
    }

    .kt-diff ins {
        color: #047857 !important;
        background: #ecfdf5;
        border-radius: 5px;
        padding: 0 5px;
        text-decoration: none;
    }

/* ---------- کارتابل: نشانه‌های چک‌لیست و پیام ---------- */
.kt-mini {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

    .kt-mini.full {
        color: #059669 !important;
        font-weight: 800;
    }

@media (prefers-reduced-motion: reduce) {
    .kt-dhero::before {
        animation: none !important;
    }
}

@media (max-width: 1000px) {
    .kt-dgrid {
        grid-template-columns: 1fr;
    }

    .kt-dside {
        position: static;
    }
}

@media (max-width: 700px) {
    .kt-dhero {
        padding: 16px;
        border-radius: 18px;
    }

    .kt-dhero-title {
        font-size: 1.25rem;
    }

    .kt-dhero-link span {
        display: none;
    }

    .kt-dhero-people {
        gap: 6px;
    }

        .kt-dhero-people > svg {
            display: none;
        }

    .kt-dhero-bottom {
        gap: 12px;
    }

    .kt-ring {
        width: 56px;
        height: 56px;
    }

        .kt-ring b {
            width: 44px;
            height: 44px;
            font-size: .8rem;
        }

    .kt-dhero-actions .kt-btn {
        flex: 1;
        justify-content: center;
    }

    .kt-dreturn {
        flex-direction: column;
        align-items: stretch;
    }

    .kt-check-tools {
        opacity: 1;
    }

    .kt-check-who {
        display: none;
    }

    .kt-check-tools .kt-ibtn:nth-child(-n+2) {
        display: none;
    }

    .kt-cm-body {
        max-width: 88%;
    }

    .kt-cm-head .kt-ibtn {
        opacity: 1;
    }

    .kt-thread {
        max-height: none;
    }

    .kt-mention {
        width: calc(100% - 16px);
    }
}

/* پنجره کناری: لینک صفحه کامل و خلاصه گفتگو */
.ktq-full {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-inline-start: 8px;
    background: rgba(255, 255, 255, .18);
    border-radius: 8px;
    padding: 1px 8px;
    color: white !important;
    text-decoration: none !important;
    font-weight: 700;
}

    .ktq-full svg {
        width: 14px;
        height: 14px;
    }

    .ktq-full:hover {
        background: rgba(255, 255, 255, .3);
    }

.ktq-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: var(--kt-soft);
    border-radius: 12px;
    padding: 9px 11px;
    text-decoration: none !important;
    font-size: .82rem;
    transition: .15s;
}

    .ktq-summary span {
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

    .ktq-summary svg {
        width: 15px;
        height: 15px;
        color: var(--kt-p);
    }

    .ktq-summary b {
        margin-inline-start: auto;
        color: var(--kt-p) !important;
        font-size: .8rem;
    }

    .ktq-summary:hover {
        background: #eef2ff;
    }

/* =====================================================================
   مرحله ۳: چند مسئول، ناظر، فرم جدید ثبت، زنگوله و صفحه اعلان‌ها
   (فقط اضافه شده؛ کلاس‌های قبلی دست نخورده‌اند)
   ===================================================================== */

/* ---------- دکمه سفید روی هیرو ---------- */
.kt-btn-white {
    background: white;
    color: #3730a3 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

    .kt-btn-white span {
        color: #3730a3 !important;
    }

    .kt-btn-white svg {
        fill: #4f46e5 !important;
    }

    .kt-btn-white:hover {
        transform: translateY(-2px);
    }

.kt-new-btn {
    margin-inline-start: auto;
}

/* ---------- کارتابل: آواتارهای روی هم و نشان ناظر ---------- */
.kt-stack {
    display: inline-flex;
    align-items: center;
    flex-direction: row;
}

    .kt-stack .kt-av {
        box-shadow: 0 0 0 2px white;
    }

        .kt-stack .kt-av + .kt-av {
            margin-inline-start: -7px;
        }

.kt-stack-more {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3 !important;
    font-size: .68rem;
    font-weight: 800;
    margin-inline-start: -6px;
    box-shadow: 0 0 0 2px white;
    padding: 0 4px;
}

.kt-dhero-people .kt-stack .kt-av {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .7);
}

.kt-dhero-people .kt-stack-more {
    background: rgba(255, 255, 255, .9);
    box-shadow: none;
}

.kt-pill-watch {
    background: #e0f2fe;
    color: #075985 !important;
}

/* ---------- پنل کشویی: فهرست افراد ---------- */
.ktq-people {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px !important;
}

    .ktq-people > span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        background: var(--kt-soft);
        border-radius: 999px;
        padding: 2px 10px 2px 3px;
        font-size: .8rem;
    }

/* ---------- صفحه وظیفه: بخش افراد ---------- */
.kt-mem-l {
    font-size: .78rem;
    font-weight: 800;
    color: var(--kt-muted) !important;
    margin: 10px 0 6px;
    display: flex;
    gap: 6px;
    align-items: baseline;
    flex-wrap: wrap;
}

    .kt-mem-l:first-of-type {
        margin-top: 0;
    }

    .kt-mem-l small {
        font-weight: 400;
        font-size: .72rem;
    }

.kt-mem-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 12px;
    transition: background .15s;
    animation: ktIn .3s ease both;
    font-size: .88rem;
    font-weight: 700;
}

    .kt-mem-row:hover {
        background: var(--kt-soft);
    }

    .kt-mem-row .kt-av {
        width: 30px;
        height: 30px;
    }

    .kt-mem-row .kt-ibtn {
        width: 28px;
        height: 28px;
        opacity: .55;
    }

    .kt-mem-row:hover .kt-ibtn {
        opacity: 1;
    }

.kt-mem-none {
    font-size: .82rem;
    margin: 0 8px 4px;
}

.kt-role {
    font-size: .7rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 9px;
    background: #e0f2fe;
    color: #075985 !important;
}

    .kt-role.main {
        background: linear-gradient(135deg, #f59e0b, #f97316);
        color: white !important;
    }

.kt-mem-add {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
    padding: 7px 10px;
    border: 1.5px dashed #c7d2fe;
    border-radius: 12px;
    background: transparent;
    color: #4338ca !important;
    font-weight: 700;
    font-size: .82rem;
    cursor: pointer;
    font-family: inherit;
    transition: .15s;
}

    .kt-mem-add svg {
        width: 17px;
        height: 17px;
    }

    .kt-mem-add:hover {
        background: #eef2ff;
    }

.kt-mem .ktp {
    margin-top: 4px;
}

/* ---------- انتخاب همکار (چیپ + جستجو) ---------- */
.ktp {
    position: relative;
}

.ktp-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    border: 1.5px solid var(--kt-border);
    border-radius: 12px;
    padding: 5px 7px;
    background: white;
    cursor: text;
    transition: border-color .15s, box-shadow .15s;
}

    .ktp.open .ktp-box, .ktp-box:focus-within {
        border-color: #a5b4fc;
        box-shadow: 0 0 0 4px #eef2ff;
    }

    .ktp-box input {
        flex: 1;
        min-width: 120px;
        border: 0 !important;
        outline: 0;
        background: transparent;
        padding: 5px 4px !important;
        font-family: inherit;
        font-size: .88rem;
        color: var(--kt-text) !important;
        box-shadow: none !important;
    }

.ktp-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eef2ff;
    border-radius: 999px;
    padding: 2px 4px 2px 9px;
    font-size: .82rem;
    font-weight: 700;
    color: #3730a3 !important;
    animation: ktPop .25s ease;
}

    .ktp-chip.main {
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
        color: white !important;
    }

        .ktp-chip.main span, .ktp-chip.main i, .ktp-chip.main small {
            color: white !important;
        }

    .ktp-chip small {
        font-size: .66rem;
        background: rgba(255, 255, 255, .25);
        border-radius: 999px;
        padding: 0 6px;
    }

    .ktp-chip i {
        font-style: normal;
        cursor: pointer;
        font-size: 1.05rem;
        line-height: 1;
        opacity: .7;
        padding: 0 3px;
    }

        .ktp-chip i:hover {
            opacity: 1;
        }

.ktp-up {
    border: 0;
    background: transparent;
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: .45;
}

    .ktp-up svg {
        width: 15px;
        height: 15px;
        fill: #f59e0b !important;
    }

    .ktp-up:hover {
        opacity: 1;
    }

.ktp-drop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(30, 27, 75, .18);
    padding: 6px;
    z-index: 40;
    max-height: 280px;
    overflow-y: auto;
    animation: ktDrop .18s ease both;
}
/* بخشی که لیست جستجوی همکار در آن باز است، روی بخش‌های بعدی (مثل مهلت) بیاید */
.ktq-sec:focus-within, .kt-mem:focus-within {
    position: relative;
    z-index: 30;
}

.ktq-sec:has(.ktp.open), .kt-mem:has(.ktp.open) {
    position: relative;
    z-index: 30;
}

.ktp-drop button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 7px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: .87rem;
}

    .ktp-drop button .kt-av {
        width: 28px;
        height: 28px;
    }

    .ktp-drop button:hover, .ktp-drop button.hi {
        background: #eef2ff;
    }

.ktp-n {
    flex: 1;
    min-width: 0;
}

    .ktp-n small {
        color: var(--kt-muted) !important;
    }

.ktp-none {
    padding: 10px;
    color: var(--kt-muted) !important;
    font-size: .84rem;
}
/* انتخاب پروژه با جستجو (KtProjectPicker) */
.ktj .ktp-box {
    min-height: 40px;
    flex-wrap: nowrap;
}

    .ktj .ktp-box input {
        min-width: 0;
        text-overflow: ellipsis;
    }

.ktj-ic {
    width: 18px !important;
    height: 18px !important;
    fill: #6366f1 !important;
    flex-shrink: 0;
}

.ktj-ok {
    width: 18px !important;
    height: 18px !important;
    fill: #16a34a !important;
    flex-shrink: 0;
}

.ktj-x {
    font-style: normal;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--kt-muted) !important;
    padding: 0 4px;
    flex-shrink: 0;
}

    .ktj-x:hover {
        color: #dc2626 !important;
    }

.ktj .ktp-drop button {
    text-align: right;
}

    .ktj .ktp-drop button.sel {
        background: #f0fdf4;
    }

    .ktj .ktp-drop button.ktj-empty {
        color: var(--kt-muted) !important;
        font-weight: 700;
        border-bottom: 1px dashed var(--kt-border);
        border-radius: 10px 10px 0 0;
        margin-bottom: 4px;
    }

.ktj.mini .ktp-box {
    min-height: 0;
    border: 0;
    background: transparent;
    padding: 0 2px;
    box-shadow: none !important;
}

    .ktj.mini .ktp-box input {
        width: 200px;
        padding: 5px 2px !important;
        font-size: .85rem;
    }

.ktj.mini .ktp-drop {
    right: -10px;
    left: auto;
    width: 340px;
    max-width: 86vw;
}

.kt-qp-proj {
    padding-inline-end: 4px;
}
/* کادری که لیست پروژه/همکار در آن باز است روی کادرهای بعدی بیاید */
.kt-card:has(.ktp.open), .kt-quick-preview:has(.ktp.open), .kt-filters:has(.ktp.open) {
    position: relative;
    z-index: 30;
}

@media (max-width: 640px) {
    .ktj.mini .ktp-box input {
        width: 140px;
    }
}

.ktp-load {
    font-style: normal;
    font-size: .7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
}

    .ktp-load.l0 {
        background: #dcfce7;
        color: #166534 !important;
    }

    .ktp-load.l1 {
        background: #e0f2fe;
        color: #075985 !important;
    }

    .ktp-load.l2 {
        background: #fef3c7;
        color: #92400e !important;
    }

    .ktp-load.l3 {
        background: #ffe4e6;
        color: #be123c !important;
    }

/* ---------- فرم «وظیفه جدید» (روی پوسته‌ی پنل کشویی) ---------- */
.ktc {
    width: min(560px, 100vw);
}

    .ktc .ktq-head {
        padding-bottom: 18px;
    }

.ktc-title {
    width: 100%;
    border: 0;
    outline: 0;
    background: rgba(255, 255, 255, .14);
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 8px;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    color: white !important;
    transition: background .2s;
}

    .ktc-title::placeholder {
        color: rgba(255, 255, 255, .65);
        font-weight: 400;
    }

    .ktc-title:focus {
        background: rgba(255, 255, 255, .22);
    }

.ktc .ktq-sec h4 small {
    font-weight: 400;
    font-size: .72rem;
    margin-inline-start: 4px;
}

.ktc-sug {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    animation: ktDrop .25s ease both;
}

.ktc-sug-l {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    font-weight: 800;
    color: #a21caf !important;
}

    .ktc-sug-l svg {
        width: 16px;
        height: 16px;
        fill: #d946ef !important;
        animation: ktSpark 3s ease-in-out infinite;
    }

.ktc-sug button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1.5px solid #f5d0fe;
    background: #fdf4ff;
    border-radius: 12px;
    padding: 4px 6px 4px 10px;
    cursor: pointer;
    font-family: inherit;
    transition: .15s;
    max-width: 100%;
}

    .ktc-sug button:hover {
        border-color: #e879f9;
        transform: translateY(-1px);
    }

    .ktc-sug button > span {
        display: flex;
        flex-direction: column;
        line-height: 1.35;
        min-width: 0;
    }

    .ktc-sug button b {
        font-size: .8rem;
    }

    .ktc-sug button small {
        font-size: .68rem;
        color: var(--kt-muted) !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 230px;
    }

    .ktc-sug button > svg {
        width: 16px;
        height: 16px;
        fill: #a21caf !important;
    }

.ktc-sug .kt-av {
    width: 26px;
    height: 26px;
}

.ktc-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: #4338ca !important;
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
    padding: 8px 2px 0;
    font-family: inherit;
}

    .ktc-link svg {
        width: 16px;
        height: 16px;
    }

    .ktc-link:hover {
        text-decoration: underline;
    }

.ktc-sub-l {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 800;
    color: var(--kt-muted) !important;
    margin: 12px 0 6px;
}

    .ktc-sub-l svg {
        width: 16px;
        height: 16px;
    }

.ktc-due {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

    .ktc-due button {
        border: 1.5px solid var(--kt-border);
        background: white;
        border-radius: 999px;
        padding: 5px 12px;
        font-size: .8rem;
        font-weight: 700;
        cursor: pointer;
        font-family: inherit;
        color: #475569 !important;
        transition: .15s;
    }

        .ktc-due button:hover {
            border-color: #a5b4fc;
            color: #3730a3 !important;
        }

        .ktc-due button.on {
            background: linear-gradient(135deg, var(--kt-p), var(--kt-p2));
            border-color: transparent;
            color: white !important;
            box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
        }

.ktc-form {
    gap: 8px;
}

.ktc .kt-form textarea {
    width: 100%;
    border: 1.5px solid var(--kt-border);
    border-radius: 10px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: .88rem;
    outline: 0;
    background: white;
    color: var(--kt-text) !important;
    resize: vertical;
}

    .ktc .kt-form textarea:focus {
        border-color: #a5b4fc;
    }

.ktc-hint {
    color: #4338ca !important;
    font-size: .76rem;
    font-weight: 700;
}

.ktc-dup {
    display: flex;
    gap: 10px;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 14px;
    padding: 10px 12px;
    animation: ktDrop .25s ease both;
}

    .ktc-dup > svg {
        width: 20px;
        height: 20px;
        fill: #d97706 !important;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .ktc-dup b {
        display: block;
        font-size: .82rem;
        color: #92400e !important;
        margin-bottom: 4px;
    }

    .ktc-dup a {
        display: block;
        font-size: .82rem;
        color: #78350f !important;
        text-decoration: none !important;
        padding: 2px 0;
    }

        .ktc-dup a:hover {
            text-decoration: underline !important;
        }

        .ktc-dup a small {
            color: #b45309 !important;
        }

.ktc .ktq-foot {
    align-items: center;
}

/* =====================================================================
   زنگوله اعلان‌ها (در HeaderMain، بیرون از .kt؛ پس متغیرها و ریست خودش را دارد)
   ===================================================================== */
.ktn {
    --kt-p: #4f46e5;
    --kt-text: #1e1b4b;
    --kt-muted: #6b7280;
    --kt-border: #eceef5;
    --kt-soft: #f5f6fc;
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    color: var(--kt-text);
    text-align: right;
    direction: rtl;
}

    .ktn *, .ktn-list * {
        color: inherit;
        text-align: inherit;
        box-sizing: border-box;
    }

    .ktn svg, .ktn-list svg {
        fill: currentColor;
    }

.ktn-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s;
    color: #475f7b !important;
    padding: 0;
}

    .ktn-btn:hover {
        background: rgba(79, 70, 229, .08);
    }

    .ktn-btn svg {
        width: 24px;
        height: 24px;
    }

    .ktn-btn.has svg {
        color: #4f46e5 !important;
        fill: #4f46e5 !important;
    }

    .ktn-btn.shake svg {
        animation: ktnRing 1s ease;
    }

.ktn-count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fb7185, #e11d48);
    color: white !important;
    font-size: .68rem;
    font-weight: 800;
    line-height: 19px;
    text-align: center !important;
    box-shadow: 0 0 0 2px white;
    animation: ktnPulse 2s infinite;
}

.ktn-back {
    position: fixed;
    inset: 0;
    z-index: 1290;
    background: transparent;
}

.ktn-panel {
    position: fixed;
    top: 62px;
    left: 14px;
    width: 400px;
    max-width: calc(100vw - 20px);
    max-height: min(640px, calc(100vh - 80px));
    background: #f8f9fc;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    z-index: 1291;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ktnDrop .22s cubic-bezier(.2, .9, .3, 1.15) both;
    border: 1px solid var(--kt-border);
}

.ktn-head {
    background: linear-gradient(135deg, #312e81, #4f46e5 60%, #7c3aed);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ktn-head-t {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ktn-head-ic {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    display: grid;
    place-items: center;
}

    .ktn-head-ic svg {
        width: 22px;
        height: 22px;
    }

.ktn-h {
    display: block;
    color: white !important;
    font-size: 1.02rem;
    font-weight: 800;
}

.ktn-hs {
    display: block;
    color: #c7d2fe !important;
    font-size: .74rem;
}

.ktn-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: rgba(255, 255, 255, .16);
    border-radius: 10px;
    padding: 6px 10px;
    color: white !important;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: .15s;
}

    .ktn-all span {
        color: white !important;
    }

    .ktn-all svg {
        width: 16px;
        height: 16px;
    }

    .ktn-all:hover {
        background: rgba(255, 255, 255, .28);
    }

.ktn-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 10px 4px;
}

    .ktn-tabs button {
        border: 0;
        background: transparent;
        border-radius: 9px;
        padding: 6px 12px;
        font-size: .8rem;
        font-weight: 700;
        color: #64748b !important;
        cursor: pointer;
        font-family: inherit;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

        .ktn-tabs button.on {
            background: white;
            color: #3730a3 !important;
            box-shadow: 0 2px 8px rgba(79, 70, 229, .14);
        }

        .ktn-tabs button b {
            background: #e11d48;
            color: white !important;
            border-radius: 999px;
            font-size: .66rem;
            padding: 0 6px;
            line-height: 16px;
        }

.ktn-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .ktn-list.big {
        padding: 4px 0 0;
        overflow: visible;
    }

.ktn-day {
    font-size: .7rem;
    font-weight: 800;
    color: #94a3b8 !important;
    padding: 8px 6px 2px;
}

.ktn-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    border: 0;
    background: white;
    border-radius: 14px;
    padding: 10px;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: transform .15s, box-shadow .15s, background .15s;
    animation: ktIn .3s ease both;
    border: 1px solid transparent;
}

    .ktn-item:hover {
        transform: translateX(-3px);
        box-shadow: 0 6px 18px rgba(30, 27, 75, .08);
    }

    .ktn-item.unread {
        background: #f5f3ff;
        border-color: #e0e7ff;
    }

    .ktn-item.big {
        padding: 12px 14px;
    }

.ktn-ic {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

    .ktn-ic .kt-av {
        width: 40px;
        height: 40px;
    }

        .ktn-ic .kt-av b {
            font-size: .9rem;
        }

.ktn-type {
    position: absolute;
    bottom: -3px;
    left: -3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 2px white;
    background: #6366f1;
}

    .ktn-type svg {
        width: 13px;
        height: 13px;
    }

.ktn-ic > .ktn-type:only-child {
    position: static;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    box-shadow: none;
}

    .ktn-ic > .ktn-type:only-child svg {
        width: 22px;
        height: 22px;
    }

.ktn-item.g-mention .ktn-type {
    background: #ec4899;
}

.ktn-item.g-comment .ktn-type {
    background: #8b5cf6;
}

.ktn-item.g-status .ktn-type {
    background: #10b981;
}

.ktn-item.t-reopen .ktn-type {
    background: #f97316;
}

.ktn-item.g-deadline .ktn-type {
    background: #f59e0b;
}

.ktn-item.t-late .ktn-type {
    background: #e11d48;
}

.ktn-item.t-watch .ktn-type {
    background: #0ea5e9;
}

.ktn-item.t-removed .ktn-type {
    background: #64748b;
}

.ktn-txt {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ktn-line {
    font-size: .84rem;
    line-height: 1.6;
    color: #334155 !important;
}

    .ktn-line b {
        color: var(--kt-text) !important;
        font-weight: 800;
    }

.ktn-title {
    font-size: .84rem;
    font-weight: 700;
    color: #3730a3 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ktn-body {
    font-size: .78rem;
    color: var(--kt-muted) !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ktn-time {
    font-size: .7rem;
    color: #94a3b8 !important;
    margin-top: 2px;
}

.ktn-item.big .ktn-title {
    white-space: normal;
}

.ktn-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
    margin-top: 6px;
    box-shadow: 0 0 0 3px #e0e7ff;
}

.ktn-empty {
    text-align: center !important;
    padding: 28px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

    .ktn-empty > span {
        width: 66px;
        height: 66px;
        border-radius: 20px;
        background: linear-gradient(135deg, #a5b4fc, #6366f1);
        display: grid;
        place-items: center;
        animation: ktBounce 2.4s ease-in-out infinite;
    }

    .ktn-empty b {
        font-size: .95rem;
        margin-top: 6px;
    }

    .ktn-empty p {
        font-size: .8rem;
        color: var(--kt-muted) !important;
        margin: 0;
    }

.ktn-skel {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 14px;
}

    .ktn-skel span {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .ktn-skel i {
        flex: 1;
        height: 38px;
        border-radius: 10px;
    }

    .ktn-skel span, .ktn-skel i {
        background: linear-gradient(90deg, #eef0f6 25%, #f8f9fc 50%, #eef0f6 75%);
        background-size: 200% 100%;
        animation: ktShimmer 1.2s infinite;
    }

.ktn-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border-top: 1px solid var(--kt-border);
}

    .ktn-foot a {
        color: #4338ca !important;
        font-weight: 800;
        font-size: .84rem;
        text-decoration: none !important;
    }

        .ktn-foot a:hover {
            text-decoration: underline !important;
        }

.ktn-desk {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1.5px solid var(--kt-border);
    background: var(--kt-soft);
    border-radius: 10px;
    padding: 5px 9px;
    font-size: .74rem;
    font-weight: 700;
    color: #475569 !important;
    cursor: pointer;
    font-family: inherit;
}

    .ktn-desk svg {
        width: 15px;
        height: 15px;
    }

    .ktn-desk.on {
        cursor: default;
        background: #ecfdf5;
        border-color: #a7f3d0;
        color: #047857 !important;
    }

/* صفحه اعلان‌ها */
.ktn-gtabs {
    flex-wrap: wrap;
}

.ktn-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 700;
    margin: 0;
    user-select: none;
}

    .ktn-switch input {
        display: none;
    }

    .ktn-switch i {
        width: 38px;
        height: 22px;
        border-radius: 999px;
        background: #cbd5e1;
        position: relative;
        transition: background .2s;
    }

        .ktn-switch i::after {
            content: "";
            position: absolute;
            top: 3px;
            right: 3px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: white;
            transition: transform .2s;
            box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
        }

    .ktn-switch input:checked + i {
        background: #6366f1;
    }

        .ktn-switch input:checked + i::after {
            transform: translateX(-16px);
        }

@keyframes ktnRing {
    0%, 100% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(18deg);
    }

    30% {
        transform: rotate(-16deg);
    }

    45% {
        transform: rotate(12deg);
    }

    60% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(4deg);
    }
}

@keyframes ktnPulse {
    0%, 100% {
        box-shadow: 0 0 0 2px white, 0 0 0 2px rgba(225, 29, 72, .45);
    }

    50% {
        box-shadow: 0 0 0 2px white, 0 0 0 7px rgba(225, 29, 72, 0);
    }
}

@keyframes ktnDrop {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ktn *, .ktn, .ktn-list * {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 700px) {
    .kt-new-btn {
        width: 100%;
        justify-content: center;
    }

    .ktn-panel {
        left: 8px;
        right: 8px;
        width: auto;
        top: 58px;
        max-height: calc(100vh - 140px);
    }

    .ktc-sug button small {
        max-width: 160px;
    }

    .ktn-switch span {
        display: none;
    }
}

/* =====================================================================
   مرحله ۴ — تقویم (ktcal-)، کادر یادآوری (ktr-)، تنظیمات یادآوری (kts-)
   ===================================================================== */
.ktcal-hero-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ktcal-kpis {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ktcal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    position: relative;
    z-index: 6;
}

.ktcal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .ktcal-nav .kt-ibtn {
        background: var(--kt-soft);
    }

.ktcal-month {
    margin: 0 8px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--kt-text) !important;
    white-space: nowrap;
}

.ktcal-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ktcal-proj {
    min-width: 210px;
}

.ktcal-pickbar {
    position: sticky;
    top: 8px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 14px;
    padding: 10px 14px;
    margin-top: 12px;
    box-shadow: 0 10px 24px rgba(16, 185, 129, .35);
    animation: ktDrop .3s ease both;
}

    .ktcal-pickbar span {
        color: white !important;
        flex: 1;
        font-weight: 700;
        font-size: .9rem;
    }

    .ktcal-pickbar svg {
        fill: white !important;
    }

    .ktcal-pickbar button {
        border: 1.5px solid rgba(255, 255, 255, .55);
        background: rgba(255, 255, 255, .15);
        color: white !important;
        border-radius: 9px;
        padding: 5px 11px;
        cursor: pointer;
        font-family: inherit;
        font-weight: 700;
        font-size: .8rem;
    }

.ktcal-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
    align-items: start;
}

.ktcal-cal {
    padding: 10px;
}

.ktcal-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 6px;
}

    .ktcal-head span {
        text-align: center !important;
        font-size: .78rem;
        font-weight: 800;
        color: var(--kt-muted) !important;
        padding: 4px 0;
    }

        .ktcal-head span:last-child {
            color: var(--kt-red) !important;
        }

.ktcal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.ktcal-day {
    min-height: 122px;
    background: white;
    border: 1.5px solid var(--kt-border);
    border-radius: 14px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s, transform .15s;
    position: relative;
    min-width: 0;
    animation: ktFade .35s ease both;
}

    .ktcal-day:hover {
        border-color: #c7d2fe;
        box-shadow: 0 6px 16px rgba(79, 70, 229, .1);
    }

    .ktcal-day.out {
        background: #fafbff;
    }

        .ktcal-day.out .ktcal-dn b {
            color: #cbd5e1 !important;
        }

    .ktcal-day.off {
        background: #fff8f8;
    }

        .ktcal-day.off .ktcal-dn b {
            color: var(--kt-red) !important;
        }

    .ktcal-day.past:not(.today) {
        background-image: linear-gradient(135deg, rgba(226, 232, 240, .35) 25%, transparent 25%, transparent 50%, rgba(226, 232, 240, .35) 50%, rgba(226, 232, 240, .35) 75%, transparent 75%);
        background-size: 14px 14px;
    }

    .ktcal-day.sel {
        border-color: #a5b4fc;
        background: #f5f7ff;
    }

    .ktcal-day.today {
        border-color: var(--kt-p);
        box-shadow: 0 0 0 3px rgba(79, 70, 229, .16);
    }

        .ktcal-day.today .ktcal-dn b {
            background: linear-gradient(135deg, var(--kt-p), var(--kt-p2));
            color: white !important;
            box-shadow: 0 4px 10px rgba(79, 70, 229, .4);
        }

    .ktcal-day.over {
        border-style: dashed;
        border-color: var(--kt-green);
        background: #ecfdf5;
        transform: scale(1.03);
    }

.ktcal.dragging .ktcal-day:not(.over) {
    border-style: dashed;
}

.ktcal.picking .ktcal-day {
    cursor: copy;
}

    .ktcal.picking .ktcal-day:hover {
        border-color: var(--kt-green);
        background: #ecfdf5;
    }

.ktcal-dn {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

    .ktcal-dn b {
        width: 27px;
        height: 27px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        font-size: .86rem;
        font-weight: 800;
        flex: none;
        text-align: center !important;
    }

    .ktcal-dn small {
        font-size: .68rem;
        color: var(--kt-muted) !important;
        white-space: nowrap;
    }

.ktcal-hol {
    color: var(--kt-red) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
}

.ktcal-cnt {
    display: none;
    font-style: normal;
    font-size: .62rem;
    font-weight: 800;
    background: var(--kt-p);
    color: white !important;
    border-radius: 999px;
    padding: 0 5px;
    line-height: 15px;
}

.ktcal-add {
    margin-inline-start: auto;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 0;
    background: #eef2ff;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, transform .15s;
    padding: 0;
    flex: none;
}

    .ktcal-add svg {
        width: 17px;
        height: 17px;
        fill: var(--kt-p) !important;
    }

.ktcal-day:hover .ktcal-add, .ktcal-day.sel .ktcal-add {
    opacity: 1;
}

.ktcal-add:hover {
    transform: scale(1.12);
    background: #e0e7ff;
}

.ktcal-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ktcal-chip {
    --bar: var(--kt-p);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .74rem;
    font-weight: 600;
    padding: 3px 8px 3px 6px;
    border-radius: 8px 3px 3px 8px;
    background: #eef2ff;
    box-shadow: inset -3px 0 0 var(--bar);
    cursor: grab;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
    transition: transform .12s, box-shadow .12s;
    animation: ktIn .3s ease both;
}

    .ktcal-chip:hover {
        transform: translateY(-1px);
        box-shadow: inset -3px 0 0 var(--bar), 0 4px 10px rgba(30, 27, 75, .12);
    }

    .ktcal-chip:active {
        cursor: grabbing;
    }

    .ktcal-chip.locked {
        cursor: pointer;
    }

    .ktcal-chip.p2 {
        --bar: var(--kt-orange);
    }

    .ktcal-chip.p3 {
        --bar: var(--kt-red);
    }

    .ktcal-chip.late {
        background: #fff1f2;
        color: #9f1239 !important;
    }

    .ktcal-chip.wait {
        background: #fffbeb;
        color: #92400e !important;
    }

    .ktcal-chip.done {
        background: #ecfdf5;
        color: #047857 !important;
        opacity: .8;
    }

        .ktcal-chip.done .ktcal-t {
            text-decoration: line-through;
        }

    .ktcal-chip.rem {
        background: #fef3c7;
        --bar: #f59e0b;
    }

.ktcal-t {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.ktcal-time {
    font-weight: 800;
    font-size: .68rem;
    color: #4338ca !important;
    flex: none;
}

.ktcal-chip.late .ktcal-time {
    color: #be123c !important;
}

.ktcal-ri {
    width: 13px !important;
    height: 13px !important;
    fill: #b45309 !important;
    flex: none;
}

.ktcal-more {
    border: 0;
    background: transparent;
    font-size: .72rem;
    color: var(--kt-p) !important;
    font-weight: 800;
    cursor: pointer;
    padding: 2px 4px;
    font-family: inherit;
    text-align: right !important;
    border-radius: 6px;
}

    .ktcal-more:hover {
        background: #eef2ff;
    }

.ktcal-dots {
    display: none;
}

/* هفته: هر روز ستون بلند با کارت کامل */
.ktcal-cal.week .ktcal-day {
    min-height: 430px;
}

.ktcal-cal.week .ktcal-chip {
    white-space: normal;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 6px 7px;
    border-radius: 10px;
}

.ktcal-cal.week .ktcal-t {
    white-space: normal;
    line-height: 1.5;
    flex-basis: 100%;
    order: 2;
}

.ktcal-cal.week .ktcal-time {
    order: 1;
}

.ktcal-meta {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    order: 3;
    width: 100%;
    margin-top: 2px;
}

    .ktcal-meta small {
        font-size: .66rem;
        color: var(--kt-muted) !important;
    }

.ktcal-pj {
    background: rgba(99, 102, 241, .12);
    border-radius: 6px;
    padding: 0 5px;
    color: #4338ca !important;
}

.ktcal-trunc {
    margin-top: 8px;
    font-size: .78rem;
    background: #fff7ed;
    color: #9a3412 !important;
    border-radius: 10px;
    padding: 7px 10px;
}

.ktcal-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
    font-size: .75rem;
    color: var(--kt-muted) !important;
}

    .ktcal-legend span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .ktcal-legend i {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        display: inline-block;
    }

        .ktcal-legend i.late {
            background: #fda4af;
        }

        .ktcal-legend i.wait {
            background: #fcd34d;
        }

        .ktcal-legend i.done {
            background: #6ee7b7;
        }

        .ktcal-legend i.p3 {
            background: var(--kt-red);
        }

.ktcal-tip {
    margin-inline-start: auto;
}

    .ktcal-tip svg {
        width: 16px;
        height: 16px;
        fill: #a5b4fc !important;
    }

/* ستون کناری */
.ktcal-side {
    position: sticky;
    top: 12px;
}

    .ktcal-side > .kt-card {
        margin-top: 0;
    }

.ktcal-stabs {
    margin-bottom: 10px;
}

    .ktcal-stabs .kt-tab {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

.ktcal-agenda, .ktcal-queue {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 230px);
    overflow: auto;
    padding: 2px;
    border-radius: 12px;
    transition: background .15s, outline-color .15s;
    outline: 2px dashed transparent;
}

    .ktcal-queue.over {
        outline-color: var(--kt-green);
        background: #ecfdf5;
    }

.ktcal-qhelp {
    font-size: .76rem;
    color: var(--kt-muted) !important;
    margin: 0 0 4px;
    line-height: 1.7;
}

.ktcal-ag {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1.5px solid var(--kt-border);
    border-radius: 12px;
    padding: 3px;
    background: white;
    border-right: 4px solid var(--kt-p);
    cursor: grab;
    animation: ktIn .3s ease both;
    transition: box-shadow .15s, transform .15s;
}

    .ktcal-ag:hover {
        box-shadow: 0 6px 16px rgba(30, 27, 75, .1);
        transform: translateY(-1px);
    }

    .ktcal-ag.p2 {
        border-right-color: var(--kt-orange);
    }

    .ktcal-ag.p3 {
        border-right-color: var(--kt-red);
    }

    .ktcal-ag.late {
        background: #fff1f2;
    }

    .ktcal-ag.done {
        opacity: .65;
    }

    .ktcal-ag.locked {
        cursor: default;
    }

.ktcal-ag-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 5px;
    font-family: inherit;
    text-align: right !important;
}

    .ktcal-ag-main b {
        display: block;
        font-size: .85rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ktcal-ag-main small {
        display: block;
        font-size: .72rem;
        color: var(--kt-muted) !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.ktcal-ag-time {
    font-weight: 800;
    font-size: .78rem;
    color: #4338ca !important;
    min-width: 40px;
    text-align: center !important;
    flex: none;
}

.ktcal-mv {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 0;
    background: var(--kt-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: none;
    padding: 0;
}

    .ktcal-mv svg {
        width: 17px;
        height: 17px;
        fill: #6366f1 !important;
    }

span.ktcal-mv {
    cursor: default;
}

    span.ktcal-mv svg {
        fill: #cbd5e1 !important;
    }

.ktcal-ok {
    background: #d1fae5;
    color: #065f46 !important;
}

.ktcal-empty {
    text-align: center !important;
    padding: 22px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

    .ktcal-empty svg {
        width: 42px;
        height: 42px;
        fill: #a5b4fc !important;
        animation: ktBounce 2.4s ease-in-out infinite;
    }

    .ktcal-empty b {
        font-size: .88rem;
        color: var(--kt-muted) !important;
    }

.ktcal-newday {
    justify-content: center;
    margin-top: 4px;
}

@media (max-width: 1100px) {
    .ktcal-wrap {
        grid-template-columns: 1fr;
    }

    .ktcal-side {
        position: static;
    }

    .ktcal-agenda, .ktcal-queue {
        max-height: none;
    }
}

@media (max-width: 700px) {
    .ktcal-bar {
        padding: 8px;
    }

    .ktcal-tools, .ktcal-tools .kt-tabs {
        width: 100%;
    }

        .ktcal-tools .kt-tab {
            flex: 1;
        }

        .ktcal-tools .kt-select, .ktcal-proj {
            width: 100%;
            min-width: 0;
        }

    .ktcal-month {
        font-size: 1rem;
        margin-inline-start: auto;
    }

    .ktcal-cal {
        padding: 6px;
    }

    .ktcal-grid, .ktcal-head {
        gap: 3px;
    }

        .ktcal-head span {
            font-size: .66rem;
        }

    .ktcal-day {
        min-height: 58px;
        padding: 3px;
        border-radius: 10px;
        align-items: center;
        gap: 2px;
    }

    .ktcal-dn {
        flex-direction: column;
        gap: 1px;
    }

        .ktcal-dn b {
            width: 24px;
            height: 24px;
            font-size: .8rem;
        }

        .ktcal-items, .ktcal-add, .ktcal-hol, .ktcal-dn small, .ktcal-legend .ktcal-tip {
            display: none;
        }

    .ktcal-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ktcal-dots {
        display: flex;
        gap: 2px;
        flex-wrap: wrap;
        justify-content: center;
    }

        .ktcal-dots i {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--kt-p);
        }

            .ktcal-dots i.late {
                background: var(--kt-red);
            }

            .ktcal-dots i.wait {
                background: #f59e0b;
            }

            .ktcal-dots i.done {
                background: var(--kt-green);
            }
    /* هفته در موبایل: روزها زیر هم */
    .ktcal-cal.week .ktcal-head {
        display: none;
    }

    .ktcal-cal.week .ktcal-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .ktcal-cal.week .ktcal-day {
        min-height: 0;
        align-items: stretch;
        padding: 8px;
    }

    .ktcal-cal.week .ktcal-dn {
        flex-direction: row;
        gap: 6px;
    }

        .ktcal-cal.week .ktcal-dn small {
            display: inline;
        }

    .ktcal-cal.week .ktcal-items {
        display: flex;
    }

    .ktcal-cal.week .ktcal-dots {
        display: none;
    }

    .ktcal-cal.week .ktcal-add {
        display: grid;
        opacity: 1;
    }
}

/* ---------------- کادر یادآوری در صفحه وظیفه ---------------- */
.ktr-hint {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #ecfdf5;
    border: 1.5px dashed #6ee7b7;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: .8rem;
    color: #065f46 !important;
    text-decoration: none !important;
    margin-bottom: 10px;
    transition: background .15s;
}

    .ktr-hint:hover {
        background: #d1fae5;
    }

    .ktr-hint svg {
        width: 20px;
        height: 20px;
        fill: #059669 !important;
        flex: none;
    }

.ktr-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .ktr-list li {
        display: flex;
        align-items: center;
        gap: 8px;
        background: #fffbeb;
        border: 1px solid #fde68a;
        border-radius: 12px;
        padding: 7px 9px;
        animation: ktIn .3s ease both;
    }

        .ktr-list li.other {
            background: #f5f7ff;
            border-color: #e0e7ff;
        }

        .ktr-list li.fired {
            background: #f8fafc;
            border-color: var(--kt-border);
            opacity: .7;
        }

.ktr-ic {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #f59e0b;
    display: grid;
    place-items: center;
    flex: none;
}

.ktr-list li:not(.fired) .ktr-ic {
    animation: ktWiggle 3s ease-in-out infinite;
}

.ktr-list li.other .ktr-ic {
    background: #6366f1;
}

.ktr-list li.fired .ktr-ic {
    background: #94a3b8;
}

.ktr-ic svg {
    width: 17px;
    height: 17px;
    fill: white !important;
}

.ktr-txt {
    flex: 1;
    min-width: 0;
}

    .ktr-txt b {
        display: block;
        font-size: .85rem;
    }

    .ktr-txt small {
        display: block;
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

    .ktr-txt em {
        display: block;
        font-style: normal;
        font-size: .76rem;
        color: #92400e !important;
        margin-top: 2px;
    }

.ktr-sent {
    color: #059669 !important;
    font-weight: 700;
}

.ktr-x {
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    padding: 0;
    flex: none;
}

    .ktr-x svg {
        width: 16px;
        height: 16px;
        fill: #94a3b8 !important;
    }

    .ktr-x:hover {
        background: #fee2e2;
    }

        .ktr-x:hover svg {
            fill: var(--kt-red) !important;
        }

.ktr-for {
    margin-bottom: 8px;
}

    .ktr-for .kt-tab {
        flex: 1;
    }

.ktr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .ktr-chips button {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        border: 1.5px solid var(--kt-border);
        background: var(--kt-soft);
        border-radius: 999px;
        padding: 5px 11px;
        font-size: .78rem;
        font-weight: 700;
        color: #3730a3 !important;
        cursor: pointer;
        font-family: inherit;
        transition: transform .12s, background .12s, border-color .12s;
    }

        .ktr-chips button svg {
            width: 15px;
            height: 15px;
            fill: #6366f1 !important;
        }

        .ktr-chips button:hover {
            border-color: #c7d2fe;
            background: #eef2ff;
            transform: translateY(-1px);
        }

        .ktr-chips button:active {
            transform: scale(.95);
        }

        .ktr-chips button.on {
            background: var(--kt-p);
            border-color: var(--kt-p);
            color: white !important;
        }

            .ktr-chips button.on svg {
                fill: white !important;
            }

        .ktr-chips button[disabled] {
            opacity: .5;
            cursor: default;
        }

.ktr-custom {
    margin-top: 10px;
    animation: ktDrop .25s ease both;
}

.ktr-skel i {
    display: block;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9);
    background-size: 200% 100%;
    animation: ktShimmer 1.4s infinite;
    margin-bottom: 6px;
}

/* ---------------- صفحه تنظیمات یادآوری ---------------- */
.kts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 14px;
    margin-top: 14px;
    align-items: start;
}

    .kts-grid > .kt-card {
        margin-top: 0;
    }

.kts-bale.linked {
    background: linear-gradient(180deg, #ecfdf5, #ffffff 55%);
    border-color: #a7f3d0;
}

.kts-ok {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    background: #d1fae5;
    color: #065f46 !important;
    border-radius: 999px;
    padding: 3px 10px;
    font-weight: 800;
    font-size: .78rem;
    animation: ktPop .4s ease;
}

    .kts-ok svg {
        width: 16px;
        height: 16px;
        fill: #059669 !important;
    }

.kts-warn {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 10px;
    font-size: .84rem;
    color: #9a3412 !important;
}

    .kts-warn svg {
        width: 20px;
        height: 20px;
        fill: #ea580c !important;
        flex: none;
    }

.kts-linked {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

    .kts-linked b {
        display: block;
        font-size: 1rem;
    }

.kts-big-ic {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    display: grid;
    place-items: center;
    animation: ktBounce 2.4s ease-in-out infinite;
    box-shadow: 0 10px 22px rgba(16, 185, 129, .35);
    flex: none;
}

    .kts-big-ic svg {
        width: 28px;
        height: 28px;
    }

.kts-steps {
    margin: 0 0 12px;
    padding-right: 20px;
    font-size: .86rem;
    line-height: 2;
}

    .kts-steps b {
        color: var(--kt-text) !important;
    }

.kts-code {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    background: #eef2ff;
    border: 2px dashed #a5b4fc;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 6px;
    animation: ktPop .4s ease;
}

.kts-digits {
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: .35em;
    color: #3730a3 !important;
    font-family: Consolas, monospace;
    direction: ltr;
    text-align: center !important;
}

.kts-cmds {
    display: block;
    margin-top: 10px;
}

.kts-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--kt-border);
    cursor: pointer;
    margin: 0;
    transition: opacity .2s;
}

    .kts-row b {
        display: block;
        font-size: .88rem;
    }

    .kts-row small {
        display: block;
        font-size: .75rem;
        color: var(--kt-muted) !important;
    }

    .kts-row.dim {
        opacity: .5;
    }

.kts-sw {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 25px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    cursor: pointer;
    transition: background .2s;
    flex: none;
    margin: 0;
    outline: 0;
}

    .kts-sw::after {
        content: "";
        position: absolute;
        top: 3px;
        right: 3px;
        width: 19px;
        height: 19px;
        border-radius: 50%;
        background: white;
        transition: right .2s;
        box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
    }

    .kts-sw:checked {
        background: var(--kt-green);
    }

        .kts-sw:checked::after {
            right: 22px;
        }

.kts-sms {
    padding: 12px 0 4px;
}

    .kts-sms b {
        display: block;
        font-size: .88rem;
    }

    .kts-sms > small {
        display: block;
        font-size: .75rem;
        color: var(--kt-muted) !important;
        margin: 2px 0 8px;
    }

    .kts-sms .kt-tabs {
        flex-wrap: wrap;
    }

.kts-note {
    display: block;
    margin-top: 10px;
    line-height: 1.8;
}

.kts-log {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .kts-log li {
        display: flex;
        align-items: center;
        gap: 8px;
        border: 1px solid var(--kt-border);
        border-radius: 12px;
        padding: 7px 9px;
        min-width: 0;
        animation: ktIn .3s ease both;
    }

    .kts-log b {
        display: block;
        font-size: .82rem;
    }

    .kts-log small {
        display: block;
        font-size: .72rem;
        color: var(--kt-muted) !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.kts-ch {
    font-size: .7rem;
    font-weight: 800;
    background: #eef2ff;
    color: #3730a3 !important;
    border-radius: 7px;
    padding: 2px 7px;
    flex: none;
}

.kts-st {
    font-size: .72rem;
    font-weight: 700;
    flex: none;
    border-radius: 999px;
    padding: 2px 9px;
    background: #f1f5f9;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kts-log .st0 .kts-st {
    background: #fef3c7;
    color: #92400e !important;
}

.kts-log .st1 .kts-st {
    background: #d1fae5;
    color: #065f46 !important;
}

.kts-log .st2 .kts-st {
    background: #ffe4e6;
    color: #be123c !important;
}

.kts-prog {
    height: 10px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
    margin-bottom: 10px;
}

    .kts-prog i {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, #10b981, #6366f1);
        border-radius: 999px;
        transition: width 1s ease;
    }

.kts-people {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

    .kts-people span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        background: var(--kt-soft);
        border-radius: 999px;
        padding: 3px 4px 3px 10px;
        font-size: .78rem;
    }

@media (max-width: 700px) {
    .kts-grid {
        grid-template-columns: 1fr;
    }

    .kts-digits {
        font-size: 1.7rem;
    }
}

/* ---------- مرحله ۴: دکمه‌های «کارتابل» و «تقویم» در باکس وظایف داشبورد (ktdj-) ---------- */
.ktdj {
    display: flex;
    gap: 6px;
    align-items: center;
}

    .ktdj a {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        height: 32px;
        padding: 0 12px;
        border-radius: 10px;
        font-size: .8em;
        font-weight: 700;
        text-decoration: none !important;
        background: var(--ui-soft, #f1f3f9);
        color: var(--ui-text, #1f2340) !important;
        transition: transform .2s, box-shadow .2s, background .2s;
    }

        .ktdj a .mud-icon-root {
            width: 18px;
            height: 18px;
            fill: var(--ui-muted, #6b7090) !important;
        }

        .ktdj a:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(31,35,64,.12);
        }

        .ktdj a.ktdj-cal {
            background: linear-gradient(135deg, #7c5cff, #5b8cff);
            color: white !important;
        }

            .ktdj a.ktdj-cal .mud-icon-root {
                fill: #ffffff !important;
            }

@media (max-width: 700px) {
    .ktdj {
        order: 2;
        margin-right: auto;
    }

        .ktdj a {
            padding: 0 9px;
        }
}

/* =====================================================================
   مرحله ۵: «امروز چه انجام شد» (ktd-)، گزارش مدیریتی (ktrp-)، دستیارها
   ===================================================================== */
.ktn-item.t-stale .ktn-type {
    background: #a21caf;
}

.ktn-item.t-weekly .ktn-type {
    background: #4f46e5;
}

/* ---------- انجام‌شده‌ها ---------- */
.ktd-hero {
    background: linear-gradient(135deg, #047857 0%, #0f766e 45%, #4338ca 100%);
}

    .ktd-hero .kt-sub {
        color: #d1fae5 !important;
    }

    .ktd-hero .kt-kpi-lbl {
        color: #d1fae5 !important;
    }

.ktd-kpi {
    cursor: default;
}

.ktd-daynav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

    .ktd-daynav .kt-btn-glass span {
        color: white !important;
    }

    .ktd-daynav .kt-btn:disabled {
        opacity: .45;
        cursor: default;
        transform: none;
    }

.ktd-date {
    width: 118px;
    text-align: center !important;
    border: 1.5px solid rgba(255, 255, 255, .35);
    background: rgba(0, 0, 0, .18);
    color: white !important;
    border-radius: 10px;
    padding: 5px 8px;
    font-family: inherit;
    font-weight: 700;
    direction: ltr;
    outline: 0;
}

    .ktd-date::placeholder {
        color: rgba(255, 255, 255, .6) !important;
    }

.ktd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
    align-items: start;
}

.ktd-side {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 76px;
}

.ktd-h {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 800;
}

.ktd-small {
    font-size: .78rem;
}

.ktd-full {
    width: 100%;
}

.ktd-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--kt-muted) !important;
    cursor: pointer;
    margin: 0;
}

    .ktd-toggle input {
        accent-color: #10b981;
        width: 16px;
        height: 16px;
    }

.ktd-line {
    position: relative;
    padding-right: 26px;
}

    .ktd-line::before {
        content: "";
        position: absolute;
        right: 13px;
        top: 6px;
        bottom: 6px;
        width: 3px;
        border-radius: 3px;
        background: linear-gradient(#a7f3d0, #c7d2fe);
    }

.ktd-hour {
    position: relative;
    margin: 14px 0 8px;
}

    .ktd-hour span {
        background: #ecfdf5;
        color: #047857 !important;
        font-size: .74rem;
        font-weight: 800;
        border-radius: 999px;
        padding: 2px 10px;
        border: 1px solid #a7f3d0;
    }

    .ktd-hour:first-child {
        margin-top: 0;
    }

.ktd-ev {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--kt-border);
    background: white;
    margin-bottom: 8px;
    transition: transform .18s, box-shadow .18s;
    animation: ktdIn .45s ease both;
}

    .ktd-ev:hover {
        transform: translateX(-3px);
        box-shadow: 0 6px 18px rgba(30, 27, 75, .08);
    }

.ktd-dot {
    position: absolute;
    right: -27px;
    top: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #10b981;
    box-shadow: 0 0 0 4px white, 0 4px 10px rgba(16, 185, 129, .35);
}

    .ktd-dot svg {
        width: 16px;
        height: 16px;
    }

.ktd-ev.a-approve .ktd-dot {
    background: #7c3aed;
    box-shadow: 0 0 0 4px white, 0 4px 10px rgba(124, 58, 237, .35);
}

.ktd-ev.a-check-done {
    padding: 7px 12px;
    background: #f8fafc;
}

    .ktd-ev.a-check-done .ktd-dot {
        width: 18px;
        height: 18px;
        right: -23px;
        top: 12px;
        background: #14b8a6;
    }

        .ktd-ev.a-check-done .ktd-dot svg {
            width: 12px;
            height: 12px;
        }

.ktd-body {
    flex: 1;
    min-width: 0;
}

.ktd-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: .82rem;
}

.ktd-av {
    width: 24px;
    height: 24px;
}

.ktd-who {
    font-weight: 800;
}

.ktd-verb {
    color: var(--kt-muted) !important;
}

.ktd-time {
    margin-right: auto;
    font-weight: 800;
    color: #047857 !important;
    background: #ecfdf5;
    border-radius: 8px;
    padding: 1px 8px;
    font-size: .78rem;
}

.ktd-title {
    display: block;
    font-weight: 800;
    font-size: .95rem;
    margin-top: 4px;
    color: var(--kt-text) !important;
    text-decoration: none !important;
    overflow-wrap: anywhere;
}

    .ktd-title:hover {
        color: var(--kt-p) !important;
    }

.ktd-ev.a-check-done .ktd-title {
    font-size: .85rem;
    font-weight: 700;
}

.ktd-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    color: #0f766e !important;
    margin-top: 2px;
}

    .ktd-item svg {
        width: 16px;
        height: 16px;
        fill: #14b8a6;
    }

.ktd-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: .72rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 1px 8px;
}

    .ktd-pill svg {
        width: 13px;
        height: 13px;
    }

    .ktd-pill.ok {
        background: #fef3c7;
        color: #92400e !important;
    }

        .ktd-pill.ok svg {
            fill: #d97706;
        }

    .ktd-pill.late {
        background: #ffe4e6;
        color: #be123c !important;
    }

    .ktd-pill.nd {
        background: #f1f5f9;
        color: #475569 !important;
    }

.ktd-skel {
    height: 74px;
    border-radius: 14px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: ktShimmer 1.2s infinite;
}

.ktd-top-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ktd-person {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 1.5px solid transparent;
    background: transparent;
    border-radius: 12px;
    padding: 6px 8px;
    cursor: pointer;
    font-family: inherit;
    transition: .18s;
    animation: ktdIn .4s ease both;
}

    .ktd-person:hover {
        background: var(--kt-soft);
    }

    .ktd-person.on {
        border-color: #10b981;
        background: #ecfdf5;
    }

.ktd-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .75rem;
    font-weight: 800;
    background: #f1f5f9;
    color: #64748b !important;
    flex-shrink: 0;
}

    .ktd-rank.r1 {
        background: linear-gradient(135deg, #fde047, #f59e0b);
        color: white !important;
        box-shadow: 0 3px 8px rgba(245, 158, 11, .45);
    }

    .ktd-rank.r2 {
        background: linear-gradient(135deg, #e2e8f0, #94a3b8);
        color: white !important;
    }

    .ktd-rank.r3 {
        background: linear-gradient(135deg, #fdba74, #c2410c);
        color: white !important;
    }

.ktd-pname {
    display: block;
    font-size: .84rem;
}

.ktd-pbar {
    display: block;
    height: 6px;
    border-radius: 99px;
    background: #eef0f6;
    overflow: hidden;
    margin-top: 4px;
}

    .ktd-pbar i {
        display: block;
        height: 100%;
        border-radius: 99px;
        background: linear-gradient(90deg, #34d399, #6366f1);
        animation: ktdGrow .8s ease both;
    }

.ktd-pnum {
    font-weight: 800;
    font-size: 1rem;
    color: #047857 !important;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

    .ktd-pnum small {
        font-size: .68rem;
        color: var(--kt-muted) !important;
        font-weight: 700;
    }

.ktd-clear {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
}

.ktd-hours {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 100px;
    padding-top: 6px;
}

.ktd-hcol {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    height: 100%;
}

    .ktd-hcol i {
        width: 100%;
        max-width: 18px;
        border-radius: 6px 6px 3px 3px;
        background: linear-gradient(#6ee7b7, #10b981);
        transform-origin: bottom;
        animation: ktdBar .6s ease both;
    }

        .ktd-hcol i.peak {
            background: linear-gradient(#fcd34d, #f59e0b);
        }

    .ktd-hcol small {
        font-size: .62rem;
        color: var(--kt-muted) !important;
    }

@keyframes ktdIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes ktdGrow {
    from {
        width: 0;
    }
}

@keyframes ktdBar {
    from {
        transform: scaleY(0);
    }
}

/* ---------- گزارش مدیریتی ---------- */
.ktrp-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #7c3aed 100%);
}

.ktrp-periods {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.ktrp-per {
    border: 1.5px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08);
    color: #e0e7ff !important;
    border-radius: 999px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: .18s;
}

    .ktrp-per:hover {
        background: rgba(255, 255, 255, .18);
    }

    .ktrp-per.on {
        background: white;
        color: #3730a3 !important;
        border-color: white;
    }

.ktrp-periods .kt-btn-glass span {
    color: white !important;
}

.ktrp-custom {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    animation: ktDrop .25s ease both;
}

    .ktrp-custom input {
        width: 120px;
        border: 1.5px solid rgba(255, 255, 255, .35);
        background: rgba(0, 0, 0, .18);
        color: white !important;
        border-radius: 10px;
        padding: 5px 8px;
        font-family: inherit;
        direction: ltr;
        text-align: center !important;
        outline: 0;
    }

        .ktrp-custom input::placeholder {
            color: rgba(255, 255, 255, .6) !important;
        }

.ktrp-spin {
    border-color: rgba(79, 70, 229, .25);
    border-top-color: #4f46e5;
}

.ktrp-spin-dark {
    border-color: #e0e7ff;
    border-top-color: #4f46e5;
    margin-right: auto;
}

.ktrp-warn {
    color: #fde68a !important;
    font-weight: 700;
}

.ktrp-assist {
    background: linear-gradient(135deg, #fdf4ff, #eef2ff);
    border-color: #e9d5ff;
}

.ktrp-assist-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

    .ktrp-assist-head b {
        display: block;
        font-size: .98rem;
    }

    .ktrp-assist-head small {
        display: block;
        font-size: .74rem;
        color: var(--kt-muted) !important;
    }

.ktrp-assist-ic {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    animation: ktSpark 3s ease-in-out infinite;
}

.ktrp-ins-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 8px;
}

.ktrp-ins {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right !important;
    border: 1px solid var(--kt-border);
    background: white;
    border-radius: 13px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: .85rem;
    line-height: 1.7;
    animation: ktdIn .4s ease both;
    transition: .18s;
}

    .ktrp-ins.go {
        cursor: pointer;
    }

        .ktrp-ins.go:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(30, 27, 75, .08);
        }

    .ktrp-ins:disabled {
        color: inherit;
        cursor: default;
    }

.ktrp-ins-ic {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

    .ktrp-ins-ic svg {
        width: 19px;
        height: 19px;
        fill: white;
    }

.ktrp-ins.l-bad {
    border-right: 4px solid #e11d48;
}

    .ktrp-ins.l-bad .ktrp-ins-ic {
        background: #e11d48;
    }

.ktrp-ins.l-warn {
    border-right: 4px solid #f59e0b;
}

    .ktrp-ins.l-warn .ktrp-ins-ic {
        background: #f59e0b;
    }

.ktrp-ins.l-good {
    border-right: 4px solid #10b981;
}

    .ktrp-ins.l-good .ktrp-ins-ic {
        background: #10b981;
    }

.ktrp-ins.l-info {
    border-right: 4px solid #0ea5e9;
}

    .ktrp-ins.l-info .ktrp-ins-ic {
        background: #0ea5e9;
    }

.ktrp-ins-go {
    fill: #a5b4fc !important;
    flex-shrink: 0;
}

.ktrp-tabsbar {
    margin-bottom: 12px;
}

    .ktrp-tabsbar .kt-tab {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

        .ktrp-tabsbar .kt-tab svg {
            width: 17px;
            height: 17px;
        }

.ktrp-cnt {
    background: #e0e7ff;
    color: #3730a3 !important;
    border-radius: 999px;
    padding: 0 7px;
    font-size: .72rem;
}

.ktrp-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

    .ktrp-filters .kt-search {
        grid-column: span 2;
        min-width: 0;
    }

        .ktrp-filters .kt-search input {
            border: 0;
            outline: 0;
            background: transparent;
            padding: 8px 2px;
            width: 100%;
            font-family: inherit;
            color: var(--kt-text) !important;
        }

.ktrp-tablewrap {
    overflow-x: auto;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
}

.ktrp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .84rem;
}

    .ktrp-table th {
        position: sticky;
        top: 0;
        background: #f8f9ff;
        color: #4338ca !important;
        font-size: .76rem;
        font-weight: 800;
        padding: 10px 8px;
        text-align: center !important;
        white-space: nowrap;
        border-bottom: 1px solid var(--kt-border);
    }

    .ktrp-table td {
        padding: 9px 8px;
        text-align: center !important;
        border-bottom: 1px solid #f1f2f7;
        vertical-align: middle;
    }

    .ktrp-table tbody tr {
        animation: ktdIn .35s ease both;
        transition: background .15s;
    }

        .ktrp-table tbody tr:hover {
            background: #fafaff;
        }

        .ktrp-table tbody tr.idle {
            opacity: .55;
        }

    .ktrp-table .w-name, .ktrp-table .w-title {
        text-align: right !important;
    }

.ktrp-hero .kt-kpis {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.ktrp-pn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.ktrp-table tbody tr td {
    cursor: default;
}

    .ktrp-table tbody tr td.w-name {
        cursor: pointer;
    }

.ktrp-table tfoot td {
    background: #eef2ff;
    font-weight: 800;
    color: #312e81 !important;
    border-top: 2px solid #c7d2fe;
}

.ktrp-av {
    width: 28px;
    height: 28px;
}

.ktrp-n {
    font-weight: 800;
}

    .ktrp-n.bad {
        background: #ffe4e6;
        color: #be123c !important;
        border-radius: 8px;
        padding: 1px 8px;
    }

    .ktrp-n.warn {
        background: #fef3c7;
        color: #92400e !important;
        border-radius: 8px;
        padding: 1px 8px;
    }

    .ktrp-n.stale {
        background: #fae8ff;
        color: #86198f !important;
        border-radius: 8px;
        padding: 1px 8px;
    }

    .ktrp-n.good {
        background: #dcfce7;
        color: #166534 !important;
        border-radius: 8px;
        padding: 1px 8px;
    }

.ktrp-zero {
    color: #cbd5e1 !important;
}

.ktrp-sub {
    display: block;
    font-size: .68rem;
    color: var(--kt-muted) !important;
    margin-top: 2px;
}

.ktrp-pct {
    font-weight: 800;
    border-radius: 8px;
    padding: 1px 8px;
}

    .ktrp-pct.good {
        background: #dcfce7;
        color: #166534 !important;
    }

    .ktrp-pct.mid {
        background: #fef9c3;
        color: #854d0e !important;
    }

    .ktrp-pct.bad {
        background: #ffe4e6;
        color: #be123c !important;
    }

.w-load {
    min-width: 120px;
}

.ktrp-load {
    display: flex;
    height: 9px;
    border-radius: 99px;
    background: #eef0f6;
    overflow: hidden;
}

    .ktrp-load i {
        display: block;
        height: 100%;
        animation: ktdGrow .8s ease both;
    }

        .ktrp-load i.ok {
            background: linear-gradient(90deg, #818cf8, #6366f1);
        }

        .ktrp-load i.late {
            background: linear-gradient(90deg, #fb7185, #e11d48);
        }

.ktrp-note {
    font-size: .75rem;
    color: var(--kt-muted) !important;
    margin-top: 10px;
    line-height: 1.8;
}

.ktrp-tasks .w-title {
    min-width: 260px;
    max-width: 420px;
}

.ktrp-tt {
    font-weight: 800;
    color: var(--kt-text) !important;
    text-decoration: none !important;
    overflow-wrap: anywhere;
}

    .ktrp-tt:hover {
        color: var(--kt-p) !important;
    }

.ktrp-tasks .kt-meta {
    margin-top: 3px;
    font-size: .72rem;
}

.ktrp-from {
    color: var(--kt-muted) !important;
}

.ktrp-ok {
    background: #dcfce7;
    color: #166534 !important;
    border-radius: 999px;
    padding: 1px 8px;
    font-weight: 700;
}

.ktrp-pr {
    border-radius: 999px;
    padding: 1px 8px;
    font-weight: 700;
}

    .ktrp-pr.p2 {
        background: #ffedd5;
        color: #9a3412 !important;
    }

    .ktrp-pr.p3 {
        background: #ffe4e6;
        color: #be123c !important;
    }

.ktrp-who {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    text-align: right !important;
}

.ktrp-nowrap {
    white-space: nowrap;
    font-size: .8rem;
}

.ktrp-dl {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .74rem;
    font-weight: 800;
    white-space: nowrap;
}

    .ktrp-dl.k1 {
        background: #ffe4e6;
        color: #be123c !important;
    }

    .ktrp-dl.k2 {
        background: #ffedd5;
        color: #9a3412 !important;
    }

    .ktrp-dl.k3 {
        background: #dcfce7;
        color: #166534 !important;
    }

    .ktrp-dl.k4 {
        background: #f1f5f9;
        color: #475569 !important;
    }

    .ktrp-dl.k5 {
        background: #e0e7ff;
        color: #3730a3 !important;
    }

    .ktrp-dl.k6, .ktrp-dl.k7 {
        background: #ecfdf5;
        color: #047857 !important;
    }

.ktrp-prog {
    display: block;
    width: 64px;
    height: 6px;
    border-radius: 99px;
    background: #eef0f6;
    overflow: hidden;
    margin: 0 auto;
}

    .ktrp-prog i {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, #34d399, #10b981);
        animation: ktdGrow .8s ease both;
    }

.ktrp-idle {
    color: #a21caf !important;
    font-weight: 800;
}

.ktrp-weekly {
    display: grid;
    grid-template-columns: minmax(0, 420px) 1fr;
    gap: 20px;
    align-items: start;
}

.ktrp-wk-phone {
    background: #e7ebf3;
    border-radius: 22px;
    padding: 0 0 14px;
    overflow: hidden;
    border: 6px solid #1e1b4b;
    box-shadow: 0 16px 36px rgba(30, 27, 75, .25);
}

.ktrp-wk-bar {
    background: #1e1b4b;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .ktrp-wk-bar b {
        color: white !important;
        font-size: .88rem;
    }

.ktrp-wk-msg {
    margin: 14px 14px 0 40px;
    background: white;
    border-radius: 16px 4px 16px 16px;
    padding: 12px 14px;
    white-space: pre-wrap;
    font-size: .85rem;
    line-height: 1.9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
    animation: ktdIn .5s ease both;
}

.ktrp-wk-side h4 {
    margin: 0 0 8px;
    font-weight: 800;
}

.ktrp-wk-side p {
    font-size: .86rem;
    line-height: 1.9;
}

/* ---------- تنظیمات دستیارها (صفحه یادآوری) ---------- */
.kts-assist {
    border-top: 4px solid #ec4899;
}

/* ---------- چاپ: فقط خود گزارش ---------- */
.ktrp-printhead, .ktrp-printkpi {
    display: none;
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .ktrp, .ktrp * {
        visibility: visible !important;
    }

    .ktrp {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        padding: 0 !important;
    }

        .ktrp .kt-hero, .ktrp-assist, .ktrp-tabsbar, .ktrp-filters, .ktrp-noprint, .kt-more {
            display: none !important;
        }

    .ktrp-printhead {
        display: flex !important;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 2px solid #4338ca;
        padding-bottom: 6px;
        margin-bottom: 10px;
        font-size: 12px;
    }

        .ktrp-printhead b {
            font-size: 16px;
            color: #312e81 !important;
        }

    .ktrp-printkpi {
        display: block !important;
        font-size: 12px;
        font-weight: 700;
        margin-bottom: 8px;
    }

    .ktrp .kt-card {
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        animation: none !important;
    }

    .ktrp-tablewrap {
        overflow: visible !important;
        border: 0 !important;
    }

    .ktrp-table {
        font-size: 10.5px;
    }

        .ktrp-table th {
            position: static;
            background: #eef2ff !important;
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

        .ktrp-table tr {
            break-inside: avoid;
            animation: none !important;
            opacity: 1 !important;
        }

        .ktrp-table td, .ktrp-table th {
            border-bottom: 1px solid #ddd !important;
            padding: 4px !important;
        }

        .ktrp-dl, .ktrp-n, .ktrp-pct, .ktrp-load i, .ktrp-prog i, .ktrp-table tfoot td {
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

    @page {
        size: A4 landscape;
        margin: 10mm;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ktd-ev, .ktd-person, .ktd-pbar i, .ktd-hcol i, .ktrp-ins, .ktrp-table tbody tr, .ktrp-load i, .ktrp-prog i, .ktrp-wk-msg {
        animation: none !important;
    }
}

@media (max-width: 1000px) {
    .ktd-grid {
        grid-template-columns: 1fr;
    }

    .ktd-side {
        position: static;
    }

    .ktrp-weekly {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .ktd-daynav .kt-btn span, .ktrp-periods .kt-btn span {
        display: none;
    }

    .ktd-time {
        margin-right: 0;
    }

    .ktrp-filters .kt-search {
        grid-column: span 1;
    }

    .ktrp-ins-list {
        grid-template-columns: 1fr;
    }

    .ktrp-wk-msg {
        margin-left: 14px;
    }
}

.ktrp-tabsbar .kt-tabs {
    overflow-x: auto;
    max-width: 100%;
    flex-wrap: nowrap;
}

.ktrp-tabsbar .kt-tab {
    white-space: nowrap;
}

/* =====================================================================
   مرحله ۶: پروژه‌ها (kpj-) و دستیار «تیکت ← وظیفه» (ktt-)
   (فقط اضافه شده؛ کلاس‌های قبلی دست نخورده‌اند)
   ===================================================================== */

/* ---------- هیرو و کارت‌های بالا ---------- */
.kpj-hero {
    background: linear-gradient(135deg, #134e4a 0%, #0f766e 40%, #4f46e5 100%);
    box-shadow: 0 14px 34px rgba(15, 118, 110, .28);
}

    .kpj-hero .kt-btn-glass .kt-badge {
        margin-inline-start: 2px;
    }

.kpj-kpi-static {
    cursor: default;
}

    .kpj-kpi-static:hover {
        transform: none;
        background: rgba(255, 255, 255, .12);
    }

/* ---------- بنر دستیار «قرارداد تازه» ---------- */
.kpj-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1.5px solid #fde68a;
    animation: ktIn .45s .1s ease both;
}

.kpj-banner-ic {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    animation: ktSpark 3s ease-in-out infinite;
}

.kpj-banner b {
    display: block;
    color: #92400e !important;
    font-size: .92rem;
}

.kpj-banner small {
    color: #a16207 !important;
    font-size: .78rem;
}

.kpj-tools {
    padding: 12px 14px;
}

.kpj-clear {
    color: #4338ca !important;
    cursor: pointer;
    font-weight: 700;
    margin-inline-start: 8px;
    text-decoration: underline;
}

/* ---------- شبکه‌ی کارت‌ها ---------- */
.kpj-ghead {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 22px 4px 0;
    animation: ktIn .4s ease both;
}

    .kpj-ghead span {
        font-weight: 800;
        font-size: 1rem;
        color: #1e1b4b !important;
    }

    .kpj-ghead small {
        color: var(--kt-muted) !important;
        font-size: .78rem;
    }

.kpj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.kpj-card {
    --pc: #4f46e5;
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 16px 16px 12px;
    border: 1px solid var(--kt-border);
    box-shadow: 0 2px 14px rgba(30, 27, 75, .06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    animation: ktIn .45s ease both;
}

    .kpj-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 5px;
        background: var(--pc);
    }

    .kpj-card::after {
        content: "";
        position: absolute;
        width: 160px;
        height: 160px;
        left: -60px;
        top: -80px;
        border-radius: 50%;
        background: var(--pc);
        opacity: .07;
        pointer-events: none;
        transition: transform .4s;
    }

    .kpj-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 34px rgba(30, 27, 75, .13);
        border-color: #dfe3f3;
    }

        .kpj-card:hover::after {
            transform: scale(1.4);
        }

    .kpj-card.warn {
        border-color: #fed7aa;
    }

    .kpj-card.arch {
        opacity: .82;
        filter: saturate(.6);
    }

.kpj-grid .kpj-card:nth-child(2) {
    animation-delay: .03s
}

.kpj-grid .kpj-card:nth-child(3) {
    animation-delay: .06s
}

.kpj-grid .kpj-card:nth-child(4) {
    animation-delay: .09s
}

.kpj-grid .kpj-card:nth-child(5) {
    animation-delay: .12s
}

.kpj-grid .kpj-card:nth-child(6) {
    animation-delay: .15s
}

.kpj-grid .kpj-card:nth-child(n+7) {
    animation-delay: .18s
}

.kpj-hit {
    position: absolute;
    inset: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 1;
    padding: 0;
}

.kpj-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.kpj-ic {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--pc);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .14);
    transition: transform .3s;
}

    .kpj-ic svg {
        width: 22px;
        height: 22px;
        fill: white !important;
    }

.kpj-card:hover .kpj-ic {
    transform: rotate(-8deg) scale(1.06);
}

.kpj-ic.big {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: rgba(255, 255, 255, .2);
    box-shadow: none;
}

    .kpj-ic.big svg {
        width: 28px;
        height: 28px;
    }

.kpj-title {
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.5;
    color: #1e1b4b !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kpj-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 3px;
    font-size: .75rem;
    color: var(--kt-muted) !important;
}

    .kpj-meta span {
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

    .kpj-meta svg {
        width: 14px;
        height: 14px;
        fill: #94a3b8 !important;
    }

.kpj-code {
    background: #f1f5f9;
    color: #475569 !important;
    border-radius: 6px;
    padding: 0 6px;
    font-weight: 700;
    direction: ltr;
    unicode-bidi: isolate;
}

.kpj-st {
    font-size: .7rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
}

    .kpj-st.s1 {
        background: #fef3c7;
        color: #92400e !important;
    }

    .kpj-st.s2 {
        background: #dcfce7;
        color: #166534 !important;
    }

    .kpj-st.s3 {
        background: #f1f5f9;
        color: #64748b !important;
    }

.kpj-me svg {
    width: 20px;
    height: 20px;
}

.kpj-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 24px;
}

.kpj-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff7ed;
    color: #c2410c !important;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: .74rem;
    font-weight: 700;
    animation: ktPop .35s ease;
}

    .kpj-flag svg {
        width: 14px;
        height: 14px;
        fill: #f97316 !important;
    }

    .kpj-flag.more {
        background: #ffedd5;
    }

.kpj-ok {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #047857 !important;
    font-size: .75rem;
    font-weight: 700;
}

    .kpj-ok svg {
        width: 15px;
        height: 15px;
        fill: #10b981 !important;
    }

.kpj-none {
    color: #94a3b8 !important;
    font-size: .75rem;
}

.kpj-bar-l {
    display: flex;
    justify-content: space-between;
    font-size: .76rem;
    color: var(--kt-muted) !important;
    margin-top: 2px;
}

    .kpj-bar-l b {
        color: #1e1b4b !important;
    }

.kpj-bar {
    height: 9px;
    border-radius: 999px;
    background: #eef0f6;
    overflow: hidden;
}

    .kpj-bar i {
        display: block;
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--pc), #10b981);
        animation: kpjGrow 1s .2s cubic-bezier(.2, .8, .2, 1) both;
        transform-origin: right;
    }

    .kpj-bar.sm {
        height: 6px;
    }

        .kpj-bar.sm i {
            background: linear-gradient(90deg, #f59e0b, #ec4899);
        }

.kpj-my {
    margin-top: 4px;
}

.kpj-nums {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: .76rem;
    color: var(--kt-muted) !important;
}

    .kpj-nums b {
        color: #1e1b4b !important;
    }

    .kpj-nums span {
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

    .kpj-nums svg {
        width: 14px;
        height: 14px;
        fill: #94a3b8 !important;
    }

.kpj-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px dashed var(--kt-border);
    padding-top: 9px;
    margin-top: 2px;
    font-size: .74rem;
}

    .kpj-foot .kt-av {
        width: 26px;
        height: 26px;
    }

.kpj-days {
    font-size: .72rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
    background: #eef2ff;
    color: #3730a3 !important;
    white-space: nowrap;
}

    .kpj-days.soon {
        background: #fef3c7;
        color: #92400e !important;
    }

    .kpj-days.late {
        background: #ffe4e6;
        color: #be123c !important;
    }

/* دکمه‌های سریع روی کارت (با هاور؛ در موبایل همیشه) */
.kpj-acts {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 4px;
    z-index: 2;
    opacity: 0;
    transform: translateY(-4px);
    transition: .2s;
}

.kpj-card:hover .kpj-acts, .kpj-card:focus-within .kpj-acts {
    opacity: 1;
    transform: none;
}

.kpj-acts button, .kpj-acts a {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--kt-border);
    background: white;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 27, 75, .1);
    transition: .15s;
}

.kpj-acts svg {
    width: 17px;
    height: 17px;
    fill: #4f46e5 !important;
}

.kpj-acts button:hover, .kpj-acts a:hover {
    background: #eef2ff;
    transform: translateY(-2px);
}

.kpj-skel {
    min-height: 210px;
}

    .kpj-skel i {
        display: block;
        height: 14px;
        border-radius: 7px;
        background: linear-gradient(90deg, #eef0f6 25%, #f8f9fc 50%, #eef0f6 75%);
        background-size: 200% 100%;
        animation: ktShimmer 1.2s infinite;
    }

        .kpj-skel i:nth-child(1) {
            width: 60%;
            height: 20px;
        }

        .kpj-skel i:nth-child(2) {
            width: 90%;
            margin-top: 30px;
        }

        .kpj-skel i:nth-child(3) {
            width: 40%;
        }

.kpj-empty-act {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.kpj-small {
    font-size: .82rem;
}

@keyframes kpjGrow {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* ---------- فرم پروژه و نمای سریع (روی پوسته‌ی ktq) ---------- */
.kpj-fhead {
    background: linear-gradient(135deg, #1e1b4b, var(--pc, #4f46e5)) !important;
    transition: background .3s;
}

.kpj-ftitle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

    .kpj-ftitle .ktc-title {
        margin-top: 0;
    }

.kpj-ptitle {
    margin: 0 !important;
    padding-left: 0 !important;
}

.kpj-pchips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

    .kpj-pchips span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: rgba(255, 255, 255, .16);
        color: white !important;
        border-radius: 999px;
        padding: 3px 10px;
        font-size: .76rem;
    }

    .kpj-pchips svg {
        width: 14px;
        height: 14px;
    }

.kpj-pring {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    background: rgba(0, 0, 0, .16);
    border-radius: 14px;
    padding: 10px 12px;
}

    .kpj-pring > div b {
        display: block;
        color: white !important;
        font-size: .95rem;
    }

    .kpj-pring > div small {
        color: #e0e7ff !important;
        font-size: .76rem;
    }

.kpj-locked, .kpj-cust-on {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdfa;
    border: 1.5px solid #99f6e4;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: .86rem;
    margin-bottom: 6px;
}

    .kpj-locked svg, .kpj-cust-on svg {
        width: 18px;
        height: 18px;
        fill: #0d9488 !important;
    }

.kpj-contracts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    margin: 4px 0 6px;
}

    .kpj-contracts button {
        border: 1.5px solid var(--kt-border);
        background: white;
        border-radius: 12px;
        padding: 7px 10px;
        text-align: right;
        cursor: pointer;
        font-family: inherit;
        display: flex;
        flex-direction: column;
        gap: 1px;
        transition: .15s;
    }

        .kpj-contracts button b {
            font-size: .82rem;
            direction: ltr;
            unicode-bidi: isolate;
        }

        .kpj-contracts button span {
            font-size: .74rem;
            color: var(--kt-muted) !important;
        }

        .kpj-contracts button small {
            font-size: .68rem;
            color: #b45309 !important;
        }

        .kpj-contracts button:hover:not([disabled]) {
            border-color: #5eead4;
        }

        .kpj-contracts button.on {
            border-color: #0d9488;
            background: #f0fdfa;
            box-shadow: 0 0 0 3px #ccfbf1;
        }

        .kpj-contracts button[disabled] {
            opacity: .5;
            cursor: not-allowed;
        }

.kpj-cust .ktp-drop small {
    margin-inline-start: 6px;
}

.kpj-quickend {
    align-items: center;
    margin: 2px 0 0;
}

.kpj-status {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

    .kpj-status button {
        border: 1.5px solid var(--kt-border);
        background: white;
        border-radius: 10px;
        padding: 6px 12px;
        font-family: inherit;
        font-size: .8rem;
        font-weight: 700;
        cursor: pointer;
        color: #475569 !important;
    }

        .kpj-status button.on.s0 {
            background: #4f46e5;
            border-color: #4f46e5;
            color: white !important;
        }

        .kpj-status button.on.s1 {
            background: #f59e0b;
            border-color: #f59e0b;
            color: white !important;
        }

        .kpj-status button.on.s2 {
            background: #10b981;
            border-color: #10b981;
            color: white !important;
        }

        .kpj-status button.on.s3 {
            background: #64748b;
            border-color: #64748b;
            color: white !important;
        }

.kpj-colors, .kpj-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

    .kpj-colors button {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 3px solid white;
        box-shadow: 0 0 0 1.5px var(--kt-border);
        cursor: pointer;
        transition: transform .15s;
    }

        .kpj-colors button:hover {
            transform: scale(1.12);
        }

        .kpj-colors button.on {
            box-shadow: 0 0 0 2.5px #1e1b4b;
            transform: scale(1.1);
        }

.kpj-icons {
    margin-top: 10px;
}

    .kpj-icons button {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        border: 1.5px solid var(--kt-border);
        background: white;
        display: grid;
        place-items: center;
        cursor: pointer;
        transition: .15s;
    }

        .kpj-icons button svg {
            width: 20px;
            height: 20px;
            fill: #64748b !important;
        }

        .kpj-icons button.on {
            background: var(--pc);
            border-color: var(--pc);
        }

            .kpj-icons button.on svg {
                fill: white !important;
            }

.kpj-codef {
    margin-top: 10px;
}

    .kpj-codef input {
        direction: ltr;
    }

.kpj-danger p {
    font-size: .8rem;
    margin: 0 0 8px;
}

.kpj-guard {
    border-color: #fed7aa;
    background: #fffbf5;
}

    .kpj-guard h4 svg {
        color: #f97316 !important;
        fill: #f97316 !important;
    }

    .kpj-guard .kpj-flag {
        margin: 0 0 5px 5px;
    }

.kpj-info b {
    display: block;
}

.kpj-info > div {
    font-size: .8rem;
    color: #78350f !important;
}

.kpj-task {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 10px;
    text-decoration: none !important;
    font-size: .85rem;
    transition: background .15s;
    border-right: 3px solid #0ea5e9;
    margin-bottom: 4px;
    background: var(--kt-soft);
}

    .kpj-task.kt-p2 {
        border-right-color: #f97316;
    }

    .kpj-task.kt-p3 {
        border-right-color: #e11d48;
    }

    .kpj-task:hover {
        background: #eef2ff;
    }

    .kpj-task > svg {
        width: 18px;
        height: 18px;
        fill: #94a3b8 !important;
        flex-shrink: 0;
    }

    .kpj-task.done > svg {
        fill: #10b981 !important;
    }

    .kpj-task.done .kt-grow {
        color: var(--kt-muted) !important;
    }

    .kpj-task small {
        white-space: nowrap;
        font-size: .72rem;
    }

.kpj-contrib {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    font-size: .8rem;
}

    .kpj-contrib .kt-av {
        width: 26px;
        height: 26px;
    }

.kpj-cn {
    width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kpj-cbar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: #eef0f6;
    display: flex;
    overflow: hidden;
}

    .kpj-cbar i {
        display: block;
        height: 100%;
        animation: kpjGrow .8s ease both;
        transform-origin: right;
    }

        .kpj-cbar i.d {
            background: #10b981;
        }

        .kpj-cbar i.o {
            background: #c7d2fe;
        }

.kpj-contrib small {
    color: var(--kt-muted) !important;
    white-space: nowrap;
    font-size: .72rem;
}

.kpj-mem small {
    font-size: .66rem;
    color: var(--kt-muted) !important;
    margin-inline-start: 2px;
}

.kpj-mem.r1 {
    background: #fef3c7 !important;
}

.kpj-log {
    font-size: .8rem;
    padding: 5px 0;
    border-bottom: 1px dashed var(--kt-border);
}

    .kpj-log:last-child {
        border-bottom: 0;
    }

/* ---------- پنجره‌ی «ساخت از قراردادها» ---------- */
.kpj-modal, .ktt {
    --kt-p: #4f46e5;
    --kt-p2: #7c3aed;
    --kt-text: #1e1b4b;
    --kt-muted: #6b7280;
    --kt-border: #eceef5;
    --kt-soft: #f5f6fc;
    --kt-red: #e11d48;
    --kt-green: #10b981;
}

.kpj-modal {
    position: fixed;
    z-index: 1301;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(820px, 96vw);
    max-height: 92vh;
    background: #f8f9fc;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(15, 23, 42, .35);
    animation: kpjModal .3s cubic-bezier(.2, .9, .3, 1.15) both;
    color: #1e1b4b;
    text-align: right;
}

    .kpj-modal * {
        color: inherit;
        text-align: inherit;
        box-sizing: border-box;
    }

    .kpj-modal svg {
        fill: currentColor;
    }

.kpj-mhead {
    background: linear-gradient(135deg, #134e4a, #0f766e 45%, #4f46e5);
    padding: 20px 22px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    position: relative;
}

    .kpj-mhead h3 {
        color: white !important;
        margin: 0 0 4px;
        font-size: 1.15rem;
        font-weight: 800;
        padding-left: 40px;
    }

    .kpj-mhead p {
        color: #ccfbf1 !important;
        margin: 0;
        font-size: .82rem;
        line-height: 1.8;
    }

.kpj-mic {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: rgba(255, 255, 255, .16);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    animation: ktWiggle 4s ease-in-out infinite;
}

.kpj-mbody {
    flex: 1;
    overflow: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kpj-opts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 6px 14px;
    background: white;
    border: 1px solid var(--kt-border, #eceef5);
    border-radius: 14px;
    padding: 10px 12px;
}

    .kpj-opts label {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: .82rem;
        margin: 0;
        cursor: pointer;
    }

    .kpj-opts input, .kpj-prow input {
        width: 17px;
        height: 17px;
        accent-color: #0d9488;
        flex-shrink: 0;
    }

.kpj-psum {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: .82rem;
}

.kpj-warn {
    color: #b45309 !important;
}

.kpj-plist {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kpj-prow {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1.5px solid #eceef5;
    border-radius: 13px;
    padding: 8px 12px;
    cursor: pointer;
    margin: 0;
    transition: .15s;
    animation: ktIn .3s ease both;
}

    .kpj-prow.on {
        border-color: #99f6e4;
    }

    .kpj-prow.off {
        background: #fafafa;
    }

    .kpj-prow:hover {
        border-color: #5eead4;
    }

.kpj-pmain {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .kpj-pmain b {
        font-size: .87rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kpj-pmain small {
        font-size: .72rem;
        color: #6b7280 !important;
    }

.kpj-psrc {
    font-size: .68rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

    .kpj-psrc.s1 {
        background: #ccfbf1;
        color: #115e59 !important;
    }

    .kpj-psrc.s2 {
        background: #e0e7ff;
        color: #3730a3 !important;
    }

    .kpj-psrc.s3 {
        background: #f1f5f9;
        color: #64748b !important;
    }

.kpj-pnums {
    display: flex;
    gap: 8px;
    font-size: .74rem;
    color: #6b7280 !important;
    flex-wrap: wrap;
    justify-content: flex-end;
}

    .kpj-pnums span {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        white-space: nowrap;
    }

    .kpj-pnums svg {
        width: 14px;
        height: 14px;
        fill: #94a3b8 !important;
    }

.kpj-pmgr {
    background: #fef3c7;
    border-radius: 999px;
    padding: 0 7px;
    color: #92400e !important;
}

    .kpj-pmgr svg {
        fill: #f59e0b !important;
    }

.kpj-modal .ktq-foot {
    align-items: center;
}

.kpj-done {
    align-items: center;
    text-align: center !important;
    padding: 30px 20px;
}

    .kpj-done > b {
        font-size: 1.3rem;
        margin-top: 8px;
    }

.kpj-done-nums {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 6px 0;
}

    .kpj-done-nums span {
        background: white;
        border: 1px solid #eceef5;
        border-radius: 14px;
        padding: 10px 16px;
        font-size: .78rem;
        color: #6b7280 !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        animation: ktPop .4s ease both;
    }

    .kpj-done-nums b {
        font-size: 1.35rem;
        color: #0f766e !important;
    }

.kpj-done p {
    max-width: 520px;
    font-size: .82rem;
    text-align: center !important;
}

@keyframes kpjModal {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ---------- دستیار تیکت ← وظیفه (صفحه‌ی تیکت و صفحه‌ی وظیفه) ---------- */
.ktt {
    --pc: #0d9488;
    background: white;
    border: 1.5px solid #ccfbf1;
    border-radius: 18px;
    padding: 12px 14px;
    margin: 12px 0;
    box-shadow: 0 4px 18px rgba(13, 148, 136, .08);
    color: #1e1b4b;
    text-align: right;
    animation: ktIn .4s ease both;
}

    .ktt *, .ktt-box * {
        color: inherit;
        text-align: inherit;
        box-sizing: border-box;
    }

    .ktt svg, .ktt-box svg {
        fill: currentColor;
    }

.ktt-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ktt-ic {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #14b8a6, #4f46e5);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

    .ktt-ic svg {
        width: 22px;
        height: 22px;
    }

.ktt-grow {
    flex: 1;
    min-width: 0;
}

.ktt-head b {
    display: block;
    font-size: .92rem;
}

.ktt-head small {
    color: #6b7280 !important;
    font-size: .76rem;
}

.ktt-btn {
    border: 0;
    border-radius: 11px;
    padding: 9px 14px;
    background: linear-gradient(135deg, #0d9488, #4f46e5);
    color: white !important;
    font-family: inherit;
    font-weight: 700;
    font-size: .84rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(13, 148, 136, .3);
    transition: transform .15s;
}

    .ktt-btn span {
        color: white !important;
    }

    .ktt-btn svg {
        width: 18px;
        height: 18px;
        fill: white !important;
        animation: ktSpark 3s ease-in-out infinite;
    }

    .ktt-btn:hover {
        transform: translateY(-2px);
    }

.ktt-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ktt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 11px;
    background: #f8fafc;
    text-decoration: none !important;
    font-size: .85rem;
    transition: background .15s;
}

    .ktt-row:hover {
        background: #f0fdfa;
    }

.ktt-st {
    width: 18px !important;
    height: 18px !important;
    fill: #94a3b8 !important;
    flex-shrink: 0;
}

.ktt-row.v1 .ktt-st, .ktt-row.v2 .ktt-st {
    fill: #10b981 !important;
}

.ktt-t {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ktt-pill {
    font-size: .7rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
    background: #e0e7ff;
    color: #3730a3 !important;
    white-space: nowrap;
}

    .ktt-pill.v1 {
        background: #fef3c7;
        color: #92400e !important;
    }

    .ktt-pill.v2 {
        background: #dcfce7;
        color: #166534 !important;
    }

.ktt-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: .78rem;
    color: #0f766e !important;
    background: #f0fdfa;
    border-radius: 10px;
    padding: 6px 10px;
}

    .ktt-tip svg {
        width: 16px;
        height: 16px;
        fill: #f59e0b !important;
    }

.ktt-box .ktt-row {
    margin-top: 6px;
}

/* ---------- موبایل ---------- */
@media (max-width: 700px) {
    .kpj-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .kpj-acts {
        opacity: 1;
        transform: none;
        position: static;
        justify-content: flex-end;
        margin-top: -2px;
    }

    .kpj-card {
        padding: 14px 14px 10px;
    }

    .kpj-banner {
        flex-wrap: wrap;
    }

        .kpj-banner .kt-btn {
            width: 100%;
            justify-content: center;
        }

    .kpj-modal {
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100vw;
        max-height: 94vh;
        border-radius: 22px 22px 0 0;
        animation: kpjUp .3s ease both;
    }

    .kpj-prow {
        flex-wrap: wrap;
    }

    .kpj-pnums {
        width: 100%;
        justify-content: flex-start;
        padding-inline-start: 27px;
    }

    .kpj-cn {
        width: 80px;
    }

    .ktt-btn {
        width: 100%;
        justify-content: center;
    }
}

@keyframes kpjUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kpj-modal, .ktt, .ktt *, .kpj-modal * {
        animation: none !important;
        transition: none !important;
    }
}

.kpj-form .kt-form-2 {
    grid-template-columns: 1fr 1fr;
}

/* =====================================================================
   مرحله ۷: خط تولید، زنجیره‌ی چک‌لیست، نوبت‌های من (پیشوند kfl-)
   ===================================================================== */
.kfl-modal, .kfl-strip {
    --kt-p: #4f46e5;
    --kt-p2: #7c3aed;
    --kt-text: #1e1b4b;
    --kt-muted: #6b7280;
    --kt-border: #eceef5;
    --kt-soft: #f5f6fc;
    --kt-red: #e11d48;
    --kt-green: #10b981;
}

.kfl-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #0d9488 100%);
    box-shadow: 0 14px 34px rgba(13, 148, 136, .25);
}

.kfl-hero-turns {
    background: linear-gradient(135deg, #7c2d12 0%, #ea580c 50%, #db2777 100%);
    box-shadow: 0 14px 34px rgba(234, 88, 12, .28);
}

.kfl-hero .kt-kpi {
    text-decoration: none !important;
}

.kfl-no {
    font-style: normal;
    min-width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #eef2ff;
    color: #3730a3 !important;
    font-size: .75rem;
    font-weight: 800;
    display: inline-grid;
    place-items: center;
    padding: 0 4px;
    flex-shrink: 0;
}

/* ---------- کارت خط‌ها ---------- */
.kfl-toolbar {
    margin-top: 14px;
}

.kfl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.kfl-card {
    --c: #4f46e5;
    border-top: 4px solid var(--c);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .18s, box-shadow .18s;
}

    .kfl-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 30px rgba(30, 27, 75, .1);
    }

.kfl-card-top {
    display: flex;
    gap: 10px;
    align-items: center;
}

.kfl-card-ic {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--c);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
}

.kfl-card-title {
    display: block;
    font-size: 1rem;
}

.kfl-card-desc {
    margin: 0;
    font-size: .82rem;
    color: var(--kt-muted) !important;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kfl-card-nums {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

    .kfl-card-nums span {
        background: var(--kt-soft);
        border-radius: 11px;
        padding: 6px 4px;
        text-align: center !important;
        font-size: .7rem;
        color: var(--kt-muted) !important;
        display: flex;
        flex-direction: column;
    }

    .kfl-card-nums b {
        font-size: 1.05rem;
        color: var(--kt-text) !important;
    }

.kfl-card-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px dashed var(--kt-border);
    padding-top: 10px;
    margin-top: auto;
}

/* ---------- ویرایشگر ---------- */
.kfl-ed {
    margin-top: 14px;
    animation: ktIn .35s ease both;
}

.kfl-ed-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--kt-border);
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 6px 20px rgba(30, 27, 75, .08);
}

    .kfl-ed-bar .kt-grow {
        display: flex;
        flex-direction: column;
    }

    .kfl-ed-bar small {
        font-size: .74rem;
    }

.kfl-ed-err {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #be123c !important;
    background: #fff1f2;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: .78rem;
    font-weight: 700;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .kfl-ed-err svg {
        width: 17px;
        height: 17px;
        flex-shrink: 0;
    }

    .kfl-ed-err.big {
        white-space: normal;
        max-width: none;
        padding: 10px 14px;
        font-size: .86rem;
    }

.kfl-ed-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 14px;
    align-items: start;
}

.kfl-ed-side {
    position: sticky;
    top: 72px;
    min-width: 0;
}

.kfl-ed-main {
    min-width: 0;
}

.kfl-ed-side .kt-card:first-child {
    margin-top: 14px;
}

.kfl-head-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kfl-title-in {
    border: 1.5px dashed #c7d2fe;
    border-radius: 12px;
    outline: 0;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: inherit;
    padding: 8px 12px;
    background: #f8faff;
    color: var(--kt-text) !important;
    width: 100%;
}

    .kfl-title-in:focus {
        border-style: solid;
        border-color: #818cf8;
        background: white;
    }

    .kfl-title-in:placeholder-shown {
        border-color: #f59e0b;
    }

.kfl-desc-in, .kfl-task-more textarea, .kfl-object textarea, .kfl-form textarea, .kfl-paste {
    border: 1.5px solid var(--kt-border);
    background: var(--kt-soft);
    border-radius: 12px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: .86rem;
    outline: 0;
    resize: vertical;
    width: 100%;
    color: var(--kt-text) !important;
}

    .kfl-desc-in:focus, .kfl-task-more textarea:focus, .kfl-paste:focus, .kfl-object textarea:focus, .kfl-form textarea:focus {
        border-color: #a5b4fc;
        background: white;
    }

.kfl-head-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

    .kfl-head-row label {
        display: flex;
        flex-direction: column;
        gap: 3px;
        margin: 0;
        font-size: .74rem;
        color: var(--kt-muted) !important;
    }

        .kfl-head-row label > span {
            color: var(--kt-muted) !important;
        }

.kfl-colors {
    display: flex;
    gap: 6px;
    margin-inline-start: auto;
}

    .kfl-colors button {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 3px solid white;
        box-shadow: 0 0 0 1.5px #e5e7eb;
        cursor: pointer;
        transition: .15s;
    }

        .kfl-colors button.on {
            box-shadow: 0 0 0 2.5px #1e1b4b;
            transform: scale(1.12);
        }

.kfl-task {
    padding: 12px;
    transition: box-shadow .2s, border-color .2s, opacity .2s;
}

    .kfl-task.over {
        border-color: #a5b4fc;
        box-shadow: 0 0 0 4px #eef2ff;
    }

    .kfl-task.dragging {
        opacity: .5;
    }

.kfl-task-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kfl-handle {
    cursor: grab;
    color: #cbd5e1 !important;
    display: grid;
    place-items: center;
    padding: 2px;
    border-radius: 6px;
}

    .kfl-handle:hover {
        color: #6366f1 !important;
        background: #eef2ff;
    }

    .kfl-handle svg {
        width: 20px;
        height: 20px;
    }

.kfl-task-no {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white !important;
    font-size: .72rem;
    font-weight: 800;
    border-radius: 8px;
    padding: 4px 9px;
    white-space: nowrap;
}

.kfl-task-in {
    border: 0;
    border-bottom: 1.5px dashed transparent;
    outline: 0;
    font-size: 1rem;
    font-weight: 800;
    font-family: inherit;
    background: transparent;
    padding: 5px 2px;
    color: var(--kt-text) !important;
}

    .kfl-task-in:focus, .kfl-step-in:focus {
        border-bottom-color: #a5b4fc;
    }

.kfl-mini-sel {
    border: 0;
    border-radius: 9px;
    padding: 4px 6px;
    font-family: inherit;
    font-size: .74rem;
    font-weight: 700;
    outline: 0;
    cursor: pointer;
}

    .kfl-mini-sel.p1 {
        background: #e0f2fe;
        color: #075985 !important;
    }

    .kfl-mini-sel.p2 {
        background: #ffedd5;
        color: #c2410c !important;
    }

    .kfl-mini-sel.p3 {
        background: #ffe4e6;
        color: #be123c !important;
    }

.kfl-tools {
    display: inline-flex;
    gap: 2px;
}

    .kfl-tools .kt-ibtn svg {
        width: 18px;
        height: 18px;
    }

.kfl-del:hover {
    color: #e11d48 !important;
    background: #fff1f2 !important;
}

.kfl-task-more {
    display: flex;
    gap: 8px;
    margin: 8px 0 2px;
    align-items: flex-start;
    flex-wrap: wrap;
    animation: ktDrop .2s ease both;
}

    .kfl-task-more textarea {
        flex: 1;
        min-width: 220px;
    }

.kfl-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.kfl-step {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--kt-soft);
    border: 1.5px solid transparent;
    border-radius: 13px;
    padding: 6px 8px;
    transition: .15s;
    animation: ktIn .25s ease both;
}

    .kfl-step:hover {
        border-color: #e0e7ff;
        background: #fafbff;
    }

    .kfl-step.over {
        border-color: #6366f1;
        box-shadow: 0 -3px 0 #6366f1;
    }

    .kfl-step.dragging {
        opacity: .45;
    }

    .kfl-step.picking {
        border-color: #a5b4fc;
        background: white;
    }

.kfl-step-in {
    border: 0;
    border-bottom: 1.5px dashed transparent;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: .88rem;
    padding: 5px 2px;
    min-width: 120px;
    color: var(--kt-text) !important;
}

.kfl-person, .kfl-pre, .kfl-swap {
    border: 1.5px solid var(--kt-border);
    background: white;
    border-radius: 10px;
    padding: 5px 6px;
    font-family: inherit;
    font-size: .78rem;
    outline: 0;
    max-width: 150px;
    cursor: pointer;
    color: var(--kt-text) !important;
}

    .kfl-person.miss {
        border-color: #fca5a5;
        background: #fff1f2;
        color: #be123c !important;
    }

    .kfl-pre.m1 {
        border-color: #99f6e4;
        background: #f0fdfa;
    }

    .kfl-pre.m2 {
        border-color: #c4b5fd;
        background: #f5f3ff;
    }

.kfl-days {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1.5px solid var(--kt-border);
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

    .kfl-days button {
        border: 0;
        background: transparent;
        width: 24px;
        height: 28px;
        cursor: pointer;
        font-size: 1rem;
        font-weight: 800;
        color: #6366f1 !important;
        font-family: inherit;
    }

        .kfl-days button:hover {
            background: #eef2ff;
        }

    .kfl-days b {
        font-size: .76rem;
        min-width: 62px;
        text-align: center !important;
        white-space: nowrap;
    }

.kfl-pick {
    background: white;
    border: 1.5px solid #c4b5fd;
    border-radius: 13px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: ktDrop .2s ease both;
}

.kfl-pick-head {
    display: flex;
    flex-direction: column;
}

    .kfl-pick-head b {
        font-size: .85rem;
    }

    .kfl-pick-head small {
        font-size: .74rem;
    }

.kfl-pick-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px;
    max-height: 240px;
    overflow: auto;
}

    .kfl-pick-list label {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        padding: 5px 7px;
        border-radius: 9px;
        cursor: pointer;
        font-size: .8rem;
    }

        .kfl-pick-list label:hover {
            background: #f5f3ff;
        }

        .kfl-pick-list label.on {
            background: #ede9fe;
        }

        .kfl-pick-list label span {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .kfl-pick-list small {
        color: var(--kt-muted) !important;
        font-size: .7rem;
        white-space: nowrap;
    }

    .kfl-pick-list input {
        accent-color: #7c3aed;
        width: 16px;
        height: 16px;
    }

.kfl-pick .kt-btn {
    align-self: flex-start;
}

.kfl-add-step {
    margin-top: 8px;
    border: 1.5px dashed #c7d2fe;
    background: transparent;
    border-radius: 12px;
    padding: 7px 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: .82rem;
    color: #4f46e5 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: .15s;
}

    .kfl-add-step:hover {
        background: #eef2ff;
    }

    .kfl-add-step svg {
        width: 18px;
        height: 18px;
    }

.kfl-add-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

    .kfl-add-row .kt-btn-ghost {
        flex: 1;
        justify-content: center;
    }

.kfl-import p {
    font-size: .82rem;
    line-height: 2;
    margin: 0 0 8px;
}

.kfl-import code {
    background: #eef2ff;
    color: #4338ca !important;
    border-radius: 6px;
    padding: 1px 6px;
    font-family: inherit;
    direction: ltr;
    display: inline-block;
}

.kfl-paste {
    font-size: .8rem;
    direction: rtl;
    white-space: pre;
}

.kfl-imp-sum {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: .82rem;
}

.kfl-sum {
    background: linear-gradient(135deg, #1e3a8a, #4f46e5 60%, #0d9488);
    border: 0;
}

.kfl-sum-big {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

    .kfl-sum-big span {
        background: rgba(255, 255, 255, .13);
        border-radius: 12px;
        padding: 8px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

        .kfl-sum-big span.hl {
            background: rgba(253, 230, 138, .25);
        }

    .kfl-sum-big b {
        color: white !important;
        font-size: 1.35rem;
        line-height: 1.2;
    }

    .kfl-sum-big small {
        color: #e0e7ff !important;
        font-size: .72rem;
    }

.kfl-sum-end {
    color: #e0e7ff !important;
    font-size: .8rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .kfl-sum-end b {
        color: #fde68a !important;
    }

    .kfl-sum-end svg {
        width: 17px;
        height: 17px;
        fill: #fde68a !important;
    }

.kfl-person-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--kt-border);
}

    .kfl-person-row:last-child {
        border-bottom: 0;
    }

    .kfl-person-row .kt-grow {
        display: flex;
        flex-direction: column;
    }

    .kfl-person-row b {
        font-size: .84rem;
    }

    .kfl-person-row small {
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

.kfl-swap {
    max-width: 130px;
}

/* ---------- نمای زمانی ---------- */
.kfl-tl {
    --lbl: 190px;
    font-size: .78rem;
    overflow-x: auto;
    max-width: 100%;
}

    .kfl-tl.compact {
        --lbl: 132px;
        font-size: .72rem;
    }

.kfl-tl-head, .kfl-tl-row {
    display: flex;
    align-items: center;
    min-width: 360px;
}

.kfl-tl-lbl {
    width: var(--lbl);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-left: 8px;
    min-width: 0;
}

    .kfl-tl-lbl .kt-grow {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .kfl-tl-lbl b {
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kfl-tl-lbl small {
        color: var(--kt-muted) !important;
        font-size: .68rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.kfl-tl-days, .kfl-tl-track {
    position: relative;
    flex: 1;
    min-width: 0;
}

.kfl-tl-days {
    height: 30px;
    border-bottom: 1px solid var(--kt-border);
}

.kfl-tl-day {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 2px;
}

    .kfl-tl-day b {
        font-size: .68rem;
        color: #64748b !important;
        font-weight: 700;
    }

    .kfl-tl-day small {
        font-size: .6rem;
        color: #6366f1 !important;
        white-space: nowrap;
        position: absolute;
        top: 0;
    }

    .kfl-tl-day.sat {
        border-right: 1px solid #c7d2fe;
    }

.kfl-tl-row {
    height: 34px;
}

    .kfl-tl-row:nth-child(odd) .kfl-tl-track {
        background: #fafbff;
    }

.kfl-tl-track {
    height: 100%;
}

.kfl-tl-wk {
    position: absolute;
    top: 0;
    bottom: 0;
    border-right: 1px dashed #e0e7ff;
}

.kfl-tl-bar {
    position: absolute;
    top: 7px;
    height: 20px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(30, 27, 75, .15);
    animation: kflGrow .5s ease both;
    transform-origin: right;
}

    .kfl-tl-bar em {
        font-style: normal;
        color: white !important;
        font-size: .62rem;
        font-weight: 700;
        white-space: nowrap;
        padding: 0 4px;
    }

    .kfl-tl-bar.crit {
        outline: 2.5px solid #e11d48;
        outline-offset: 1px;
    }

.kfl-tl-more {
    color: var(--kt-muted) !important;
    font-size: .74rem;
    padding: 6px 0;
}

.kfl-tl-legend {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: .7rem;
    color: var(--kt-muted) !important;
}

    .kfl-tl-legend span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: var(--kt-muted) !important;
    }

    .kfl-tl-legend i {
        width: 14px;
        height: 10px;
        border-radius: 3px;
        background: #e5e7eb;
        display: inline-block;
    }

        .kfl-tl-legend i.crit {
            outline: 2px solid #e11d48;
        }

@keyframes kflGrow {
    from {
        transform: scaleX(0);
        opacity: .3;
    }

    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* ---------- پنجره‌ی اجرا ---------- */
.kfl-modal {
    width: min(940px, 96vw);
}

.kfl-mhead {
    background: linear-gradient(135deg, #0f172a, #1e3a8a 45%, #0d9488);
}

.kfl-start-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 12px;
}

.kfl-fld {
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
    padding: 12px;
}

    .kfl-fld > span {
        font-size: .78rem;
        font-weight: 800;
        color: #475569 !important;
    }

.kfl-mode {
    align-self: flex-start;
}

.kfl-psearch {
    flex: none;
}

.kfl-plist {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 210px;
    overflow: auto;
}

.kfl-prow {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--kt-border);
    background: white;
    border-radius: 11px;
    padding: 7px 9px;
    cursor: pointer;
    font-family: inherit;
    transition: .15s;
    text-align: right !important;
}

    .kfl-prow:hover {
        border-color: #a5b4fc;
    }

    .kfl-prow.on {
        border-color: #4f46e5;
        background: #eef2ff;
    }

    .kfl-prow svg {
        width: 18px;
        height: 18px;
        color: #6366f1 !important;
        flex-shrink: 0;
    }

    .kfl-prow .kt-grow {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .kfl-prow b {
        font-size: .84rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kfl-prow small {
        font-size: .7rem;
        color: var(--kt-muted) !important;
    }

.kfl-date {
    direction: ltr;
    text-align: center !important;
    max-width: 140px;
}

.kfl-time {
    direction: ltr;
    text-align: center !important;
    max-width: 90px;
}

.kfl-quick-dates {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

    .kfl-quick-dates button {
        border: 1.5px solid var(--kt-border);
        background: var(--kt-soft);
        border-radius: 999px;
        padding: 5px 12px;
        font-family: inherit;
        font-size: .78rem;
        font-weight: 700;
        cursor: pointer;
        color: #475569 !important;
    }

        .kfl-quick-dates button.on {
            background: #4f46e5;
            border-color: #4f46e5;
            color: white !important;
        }

.kfl-swaps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 6px;
}

.kfl-swap-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--kt-border);
    border-radius: 12px;
    padding: 6px 9px;
    transition: .2s;
}

    .kfl-swap-row.changed {
        border-color: #fcd34d;
        background: #fffbeb;
    }

    .kfl-swap-row .kt-grow {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .kfl-swap-row b {
        font-size: .83rem;
    }

    .kfl-swap-row small {
        font-size: .7rem;
        color: var(--kt-muted) !important;
    }

.kfl-load {
    background: #e0f2fe;
    color: #075985 !important;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: .68rem;
    font-weight: 700;
    white-space: nowrap;
}

    .kfl-load.hot {
        background: #ffedd5;
        color: #c2410c !important;
        animation: ktPulse 1.6s infinite;
    }

.kfl-pv-nums {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

    .kfl-pv-nums span {
        background: white;
        border: 1px solid var(--kt-border);
        border-radius: 13px;
        padding: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

        .kfl-pv-nums span.hl {
            background: linear-gradient(135deg, #4f46e5, #0d9488);
            border: 0;
        }

    .kfl-pv-nums b {
        font-size: 1.2rem;
    }

    .kfl-pv-nums small {
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

    .kfl-pv-nums span.hl b, .kfl-pv-nums span.hl small {
        color: white !important;
    }

.kfl-warn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 11px;
    padding: 7px 10px;
    font-size: .8rem;
    color: #92400e !important;
}

    .kfl-warn svg {
        width: 18px;
        height: 18px;
        fill: #f59e0b !important;
        flex-shrink: 0;
    }

.kfl-modal .kfl-tl {
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
    padding: 8px 10px;
}

/* ---------- اجراهای در جریان ---------- */
.kfl-runs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}

.kfl-run {
    --c: #4f46e5;
    border-right: 5px solid var(--c);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.kfl-run-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .kfl-run-top .kt-grow {
        display: flex;
        flex-direction: column;
    }

    .kfl-run-top small {
        font-size: .74rem;
    }

.kfl-ring {
    --p: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), #eef2ff 0);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    position: relative;
}

    .kfl-ring::before {
        content: "";
        position: absolute;
        inset: 6px;
        background: white;
        border-radius: 50%;
    }

    .kfl-ring b {
        position: relative;
        font-size: .74rem;
    }

.kfl-prog {
    height: 7px;
    background: #eef2ff;
    border-radius: 999px;
    overflow: hidden;
}

    .kfl-prog i {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, var(--c), #10b981);
        border-radius: 999px;
        transition: width .6s;
    }

.kfl-run-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.kfl-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--kt-soft);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: .72rem;
    font-weight: 700;
    color: #475569 !important;
}

    .kfl-chip svg {
        width: 14px;
        height: 14px;
    }

    .kfl-chip.late {
        background: #ffe4e6;
        color: #be123c !important;
    }

    .kfl-chip.early {
        background: #dcfce7;
        color: #166534 !important;
    }

.kfl-run-now {
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .kfl-run-now svg {
        width: 17px;
        height: 17px;
        fill: #f59e0b !important;
    }

.kfl-run-people {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.kfl-rp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--kt-soft);
    border-radius: 999px;
    padding: 2px 8px 2px 3px;
}

    .kfl-rp.now {
        background: #fef3c7;
    }

    .kfl-rp small {
        font-size: .7rem;
    }

    .kfl-rp .kt-av {
        width: 24px;
        height: 24px;
        font-size: .7rem;
    }

.kfl-run-foot, .kfl-swapbox {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    border-top: 1px dashed var(--kt-border);
    padding-top: 9px;
}

    .kfl-swapbox span {
        font-size: .8rem;
    }

    .kfl-swapbox .kt-select {
        max-width: 150px;
        padding: 6px 8px;
    }

/* ---------- تعطیلات ---------- */
.kfl-hol {
    margin-top: 14px;
}

.kfl-hol-add {
    margin-bottom: 6px;
}

.kfl-hol-note {
    font-size: .78rem;
    margin: 4px 0 12px;
}

.kfl-hol-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kfl-hol-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 12px;
    padding: 6px 10px;
    animation: ktPop .3s ease;
}

    .kfl-hol-item b {
        font-size: .8rem;
        color: #be123c !important;
        direction: ltr;
    }

    .kfl-hol-item small {
        font-size: .76rem;
    }

    .kfl-hol-item.past {
        opacity: .55;
    }

/* ---------- نوبت‌های من ---------- */
.kfl-turns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kfl-turn {
    --c: #4f46e5;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border: 1.5px solid var(--kt-border);
    border-right: 5px solid var(--c);
    border-radius: 15px;
    padding: 11px 13px;
    background: white;
    animation: ktIn .3s ease both;
    transition: .15s;
}

    .kfl-turn:hover {
        box-shadow: 0 8px 22px rgba(30, 27, 75, .08);
    }

    .kfl-turn.today {
        border-color: #fde68a;
        background: #fffdf5;
    }

    .kfl-turn.late {
        border-color: #fecdd3;
        background: #fff8f9;
    }

.kfl-turn-main {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

    .kfl-turn-main b {
        font-size: .96rem;
    }

    .kfl-turn-main small {
        font-size: .76rem;
        color: var(--kt-muted) !important;
    }

    .kfl-turn-main a {
        color: #4f46e5 !important;
        font-weight: 700;
    }

.kfl-due {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #eef2ff;
    border-radius: 12px;
    padding: 6px 12px;
    font-size: .78rem;
    font-weight: 800;
    color: #3730a3 !important;
    min-width: 130px;
}

    .kfl-due svg {
        width: 16px;
        height: 16px;
    }

    .kfl-due small {
        font-size: .68rem;
        font-weight: 400;
        color: #6366f1 !important;
    }

    .kfl-due.today {
        background: #fef3c7;
        color: #92400e !important;
    }

        .kfl-due.today small {
            color: #b45309 !important;
        }

    .kfl-due.late {
        background: #ffe4e6;
        color: #be123c !important;
        animation: ktPulse 1.8s infinite;
    }

        .kfl-due.late small {
            color: #e11d48 !important;
        }

.kfl-turn-act {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
}

.kfl-object {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    animation: ktDrop .2s ease both;
}

    .kfl-object textarea {
        flex: 1;
    }

.kfl-upcoming {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kfl-up {
    --c: #4f46e5;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 13px;
    background: var(--kt-soft);
    flex-wrap: wrap;
}

    .kfl-up .kt-grow {
        display: flex;
        flex-direction: column;
        min-width: 180px;
    }

        .kfl-up .kt-grow b {
            font-size: .88rem;
        }

        .kfl-up .kt-grow small {
            font-size: .72rem;
            color: var(--kt-muted) !important;
        }

.kfl-up-eta {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: white;
    border: 2px solid var(--c);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .kfl-up-eta b {
        font-size: 1.15rem;
        line-height: 1;
        color: var(--c) !important;
    }

    .kfl-up-eta small {
        font-size: .6rem;
        color: var(--kt-muted) !important;
        white-space: nowrap;
    }

.kfl-before {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

    .kfl-before small {
        font-size: .72rem;
        color: #475569 !important;
    }

.kfl-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

    .kfl-dots i {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: #c7d2fe;
    }

        .kfl-dots i.me {
            width: 13px;
            height: 13px;
            background: #f59e0b;
            box-shadow: 0 0 0 3px #fef3c7;
        }

.kfl-donelist {
    display: flex;
    flex-direction: column;
}

.kfl-donerow {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 2px;
    border-bottom: 1px dashed var(--kt-border);
}

    .kfl-donerow:last-child {
        border-bottom: 0;
    }

    .kfl-donerow .kt-grow {
        display: flex;
        flex-direction: column;
    }

    .kfl-donerow b {
        font-size: .85rem;
    }

    .kfl-donerow small {
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

.kfl-res-ic {
    width: 22px;
    height: 22px;
}

    .kfl-res-ic.early {
        fill: #10b981 !important;
    }

    .kfl-res-ic.ontime {
        fill: #0ea5e9 !important;
    }

    .kfl-res-ic.late {
        fill: #e11d48 !important;
    }

.kfl-res {
    font-size: .72rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
}

    .kfl-res.early {
        background: #dcfce7;
        color: #166534 !important;
    }

    .kfl-res.ontime {
        background: #e0f2fe;
        color: #075985 !important;
    }

    .kfl-res.late {
        background: #ffe4e6;
        color: #be123c !important;
    }

.kfl-pts {
    font-size: .8rem;
    color: #7c3aed !important;
    min-width: 42px;
    text-align: left !important;
}

/* ---------- زنجیره در صفحه‌ی وظیفه ---------- */
.kfl-chain {
    display: flex;
    flex-direction: column;
    position: relative;
}

.kfl-link {
    display: flex;
    gap: 12px;
    position: relative;
    padding-bottom: 14px;
}

    .kfl-link:not(:last-child)::before {
        content: "";
        position: absolute;
        right: 15px;
        top: 32px;
        bottom: 0;
        width: 2.5px;
        background: #e5e7eb;
        border-radius: 2px;
    }

    .kfl-link.st2:not(:last-child)::before {
        background: linear-gradient(#10b981, #a7f3d0);
    }

.kfl-dot {
    font-style: normal;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .78rem;
    font-weight: 800;
    flex-shrink: 0;
    background: #f1f5f9;
    color: #94a3b8 !important;
    border: 2px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

    .kfl-dot svg {
        width: 18px;
        height: 18px;
    }

.kfl-link.st1 .kfl-dot {
    background: #4f46e5;
    color: white !important;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 5px #eef2ff;
    animation: ktPulse 1.8s infinite;
}

.kfl-link.st1.late .kfl-dot {
    background: #e11d48;
    border-color: #fecdd3;
    box-shadow: 0 0 0 5px #fff1f2;
}

.kfl-link.st2 .kfl-dot {
    background: #10b981;
    border-color: #a7f3d0;
}

.kfl-link.st2.late .kfl-dot {
    background: #f43f5e;
    border-color: #fecdd3;
}

.kfl-link.st2.ontime .kfl-dot {
    background: #0ea5e9;
    border-color: #bae6fd;
}

.kfl-link.outside {
    opacity: .62;
}

.kfl-link.mine .kfl-link-main {
    background: #fffbeb;
    border-color: #fde68a;
}

.kfl-link-main {
    flex: 1;
    min-width: 0;
    border: 1.5px solid var(--kt-border);
    border-radius: 13px;
    padding: 8px 11px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kfl-link.st1 .kfl-link-main {
    border-color: #c7d2fe;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .1);
}

.kfl-link-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .kfl-link-top b {
        font-size: .9rem;
    }

.kfl-out {
    font-size: .7rem;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 1px 8px;
    color: #64748b !important;
}

.kfl-obj {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: .7rem;
    color: #c2410c !important;
    background: #ffedd5;
    border-radius: 999px;
    padding: 1px 7px;
}

    .kfl-obj svg {
        width: 13px;
        height: 13px;
        fill: #f97316 !important;
    }

.kfl-link-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    font-size: .76rem;
    color: #475569 !important;
}

    .kfl-link-meta .kt-av {
        width: 22px;
        height: 22px;
        font-size: .65rem;
    }

    .kfl-link-meta span {
        color: #475569 !important;
    }

    .kfl-link-meta .kfl-res.early {
        color: #166534 !important;
    }

    .kfl-link-meta .kfl-res.ontime {
        color: #075985 !important;
    }

    .kfl-link-meta .kfl-res.late {
        color: #be123c !important;
    }

    .kfl-link-meta .kt-red {
        color: #e11d48 !important;
        font-weight: 700;
    }

.kfl-sep {
    color: #cbd5e1 !important;
}

.kfl-link-act {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

    .kfl-link-act:empty {
        display: none;
    }

.kfl-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px dashed var(--kt-border);
    padding-top: 8px;
    animation: ktDrop .2s ease both;
}

/* ---------- نوار کارتابل ---------- */
.kfl-strip {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 15px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 1.5px solid #c7d2fe;
    text-decoration: none !important;
    transition: .18s;
    animation: ktIn .4s ease both;
    color: #1e1b4b;
}

    .kfl-strip * {
        color: inherit;
        text-align: inherit;
    }

    .kfl-strip:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(79, 70, 229, .15);
    }

    .kfl-strip.now {
        background: linear-gradient(135deg, #fffbeb, #fef3c7);
        border-color: #fcd34d;
    }

    .kfl-strip.late {
        background: linear-gradient(135deg, #fff1f2, #ffe4e6);
        border-color: #fda4af;
    }

.kfl-strip-ic {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    animation: ktSpark 3s ease-in-out infinite;
}

    .kfl-strip-ic svg {
        width: 22px;
        height: 22px;
    }

.kfl-strip .kt-grow {
    display: flex;
    flex-direction: column;
}

.kfl-strip b {
    font-size: .9rem;
    color: #1e1b4b !important;
}

.kfl-strip small {
    font-size: .76rem;
    color: #6b7280 !important;
}

.kfl-strip-go {
    display: inline-flex;
    align-items: center;
    font-size: .8rem;
    font-weight: 800;
    color: #4f46e5 !important;
    white-space: nowrap;
}

    .kfl-strip-go svg {
        width: 18px;
        height: 18px;
        fill: #4f46e5 !important;
    }

@media (max-width: 1100px) {
    .kfl-ed-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .kfl-ed-side {
        position: static;
    }
}

@media (max-width: 700px) {
    .kfl-start-grid {
        grid-template-columns: 1fr;
    }

    .kfl-step, .kfl-task-head {
        flex-wrap: wrap;
    }

    .kfl-task-in {
        flex-basis: calc(100% - 110px);
    }

    .kfl-tools {
        margin-inline-start: auto;
    }

    .kfl-step-in {
        flex-basis: calc(100% - 70px);
    }

    .kfl-pv-nums {
        grid-template-columns: repeat(2, 1fr);
    }

    .kfl-swaps {
        grid-template-columns: 1fr;
    }

    .kfl-card-nums {
        grid-template-columns: repeat(2, 1fr);
    }

    .kfl-turn-act {
        flex-direction: row;
        width: 100%;
    }

        .kfl-turn-act .kt-btn-green {
            flex: 1;
            justify-content: center;
        }

    .kfl-ed-bar {
        flex-wrap: wrap;
    }

    .kfl-ed-err {
        order: 9;
        flex-basis: 100%;
        max-width: none;
        white-space: normal;
    }
}

/* ---------- مرحله ۷: دو تب پنجره‌ی اجرا + گانت چارت کامل (kfl-g) ---------- */
.kfl-modal.wide {
    width: min(1320px, 97vw);
}

.kfl-mtabs {
    display: flex;
    gap: 6px;
    padding: 10px 16px 0;
    background: #f8f9fc;
    border-bottom: 1px solid #eceef5;
}

    .kfl-mtabs button {
        border: 0;
        background: transparent;
        font-family: inherit;
        font-weight: 800;
        font-size: .88rem;
        color: #64748b !important;
        padding: 9px 14px 11px;
        border-radius: 12px 12px 0 0;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        position: relative;
        transition: .18s;
    }

        .kfl-mtabs button svg {
            width: 19px;
            height: 19px;
            fill: #94a3b8 !important;
        }

        .kfl-mtabs button small {
            background: #eef2ff;
            color: #4338ca !important;
            border-radius: 999px;
            padding: 1px 8px;
            font-size: .7rem;
        }

        .kfl-mtabs button:hover {
            color: #3730a3 !important;
            background: #eef2ff;
        }

        .kfl-mtabs button.on {
            background: white;
            color: #3730a3 !important;
            box-shadow: 0 -2px 10px rgba(79, 70, 229, .08);
        }

            .kfl-mtabs button.on svg {
                fill: #4f46e5 !important;
            }

            .kfl-mtabs button.on::after {
                content: "";
                position: absolute;
                right: 12px;
                left: 12px;
                bottom: -1px;
                height: 3px;
                border-radius: 3px;
                background: linear-gradient(90deg, #4f46e5, #7c3aed);
            }

.kfl-gopen {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: right;
    padding: 12px 16px;
    border-radius: 15px;
    background: linear-gradient(135deg, #312e81, #4f46e5 55%, #7c3aed);
    box-shadow: 0 8px 22px rgba(79, 70, 229, .3);
    transition: transform .15s;
}

    .kfl-gopen:hover {
        transform: translateY(-2px);
    }

    .kfl-gopen svg {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .kfl-gopen .kt-grow {
        display: flex;
        flex-direction: column;
    }

    .kfl-gopen b {
        color: white !important;
        font-size: .95rem;
    }

    .kfl-gopen small {
        color: #c7d2fe !important;
        font-size: .76rem;
    }

.kfl-g {
    --gl: 250px;
    --kt-text: #1e1b4b;
    --kt-muted: #6b7280;
    --kt-border: #eceef5;
    color: #1e1b4b;
    text-align: right;
    background: white;
    border: 1px solid #eceef5;
    border-radius: 16px;
    overflow: hidden;
}

    .kfl-g * {
        color: inherit;
        text-align: inherit;
        box-sizing: border-box;
    }

    .kfl-g svg {
        fill: currentColor;
    }

.kfl-g-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-bottom: 1px solid #eceef5;
    background: #fafbff;
}

.kfl-g-zoom {
    display: flex;
    background: #eef2ff;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

    .kfl-g-zoom button {
        border: 0;
        background: transparent;
        font-family: inherit;
        font-size: .78rem;
        font-weight: 700;
        color: #4338ca !important;
        padding: 5px 11px;
        border-radius: 8px;
        cursor: pointer;
    }

        .kfl-g-zoom button.on {
            background: white;
            box-shadow: 0 2px 6px rgba(79, 70, 229, .18);
        }

.kfl-g-chk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: .8rem;
    cursor: pointer;
    color: #475569 !important;
}

    .kfl-g-chk input {
        width: 16px;
        height: 16px;
        accent-color: #4f46e5;
    }

.kfl-g-sum {
    font-size: .78rem;
    font-weight: 700;
    color: #4338ca !important;
}

.kfl-g-scroll {
    overflow: auto;
    position: relative;
}

.kfl-g-inner {
    position: relative;
    width: max-content;
    min-width: 100%;
}

.kfl-g-head {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 6;
    background: white;
    border-bottom: 1.5px solid #e0e7ff;
}

.kfl-g-lbl {
    width: var(--gl);
    flex-shrink: 0;
    position: sticky;
    right: 0;
    z-index: 4;
    background: white;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border-left: 1.5px solid #e0e7ff;
    min-width: 0;
    height: 100%;
}

    .kfl-g-lbl .kt-grow {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .kfl-g-lbl b {
        font-size: .8rem;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kfl-g-lbl small {
        font-size: .68rem;
        color: #6b7280 !important;
        display: flex;
        align-items: center;
        gap: 4px;
        overflow: hidden;
        white-space: nowrap;
    }

.kfl-g-corner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    height: auto;
    z-index: 7;
}

    .kfl-g-corner b {
        color: #3730a3 !important;
    }

.kfl-g-pdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.kfl-g-days {
    position: relative;
    height: 50px;
    flex-shrink: 0;
}

.kfl-g-month {
    position: absolute;
    top: 0;
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: .72rem;
    font-weight: 800;
    color: #4f46e5 !important;
    border-right: 1.5px solid #c7d2fe;
    background: #f5f7ff;
    white-space: nowrap;
    overflow: hidden;
}

.kfl-g-day {
    position: absolute;
    top: 22px;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    border-right: 1px solid #f1f3fa;
}

    .kfl-g-day b {
        font-size: .74rem;
        font-weight: 700;
        color: #475569 !important;
    }

    .kfl-g-day small {
        font-size: .6rem;
        color: #94a3b8 !important;
    }

    .kfl-g-day.sat {
        border-right: 1.5px solid #c7d2fe;
    }

        .kfl-g-day.sat b {
            color: #4f46e5 !important;
        }

    .kfl-g-day.today {
        background: #fef3c7;
    }

        .kfl-g-day.today b {
            color: #b45309 !important;
        }

.kfl-g-body {
    position: relative;
}

.kfl-g-grid {
    position: absolute;
    top: 0;
    bottom: 0;
    right: var(--gl);
    pointer-events: none;
}

    .kfl-g-grid i {
        position: absolute;
        top: 0;
        bottom: 0;
        border-right: 1px solid #f3f4fa;
    }

        .kfl-g-grid i.sat {
            border-right: 1.5px solid #e0e7ff;
            background: rgba(238, 242, 255, .35);
        }

.kfl-g-now {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
    z-index: 2;
}

.kfl-g-row {
    display: flex;
    position: relative;
    border-bottom: 1px solid #f3f4fa;
}

    .kfl-g-row .kfl-g-lbl {
        cursor: pointer;
    }

    .kfl-g-row:hover .kfl-g-lbl, .kfl-g-row:hover .kfl-g-track {
        background-color: rgba(238, 242, 255, .45);
    }

    .kfl-g-row.focus .kfl-g-lbl {
        background: #eef2ff;
        box-shadow: inset -4px 0 0 #4f46e5;
    }

    .kfl-g-row.linked .kfl-g-lbl {
        background: #f5f7ff;
    }

    .kfl-g-row.grp .kfl-g-lbl {
        background: #f8f9fc;
        cursor: default;
    }

        .kfl-g-row.grp .kfl-g-lbl svg {
            width: 17px;
            height: 17px;
            fill: #6366f1 !important;
            flex-shrink: 0;
        }

        .kfl-g-row.grp .kfl-g-lbl b {
            font-weight: 800;
            color: #312e81 !important;
            flex: 1;
            min-width: 0;
        }

        .kfl-g-row.grp .kfl-g-lbl small {
            flex-shrink: 0;
        }

    .kfl-g-row.grp .kfl-g-track {
        background: rgba(248, 249, 252, .7);
    }

.kfl-g-track {
    position: relative;
    flex-shrink: 0;
}

.kfl-g-sbar {
    position: absolute;
    top: 12px;
    height: 8px;
    border-radius: 2px;
    background: #312e81;
    opacity: .8;
}

    .kfl-g-sbar::before, .kfl-g-sbar::after {
        content: "";
        position: absolute;
        bottom: -5px;
        border: 5px solid transparent;
        border-top-color: #312e81;
    }

    .kfl-g-sbar::before {
        right: -5px;
    }

    .kfl-g-sbar::after {
        left: -5px;
    }

.kfl-g-bar {
    position: absolute;
    top: 8px;
    height: 22px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 3px 8px rgba(30, 27, 75, .16);
    animation: kflGrow .5s ease both;
    transform-origin: right;
    transition: filter .15s, box-shadow .15s;
}

    .kfl-g-bar:hover {
        filter: brightness(1.08);
        box-shadow: 0 6px 14px rgba(30, 27, 75, .25);
    }

    .kfl-g-bar em {
        font-style: normal;
        color: white !important;
        font-size: .7rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 7px;
    }

    .kfl-g-bar.crit {
        outline: 2.5px solid #e11d48;
        outline-offset: 1.5px;
    }

.kfl-g-row.focus .kfl-g-bar {
    outline: 3px solid #312e81;
    outline-offset: 2px;
}

.kfl-g-out {
    position: absolute;
    top: 11px;
    font-size: .68rem;
    color: #64748b !important;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

.kfl-g-links {
    position: absolute;
    top: 0;
    right: var(--gl);
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

    .kfl-g-links path {
        fill: none !important;
        stroke: #94a3b8;
        stroke-width: 1.4;
    }

        .kfl-g-links path.crit {
            stroke: #e11d48;
            stroke-width: 1.8;
        }

        .kfl-g-links path.hot {
            stroke: #4f46e5;
            stroke-width: 2.4;
        }

        .kfl-g-links path.dim {
            opacity: .18;
        }

.kfl-g-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 10px 12px;
    border-top: 1px solid #eceef5;
    background: #fafbff;
    font-size: .74rem;
}

    .kfl-g-legend span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #475569 !important;
    }

    .kfl-g-legend i {
        width: 16px;
        height: 10px;
        border-radius: 3px;
        display: inline-block;
        background: #e5e7eb;
    }

        .kfl-g-legend i.crit {
            background: white;
            outline: 2px solid #e11d48;
        }

        .kfl-g-legend i.grp {
            background: #312e81;
            height: 6px;
        }

        .kfl-g-legend i.arrow {
            background: none;
            height: 2px;
            border-top: 2px solid #94a3b8;
            border-radius: 0;
        }

@media (max-width: 700px) {
    .kfl-g {
        --gl: 150px;
    }

    .kfl-g-tools {
        gap: 8px;
    }

    .kfl-g-sum {
        width: 100%;
    }

    .kfl-mtabs {
        padding: 8px 10px 0;
    }

        .kfl-mtabs button {
            flex: 1;
            justify-content: center;
            padding: 8px 6px 10px;
            font-size: .82rem;
        }
}

/* کارتابل: متن خوشامد در یک خط، دکمه‌ها در خط زیر (kt-hero-tools) */
.kt-hero-tools {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .kt-hero-tools .kt-scope {
        margin-left: auto;
    }

    .kt-hero-tools .kt-new-btn {
        margin-inline-start: 0;
    }

/* =====================================================================
   مرحله ۷ب: گانت زنده‌ی مدیر (kfl-g … live) و کارنامه‌ی ماهانه (kfk-)
   ===================================================================== */
.kfl-g-bar.live {
    background: #94a3b8;
}

    .kfl-g-bar.live.early {
        background: linear-gradient(135deg, #10b981, #047857);
    }

    .kfl-g-bar.live.ontime {
        background: linear-gradient(135deg, #34d399, #10b981);
    }

    .kfl-g-bar.live.late {
        background: linear-gradient(135deg, #fb7185, #e11d48);
    }

    .kfl-g-bar.live.active {
        background: repeating-linear-gradient(-45deg, #4f46e5 0 8px, #6366f1 8px 16px);
        background-size: 200% 100%;
        animation: kflGrow .5s ease both, kflStripe 1.2s linear infinite;
    }

    .kfl-g-bar.live.overdue {
        background: repeating-linear-gradient(-45deg, #ea580c 0 8px, #f97316 8px 16px);
        background-size: 200% 100%;
        animation: kflGrow .5s ease both, kflStripe 1.2s linear infinite;
    }

    .kfl-g-bar.live.wait {
        background: #e2e8f0;
        box-shadow: none;
        border: 1.5px dashed #94a3b8;
    }

        .kfl-g-bar.live.wait em {
            color: #475569 !important;
        }

    .kfl-g-bar.live.byp {
        border: 0;
    }

        .kfl-g-bar.live.byp.wait {
            opacity: .55;
        }

        .kfl-g-bar.live.byp.late {
            box-shadow: 0 0 0 2px #e11d48;
        }

.kfl-g-plan {
    position: absolute;
    top: 31px;
    height: 4px;
    border-radius: 3px;
    background: #94a3b8;
    opacity: .55;
    z-index: 2;
}

@keyframes kflStripe {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 45px 0;
    }
}

.kfl-g-st {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-style: normal;
    font-size: .68rem;
    font-weight: 800;
    color: white !important;
    background: #cbd5e1;
}

    .kfl-g-st svg {
        width: 14px;
        height: 14px;
    }

    .kfl-g-st.early {
        background: #047857;
    }

    .kfl-g-st.ontime {
        background: #10b981;
    }

    .kfl-g-st.late {
        background: #e11d48;
    }

    .kfl-g-st.active {
        background: #4f46e5;
        box-shadow: 0 0 0 3px #e0e7ff;
    }

    .kfl-g-st.overdue {
        background: #f97316;
        box-shadow: 0 0 0 3px #ffedd5;
        animation: ktPulse 1.6s infinite;
    }

    .kfl-g-st.wait {
        background: white;
        border: 1.5px dashed #94a3b8;
        color: #64748b !important;
    }

.kfl-g-res {
    margin-right: 4px;
    border-radius: 999px;
    padding: 0 6px;
    font-size: .62rem;
    font-weight: 700;
}

    .kfl-g-res.early, .kfl-g-res.ontime {
        background: #d1fae5;
        color: #047857 !important;
    }

    .kfl-g-res.late {
        background: #ffe4e6;
        color: #be123c !important;
    }

    .kfl-g-res.active {
        background: #e0e7ff;
        color: #3730a3 !important;
    }

    .kfl-g-res.overdue {
        background: #ffedd5;
        color: #c2410c !important;
    }

.kfl-g-open {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: #94a3b8 !important;
}

    .kfl-g-open svg {
        width: 15px;
        height: 15px;
    }

    .kfl-g-open:hover {
        background: #eef2ff;
        color: #4f46e5 !important;
    }

.kfl-g-legend i.st {
    border: 0;
}

    .kfl-g-legend i.st.early {
        background: #047857;
    }

    .kfl-g-legend i.st.ontime {
        background: #34d399;
    }

    .kfl-g-legend i.st.late {
        background: #e11d48;
    }

    .kfl-g-legend i.st.active {
        background: repeating-linear-gradient(-45deg, #4f46e5 0 4px, #818cf8 4px 8px);
    }

    .kfl-g-legend i.st.overdue {
        background: repeating-linear-gradient(-45deg, #ea580c 0 4px, #fdba74 4px 8px);
    }

    .kfl-g-legend i.st.wait {
        background: #e2e8f0;
        outline: 1.5px dashed #94a3b8;
    }

.kfl-g-legend i.plan {
    height: 4px;
    background: #94a3b8;
}

/* ---------- صفحه‌ی گانت یک اجرا ---------- */
.kfl-gv {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kfl-gv-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 4px solid var(--c, #4f46e5);
}

    .kfl-gv-head .kt-grow {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .kfl-gv-head b {
        font-size: 1.1rem;
        font-weight: 800;
    }

.kfl-gv-nums {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

    .kfl-gv-nums > span {
        background: white;
        border: 1px solid var(--kt-border);
        border-radius: 14px;
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        gap: 2px;
        animation: ktPop .4s ease both;
    }

    .kfl-gv-nums b {
        font-size: 1.3rem;
        font-weight: 800;
        color: #1e1b4b !important;
    }

    .kfl-gv-nums small {
        font-size: .74rem;
        color: var(--kt-muted) !important;
    }

    .kfl-gv-nums .good b {
        color: #047857 !important;
    }

    .kfl-gv-nums .bad b {
        color: #e11d48 !important;
    }

    .kfl-gv-nums .warn b {
        color: #c2410c !important;
    }

.kfl-gv-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kfl-gv-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .78rem;
    color: var(--kt-muted) !important;
}

    .kfl-gv-bar > span:first-child {
        width: 120px;
        flex-shrink: 0;
    }

    .kfl-gv-bar > div {
        flex: 1;
        height: 10px;
        border-radius: 6px;
        background: #eef0f6;
        overflow: hidden;
    }

        .kfl-gv-bar > div i {
            display: block;
            height: 100%;
            border-radius: 6px;
            background: linear-gradient(90deg, #10b981, #34d399);
            transition: width .6s;
        }

    .kfl-gv-bar.time > div i {
        background: linear-gradient(90deg, #6366f1, #a5b4fc);
    }

    .kfl-gv-bar b {
        width: 44px;
        text-align: left !important;
        color: #1e1b4b !important;
    }

.kfl-gv-warn {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .kfl-gv-warn > div {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        color: #9a3412 !important;
        border-radius: 12px;
        padding: 8px 12px;
        font-size: .82rem;
        line-height: 1.7;
    }

    .kfl-gv-warn svg {
        width: 18px;
        height: 18px;
        fill: #ea580c !important;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .kfl-gv-warn.ok > div {
        background: #ecfdf5;
        border-color: #a7f3d0;
        color: #065f46 !important;
    }

    .kfl-gv-warn.ok svg {
        fill: #059669 !important;
    }

/* ---------- کارنامه‌ی ماهانه (kfk-) ---------- */
.kfk {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kfk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kfk-month {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid var(--kt-border);
    border-radius: 13px;
    padding: 4px;
}

    .kfk-month b {
        min-width: 120px;
        text-align: center !important;
        font-weight: 800;
        color: #3730a3 !important;
    }

    .kfk-month button {
        border: 0;
        background: var(--kt-soft);
        width: 32px;
        height: 32px;
        border-radius: 9px;
        cursor: pointer;
        display: grid;
        place-items: center;
    }

        .kfk-month button:disabled {
            opacity: .35;
            cursor: default;
        }

        .kfk-month button svg {
            width: 20px;
            height: 20px;
            color: #4338ca;
        }

.kfk-note {
    font-size: .78rem;
    color: var(--kt-muted) !important;
}

.kfk-sum {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

    .kfk-sum > span {
        background: white;
        border: 1px solid var(--kt-border);
        border-radius: 14px;
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .kfk-sum b {
        font-size: 1.35rem;
        font-weight: 800;
    }

    .kfk-sum small {
        font-size: .74rem;
        color: var(--kt-muted) !important;
    }

    .kfk-sum .e b {
        color: #047857 !important;
    }

    .kfk-sum .o b {
        color: #10b981 !important;
    }

    .kfk-sum .l b {
        color: #e11d48 !important;
    }

    .kfk-sum .w b {
        color: #c2410c !important;
    }

    .kfk-sum .s b {
        color: #4f46e5 !important;
    }

.kfk-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-items: end;
}

.kfk-pod {
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 18px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center !important;
    position: relative;
    animation: ktPop .45s ease both;
}

    .kfk-pod .kt-av {
        width: 52px;
        height: 52px;
        box-shadow: 0 0 0 3px white, 0 0 0 5px var(--m, #c7d2fe);
    }

        .kfk-pod .kt-av b {
            font-size: 1.1rem;
        }

    .kfk-pod > b {
        font-size: .92rem;
        font-weight: 800;
    }

    .kfk-pod small {
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

    .kfk-pod .kfk-score {
        font-size: 1.5rem;
        font-weight: 900;
        color: var(--m, #4f46e5) !important;
        line-height: 1.1;
    }

.kfk-medal {
    position: absolute;
    top: -12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: .85rem;
    color: white !important;
    background: var(--m);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}

.kfk-pod.r1 {
    --m: #f59e0b;
    padding-top: 22px;
    padding-bottom: 20px;
    background: linear-gradient(180deg, #fffbeb, white);
    border-color: #fde68a;
}

.kfk-pod.r2 {
    --m: #94a3b8;
}

.kfk-pod.r3 {
    --m: #c2410c;
}

.kfk-table {
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 16px;
    overflow: hidden;
}

.kfk-row {
    display: grid;
    grid-template-columns: 44px minmax(160px, 1.6fr) 70px minmax(200px, 2fr) 70px 80px 80px 34px;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid #f1f3fa;
    cursor: pointer;
    transition: background .15s;
}

    .kfk-row:hover {
        background: #fafbff;
    }

    .kfk-row.head {
        cursor: default;
        background: #f8f9fc;
        font-size: .72rem;
        font-weight: 800;
        color: #64748b !important;
    }

        .kfk-row.head:hover {
            background: #f8f9fc;
        }

    .kfk-row.open {
        background: #f5f7ff;
    }

.kfk-rank {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .8rem;
    background: #eef2ff;
    color: #4338ca !important;
}

    .kfk-rank.r1 {
        background: #fef3c7;
        color: #b45309 !important;
    }

    .kfk-rank.r2 {
        background: #f1f5f9;
        color: #475569 !important;
    }

    .kfk-rank.r3 {
        background: #ffedd5;
        color: #c2410c !important;
    }

    .kfk-rank.none {
        background: transparent;
        color: #cbd5e1 !important;
    }

.kfk-who {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .kfk-who .kt-av {
        width: 30px;
        height: 30px;
    }

    .kfk-who b {
        font-size: .86rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.kfk-num {
    font-weight: 800;
    font-size: .95rem;
    text-align: center !important;
}

.kfk-split {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .kfk-split > div {
        display: flex;
        height: 12px;
        border-radius: 6px;
        overflow: hidden;
        background: #eef0f6;
    }

    .kfk-split i {
        display: block;
        height: 100%;
    }

        .kfk-split i.e {
            background: #047857;
        }

        .kfk-split i.o {
            background: #34d399;
        }

        .kfk-split i.l {
            background: #e11d48;
        }

    .kfk-split small {
        font-size: .68rem;
        color: var(--kt-muted) !important;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

        .kfk-split small b {
            font-weight: 800;
        }

        .kfk-split small .e {
            color: #047857 !important;
        }

        .kfk-split small .o {
            color: #059669 !important;
        }

        .kfk-split small .l {
            color: #e11d48 !important;
        }

.kfk-pct {
    text-align: center !important;
    font-weight: 800;
    font-size: .86rem;
}

.kfk-score {
    text-align: center !important;
    font-weight: 900;
    font-size: 1.05rem;
    color: #4f46e5 !important;
}

    .kfk-score.hi {
        color: #047857 !important;
    }

    .kfk-score.lo {
        color: #e11d48 !important;
    }

.kfk-late {
    text-align: center !important;
}

    .kfk-late span {
        background: #ffedd5;
        color: #c2410c !important;
        border-radius: 999px;
        padding: 2px 9px;
        font-size: .74rem;
        font-weight: 800;
    }

.kfk-chev svg {
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transition: transform .2s;
}

.kfk-row.open .kfk-chev svg {
    transform: rotate(180deg);
}

.kfk-items {
    background: #fafbff;
    border-bottom: 1px solid #eceef5;
    padding: 8px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: ktDrop .25s ease both;
}

.kfk-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #eceef5;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: .8rem;
}

    .kfk-item .kt-grow {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

        .kfk-item .kt-grow b {
            font-weight: 700;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .kfk-item .kt-grow small {
            color: var(--kt-muted) !important;
            font-size: .7rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .kfk-item .kfk-when {
        font-size: .72rem;
        color: #64748b !important;
        white-space: nowrap;
    }

.kfk-res {
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

    .kfk-res.e {
        background: #d1fae5;
        color: #047857 !important;
    }

    .kfk-res.o {
        background: #ecfdf5;
        color: #059669 !important;
    }

    .kfk-res.l {
        background: #ffe4e6;
        color: #be123c !important;
    }

    .kfk-res.w {
        background: #ffedd5;
        color: #c2410c !important;
    }

.kfk-pts {
    font-weight: 900;
    color: #4f46e5 !important;
    width: 38px;
    text-align: center !important;
}

.kfk-item a {
    color: #4f46e5 !important;
    display: grid;
    place-items: center;
}

    .kfk-item a svg {
        width: 17px;
        height: 17px;
    }

.kfk-help {
    font-size: .76rem;
    color: var(--kt-muted) !important;
    line-height: 1.9;
    background: white;
    border: 1px dashed #c7d2fe;
    border-radius: 14px;
    padding: 10px 14px;
}

    .kfk-help b {
        color: #3730a3 !important;
    }

@media (max-width: 900px) {
    .kfk-row {
        grid-template-columns: 36px minmax(0, 1fr) 54px 64px 28px;
    }

        .kfk-row > .kfk-split, .kfk-row > .kfk-pct, .kfk-row > .kfk-late {
            display: none;
        }

        .kfk-row.head > span:nth-child(4), .kfk-row.head > span:nth-child(5), .kfk-row.head > span:nth-child(6) {
            display: none;
        }

    .kfk-podium {
        gap: 8px;
    }

    .kfk-pod {
        padding: 12px 6px;
    }

        .kfk-pod .kt-av {
            width: 40px;
            height: 40px;
        }

    .kfk-item {
        flex-wrap: wrap;
    }

        .kfk-item .kt-grow {
            flex-basis: 100%;
        }

    .kfl-gv-bar > span:first-child {
        width: 90px;
    }

    .kfl-g-open {
        display: none;
    }
}
/* ================================================================
   مرحله ۸: صفحه‌ی داخل پروژه و بورد (پیشوند kpb-)
   این بخش را به آخر tm-ui.css اضافه کن (فقط یک بار).
   ================================================================ */

/* ---------- هیرو با رنگ پروژه ---------- */
.kpb-hero {
    background: linear-gradient(125deg, #1e1b4b 0%, var(--pc, #4f46e5) 115%);
}

    .kpb-hero .kt-hero-top {
        align-items: center;
    }

.kpb-back {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .14);
    border: 1.5px solid rgba(255, 255, 255, .25);
    flex-shrink: 0;
    transition: .18s;
}

    .kpb-back:hover {
        background: rgba(255, 255, 255, .26);
    }

.kpb-hic {
    background: var(--pc, #4f46e5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}

.kpb-hero .kt-title {
    color: white !important;
}

.kpb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

    .kpb-chips span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: rgba(255, 255, 255, .14);
        color: white !important;
        border-radius: 999px;
        padding: 3px 10px;
        font-size: .74rem;
        font-weight: 600;
    }

        .kpb-chips span .mud-icon-root {
            width: 15px;
            height: 15px;
        }

        .kpb-chips span.st.s0 {
            background: rgba(16, 185, 129, .35);
        }

        .kpb-chips span.st.s1 {
            background: rgba(245, 158, 11, .4);
        }

        .kpb-chips span.st.s3 {
            background: rgba(225, 29, 72, .4);
        }

        .kpb-chips span.late {
            background: rgba(225, 29, 72, .55);
        }

.kpb-ring {
    background: conic-gradient(#fde68a calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0);
}

.kpb-tabs button .mud-icon-root {
    width: 17px;
    height: 17px;
}

.kpb-hero .kt-kpi-val small {
    font-size: .7em;
    opacity: .7;
    color: inherit !important;
}

/* ---------- نمای کلی ---------- */
.kpb-ov {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

    .kpb-ov > div > .kt-card:first-child {
        margin-top: 14px;
    }

.kpb h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .95rem;
    font-weight: 800;
    margin: 0 0 10px;
    color: #1e1b4b !important;
}

    .kpb h3 .mud-icon-root {
        width: 19px;
        height: 19px;
        fill: #6366f1;
    }

    .kpb h3 small {
        font-weight: 600;
        font-size: .75rem;
    }

.kpb-more-l {
    margin-inline-start: auto;
    font-size: .78rem;
    color: #4f46e5 !important;
    cursor: pointer;
    font-weight: 700;
}

.kpb-guard {
    border-inline-start: 4px solid #f59e0b;
}

    .kpb-guard.ok {
        border-inline-start-color: #10b981;
    }

        .kpb-guard.ok h3 .mud-icon-root {
            fill: #10b981;
        }

.kpb-flag {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
    margin-top: 6px;
    font-size: .85rem;
    line-height: 1.6;
}

    .kpb-flag .mud-icon-root {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        margin-top: 2px;
        fill: #6366f1;
    }

    .kpb-flag.w {
        background: #fff7ed;
    }

        .kpb-flag.w .mud-icon-root {
            fill: #ea580c;
        }

.kpb-chart {
    padding-bottom: 10px;
}

.kpb-legend {
    display: flex;
    gap: 14px;
    font-size: .75rem;
    color: #475569 !important;
    margin: -4px 0 6px;
}

    .kpb-legend span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    .kpb-legend i {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        display: inline-block;
    }

        .kpb-legend i.c, .kpb-wbars .c {
            background: #818cf8;
        }

        .kpb-legend i.d, .kpb-wbars .d {
            background: #10b981;
        }

.kpb-bars {
    display: flex;
    gap: 6px;
    height: 170px;
    align-items: stretch;
    border-bottom: 1px solid #e2e8f0;
    padding-top: 16px;
}

.kpb-wk {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    cursor: default;
    border-radius: 8px;
    transition: background .15s;
}

    .kpb-wk:hover {
        background: #f1f5f9;
    }

.kpb-wbars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

    .kpb-wbars span {
        width: 38%;
        max-width: 18px;
        border-radius: 4px 4px 0 0;
        position: relative;
        min-height: 0;
        transition: height .5s ease;
    }

        .kpb-wbars span b {
            position: absolute;
            top: -16px;
            left: 50%;
            transform: translateX(-50%);
            font-size: .66rem;
            color: #334155 !important;
            font-weight: 700;
        }

.kpb-wk small {
    text-align: center;
    font-size: .66rem;
    color: #64748b !important;
    padding: 4px 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpb-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

    .kpb-stats .kt-card {
        margin-top: 14px;
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 12px;
    }

    .kpb-stats b {
        font-size: 1.2rem;
        font-weight: 800;
        color: #1e1b4b !important;
    }

    .kpb-stats span {
        font-size: .74rem;
        color: #64748b !important;
    }

.kpb-mini {
    display: block;
    height: 5px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 4px;
}

    .kpb-mini i {
        display: block;
        height: 100%;
        background: #6366f1;
        border-radius: 3px;
    }

.kpb-desc {
    font-size: .87rem;
    line-height: 1.8;
}

.kpb-team {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpb-mem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 10px;
    background: #f8fafc;
    font-size: .84rem;
    font-weight: 600;
}

    .kpb-mem .kt-av {
        width: 30px;
        height: 30px;
    }

    .kpb-mem > span {
        display: flex;
        flex-direction: column;
        line-height: 1.4;
    }

    .kpb-mem small {
        font-size: .7rem;
        font-weight: 500;
        color: #64748b !important;
    }

    .kpb-mem.r1 {
        background: #fef3c7;
    }

.kpb-small {
    font-size: .76rem;
    margin-top: 10px;
}

/* ---------- بورد ---------- */
.kpb-btools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.kpb-filter .kt-tab small {
    font-size: .7rem;
    opacity: .7;
    margin-inline-start: 3px;
    color: inherit !important;
}

.kpb-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .75rem;
}

    .kpb-hint .mud-icon-root {
        width: 15px;
        height: 15px;
    }

.kpb-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 12px 2px 14px;
    align-items: flex-start;
    scroll-snap-type: x proximity;
    min-height: 420px;
}

    .kpb-board::-webkit-scrollbar {
        height: 10px;
    }

    .kpb-board::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 5px;
    }

.kpb-col {
    flex: 0 0 280px;
    background: #f1f5f9;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-snap-align: start;
    border: 2px solid transparent;
    transition: border-color .15s, background .15s;
    max-height: calc(100vh - 210px);
}

    .kpb-col.over {
        border-color: var(--lc, #6366f1);
        background: #eef2ff;
    }

    .kpb-col.done {
        background: #ecfdf5;
    }

        .kpb-col.done.over {
            background: #d1fae5;
        }

.kpb-lhead {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
}

    .kpb-lhead b {
        font-size: .9rem;
        font-weight: 800;
        color: #1e293b !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.kpb-lic {
    width: 18px !important;
    height: 18px !important;
    fill: #10b981;
}

.kpb-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lc, #64748b);
    display: inline-block;
    flex-shrink: 0;
}

.kpb-count {
    background: white;
    border-radius: 999px;
    padding: 1px 9px;
    font-size: .74rem;
    font-weight: 700;
    color: #475569 !important;
}

.kpb-ibtn {
    border: 0;
    background: transparent;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

    .kpb-ibtn:hover {
        background: rgba(15, 23, 42, .07);
    }

    .kpb-ibtn .mud-icon-root {
        width: 18px;
        height: 18px;
        fill: #64748b;
    }

.kpb-lmenu {
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    display: flex;
    flex-direction: column;
}

    .kpb-lmenu button {
        border: 0;
        background: transparent;
        text-align: start;
        padding: 7px 8px;
        border-radius: 8px;
        font-family: inherit;
        font-size: .82rem;
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        color: #334155 !important;
    }

        .kpb-lmenu button:hover:not(:disabled) {
            background: #f1f5f9;
        }

        .kpb-lmenu button:disabled {
            opacity: .4;
            cursor: default;
        }

        .kpb-lmenu button .mud-icon-root {
            width: 17px;
            height: 17px;
            fill: #64748b;
        }

        .kpb-lmenu button.red {
            color: #be123c !important;
        }

            .kpb-lmenu button.red .mud-icon-root {
                fill: #be123c;
            }

.kpb-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 30px;
    padding: 2px;
}

.kpb-drop-hint {
    border: 2px dashed #6ee7b7;
    border-radius: 12px;
    padding: 18px 10px;
    text-align: center;
    font-size: .8rem;
    color: #047857 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

    .kpb-drop-hint .mud-icon-root {
        fill: #10b981;
    }

.kpb-card {
    background: white;
    border-radius: 12px;
    padding: 9px 10px 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    border-inline-start: 4px solid #cbd5e1;
    cursor: grab;
    transition: box-shadow .15s, transform .15s, opacity .15s;
    position: relative;
}

    .kpb-card[draggable="false"] {
        cursor: default;
    }

    .kpb-card:hover {
        box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
    }

    .kpb-card.kt-p1 {
        border-inline-start-color: #0ea5e9;
    }

    .kpb-card.kt-p2 {
        border-inline-start-color: #f97316;
    }

    .kpb-card.kt-p3 {
        border-inline-start-color: #e11d48;
    }

    .kpb-card.dragging {
        opacity: .4;
        transform: rotate(2deg);
    }

    .kpb-card.before::before {
        content: "";
        position: absolute;
        top: -7px;
        left: 4px;
        right: 4px;
        height: 4px;
        background: var(--lc, #6366f1);
        border-radius: 2px;
    }

    .kpb-card.isdone .kpb-ctitle {
        text-decoration: line-through;
        color: #64748b !important;
    }

.kpb-ghost {
    height: 4px;
    background: var(--lc, #6366f1);
    border-radius: 2px;
    margin: 0 4px;
}

.kpb-ctop {
    display: flex;
    gap: 4px;
    align-items: flex-start;
}

.kpb-ctitle {
    flex: 1;
    font-size: .86rem;
    font-weight: 700;
    color: #1e293b !important;
    line-height: 1.6;
    text-decoration: none;
    word-break: break-word;
}

    .kpb-ctitle:hover {
        color: #4f46e5 !important;
    }

.kpb-ctop .kpb-ibtn {
    width: 24px;
    height: 24px;
    margin-top: -2px;
    opacity: .55;
}

.kpb-card:hover .kpb-ctop .kpb-ibtn {
    opacity: 1;
}

.kpb-prog {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 6px 0 2px;
    overflow: hidden;
}

    .kpb-prog i {
        display: block;
        height: 100%;
        background: #6366f1;
        border-radius: 2px;
    }

.kpb-cmeta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
    font-size: .72rem;
    color: #64748b !important;
}

    .kpb-cmeta > span:not(.kt-av) {
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

    .kpb-cmeta .mud-icon-root {
        width: 14px;
        height: 14px;
        fill: #94a3b8;
    }

    .kpb-cmeta .kt-av {
        width: 24px;
        height: 24px;
        font-size: .68rem;
    }

.kpb-more {
    font-size: .68rem;
    color: #64748b !important;
    margin-inline-start: -4px;
}

.kpb-due {
    border-radius: 6px;
    padding: 1px 6px;
    background: #f1f5f9;
    font-weight: 700;
    white-space: nowrap;
}

    .kpb-due.d1 {
        background: #ffe4e6;
        color: #be123c !important;
    }

        .kpb-due.d1 .mud-icon-root {
            fill: #be123c;
        }

    .kpb-due.d2 {
        background: #fef3c7;
        color: #92400e !important;
    }

        .kpb-due.d2 .mud-icon-root {
            fill: #b45309;
        }

    .kpb-due.d3 {
        background: #e0f2fe;
        color: #075985 !important;
    }

    .kpb-due.ok, .kpb-due.d9 {
        background: #d1fae5;
        color: #065f46 !important;
    }

        .kpb-due.ok .mud-icon-root {
            fill: #10b981;
        }

.kpb-move {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    align-items: center;
}

    .kpb-move small {
        font-size: .72rem;
        color: #64748b !important;
        width: 100%;
    }

    .kpb-move button {
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        border-radius: 999px;
        padding: 4px 10px;
        font-family: inherit;
        font-size: .76rem;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        color: #334155 !important;
    }

        .kpb-move button:hover {
            background: #eef2ff;
            border-color: #c7d2fe;
        }

        .kpb-move button .mud-icon-root {
            width: 14px;
            height: 14px;
        }

.kpb-addbtn {
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 8px;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 700;
    color: #64748b !important;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    width: 100%;
}

    .kpb-addbtn:hover {
        background: rgba(99, 102, 241, .1);
        color: #4f46e5 !important;
    }

    .kpb-addbtn .mud-icon-root {
        width: 18px;
        height: 18px;
        fill: currentColor;
    }

.kpb-newcol {
    background: rgba(241, 245, 249, .6);
    border: 2px dashed #cbd5e1;
}

.kpb-add {
    background: white;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.kpb-in {
    width: 100%;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: .86rem;
    background: white;
    color: #1e293b !important;
    outline: none;
    box-sizing: border-box;
}

    .kpb-in:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
    }

.kpb-add-row {
    display: flex;
    gap: 6px;
}

    .kpb-add-row .kt-select {
        flex: 1;
        min-width: 0;
        font-size: .78rem;
        padding: 6px;
    }

/* پنجره‌ی ویرایش لیست */
.kpb-dlg {
    position: fixed;
    z-index: 1302;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(400px, calc(100vw - 28px));
    background: white;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: ktIn .25s ease both;
}

    .kpb-dlg h3 {
        margin: 0;
    }

    .kpb-dlg label {
        display: flex;
        flex-direction: column;
        gap: 5px;
        font-size: .82rem;
        font-weight: 700;
        color: #334155 !important;
    }

.kpb-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

    .kpb-colors button {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: 0;
        cursor: pointer;
        box-shadow: 0 0 0 2px white, 0 0 0 3px transparent;
        transition: .15s;
    }

        .kpb-colors button.on {
            box-shadow: 0 0 0 2px white, 0 0 0 4px #1e1b4b;
        }

.kpb-dlg .kpb-chk {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
}

.kpb-chk input {
    margin-top: 4px;
}

.kpb-chk span {
    display: flex;
    flex-direction: column;
}

.kpb-chk small {
    font-weight: 500;
    color: #64748b !important;
}

.kpb-dlg-foot {
    display: flex;
    gap: 8px;
}

/* ---------- تب وظایف ---------- */
.kpb-tl .kt-bar {
    flex-wrap: wrap;
}

.kpb-trow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: #1e293b !important;
    border-inline-start: 3px solid transparent;
    transition: background .15s;
}

    .kpb-trow:hover {
        background: #f8fafc;
    }

    .kpb-trow.kt-p2 {
        border-inline-start-color: #f97316;
    }

    .kpb-trow.kt-p3 {
        border-inline-start-color: #e11d48;
    }

    .kpb-trow.isdone .kpb-tt {
        color: #64748b !important;
        text-decoration: line-through;
    }

.kpb-tst {
    width: 20px !important;
    height: 20px !important;
    fill: #94a3b8;
    flex-shrink: 0;
}

.kpb-trow.isdone .kpb-tst {
    fill: #10b981;
}

.kpb-tt {
    font-size: .87rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kpb-tlist {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .73rem;
    color: #475569 !important;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
}

.kpb-tck {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .74rem;
}

    .kpb-tck .mud-icon-root {
        width: 14px;
        height: 14px;
    }

.kpb-trow .kpb-due {
    font-size: .74rem;
}

.kpb-trow .kt-av {
    width: 26px;
    height: 26px;
}

/* ---------- تب خط تولید ---------- */
.kpb-flows {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

    .kpb-flows > .kt-card {
        margin-top: 0;
    }

.kpb-frun {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    border: 2px dashed #c7d2fe;
    background: #f5f3ff;
}

    .kpb-frun:hover {
        border-color: #6366f1;
    }

    .kpb-frun b {
        display: block;
        color: #3730a3 !important;
        font-size: .9rem;
    }

    .kpb-frun small {
        display: block;
        font-size: .76rem;
        margin-top: 2px;
    }

.kpb-fic {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.kpb-fhead {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .kpb-fhead b {
        font-size: .92rem;
        color: #1e293b !important;
    }

.kpb-fst {
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 9px;
    background: #e0e7ff;
    color: #3730a3 !important;
}

.kpb-flow.fin .kpb-fst {
    background: #d1fae5;
    color: #065f46 !important;
}

.kpb-fbar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0 8px;
}

    .kpb-fbar i {
        display: block;
        height: 100%;
        border-radius: 4px;
        background: linear-gradient(90deg, #6366f1, #8b5cf6);
    }

.kpb-flow.fin .kpb-fbar i {
    background: #10b981;
}

.kpb-fmeta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: .76rem;
    color: #64748b !important;
}

.kpb-fact {
    margin-top: 10px;
}

/* ---------- تب اعضا ---------- */
.kpb-prow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px 56px 56px 64px 160px;
    gap: 8px;
    align-items: center;
    padding: 9px 6px;
    border-bottom: 1px solid #f1f5f9;
    font-size: .85rem;
    text-align: center;
}

    .kpb-prow.head {
        font-size: .74rem;
        font-weight: 700;
        color: #64748b !important;
        border-bottom: 2px solid #e2e8f0;
    }

    .kpb-prow > span:first-child {
        text-align: start;
    }

.kpb-pn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

    .kpb-pn .kt-av {
        width: 32px;
        height: 32px;
    }

    .kpb-pn > span {
        display: flex;
        flex-direction: column;
        line-height: 1.4;
        min-width: 0;
    }

    .kpb-pn small {
        font-size: .7rem;
        font-weight: 500;
        color: #64748b !important;
    }

.kpb-pbar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    background: #f1f5f9;
    overflow: hidden;
    gap: 2px;
}

    .kpb-pbar i {
        display: block;
        height: 100%;
        border-radius: 4px;
    }

        .kpb-pbar i.d {
            background: #10b981;
        }

        .kpb-pbar i.o {
            background: #818cf8;
        }

.kpb-lg {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    margin: 0 6px 0 3px;
    vertical-align: middle;
}

    .kpb-lg.d {
        background: #10b981;
    }

    .kpb-lg.o {
        background: #818cf8;
    }

/* ---------- موبایل ---------- */
@media (max-width: 900px) {
    .kpb-ov {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .kpb-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .kpb-ring {
        display: none;
    }

    .kpb-hero .kt-hero-ico {
        display: none;
    }

    .kpb-hero .kt-hero-tools .kt-scope {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

        .kpb-hero .kt-hero-tools .kt-scope button {
            white-space: nowrap;
        }

    .kpb-hero .kt-hero-tools .kt-btn {
        flex: 1;
        justify-content: center;
    }

    .kpb-hint {
        display: none;
    }

    .kpb-filter {
        width: 100%;
    }

    .kpb-col {
        flex-basis: 84vw;
        max-height: none;
    }

    .kpb-board {
        scroll-snap-type: x mandatory;
    }

    .kpb-ctop .kpb-ibtn {
        opacity: 1;
    }

    .kpb-tlist, .kpb-tck {
        display: none;
    }

    .kpb-prow {
        grid-template-columns: minmax(0, 1fr) 40px 40px 44px;
    }

        .kpb-prow > :nth-child(5), .kpb-prow > :nth-child(6) {
            display: none;
        }

    .kpb-bars {
        gap: 2px;
    }
}

/* =====================================================================
   مرحله ۸ب — کارنامه‌ی ماهانه (/tasks/kpi) · پیشوند kpc-
   ===================================================================== */
.kpc-hero .kt-hero-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kpc-month {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, .22);
    border-radius: 13px;
    padding: 4px;
}

    .kpc-month b {
        min-width: 118px;
        text-align: center !important;
        font-weight: 800;
        color: white !important;
    }

    .kpc-month button {
        border: 0;
        background: rgba(255, 255, 255, .14);
        width: 34px;
        height: 34px;
        border-radius: 10px;
        cursor: pointer;
        display: grid;
        place-items: center;
    }

        .kpc-month button:disabled {
            opacity: .35;
            cursor: default;
        }

        .kpc-month button svg {
            width: 20px;
            height: 20px;
            fill: white !important;
        }

.kpc-hero span.kt-kpi {
    cursor: default;
}

.kpc-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.kpc-note {
    font-size: .78rem;
    color: var(--kt-muted) !important;
    line-height: 1.8;
    max-width: 640px;
}

.kpc-foot-note {
    font-size: .76rem;
    color: var(--kt-muted) !important;
    margin: 8px 4px 0;
    line-height: 1.8;
}

/* تنظیمات */
.kpc-set {
    border-top: 4px solid #f59e0b;
}

    .kpc-set h4 {
        margin: 4px 0 6px;
        font-weight: 800;
        font-size: .95rem;
    }

    .kpc-set p {
        margin: 0 0 10px;
        font-size: .8rem;
    }

.kpc-wts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

    .kpc-wts label {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: .8rem;
        font-weight: 700;
    }

    .kpc-wts input {
        border: 1.5px solid var(--kt-border);
        background: var(--kt-soft);
        border-radius: 12px;
        padding: 8px 10px;
        font-family: inherit;
        font-size: 1rem;
        font-weight: 800;
        width: 100%;
        outline: 0;
    }

        .kpc-wts input:focus {
            border-color: #a5b4fc;
            background: white;
        }

.kpc-wsum {
    font-weight: 800;
    font-size: .85rem;
    color: #c2410c !important;
    padding-bottom: 10px;
}

    .kpc-wsum.ok {
        color: #047857 !important;
    }

.kpc-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .86rem;
    line-height: 1.8;
    cursor: pointer;
    margin-bottom: 6px;
}

    .kpc-check input {
        margin-top: 6px;
        accent-color: #4f46e5;
    }

.kpc-tagmode {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 22px;
}

    .kpc-tagmode .kt-select {
        max-width: 360px;
        margin-right: 22px;
    }

.kpc-set-foot {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* جدول رتبه‌ها */
.kpc-podium {
    margin-top: 14px;
}

    .kpc-podium .kfk-pod {
        cursor: pointer;
        font-family: inherit;
    }

.kpc-table {
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 14px;
    animation: ktIn .45s ease both;
}

.kpc-row {
    display: grid;
    grid-template-columns: 44px minmax(170px, 1.5fr) minmax(130px, 1fr) minmax(220px, 1.4fr) 110px 28px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f3fa;
    cursor: pointer;
    transition: background .15s;
}

    .kpc-row:last-child {
        border-bottom: 0;
    }

    .kpc-row:hover {
        background: #fafbff;
    }

    .kpc-row.head {
        cursor: default;
        background: #f8f9fc;
        font-size: .72rem;
        font-weight: 800;
        color: #64748b !important;
    }

.kpc-who-t {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .kpc-who-t b {
        font-size: .9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .kpc-who-t small {
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

.kpc-tot {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .kpc-tot b {
        font-size: 1.15rem;
        font-weight: 900;
        color: var(--c) !important;
        min-width: 30px;
    }

    .kpc-tot i {
        flex: 1;
        height: 8px;
        background: #eef0f6;
        border-radius: 99px;
        overflow: hidden;
    }

    .kpc-tot em {
        display: block;
        height: 100%;
        background: var(--c);
        border-radius: 99px;
        animation: kpcGrow .9s ease both;
    }

.kpc-parts {
    display: flex;
    gap: 6px;
}

.kpc-part {
    min-width: 44px;
    text-align: center !important;
    padding: 3px 6px;
    border-radius: 9px;
    font-weight: 800;
    font-size: .8rem;
    background: white;
    border: 1.5px solid var(--c);
    color: var(--c) !important;
}

    .kpc-part.na {
        background: #f8fafc;
        border-color: #e2e8f0;
        color: #cbd5e1 !important;
    }

.kpc-trend {
    font-weight: 800;
    font-size: .8rem;
    color: #64748b !important;
}

    .kpc-trend.up {
        color: #059669 !important;
    }

    .kpc-trend.down {
        color: #e11d48 !important;
    }

.kpc-go svg {
    width: 22px;
    height: 22px;
    color: #a5b4fc;
}

@keyframes kpcGrow {
    from {
        width: 0;
    }
}

/* ================= کارت A4 ================= */
.kpc-sheets.all {
    display: none;
}

.kpc-sheet {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--kt-border);
    box-shadow: 0 6px 30px rgba(30, 27, 75, .08);
    margin: 14px auto 0;
    max-width: 820px;
    overflow: hidden;
    animation: ktIn .45s ease both;
}

.kpc-head {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;
    align-items: center;
    padding: 20px 22px;
    background: linear-gradient(135deg, #312e81, #4f46e5 55%, #7c3aed);
    position: relative;
}

    .kpc-head * {
        color: white !important;
    }

.kpc-head-who {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.kpc-head .kpc-av {
    width: 64px;
    height: 64px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .5);
    flex-shrink: 0;
}

    .kpc-head .kpc-av b {
        font-size: 1.5rem;
    }

.kpc-head small {
    font-size: .78rem;
    opacity: .85;
}

.kpc-head h3 {
    margin: 2px 0 4px;
    font-size: 1.45rem;
    font-weight: 900;
}

.kpc-rank {
    display: inline-block;
    background: rgba(255, 255, 255, .16);
    border-radius: 99px;
    padding: 2px 12px;
    font-size: .8rem;
    font-weight: 700;
}

.kpc-ring {
    width: 108px;
    height: 108px;
    position: relative;
}

    .kpc-ring svg {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }

    .kpc-ring circle {
        fill: none;
        stroke-width: 11;
    }

    .kpc-ring .bg {
        stroke: rgba(255, 255, 255, .18);
    }

    .kpc-ring .fg {
        stroke: white;
        stroke-linecap: round;
        animation: kpcRing 1.1s ease both;
    }

    .kpc-ring > span {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .kpc-ring b {
        font-size: 2rem;
        font-weight: 900;
        line-height: 1;
    }

    .kpc-ring small {
        font-size: .7rem;
    }

@keyframes kpcRing {
    from {
        stroke-dasharray: 0 314.16;
    }
}

.kpc-grade {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

    .kpc-grade b {
        background: white;
        color: var(--c) !important;
        border-radius: 12px;
        padding: 6px 14px;
        font-weight: 900;
        font-size: 1rem;
        box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
    }

    .kpc-grade small {
        font-size: .76rem;
        font-weight: 700;
    }

.kpc-parts-big {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px 22px 4px;
}

.kpc-pb {
    background: var(--kt-soft);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--kt-border);
}

.kpc-pb-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

    .kpc-pb-top span {
        font-size: .78rem;
        font-weight: 800;
        flex: 1;
        line-height: 1.5;
    }

    .kpc-pb-top small {
        font-size: .66rem;
        color: var(--kt-muted) !important;
        white-space: nowrap;
    }

    .kpc-pb-top b {
        font-size: 1.35rem;
        font-weight: 900;
        color: var(--c) !important;
    }

.kpc-pb i {
    height: 7px;
    background: #e5e7f0;
    border-radius: 99px;
    overflow: hidden;
}

.kpc-pb em {
    display: block;
    height: 100%;
    background: var(--c);
    border-radius: 99px;
    animation: kpcGrow 1s ease both;
}

.kpc-pb > small {
    font-size: .7rem;
    color: var(--kt-muted) !important;
    line-height: 1.6;
}

.kpc-pb.na {
    opacity: .75;
}

.kpc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px 22px 0;
}

    .kpc-stats > div {
        border: 1px solid var(--kt-border);
        border-radius: 14px;
        padding: 10px 12px;
    }

.kpc-sheet h5 {
    margin: 0 0 6px;
    font-size: .86rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #312e81 !important;
}

    .kpc-sheet h5 svg {
        width: 18px;
        height: 18px;
        color: #6366f1;
    }

.kpc-stats ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kpc-stats li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: .8rem;
    padding: 3px 0;
    border-bottom: 1px dashed #eef0f6;
}

    .kpc-stats li:last-child {
        border-bottom: 0;
    }

    .kpc-stats li b {
        font-weight: 800;
    }

    .kpc-stats li.g b {
        color: #047857 !important;
    }

    .kpc-stats li.r b {
        color: #e11d48 !important;
    }

.kpc-adv {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 22px 0;
}

    .kpc-adv > div {
        border-radius: 14px;
        padding: 10px 14px;
    }

.kpc-good {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

    .kpc-good h5, .kpc-good h5 svg {
        color: #047857 !important;
    }

.kpc-tips {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

    .kpc-tips h5, .kpc-tips h5 svg {
        color: #b45309 !important;
    }

.kpc-adv ul {
    margin: 0;
    padding: 0 18px 0 0;
}

.kpc-adv li {
    font-size: .8rem;
    line-height: 1.9;
    margin-bottom: 2px;
}

.kpc-adv p {
    font-size: .8rem;
    margin: 0;
}

.kpc-late {
    padding: 12px 22px 0;
}

    .kpc-late table {
        width: 100%;
        border-collapse: collapse;
        font-size: .78rem;
    }

    .kpc-late th {
        background: #f8f9fc;
        font-weight: 800;
        color: #64748b !important;
        padding: 6px 8px;
        font-size: .72rem;
    }

    .kpc-late td {
        padding: 6px 8px;
        border-bottom: 1px solid #f1f3fa;
    }

        .kpc-late td a {
            color: #3730a3 !important;
            text-decoration: none;
            font-weight: 700;
        }

        .kpc-late td.open {
            color: #e11d48 !important;
            font-weight: 700;
        }

.kpc-fl {
    font-style: normal;
    background: #ede9fe;
    color: #6d28d9 !important;
    border-radius: 6px;
    padding: 0 6px;
    font-size: .66rem;
    margin-left: 6px;
    font-weight: 700;
}

.kpc-ai {
    margin: 12px 22px 0;
    border-radius: 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #fdf2f8, #eef2ff);
    border: 1px solid #e9d5ff;
}

    .kpc-ai h5 {
        color: #7e22ce !important;
    }

.kpc-ai-ico {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white !important;
    display: grid;
    place-items: center;
    font-size: .75rem;
    font-weight: 900;
}

.kpc-ai p {
    font-size: .84rem;
    line-height: 2;
    margin: 0;
    white-space: pre-wrap;
}

.kpc-ai-act {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

    .kpc-ai-act small {
        font-size: .72rem;
    }

.kpc-ai.empty {
    background: #faf5ff;
    border-style: dashed;
}

.kpc-mnote {
    margin: 12px 22px 0;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
    padding: 10px 14px;
}

    .kpc-mnote textarea {
        width: 100%;
        border: 1.5px solid var(--kt-border);
        background: var(--kt-soft);
        border-radius: 12px;
        padding: 8px 10px;
        font-family: inherit;
        font-size: .85rem;
        line-height: 1.9;
        resize: vertical;
        outline: 0;
        margin-bottom: 6px;
    }

        .kpc-mnote textarea:focus {
            border-color: #a5b4fc;
            background: white;
        }

    .kpc-mnote p {
        font-size: .84rem;
        line-height: 2;
        margin: 0;
        white-space: pre-wrap;
    }

.kpc-printonly, .kpc-hide {
    display: none;
}

.kpc-sign {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    padding: 22px 22px 18px;
}

    .kpc-sign span {
        flex: 1;
        border-top: 1.5px dashed #cbd5e1;
        padding-top: 6px;
        font-size: .74rem;
        color: var(--kt-muted) !important;
        text-align: center !important;
        margin-top: 26px;
    }

    .kpc-sign small {
        font-size: .68rem;
        color: var(--kt-muted) !important;
        white-space: nowrap;
    }

@media (max-width: 800px) {
    .kpc-row {
        grid-template-columns: 38px 1fr 110px 22px;
    }

    .kpc-hide-m {
        display: none !important;
    }

    .kpc-head {
        grid-template-columns: 1fr auto;
        padding: 16px;
    }

    .kpc-grade {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
    }

    .kpc-parts-big {
        grid-template-columns: 1fr 1fr;
        padding: 12px 14px 0;
    }

    .kpc-stats, .kpc-adv {
        grid-template-columns: 1fr;
        padding: 10px 14px 0;
    }

    .kpc-late {
        padding: 10px 14px 0;
        overflow-x: auto;
    }

    .kpc-ai, .kpc-mnote {
        margin: 10px 14px 0;
    }

    .kpc-ring {
        width: 92px;
        height: 92px;
    }

    .kpc-head h3 {
        font-size: 1.15rem;
    }
}

/* ---------- چاپ: هر کارت یک صفحه‌ی A4 ---------- */
@media print {
    body * {
        visibility: hidden !important;
    }

    .kpc > *:not(.kpc-sheets) {
        display: none !important;
    }

    .kpc-sheets, .kpc-sheets * {
        visibility: visible !important;
    }

        .kpc-sheets, .kpc-sheets.all {
            display: block !important;
            position: absolute;
            top: 0;
            right: 0;
            left: 0;
        }

    .kpc-sheet {
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        animation: none !important;
        break-after: page;
        page-break-after: always;
    }

        .kpc-sheet:last-child {
            break-after: auto;
            page-break-after: auto;
        }

        .kpc-sheet, .kpc-sheet * {
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

    .kpc-head {
        border-radius: 14px;
        grid-template-columns: 1fr auto auto !important;
        padding: 14px 18px !important;
    }

    .kpc-grade {
        grid-column: auto !important;
        flex-direction: column !important;
    }

    .kpc-ring {
        width: 96px !important;
        height: 96px !important;
    }

    .kpc-parts-big {
        grid-template-columns: repeat(4, 1fr) !important;
        padding: 10px 0 0 !important;
        gap: 8px !important;
    }

    .kpc-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        padding: 8px 0 0 !important;
        gap: 8px !important;
    }

    .kpc-adv {
        grid-template-columns: 1fr 1fr !important;
        padding: 8px 0 0 !important;
        gap: 8px !important;
    }

    .kpc-late {
        padding: 8px 0 0 !important;
        overflow: visible !important;
    }

    .kpc-ai, .kpc-mnote {
        margin: 8px 0 0 !important;
        padding: 8px 12px !important;
    }

    .kpc-sign {
        padding: 14px 0 0 !important;
    }

    .kpc-adv li {
        line-height: 1.7 !important;
    }

    .kpc-ai p, .kpc-mnote p {
        font-size: 11px !important;
        line-height: 1.8 !important;
    }

    .kpc-ring .fg, .kpc-pb em {
        animation: none !important;
    }

    .kpc-noprint {
        display: none !important;
    }

    .kpc-printonly {
        display: block !important;
    }

    .kpc-ai.empty {
        display: none !important;
    }

    .kpc-adv li, .kpc-late td, .kpc-stats li {
        font-size: 10.5px;
    }

    .kpc-late tr {
        break-inside: avoid;
    }

    .kpc-late td a {
        color: #1e1b4b !important;
    }

    @page {
        size: A4 portrait;
        margin: 9mm;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kpc-tot em, .kpc-pb em, .kpc-ring .fg, .kpc-table, .kpc-sheet {
        animation: none !important;
    }
}

/* =====================================================================
   مرحله ۹ — تقویم و خط زمانی پروژه (kpt-)، کارهای مشتری (kcw-)
   ===================================================================== */
.kpb-cust {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, .16);
    border-radius: 99px;
    padding: 2px 10px;
    font-size: .78rem;
    color: white !important;
    text-decoration: none !important;
    border: 1px dashed rgba(255, 255, 255, .5);
}

    .kpb-cust:hover {
        background: rgba(255, 255, 255, .28);
    }

    .kpb-cust svg {
        width: 15px;
        height: 15px;
    }

/* ---------- نوار بالا ---------- */
.kpt-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.kpt-month {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid var(--kt-border);
    border-radius: 13px;
    padding: 4px;
}

    .kpt-month b {
        min-width: 112px;
        text-align: center !important;
        font-weight: 800;
        color: #3730a3 !important;
    }

    .kpt-month button {
        border: 0;
        background: var(--kt-soft);
        width: 32px;
        height: 32px;
        border-radius: 9px;
        cursor: pointer;
        display: grid;
        place-items: center;
    }

        .kpt-month button svg {
            width: 20px;
            height: 20px;
            color: #4338ca;
        }

.kpt-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

    .kpt-chips button {
        border: 1.5px solid var(--kt-border);
        background: white;
        border-radius: 99px;
        padding: 5px 12px;
        font-family: inherit;
        font-size: .8rem;
        font-weight: 700;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: .15s;
    }

        .kpt-chips button:hover {
            border-color: #c7d2fe;
        }

        .kpt-chips button.on {
            background: #eef2ff;
            border-color: #a5b4fc;
            color: #3730a3 !important;
        }

        .kpt-chips button b {
            background: #e0e7ff;
            color: #3730a3 !important;
            border-radius: 99px;
            padding: 0 6px;
            font-size: .7rem;
        }

.kpt-stat {
    font-size: .78rem;
    color: var(--kt-muted) !important;
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: default;
}

button.kpt-stat {
    cursor: pointer;
    background: var(--kt-soft);
    border-radius: 99px;
    padding: 4px 10px;
}

.kpt-stat b {
    color: var(--kt-text) !important;
    font-weight: 800;
}

.kpt-stat.late b {
    color: #e11d48 !important;
}

/* ---------- جدول ماه ---------- */
.kpt-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 18px;
    padding: 10px;
    animation: ktIn .45s ease both;
}

.kpt-wd {
    text-align: center !important;
    font-size: .74rem;
    font-weight: 800;
    color: #64748b !important;
    padding: 4px 0 6px;
}

    .kpt-wd.fri {
        color: #e11d48 !important;
    }

.kpt-blank {
    min-height: 110px;
}

.kpt-day {
    min-height: 110px;
    border: 1.5px solid #f1f3fa;
    border-radius: 12px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    min-width: 0;
    position: relative;
}

    .kpt-day:hover {
        border-color: #c7d2fe;
    }

    .kpt-day.off {
        background: #fff7f7;
    }

        .kpt-day.off .kpt-dn {
            color: #e11d48 !important;
        }

    .kpt-day.today {
        border-color: #6366f1;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
    }

        .kpt-day.today .kpt-dn {
            background: #4f46e5;
            color: white !important;
        }

    .kpt-day.sel {
        background: #f5f7ff;
    }

    .kpt-day.over {
        border-color: #10b981;
        border-style: dashed;
        background: #ecfdf5;
    }

.kpt-dn {
    font-weight: 800;
    font-size: .8rem;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #334155 !important;
}

.kpt-dots {
    display: none;
}

.kpt-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.kpt-it {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    padding: 3px 5px;
    border-radius: 7px;
    background: #eef2ff;
    border-right: 3px solid #6366f1;
    min-width: 0;
    cursor: pointer;
    transition: transform .12s;
}

    .kpt-it:hover {
        transform: translateX(-2px);
    }

    .kpt-it[draggable="true"] {
        cursor: grab;
    }

    .kpt-it > span:last-child {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    .kpt-it .kt-av {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

        .kpt-it .kt-av b {
            font-size: .55rem;
        }

    .kpt-it svg {
        width: 13px;
        height: 13px;
        flex-shrink: 0;
    }

    .kpt-it.dragging {
        opacity: .4;
    }

    .kpt-it.t.hot {
        border-right-color: #f97316;
    }

    .kpt-it.t.late {
        background: #fff1f2;
        border-right-color: #e11d48;
        color: #9f1239 !important;
    }

    .kpt-it.done, .kpt-it.t.done {
        background: #ecfdf5;
        border-right-color: #10b981;
        color: #047857 !important;
    }

        .kpt-it.done > span:last-child {
            text-decoration: line-through;
            opacity: .8;
        }

    .kpt-it.f {
        background: #f5f3ff;
        border-right-color: #8b5cf6;
        color: #5b21b6 !important;
    }

        .kpt-it.f.wait {
            opacity: .65;
            border-right-style: dashed;
        }

        .kpt-it.f.late {
            background: #fff1f2;
            border-right-color: #e11d48;
        }

    .kpt-it.m {
        background: #fffbeb;
        border-right-color: #f59e0b;
        color: #92400e !important;
        font-weight: 800;
    }

.kpt-more {
    border: 0;
    background: transparent;
    color: #4f46e5 !important;
    font-family: inherit;
    font-size: .7rem;
    font-weight: 800;
    cursor: pointer;
    text-align: right !important;
    padding: 2px 4px;
}

.kpt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: .74rem;
    margin: 10px 4px 0;
}

    .kpt-legend i, .kpt-dots i, .kpt-bullet, .kpt-k {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 3px;
        background: #6366f1;
        margin-left: 5px;
        vertical-align: middle;
    }

        .kpt-legend i.late, .kpt-dots i.late, .kpt-row.late .kpt-bullet {
            background: #e11d48;
        }

        .kpt-legend i.done, .kpt-dots i.done, .kpt-row.done .kpt-bullet {
            background: #10b981;
        }

        .kpt-legend i.f, .kpt-dots i.f, .kpt-row.f .kpt-bullet {
            background: #8b5cf6;
        }

        .kpt-legend i.m, .kpt-dots i.m, .kpt-row.m .kpt-bullet {
            background: #f59e0b;
        }

.kpt-daylist h4 {
    margin: 0 0 8px;
    font-weight: 800;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .kpt-daylist h4 svg {
        width: 20px;
        height: 20px;
        color: #6366f1;
    }

    .kpt-daylist h4 small {
        font-weight: 600;
        font-size: .75rem;
    }

.kpt-daylist p {
    margin: 0;
    font-size: .85rem;
}

.kpt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid #f1f3fa;
    cursor: pointer;
    border-radius: 10px;
    transition: background .15s;
}

    .kpt-row:hover {
        background: #fafbff;
    }

    .kpt-row:last-child {
        border-bottom: 0;
    }

    .kpt-row b {
        display: block;
        font-size: .86rem;
    }

    .kpt-row small {
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

    .kpt-row.done b {
        text-decoration: line-through;
        opacity: .7;
    }

.kpt-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0;
    flex-shrink: 0;
}

.kpt-who {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    white-space: nowrap;
}

    .kpt-who .kt-av {
        width: 24px;
        height: 24px;
    }

/* ---------- خط زمانی ---------- */
.kpt-tl {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kpt-compose {
    margin-top: 0;
    border-top: 4px solid #6366f1;
}

    .kpt-compose textarea {
        width: 100%;
        border: 1.5px solid var(--kt-border);
        background: var(--kt-soft);
        border-radius: 12px;
        padding: 10px 12px;
        font-family: inherit;
        font-size: .9rem;
        line-height: 1.9;
        resize: vertical;
        outline: 0;
    }

        .kpt-compose textarea:focus {
            border-color: #a5b4fc;
            background: white;
        }

.kpt-compose-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

    .kpt-compose-foot label {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: .82rem;
        font-weight: 700;
        cursor: pointer;
    }

    .kpt-compose-foot input {
        accent-color: #4f46e5;
    }

    .kpt-compose-foot small {
        font-size: .72rem;
    }

.kpt-tl-f small {
    font-size: .7rem;
    margin-right: 6px;
}

.kpt-k {
    margin-left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

    .kpt-k.kk-all {
        background: #94a3b8;
    }

    .kpt-k.kk-msg {
        background: #6366f1;
    }

    .kpt-k.kk-task {
        background: #10b981;
    }

    .kpt-k.kk-comment {
        background: #0ea5e9;
    }

    .kpt-k.kk-report {
        background: #f59e0b;
    }

    .kpt-k.kk-flow {
        background: #8b5cf6;
    }

    .kpt-k.kk-project {
        background: #ec4899;
    }

.kpt-feed {
    background: white;
    border: 1px solid var(--kt-border);
    border-radius: 18px;
    padding: 6px 16px 14px;
    position: relative;
}

.kpt-dayhead {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 0 6px;
    background: linear-gradient(white 70%, rgba(255, 255, 255, 0));
}

    .kpt-dayhead span {
        display: inline-block;
        background: #eef2ff;
        color: #3730a3 !important;
        font-weight: 800;
        font-size: .76rem;
        border-radius: 99px;
        padding: 3px 12px;
    }

.kpt-ev {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    position: relative;
    animation: ktIn .35s ease both;
}

    .kpt-ev::before {
        content: "";
        position: absolute;
        right: 17px;
        top: 44px;
        bottom: -8px;
        width: 2px;
        background: #f1f3fa;
    }

    .kpt-ev:last-child::before {
        display: none;
    }

.kpt-ev-ico {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #ecfdf5;
    position: relative;
    z-index: 1;
}

    .kpt-ev-ico svg {
        width: 19px;
        height: 19px;
        color: #047857;
    }

    .kpt-ev-ico .kt-av {
        width: 36px;
        height: 36px;
    }

.kpt-ev.kk-comment .kpt-ev-ico {
    background: #e0f2fe;
}

    .kpt-ev.kk-comment .kpt-ev-ico svg {
        color: #0369a1;
    }

.kpt-ev.kk-report .kpt-ev-ico {
    background: #fef3c7;
}

    .kpt-ev.kk-report .kpt-ev-ico svg {
        color: #b45309;
    }

.kpt-ev.kk-flow .kpt-ev-ico {
    background: #ede9fe;
}

    .kpt-ev.kk-flow .kpt-ev-ico svg {
        color: #6d28d9;
    }

.kpt-ev.kk-project .kpt-ev-ico {
    background: #fce7f3;
}

    .kpt-ev.kk-project .kpt-ev-ico svg {
        color: #be185d;
    }

.kpt-ev.kk-task.tone2 .kpt-ev-ico {
    background: #fff1f2;
}

    .kpt-ev.kk-task.tone2 .kpt-ev-ico svg {
        color: #e11d48;
    }

.kpt-ev-body {
    flex: 1;
    min-width: 0;
}

.kpt-ev-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: .84rem;
}

    .kpt-ev-top b {
        font-weight: 800;
    }

    .kpt-ev-top > span {
        color: #475569 !important;
    }

    .kpt-ev-top small {
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

.kpt-tag {
    font-style: normal;
    font-size: .68rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569 !important;
    border-radius: 99px;
    padding: 1px 8px;
}

.kpt-ev.tone1 .kpt-tag {
    background: #dcfce7;
    color: #047857 !important;
}

.kpt-ev.tone2 .kpt-tag {
    background: #ffe4e6;
    color: #be123c !important;
}

.kpt-ev.kk-report .kpt-tag {
    background: #fef3c7;
    color: #92400e !important;
}

.kpt-ev-task {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    font-weight: 700;
    color: #3730a3 !important;
    text-decoration: none !important;
    margin-top: 3px;
}

    .kpt-ev-task svg {
        width: 14px;
        height: 14px;
    }

    .kpt-ev-task:hover {
        text-decoration: underline !important;
    }

.kpt-ev-text {
    font-size: .84rem;
    line-height: 1.9;
    margin-top: 4px;
    white-space: pre-wrap;
    color: #334155 !important;
}

    .kpt-ev-text.bubble {
        background: #eef2ff;
        border-radius: 4px 16px 16px 16px;
        padding: 8px 12px;
        display: inline-block;
        max-width: 100%;
        color: #1e1b4b !important;
    }

.kpt-ev.kk-comment .kpt-ev-text {
    background: #f0f9ff;
    border-radius: 10px;
    padding: 6px 10px;
}

.kpt-ev.kk-report .kpt-ev-text {
    background: #fffbeb;
    border-radius: 10px;
    padding: 6px 10px;
    border: 1px dashed #fde68a;
}

.kpt-del {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 2px;
    display: grid;
    place-items: center;
    opacity: .5;
}

    .kpt-del:hover {
        opacity: 1;
    }

    .kpt-del svg {
        width: 17px;
        height: 17px;
        color: #e11d48;
    }

.kpt-more-wrap {
    display: flex;
    justify-content: center;
}

/* ---------- کارهای مشتری ---------- */
.kcw-top {
    margin: 4px 0 2px;
}

.kcw-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 4px solid #0ea5e9;
}

.kcw-ico {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

    .kcw-ico svg {
        width: 24px;
        height: 24px;
    }

.kcw-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.kcw-head small {
    font-size: .76rem;
}

.kcw-nums {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

    .kcw-nums > span {
        background: white;
        border: 1px solid var(--kt-border);
        border-radius: 14px;
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        gap: 2px;
        animation: ktIn .4s ease both;
    }

    .kcw-nums b {
        font-size: 1.35rem;
        font-weight: 800;
    }

    .kcw-nums small {
        font-size: .74rem;
        color: var(--kt-muted) !important;
    }

    .kcw-nums .bad b {
        color: #e11d48 !important;
    }

    .kcw-nums .good b {
        color: #047857 !important;
    }

.kcw-projs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.kcw-proj {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid var(--kt-border);
    border-right: 4px solid var(--pc);
    border-radius: 14px;
    padding: 10px 12px;
    text-decoration: none !important;
    transition: transform .15s, box-shadow .15s;
    animation: ktIn .4s ease both;
}

    .kcw-proj:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(30, 27, 75, .08);
    }

    .kcw-proj.dim {
        opacity: .6;
    }

.kcw-pico {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--pc);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.kcw-proj b {
    display: block;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kcw-proj small {
    display: block;
    font-size: .7rem;
    color: var(--kt-muted) !important;
}

.kcw-bar {
    display: block;
    height: 5px;
    background: #eef0f6;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 5px;
}

    .kcw-bar em {
        display: block;
        height: 100%;
        background: var(--pc);
        border-radius: 99px;
    }

.kcw-pnum {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

    .kcw-pnum b {
        font-weight: 900;
        color: var(--pc) !important;
    }

.kcw-note {
    font-size: .82rem;
    margin: 10px 4px 0;
}

.kcw-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

    .kcw-tabs button {
        border: 0;
        background: var(--kt-soft);
        border-radius: 10px;
        padding: 6px 14px;
        font-family: inherit;
        font-weight: 700;
        font-size: .82rem;
        cursor: pointer;
    }

        .kcw-tabs button.on {
            background: #eef2ff;
            color: #3730a3 !important;
        }

    .kcw-tabs b {
        font-size: .72rem;
        background: white;
        border-radius: 99px;
        padding: 0 6px;
        margin-right: 4px;
    }

.kcw-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 6px;
    border-bottom: 1px solid #f1f3fa;
    text-decoration: none !important;
    border-radius: 10px;
    transition: background .15s;
}

    .kcw-row:hover {
        background: #fafbff;
    }

    .kcw-row:last-of-type {
        border-bottom: 0;
    }

.kcw-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kcw-row b {
    display: block;
    font-size: .86rem;
}

.kcw-row small {
    font-size: .72rem;
    color: var(--kt-muted) !important;
}

.kcw-row.done b {
    text-decoration: line-through;
    opacity: .7;
}

.kcw-due {
    font-size: .76rem;
    white-space: nowrap;
    color: #475569 !important;
}

.kcw-row.late .kcw-due {
    color: #e11d48 !important;
    font-weight: 800;
}

.kcw-who {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    white-space: nowrap;
    min-width: 120px;
}

    .kcw-who .kt-av {
        width: 24px;
        height: 24px;
    }

@media (max-width: 760px) {
    /* هفت تب صفحه‌ی پروژه در موبایل: ورق بخورند و از کادر بیرون نزنند */
    .kpb-hero .kt-hero-tools, .kpb-hero .kt-hero-tools .kt-scope {
        min-width: 0;
        max-width: 100%;
    }

    .kpt-grid {
        gap: 3px;
        padding: 6px;
    }

    .kpt-blank, .kpt-day {
        min-height: 54px;
    }

    .kpt-day {
        padding: 3px;
        align-items: center;
    }

    .kpt-items {
        display: none;
    }

    .kpt-dots {
        display: flex;
        gap: 2px;
        flex-wrap: wrap;
        justify-content: center;
    }

        .kpt-dots i {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            margin: 0;
        }

    .kpt-wd {
        font-size: .62rem;
    }

    .kpt-legend span.kt-muted {
        display: none;
    }

    .kpt-feed {
        padding: 4px 10px 10px;
    }

    .kcw-who span, .kpt-who {
        display: none;
    }

    .kcw-who {
        min-width: 0;
    }
}

/* =====================================================================
   مرحله ۱۰: الگو و کار تکراری (ktl-)، فرم الگو (kte-)، کادر صفحه‌ی وظیفه (ktx-)، نوار فرم وظیفه (ktb-)
   ===================================================================== */

/* ---------------- صفحه‌ی /tasks/templates ---------------- */
.ktl-hero {
    background: linear-gradient(135deg, #064e3b 0%, #0f766e 45%, #4f46e5 100%);
    box-shadow: 0 14px 34px rgba(13, 148, 136, .28);
}

.ktl-spin {
    animation: ktlSpin 6s linear infinite;
}

@keyframes ktlSpin {
    to {
        transform: rotate(-360deg);
    }
}

.ktl-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0 12px;
}

    .ktl-bar .kt-tab svg {
        width: 17px;
        height: 17px;
        margin-left: 4px;
        vertical-align: -3px;
    }

    .ktl-bar .kt-tab em {
        font-style: normal;
        background: rgba(79, 70, 229, .12);
        color: #4338ca !important;
        border-radius: 99px;
        padding: 0 7px;
        margin-right: 6px;
        font-size: .75rem;
    }

    .ktl-bar .kt-tab.on em {
        background: rgba(255, 255, 255, .25);
        color: white !important;
    }

.ktl-who .kt-tab {
    font-size: .8rem;
}

.ktl-search {
    min-width: 220px;
}

.ktl-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ktl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

/* --- ردیف کار تکراری --- */
.ktl-row {
    display: grid;
    grid-template-columns: 46px 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-right: 5px solid #10b981;
    position: relative;
    animation: ktIn .35s ease both;
    transition: box-shadow .2s, transform .2s;
}

    .ktl-row:hover {
        box-shadow: 0 10px 26px rgba(15, 23, 42, .09);
        transform: translateY(-1px);
    }

    .ktl-row.k1 {
        border-right-color: #0ea5e9;
    }

    .ktl-row.k2 {
        border-right-color: #8b5cf6;
    }

    .ktl-row.k3 {
        border-right-color: #10b981;
    }

    .ktl-row.k4 {
        border-right-color: #f59e0b;
    }

    .ktl-row.paused, .ktl-row.ended {
        opacity: .62;
        border-right-color: #cbd5e1;
    }

    .ktl-row.hl {
        box-shadow: 0 0 0 3px #a7f3d0, 0 10px 26px rgba(15, 23, 42, .09);
    }

.ktl-k {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #10b981, #0d9488);
    box-shadow: 0 6px 14px rgba(16, 185, 129, .3);
}

    .ktl-k svg {
        width: 24px;
        height: 24px;
        fill: #ffffff !important;
    }

.ktl-row.k1 .ktl-k {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    box-shadow: 0 6px 14px rgba(14, 165, 233, .3);
}

.ktl-row.k2 .ktl-k {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    box-shadow: 0 6px 14px rgba(124, 58, 237, .3);
}

.ktl-row.k4 .ktl-k {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    box-shadow: 0 6px 14px rgba(245, 158, 11, .3);
}

.ktl-row.paused .ktl-k, .ktl-row.ended .ktl-k {
    background: #94a3b8;
    box-shadow: none;
}

.ktl-main {
    min-width: 0;
}

.ktl-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ktl-name {
    font-size: 1rem;
    font-weight: 800;
    color: #1e1b4b !important;
}

.ktl-rule {
    background: #ecfdf5;
    color: #047857 !important;
    font-size: .78rem;
    font-weight: 700;
    border-radius: 99px;
    padding: 2px 10px;
}

.ktl-row.k1 .ktl-rule {
    background: #e0f2fe;
    color: #0369a1 !important;
}

.ktl-row.k2 .ktl-rule {
    background: #f3e8ff;
    color: #6d28d9 !important;
}

.ktl-row.k4 .ktl-rule {
    background: #fef3c7;
    color: #b45309 !important;
}

.ktl-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 7px;
    padding: 2px 7px;
    background: #f1f5f9;
    color: #475569 !important;
}

    .ktl-badge svg {
        width: 14px;
        height: 14px;
    }

    .ktl-badge.pause {
        background: #fef3c7;
        color: #92400e !important;
    }

    .ktl-badge.end {
        background: #e2e8f0;
        color: #334155 !important;
    }

    .ktl-badge.rot {
        background: #e0e7ff;
        color: #3730a3 !important;
    }

    .ktl-badge.share {
        background: #fce7f3;
        color: #9d174d !important;
    }

.ktl-title {
    color: var(--kt-muted) !important;
    font-size: .84rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ktl-meta {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: .82rem;
}

.ktl-next {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #334155 !important;
}

    .ktl-next svg {
        width: 16px;
        height: 16px;
        fill: #0d9488 !important;
    }

    .ktl-next b {
        color: #0f766e !important;
    }

    .ktl-next small {
        color: var(--kt-muted) !important;
        margin-right: 6px;
    }

.ktl-people {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

    .ktl-people .tm-av, .ktl-people img {
        width: 26px !important;
        height: 26px !important;
        border: 2px solid #fff;
        margin-left: -8px;
    }

    .ktl-people small {
        margin-right: 6px;
        color: #475569 !important;
    }

.ktl-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--kt-soft);
    border: 1px solid var(--kt-border);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: .78rem;
    color: #475569 !important;
}

    .ktl-chip svg {
        width: 14px;
        height: 14px;
        fill: #64748b !important;
    }

.ktl-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.ktl-runs {
    display: flex;
    gap: 4px;
    direction: ltr;
}

.ktl-dot {
    width: 13px;
    height: 13px;
    border-radius: 4px;
    display: inline-block;
    background: #e2e8f0;
    transition: transform .15s;
}

a.ktl-dot:hover {
    transform: scale(1.35);
}

.ktl-dot.d {
    background: #10b981;
}

.ktl-dot.dl {
    background: #f59e0b;
}

.ktl-dot.o {
    background: #60a5fa;
}

.ktl-dot.l {
    background: #f43f5e;
    animation: ktlBlink 1.6s ease-in-out infinite;
}

.ktl-dot.s {
    background: repeating-linear-gradient(45deg, #cbd5e1 0 3px, #f1f5f9 3px 6px);
}

.ktl-dot.e {
    background: transparent;
    border: 1.5px dashed #e2e8f0;
}

@keyframes ktlBlink {
    50% {
        opacity: .45;
    }
}

.ktl-nums {
    display: flex;
    gap: 6px;
}

    .ktl-nums span {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 50px;
        padding: 3px 6px;
        border-radius: 10px;
        background: var(--kt-soft);
        font-size: .7rem;
        color: var(--kt-muted) !important;
    }

    .ktl-nums b {
        font-size: .98rem;
        color: #1e293b !important;
    }

    .ktl-nums .bad {
        background: #fff1f2;
    }

        .ktl-nums .bad b {
            color: #e11d48 !important;
        }

    .ktl-nums .good {
        background: #ecfdf5;
    }

        .ktl-nums .good b {
            color: #059669 !important;
        }

.ktl-acts {
    display: flex;
    gap: 4px;
}

.ktl-hist {
    grid-column: 1 / -1;
    border-top: 1px dashed var(--kt-border);
    padding-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 4px 16px;
    animation: ktIn .25s ease both;
}

.ktl-hrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    padding: 3px 0;
}

    .ktl-hrow a {
        color: var(--kt-p) !important;
        font-weight: 700;
    }

/* --- دستیار --- */
.ktl-sug {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid #fde68a;
    animation: ktIn .4s ease both;
}

.ktl-sug-ico {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 6px 14px rgba(217, 119, 6, .3);
}

    .ktl-sug-ico svg {
        fill: #ffffff !important;
    }

.ktl-sug > div > b {
    color: #78350f !important;
}

.ktl-sug-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.ktl-sug-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .75);
    border-radius: 12px;
    padding: 8px 12px;
}

    .ktl-sug-row b {
        display: block;
        color: #1e293b !important;
        font-size: .9rem;
    }

    .ktl-sug-row small {
        color: #92400e !important;
        font-size: .78rem;
    }

.ktl-sug-x {
    border: 0;
    background: transparent;
    color: #b45309 !important;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
}

/* --- خالی --- */
.ktl-empty .kt-empty-ico {
    background: linear-gradient(135deg, #10b981, #0d9488);
}

.ktl-ex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

    .ktl-ex button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border: 1.5px solid #a7f3d0;
        background: #ecfdf5;
        color: #065f46 !important;
        border-radius: 12px;
        padding: 8px 14px;
        font-weight: 700;
        font-size: .85rem;
        cursor: pointer;
        font-family: inherit;
        transition: .15s;
    }

        .ktl-ex button:hover {
            background: #d1fae5;
            transform: translateY(-1px);
        }

        .ktl-ex button svg {
            width: 18px;
            height: 18px;
            fill: #059669 !important;
        }

/* --- کارت الگو --- */
.ktl-tpl {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 4px solid #0ea5e9;
    animation: ktIn .35s ease both;
    transition: box-shadow .2s, transform .2s;
}

    .ktl-tpl:hover {
        box-shadow: 0 10px 26px rgba(15, 23, 42, .09);
        transform: translateY(-2px);
    }

    .ktl-tpl.kt-p2 {
        border-top-color: #f97316;
    }

    .ktl-tpl.kt-p3 {
        border-top-color: #e11d48;
    }

    .ktl-tpl.hl {
        box-shadow: 0 0 0 3px #bae6fd;
    }

.ktl-tpl-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

    .ktl-tpl-top b {
        display: block;
        color: #1e1b4b !important;
        font-weight: 800;
    }

    .ktl-tpl-top small {
        display: block;
        color: var(--kt-muted) !important;
        font-size: .8rem;
    }

.ktl-tpl-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #38bdf8, #4f46e5);
}

    .ktl-tpl-ico svg {
        width: 20px;
        height: 20px;
        fill: #ffffff !important;
    }

.ktl-tpl-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--kt-border);
}

    .ktl-tpl-foot small {
        font-size: .76rem;
    }

/* ---------------- فرم الگو (پنجره‌ی وسط) ---------------- */
.kte, .kte-back {
    --kt-p: #4f46e5;
    --kt-p2: #7c3aed;
    --kt-text: #1e1b4b;
    --kt-muted: #6b7280;
    --kt-border: #eceef5;
    --kt-soft: #f5f6fc;
    --kt-red: #e11d48;
}

    .kte * {
        color: inherit;
        text-align: inherit;
        box-sizing: border-box;
    }

    .kte svg {
        fill: currentColor;
    }

.kte-back {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(3px);
    z-index: 1400;
    animation: ktFade .2s ease both;
}

.kte {
    position: fixed;
    z-index: 1401;
    top: 4vh;
    left: 50%;
    width: min(1000px, 96vw);
    max-height: 92vh;
    transform: translateX(-50%);
    background: #f8f9fc;
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--kt-text);
    text-align: right;
    direction: rtl;
    animation: kteIn .3s cubic-bezier(.2, .9, .3, 1.15) both;
}

@keyframes kteIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(24px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.kte-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #312e81, #4f46e5 60%, #0ea5e9);
}

    .kte-head.recur {
        background: linear-gradient(135deg, #064e3b, #0f766e 55%, #4f46e5);
    }

    .kte-head h3 {
        margin: 0;
        color: white !important;
        font-size: 1.15rem;
        font-weight: 800;
    }

    .kte-head small {
        color: #d1fae5 !important;
        font-size: .82rem;
    }

.kte-hico {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .16);
    display: grid;
    place-items: center;
}

    .kte-hico svg {
        fill: #ffffff !important;
    }

.kte-head.recur .kte-hico svg {
    animation: ktlSpin 6s linear infinite;
}

.kte-x {
    border: 0;
    background: rgba(255, 255, 255, .15);
    width: 36px;
    height: 36px;
    border-radius: 11px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

    .kte-x:hover {
        background: rgba(255, 255, 255, .28);
    }

.kte-body {
    flex: 1;
    overflow: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    padding: 16px 20px;
}

.kte-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.kte-sec {
    background: #fff;
    border: 1px solid var(--kt-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .kte-sec h4 {
        margin: 0;
        font-size: .95rem;
        font-weight: 800;
        color: #1e1b4b !important;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .kte-sec h4 svg {
            width: 19px;
            height: 19px;
            fill: var(--kt-p) !important;
        }

        .kte-sec h4 small {
            font-weight: 500;
            font-size: .78rem;
        }

.kte-when {
    border-color: #a7f3d0;
    background: linear-gradient(180deg, #f0fdf4, #fff 60%);
}

    .kte-when h4 svg {
        fill: #059669 !important;
    }

.kte-l {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

    .kte-l > span {
        font-size: .8rem;
        font-weight: 700;
        color: #475569 !important;
    }

    .kte-l input, .kte-l textarea, .kte select, .kte-num {
        border: 1.5px solid #e2e8f0;
        border-radius: 11px;
        padding: 8px 11px;
        background: #fff;
        font-family: inherit;
        font-size: .9rem;
        color: #1e293b !important;
        outline: none;
        transition: border-color .15s, box-shadow .15s;
        width: 100%;
    }

        .kte-l input:focus, .kte-l textarea:focus, .kte select:focus, .kte-num:focus {
            border-color: #818cf8;
            box-shadow: 0 0 0 3px rgba(129, 140, 248, .2);
        }

    .kte-l textarea {
        resize: vertical;
    }

.kte .ltr {
    direction: ltr;
    text-align: left;
}

.kte-title {
    font-size: 1.05rem !important;
    font-weight: 700;
}

.kte-l-sm input {
    font-size: .84rem;
    padding: 6px 10px;
}

.kte-ph {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

    .kte-ph small {
        color: var(--kt-muted) !important;
        font-size: .75rem;
    }

    .kte-ph button {
        border: 1px dashed #c7d2fe;
        background: #eef2ff;
        color: #4338ca !important;
        border-radius: 8px;
        padding: 1px 8px;
        font-size: .78rem;
        cursor: pointer;
        font-family: inherit;
    }

        .kte-ph button:hover {
            background: #e0e7ff;
        }

.kte-sample {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: #475569 !important;
    background: #f8fafc;
    border-radius: 10px;
    padding: 6px 10px;
}

    .kte-sample svg {
        width: 16px;
        height: 16px;
        fill: #64748b !important;
    }

    .kte-sample b {
        color: #0f766e !important;
    }

.kte-kinds {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

    .kte-kinds button {
        border: 1.5px solid #d1fae5;
        background: #fff;
        border-radius: 13px;
        padding: 10px 6px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-family: inherit;
        font-weight: 700;
        font-size: .86rem;
        color: #475569 !important;
        transition: .15s;
    }

        .kte-kinds button svg {
            width: 22px;
            height: 22px;
            fill: #94a3b8 !important;
        }

        .kte-kinds button:hover {
            border-color: #6ee7b7;
        }

        .kte-kinds button.on {
            background: linear-gradient(135deg, #10b981, #0d9488);
            border-color: transparent;
            color: white !important;
            box-shadow: 0 8px 18px rgba(16, 185, 129, .3);
            transform: translateY(-1px);
        }

            .kte-kinds button.on span {
                color: white !important;
            }

            .kte-kinds button.on svg {
                fill: #ffffff !important;
            }

.kte-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .88rem;
    font-weight: 700;
    color: #334155 !important;
}

    .kte-row select {
        width: auto;
    }

.kte-num {
    width: 72px !important;
    text-align: center !important;
}

.kte-days {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

    .kte-days button {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1.5px solid #e2e8f0;
        background: #fff;
        cursor: pointer;
        font-family: inherit;
        font-weight: 800;
        color: #475569 !important;
        transition: .15s;
    }

        .kte-days button.fri {
            color: #e11d48 !important;
        }

        .kte-days button.on {
            background: linear-gradient(135deg, #8b5cf6, #6d28d9);
            border-color: transparent;
            color: white !important;
            box-shadow: 0 6px 14px rgba(124, 58, 237, .3);
        }

        .kte-days button.kte-days-all {
            width: auto;
            border-radius: 10px;
            padding: 0 12px;
            font-size: .78rem;
            font-weight: 700;
            border-style: dashed;
        }

.kte-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.kte-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.kte-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .85rem;
    color: #334155 !important;
    cursor: pointer;
    line-height: 1.6;
}

    .kte-check input {
        margin-top: 5px;
        width: 17px;
        height: 17px;
        accent-color: #10b981;
        flex-shrink: 0;
    }

    .kte-check small {
        color: var(--kt-muted) !important;
    }

.kte-rot {
    background: #eef2ff;
    border-radius: 10px;
    padding: 6px 10px;
}

.kte-share {
    background: #fdf2f8;
    border-radius: 10px;
    padding: 8px 10px;
}

    .kte-share input {
        accent-color: #db2777;
    }

.kte-sub-l {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    font-weight: 700;
    color: #64748b !important;
}

    .kte-sub-l svg {
        width: 16px;
        height: 16px;
    }

.kte-hint {
    color: #0f766e !important;
    font-size: .78rem;
}

/* --- پیش‌نمایش --- */
.kte-side {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .kte-side h5 {
        margin: 6px 0 0;
        font-size: .85rem;
        font-weight: 800;
        color: #334155 !important;
    }

.kte-sum {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #059669, #0d9488 60%, #4f46e5);
    box-shadow: 0 12px 26px rgba(13, 148, 136, .3);
}

    .kte-sum.tpl {
        background: linear-gradient(135deg, #0284c7, #4f46e5);
        box-shadow: 0 12px 26px rgba(79, 70, 229, .3);
    }

    .kte-sum > svg {
        width: 26px;
        height: 26px;
        flex-shrink: 0;
        fill: #ffffff !important;
    }

    .kte-sum b {
        display: block;
        color: white !important;
        font-size: .98rem;
        margin-bottom: 4px;
    }

    .kte-sum span {
        display: block;
        color: #d1fae5 !important;
        font-size: .8rem;
        line-height: 1.7;
    }

    .kte-sum.tpl span {
        color: #dbeafe !important;
    }

.kte-pv {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .kte-pv li {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #fff;
        border: 1px solid var(--kt-border);
        border-radius: 13px;
        padding: 7px 10px;
        animation: ktIn .3s ease both;
    }

        .kte-pv li:nth-child(2) {
            animation-delay: .04s;
        }

        .kte-pv li:nth-child(3) {
            animation-delay: .08s;
        }

        .kte-pv li:nth-child(4) {
            animation-delay: .12s;
        }

        .kte-pv li:nth-child(5) {
            animation-delay: .16s;
        }

        .kte-pv li:nth-child(6) {
            animation-delay: .2s;
        }

        .kte-pv li.first {
            border-color: #6ee7b7;
            box-shadow: 0 0 0 3px #d1fae5;
        }

        .kte-pv li.skip {
            opacity: .6;
            background: #f8fafc;
        }

.kte-pv-d {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: #ecfdf5;
    color: #047857 !important;
    font-weight: 800;
    text-align: center !important;
}

.kte-pv li.skip .kte-pv-d {
    background: #f1f5f9;
    color: #94a3b8 !important;
}

.kte-pv-t {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .kte-pv-t b {
        font-size: .84rem;
        color: #1e293b !important;
    }

    .kte-pv-t small {
        font-size: .74rem;
        color: var(--kt-muted) !important;
    }

        .kte-pv-t small.mv {
            color: #b45309 !important;
        }

        .kte-pv-t small.who {
            color: #4338ca !important;
            font-weight: 700;
        }

.kte-pv-empty {
    font-size: .82rem;
    color: #b45309 !important;
    background: #fffbeb;
    border-radius: 10px;
    padding: 8px 10px;
}

.kte-tip {
    display: flex;
    gap: 8px;
    font-size: .82rem;
    line-height: 1.7;
    color: #475569 !important;
    background: #fff;
    border: 1px dashed #c7d2fe;
    border-radius: 13px;
    padding: 10px 12px;
}

    .kte-tip svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        fill: #f59e0b !important;
    }

.kte-err {
    margin: 0 20px 6px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c !important;
    border-radius: 11px;
    padding: 8px 12px;
    font-size: .86rem;
    font-weight: 700;
}

.kte-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--kt-border);
    background: #fff;
}

.kte-del-q {
    color: #be123c !important;
    font-weight: 700;
    font-size: .85rem;
}

.kte-del:hover {
    color: #e11d48 !important;
    border-color: #fecdd3;
}

/* ---------------- کادر صفحه‌ی وظیفه ---------------- */
.ktx .kt-sec-head {
    margin-bottom: 8px;
}

.ktx-recur {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: .84rem;
    color: #065f46 !important;
    text-decoration: none !important;
    margin-bottom: 8px;
    transition: .15s;
}

    .ktx-recur:hover {
        background: #d1fae5;
    }

    .ktx-recur svg {
        width: 18px;
        height: 18px;
        fill: #059669 !important;
        flex-shrink: 0;
    }

    .ktx-recur small {
        display: block;
        color: #047857 !important;
        font-size: .76rem;
    }

.ktx-wait {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e !important;
    border-radius: 12px;
    padding: 7px 10px;
    font-size: .82rem;
    margin-bottom: 8px;
}

    .ktx-wait svg {
        width: 18px;
        height: 18px;
        fill: #d97706 !important;
        animation: ktWiggle 3s ease-in-out infinite;
    }

.ktx-acts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ktx-act {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--kt-border);
    background: var(--kt-soft);
    border-radius: 11px;
    padding: 8px 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: .8rem;
    color: #3730a3 !important;
    cursor: pointer;
    transition: .15s;
}

    .ktx-act:hover {
        background: #eef2ff;
        border-color: #c7d2fe;
        transform: translateY(-1px);
    }

    .ktx-act svg {
        width: 18px;
        height: 18px;
        fill: #6366f1 !important;
        flex-shrink: 0;
    }

    .ktx-act:nth-child(2) svg {
        fill: #059669 !important;
    }

.ktx-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.ktx-link {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "k k k" "t w x";
    gap: 2px 6px;
    align-items: center;
    border: 1px solid var(--kt-border);
    border-right: 3px solid #a5b4fc;
    border-radius: 10px;
    padding: 6px 8px;
    background: #fff;
}

    .ktx-link.k2 {
        border-right-color: #f59e0b;
    }

    .ktx-link.k3 {
        border-right-color: #94a3b8;
    }

    .ktx-link.done {
        opacity: .7;
    }

.ktx-kind {
    grid-area: k;
    font-size: .7rem;
    font-weight: 700;
    color: var(--kt-muted) !important;
}

.ktx-link.k2 .ktx-kind {
    color: #b45309 !important;
}

.ktx-t {
    grid-area: t;
    font-size: .82rem;
    color: #1e293b !important;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

    .ktx-t b {
        color: var(--kt-p) !important;
    }

a.ktx-t:hover {
    color: var(--kt-p) !important;
}

.ktx-link.done .ktx-t {
    text-decoration: line-through !important;
}

.ktx-st {
    color: #10b981 !important;
    font-weight: 800;
    font-size: .75rem;
}

.ktx-who {
    grid-area: w;
}

    .ktx-who .tm-av, .ktx-who img {
        width: 22px !important;
        height: 22px !important;
    }

.ktx-x {
    grid-area: x;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #94a3b8 !important;
    font-size: 1.1rem;
    line-height: 1;
}

    .ktx-x:hover {
        color: #e11d48 !important;
    }

.ktx-add {
    margin-top: 8px;
}

.ktx-addbox {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: ktIn .25s ease both;
}

    .ktx-addbox > input {
        border: 1.5px solid #e2e8f0;
        border-radius: 10px;
        padding: 7px 10px;
        font-family: inherit;
        font-size: .86rem;
        outline: none;
        color: #1e293b !important;
    }

        .ktx-addbox > input:focus {
            border-color: #818cf8;
        }

.ktx-kinds {
    display: flex;
    gap: 4px;
}

    .ktx-kinds button {
        flex: 1;
        border: 1.5px solid var(--kt-border);
        background: #fff;
        border-radius: 9px;
        padding: 5px 6px;
        font-size: .76rem;
        font-weight: 700;
        cursor: pointer;
        font-family: inherit;
        color: #475569 !important;
    }

        .ktx-kinds button.on {
            background: #eef2ff;
            border-color: #a5b4fc;
            color: #3730a3 !important;
        }

.ktx-res {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 220px;
    overflow: auto;
}

    .ktx-res button {
        display: flex;
        align-items: center;
        gap: 6px;
        border: 0;
        background: var(--kt-soft);
        border-radius: 9px;
        padding: 6px 8px;
        cursor: pointer;
        font-family: inherit;
        font-size: .8rem;
        color: #1e293b !important;
        text-align: right !important;
    }

        .ktx-res button:hover {
            background: #eef2ff;
        }

        .ktx-res button b {
            color: var(--kt-p) !important;
        }

        .ktx-res button small {
            color: var(--kt-muted) !important;
            font-size: .72rem;
            white-space: nowrap;
        }

        .ktx-res button span {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

/* ---------------- نوار الگو در فرم «وظیفه جدید» ---------------- */
.ktb {
    background: #fff;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ktb-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ktb-l {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    font-weight: 800;
    color: #475569 !important;
    margin-left: 4px;
}

    .ktb-l svg {
        width: 16px;
        height: 16px;
        fill: #0284c7 !important;
    }

.ktb-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1.5px solid #bae6fd;
    background: #f0f9ff;
    color: #075985 !important;
    border-radius: 99px;
    padding: 3px 11px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    max-width: 200px;
    transition: .15s;
}

    .ktb-chip span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ktb-chip svg {
        width: 14px;
        height: 14px;
        fill: #db2777 !important;
        flex-shrink: 0;
    }

    .ktb-chip:hover {
        background: #e0f2fe;
        transform: translateY(-1px);
    }

    .ktb-chip.on {
        background: linear-gradient(135deg, #0ea5e9, #4f46e5);
        border-color: transparent;
        color: white !important;
    }

        .ktb-chip.on span {
            color: white !important;
        }

.ktb-more svg {
    fill: #0369a1 !important;
}

.ktb-none {
    color: var(--kt-muted) !important;
    font-size: .76rem;
}

.ktb-skel {
    width: 80px;
    height: 24px;
    border-radius: 99px;
    background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9);
    background-size: 200% 100%;
    animation: ktShimmer 1.2s linear infinite;
}

.ktb-all {
    display: flex;
    flex-direction: column;
    gap: 5px;
    animation: ktIn .2s ease both;
}

    .ktb-all input {
        border: 1.5px solid #e2e8f0;
        border-radius: 9px;
        padding: 6px 10px;
        font-family: inherit;
        font-size: .82rem;
        outline: none;
        color: #1e293b !important;
    }

.ktb-all-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 180px;
    overflow: auto;
}

    .ktb-all-list button {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        border: 0;
        background: transparent;
        border-radius: 8px;
        padding: 6px 8px;
        cursor: pointer;
        font-family: inherit;
        font-size: .82rem;
        color: #1e293b !important;
    }

        .ktb-all-list button:hover {
            background: #f0f9ff;
        }

        .ktb-all-list button small {
            color: var(--kt-muted) !important;
        }

.ktb-tools {
    border-top: 1px dashed var(--kt-border);
    padding-top: 8px;
}

.ktb-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: var(--kt-soft);
    color: #3730a3 !important;
    border-radius: 9px;
    padding: 5px 10px;
    font-size: .77rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none !important;
    transition: .15s;
}

    .ktb-btn svg {
        width: 15px;
        height: 15px;
        fill: #6366f1 !important;
    }

    .ktb-btn:hover {
        background: #eef2ff;
    }

    .ktb-btn.recur {
        background: #ecfdf5;
        color: #065f46 !important;
    }

        .ktb-btn.recur svg {
            fill: #059669 !important;
        }

        .ktb-btn.recur:hover {
            background: #d1fae5;
        }

    .ktb-btn.ghost {
        background: transparent;
        color: var(--kt-muted) !important;
        margin-right: auto;
    }

        .ktb-btn.ghost svg {
            fill: #94a3b8 !important;
        }

/* ---------------- موبایل ---------------- */
@media (max-width: 900px) {
    .kte-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .kte-side {
        position: static;
        order: -1;
        min-width: 0;
    }

        .kte-side .kte-pv {
            flex-direction: row;
            overflow-x: auto;
            padding-bottom: 4px;
        }

            .kte-side .kte-pv li {
                min-width: 170px;
            }

    .ktl-row {
        grid-template-columns: 40px 1fr;
    }

    .ktl-k {
        width: 40px;
        height: 40px;
    }

    .ktl-stats {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .ktl-acts {
        grid-column: 1 / -1;
        justify-content: flex-end;
        border-top: 1px dashed var(--kt-border);
        padding-top: 6px;
    }
}

@media (max-width: 600px) {
    .kte {
        top: 0;
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .kte-body {
        padding: 12px;
    }

    .kte-grid, .kte-grid-2 {
        grid-template-columns: 1fr;
    }

    .kte-kinds button {
        padding: 8px 2px;
        font-size: .78rem;
    }

    .kte-days button {
        width: 36px;
        height: 36px;
    }

    .kte-foot {
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .ktl-search {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }

        .ktl-search input {
            width: 100%;
        }

    .ktl-sug {
        padding: 12px;
    }

    .ktl-sug-ico {
        display: none;
    }

    .ktl-sug-row {
        flex-wrap: wrap;
    }

        .ktl-sug-row > .kt-grow {
            flex-basis: 100%;
        }

    .ktl-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ktl-spin, .kte-head.recur .kte-hico svg, .ktl-dot.l, .ktx-wait svg {
        animation: none !important;
    }
}

/* فرم الگو روی پنل «وظیفه جدید» باز می‌شود؛ پنل بعد از انیمیشن ورود نباید transform نگه دارد
   (وگرنه پنجره‌ی وسط صفحه داخل پنل جا می‌گیرد) */
.ktq {
    animation-fill-mode: backwards;
}

/* =====================================================================
   مرحله ۱۱: تنظیمات و دسترسی پروژه (kps-)، کادر تمدید مهلت در صفحه‌ی وظیفه (kpd-)
   ===================================================================== */

.kps {
    margin-top: 2px;
}

.kps-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 0 16px;
    align-items: start;
}

.kps-main, .kps-side {
    min-width: 0;
}

.kps h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.kps-side h3 {
    margin-bottom: 10px;
}

    .kps-side h3 > .mud-icon-root {
        width: 20px;
        height: 20px;
        fill: #6366f1;
    }

.kps-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

    .kps-head small {
        display: block;
        font-size: .78rem;
        margin-top: 2px;
    }

.kps-hic {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .22);
}

    .kps-hic .mud-icon-root {
        width: 23px;
        height: 23px;
    }

.kps-lock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .76rem;
    font-weight: 700;
    color: #64748b !important;
    background: #f1f5f9;
    border-radius: 99px;
    padding: 4px 10px;
    white-space: nowrap;
}

    .kps-lock .mud-icon-root {
        width: 15px;
        height: 15px;
    }

.kps-small {
    font-size: .82rem;
    line-height: 1.8;
}

/* ---------------- قانون‌ها ---------------- */
.kps-rules {
    position: relative;
    transition: box-shadow .25s, border-color .25s;
}

    .kps-rules.dirty {
        border-color: #c7d2fe;
        box-shadow: 0 10px 30px rgba(79, 70, 229, .14);
    }

.kps-rule {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 10px;
    border-radius: 14px;
    border-top: 1px solid var(--kt-border);
    transition: background .2s;
    position: relative;
}

    .kps-rule:first-of-type {
        border-top: 0;
    }

    .kps-rule.chg {
        background: #eef2ff;
        border-top-color: transparent;
    }

        .kps-rule.chg::after {
            content: "تغییر کرده";
            position: absolute;
            top: 8px;
            left: 10px;
            font-size: .66rem;
            font-weight: 800;
            color: white !important;
            background: #6366f1;
            border-radius: 99px;
            padding: 1px 8px;
            animation: ktIn .3s ease both;
        }

        .kps-rule.chg:has(.kps-sw)::after {
            left: 70px;
        }

.kps-ric {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #f1f5f9;
    background: color-mix(in srgb, var(--c) 13%, white);
}

    .kps-ric .mud-icon-root {
        width: 20px;
        height: 20px;
        fill: var(--c);
    }

.kps-rt {
    cursor: pointer;
    margin: 0;
}

    .kps-rt b {
        display: block;
        font-size: .92rem;
        font-weight: 800;
    }

    .kps-rt small {
        display: block;
        color: var(--kt-muted) !important;
        font-size: .79rem;
        line-height: 1.75;
        margin-top: 2px;
    }

.kps-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 9px;
    background: var(--kt-soft);
    border: 1px solid var(--kt-border);
    border-radius: 12px;
    padding: 3px;
}

    .kps-seg button {
        border: 0;
        background: transparent;
        font: inherit;
        font-size: .8rem;
        font-weight: 700;
        padding: 6px 12px;
        border-radius: 9px;
        cursor: pointer;
        color: #475569 !important;
        transition: background .15s, color .15s, box-shadow .15s;
    }

        .kps-seg button:hover:not(:disabled):not(.on) {
            background: white;
        }

        .kps-seg button.on {
            background: linear-gradient(135deg, var(--kt-p), var(--kt-p2));
            color: white !important;
            box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
        }

        .kps-seg button:disabled {
            cursor: default;
        }

            .kps-seg button:disabled:not(.on) {
                opacity: .55;
            }

/* سوییچ */
.kps-sw {
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
    margin-top: 4px;
}

    .kps-sw input {
        position: absolute;
        inset: 0;
        opacity: 0;
        margin: 0;
        cursor: pointer;
        z-index: 2;
    }

        .kps-sw input:disabled {
            cursor: default;
        }

    .kps-sw i {
        position: absolute;
        inset: 0;
        border-radius: 99px;
        background: #cbd5e1;
        transition: background .2s;
    }

        .kps-sw i::after {
            content: "";
            position: absolute;
            top: 3px;
            right: 3px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: white;
            box-shadow: 0 2px 6px rgba(15, 23, 42, .25);
            transition: right .22s cubic-bezier(.4, 1.4, .6, 1);
        }

    .kps-sw.on i {
        background: linear-gradient(135deg, #10b981, #059669);
    }

        .kps-sw.on i::after {
            right: 23px;
        }

    .kps-sw input:focus-visible + i {
        outline: 3px solid #a5b4fc;
        outline-offset: 2px;
    }

    .kps-sw input:disabled + i {
        opacity: .6;
    }

/* نوار ذخیره */
.kps-save {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #1e1b4b;
    box-shadow: 0 14px 30px rgba(30, 27, 75, .35);
    animation: kpsUp .3s ease both;
}

    .kps-save b {
        display: block;
        color: white !important;
        font-size: .88rem;
    }

    .kps-save small {
        display: block;
        color: #c7d2fe !important;
        font-size: .74rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kps-save .kt-btn-ghost {
        color: #e0e7ff !important;
        background: rgba(255, 255, 255, .08);
    }

.kps-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fbbf24;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(251, 191, 36, .6);
    animation: kpsPulse 1.6s infinite;
}

@keyframes kpsUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes kpsPulse {
    70% {
        box-shadow: 0 0 0 9px rgba(251, 191, 36, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

/* ---------------- ماتریس دسترسی ---------------- */
.kps-mxw {
    overflow-x: auto;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
}

.kps-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .8rem;
    min-width: 620px;
}

    .kps-table th, .kps-table td {
        padding: 9px 8px;
        border-bottom: 1px solid var(--kt-border);
        vertical-align: middle;
    }

    .kps-table tbody tr:last-child th, .kps-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .kps-table thead th {
        background: var(--kt-soft);
        font-weight: 800;
        font-size: .76rem;
        color: #475569 !important;
        text-align: center !important;
        white-space: nowrap;
    }

        .kps-table thead th.me {
            color: #4338ca !important;
            background: #eef2ff;
        }

        .kps-table thead th small {
            display: block;
            font-size: .64rem;
            color: white !important;
            background: #6366f1;
            border-radius: 99px;
            width: max-content;
            margin: 3px auto 0;
            padding: 0 7px;
        }

    .kps-table tbody th {
        text-align: right !important;
        font-weight: 400;
        background: white;
        position: sticky;
        right: 0;
        z-index: 1;
        min-width: 190px;
    }

        .kps-table tbody th b {
            display: block;
            font-weight: 800;
            font-size: .82rem;
        }

        .kps-table tbody th small {
            display: block;
            color: var(--kt-muted) !important;
            font-size: .7rem;
            line-height: 1.6;
        }

    .kps-table td {
        text-align: center !important;
        transition: background .25s;
    }

        .kps-table td.me {
            background: #f8faff;
        }

        .kps-table td.chg {
            background: #fef9c3;
            animation: kpsFlash .7s ease;
        }

@keyframes kpsFlash {
    0% {
        background: #fde047;
    }

    100% {
        background: #fef9c3;
    }
}

.kps-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

    .kps-cell .mud-icon-root {
        width: 20px;
        height: 20px;
    }

    .kps-cell em {
        font-style: normal;
        font-size: .66rem;
        font-weight: 700;
    }

.kps-table .v1 .kps-cell, .kps-legend .v1 {
    color: #059669 !important;
}

    .kps-table .v1 .mud-icon-root, .kps-legend .v1 .mud-icon-root {
        fill: #10b981;
    }

.kps-table .v2 .kps-cell, .kps-legend .v2 {
    color: #b45309 !important;
}

    .kps-table .v2 .mud-icon-root, .kps-legend .v2 .mud-icon-root {
        fill: #f59e0b;
    }

.kps-table .v3 .kps-cell, .kps-legend .v3 {
    color: #0369a1 !important;
}

    .kps-table .v3 .mud-icon-root, .kps-legend .v3 .mud-icon-root {
        fill: #0ea5e9;
    }

.kps-table .v0 .kps-cell, .kps-legend .v0 {
    color: #94a3b8 !important;
}

    .kps-table .v0 .mud-icon-root, .kps-legend .v0 .mud-icon-root {
        fill: #cbd5e1;
    }

.kps-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: .74rem;
    font-weight: 700;
}

    .kps-legend span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .kps-legend .mud-icon-root {
        width: 16px;
        height: 16px;
    }

/* ---------------- وزن کارها ---------------- */
.kps-prog {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--kt-soft);
    border-radius: 12px;
    padding: 5px 10px;
}

    .kps-prog span {
        text-align: center !important;
    }

    .kps-prog small {
        display: block;
        font-size: .64rem;
        color: var(--kt-muted) !important;
    }

    .kps-prog b {
        font-size: 1rem;
        font-weight: 800;
    }

    .kps-prog .w b {
        color: #059669 !important;
    }

    .kps-prog > .mud-icon-root {
        width: 16px;
        height: 16px;
        fill: #94a3b8;
    }

.kps-wrow {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 6px;
    border-top: 1px solid var(--kt-border);
}

    .kps-wrow.isdone .kps-wt-t {
        color: #94a3b8 !important;
    }

.kps-wt-t {
    font-size: .84rem;
    text-decoration: none !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .kps-wt-t b {
        color: #6366f1 !important;
        font-weight: 700;
        margin-left: 4px;
    }

.kps-wp {
    font-size: .72rem;
    color: var(--kt-muted) !important;
    min-width: 34px;
    text-align: center !important;
}

.kps-chips {
    display: inline-flex;
    gap: 3px;
    direction: ltr;
}

    .kps-chips button {
        width: 26px;
        height: 26px;
        border-radius: 8px;
        border: 1.5px solid #d1fae5;
        background: white;
        font: inherit;
        font-size: .76rem;
        font-weight: 800;
        color: #6b7280 !important;
        cursor: pointer;
        transition: transform .12s, background .15s;
    }

        .kps-chips button.fill {
            background: #d1fae5;
            color: #065f46 !important;
        }

        .kps-chips button.on {
            background: linear-gradient(135deg, #10b981, #059669);
            border-color: #059669;
            color: white !important;
            transform: scale(1.08);
        }

        .kps-chips button:hover:not(:disabled) {
            transform: translateY(-2px);
        }

.kps-more {
    display: block;
    margin: 10px auto 0;
}

/* ---------------- ستون کناری ---------------- */
.kps-ai {
    background: linear-gradient(135deg, #f5f3ff, #eef2ff);
    border-color: #ddd6fe;
}

    .kps-ai h3 > .mud-icon-root {
        fill: #7c3aed;
    }

.kps-hint {
    display: flex;
    gap: 8px;
    font-size: .82rem;
    line-height: 1.8;
    padding: 7px 0;
    border-top: 1px dashed #ddd6fe;
}

    .kps-hint:first-of-type {
        border-top: 0;
    }

    .kps-hint .mud-icon-root {
        width: 18px;
        height: 18px;
        fill: #f59e0b;
        flex-shrink: 0;
        margin-top: 3px;
    }

/* درخواست تمدید (هم در تب تنظیمات و هم در صفحه‌ی وظیفه) */
.kps-rq, .kpd-pend {
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    border-radius: 14px;
    padding: 10px 12px;
    margin-top: 8px;
    animation: ktIn .35s ease both;
}

.kps-rq-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .kps-rq-top b {
        display: block;
        font-size: .86rem;
    }

    .kps-rq-top small {
        display: block;
        font-size: .7rem;
        color: var(--kt-muted) !important;
    }

.kps-days {
    font-size: .74rem;
    font-weight: 800;
    color: #0369a1 !important;
    background: #e0f2fe;
    border-radius: 99px;
    padding: 2px 9px;
    white-space: nowrap;
}

    .kps-days.neg {
        color: #047857 !important;
        background: #d1fae5;
    }

.kps-rq-t {
    display: block;
    font-size: .83rem;
    font-weight: 700;
    margin-top: 8px;
    text-decoration: none !important;
    color: #1e1b4b !important;
}

.kps-rq-d {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: .82rem;
    direction: rtl;
}

    .kps-rq-d span {
        color: #94a3b8 !important;
        text-decoration: line-through;
    }

    .kps-rq-d b {
        color: #0369a1 !important;
    }

    .kps-rq-d .mud-icon-root {
        width: 15px;
        height: 15px;
        fill: #7dd3fc;
    }

.kps-rq-why {
    font-size: .8rem;
    line-height: 1.8;
    margin-top: 6px;
    color: #334155 !important;
    background: white;
    border-radius: 10px;
    padding: 6px 9px;
}

.kps-rq-act {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.kps-note, .kpd-form textarea, .kpd-form input {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 11px;
    padding: 8px 10px;
    font: inherit;
    font-size: .84rem;
    background: white;
    margin-top: 8px;
    resize: vertical;
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}

    .kps-note:focus, .kpd-form textarea:focus, .kpd-form input:focus {
        border-color: #818cf8;
        box-shadow: 0 0 0 3px rgba(129, 140, 248, .2);
    }

.kps-past {
    margin-top: 10px;
    font-size: .8rem;
}

    .kps-past summary {
        cursor: pointer;
        color: #4338ca !important;
        font-weight: 700;
    }

.kps-prq {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 0;
    border-top: 1px solid var(--kt-border);
}

    .kps-prq small {
        color: var(--kt-muted) !important;
    }

.kps-pill {
    font-size: .68rem;
    font-weight: 800;
    border-radius: 99px;
    padding: 1px 8px;
    white-space: nowrap;
    background: #f1f5f9;
    color: #64748b !important;
}

.kps-prq.s1 .kps-pill {
    background: #d1fae5;
    color: #047857 !important;
}

.kps-prq.s2 .kps-pill {
    background: #ffe4e6;
    color: #be123c !important;
}

/* بایگانی */
.kps-ar h3 > .mud-icon-root {
    fill: #64748b;
}

.kps-ar.is {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.kps-ar-l {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

    .kps-ar-l li {
        display: flex;
        gap: 8px;
        align-items: flex-start;
        font-size: .8rem;
        line-height: 1.75;
        padding: 5px 0;
    }

        .kps-ar-l li .mud-icon-root {
            width: 17px;
            height: 17px;
            fill: #94a3b8;
            flex-shrink: 0;
            margin-top: 3px;
        }

        .kps-ar-l li.w .mud-icon-root {
            fill: #f59e0b;
        }

        .kps-ar-l li.ok .mud-icon-root {
            fill: #10b981;
        }

.kps-arbtn {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
}

.kps-confirm {
    margin-top: 12px;
    border: 1.5px solid #fcd34d;
    background: #fffbeb;
    border-radius: 13px;
    padding: 10px 12px;
    animation: ktIn .3s ease both;
}

    .kps-confirm b {
        display: block;
        font-size: .88rem;
        color: #92400e !important;
    }

    .kps-confirm small {
        display: block;
        font-size: .77rem;
        color: #a16207 !important;
        margin-top: 3px;
        line-height: 1.7;
    }

    .kps-confirm div {
        display: flex;
        justify-content: flex-end;
        gap: 6px;
        margin-top: 8px;
    }

/* تاریخچه */
.kps-hist h3 > .mud-icon-root {
    fill: #0ea5e9;
}

.kps-hrow {
    display: flex;
    gap: 10px;
    font-size: .8rem;
    line-height: 1.75;
    padding: 6px 0;
    position: relative;
}

    .kps-hrow i {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: #a5b4fc;
        flex-shrink: 0;
        margin-top: 8px;
        box-shadow: 0 0 0 3px #eef2ff;
    }

    .kps-hrow:not(:last-of-type)::before {
        content: "";
        position: absolute;
        right: 4px;
        top: 20px;
        bottom: -6px;
        width: 1px;
        background: #e0e7ff;
    }

    .kps-hrow.a-settings i {
        background: #6366f1;
    }

    .kps-hrow.a-archive i {
        background: #64748b;
    }

    .kps-hrow.a-unarchive i {
        background: #10b981;
    }

    .kps-hrow.a-member-add i, .kps-hrow.a-manager i {
        background: #f59e0b;
    }

    .kps-hrow small {
        display: block;
        color: var(--kt-muted) !important;
        font-size: .7rem;
    }

/* ---------------- نوار بایگانی بالای صفحه‌ی پروژه + دستیار بایگانی ---------------- */
.kps-banner, .kps-assist-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kps-banner {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1.5px solid #cbd5e1;
}

    .kps-banner b, .kps-assist-top b {
        display: block;
        font-size: .92rem;
        color: #334155 !important;
    }

    .kps-banner small, .kps-assist-top small {
        display: block;
        font-size: .78rem;
        line-height: 1.7;
        color: #64748b !important;
    }

.kps-banner-ic {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #64748b, #334155);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.kps-assist {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1.5px solid #e2e8f0;
    animation: ktIn .45s .1s ease both;
}

.kps-assist-l {
    margin-top: 10px;
    background: white;
    border-radius: 13px;
    border: 1px solid var(--kt-border);
    overflow: hidden;
}

.kps-arow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-top: 1px solid var(--kt-border);
}

    .kps-arow:first-child {
        border-top: 0;
    }

    .kps-arow a {
        text-decoration: none !important;
        min-width: 0;
    }

        .kps-arow a b {
            display: block;
            font-size: .86rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .kps-arow a small {
            display: block;
            font-size: .74rem;
            color: var(--kt-muted) !important;
        }

    .kps-arow.all {
        justify-content: flex-end;
        background: var(--kt-soft);
        font-size: .82rem;
    }

.kps-pic {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* ---------------- صفحه‌ی وظیفه: تمدید مهلت ---------------- */
.kpd .kt-sec-head {
    margin-bottom: 4px;
}

.kpd-ask {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: .86rem;
}

    .kpd-ask small {
        display: block;
        font-size: .76rem;
        color: var(--kt-muted) !important;
        line-height: 1.7;
        margin-top: 2px;
    }

.kpd-form {
    animation: ktIn .3s ease both;
}

.kpd-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .kpd-quick button {
        border: 1.5px solid #e0e7ff;
        background: white;
        border-radius: 11px;
        padding: 5px 10px;
        font: inherit;
        font-size: .78rem;
        font-weight: 700;
        cursor: pointer;
        color: #4338ca !important;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        line-height: 1.4;
        transition: transform .12s, background .15s;
    }

        .kpd-quick button small {
            font-size: .66rem;
            font-weight: 400;
            color: #6b7280 !important;
            direction: ltr;
        }

        .kpd-quick button.on {
            background: linear-gradient(135deg, var(--kt-p), var(--kt-p2));
            border-color: transparent;
            color: white !important;
        }

            .kpd-quick button.on small {
                color: #e0e7ff !important;
            }

        .kpd-quick button:hover {
            transform: translateY(-2px);
        }

.kpd-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 8px;
}

.kpd-form label {
    display: block;
    margin: 8px 0 0;
}

    .kpd-form label > span {
        display: block;
        font-size: .74rem;
        font-weight: 700;
        color: #475569 !important;
    }

.kpd-form input {
    margin-top: 3px;
    text-align: left !important;
}

.kpd-form textarea {
    margin-top: 3px;
}

/* ---------------- موبایل ---------------- */
@media (max-width: 1000px) {
    .kps-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .kps-rule {
        padding: 12px 4px;
        gap: 10px;
    }

        .kps-rule.chg::after {
            top: auto;
            bottom: 6px;
        }

        .kps-rule.chg:has(.kps-sw)::after {
            left: 10px;
        }

    .kps-ric {
        width: 32px;
        height: 32px;
    }

    .kps-seg {
        display: flex;
    }

        .kps-seg button {
            flex: 1 1 auto;
            padding: 7px 8px;
        }

    .kps-head .kps-lock {
        display: none;
    }

    .kps-wrow {
        flex-wrap: wrap;
    }

    .kps-wt-t {
        flex: 1 1 100%;
    }

    .kps-chips {
        margin-right: auto;
    }

    .kps-save small {
        display: none;
    }

    .kps-banner, .kps-assist-top {
        flex-wrap: wrap;
    }

        .kps-banner .kt-grow, .kps-assist-top .kt-grow {
            flex: 1 1 calc(100% - 60px);
        }

    .kpd-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .kps-table {
        min-width: 470px;
        font-size: .74rem;
    }

        .kps-table tbody th {
            min-width: 112px;
            max-width: 130px;
            box-shadow: -6px 0 10px -8px rgba(30, 27, 75, .25);
        }

            .kps-table tbody th small {
                display: none;
            }

        .kps-table thead th {
            white-space: normal;
            font-size: .68rem;
            padding: 8px 4px;
        }

        .kps-table td {
            padding: 8px 3px;
        }
}
/* =====================================================================
   مرحله ۱۲ — اتاق پایش (/tasks/monitor)   پیشوند: kmo-
   ===================================================================== */
.kmo-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #0d9488 100%);
    padding-bottom: 52px !important;
}

.kmo-stale {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 12px;
    padding: 4px 8px;
}

    .kmo-stale select {
        background: transparent;
        border: 0;
        color: white !important;
        font: inherit;
        font-weight: 700;
        outline: none;
        cursor: pointer;
    }

        .kmo-stale select option {
            color: #1e1b4b !important;
        }

.kmo-spin {
    animation: kmo-spin 1s linear infinite;
}

@keyframes kmo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- کارت‌های شاخص ---------- */
.kmo-cards {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
    margin: -34px 14px 16px;
    position: relative;
    z-index: 2;
}

.kmo-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 12px 10px;
    background: #fff;
    border: 1px solid var(--kt-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(30,27,75,.08);
    text-decoration: none !important;
    transition: transform .15s, box-shadow .15s;
    border-top: 4px solid var(--c, #4f46e5);
    animation: kmo-in .35s both;
}

    .kmo-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(30,27,75,.14);
    }

    .kmo-card.t-blue {
        --c: #2563eb;
    }

    .kmo-card.t-red {
        --c: #e11d48;
    }

    .kmo-card.t-orange {
        --c: #ea580c;
    }

    .kmo-card.t-amber {
        --c: #d97706;
    }

    .kmo-card.t-violet {
        --c: #7c3aed;
    }

    .kmo-card.t-slate {
        --c: #475569;
    }

    .kmo-card.t-green {
        --c: #059669;
    }

    .kmo-card.hot {
        background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, #fff), #fff);
    }

    .kmo-card.zero .kmo-card-val {
        color: #94a3b8 !important;
    }

.kmo-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.kmo-card-lbl {
    font-size: .78rem;
    font-weight: 700;
    color: var(--kt-muted) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kmo-card-val {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--c) !important;
}

.kmo-card-sub {
    font-size: .72rem;
    color: var(--kt-muted) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kmo-i {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--kt-soft);
    color: var(--kt-muted) !important;
    font-size: .7rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    cursor: help;
}

.kmo-tip {
    display: none;
    position: absolute;
    top: 24px;
    left: -6px;
    width: 230px;
    background: #1e1b4b;
    color: white !important;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: .76rem;
    line-height: 1.7;
    font-weight: 400;
    z-index: 30;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
    text-align: right;
    white-space: normal;
}

    .kmo-tip * {
        color: white !important;
    }

    .kmo-tip b {
        display: block;
        margin-bottom: 2px;
    }

    .kmo-tip small {
        display: block;
        opacity: .75;
    }

.kmo-i:hover .kmo-tip, .kmo-i:focus .kmo-tip {
    display: block;
}

.kmo-skel {
    min-height: 92px;
    border-top-color: #e5e7eb;
}

    .kmo-skel i, .kmo-skel-box {
        display: block;
        border-radius: 8px;
        background: linear-gradient(90deg, #eef0f6 25%, #f8f9fc 50%, #eef0f6 75%);
        background-size: 200% 100%;
        animation: kmo-sh 1.2s infinite;
    }

    .kmo-skel i {
        height: 12px;
        width: 60%;
    }

        .kmo-skel i:nth-child(2) {
            height: 26px;
            width: 40%;
        }

        .kmo-skel i:nth-child(3) {
            width: 75%;
        }

.kmo-skel-box {
    min-height: 220px;
}

@keyframes kmo-sh {
    to {
        background-position: -200% 0;
    }
}

@keyframes kmo-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

/* ---------- چیدمان ---------- */
.kmo > section, .kmo-grid {
    margin: 0 0 16px;
}

.kmo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 16px;
}

.kmo-grid-eq {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.kmo-grid > section {
    margin: 0;
}

.kmo-none {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px;
    color: #059669 !important;
    background: #ecfdf5;
    border-radius: 12px;
    font-size: .88rem;
}

    .kmo-none svg {
        width: 20px;
        height: 20px;
    }

.kmo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px;
    margin: 16px;
    text-align: center !important;
}

    .kmo-empty svg {
        width: 40px;
        height: 40px;
        color: #94a3b8 !important;
    }

.kmo-pill {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 8px;
    margin-left: 4px;
    white-space: nowrap;
}

.p-red {
    background: #ffe4e6;
    color: #be123c !important;
}

.p-amber {
    background: #fef3c7;
    color: #92400e !important;
}

.p-slate {
    background: #e2e8f0;
    color: #334155 !important;
}

.p-blue {
    background: #dbeafe;
    color: #1d4ed8 !important;
}

.p-violet {
    background: #ede9fe;
    color: #6d28d9 !important;
}

.kmo-chip {
    border: 0;
    background: #eef2ff;
    color: #3730a3 !important;
    border-radius: 999px;
    padding: 4px 12px;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}

    .kmo-chip i {
        font-style: normal;
        margin-right: 4px;
    }

/* ---------- دستیار ---------- */
.kmo-act {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--kt-soft);
    margin-bottom: 8px;
    border-right: 4px solid #94a3b8;
    animation: kmo-in .35s both;
}

    .kmo-act b {
        display: block;
        font-size: .88rem;
    }

    .kmo-act small {
        display: block;
        font-size: .76rem;
        color: var(--kt-muted) !important;
        margin-top: 2px;
    }

    .kmo-act.l-bad {
        border-right-color: #e11d48;
        background: #fff1f2;
    }

    .kmo-act.l-warn {
        border-right-color: #f59e0b;
        background: #fffbeb;
    }

    .kmo-act.l-info {
        border-right-color: #3b82f6;
        background: #eff6ff;
    }

    .kmo-act.l-good {
        border-right-color: #10b981;
        background: #ecfdf5;
    }

.kmo-act-ic {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

    .kmo-act-ic svg {
        width: 19px;
        height: 19px;
    }

.l-bad .kmo-act-ic {
    color: #e11d48 !important;
}

.l-warn .kmo-act-ic {
    color: #d97706 !important;
}

.l-info .kmo-act-ic {
    color: #2563eb !important;
}

.l-good .kmo-act-ic {
    color: #059669 !important;
}

.kmo-act .kt-btn {
    flex-shrink: 0;
    text-decoration: none !important;
}

/* ---------- تصمیم‌ها ---------- */
.kmo-dec {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px dashed var(--kt-border);
    text-decoration: none !important;
}

    .kmo-dec:last-child {
        border-bottom: 0;
    }

    .kmo-dec:hover {
        background: var(--kt-soft);
        border-radius: 10px;
    }

    .kmo-dec b, .kmo-dec small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kmo-dec b {
        font-size: .86rem;
    }

    .kmo-dec small {
        font-size: .74rem;
        color: var(--kt-muted) !important;
    }

.kmo-age {
    font-size: .72rem;
    color: var(--kt-muted) !important;
    white-space: nowrap;
}

/* ---------- تأخیرها ---------- */
.kmo-lr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid var(--kt-border);
}

    .kmo-lr:last-child {
        border-bottom: 0;
    }

    .kmo-lr:hover {
        background: #fafbff;
    }

.kmo-days {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff7ed;
    color: #c2410c !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

    .kmo-days b {
        font-size: 1.15rem;
        font-weight: 900;
    }

    .kmo-days small {
        font-size: .65rem;
    }

    .kmo-days.d-mid {
        background: #ffedd5;
        color: #c2410c !important;
    }

    .kmo-days.d-hi {
        background: #e11d48;
        color: white !important;
    }

        .kmo-days.d-hi * {
            color: white !important;
        }

.kmo-lr-main {
    text-decoration: none !important;
}

    .kmo-lr-main b {
        display: block;
        font-size: .9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kmo-lr-main small {
        display: block;
        font-size: .75rem;
        color: var(--kt-muted) !important;
        margin-top: 2px;
    }

.kmo-idle {
    color: #b45309 !important;
    font-weight: 700;
}

.kmo-who {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: .8rem;
    padding: 4px 6px;
    border-radius: 10px;
    max-width: 150px;
}

    .kmo-who:hover {
        background: #eef2ff;
    }

    .kmo-who span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.kmo-asked {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .76rem;
    color: #059669 !important;
    white-space: nowrap;
}

    .kmo-asked svg {
        width: 16px;
        height: 16px;
    }

.kmo-more-b {
    width: 100%;
    border: 0;
    background: var(--kt-soft);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 6px;
}

.kmo-more {
    display: block;
    text-align: center !important;
    padding: 10px;
    font-size: .84rem;
    font-weight: 700;
    color: var(--kt-p) !important;
}

/* ---------- بار کاری ---------- */
.kmo-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .74rem;
    color: var(--kt-muted) !important;
}

    .kmo-legend span {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .kmo-legend i {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        display: inline-block;
    }

.kmo-legend-b {
    margin-top: 8px;
    justify-content: center;
}

.kmo-ppl {
    font-size: .84rem;
}

.kmo-ph, .kmo-pr {
    display: grid;
    grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 2fr) repeat(8, minmax(42px, .5fr));
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
}

.kmo-ph {
    font-size: .72rem;
    color: var(--kt-muted) !important;
    font-weight: 700;
    border-bottom: 1px solid var(--kt-border);
}

    .kmo-ph span:nth-child(n+3), .kmo-pr > span:nth-child(n+3) {
        text-align: center !important;
    }

.kmo-pr {
    border-radius: 12px;
    cursor: pointer;
    transition: background .12s;
}

    .kmo-pr:hover {
        background: var(--kt-soft);
    }

    .kmo-pr.on {
        background: #eef2ff;
        box-shadow: inset 0 0 0 1px #c7d2fe;
    }

.kmo-pn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .kmo-pn b {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: .85rem;
    }

.kmo-flag {
    font-size: .66rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
}

    .kmo-flag.f-over {
        background: #ffe4e6;
        color: #be123c !important;
    }

    .kmo-flag.f-idle {
        background: #e0f2fe;
        color: #0369a1 !important;
    }

    .kmo-flag.f-quiet {
        background: #fef3c7;
        color: #92400e !important;
    }

.kmo-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 14px;
}

    .kmo-bar i {
        height: 100%;
        border-radius: 4px;
        min-width: 4px;
        transition: width .4s;
    }

    .kmo-bar em {
        font-style: normal;
        font-weight: 800;
        font-size: .78rem;
        margin-right: 6px;
    }

.kmo-bad {
    color: #c2410c !important;
    font-weight: 800;
}

.kmo-warn {
    color: #b45309 !important;
    font-weight: 700;
}

.kmo-moves {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef2ff, #f0fdfa);
}

    .kmo-moves h4 {
        margin: 0 0 8px;
        font-size: .9rem;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

        .kmo-moves h4 svg {
            width: 18px;
            height: 18px;
            color: #4f46e5 !important;
        }

        .kmo-moves h4 small {
            font-weight: 400;
            font-size: .74rem;
        }

.kmo-mv {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 12px;
    margin-top: 6px;
}

    .kmo-mv a {
        text-decoration: none !important;
    }

    .kmo-mv b {
        font-size: .86rem;
    }

    .kmo-mv small {
        display: block;
        font-size: .74rem;
        color: var(--kt-muted) !important;
        margin-top: 2px;
    }

/* ---------- پروژه و خط ---------- */
.kmo-pj, .kmo-ln {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 6px;
    border-bottom: 1px solid var(--kt-border);
    text-decoration: none !important;
}

    .kmo-pj:last-child, .kmo-ln:last-child {
        border-bottom: 0;
    }

    .kmo-pj:hover, .kmo-ln:hover {
        background: var(--kt-soft);
        border-radius: 12px;
    }

    .kmo-pj b, .kmo-ln b {
        display: block;
        font-size: .88rem;
    }

    .kmo-pj small, .kmo-ln small {
        display: block;
        font-size: .74rem;
        color: var(--kt-muted) !important;
        margin-top: 2px;
    }

.kmo-pj-ic {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

    .kmo-pj-ic svg {
        width: 20px;
        height: 20px;
    }

.kmo-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.kmo-why {
    color: #b45309 !important;
}

.kmo-ring {
    --p: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: conic-gradient(#0d9488 calc(var(--p) * 1%), #e2e8f0 0);
}

    .kmo-ring b {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #fff;
        display: grid;
        place-items: center;
        font-size: .66rem !important;
        font-weight: 800;
    }

/* ---------- نمودارها ---------- */
.kmo-chart {
    display: flex;
    gap: 6px;
    height: 190px;
    padding-top: 6px;
}

.kmo-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: .66rem;
    color: #94a3b8 !important;
    padding-bottom: 20px;
}

.kmo-cols {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 3px;
    border-bottom: 1px solid #e2e8f0;
    direction: ltr;
    background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #f1f5f9 calc(25% - 1px), #f1f5f9 25%);
    background-size: 100% calc(100% - 20px);
    background-repeat: no-repeat;
}

.kmo-col {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
    outline: none;
    cursor: default;
}

    .kmo-col.off .kmo-x {
        color: #e11d48 !important;
    }

.kmo-stack {
    width: 100%;
    max-width: 22px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    margin-bottom: 20px;
    transition: height .5s;
}

    .kmo-stack i {
        display: block;
        min-height: 3px;
    }

        .kmo-stack i:first-child {
            border-radius: 4px 4px 0 0;
        }

.kmo-x {
    position: absolute;
    bottom: 2px;
    font-size: .62rem;
    color: #94a3b8 !important;
    white-space: nowrap;
}

.kmo-tt {
    display: none;
    position: absolute;
    bottom: calc(100% - 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1b4b;
    color: white !important;
    font-size: .72rem;
    line-height: 1.6;
    padding: 6px 10px;
    border-radius: 10px;
    white-space: nowrap;
    z-index: 20;
    direction: rtl;
    text-align: right !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
    pointer-events: none;
}

    .kmo-tt * {
        color: white !important;
    }

    .kmo-tt b {
        display: block;
    }

.kmo-col:hover .kmo-tt, .kmo-col:focus .kmo-tt {
    display: block;
}

.kmo-col:hover .kmo-stack {
    filter: brightness(1.08);
}

.kmo-chart-m {
    height: 210px;
}

    .kmo-chart-m .kmo-cols {
        gap: 8px;
        background-size: 100% calc(100% - 38px);
    }

    .kmo-chart-m .kmo-stack {
        max-width: 30px;
        margin-bottom: 38px;
    }

    .kmo-chart-m .kmo-x {
        bottom: 19px;
    }

.kmo-v {
    font-size: .68rem;
    font-weight: 800;
    margin-bottom: 2px;
    color: #334155 !important;
}

.kmo-pct {
    position: absolute;
    bottom: 2px;
    font-size: .64rem;
    font-weight: 700;
    color: #059669 !important;
}

    .kmo-pct.bad {
        color: #c2410c !important;
    }

.kmo-table {
    margin-top: 8px;
    font-size: .78rem;
}

    .kmo-table summary {
        cursor: pointer;
        color: var(--kt-muted) !important;
    }

    .kmo-table table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 6px;
    }

    .kmo-table th, .kmo-table td {
        padding: 4px 6px;
        border-bottom: 1px solid var(--kt-border);
        text-align: center !important;
    }

/* ---------- موبایل و تبلت ---------- */
@media (max-width: 1200px) {
    .kmo-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .kmo-grid, .kmo-grid-eq {
        grid-template-columns: minmax(0, 1fr);
    }

    .kmo-ph {
        display: none;
    }

    .kmo-pr {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        row-gap: 4px;
        border: 1px solid var(--kt-border);
        margin-bottom: 8px;
    }

        .kmo-pr .kmo-pn, .kmo-pr .kmo-bar {
            grid-column: 1 / -1;
        }

        .kmo-pr > span[data-l] {
            display: flex;
            flex-direction: column;
            align-items: center;
            font-weight: 700;
            font-size: .85rem;
        }

            .kmo-pr > span[data-l]::before {
                content: attr(data-l);
                font-size: .64rem;
                font-weight: 400;
                color: var(--kt-muted);
            }
}

@media (max-width: 600px) {
    .kmo-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: -28px 8px 14px;
        gap: 8px;
    }

    .kmo-card-val {
        font-size: 1.45rem;
    }

    .kmo-tip {
        left: auto;
        right: -150px;
        width: 200px;
    }

    .kmo-lr {
        flex-wrap: wrap;
    }

        .kmo-lr .kmo-lr-main {
            flex-basis: calc(100% - 60px);
        }

        .kmo-lr .kmo-who {
            margin-right: 58px;
        }

    .kmo-mv, .kmo-act {
        flex-wrap: wrap;
    }

        .kmo-mv > .kt-grow {
            flex-basis: 100%;
        }

        .kmo-act > .kt-grow {
            flex-basis: calc(100% - 46px);
        }

    .kmo .kt-sec-head {
        flex-wrap: wrap;
    }

        .kmo .kt-sec-head h3 {
            flex-wrap: wrap;
        }

            .kmo .kt-sec-head h3 small {
                flex-basis: 100%;
                padding-right: 38px;
            }

    .kmo-mv .kt-btn, .kmo-act .kt-btn {
        margin-right: auto;
    }

    .kmo-chart .kmo-x {
        font-size: .5rem;
    }

    .kmo-cols {
        gap: 1px;
    }

    .kmo-chart-m .kmo-cols {
        gap: 3px;
    }

    .kmo-chart-m .kmo-x {
        font-size: .52rem;
    }

    .kmo-hero .kt-hero-top {
        flex-wrap: wrap;
    }
}
/* =====================================================================
   ۱۱ج — نوع فعالیت روی چک‌لیست خط تولید + کنار گذاشتن چک‌لیست در اجرا
   ===================================================================== */
.kfl-wt {
    border: 1.5px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3 !important;
    border-radius: 10px;
    padding: 5px 6px;
    font-family: inherit;
    font-size: .76rem;
    outline: 0;
    max-width: 140px;
}

    .kfl-wt.auto {
        border-color: var(--kt-border);
        background: white;
        color: #94a3b8 !important;
    }

.kfl-mtabs button small.kfl-skipn {
    background: #ffe4e6;
    color: #be123c !important;
}

.kfl-skip-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff7ed, #fffbeb);
    border: 1px solid #fde68a;
    margin-bottom: 12px;
}

    .kfl-skip-head b {
        display: block;
        font-size: .9rem;
    }

    .kfl-skip-head small {
        display: block;
        font-size: .78rem;
        color: #78716c !important;
        line-height: 1.8;
        margin-top: 2px;
    }

.kfl-skip-task {
    border: 1px solid var(--kt-border);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: .2s;
}

    .kfl-skip-task.off {
        opacity: .6;
        background: #f8fafc;
    }

.kfl-skip-th {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: var(--kt-soft);
}

    .kfl-skip-th svg {
        width: 19px;
        height: 19px;
        color: #4f46e5 !important;
    }

    .kfl-skip-th b {
        font-size: .88rem;
    }

.kfl-skip-note {
    font-size: .72rem;
    font-weight: 700;
    color: #be123c !important;
    background: #ffe4e6;
    border-radius: 999px;
    padding: 1px 8px;
}

.kfl-skip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-top: 1px dashed var(--kt-border);
    transition: .15s;
}

    .kfl-skip-row b {
        display: block;
        font-size: .84rem;
    }

    .kfl-skip-row small {
        display: block;
        font-size: .72rem;
        color: var(--kt-muted) !important;
    }

    .kfl-skip-row.off b {
        text-decoration: line-through;
        color: #94a3b8 !important;
    }

    .kfl-skip-row.off {
        background: #fafafa;
    }

.kfl-skip-upto {
    border: 1px dashed #cbd5e1;
    background: white;
    border-radius: 999px;
    padding: 3px 10px;
    font-family: inherit;
    font-size: .72rem;
    color: #64748b !important;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    transition: .15s;
}

.kfl-skip-row:hover .kfl-skip-upto {
    opacity: 1;
}

.kfl-skip-upto:hover {
    border-color: #f59e0b;
    color: #b45309 !important;
}

.kfl-skip-x {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid #fecaca;
    background: #fff1f2;
    color: #e11d48 !important;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: .15s;
}

    .kfl-skip-x svg {
        width: 17px;
        height: 17px;
    }

    .kfl-skip-x:hover {
        background: #e11d48;
        color: white !important;
    }

    .kfl-skip-x.on {
        border-color: #c7d2fe;
        background: #eef2ff;
        color: #4f46e5 !important;
    }

.kfl-pv-nums span.off b {
    color: #be123c !important;
}

@media (max-width: 700px) {
    .kfl-wt {
        max-width: 100%;
        flex-basis: 100%;
    }

    .kfl-skip-upto {
        opacity: 1;
    }
}

.kfl-skip-head, .kfl-skip-task {
    flex-shrink: 0;
}

/* ================================================================
   ۱۱د — نوع فعالیت گزارش کار کنار هر ریزکار (صفحه‌ی وظیفه)
   ================================================================ */
.kt-check-wt {
    flex-shrink: 0;
    max-width: 150px;
    border: 1.5px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3 !important;
    border-radius: 999px;
    padding: 3px 8px;
    font-family: inherit;
    font-size: .72rem;
    font-weight: 600;
    outline: 0;
    cursor: pointer;
    transition: .15s;
}

    .kt-check-wt:hover, .kt-check-wt:focus {
        border-color: #818cf8;
    }

    .kt-check-wt.auto {
        border-color: transparent;
        background: transparent;
        color: #94a3b8 !important;
        font-weight: 400;
        opacity: 0;
    }

        .kt-check-list li:hover .kt-check-wt.auto, .kt-check-wt.auto:focus {
            opacity: 1;
            border-color: var(--kt-border);
            background: white;
        }

    .kt-check-wt.chip {
        cursor: default;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.kt-check-list li.done .kt-check-wt {
    opacity: .75;
}

@media (max-width: 600px) {
    .kt-check-list li {
        flex-wrap: wrap;
        row-gap: 4px;
    }

        .kt-check-list li .kt-check-title {
            flex-basis: 55%;
        }

    .kt-check-wt {
        order: 5;
        max-width: calc(100% - 34px);
        margin-inline-start: 34px;
    }

        .kt-check-wt.auto {
            opacity: 1;
            border-color: var(--kt-border);
            background: white;
        }
}

/* ================================================================
   مرحله ۱۳ — گانت پروژه‌ها (/projects/gantt)  پیشوند kgn-
   ================================================================ */
.kgn {
    --kgn-l: 260px;
}

.kgn-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #1e3a8a 55%, #4338ca 100%) !important;
}

.kgn-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.kgn-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
}

    .kgn-stat b {
        font-size: 1.25rem;
        font-weight: 800;
    }

    .kgn-stat small {
        font-size: .78rem;
        opacity: .9;
    }

    .kgn-stat.bad {
        background: rgba(244,63,94,.35);
        border-color: rgba(254,205,211,.5);
    }

    .kgn-stat.warn {
        background: rgba(245,158,11,.3);
        border-color: rgba(253,230,138,.5);
    }

.kgn-skel {
    height: 340px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}

    .kgn-skel i {
        height: 34px;
        border-radius: 10px;
        background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9);
        background-size: 200% 100%;
        animation: kgnShim 1.2s linear infinite;
    }

@keyframes kgnShim {
    to {
        background-position: -200% 0;
    }
}

.kgn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 20px;
    text-align: center;
}

    .kgn-empty svg {
        width: 44px;
        height: 44px;
        color: #94a3b8 !important;
    }

.kgn-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px !important;
    margin-bottom: 10px;
}

.kgn-tabs, .kgn-zoom {
    display: flex;
    background: var(--kt-soft);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

    .kgn-tabs button, .kgn-zoom button {
        border: 0;
        background: transparent;
        border-radius: 9px;
        padding: 6px 12px;
        font-family: inherit;
        font-size: .84rem;
        cursor: pointer;
        color: #475569 !important;
        display: flex;
        align-items: center;
        gap: 5px;
        transition: .15s;
    }

        .kgn-tabs button svg {
            width: 18px;
            height: 18px;
        }

        .kgn-tabs button.on, .kgn-zoom button.on {
            background: white;
            color: #1e3a8a !important;
            font-weight: 700;
            box-shadow: 0 1px 4px rgba(15,23,42,.1);
        }

        .kgn-tabs button small {
            background: #fee2e2;
            color: #be123c !important;
            border-radius: 999px;
            padding: 0 7px;
            font-size: .72rem;
            font-weight: 700;
        }

.kgn-sel {
    border: 1.5px solid #cbd5e1;
    border-radius: 11px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: .84rem;
    background: white;
    max-width: 220px;
    outline: 0;
}

    .kgn-sel:focus {
        border-color: #818cf8;
    }

.kgn-chk {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    cursor: pointer;
    user-select: none;
}

    .kgn-chk input {
        accent-color: #4f46e5;
        width: 16px;
        height: 16px;
    }

.kgn-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-size: .76rem;
    color: #64748b !important;
    margin: 0 4px 8px;
}

    .kgn-legend span {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .kgn-legend i {
        width: 18px;
        height: 9px;
        border-radius: 4px;
        display: inline-block;
    }

.lg-open {
    background: #6366f1;
}

.lg-late {
    background: #ea580c;
}

.lg-done {
    background: #22c55e;
}

.lg-flow {
    background: #0d9488;
}

.lg-crit {
    background: #6366f1;
    box-shadow: 0 0 0 2px #e11d48;
}

.lg-fc {
    background: repeating-linear-gradient(-45deg, #fda4af 0 3px, #fff1f2 3px 6px);
}

.lg-plan {
    width: 10px !important;
    height: 10px !important;
    background: #0f172a;
    transform: rotate(45deg);
    border-radius: 2px !important;
}

.kgn-nodue {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 9px;
}

.kgn-hint {
    color: #94a3b8 !important;
}

/* ---------- شبکه ---------- */
.kgn-wrap {
    padding: 0 !important;
    overflow: hidden;
}

.kgn-scroll {
    overflow: auto;
    max-height: calc(100vh - 250px);
    min-height: 260px;
    position: relative;
}

.kgn-inner {
    position: relative;
}

.kgn-head {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    height: 50px;
    background: white;
    border-bottom: 1px solid var(--kt-border);
}

.kgn-lbl {
    position: sticky;
    right: 0;
    z-index: 4;
    flex-shrink: 0;
    width: var(--kgn-l);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: white;
    border-left: 1px solid var(--kt-border);
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

    .kgn-lbl b {
        font-size: .84rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
    }

    .kgn-lbl small {
        font-size: .72rem;
        color: #64748b !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
    }

    .kgn-lbl .kt-grow {
        min-width: 0;
    }

.kgn-corner {
    z-index: 7;
    align-items: flex-end;
    padding-bottom: 8px;
}

    .kgn-corner b {
        color: #64748b !important;
        font-size: .76rem;
    }

.kgn-days {
    position: relative;
    height: 100%;
    flex-shrink: 0;
}

.kgn-month {
    position: absolute;
    top: 0;
    height: 24px;
    line-height: 24px;
    font-size: .74rem;
    font-weight: 700;
    color: #334155 !important;
    border-right: 1px solid #e2e8f0;
    padding-right: 6px;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
}

.kgn-day {
    position: absolute;
    bottom: 4px;
    font-size: .68rem;
    text-align: center;
    color: #94a3b8 !important;
}

    .kgn-day.fri {
        color: #f43f5e !important;
    }

    .kgn-day.today {
        color: white !important;
        background: #e11d48;
        border-radius: 6px;
        font-weight: 700;
    }

.kgn-body {
    position: relative;
}

.kgn-grid {
    position: absolute;
    top: 0;
    bottom: 0;
    right: var(--kgn-l);
    pointer-events: none;
}

    .kgn-grid i {
        position: absolute;
        top: 0;
        bottom: 0;
        background: #f8fafc;
    }

.kgn-now {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e11d48;
    opacity: .55;
    z-index: 2;
}

.kgn-row {
    position: absolute;
    right: 0;
    left: 0;
    display: flex;
    border-bottom: 1px solid #f1f5f9;
}

    .kgn-row:hover .kgn-lbl {
        background: #f8fafc;
    }

    .kgn-row.sel .kgn-lbl, .kgn-row.sel {
        background: #eef2ff;
    }

    .kgn-row.linked .kgn-lbl {
        background: #fff7ed;
    }

    .kgn-row.prj {
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
    }

        .kgn-row.prj .kgn-lbl {
            background: #f8fafc;
            cursor: pointer;
        }

            .kgn-row.prj .kgn-lbl b {
                font-size: .92rem;
            }

    .kgn-row.ph .kgn-lbl {
        padding-right: 34px;
    }

        .kgn-row.ph .kgn-lbl b {
            font-size: .76rem;
            color: #475569 !important;
        }

.kgn-chev {
    width: 20px !important;
    height: 20px !important;
    color: #64748b !important;
    flex-shrink: 0;
}

.kgn-pdot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.kgn-phdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kgn-ficon {
    width: 20px !important;
    height: 20px !important;
    color: #0d9488 !important;
    flex-shrink: 0;
}

.kgn-open svg {
    width: 17px;
    height: 17px;
    color: #64748b !important;
}

.kgn-av {
    width: 24px !important;
    height: 24px !important;
    font-size: .7rem !important;
    flex-shrink: 0;
}

    .kgn-av.lg {
        width: 30px !important;
        height: 30px !important;
        font-size: .8rem !important;
    }

.kgn-tag {
    font-style: normal;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 7px;
    flex-shrink: 0;
    white-space: nowrap;
}

    .kgn-tag.late {
        background: #ffedd5;
        color: #c2410c !important;
    }

    .kgn-tag.crit {
        background: #ffe4e6;
        color: #be123c !important;
    }

    .kgn-tag.good {
        background: #dcfce7;
        color: #15803d !important;
    }

.kgn-track {
    position: relative;
    flex-shrink: 0;
    height: 100%;
}

.kgn-bar, .kgn-pbar, .kgn-phbar, .kgn-fc {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.kgn-bar {
    height: 22px;
    border-radius: 7px;
    background: #6366f1;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    z-index: 3;
    transition: box-shadow .15s;
    touch-action: none;
    user-select: none;
}

    .kgn-bar > i {
        position: absolute;
        inset: 0 0 0 auto;
        background: rgba(255,255,255,.22);
    }

    .kgn-bar em {
        position: relative;
        font-style: normal;
        font-size: .72rem;
        color: white !important;
        padding: 0 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 600;
    }

    .kgn-bar.late {
        background: #ea580c;
    }

    .kgn-bar.done {
        background: #22c55e;
    }

    .kgn-bar.flow {
        background: #0d9488;
    }

    .kgn-bar.crit {
        box-shadow: 0 0 0 2px #e11d48;
    }

    .kgn-bar.mov {
        cursor: grab;
    }

        .kgn-bar.mov:hover {
            box-shadow: 0 0 0 3px rgba(99,102,241,.3);
        }

    .kgn-bar.crit.mov:hover {
        box-shadow: 0 0 0 2px #e11d48, 0 0 0 5px rgba(225,29,72,.2);
    }

    .kgn-bar.drag {
        cursor: grabbing;
        opacity: .85;
        box-shadow: 0 6px 16px rgba(30,58,138,.35);
    }

.kgn-grip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 9px;
    cursor: ew-resize;
    background: rgba(15,23,42,.18);
}

.kgn-pbar {
    height: 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--c) 25%, white);
    border: 1.5px solid var(--c);
    overflow: hidden;
    box-sizing: border-box;
    z-index: 3;
}

    .kgn-pbar i {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        background: var(--c);
    }

.kgn-phbar {
    height: 6px;
    border-radius: 999px;
    background: #cbd5e1;
    z-index: 3;
}

.kgn-fc {
    height: 14px;
    border-radius: 0 6px 6px 0;
    background: repeating-linear-gradient(-45deg, #fda4af 0 3px, #fff1f2 3px 6px);
    border: 1px dashed #fb7185;
    box-sizing: border-box;
    z-index: 2;
}

.kgn-planend {
    position: absolute;
    top: 50%;
    width: 11px;
    height: 11px;
    margin: -6px -6px 0 0;
    background: #0f172a;
    transform: rotate(45deg);
    border-radius: 2px;
    z-index: 4;
}

.kgn-out {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: .72rem;
    color: #475569 !important;
    white-space: nowrap;
    z-index: 3;
    pointer-events: none;
}

.kgn-dragtip {
    position: absolute;
    top: -2px;
    transform: translateY(-100%);
    background: #0f172a;
    color: white !important;
    font-size: .72rem;
    border-radius: 7px;
    padding: 3px 8px;
    white-space: nowrap;
    z-index: 8;
    pointer-events: none;
}

.kgn-links {
    position: absolute;
    top: 0;
    right: var(--kgn-l);
    z-index: 2;
    pointer-events: none;
    overflow: visible;
}

    .kgn-links path {
        fill: none;
        stroke: #94a3b8;
        stroke-width: 1.4;
    }

        .kgn-links path.crit {
            stroke: #e11d48;
            stroke-width: 1.8;
        }

        .kgn-links path.hot {
            stroke: #f59e0b;
            stroke-width: 2.2;
        }

.kgn-none {
    position: absolute;
    top: 24px;
    right: calc(var(--kgn-l) + 20px);
    color: #94a3b8 !important;
    font-size: .9rem;
}

/* ---------- تداخل افراد ---------- */
.kgn-row.per .kgn-lbl {
    cursor: pointer;
}

.kgn-heat {
    position: absolute;
    top: 9px;
    bottom: 9px;
    border-radius: 4px;
    font-size: .68rem;
    display: grid;
    place-items: center;
    color: #1e3a8a !important;
    box-sizing: border-box;
    border: 1px solid white;
}

    .kgn-heat.h1 {
        background: #e0e7ff;
    }

    .kgn-heat.h2 {
        background: #a5b4fc;
    }

    .kgn-heat.h3 {
        background: #6366f1;
        color: white !important;
    }

    .kgn-heat.h4 {
        background: #3730a3;
        color: white !important;
    }

    .kgn-heat.clash {
        box-shadow: inset 0 -3px 0 #e11d48;
    }

.kgn-span {
    position: absolute;
    top: 5px;
    bottom: 5px;
    border: 2px solid #e11d48;
    border-radius: 7px;
    z-index: 3;
    box-sizing: border-box;
}

.kgn-clashes {
    margin-top: 12px;
}

    .kgn-clashes h3 {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 1rem;
        margin: 0 0 10px;
        flex-wrap: wrap;
    }

        .kgn-clashes h3 svg {
            color: #f59e0b !important;
        }

        .kgn-clashes h3 small {
            font-weight: 400;
            font-size: .76rem;
            color: #64748b !important;
        }

.kgn-clash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    border-top: 1px dashed var(--kt-border);
}

    .kgn-clash b {
        font-size: .86rem;
        display: block;
    }

    .kgn-clash small {
        font-size: .76rem;
        color: #64748b !important;
        display: block;
        line-height: 1.7;
    }

/* ---------- پنل ---------- */
.kgn-layer {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
}

.kgn-shade {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.25);
    z-index: 1300;
    animation: ktIn .2s ease both;
}

.kgn-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 400px;
    max-width: 100vw;
    background: white;
    z-index: 1301;
    box-shadow: 8px 0 30px rgba(15,23,42,.18);
    display: flex;
    flex-direction: column;
    animation: kgnSlide .25s ease both;
}

@keyframes kgnSlide {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
}

.kgn-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--kt-border);
}

    .kgn-panel-head b {
        display: block;
        font-size: .96rem;
    }

    .kgn-panel-head small {
        display: block;
        font-size: .76rem;
        color: #64748b !important;
    }

.kgn-panel-body {
    overflow: auto;
    padding: 14px 16px 30px;
    flex: 1;
}

    .kgn-panel-body h4 {
        font-size: .86rem;
        margin: 18px 0 8px;
        color: #334155 !important;
    }

.kgn-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

    .kgn-facts span {
        background: var(--kt-soft);
        border-radius: 12px;
        padding: 8px 10px;
    }

    .kgn-facts small {
        display: block;
        font-size: .7rem;
        color: #64748b !important;
    }

    .kgn-facts b {
        font-size: .86rem;
    }

    .kgn-facts em {
        font-style: normal;
        font-size: .68rem;
        color: #94a3b8 !important;
        margin-right: 4px;
    }

.kgn-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 12px;
    background: #f1f5f9;
    font-size: .8rem;
    line-height: 1.8;
}

    .kgn-note svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        margin-top: 3px;
    }

    .kgn-note.warn {
        background: #fff7ed;
    }

        .kgn-note.warn svg {
            color: #ea580c !important;
        }

    .kgn-note.crit {
        background: #fff1f2;
    }

        .kgn-note.crit svg {
            color: #e11d48 !important;
        }

    .kgn-note.bad {
        background: #fef2f2;
        color: #b91c1c !important;
    }

        .kgn-note.bad svg {
            color: #dc2626 !important;
        }

.kgn-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

    .kgn-dates label span {
        display: block;
        font-size: .74rem;
        color: #64748b !important;
        margin-bottom: 3px;
    }

    .kgn-dates input {
        width: 100%;
        box-sizing: border-box;
        border: 1.5px solid #cbd5e1 !important;
        background: white;
        border-radius: 10px;
        padding: 7px 10px;
        font-family: inherit;
        font-size: .9rem;
        direction: ltr;
        text-align: center;
        outline: 0;
    }

        .kgn-dates input:focus {
            border-color: #818cf8;
        }

.kgn-shift {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
    font-size: .78rem;
    color: #64748b !important;
}

    .kgn-shift button {
        border: 1px solid #cbd5e1;
        background: white;
        border-radius: 8px;
        padding: 3px 9px;
        font-family: inherit;
        cursor: pointer;
        font-size: .8rem;
    }

        .kgn-shift button:hover {
            border-color: #818cf8;
            background: #eef2ff;
        }

.kgn-wide {
    width: 100%;
    margin-top: 10px;
    justify-content: center;
    max-width: none !important;
}

.kgn-pv {
    margin-top: 12px;
    border: 1px solid var(--kt-border);
    border-radius: 14px;
    overflow: hidden;
}

.kgn-pv-sum {
    padding: 10px 12px;
    background: #f8fafc;
    font-size: .82rem;
    line-height: 1.8;
}

    .kgn-pv-sum small {
        display: block;
        color: #64748b !important;
    }

    .kgn-pv-sum.bad {
        background: #fff7ed;
    }

    .kgn-pv-sum.good {
        background: #f0fdf4;
    }

.kgn-pv-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #f1f5f9;
}

    .kgn-pv-row b {
        font-size: .8rem;
        display: block;
    }

    .kgn-pv-row small {
        font-size: .7rem;
        color: #64748b !important;
    }

        .kgn-pv-row small em {
            font-style: normal;
            color: #b91c1c !important;
        }

    .kgn-pv-row.main {
        background: #eef2ff;
    }

    .kgn-pv-row.blocked {
        opacity: .6;
    }

.kgn-pv-d {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: .72rem;
    flex-shrink: 0;
}

    .kgn-pv-d s {
        color: #94a3b8 !important;
    }

.kgn-pv-btns {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--kt-border);
}

.kgn-deps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

    .kgn-deps > small {
        font-size: .74rem;
        color: #64748b !important;
        width: 100%;
    }

.kgn-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef2ff;
    color: #3730a3 !important;
    border-radius: 999px;
    padding: 3px 4px 3px 10px;
    font-size: .76rem;
}

    .kgn-chip.out {
        background: #f1f5f9;
        color: #334155 !important;
        padding: 3px 10px;
    }

    .kgn-chip button {
        border: 0;
        background: transparent;
        cursor: pointer;
        padding: 0;
        display: grid;
        place-items: center;
    }

        .kgn-chip button svg {
            width: 15px;
            height: 15px;
            color: #6366f1 !important;
        }

@media (max-width: 700px) {
    .kgn {
        --kgn-l: 150px;
    }

    .kgn-hero .kt-hero-top {
        flex-wrap: wrap;
    }

        .kgn-hero .kt-hero-top > .kt-grow {
            flex: 1 1 calc(100% - 80px);
        }

    .kgn-hero .kt-sub {
        font-size: .8rem;
    }

    .kgn-lbl {
        padding: 0 8px;
        gap: 5px;
    }

    .kgn-row.ph .kgn-lbl {
        padding-right: 14px;
    }

    .kgn-lbl small {
        display: none;
    }

    .kgn-row.prj .kgn-lbl small {
        display: block;
        white-space: normal;
        line-height: 1.4;
        max-height: 2.8em;
    }

    .kgn-av {
        display: none !important;
    }

    .kgn-sel {
        max-width: 46%;
        flex: 1;
    }

    .kgn-hint {
        display: none;
    }

    .kgn-scroll {
        max-height: calc(100vh - 200px);
    }

    .kgn-panel {
        width: 100vw;
        top: auto;
        max-height: 86vh;
        border-radius: 18px 18px 0 0;
        animation: kgnUp .25s ease both;
    }

    .kgn-stat {
        padding: 6px 10px;
    }

        .kgn-stat b {
            font-size: 1.05rem;
        }
}

@keyframes kgnUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
}


/* ================================================================
   توقف خط تولید (kfp-) — به انتهای tm-ui.css اضافه کن
   ================================================================ */
.kfp-banner {
    --o: #d97706;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    margin: 0 0 12px;
    border-radius: 14px;
    background: repeating-linear-gradient(135deg, #fffbeb, #fffbeb 12px, #fef3c7 12px, #fef3c7 24px);
    border: 1.5px solid #fcd34d;
    border-right: 5px solid var(--o);
    animation: kfpIn .35s ease;
}

    .kfp-banner b {
        font-size: .95rem;
        color: #78350f;
    }

    .kfp-banner small {
        display: block;
        color: #92400e;
        font-size: .78rem;
        margin-top: 2px;
    }

    .kfp-banner .kfp-hint {
        color: #a16207;
        opacity: .85;
    }

    .kfp-banner.compact {
        margin: 0;
        padding: 8px 10px;
        gap: 8px;
    }

        .kfp-banner.compact .kfp-banner-ic {
            width: 30px;
            height: 30px;
        }

        .kfp-banner.compact .kfp-hint {
            display: none;
        }

.kfp-banner-ic {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 12px;
    background: var(--o);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 14px -6px var(--o);
    animation: kfpPulse 2.2s infinite;
}

.kfp-note {
    margin: 4px 0 0;
    font-size: .84rem;
    color: var(--kt-text);
    white-space: pre-line;
}

.kfp-note-1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.kfp-origin {
    --o: #64748b;
    display: inline-flex;
    align-items: center;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    background: var(--o);
    color: white !important;
    white-space: nowrap;
}

.kfp-open {
    opacity: .85;
}

    .kfp-open:hover {
        opacity: 1;
    }

/* ---- کنار هر مرحله ---- */
.kfp-step {
    display: contents;
}

.kfp-chip {
    --o: #d97706;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    background: var(--o);
    color: white !important;
}

    .kfp-chip svg {
        width: 16px;
        height: 16px;
        fill: #ffffff;
    }

    .kfp-chip.wait {
        background: #fef3c7;
        color: #92400e !important;
        border: 1px dashed #f59e0b;
    }

        .kfp-chip.wait svg {
            fill: #92400e;
        }

.kfp-why {
    font-size: .76rem;
    color: var(--kt-muted);
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kfl-link.st1:has(.kfp-chip:not(.wait)) .kfl-dot {
    background: #d97706;
}

.kfp-form {
    flex-basis: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    padding: 12px;
    border-radius: 14px;
    background: var(--kt-soft);
    border: 1px solid var(--kt-border);
    animation: kfpIn .25s ease;
}

    .kfp-form textarea {
        width: 100%;
        border: 1.5px solid var(--kt-border);
        border-radius: 12px;
        padding: 8px 10px;
        font: inherit;
        font-size: .86rem;
        background: white;
        resize: vertical;
    }

        .kfp-form textarea:focus {
            outline: none;
            border-color: var(--kt-p);
        }

.kfp-form-t {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
}

    .kfp-form-t svg {
        fill: #d97706;
    }

.kfp-origins {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kfp-o {
    --o: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 12px;
    border: 1.5px solid var(--kt-border);
    background: white;
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
    transition: all .15s;
}

    .kfp-o svg {
        width: 18px;
        height: 18px;
        fill: var(--o);
    }

    .kfp-o:hover {
        border-color: var(--o);
        transform: translateY(-1px);
    }

    .kfp-o.on {
        background: var(--o);
        border-color: var(--o);
        box-shadow: 0 6px 14px -8px var(--o);
    }

/* ---- صفحه‌ی گزارش ---- */
.kfp-hero {
    background: linear-gradient(135deg, #78350f, #b45309 45%, #4f46e5);
}

    .kfp-hero .kt-kpi-val small {
        font-size: .7rem;
        font-weight: 600;
    }

.kfp-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

    .kfp-filter label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: .84rem;
    }

.kfp-date {
    width: 120px;
    direction: ltr;
    text-align: center;
}

.kfp-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kfp-row {
    --c: #4f46e5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--kt-border);
    border-right: 5px solid var(--c);
    background: white;
}

    .kfp-row b {
        font-size: .92rem;
    }

    .kfp-row small {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        color: var(--kt-muted);
        font-size: .78rem;
        margin-top: 2px;
    }

    .kfp-row.live {
        background: linear-gradient(90deg, #fff, #fffbeb);
    }

.kfp-acts {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: none;
}

.kfp-days {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 6px 8px;
    border-radius: 12px;
    background: #fef3c7;
    flex: none;
}

    .kfp-days b {
        font-size: 1.25rem;
        line-height: 1.1;
        color: #92400e;
    }

    .kfp-days small {
        font-size: .68rem;
        color: #a16207;
        margin: 0;
    }

    .kfp-days.big {
        min-width: 74px;
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
    }

        .kfp-days.big b {
            font-size: 1.6rem;
            color: white !important;
        }

        .kfp-days.big small {
            color: white !important;
            opacity: .85;
        }

.kfp-projects {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kfp-proj {
    --c: #4f46e5;
    border-radius: 16px;
    border: 1px solid var(--kt-border);
    border-right: 5px solid var(--c);
    background: white;
    overflow: hidden;
    transition: box-shadow .2s;
}

    .kfp-proj:hover, .kfp-proj.open {
        box-shadow: 0 10px 28px -18px rgba(30, 27, 75, .45);
    }

.kfp-proj-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: none;
    border: 0;
    font: inherit;
    text-align: right;
    cursor: pointer;
}

.kfp-proj-t {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

    .kfp-proj-t b {
        font-size: 1rem;
    }

    .kfp-proj-t small {
        color: var(--kt-muted);
        font-size: .8rem;
    }

.kfp-live-dot {
    color: #b45309;
    font-weight: 700;
}

.kfp-stack {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--kt-soft);
    margin-top: 4px;
    max-width: 420px;
}

    .kfp-stack i {
        display: block;
        height: 100%;
        background: var(--o);
        transform-origin: right;
        animation: kfpGrow .6s ease;
    }

.kfp-origin-sums {
    display: flex;
    gap: 6px;
    flex: none;
}

.kfp-os {
    --o: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 46px;
    padding: 4px 6px;
    border-radius: 10px;
    border: 1.5px solid var(--o);
}

    .kfp-os b {
        color: var(--o);
        font-size: 1rem;
        line-height: 1.2;
    }

    .kfp-os small {
        font-size: .68rem;
        color: var(--kt-muted);
    }

.kfp-items {
    border-top: 1px dashed var(--kt-border);
    padding: 8px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fafbff;
}

.kfp-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--kt-border);
}

    .kfp-item.st3 {
        opacity: .65;
    }

    .kfp-item b {
        font-size: .88rem;
    }

@keyframes kfpIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes kfpGrow {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

@keyframes kfpPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(217, 119, 6, .45);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(217, 119, 6, 0);
    }
}

@media (max-width: 760px) {
    .kfp-proj-head {
        flex-wrap: wrap;
    }

    .kfp-origin-sums {
        width: 100%;
        justify-content: space-between;
    }

    .kfp-row {
        flex-wrap: wrap;
    }

    .kfp-acts {
        width: 100%;
        justify-content: flex-end;
    }

    .kfp-why {
        max-width: 100%;
    }

    .kfp-date {
        width: 104px;
    }
}

.kfp-proj-head > svg {
    width: 24px;
    height: 24px;
    flex: none;
    fill: var(--kt-muted);
}

.kfp-proj-t small {
    display: block;
}

    .kfp-proj-t small span {
        display: inline;
    }

.kfp-row svg, .kfp-filter svg {
    width: 18px;
    height: 18px;
}

.kfl-run .kfp-open, .kfl-run .kfp-form {
    align-self: stretch;
}

.kfl-run .kfp-open {
    align-self: flex-start;
}
