/* ===== Table ===== */
.table-wrap {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table--sticky {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.table--sticky th {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Hide scrollbar but keep scrolling functionality */
.table-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.table-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.table--fixed {
    table-layout: fixed;
}

.table--fixed td:last-child,
.table--fixed th:last-child,
.table--fixed td:nth-child(4),
.table--fixed th:nth-child(4) {
    white-space: nowrap;
}

.table-scroll table {
    table-layout: fixed;
}

.table--purchases td:nth-child(1),
.table--purchases th:nth-child(1),
.table--purchases td:nth-child(3),
.table--purchases th:nth-child(3),
.table--purchases td:nth-child(4),
.table--purchases th:nth-child(4) {
    white-space: nowrap;
}

.table--logs td:nth-child(1),
.table--logs th:nth-child(1),
.table--logs td:nth-child(2),
.table--logs th:nth-child(2) {
    white-space: nowrap;
}

th,
td {
    padding: 0.625rem clamp(0.5rem, 1.1vw, 1rem);
    text-align: left;
    font-size: 0.875rem;
}

td {
    overflow-wrap: anywhere;
}

th {
    background: #f9fafb;
    color: var(--color-text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

tr:not(:last-child) td {
    border-bottom: 1px solid var(--color-border);
}

tr:hover td {
    background: #fafbfc;
}

td .btn {
    margin-right: 0.25rem;
}

.cell-actions {
    white-space: nowrap;
}

.cell-express {
    line-height: 1.25;
    white-space: normal;
}

.cell-express__fee {
    font-size: 0.95rem;
    font-weight: 600;
}

.cell-express__company {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.cell-desc {
    line-height: 1.35;
    white-space: normal;
}

.cell-desc__badge {
    margin-top: 0.25rem;
}

.row--extra td:first-child {
    box-shadow: inset 0.1875rem 0 0 #10b981;
}

/* Progress table specific styles */
.table--progress td:nth-child(2),
.table--progress th:nth-child(2),
.table--progress td:nth-child(3),
.table--progress th:nth-child(3),
.table--progress td:nth-child(4),
.table--progress th:nth-child(4),
.table--progress td:nth-child(5),
.table--progress th:nth-child(5) {
    white-space: nowrap;
}

.table--progress .playtime-input {
    width: 4.375rem;
}

.table--progress .status-select {
    width: 100%;
}

/* Status badges */
.status--not-started {
    color: var(--color-text-secondary);
    background: #f3f4f6;
}

.status--in-progress {
    color: #1e40af;
    background: #dbeafe;
}

.status--completed {
    color: #166534;
    background: #dcfce7;
}

/* Game source labels under name */
.text-custom {
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.text-shared {
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

/* H5-only inline copies of the platform / express / amount columns (see responsive.css).
   Selector outranks .badge { display: inline-block } from badges.css. */
td .cell-game__platform,
td .cell-desc__express,
td .cell-date__amount,
td .cell-game__meta {
    display: none;
}
