/* 守永クリニック — ミニマル・ライトテーマ */

:root {
    --site-bg: #ffffff;
    --site-bg-muted: #eef2f1;
    --site-text: #1a1a1a;
    --site-text-muted: #5a5a5a;
    /* クリニックのブランドカラー（落ち着いたティール系） */
    --site-accent: #0e8a7d;
    --site-accent-hover: #0b6f65;
    --site-accent-soft: #e6f5f2;
    --site-border-strong: #000000;
    --site-line: #bdbdbd;
    --site-admin-bar: #1a1a1a;
    --primary-color: var(--site-accent);
    --primary-dark: var(--site-accent-hover);
    --primary-light: var(--site-accent-soft);
    --text-dark: var(--site-text);
    --text-muted: var(--site-text-muted);
    --border-color: var(--site-border-strong);
    --success-color: #2e7d32;
    --danger-color: #c62828;
    --warning-color: #e65100;
    /* サブページの枠線用（深緑がかった紺） */
    --site-navy-line: #155e52;
    --info-color: #1565c0;
}

body {
    font-family: "Noto Sans JP", "Segoe UI", system-ui, sans-serif;
    background-color: var(--site-bg);
    color: var(--site-text);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* ----- ヘッダー（公開） ----- */
.site-navbar {
    background: var(--site-bg) !important;
    box-shadow: none !important;
}

.site-navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    letter-spacing: 0.02em;
    color: var(--site-text) !important;
    text-decoration: none !important;
}

.site-logo-img {
    height: clamp(44px, 5vw, 54px);
    width: auto;
    max-width: min(200px, 44vw);
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.site-navbar-admin .site-logo-img {
    background: #fff;
    padding: 4px 10px;
    border-radius: 4px;
}

.site-logo-text {
    line-height: 1.2;
}

.site-nav-link {
    color: var(--site-text) !important;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.65rem !important;
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav-link:hover {
    color: var(--site-accent) !important;
    border-bottom-color: rgba(14, 138, 125, 0.35);
}

.site-nav-link--accent {
    color: var(--site-accent) !important;
}

.site-nav-link--accent:hover {
    border-bottom-color: var(--site-accent);
}

.site-navbar .navbar-toggler:focus {
    box-shadow: none;
}

/* 管理ナビ */
.site-navbar-admin {
    background: var(--site-admin-bar) !important;
    box-shadow: none !important;
}

.site-navbar-admin .navbar-brand {
    color: #fff !important;
}

.scroll-mt {
    scroll-margin-top: 1.25rem;
}

/* トップ: 施設案内・料金・予約状況を常に縦積み（main 内の入れ子コンテナでも横並びにならないよう明示） */
.site-home-sections-stack {
    flex-direction: column;
    align-items: stretch;
}

.site-home-sections-stack > * {
    flex: 0 0 auto;
    max-width: 100%;
    min-width: 0;
}

/* ホーム以外: Bootstrap の黄色枠・テンプレ内の黄系 border を紺の線に統一 */
body.site-subpage .border-warning {
    border-color: var(--site-navy-line) !important;
}

body.site-subpage .plan-option:hover {
    border-color: var(--site-accent) !important;
}

body.site-subpage .plan-option input[type="radio"]:checked ~ .plan-details {
    border-color: var(--site-accent) !important;
}

body.site-subpage .admin-dash-menu-head {
    border-bottom-color: var(--site-accent-hover) !important;
}

body.site-subpage .admin-dash-tile {
    border-color: var(--site-accent-hover) !important;
}

body.site-subpage .admin-dash-tile:hover {
    box-shadow: 0 4px 12px rgba(14, 138, 125, 0.35);
}

body.site-subpage .staff-dash-tile {
    border-color: var(--site-accent-hover) !important;
}

body.site-subpage .staff-dash-tile:hover {
    box-shadow: 0 4px 12px rgba(14, 138, 125, 0.35);
}

/* 管理・入退室モーダル見出し（水色） */
.modal-header-site-accent {
    background: var(--site-accent);
    color: #000;
    border-bottom: 1px solid var(--site-accent-hover);
}

.modal-header-site-accent .modal-title {
    color: #000;
}

/* ログインカードなど: 枠だけ紺に明示 */
.card.border-site-navy {
    border-color: var(--site-navy-line) !important;
}

/* 場所一覧など: 枠をブランドの青（アクセント）に */
.border-site-accent {
    border-color: var(--site-accent) !important;
}

.site-card-header-accent,
.site-location-list-header {
    background: var(--site-bg);
    color: var(--site-text);
    border-bottom: 2px solid var(--site-accent) !important;
}

.site-card-header-accent .fas,
.site-card-header-accent .far,
.site-location-list-header .fa-map-marker-alt {
    color: var(--site-accent);
}

/* 予約確認内の日付ブロック見出しなど */
.site-card-header-accent-sm {
    background: var(--site-accent-soft);
    color: var(--site-text);
    border-bottom: 1px solid var(--site-accent) !important;
    font-weight: 700;
}

/* アクセントの下線のみ（見出し色はユーティリティ任せ） */
.site-card-header-border-accent {
    background: var(--site-bg);
    border-bottom: 2px solid var(--site-accent) !important;
}

.table-site-total-row th {
    background-color: var(--site-accent-soft) !important;
    border-color: rgba(14, 138, 125, 0.35) !important;
    color: var(--site-text) !important;
}

.site-alert-accent {
    background: var(--site-accent-soft);
    border: 1px solid var(--site-accent);
    color: var(--site-text);
}

.badge-site-pending {
    background: var(--site-accent-soft) !important;
    color: var(--site-text) !important;
    border: 1px solid var(--site-accent);
    font-weight: 600;
}

.badge-site-plan {
    background: var(--site-accent-soft) !important;
    color: var(--site-text) !important;
    border: 1px solid var(--site-accent);
    font-weight: 600;
}

.site-navbar-admin .nav-link:hover {
    color: #fff !important;
}

/* ナビ項目が狭くなったときに最後の1文字だけ改行されるのを防ぐ */
@media (min-width: 992px) {
    .navbar-expand-lg .navbar-nav > .nav-item > .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ----- カード ----- */
.card {
    border: 2px solid var(--site-border-strong);
    border-radius: 0;
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.card:hover {
    transform: none;
    box-shadow: none;
}

.card-header {
    background-color: var(--site-bg) !important;
    color: var(--site-text) !important;
    border-bottom: 1px solid var(--site-line) !important;
    font-weight: 600;
}

.card-title {
    color: var(--site-text) !important;
    font-weight: 600;
}

.site-panel-muted {
    background-color: var(--site-bg-muted);
}

.site-card-feature {
    border: 2px solid var(--site-border-strong);
    border-radius: 0;
    background: var(--site-bg);
}

.site-card-feature .site-card-title {
    color: var(--site-accent);
    font-weight: 600;
    font-size: 1rem;
}

/* =====================================================================
   ボタン（アプリ全体で統一。役割ごとの使い分けは docs/UI_RULES.md の「ボタン」）
   - 主な操作       .btn-warning / .btn-site-accent / .btn-admin-menu … ブランドカラーの塗りつぶし
   - その他の操作   .btn-outline-secondary / .btn-site-accent-outline … 白地にブランドカラーの枠
   - 戻る・キャンセル .btn-secondary … 白地にグレーの枠
   - 削除           .btn-outline-danger … 白地に赤の枠（削除の確定は .btn-danger で赤の塗りつぶし）
   ===================================================================== */
:root {
    --btn-radius: 6px;
    --btn-border: 2px;
    --btn-height: 40px;
    --btn-height-sm: 34px;
    --btn-back: #5f6b73;
    --btn-danger: #c62828;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: var(--btn-height);
    padding: 0.35rem 1rem;
    border-width: var(--btn-border);
    border-style: solid;
    border-radius: var(--btn-radius);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-sm {
    min-height: var(--btn-height-sm);
    padding: 0.2rem 0.75rem;
    font-size: 0.875rem;
}

.btn:focus-visible {
    outline: 3px solid rgba(14, 138, 125, 0.35);
    outline-offset: 2px;
    box-shadow: none;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
}

/* 主な操作 */
.btn-warning,
.btn-site-accent,
.btn-admin-menu {
    background-color: var(--site-accent);
    border-color: var(--site-accent);
    color: #fff;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-site-accent:hover,
.btn-site-accent:focus,
.btn-site-accent:active,
.btn-admin-menu:hover,
.btn-admin-menu:focus {
    background-color: var(--site-accent-hover);
    border-color: var(--site-accent-hover);
    color: #fff;
}

/* その他の操作 */
.btn-outline-secondary,
.btn-site-accent-outline,
.btn-outline-warning,
.btn-light {
    background-color: #fff;
    border-color: var(--site-accent);
    color: var(--site-accent-hover);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-site-accent-outline:hover,
.btn-outline-warning:hover,
.btn-light:hover {
    background-color: var(--site-accent-soft);
    border-color: var(--site-accent-hover);
    color: var(--site-accent-hover);
}

/* 戻る・キャンセル */
.btn-secondary {
    background-color: #fff;
    border-color: #b6bec4;
    color: var(--btn-back);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background-color: var(--site-bg-muted);
    border-color: var(--btn-back);
    color: #3b454c;
}

/* 削除 */
.btn-outline-danger {
    background-color: #fff;
    border-color: var(--btn-danger);
    color: var(--btn-danger);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active,
.btn-danger {
    background-color: var(--btn-danger);
    border-color: var(--btn-danger);
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    background-color: #a31f1f;
    border-color: #a31f1f;
    color: #fff;
}

/* ----- フォーム ----- */
.form-control:focus {
    border-color: var(--site-text);
    box-shadow: 0 0 0 1px var(--site-text);
}

.form-select:focus {
    border-color: var(--site-text);
    box-shadow: 0 0 0 1px var(--site-text);
}

/* ----- バッジ ----- */
.badge.bg-warning {
    background-color: var(--site-bg-muted) !important;
    color: var(--site-text) !important;
    border: 1px solid var(--site-line);
    font-weight: 600;
}

/* ----- アラート ----- */
.alert-warning {
    background-color: var(--site-bg-muted);
    border: 1px solid var(--site-line);
    color: var(--site-text);
}

/* ----- テーブル ----- */
.table-hover tbody tr:hover {
    background-color: var(--site-bg-muted);
}

.table th {
    background-color: var(--site-bg-muted);
    color: var(--site-text);
    font-weight: 600;
    border-color: var(--site-line);
}

.text-warning {
    color: var(--site-accent) !important;
}

/* ----- リンク ----- */
a:not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.page-link):not(.btn):not(.admin-dash-tile):not(.staff-dash-tile) {
    color: var(--site-accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.page-link):not(.btn):not(.admin-dash-tile):not(.staff-dash-tile):hover {
    color: var(--site-accent-hover);
    text-decoration: underline;
}

/* ----- 時間枠 ----- */
.time-slot-option {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    border: 2px solid transparent;
}

.time-slot-option:hover {
    background-color: var(--site-bg-muted);
    border-color: var(--site-line);
}

.time-slot-option.selected {
    background-color: var(--site-text);
    color: #fff;
    border-color: var(--site-text);
    font-weight: 600;
}

.time-slot-option.disabled {
    background-color: var(--site-bg-muted);
    color: var(--site-text-muted);
    cursor: not-allowed;
    opacity: 0.55;
}

/* ----- ページネーション ----- */
.page-link {
    color: var(--site-text);
    border-color: var(--site-line);
}

.page-link:hover {
    background-color: var(--site-bg-muted);
    border-color: var(--site-line);
    color: var(--site-text);
}

.page-item.active .page-link {
    background-color: var(--site-text);
    border-color: var(--site-text);
    color: #fff;
}

/* ----- フッター ----- */
.site-footer {
    background-color: var(--site-bg-muted);
    border-top: 1px solid var(--site-line);
}

.site-footer-copy {
    color: var(--site-text-muted);
}

footer.site-footer {
    background-color: var(--site-bg-muted) !important;
    border-top: 1px solid var(--site-line) !important;
}

/* ----- 場所カード ----- */
.location-card {
    transition: border-color 0.2s ease;
    border: 2px solid var(--site-border-strong) !important;
}

.location-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--site-accent) !important;
}

.location-card:hover .card-title {
    color: var(--site-accent) !important;
}

.location-card:hover .btn {
    background-color: var(--site-text);
    border-color: var(--site-text);
    color: #fff;
}

/* ----- トップ／セクション用 ----- */
.site-hero-fullbleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.site-intro-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--site-text);
}

.site-intro-sub {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--site-text-muted);
}

.site-rule {
    width: 48px;
    height: 2px;
    background: var(--site-border-strong);
    margin: 1.25rem auto 2rem;
}

.site-subnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--site-line);
}

.site-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--site-text) !important;
    text-decoration: none !important;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--site-line);
}

.site-subnav a:hover {
    color: var(--site-accent) !important;
    border-bottom-color: var(--site-accent);
}

.site-section-heading {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.75rem;
}

.site-stats-card {
    background: var(--site-text);
    color: #fff;
    border: 2px solid var(--site-border-strong);
    border-radius: 0;
}

.site-stats-card .card-title {
    color: #fff !important;
}

/* ----- レスポンシブ ----- */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }

    .navbar-nav {
        text-align: left;
    }
}

/* ----- アニメーション ----- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.45s ease-out;
}

/* ----- スクロールバー ----- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--site-bg-muted);
}

::-webkit-scrollbar-thumb {
    background: var(--site-line);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--site-text-muted);
}


/* =====================================================================
   一覧・詳細画面の共通部品（docs/UI_RULES.md）
   ===================================================================== */

/* ----- ページ見出し（タイトルと操作ボタン） ----- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin-bottom: 0;
    font-size: 1.6rem;
}

/* ボタン同士の間隔は 12px 以上（押し間違いを防ぐ） */
.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ----- 行をクリックして詳細を開く表 ----- */
tr.clickable-row {
    cursor: pointer;
}

tr.clickable-row:hover > td,
tr.clickable-row:focus > td {
    background-color: var(--site-accent-soft);
}

tr.clickable-row:focus {
    outline: 2px solid var(--site-accent);
    outline-offset: -2px;
}

/* ----- DataTables ----- */
div.dt-container {
    font-size: 0.95rem;
}

div.dt-container .dt-search input,
div.dt-container .dt-length select {
    font-size: 16px;
}

table.dataTable > tbody > tr > td {
    vertical-align: middle;
}

/* 隠れた項目を開くボタンの列（列が畳まれていないときは幅を取らない） */
table.dataTable th.dt-toggle-col,
table.dataTable td.dt-toggle-col {
    width: 0;
    padding-left: 0;
    padding-right: 0;
}

/* スマホでは、畳む前から幅を取っておく（Responsive は畳む前の幅で列を選ぶため、
   畳んだあとにこの列が広がると、表が画面の右にはみ出す） */
table.dataTable.collapsed th.dt-toggle-col,
table.dataTable.collapsed td.dt-toggle-col {
    width: 44px;
    min-width: 44px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    text-align: center;
}

@media (max-width: 575.98px) {
    table.dataTable th.dt-toggle-col,
    table.dataTable td.dt-toggle-col {
        width: 44px;
        min-width: 44px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        text-align: center;
    }
}

/* 列が畳まれた行を開いたときの表示（長い説明・メモは折り返す） */
table.dataTable > tbody > tr.child > td {
    white-space: normal;
}

table.dataTable > tbody > tr.child ul.dtr-details {
    width: 100%;
}

table.dataTable > tbody > tr.child span.dtr-data {
    word-break: break-word;
}

table.dataTable > tbody > tr.child span.dtr-title {
    min-width: 7em;
    color: var(--site-text-muted);
    font-weight: 500;
}

/* ----- 給与明細の控除額の目安 ----- */
.deduction-hint {
    margin-top: 0.25rem;
    color: var(--site-accent-hover);
    line-height: 1.4;
}

.deduction-hint--differs > div:first-child {
    color: var(--warning-color);
    font-weight: 600;
}

/* ----- 詳細画面の項目一覧 ----- */
.detail-table th {
    width: 35%;
    font-weight: normal;
    color: var(--site-text-muted);
    white-space: nowrap;
}

.detail-table td {
    word-break: break-word;
}

/* ----- 詳細画面の操作ボタン（戻る／編集・削除） ----- */
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.detail-actions-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* 削除ボタンは編集ボタンと離して押し間違いを防ぐ */
.detail-actions-main .btn-danger,
.detail-actions-main .btn-outline-danger {
    margin-left: 1.5rem;
}

/* ----- フォーム・削除確認の下部ボタン（戻る／保存） ----- */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ----- 見出しの右にボタンがあるカードヘッダー（入りきらないときはボタンを次の行へ） ----- */
.card-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.card-header-actions > span {
    flex: 1 1 12rem;
}

/* =====================================================================
   スマホ表示（幅 576px 未満）
   ===================================================================== */
@media (max-width: 575.98px) {
    main.container {
        padding-left: 12px;
        padding-right: 12px;
    }

    h1, .h1 {
        font-size: 1.4rem;
    }

    .page-header h1 {
        font-size: 1.35rem;
        width: 100%;
    }

    /* 見出し横のボタンは縦に並べて押しやすくする */
    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1 1 auto;
    }

    /* 指で押しやすい大きさ（高さ 44px 程度） */
    :root {
        --btn-height: 44px;
        --btn-height-sm: 38px;
    }

    /* iPhone で入力欄が勝手に拡大されないよう 16px 以上にする */
    .form-control,
    .form-select,
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .card-body {
        padding: 0.85rem;
    }

    .card-header {
        padding: 0.6rem 0.85rem;
    }

    /* 詳細画面の操作ボタンは横幅いっぱいに並べる */
    .detail-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .detail-actions > .btn,
    .detail-actions-main {
        width: 100%;
    }

    .detail-actions-main {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* 戻る／保存は縦に並べ、主な操作（保存・削除する）を上にする */
    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions > .btn {
        width: 100%;
    }

    .detail-actions-main .btn {
        width: 100%;
    }

    .detail-actions-main .btn-danger,
    .detail-actions-main .btn-outline-danger {
        margin-left: 0;
        margin-top: 1rem;
    }

    .detail-table th {
        width: 40%;
        white-space: normal;
    }

    /* DataTables の件数・検索を縦に並べ、検索欄は横幅いっぱいにする */
    div.dt-container div.dt-layout-row {
        display: block;
    }

    div.dt-container .dt-layout-cell {
        display: block;
        text-align: left !important;
        padding: 0.25rem 0;
    }

    div.dt-container .dt-search {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    div.dt-container .dt-search input {
        flex: 1;
        margin-left: 0 !important;
    }

    div.dt-container .dt-paging {
        display: flex;
        justify-content: center;
    }

    /* 見出しとボタンが横並びの箇所は折り返す */
    main .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .site-footer {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .site-footer-copy {
        font-size: 0.75rem;
    }
}

/* ----- カレンダー（FullCalendar）のスマホ表示 ----- */
@media (max-width: 575.98px) {
    .fc .fc-toolbar-title {
        font-size: 1.05rem;
    }

    .fc .fc-toolbar.fc-header-toolbar {
        gap: 0.5rem;
    }
}

/* ----- 勤務表（横に日付、縦に従業員。includes/shift_table.html） ----- */
.shift-table-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.shift-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.85rem;
}

.shift-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 表の中だけ横に動かす（ページ全体は横スクロールさせない） */
.shift-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #adb5bd;
}

.shift-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
    white-space: nowrap;
}

.shift-table th,
.shift-table td {
    border-right: 1px solid #ced4da;
    border-bottom: 1px solid #ced4da;
    text-align: center;
    vertical-align: middle;
    padding: 2px;
    background-color: #fff;
}

.shift-table thead th {
    background-color: #f1f3f5;
    font-weight: 600;
}

.shift-table-day,
.shift-table-weekday,
.shift-cell {
    min-width: 2.4rem;
}

.shift-cell {
    height: 2.4rem;
}

/* 氏名の列は、横に動かしても左に残す */
.shift-table .shift-table-name {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 6.5rem;
    max-width: 8rem;
    text-align: left;
    padding: 2px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #fff;
    border-right: 2px solid #adb5bd;
}

.shift-table thead .shift-table-name {
    background-color: #f1f3f5;
    z-index: 3;
}

.shift-table .is-saturday {
    background-color: #eef4fb;
}

.shift-table thead .is-saturday {
    background-color: #dbe7f5;
    color: #1c5c82;
}

.shift-table .is-holiday {
    background-color: #f1f1f1;
}

.shift-table thead .is-holiday {
    background-color: #c9ccd0;
    color: #b0384f;
}

.shift-table-day a {
    color: inherit;
    text-decoration: underline;
    display: block;
}

.shift-table tr.is-self th,
.shift-table tr.is-self td {
    box-shadow: inset 0 0 0 9999px rgba(14, 138, 125, 0.08);
}

.shift-table tr.is-self .shift-table-name {
    font-weight: 700;
}

.shift-summary-head,
.shift-summary {
    min-width: 2.6rem;
    background-color: #f8f9fa;
}

.shift-chip {
    display: inline-block;
    min-width: 1.9rem;
    padding: 2px 3px;
    margin: 1px;
    border-radius: 4px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.shift-table--editable .shift-cell {
    cursor: pointer;
}

.shift-table--editable .shift-cell:hover,
.shift-table--editable .shift-cell:focus {
    outline: 2px solid var(--site-accent);
    outline-offset: -2px;
}

/* 勤務表のマスで選ぶシフトの種類 */
.shift-pattern-options {
    display: grid;
    gap: 12px;
}

.shift-pattern-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 6px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background-color: #fff;
    text-align: left;
}

.shift-pattern-option:hover,
.shift-pattern-option:focus {
    border-color: var(--site-accent);
    background-color: var(--site-accent-soft);
}

/* 従業員QRコード（出退勤） */
.attendance-qr-box {
    max-width: min(320px, 100%);
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
}

/* 一括設定（住民税・標準報酬月額）: PC は名前と入力欄を横に、スマホは縦に並べる */
.bulk-edit-list { display: flex; flex-direction: column; gap: 0.75rem; }
.bulk-edit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
}
.bulk-edit-row--attention { border-color: #dc3545; background: #fff5f5; }
.bulk-edit-name { flex: 1 1 280px; min-width: 0; }
.bulk-edit-inputs { display: flex; flex-wrap: wrap; gap: 0.75rem; flex: 0 1 360px; }
.bulk-edit-inputs label { flex: 1 1 150px; }

/* シフトのカレンダー表示（月曜始まり。スマホでは1日を1行にする） */
.shift-calendar { display: flex; flex-direction: column; border: 1px solid #dee2e6; border-radius: 0.35rem; overflow: hidden; }
.shift-calendar-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.shift-calendar-head { background: #e9ecef; font-weight: 700; text-align: center; }
.shift-calendar-weekday { padding: 0.35rem; }
.shift-calendar-weekday.is-saturday, .shift-calendar-day.is-saturday .shift-calendar-date { color: #0d6efd; }
.shift-calendar-weekday.is-holiday, .shift-calendar-day.is-holiday .shift-calendar-date { color: #dc3545; }
.shift-calendar-day { min-height: 6.5rem; border-top: 1px solid #dee2e6; border-left: 1px solid #dee2e6; padding: 0.3rem; font-size: 0.8rem; min-width: 0; }
.shift-calendar-row .shift-calendar-day:first-child { border-left: none; }
.shift-calendar-day.is-holiday { background: #f8f0ea; }
.shift-calendar-day.is-outside { background: #f8f9fa; color: #adb5bd; }
.shift-calendar-date { font-weight: 700; margin-bottom: 0.2rem; }
.shift-calendar-date-weekday { display: none; }
.shift-calendar-entry { margin-bottom: 0.25rem; overflow: hidden; text-overflow: ellipsis; }
.shift-calendar-entry.is-self { background: #fff3cd; border-radius: 0.25rem; }
.shift-calendar-name { white-space: nowrap; }
@media (max-width: 767.98px) {
    .shift-calendar-head { display: none; }
    .shift-calendar-row { display: block; }
    .shift-calendar-day { min-height: 0; border-left: none; display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
    .shift-calendar-day.is-outside { display: none; }
    .shift-calendar-date { width: 100%; }
    .shift-calendar-date-weekday { display: inline; }
}
