/* ====================================================
   TABS
==================================================== */
.tcm-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 18px;
}

.tcm-tab {
    padding: 10px 22px;
    background: #f4f4f4;
    border-radius: 2px 2px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    border: 1px solid #e1e1e1;
    border-bottom: none;
    transition: 0.25s ease;
}

.tcm-tab:hover {
    background: #e8e8e8;
}

.tcm-tab.active {
    background: #ffffff;
    color: #005bac;
    border-bottom: 2px solid #005bac;
}

/* ====================================================
   SEARCH BAR (FULL WIDTH DESKTOP)
==================================================== */
.tcm-search {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 0 0 18px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    font-size: 15px;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition: 0.2s ease;
}

.tcm-search:focus {
    border-color: #005bac;
    box-shadow: 0 0 0 2px rgba(0,91,172,0.15);
}

/* ====================================================
   TABLE WRAPPER (DESKTOP)
==================================================== */
.tcm-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 35px;
}

/* ====================================================
   TABLE (DESKTOP)
==================================================== */
.tcm-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

/* ---------- HEADER ---------- */
.tcm-table thead th {
    padding: 16px 12px;
    font-weight: 800;
    font-size: 15px;
    background: #f1f5f9;
    border-bottom: 2px solid #e5e7eb;
    text-align: center;
    white-space: nowrap;
}

/* ---------- BODY ---------- */
.tcm-table tbody td {
    padding: 12px;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    text-align: center;
}

/* Zebra */
.tcm-table tbody tr:nth-child(even) td {
    background: #fafafa;
}

/* Hover */
.tcm-table tbody tr:hover td {
    background: #eef6ff;
}

/* ====================================================
   COLUMN WIDTHS (DESKTOP ONLY)
==================================================== */
.tcm-table th:first-child,
.tcm-table td:first-child {
    width: 110px;
}

.tcm-table th:nth-child(2),
.tcm-table td:nth-child(2) {
    width: calc((100% - 110px) / 3);
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tcm-table th:nth-child(3),
.tcm-table td:nth-child(3),
.tcm-table th:nth-child(4),
.tcm-table td:nth-child(4) {
    width: calc((100% - 110px) / 3);
}

/* ====================================================
   THUMBNAIL
==================================================== */
.tcm-thumb {
    width: 82px;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: 0.25s ease;
}

.tcm-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* ====================================================
   PDF PREVIEW
==================================================== */
.tcm-pdf-preview {
    display: inline-block;
    width: 85px;
    height: 110px;
    padding: 6px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #fff;
    transition: 0.25s ease;
}

.tcm-pdf-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tcm-pdf-preview:hover {
    transform: scale(1.08);
    border-color: #005bac;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

/* ====================================================
   PDF FALLBACK
==================================================== */
.tcm-icon-pdf {
    width: 85px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #eef4ff;
    border: 2px solid #005bac;
    color: #005bac;
    font-weight: 600;
    font-size: 18px;
    transition: 0.25s ease;
}

.tcm-icon-pdf:hover {
    background: #005bac;
    color: #ffffff;
    transform: scale(1.08);
}

/* ====================================================
   PAGINATION
==================================================== */
.tcm-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 22px 0 35px;
    flex-wrap: wrap;
}

.tcm-pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid #dcdcdc;
    background: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.tcm-pagination button.active {
    background: #005bac;
    border-color: #005bac;
    color: #ffffff;
}

/* ====================================================
   MOBILE – FINAL (NO OVERFLOW)
==================================================== */
@media (max-width: 768px) {

    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Tabs */
    .tcm-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tcm-tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Search */
    .tcm-search {
        width: 100%;
    }

    /* Disable table scrolling */
    .tcm-table-wrapper {
        overflow: visible;
    }

    /* Table → Cards */
    .tcm-table,
    .tcm-table tbody,
    .tcm-table tr {
        display: block;
        width: 100%;
    }

    .tcm-table {
        border: none;
        table-layout: auto;
    }

    .tcm-table thead {
        display: none;
    }

    .tcm-table tr {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 14px;
        margin-bottom: 16px;
    }

    .tcm-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px 0;
        border: none;
        text-align: left;
        font-size: 14px;
        white-space: normal;
        word-break: break-word;
    }

    .tcm-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #374151;
        flex: 0 0 42%;
        padding-right: 10px;
    }

    /* Reset widths */
    .tcm-table td,
    .tcm-table th {
        width: auto !important;
        max-width: 100% !important;
    }

    /* Images */
    .tcm-thumb {
        width: 70px;
    }

    .tcm-pdf-preview,
    .tcm-icon-pdf {
        width: 75px;
        height: 100px;
    }

    /* Pagination */
    .tcm-pagination {
        flex-direction: column;
        gap: 8px;
    }

    .tcm-pagination button {
        width: 100%;
        max-width: 320px;
        height: 42px;
        font-size: 15px;
    }
}
