/* ==========================================================================
   Cambridge module — shared table styles
   Staff portal (mod_staff_*) + Block registration (mod_block_participant_table)
   Loaded by ModuleStaff, ModuleBlock and ModuleRetake (see plan-
   table-styling-responsiveness.md).
   ========================================================================== */

/* --- Wrapper: horizontal scroll backstop ---------------------------------- */
.cambridge__table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cambridge__table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

/* --- Cells: padding fixes the "words glued together" problem -------------- */
.cambridge__table-wrapper th,
.cambridge__table-wrapper td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Headers: left-aligned (UA default is center), nowrap, stronger rule */
.cambridge__table-wrapper thead th {
    font-weight: 600;
    white-space: nowrap;
    background: #f5f5f5;
    border-bottom: 2px solid #c9c9c9;
}

/* Zebra striping (body only, so thead keeps its background) */
.cambridge__table-wrapper tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Action icon columns: space the delete/edit icons apart */
.cambridge__table-wrapper td > a {
    margin-left: 12px;
    white-space: nowrap;
}

.cambridge__table-wrapper td > a:first-child {
    margin-left: 0;
}

/* Status/warning icon column (first column of the block participant table) */
.cambridge__table-wrapper .cambridge__table--center {
    text-align: center;
}

/* Numeric / monetary columns (Exam Fee, totals) */
.cambridge__table-wrapper .cambridge__table--num {
    text-align: right;
    white-space: nowrap;
}

/* --- Block participant table (has its own #id, same wrapper) -------------- */
#block-participant-table {
    width: 100%;
    border-collapse: collapse;
}

#block-participant-table [data-price-row] td {
    border-top: 2px solid #c9c9c9;
    background: #f5f5f5;
}

/* --- Inputs inside claim-table cells -------------------------------------- */
.cambridge__table-wrapper label {
    display: inline-flex;
    align-items: center;
}

.cambridge__table-wrapper label span {
    margin-left: 4px;
}

.cambridge__table-wrapper input[type="number"].cambridge__staff--intable-number {
    width: 80px;
}

.cambridge__table-wrapper input[type="text"].cambridge__staff--intable-number {
    width: 100%;
    max-width: 280px;
}

/* --- Staff "totals" side-by-side pair (claim exams / certifications) ------- */
.cambridge__staff--totals {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* --- Mobile: hide secondary columns, stack the totals pair ----------------- */
@media (max-width: 767px) {
    .cambridge__table-wrapper .cambridge__mobile--hidden {
        display: none;
    }

    .cambridge__table-wrapper table {
        font-size: 0.85rem;
    }

    .cambridge__table-wrapper th,
    .cambridge__table-wrapper td {
        padding: 6px 8px;
    }

    /* Override the inline flex: 1 1 75% / 25% on the claim totals wrappers */
    .cambridge__staff--totals {
        flex-direction: column;
    }

    .cambridge__staff--totals > .cambridge__table-wrapper {
        flex-basis: auto !important;
        width: 100%;
    }
}
