/* UNIFIED_NBOK_FORM_LAYOUT_V43_START */

/*
    فقط ظاهر مشترک ستون/باکس برچسب و ستون عملیات.
    این فایل هیچ مقدار، hidden input، چیپ یا دیتای انتخاب‌شده را تغییر نمی‌دهد.
*/

:root {
    --unified-nbok-tag-width: 165px;
    --unified-nbok-op-width: 54px;
}

/* جدول‌ها */
.unified-nbok-form .unified-nbok-table {
    table-layout: auto !important;
}

/* ستون برچسب‌ها - برای هر ۵ فرم */
.unified-nbok-form .unified-nbok-tag-cell,
.unified-nbok-form .unified-nbok-tag-head,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col,
#mentoringAgreementForm .agreement-nbok-table .unified-nbok-tag-cell {
    width: var(--unified-nbok-tag-width) !important;
    min-width: var(--unified-nbok-tag-width) !important;
    max-width: var(--unified-nbok-tag-width) !important;
    padding: 5px 5px !important;
    vertical-align: top !important;
    text-align: right !important;
}

.unified-nbok-form .unified-nbok-tag-head {
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
}

/* ستون عملیات - همان حالت جمع‌وجور */
.unified-nbok-form .unified-op-cell,
.unified-nbok-form .unified-op-head {
    width: var(--unified-nbok-op-width) !important;
    min-width: var(--unified-nbok-op-width) !important;
    max-width: var(--unified-nbok-op-width) !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.unified-nbok-form .unified-op-cell {
    padding: 4px 3px !important;
}

.unified-nbok-form .unified-op-head {
    padding: 7px 3px !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
}

.unified-nbok-form .unified-op-cell .btn-remove-topic,
#mentoringAgreementForm .agreement-nbok-table td .btn-remove-topic {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* خود باکس انتخاب برچسب - کوچک‌تر و دکمه پایین */
.unified-nbok-form .multi-tag-editor,
.unified-nbok-form .nbok-v16-editor,
.unified-nbok-grid-tag-cell .multi-tag-editor,
.unified-nbok-grid-tag-cell .nbok-v16-editor,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .multi-tag-editor,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .nbok-v16-editor {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 66px !important;
    padding: 5px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    cursor: default !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 4px !important;
}

/* لیست چیپ‌ها بالا می‌ماند، دکمه می‌رود پایین */
.unified-nbok-form .multi-tag-chip-list,
.unified-nbok-form .nbok-v16-chip-list,
.unified-nbok-grid-tag-cell .multi-tag-chip-list,
.unified-nbok-grid-tag-cell .nbok-v16-chip-list,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .multi-tag-chip-list,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .nbok-v16-chip-list {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 21px !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;
    flex: 1 1 auto !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    gap: 4px !important;

    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* چیپ‌ها کوچک‌تر */
.unified-nbok-form .multi-tag-chip,
.unified-nbok-grid-tag-cell .multi-tag-chip,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .multi-tag-chip {
    max-width: 100% !important;
    min-height: 21px !important;
    padding: 2px 6px 2px 4px !important;
    border-radius: 999px !important;
    font-size: 8.5px !important;
    line-height: 1.45 !important;
    gap: 4px !important;
}

.unified-nbok-form .multi-tag-chip-text,
.unified-nbok-grid-tag-cell .multi-tag-chip-text,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .multi-tag-chip-text {
    max-width: 118px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.unified-nbok-form .multi-tag-chip-remove,
.unified-nbok-grid-tag-cell .multi-tag-chip-remove,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .multi-tag-chip-remove {
    width: 15px !important;
    min-width: 15px !important;
    max-width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
    max-height: 15px !important;
    font-size: 11px !important;
}

/* ردیف دکمه همیشه پایین باکس */
.unified-nbok-form .nbok-v16-action-row,
.unified-nbok-grid-tag-cell .nbok-v16-action-row,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .nbok-v16-action-row {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: auto !important;
    padding-top: 3px !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    display: block !important;
}

/* دکمه انتخاب برچسب کوچک‌تر */
.unified-nbok-form .nbok-v16-open-btn,
.unified-nbok-grid-tag-cell .nbok-v16-open-btn,
#mentoringAgreementForm .agreement-nbok-table .agreement-tag-col .nbok-v16-open-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 27px !important;
    height: 27px !important;
    padding: 3px 7px !important;
    border-radius: 8px !important;
    font-size: 9.5px !important;
    font-weight: 900 !important;
    line-height: 1.45 !important;
    box-sizing: border-box !important;
}

/* متن خالی کوچک و بالا */
.unified-nbok-form .multi-tag-empty-hint,
.unified-nbok-grid-tag-cell .multi-tag-empty-hint {
    font-size: 8px !important;
    line-height: 1.5 !important;
    padding: 1px 2px !important;
}

/* این‌ها فقط مخفی می‌شوند؛ حذف یا بازسازی نمی‌شوند */
.unified-nbok-form .nbok-v16-action-hint,
.unified-nbok-form .multi-tag-input-row,
.unified-nbok-form .multi-tag-footer,
.unified-nbok-form .multi-tag-text-input,
.unified-nbok-form .multi-tag-add-btn,
.unified-nbok-form .multi-tag-draft-counter,
.unified-nbok-grid-tag-cell .nbok-v16-action-hint,
.unified-nbok-grid-tag-cell .multi-tag-input-row,
.unified-nbok-grid-tag-cell .multi-tag-footer,
.unified-nbok-grid-tag-cell .multi-tag-text-input,
.unified-nbok-grid-tag-cell .multi-tag-add-btn,
.unified-nbok-grid-tag-cell .multi-tag-draft-counter {
    display: none !important;
}

/* فرم‌هایی که برچسب کنار textarea دارند */
.unified-nbok-form .tagged-field-grid,
#supervisorReportForm .tagged-field-grid,
#preMentoringForm .tagged-field-grid,
#mentoringAgreementForm .tagged-field-grid,
#notebookForm .tagged-field-grid {
    display: grid !important;
    grid-template-columns: var(--unified-nbok-tag-width) minmax(0, 1fr) !important;
    gap: 9px !important;
    align-items: start !important;
}

/* اسکرول داخلی چیپ‌ها */
.unified-nbok-form .multi-tag-chip-list::-webkit-scrollbar,
.unified-nbok-form .nbok-v16-chip-list::-webkit-scrollbar {
    width: 4px !important;
    height: 4px !important;
}

.unified-nbok-form .multi-tag-chip-list::-webkit-scrollbar-thumb,
.unified-nbok-form .nbok-v16-chip-list::-webkit-scrollbar-thumb {
    background: rgba(77, 181, 106, 0.28) !important;
    border-radius: 99px !important;
}

/* تبلت */
@media (max-width: 992px) {
    :root {
        --unified-nbok-tag-width: 145px;
        --unified-nbok-op-width: 44px;
    }

    .unified-nbok-form .multi-tag-editor,
    .unified-nbok-form .nbok-v16-editor,
    .unified-nbok-grid-tag-cell .multi-tag-editor,
    .unified-nbok-grid-tag-cell .nbok-v16-editor {
        min-height: 61px !important;
        padding: 4px !important;
        border-radius: 9px !important;
    }

    .unified-nbok-form .multi-tag-chip-list,
    .unified-nbok-form .nbok-v16-chip-list {
        min-height: 19px !important;
        max-height: 40px !important;
        gap: 3px !important;
    }

    .unified-nbok-form .multi-tag-chip {
        min-height: 19px !important;
        padding: 2px 5px 2px 4px !important;
        font-size: 7.5px !important;
    }

    .unified-nbok-form .multi-tag-chip-text {
        max-width: 100px !important;
    }

    .unified-nbok-form .nbok-v16-open-btn {
        min-height: 25px !important;
        height: 25px !important;
        padding: 3px 6px !important;
        font-size: 8px !important;
        border-radius: 7px !important;
    }

    .unified-nbok-form .unified-op-cell .btn-remove-topic {
        width: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        border-radius: 7px !important;
        font-size: 11px !important;
    }
}

/* موبایل */
@media (max-width: 576px) {
    :root {
        --unified-nbok-tag-width: 128px;
        --unified-nbok-op-width: 40px;
    }

    .unified-nbok-form .multi-tag-editor,
    .unified-nbok-form .nbok-v16-editor,
    .unified-nbok-grid-tag-cell .multi-tag-editor,
    .unified-nbok-grid-tag-cell .nbok-v16-editor {
        min-height: 58px !important;
        padding: 4px !important;
    }

    .unified-nbok-form .multi-tag-chip {
        min-height: 18px !important;
        font-size: 7px !important;
    }

    .unified-nbok-form .multi-tag-chip-text {
        max-width: 86px !important;
    }

    .unified-nbok-form .nbok-v16-open-btn {
        min-height: 24px !important;
        height: 24px !important;
        font-size: 7.5px !important;
    }

    .unified-nbok-form .unified-op-cell .btn-remove-topic {
        width: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
        border-radius: 6px !important;
        font-size: 10px !important;
    }

    .unified-nbok-form .tagged-field-grid,
    #supervisorReportForm .tagged-field-grid,
    #preMentoringForm .tagged-field-grid,
    #mentoringAgreementForm .tagged-field-grid,
    #notebookForm .tagged-field-grid {
        grid-template-columns: 1fr !important;
        gap: 7px !important;
    }
}

/* UNIFIED_NBOK_FORM_LAYOUT_V43_END */
