/* 基本設定 */
html {
    background: #f9fafc;
    font-family: 'M PLUS Rounded 1c', 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

body {
    color: #5a5a5a;
    line-height: 1.6;
}

/* メインコンテンツエリア */
main {
    width: 100%;
    padding: 0px 8px;
    margin: 0 auto;
    max-width: 1200px;
}

/* フラッシュメッセージ */
.flash {
    text-align: center;
    position: relative;
    margin: 10px 0;
    padding: 12px;
    border-radius: 20px;
    animation: fadeIn 0.7s ease-out;
    background-color: rgba(255, 96, 82, 0.8);
    color: white;
    cursor: pointer;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* 必須マーク */
span.req {
    font-size: 0.7rem;
    color: #fff;
    background: #ff7070;
    padding: 0.2rem 0.5rem;
    margin: 0.5rem;
    vertical-align: middle;
    float: right;
    border-radius: 20px;
}

/* プレースホルダー */
::placeholder {
    color: #aab6c2;
}

/* パンくず(タブデザイン。現在ページは塗りつぶし表示) */
.breadcrumb {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #a8c5db;
}
.breadcrumb ul {
    display: flex;
    align-items: flex-end;
    /* タブなので折り返さず、入りきらない場合は横スクロールさせる */
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.breadcrumb ul::-webkit-scrollbar {
    display: none;
}
.breadcrumb ul li {
    flex: 0 0 auto;
}
.breadcrumb ul li a {
    white-space: nowrap;
}
.breadcrumb ul li + li::before {
    content: none !important;
    display: none !important;
}
.breadcrumb ul li a {
    display: inline-block;
    padding: 0.5rem 1.1rem !important;
    border-radius: 10px 10px 0 0;
    background: #eef5fb;
    color: #5a8bb8 !important;
    border: 1px solid #d5e4ef;
    border-bottom: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.breadcrumb ul li a:hover {
    background: #e0eff8;
}
.breadcrumb ul li.is-active a {
    background: #6b9dc7;
    color: #fff !important;
    border-color: #6b9dc7;
    font-weight: 600;
}

/* ボックス */
.box {
    border-radius: 20px;
    padding: 1.8rem 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    background-color: white;
    margin-bottom: 2rem;
}

.box:not(.narrow) {
    overflow-x: auto;
}

.box.narrow {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.box.mid {
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.box:first-of-type {
    margin-top: 1.5rem;
}

/* テーブル */
div.table-container {
    border-radius: 15px;
    overflow-x: auto;
    overflow-y: auto;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    min-height: 200px;
    max-height: 80vh;
    display: block;
}

.table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #e8f2f8;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #a8c5db;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #6b9dc7;
}

table.list {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table.list thead th {
    background-color: #e0eff8;
    color: #5a8bb8;
    font-weight: 600;
    padding: 12px 0;
    text-align: center;
    border-bottom: 1px solid #d5e4ef;
    border-left: 1px solid #d5e4ef;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    box-sizing: border-box;
}

table.list thead th:first-child {
    border-left: none;
}

table.list tbody tr:nth-child(2n + 1) {
    background-color: #f9fafc;
}

table.list tbody tr:hover {
    background-color: #f5fafc;
}

table.list tbody td {
    padding: 12px 8px;
    border-bottom: 1px solid #e8f2f8;
    border-left: 1px solid #e8f2f8;
    font-size: 0.9rem;
    box-sizing: border-box;
}

table.list tbody td:first-child {
    border-left: none;
}

table.list tbody tr:last-child td {
    border-bottom: none;
}

table.list td.left {
    text-align: left;
}

table.list td.center {
    text-align: center;
}

table.list td.right {
    text-align: right;
}

td.center {
    text-align: center !important;
}

/* 垂直テーブル */
table.vertical {
    width: 100%;
    max-width: 800px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    border-collapse: separate;
    border-spacing: 0;
}

table.vertical th {
    padding: 12px 15px;
    background: #f0f5fa;
    vertical-align: middle;
    font-size: 0.95rem;
    font-weight: 500;
    width: 35%;
    box-sizing: border-box;
    border-bottom: 1px solid #e8eef4;
    text-align: left;
    color: #7799b3;
}

table.vertical td {
    padding: 12px 15px;
    background: #fff;
    font-size: 0.95rem;
    box-sizing: border-box;
    border-bottom: 1px solid #f0f5fa;
    vertical-align: middle;
    color: #5a5a5a;
}

table.vertical tr:last-child th,
table.vertical tr:last-child td {
    border-bottom: none;
}

/* データ表示エリア */
.data {
    background: #f6f8fa;
    padding: 15px;
    border-radius: 15px;
}

/* フォーム要素 */
input,
select,
textarea {
    border-radius: 50px !important;
    border: 1px solid #e8eef4 !important;
    background-color: #f6f8fa !important;
    transition: all 0.3s ease !important;
    padding: 0.5rem 1.2rem !important;
    color: #5a5a5a !important;
}
textarea {
    border-radius: 1px !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #b4c8d8 !important;
    box-shadow: 0 0 0 3px rgba(180, 200, 216, 0.2) !important;
}

input[type='number'].right {
    text-align: right;
}

input[type='file'] {
    padding: 10px;
    border-radius: 15px !important;
}

/* メッセージボックス */
.message {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
}

.message-body {
    font-size: 1.2em;
    text-align: center;
    padding: 1.2rem;
    border: none;
    border-radius: 15px;
    background-color: #f0f5fa;
    color: #7799b3;
    border-left: 5px solid #b4c8d8;
}

/* テーブルのサイズ設定 */
table.list th[size='50'],
table.list td[size='50'] {
    width: 50px;
}

table.list th[size='75'],
table.list td[size='75'] {
    width: 75px;
}

table.list th[size='90'],
table.list td[size='90'] {
    width: 90px;
}

table.list th[size='100'],
table.list td[size='100'] {
    width: 100px;
}

table.list th[size='125'],
table.list td[size='125'] {
    width: 125px;
}

table.list th[size='150'],
table.list td[size='150'] {
    width: 150px;
}

table.list th[size='175'],
table.list td[size='175'] {
    width: 175px;
}

table.list th[size='200'],
table.list td[size='200'] {
    width: 200px;
}

table.list th[size='225'],
table.list td[size='225'] {
    width: 225px;
}

table.list th[size='250'],
table.list td[size='250'] {
    width: 250px;
}

table.list th[size='275'],
table.list td[size='275'] {
    width: 275px;
}

table.list th[size='300'],
table.list td[size='300'] {
    width: 300px;
}

table.list th[size='325'],
table.list td[size='325'] {
    width: 325px;
}

table.list th[size='350'],
table.list td[size='350'] {
    width: 350px;
}

table.list th[size='375'],
table.list td[size='375'] {
    width: 375px;
}

table.list th[size='400'],
table.list td[size='400'] {
    width: 400px;
}

table.list th[size='425'],
table.list td[size='425'] {
    width: 425px;
}

table.list th[size='450'],
table.list td[size='450'] {
    width: 450px;
}

table.list th[size='500'],
table.list td[size='500'] {
    width: 500px;
}

/* ラジオボタン */
.radio_wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

input[type='radio'] {
    display: none;
}

label.radio_item {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 30px;
    transition: all 0.3s ease;
    color: #5a5a5a;
}

label.radio_item:after,
label.radio_item:before {
    position: absolute;
    content: '';
    transition: all 0.3s ease;
}

label.radio_item:after {
    left: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #c4d3e0;
    border-radius: 50%;
    background: white;
}

label.radio_item:before {
    left: 5px;
    width: 10px;
    height: 10px;
    background: #88a6bd;
    border-radius: 50%;
    position: absolute;
    opacity: 0;
}

label.radio_item:hover:after {
    border-color: #88a6bd;
}

label.radio_item.checked:after {
    border-color: #88a6bd;
}

label.radio_item.checked:before {
    opacity: 1;
}

/* ボタン */
.button {
    border-radius: 50px;
    transition: all 0.3s ease;
    height: 2.8rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.button.is-primary {
    background-color: #88a6bd;
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(136, 166, 189, 0.3);
}

.button.is-primary:hover {
    background-color: #7799b3;
    box-shadow: 0 6px 20px rgba(136, 166, 189, 0.4);
    transform: translateY(-2px);
}

.button.is-info {
    background-color: #88a6bd;
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(136, 166, 189, 0.3);
}

.button.is-info:hover {
    background-color: #7799b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(136, 166, 189, 0.4);
}

.button.is-success {
    background-color: #8abf9c;
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(138, 191, 156, 0.3);
}

.button.is-success:hover {
    background-color: #79ad8b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 191, 156, 0.4);
}

.button.is-danger {
    background-color: #ff8c8c;
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 140, 140, 0.3);
}

.button.is-danger:hover {
    background-color: #ff7070;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 140, 0.4);
}

.button.is-dark {
    background-color: #6d7987;
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(109, 121, 135, 0.3);
}

.button.is-dark:hover {
    background-color: #5d6978;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(109, 121, 135, 0.4);
}

/* トースト通知 */
#toast-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 0;
    padding-top: calc(12px + env(safe-area-inset-top));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    width: 100%;
    max-width: 480px;
    margin: 0;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    font-size: 0.92rem;
    line-height: 1.5;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-shown {
    opacity: 1;
    transform: translateY(0);
}

.toast .toast-text {
    flex: 1;
    white-space: pre-line;
}

/* 確認モーダル */
.confirm-modal .modal-card {
    width: calc(100% - 2rem);
    max-width: 420px;
    border-radius: 15px;
    overflow: hidden;
}

.confirm-modal .modal-card-head,
.confirm-modal .modal-card-foot {
    background-color: #f8fbfd;
    border-color: #e8eef4;
}

.confirm-modal .modal-card-title {
    font-size: 1.05rem;
    color: #5a8bb8;
}

.confirm-modal .modal-card-body {
    padding: 1.5rem 1.2rem;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.confirm-modal .modal-card-foot {
    justify-content: flex-end;
    gap: 0.5rem;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
    .box {
        padding: 1.2rem 0.6rem;
    }

    /* スマホではタブを詰めて3階層でも収まりやすくする */
    .breadcrumb ul li a {
        padding: 0.45rem 0.8rem !important;
        font-size: 0.82rem;
    }

    .confirm-modal .modal-card-foot {
        flex-direction: column-reverse;
    }

    .confirm-modal .modal-card-foot .button {
        width: 100%;
        margin: 0;
    }

    .navbar {
        border-radius: 0;
    }

    table.vertical th {
        width: 40%;
    }
}
