/* Professional data tables – column widths fit content. Visual only. */
:root {
    --ust-table-navy: #0d2137;
    --ust-table-teal: #0f766e;
    --ust-table-stripe: #f7f8fa;
    --ust-table-line: #e6e8eb;
    --ust-table-text: #1f2937;
}

.table-responsive {
    background: #fff;
    border: 1px solid var(--ust-table-line);
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: visible;
    contain: none;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.86rem;
}

.table-responsive thead tr,
#requestsTable thead tr {
    background: var(--ust-table-navy);
}

.table-responsive th,
#requestsTable th {
    background: var(--ust-table-navy);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
    padding: 0.75rem 0.65rem;
    border: none;
    border-radius: 0;
}

.table-responsive td,
#requestsTable td {
    vertical-align: middle;
    padding: 0.7rem 0.65rem;
    border: none;
    border-bottom: 1px solid var(--ust-table-line);
    color: var(--ust-table-text);
    background: #fff;
    line-height: 1.45;
}

.table-responsive tbody tr:nth-child(even) td,
#requestsTable tbody tr:nth-child(even) td {
    background: var(--ust-table-stripe);
}

.table-responsive tbody tr:hover td,
#requestsTable tbody tr:hover td {
    background: #eef6f6;
}

.table-responsive .tag-standard,
.table-responsive .tag-clinical {
    background: transparent;
    font-weight: 700;
}
.table-responsive .tag-standard { color: var(--ust-table-teal); }
.table-responsive .tag-clinical { color: #1d4ed8; }

.cell-clip {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.cell-ellipsis {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}

.cell-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
    line-height: 1.45;
    max-height: 2.9em;
}

/* Admin 9 columns */
.ust-table-admin {
    table-layout: fixed;
    min-width: 1380px;
}
.ust-table-admin col.c-id { width: 158px; }
.ust-table-admin col.c-name { width: 118px; }
.ust-table-admin col.c-mail { width: 196px; }
.ust-table-admin col.c-title { width: auto; }
.ust-table-admin col.c-type { width: 86px; }
.ust-table-admin col.c-date { width: 96px; }
.ust-table-admin col.c-status { width: 128px; }
.ust-table-admin col.c-act { width: 176px; }

.ust-table-admin .col-id {
    font-weight: 800;
    color: var(--ust-table-navy);
    white-space: nowrap;
    text-align: center;
    font-size: 0.8rem;
}
.ust-table-admin .col-name { text-align: right; }
.ust-table-admin .col-mail { text-align: left; }
.ust-table-admin .col-title { text-align: left; }
.ust-table-admin .col-type {
    white-space: nowrap;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
}
.ust-table-admin .col-date { white-space: nowrap; text-align: center; font-size: 0.8rem; }
.ust-table-admin .col-status { text-align: center; font-size: 0.8rem; }
.ust-table-admin .col-act { white-space: nowrap; text-align: center; }

/* Archive 8 columns */
.ust-table-archive {
    table-layout: fixed;
    min-width: 1240px;
}
.ust-table-archive col.c-id { width: 158px; }
.ust-table-archive col.c-name { width: 120px; }
.ust-table-archive col.c-mail { width: 196px; }
.ust-table-archive col.c-title { width: auto; }
.ust-table-archive col.c-type { width: 86px; }
.ust-table-archive col.c-date { width: 96px; }
.ust-table-archive col.c-status { width: 128px; }
.ust-table-archive .col-id {
    font-weight: 800;
    color: var(--ust-table-navy);
    white-space: nowrap;
    text-align: center;
    font-size: 0.8rem;
}
.ust-table-archive .col-name { text-align: right; }
.ust-table-archive .col-mail,
.ust-table-archive .col-title { text-align: left; }
.ust-table-archive .col-type,
.ust-table-archive .col-date,
.ust-table-archive .col-status { text-align: center; white-space: nowrap; }

/* Dashboard: give title the widest column */
#requestsTable {
    table-layout: fixed;
    min-width: 1080px;
}
#requestsTable th:nth-child(1),
#requestsTable td.col-id { width: 13%; }
#requestsTable th:nth-child(2),
#requestsTable td.col-researcher { width: 16%; }
#requestsTable th:nth-child(3),
#requestsTable td.col-title { width: 38%; }
#requestsTable th:nth-child(4),
#requestsTable td.col-date { width: 11%; }
#requestsTable th:nth-child(5),
#requestsTable td.col-status { width: 12%; }
#requestsTable th:nth-child(6),
#requestsTable td.col-action { width: 10%; }
#requestsTable .req-title {
    -webkit-line-clamp: 2;
    max-height: 3em;
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}

.table-responsive .action-btns,
.col-action {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.action-btns .btn-xs,
.col-action .btn,
#requestsTable .col-action .btn {
    background: transparent !important;
    color: var(--ust-table-teal) !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: auto !important;
    font-weight: 700;
    font-size: 0.82rem;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.virtual-table-header,
.virtual-archive-header {
    background: var(--ust-table-navy) !important;
    color: #fff !important;
    font-weight: 800;
}

.virtual-req-row,
.virtual-archive-row {
    background: #fff;
    border-bottom: 1px solid var(--ust-table-line) !important;
    color: var(--ust-table-text);
}

.virtual-archive-row:nth-child(even),
.virtual-req-row:nth-child(even) {
    background: var(--ust-table-stripe);
}

.virtual-req-row:hover,
.virtual-archive-row:hover {
    background: #eef6f6;
}
