.admin-body {
    background: #f4f7fb;
}

.admin-page-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.admin-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.admin-page-subtitle {
    color: #64748b;
    margin-bottom: 24px;
}

.admin-table thead {
    background: #1e84b5;
    color: #fff;
}

.admin-table th,
.admin-table td {
    vertical-align: middle;
    font-size: 14px;
}

.admin-action-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Workflow forward / decision — button width matches full label text */
.admin-action-btn--workflow {
    width: fit-content;
    max-width: none;
    box-sizing: border-box;
}

.admin-action-btn__label {
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-action-btn--view {
    background: #e0f2fe;
    color: #0369a1;
}

.admin-action-btn--approve {
    background: #198754;
    color: #fff;
}

.admin-action-btn--reject {
    background: #dc3545;
    color: #fff;
}

.admin-action-btn--review {
    background: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}

.admin-action-btn--review:hover,
.admin-action-btn--review:focus {
    background: #0b5ed7 !important;
    color: #fff !important;
}

.admin-workflow-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #fef3c7;
    color: #b45309;
}

.admin-workflow-badge--completed {
    background: #dcfce7;
    color: #15803d;
}

.admin-approval-timeline {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.admin-approval-step {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    background: #f8fafc;
}

.admin-approval-step h4 {
    font-size: 15px;
    margin: 0 0 6px;
    color: #0f172a;
}

/* LOI list — compact approval columns */
.admin-table--loi-list {
    font-size: 13px;
}

.admin-table--loi-list .admin-th-approval,
.admin-table--loi-list .admin-td-approval {
    text-align: center;
    min-width: 72px;
    max-width: 88px;
}

.admin-table--loi-list .admin-th-letter,
.admin-table--loi-list .admin-td-letter {
    text-align: center;
    min-width: 108px;
    max-width: 130px;
    vertical-align: middle;
    font-size: 12px;
    line-height: 1.25;
}

.admin-approval-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.admin-approval-pill--pending {
    background: #f1f5f9;
    color: #64748b;
}

.admin-approval-pill--approved {
    background: #dcfce7;
    color: #15803d;
}

.admin-approval-pill--rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-approval-pill--neutral {
    background: #e0f2fe;
    color: #0369a1;
}

.admin-td-wrap {
    max-width: 160px;
    word-wrap: break-word;
}

.admin-loi-table-wrap {
    margin-top: 8px;
}

/*
 * Sticky list header (shared LOI + Affiliation admin lists).
 * Vertical + horizontal scroll share one wrap so thead stays aligned
 * with tbody during overflow-x / drag-to-scroll. Scrollport sits below
 * the admin header/nav in the page layout (no navbar overlap).
 */
.admin-loi-table-wrap.table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 12.5rem);
    -webkit-overflow-scrolling: touch;
}

.admin-loi-table-wrap .admin-table--loi-list {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

/* Restore Bootstrap .table-bordered grid under border-collapse:separate (needed for sticky). */
.admin-loi-table-wrap .admin-table--loi-list > :not(caption) > * > * {
    border: 1px solid #dee2e6;
    border-top-width: 0;
    border-left-width: 0;
}

.admin-loi-table-wrap .admin-table--loi-list > :not(caption) > *:first-child > * {
    border-top-width: 1px;
}

.admin-loi-table-wrap .admin-table--loi-list > :not(caption) > * > *:first-child {
    border-left-width: 1px;
}

.admin-loi-table-wrap .admin-table--loi-list > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #1e84b5;
    color: #fff;
    border-color: #1674a3;
}

.admin-loi-table-wrap.js-h-drag-scroll {
    cursor: grab;
}

.admin-loi-table-wrap.js-h-drag-scroll.is-dragging {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
}

.admin-loi-table-wrap.js-h-drag-scroll.is-dragging * {
    user-select: none;
    -webkit-user-select: none;
}

.admin-table--loi-list .admin-th-action,
.admin-table--loi-list .admin-td-action {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
}

.admin-remarks-btn {
    white-space: nowrap;
}

.admin-remarks-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #f8fafc;
}

.admin-remarks-card:last-child {
    margin-bottom: 0;
}

.admin-remarks-card__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.admin-remarks-card__head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.admin-remarks-edit-btn {
    font-size: 12px;
    line-height: 1.2;
}

.admin-remarks-card__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
    flex: 1 1 200px;
}

.admin-remarks-card__date {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 8px;
}

.admin-remarks-card__remark {
    margin: 0;
    padding: 10px 12px;
    background: #fff;
    border-left: 3px solid #1e84b5;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.55;
    color: #334155;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.admin-remarks-card__remark--empty {
    border-left-color: #cbd5e1;
    color: #94a3b8;
    font-style: italic;
    background: transparent;
    padding-left: 0;
}

.admin-workflow-review-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.admin-loi-view-section + .admin-workflow-review-section {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.admin-decision-modal__footer {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

.admin-decision-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

#adminLoiDecisionModal .modal-body .form-label {
    font-weight: 600;
    color: #0f172a;
}

.admin-loi-view-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.admin-loi-view-section:last-of-type {
    border-bottom: none;
}

.admin-loi-view-section__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
}

.admin-loi-view-value {
    color: #334155;
    font-size: 14px;
}

/* LOI field | value tables */
.loi-fields-table {
    font-size: 14px;
    margin-bottom: 0;
}

.loi-fields-table__head th {
    background: #1e84b5;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-color: #1674a3 !important;
    padding: 10px 14px;
}

.loi-fields-table__th-label {
    width: 34%;
    min-width: 200px;
}

.loi-fields-table__label {
    width: 34%;
    min-width: 200px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
    font-size: 13px;
    vertical-align: top;
    padding: 12px 14px;
    border-color: #e2e8f0 !important;
}

.loi-fields-table__value {
    color: #0f172a;
    font-size: 14px;
    font-weight: 500;
    vertical-align: top;
    padding: 12px 14px;
    word-break: break-word;
    background: #fff;
}

.loi-fields-table__value--empty {
    color: #94a3b8;
    font-weight: 400;
    font-style: italic;
}

.loi-fields-table tbody tr:hover .loi-fields-table__value {
    background: #f8fafc;
}

/* Single full-application table — compact, fits page width */
.loi-fields-table--full {
    table-layout: fixed;
    width: 100%;
    font-size: 12px;
}

.loi-fields-table--full .loi-fields-table__head th {
    padding: 6px 8px;
    font-size: 11px;
}

.loi-fields-table--cols-4 .loi-fields-table__label {
    width: 14%;
    min-width: 0;
    max-width: none;
    padding: 5px 8px;
    font-size: 11px;
    line-height: 1.3;
}

.loi-fields-table--cols-4 .loi-fields-table__value {
    width: 36%;
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.35;
}

.loi-fields-table--cols-4 .loi-fields-table__spacer {
    background: #fafbfc;
    border-color: #e2e8f0 !important;
}

.loi-fields-table__section td {
    background: #1e84b5;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    padding: 5px 8px;
    letter-spacing: 0.03em;
    border-color: #1674a3 !important;
}

.admin-loi-view-section--full-table {
    border-bottom: none;
    margin-bottom: 24px;
    padding-bottom: 0;
}

.admin-loi-docs-table .admin-doc-reject-btn {
    white-space: nowrap;
}

.admin-activity-log-table {
    font-size: 13px;
}

.admin-activity-log-table code {
    font-size: 11px;
    color: #475569;
}

.admin-loi-docs-table .admin-doc-review-form textarea {
    min-width: 160px;
}

.admin-doc-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.admin-doc-pill--pending {
    background: #f1f5f9;
    color: #64748b;
}

.admin-doc-pill--approved {
    background: #dcfce7;
    color: #15803d;
}

.admin-doc-pill--rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-doc-pill--expired {
    background: #ffedd5;
    color: #c2410c;
}

.admin-doc-pill--resubmitted {
    background: #fef3c7;
    color: #b45309;
}

.admin-loi-file-link {
    word-break: break-all;
    font-size: 13px;
}

.uploaded-file-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #1e84b5;
    background: #e8f4fa;
    color: #1e84b5;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.uploaded-file-view-btn:hover {
    background: #1e84b5;
    border-color: #1e84b5;
    color: #fff;
}

.uploaded-file-view-btn i {
    font-size: 15px;
}

.admin-auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 15px;
    background: #f5f6f8;
}

.admin-auth-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 1100px;
}

.admin-auth-left {
    background: linear-gradient(135deg, #1e84b5, #0d5d82);
    color: #fff;
    padding: 60px 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.admin-auth-left h2 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
}

.admin-auth-form {
    padding: 50px 40px;
}

.admin-input-box {
    position: relative;
}

.admin-input-box i {
    position: absolute;
    left: 16px;
    top: 18px;
    color: #8c8c8c;
    z-index: 2;
}

.admin-input-box .form-control,
.admin-input-box .form-select {
    padding-left: 45px;
    height: 55px;
    border-radius: 12px;
}

.admin-btn-main {
    background: #1e84b5;
    color: #fff;
    height: 55px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
}

.admin-btn-main:hover {
    background: #16698e;
    color: #fff;
}

.admin-forgot-link {
    font-size: 14px;
    font-weight: 600;
    color: #1e84b5;
    text-decoration: none;
}

.admin-forgot-link:hover {
    color: #16698e;
    text-decoration: underline;
}

.admin-captcha-row {
    display: flex;
    align-items: stretch;
}

.admin-captcha-code {
    background: #e8e3d0;
    padding: 0 18px;
    border-radius: 12px 0 0 12px;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    min-height: 55px;
    letter-spacing: 2px;
}

.admin-captcha-input {
    border-radius: 0 12px 12px 0 !important;
    height: 55px;
    font-size: 16px;
}

.admin-module-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    height: 100%;
}

.admin-module-card:hover {
    border-color: #1e84b5;
    box-shadow: 0 8px 28px rgba(30, 132, 181, 0.15);
    transform: translateY(-2px);
    color: inherit;
}

.admin-module-card__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.admin-module-card__icon--loi {
    background: linear-gradient(135deg, #1e84b5, #0d9488);
}

.admin-module-card__icon--aff {
    background: linear-gradient(135deg, #6366f1, #1e84b5);
}

.admin-module-card__body {
    flex: 1;
    min-width: 0;
}

.admin-module-card__title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.admin-module-card__meta {
    margin: 0 0 8px;
    font-size: 14px;
    color: #64748b;
}

.admin-module-card__badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #fef3c7;
    color: #b45309;
}

.admin-module-card__hint {
    font-size: 13px;
}

.admin-module-card__arrow {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 18px;
}

.admin-module-card:hover .admin-module-card__arrow {
    color: #1e84b5;
}

@media (max-width: 991px) {
    .admin-auth-left {
        display: none;
    }
    .admin-auth-form {
        padding: 35px 20px;
    }
}
