/* =========================================================
   Branding G system — UI スタイル
   方針：レイアウト構造・PHPロジックは変更せず、
        「見た目」と「操作性」のみを強化する。
   ・ブランド色（--brand-accent）を各画面のアクセントに活用
   ・データ表の高密度は維持（.table-scroll 系はそのまま温存）
   ========================================================= */

:root {
    --bg-app: #f3f5f8;
    --surface: #ffffff;
    --border-soft: #e4e7ee;
    --text-main: #1f2a37;
    --text-muted: #6b7280;
    --brand-accent: #334155;          /* ブランド色が無い画面のフォールバック */
    --radius: 0.7rem;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .07);
    --shadow-md: 0 6px 18px rgba(16, 24, 40, .08);
}

body {
    background: var(--bg-app);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* =========================================================
   既存ルール（密度・レイアウト維持のため温存）
   ========================================================= */
table {
    border-collapse: collapse; /*セル同士の枠線を1本に重ね*/
}

th,
td {
    white-space: nowrap; /*セル内の自動改行を防止*/
}

/* 横スクロールはテーブル部分だけ */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--surface);
}

/* Bootstrapのtableの余白を詰める */
.table-scroll table {
    width: max-content;
    margin-bottom: 0;
    white-space: nowrap;
    table-layout: auto;
}

/* セル内余白をかなり小さくする */
.table-scroll .table th,
.table-scroll .table td {
    padding: 0.25rem 0.35rem;
    line-height: 1.15;
    vertical-align: middle;
    width: 1%;
}

/* 高密度テーブルのヘッダ行を読み取りやすく（密度は維持） */
.table-scroll .table > tr:first-child th,
.table-scroll .table thead th {
    position: sticky;
    top: 0;
    background: #eef1f6;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border-soft);
    z-index: 1;
}

/*sp項目*/
.sp-row {
    display: flex;           /* 左右に並べる */
    align-items: baseline;   /* ラベルと入力/値の文字基準線を揃える */
    gap: 10px;               /* 左右のすき間 */
    margin-bottom: 10px;     /* 行間 */
}

.sp-label {
    width: 8em;        /* 左側の項目名の幅を固定 */
    flex: 0 0 8em;     /* 縮めず、常に8文字分くらい確保 */
    text-align: right; /* 文字右寄せ */
    color: var(--text-muted);
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.5;
}

.sp-row > input,
.sp-row > select,
.sp-row > textarea,
.sp-field {
    flex: 1;                /* 右側を残り幅いっぱいにする */
    min-width: 0;           /* はみ出し防止 */
    box-sizing: border-box; /* padding込みで幅計算 */
}

.sp-row > input,
.sp-row > select,
.sp-row > textarea {
    width: 100%; /* 右側の入力欄を横幅いっぱいにする */
}

.sp-field {
    display: flex;      /* ラジオやチェックボックスを横並び */
    flex-wrap: wrap;    /* スマホで収まらなければ折り返す */
    gap: 6px 14px;      /* 選択肢同士のすき間 */
    align-items: center;
}

/* ブランド別デザイン */
.brand-link-chip {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background-color: var(--brand-bg);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    line-height: 1.5;
}

a.brand-link-chip:hover {
    filter: brightness(.92);
    color: #fff;
}

.brand-table-head th {
    background-color: var(--brand-bg);
    color: #fff;
}

/* 斜め線（過去日などの打ち消し表現） */
.diagonal-line {
    position: relative;
}

.diagonal-line::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    border-top: 1px solid #6c757d;
    transform: rotate(-12deg);
    transform-origin: center;
    pointer-events: none;
}

/* =========================================================
   ここから追加：見た目・操作性の強化
   ========================================================= */

/* ---- ナビゲーション（上部バー） ---- */
.navbar.bg-dark {
    background: linear-gradient(180deg, #20262e 0%, #171b21 100%) !important;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: .01em;
}

.navbar .navbar-text {
    font-size: .82rem;
    color: rgba(255, 255, 255, .82) !important;
    padding-top: 0;
    padding-bottom: 0;
}

/* 上部バーの各情報を「ラベル＋値」のピル状にして読みやすく */
.nav-meta {
    display: inline-flex;
    align-items: baseline;
    gap: .3rem;
    background: rgba(255, 255, 255, .08);
    border-radius: 999px;
    padding: .12rem .65rem;
    margin: .15rem .35rem .15rem 0;
    white-space: nowrap;
}

.nav-meta .nav-meta-label {
    font-size: .68rem;
    color: rgba(255, 255, 255, .55);
}

.nav-meta .nav-meta-value {
    font-size: .82rem;
    color: #fff;
    font-weight: 600;
}

/* ---- パンくず ---- */
.app-breadcrumb {
    font-size: .9rem;
    color: var(--text-muted);
}

.app-breadcrumb a {
    color: var(--brand-accent);
    font-weight: 600;
}

.app-breadcrumb a:hover {
    text-decoration: underline;
}

.app-breadcrumb .sep {
    margin: 0 .4rem;
    color: #b7bdc7;
}

/* ---- ページ見出し（ブランド色のアクセントバー付き） ---- */
.page-heading {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 700;
    margin: 0 0 1.1rem;
    padding-left: .8rem;
    border-left: .35rem solid var(--brand-accent);
    line-height: 1.3;
}

/* 業務画面のセクション見出し（【予約者情報】等） */
main h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.6rem 0 .8rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--border-soft);
    color: var(--text-main);
}

main h6 {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-muted);
    margin: 1.1rem 0 .5rem;
}

/* ---- カード（情報のまとまり） ---- */
.app-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.1rem;
}

/* ---- フォーム ---- */
.app-form {
    max-width: 660px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.4rem 1.5rem;
}

.app-form .form-control,
.app-form .form-select {
    max-width: 26rem;
}

/* ラジオ選択肢に添える色見本 */
.color-swatch {
    display: inline-block;
    width: .9rem;
    height: .9rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .18);
    vertical-align: -2px;
    margin-right: .2rem;
}

/* 必須マーク */
.req::after {
    content: "必須";
    display: inline-block;
    margin-left: .4rem;
    font-size: .62rem;
    font-weight: 700;
    color: #b42318;
    background: #fef3f2;
    border: 1px solid #fecdca;
    border-radius: 4px;
    padding: 0 .3rem;
    vertical-align: middle;
}

/* フォーム下部の操作ボタン領域 */
.form-actions {
    display: flex;
    gap: .6rem;
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-soft);
}

/* 大きな業務フォーム（予約作成/編集）の生inputをまとめて整える
   ※ name/id/JS は変更せず、見た目だけ Bootstrap 風に統一して操作性を上げる */
.app-form-grid input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.app-form-grid select,
.app-form-grid textarea {
    display: block;
    width: 100%;
    padding: .4rem .65rem;
    font-size: .95rem;
    line-height: 1.5;
    color: var(--text-main);
    background-color: #fff;
    border: 1px solid #ccd2db;
    border-radius: .5rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.app-form-grid input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):focus,
.app-form-grid select:focus,
.app-form-grid textarea:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}

.app-form-grid input[disabled],
.app-form-grid select[disabled],
.app-form-grid textarea[disabled] {
    background-color: #f2f4f7;
    color: var(--text-muted);
}

/* ラジオ・チェックは少し大きくしてタップしやすく */
.app-form-grid input[type="radio"],
.app-form-grid input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    vertical-align: -2px;
    cursor: pointer;
}

/* 詳細表示など、値だけを示す行の見え方 */
.sp-value {
    flex: 1;
    min-width: 0;
    line-height: 1.6;
    word-break: break-word;
    white-space: normal;
}

/* ---- ボタンの操作性（クリック領域・一貫性） ---- */
.btn {
    border-radius: .5rem;
    font-weight: 600;
}

.btn-sm {
    border-radius: .45rem;
}

.btn-outline-dark {
    --bs-btn-border-color: #ccd2db;
    --bs-btn-color: #3a414b;
    --bs-btn-hover-bg: #2b3038;
    --bs-btn-hover-border-color: #2b3038;
}

/* 画面内アクションをまとめるツールバー */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: 1rem;
}

/* ---- ステータスバッジ（密度を保ったまま視認性UP） ---- */
.badge-soft {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: #eef1f6;
    color: var(--text-main);
    white-space: nowrap;
}

/* 文字色指定（progress/payment）をそのままバッジ枠に活かす */
.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
}

.badge-dot::before {
    content: "";
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

/* ---- データ一覧テーブル（密度維持・装飾のみ） ---- */
.data-table {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-sm);
}

.data-table .table {
    margin-bottom: 0;
}

.data-table .table > tbody > tr:first-child th,
.data-table .table > tr:first-child th {
    background: #eef1f6;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--border-soft);
    white-space: nowrap;
}

/* ---- フッター ---- */
.footer {
    background: var(--surface) !important;
}

/* ---- ログイン画面の微調整 ---- */
.login-card {
    box-shadow: var(--shadow-md) !important;
}
