table, td, th {
    margin: 0 auto;
    text-align: center;
    border-collapse: collapse;
    font-family: inherit;
}

/* Responsive table wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 参加登録費テーブル専用スタイル */
.table-responsive table {
    width: 100%;
    min-width: 600px;
    border-radius: 8px;
    overflow: hidden;
}

/* 参加登録費テーブル専用スタイル - より具体的なスタイル */

/* 1行目（rowspan=2がある行）のスタイル - 6列目（当日の基本料金）の前に境界線 */
.registration-table tbody tr:nth-child(odd) td:nth-child(6) {
    border-left: 2px solid #5591af !important;
}

/* 2行目（rowspanの影響でセルが少ない行）のスタイル - 5列目（当日の基本料金）の前に境界線 */
.registration-table tbody tr:nth-child(even) td:nth-child(5) {
    border-left: 2px solid #5591af !important;
}

/* 金額列の右揃え - 1行目（rowspan有り） - 基本料金と合計 */
.registration-table tbody tr:nth-child(odd) td:nth-child(2),
.registration-table tbody tr:nth-child(odd) td:nth-child(4),
.registration-table tbody tr:nth-child(odd) td:nth-child(5),
.registration-table tbody tr:nth-child(odd) td:nth-child(7) {
    text-align: right !important;
    padding-right: 20px !important;
}

/* 金額列の右揃え - 2行目（rowspan無し） - 基本料金と合計 */
.registration-table tbody tr:nth-child(even) td:nth-child(1),
.registration-table tbody tr:nth-child(even) td:nth-child(3),
.registration-table tbody tr:nth-child(even) td:nth-child(4),
.registration-table tbody tr:nth-child(even) td:nth-child(6) {
    text-align: right !important;
    padding-right: 20px !important;
}

/* 消費税列の中央揃え - 1行目 */
.registration-table tbody tr:nth-child(odd) td:nth-child(3),
.registration-table tbody tr:nth-child(odd) td:nth-child(6) {
    text-align: center !important;
}

/* 消費税列の中央揃え - 2行目 */
.registration-table tbody tr:nth-child(even) td:nth-child(2),
.registration-table tbody tr:nth-child(even) td:nth-child(5) {
    text-align: center !important;
}

td, th {
    width: max-content;
    height: auto;
    padding: 12px 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: background-color 0.2s ease;
}

th {
    background: #5591af;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.025em;
}

/* 行の左端のヘッダーセル */
tbody th {
    background: rgba(85, 145, 175, 0.15);
    color: #2d3748;
    font-weight: 600;
    text-align: left;
}

.bold {
    font-weight: 700;
    color: #2d3748;
}

.even {
    background: rgba(85, 145, 175, 0.05);
}

.odd {
    background: rgba(255, 255, 255, 0.8);
}

.even:hover,
.odd:hover {
    background: rgba(102, 126, 234, 0.1);
}

table.lost-items {
    margin: 1.5rem auto;
    text-align: center;
    border-collapse: collapse;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

table.lost-items th {
    text-align: center;
    background: #5591af;
    color: #ffffff;
}

table.lost-items td, table.lost-items th {
    width: max-content;
    min-width: 12em;
    height: auto;
    padding: 12px 16px;
    text-align: center;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

tr.table-item-noborder td {
    border: 0;
    text-align: left;
}

tr.table-item-noborder th {
    border: 0;
    text-align: right;
    background: #ffffff;
}

tr, th {
    text-align: left;
}

/* モバイル用テーブルスタイル */
@media screen and (max-width: 959px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .table-responsive table {
        min-width: 800px;
        font-size: 0.85rem;
    }

    .table-responsive td,
    .table-responsive th {
        padding: 8px 12px;
        white-space: nowrap;
    }

    /* テーブルヘッダーを固定表示する場合 */
    .table-responsive thead th {
        position: sticky;
        top: 0;
        background: #5591af;
        z-index: 10;
    }

    /* スクロールヒントの追加 */
    .table-responsive::after {
        content: "← スクロール可能 →";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: #666;
        padding: 0.5rem;
        background: rgba(85, 145, 175, 0.05);
        border-top: 1px solid rgba(226, 232, 240, 0.8);
    }
}