/* Trainee Users — card grid + list view mirrors Identity Users. */

/* Keep card body rows aligned across the grid when names wrap. */
.trainees-page .card-grid .ecard {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.trainees-page .ecard .ec-top {
    align-items: flex-start;
    min-height: 52px;
}

.trainees-page .ecard .ec-title {
    font-size: 14px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.trainees-page .ecard .ec-top .cell-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trainees-page .ecard .ec-row {
    padding: 5px 0;
    font-size: 12.5px;
}

.trainees-page .ecard .ec-row .lab {
    flex: 0 1 auto;
    max-width: 55%;
}

.trainees-page .ecard .ec-row .val {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    text-align: right;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trainees-page .ecard .card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}

.trainees-page .ecard .card-actions .btn svg {
    width: 14px;
    height: 14px;
}

.trainees-page .section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 12px;
    flex-wrap: wrap;
}

.trainees-page .section-title-row .section-title {
    margin: 0;
}

.trainees-page .trainee-ai-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #EFF8FF;
    border: 1px solid #B2DDFF;
    color: #175CD3;
    font-size: 13px;
    line-height: 1.45;
}

.trainees-page .trainee-ai-banner-ico {
    flex-shrink: 0;
    margin-top: 1px;
    color: #2E90FA;
}

.trainees-page .trainee-ai-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #175CD3;
    white-space: nowrap;
}

.trainees-page .trainee-ai-count svg {
    color: #2E90FA;
    flex-shrink: 0;
}

.trainees-page .trainee-ai-col {
    width: 1%;
    text-align: center;
}

.trainees-page .ecard .ec-row .val.trainee-ai-count {
    color: #175CD3;
}

/* List view — same wireframe table as Users page */
.trainees-page .tbl-wrap {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.trainees-page .tbl-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.trainees-page .tbl-wrap thead th {
    background: var(--gray-bg);
    text-align: left;
    padding: 11px 16px;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

body.rtl .trainees-page .tbl-wrap thead th {
    text-align: right;
}

.trainees-page .tbl-wrap tbody td {
    padding: 13px 16px;
    border-top: 1px solid var(--border-soft);
    font-size: 13.5px;
    vertical-align: middle;
}

.trainees-page .tbl-wrap tbody tr:hover {
    background: #fafbfc;
}

.trainees-page .tbl-wrap .nd-row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.trainees-page .tbl-wrap .nd-row-actions .kebab {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted-2);
    padding: 4px;
}

.trainees-page .tbl-wrap .nd-row-actions .kebab:hover {
    color: var(--navy);
    background: var(--gray-bg);
    border-radius: 8px;
}

.trainees-page .tbl-wrap .avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
}

/* The photo covers the initials rather than replacing them, so a broken image just falls back. */
.trainees-page .avatar,
.trainee-profile-page .avatar {
    position: relative;
    overflow: hidden;
    flex: none;
}

.trainees-page .avatar .avatar-photo,
.trainee-profile-page .avatar .avatar-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trainees-page .cell-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.trainees-page .trainee-progress {
    display: inline-flex;
    width: 160px;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border-soft);
    vertical-align: middle;
}

.trainees-page .trainee-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #c45d0d;
}

.trainees-page .trainee-progress-label {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.trainees-page .trainee-progress-row .trainee-progress {
    flex: 1;
    min-width: 70px;
    max-width: 130px;
}

.trainees-page .trainee-time-left {
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.trainees-page .trainee-status {
    background: var(--info-bg);
    color: var(--info);
    white-space: nowrap;
}

@media (max-width: 900px) {
    .trainees-page .trainee-progress {
        width: 110px;
    }
}

/* Delete trainee confirmation — same modal-scrim pattern as Users */
.modal-scrim.trainees-delete-modal {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .55);
    display: grid;
    place-items: center;
    z-index: 1055;
    padding: 20px;
    opacity: 0;
    transition: .18s;
    backdrop-filter: blur(2px);
}

.modal-scrim.trainees-delete-modal.show {
    opacity: 1;
}

.modal-scrim.trainees-delete-modal .trainees-delete-dialog {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(10px) scale(.99);
    transition: .18s;
}

.modal-scrim.trainees-delete-modal.show .trainees-delete-dialog {
    transform: none;
}

.modal-scrim.trainees-delete-modal .modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    background: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-scrim.trainees-delete-modal .modal-title {
    font-weight: 800;
    font-size: 16.5px;
    color: var(--navy);
    letter-spacing: -.01em;
    margin: 0;
}

.modal-scrim.trainees-delete-modal .modal-body {
    padding: 20px;
}

.modal-scrim.trainees-delete-modal .modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-soft);
}

.modal-scrim.trainees-delete-modal .trainees-delete-body {
    display: flex;
    gap: 13px;
    align-items: flex-start;
}

.modal-scrim.trainees-delete-modal .trainees-delete-icon {
    background: var(--danger-bg);
    color: var(--danger);
    flex-shrink: 0;
}

.modal-scrim.trainees-delete-modal .trainees-delete-message {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.55;
    font-weight: 400;
    padding-top: 6px;
}

.modal-scrim.trainees-delete-modal .modal-head .icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.modal-scrim.trainees-delete-modal .modal-head .icon-btn:hover {
    background: var(--gray-bg);
    color: var(--text);
}

.modal-scrim.trainees-delete-modal .modal-foot .btn {
    padding: 9px 16px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1.2;
    box-shadow: none;
}

.modal-scrim.trainees-delete-modal .modal-foot .trainees-delete-modal-cancel {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}

.modal-scrim.trainees-delete-modal .modal-foot .trainees-delete-modal-cancel:hover {
    background: var(--gray-bg);
    border-color: var(--border);
    color: var(--text);
}

.modal-scrim.trainees-delete-modal .modal-foot .trainees-delete-modal-confirm {
    background: var(--danger);
    border: none;
    color: #fff;
}

.modal-scrim.trainees-delete-modal .modal-foot .trainees-delete-modal-confirm:hover {
    filter: brightness(1.05);
    background: var(--danger);
    color: #fff;
}

.modal-scrim.trainees-delete-modal .modal-foot .trainees-delete-modal-confirm svg {
    width: 18px;
    height: 18px;
}

.modal-scrim.trainees-status-modal .trainees-status-message {
    align-items: flex-start;
    background: #edf5ff;
    border: 1px solid #b7d6ff;
    border-radius: 12px;
    color: #1d4ed8;
    display: flex;
    gap: 11px;
    line-height: 1.55;
    margin: 0 0 16px;
    padding: 14px 16px;
}

.modal-scrim.trainees-status-modal .trainees-status-message i {
    margin-top: 3px;
}

.modal-scrim.trainees-status-modal .trainees-status-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.modal-scrim.trainees-status-modal textarea {
    resize: vertical;
    min-height: 96px;
}

.modal-scrim.trainees-status-modal .trainees-status-hint {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.modal-scrim.trainees-status-modal .trainees-status-confirm {
    background: var(--blue, #2f6fed);
    border: 0;
    color: #fff;
}

.modal-scrim.trainees-status-modal .trainees-status-confirm:disabled {
    cursor: not-allowed;
    opacity: .55;
}
