/* 1. 基本設定: bodyとhtmlのスクロールを無効化し、高さを100%にする */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 2. ヘッダーの固定 */
.main-header {
    width: 100%;
    height: 60px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    /* position: fixed;
    z-index: 1000;
    top: 0;
    left: 0; */
}

.main-footer {
    width: 100%;
    z-index: 1001;
}

/* 3. コンテンツ全体のラッパー (#contents) の調整 */
#contents {
    display: flex;
    flex-grow: 1;
    width: 100%;
    overflow: hidden;
    position: relative;
    /* margin-top: 1px;
    height: calc(100% - 1px); */
    margin-top: 0px;
    height: 100%;
    padding-top: 0px;
    padding-bottom: 10px;
}

/* 4. 左サイドメニュー（#sub）の固定 */
#sub {
    width: 150px;
    flex-shrink: 0;
    background-color: #fff;
    border-right: 1px solid #fff;
    position: fixed;
    top: 90px;
    left: 0;
    z-index: 990;
    overflow-y: auto;
    height: calc(100% - 1px);
    margin-left: 10px;
}

/* 5. メインコンテンツと右サイドメニューのラッパー */
#contents-main-wrapper {
    display: flex;
    flex-grow: 1;
    flex-direction: row;
    margin-left: 150px;
    margin-right: 150px;
    box-sizing: border-box;
}

/* 6. メインコンテンツ領域 (#main) のスクロール設定 */
#main {
    flex-grow: 1;
    height: 100%;
    max-width: 95%;
    padding: 10px;
    box-sizing: border-box;
    background-color: #fff;
    padding-bottom: 100px;
}

/* 7. 右サイドメニュー（#side）の固定 */
#side {
    width: 150px;
    flex-shrink: 0;
    background-color: #fff;
    border-left: 1px solid #fff;
    position: fixed;
    top: 90px;
    right: 0;
    z-index: 990;
    overflow-y: auto;
    height: calc(100% - 60px);
    margin-right: 10px;
}

#global-autocomplete-list-container {
    /* このコンテナ自体は表示されず、absoluteな子要素の基準となる */
    position: absolute; /* または relative */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* コンテナ自体はクリックをブロックしない */
    z-index: 9998; /* リスト本体より一つ低いz-index */
}

/* オートコンプリートのリスト本体 */
.autocomplete-items {
    position: fixed;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 9999;
    /* left, top, width はJavaScriptで動的に設定されるため、ここでの固定値は不要 */
    /* left: 0; /* JSで設定 */
    /* right: auto; /* JSで設定 */
    /* width: 200px; /* JSで設定 */
    max-height: 200px;
    overflow-y: auto;
    background-color: #f1f1f1;
    /* margin-top: 2px; /* JSでtopを計算するので不要 */
    pointer-events: auto; /* リストアイテム自体はクリック可能にする */
}

/* <h2>タグの固定 (home.blade.phpからクラス名を反映) */
.sticky-title {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
    padding: 10px 0;
    margin: 0;
    border-bottom: 1px solid #eee;
}

/* <table>の<th>（テーブルヘッダー）の固定 */
.scrollable-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-top: 10px;
}

.scrollable-table thead {
    display: block;
    /* スクロールバーの幅 (約17px) を考慮して、theadの幅を調整 */
    width: calc(100% - 17px);
    position: sticky;
    top: 40px; /* .sticky-titleの高さ（H2の高さ） */
    background-color: #f0f0f0;
    z-index: 15;
}

.scrollable-table tbody {
    display: block;
    height: calc(100vh - 250px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* padding-right: 17px; */
    box-sizing: border-box;
    width: 100%;
}

.scrollable-table th {
    height: 30px; /* <th>行の高さ（padding含む） */
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.scrollable-table thead tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.scrollable-table th:nth-child(1),
.scrollable-table td:nth-child(1) {
    width: 10%;
}
.scrollable-table th:nth-child(2),
.scrollable-table td:nth-child(2) {
    width: 30%;
}
.scrollable-table th:nth-child(3),
.scrollable-table td:nth-child(3) {
    width: 20%;
}
.scrollable-table th:nth-child(4),
.scrollable-table td:nth-child(4) {
    width: 30%;
}
.scrollable-table th:nth-child(5),
.scrollable-table td:nth-child(5) {
    width: 10%;
}

.autocomplete-items-container {
    position: relative;
    display: inline-block;
    width: 100%;
}
.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 9999;
    left: 0;
    right: 200;
    max-height: 200px;
    overflow-y: auto;
    background-color: #f1f1f1;
    margin-top: 2px;
}
.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
}
.autocomplete-items div:hover {
    background-color: #e9e9e9;
}
.autocomplete-active {
    background-color: DodgerBlue !important;
    color: #ffffff;
}

.btnrikishi {
    font-size: 18px;
    width: 100px;
    margin-bottom: 10px;
}

.kimarite_span {
    margin-bottom: 10px;
}
