/* =========================================================
   جدول‌های صفحه‌های فهرست (Index)
   - ارتفاع هر سطر ثابت است؛ هیچ متنی سطر را بلند نمی‌کند.
   - متن طولانی با «...» بریده می‌شود و با نگه داشتن ماوس روی آن،
     متن کامل در Tooltip نمایش داده می‌شود (table-clip.js).
   - فقط جدول‌هایی که کلاس index-table دارند تحت‌تأثیر هستند.
   ========================================================= */

.index-table {
    --clip-row-height: 4rem;
    --clip-cell-max: 18rem;
}

.index-table.table-sm {
    --clip-row-height: 3.5rem;
}

.index-table > thead > tr > th {
    white-space: nowrap;
}

.index-table > tbody > tr {
    height: var(--clip-row-height);
}

.index-table > tbody > tr > td {
    vertical-align: middle;
}

/* سلول‌های متنی: یک خط، با سه‌نقطه */
.index-table > tbody > tr > td:not(:has(.btn, [class*="action"], .dropdown, .dropdown-menu, select, input, textarea)) {
    max-width: var(--clip-cell-max);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* خط‌های داخل سلول (مثل نام + توضیح کوچک زیر آن) */
.index-table > tbody > tr > td:not(:has(.btn, [class*="action"], .dropdown, .dropdown-menu, select, input, textarea)) > :is(div, p, small, .d-block):not(.d-flex):not(.badge) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* سلولی که آیکن/آواتار + متن دارد (d-flex) */
.index-table > tbody > tr > td > .d-flex {
    min-width: 0;
    max-width: 100%;
}

.index-table > tbody > tr > td > .d-flex > :is(span, div):not(.badge):not([class*="avatar"]):not([class*="icon"]):not([class*="me-"]) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.index-table > tbody > tr > td > .d-flex > :is(span, div)[class*="avatar"] {
    flex-shrink: 0;
}

/* لینک‌ها و دکمه‌های لینک‌مانند داخل سلول هم بریده شوند */
.index-table > tbody > tr > td > :is(a, strong, button.order-number-link, button.production-lot-link) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* وقتی متنی بریده شده، نشانگر Tooltip نشان داده شود */
.index-table [data-clip-title] {
    cursor: help;
}
.filter-test-page .index-table th,
.filter-test-page .index-table td {
    text-align: center;
    vertical-align: middle;
    border: 1px solid #adb5bd;
}

.filter-test-page .index-table {
    border-collapse: collapse;
}