/* OneTap Portal — デイリータイムグリッド用 CSS
 *
 * Tailwind CDN を base.html で読み込んでおり、汎用ユーティリティは Tailwind を使う。
 * 本ファイルでは Daily ビュー（縦=時間 / 横=リソース）のレイアウトのみを記述する。
 */

:root {
    --grid-slot-h: 16px;          /* 10 分セルの高さ */
    --grid-time-col-w: 64px;      /* 左端の時間ラベル列の幅 */
    --grid-resource-col-w: 120px; /* リソース列の最小幅（伸縮） */
    --grid-head-h: 56px;          /* 上部リソースヘッダーの高さ */
}

.dailygrid-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 160px);
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 4px;
}

.dailygrid {
    display: grid;
    position: relative;
    /* grid-template-columns / grid-template-rows は inline スタイルで動的に設定 */
}

/* ---- ヘッダー: 左上コーナー / リソース行 / 時間列 ---- */
.dailygrid__corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 30;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
}

.dailygrid__resource-head {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 13px;
}

.dailygrid__resource-head--facility-start {
    border-left: 2px solid #94a3b8;
}

.dailygrid__facility-label {
    font-size: 11px;
    color: #64748b;
    line-height: 1.2;
    margin-bottom: 2px;
    font-weight: 600;
    min-height: 13px;
}

.dailygrid__resource-label {
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dailygrid__time-label {
    position: sticky;
    left: 0;
    z-index: 15;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    padding: 2px 6px 0 6px;
    font-size: 11px;
    color: #64748b;
    text-align: right;
    line-height: 1;
}

/* ---- セル ---- */
.dailygrid__cell {
    border-right: 1px solid #f1f5f9;
    cursor: pointer;
    background: #ffffff;
}

.dailygrid__cell:hover {
    background: rgba(59, 130, 246, 0.08);
}

.dailygrid__cell--hour-boundary {
    border-top: 1px solid #cbd5e1;
}

.dailygrid__cell--half-hour-boundary {
    border-top: 1px dashed #e5e7eb;
}

.dailygrid__cell--facility-start {
    border-left: 2px solid #94a3b8;
}

.dailygrid__cell--closed {
    background: repeating-linear-gradient(
        45deg,
        #e5e7eb,
        #e5e7eb 4px,
        #f3f4f6 4px,
        #f3f4f6 8px
    );
    cursor: not-allowed;
}

.dailygrid__cell--closed:hover {
    background: repeating-linear-gradient(
        45deg,
        #e5e7eb,
        #e5e7eb 4px,
        #f3f4f6 4px,
        #f3f4f6 8px
    );
}

.dailygrid__cell--past {
    background: #d1d5db;
    cursor: not-allowed;
}

.dailygrid__cell--past:hover {
    background: #d1d5db;
}

/* ---- 予約セル ---- */
/* ---- 色の凡例（種類色の対応表。日・週ビュー共通） ---- */
.rsv-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    color: #334155;
}

.rsv-legend__label {
    font-weight: 600;
    color: #64748b;
}

.rsv-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.rsv-legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #3b82f6;
    flex: none;
}

/* 自分の予約: 種類色は任意。中立地色＋濃紺白の二重枠で「枠線＝自分」を示す（セルの --mine と対応） */
.rsv-legend__swatch--mine {
    background: #e2e8f0;
    box-shadow: inset 0 0 0 2px #0f172a, inset 0 0 0 4px #ffffff;
}

.rsv-legend__swatch--redacted {
    background: #94a3b8;
}

.rsv-legend__swatch--block {
    background: #475569;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.12) 3px,
        transparent 3px,
        transparent 6px
    );
}

.dailygrid__reservation {
    /* 縦位置は grid-row ではなく margin-top / height（実時間の比率）で決める。
       列全体に置いた要素を伸ばさないため align-self: start を効かせる。 */
    align-self: start;
    min-height: 12px;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 1px 2px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dailygrid__reservation:hover {
    filter: brightness(1.08);
}

.dailygrid__reservation-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dailygrid__reservation-time {
    font-size: 10px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dailygrid__reservation--redacted {
    background: #94a3b8;
}

/* 自分の予約: 背景は種類色に譲り、濃紺＋白の二重枠で「自分」を強調（種類色に依らず視認できる） */
.dailygrid__reservation--mine {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 0 0 2px #0f172a, inset 0 0 0 4px #ffffff;
}

.dailygrid__reservation--past {
    opacity: 0.7;
}

/* ブロック（予約不可枠）: 斜線入りのダークグレーで「予約ではない」ことを示す */
.dailygrid__reservation--block {
    background: #475569;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.12) 6px,
        transparent 6px,
        transparent 12px
    );
}

/* ============================================
 * ウィークリービュー（縦=時間 × 横=7日 × Nリソース）
 * ============================================ */

.weeklygrid-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 160px);
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 4px;
}

.weeklygrid {
    display: grid;
    position: relative;
}

/* ---- ヘッダー ---- */
.weeklygrid__corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 30;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
}

.weeklygrid__day-head {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #cbd5e1;
    border-left: 2px solid #94a3b8;
    padding: 4px 8px 2px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weeklygrid__day-head--today {
    background: #fef3c7;  /* amber-100, 今日の列を強調 */
    color: #92400e;
}

.weeklygrid__resource-head {
    position: sticky;
    z-index: 20;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weeklygrid__resource-head--day-start {
    border-left: 2px solid #94a3b8;
}

.weeklygrid__time-label {
    position: sticky;
    left: 0;
    z-index: 15;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    padding: 2px 6px 0 6px;
    font-size: 11px;
    color: #64748b;
    text-align: right;
    line-height: 1;
}

/* ---- セル ---- */
.weeklygrid__cell {
    border-right: 1px solid #f1f5f9;
    cursor: pointer;
    background: #ffffff;
}

.weeklygrid__cell:hover {
    background: rgba(59, 130, 246, 0.08);
}

.weeklygrid__cell--hour-boundary {
    border-top: 1px solid #cbd5e1;
}

.weeklygrid__cell--half-hour-boundary {
    border-top: 1px dashed #e5e7eb;
}

.weeklygrid__cell--day-start {
    border-left: 2px solid #94a3b8;
}

.weeklygrid__cell--closed {
    background: repeating-linear-gradient(
        45deg,
        #e5e7eb,
        #e5e7eb 4px,
        #f3f4f6 4px,
        #f3f4f6 8px
    );
    cursor: not-allowed;
}

.weeklygrid__cell--closed:hover {
    background: repeating-linear-gradient(
        45deg,
        #e5e7eb,
        #e5e7eb 4px,
        #f3f4f6 4px,
        #f3f4f6 8px
    );
}

.weeklygrid__cell--past {
    background: #d1d5db;
    cursor: not-allowed;
}

.weeklygrid__cell--past:hover {
    background: #d1d5db;
}

/* ---- 予約セル（Daily と同じデザイン） ---- */
.weeklygrid__reservation {
    /* daily と同じ。縦位置は margin-top / height で決める。 */
    align-self: start;
    min-height: 12px;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 1px 2px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.weeklygrid__reservation:hover {
    filter: brightness(1.08);
}

/* 自分の予約: 背景は種類色に譲り、濃紺＋白の二重枠で「自分」を強調（種類色に依らず視認できる） */
.weeklygrid__reservation--mine {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 0 0 2px #0f172a, inset 0 0 0 4px #ffffff;
}

.weeklygrid__reservation--redacted {
    background: #94a3b8;
}

.weeklygrid__reservation--past {
    opacity: 0.7;
}

/* ブロック（予約不可枠） */
.weeklygrid__reservation--block {
    background: #475569;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.12) 6px,
        transparent 6px,
        transparent 12px
    );
}

.weeklygrid__reservation-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weeklygrid__reservation-time {
    font-size: 10px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- 現在時刻バー（weekly: 今日の列だけ赤線） ---- */
.weeklygrid__now-bar {
    position: absolute;
    height: 0;
    border-top: 2px solid #ef4444;
    z-index: 8;
    pointer-events: none;
}

.weeklygrid__now-bar-dot {
    position: absolute;
    left: 0;
    top: -6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    transform: translateX(-50%);
}

/* ---- 現在時刻バー（Google カレンダー風） ---- */
.dailygrid__now-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 2px solid #ef4444;
    z-index: 8;
    pointer-events: none;
}

.dailygrid__now-bar-dot {
    position: absolute;
    left: var(--grid-time-col-w);
    top: -6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    transform: translateX(-50%);
}

/* ---- モーダル ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-panel {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    min-width: 360px;
    max-width: 500px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.16), 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #E2E8F0;
}

/* ============================================
 * 共通 UI コンポーネント
 * ============================================ */

/* ── ページカード ── */
.page-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 28px;
    margin: 20px auto;
}

/* ── ページタイトル ── */
.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #0F1729;
    letter-spacing: -0.02em;
}

/* ── 戻るリンク ── */
.back-link {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    color: #64748B;
    text-decoration: none;
    margin-bottom: 14px;
    transition: color 0.12s;
}
.back-link:hover { color: #0F1729; }

/* ── ボタン ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    border: none;
    transition: background 0.12s, opacity 0.12s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary  { background: #0F1729; color: #fff; }
.btn-primary:hover:not(:disabled)  { background: #1E2A3B; }
.btn-secondary { background: #fff; color: #374151; border: 1px solid #D1D5DB; }
.btn-secondary:hover:not(:disabled) { background: #F9FAFB; border-color: #9CA3AF; }
.btn-danger   { background: #DC2626; color: #fff; }
.btn-danger:hover:not(:disabled)   { background: #B91C1C; }
.btn-sm { font-size: 12px; padding: 5px 10px; border-radius: 5px; }
.btn-ghost-danger {
    background: transparent; color: #DC2626;
    border: 1px solid #FECACA;
    font-size: 12px; padding: 4px 10px; border-radius: 5px;
    cursor: pointer;
}
.btn-ghost-danger:hover { background: #FEF2F2; }
.btn-ghost-primary {
    background: transparent; color: #34D399;
    font-size: 12px; padding: 4px 10px; border-radius: 5px;
    cursor: pointer; border: 1px solid rgba(52,211,153,0.3);
}
.btn-ghost-primary:hover { background: rgba(52,211,153,0.06); }

/* ── フォーム ── */
.form-label {
    display: block;
    font-size: 11.5px; font-weight: 600;
    color: #475569;
    letter-spacing: 0.04em; text-transform: uppercase;
    margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
    display: block; width: 100%; box-sizing: border-box;
    border: 1.5px solid #CBD5E1; border-radius: 6px;
    padding: 8px 11px; font-size: 13.5px;
    color: #0F1729; background: #FAFBFC;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #34D399;
    box-shadow: 0 0 0 3px rgba(52,211,153,0.12);
    background: #fff;
}
.form-input:disabled, .form-select:disabled {
    background: #F1F5F9; color: #94A3B8; cursor: not-allowed;
}
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.form-help { font-size: 12px; color: #94A3B8; margin-top: 5px; line-height: 1.4; }

/* ── テーブル ── */
.admin-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.admin-table thead th {
    padding: 8px 12px;
    font-size: 11px; font-weight: 600;
    color: #64748B; text-transform: uppercase; letter-spacing: 0.06em;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
    background: #F8FAFC;
}
.admin-table tbody tr { border-bottom: 1px solid #F1F5F9; transition: background 0.08s; }
.admin-table tbody tr:hover { background: #F8FAFC; }
.admin-table tbody td { padding: 10px 12px; color: #1E293B; vertical-align: middle; }
.admin-table tbody td.td-muted { color: #94A3B8; }

/* ── バッジ ── */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 7px; border-radius: 4px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.badge-red   { background: #FEE2E2; color: #991B1B; }
.badge-blue  { background: #DBEAFE; color: #1E40AF; }
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-amber { background: #FEF3C7; color: #92400E; }
.badge-gray  { background: #F1F5F9; color: #475569; }

/* ── ユーザー一覧: 検索/絞り込みツールバー ── */
.users-toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    padding: 4px 0 14px; border-bottom: 1px solid #E2E8F0;
}
.users-search { position: relative; flex: 1 1 260px; min-width: 180px; }
.users-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.users-search .form-input { padding-left: 34px; }
.users-role-filter { flex: 0 0 auto; width: auto; min-width: 160px; }

.users-meta { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px 6px; }
.users-count { font-size: 12.5px; color: #64748B; }
.users-count b { color: #0F1729; font-variant-numeric: tabular-nums; }

/* ── ユーザー一覧: コンパクト行 + ソート可能ヘッダー ── */
.users-table tbody td { padding: 7px 12px; }
.admin-table thead th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.admin-table thead th.sortable:hover { color: #0F1729; }
.sort-ind { color: #065F46; font-size: 10px; }

/* ── ユーザー一覧: ページング ── */
.users-pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 2px; }
.users-per { font-size: 12px; color: #64748B; }
.users-per select {
    appearance: none; border: 1px solid #CBD5E1; border-radius: 5px;
    padding: 3px 22px 3px 8px; font-size: 12px; color: #0F1729; background: #FAFBFC; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 7px center;
}
.users-pages { display: flex; align-items: center; gap: 6px; }
.pg-btn {
    border: 1px solid #E2E8F0; background: #fff; color: #1E293B; border-radius: 6px;
    min-width: 30px; height: 30px; padding: 0 8px; font-size: 12.5px; cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.pg-btn:hover:not(:disabled) { background: #F8FAFC; }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-btn.active { background: #0F1729; color: #fff; border-color: #0F1729; }
.pg-ellipsis { font-size: 12.5px; color: #64748B; padding: 0 2px; }

/* ── セクション見出し ── */
.section-heading {
    font-size: 13px; font-weight: 700; color: #0F1729;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid #F1F5F9;
}

/* ── トグル（roles.html） ── */
.toggle-track {
    position: relative; display: inline-block;
    width: 36px; height: 20px; border-radius: 10px;
    transition: background 0.15s; cursor: pointer; flex-shrink: 0;
}
.toggle-thumb {
    position: absolute; top: 2px; width: 16px; height: 16px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.15s;
}

/* ── インラインリンク ── */
a.inline-link { color: #34D399; text-decoration: none; font-weight: 500; }
a.inline-link:hover { text-decoration: underline; }

/* ============================================
 * 予約者検索ペイン（予約作成モーダルの代理予約モード）
 *
 * 予約者は 1,000 人規模になるため、プルダウンではなく検索ペインで選ぶ。
 * デスクトップ／タブレットは左右 2 ペイン、スマホ（<768px）はモーダル全面を
 * 「予約内容 → 予約者検索」の 2 ステップで切り替える（切替は JS の isNarrow）。
 * ============================================ */

/* 代理予約モードのときだけモーダルを広げる（既定の .modal-panel は変更しない） */
.modal-panel--split {
    display: flex;
    align-items: stretch;
    gap: 24px;
    width: min(60rem, calc(100vw - 2rem));
    max-width: min(60rem, calc(100vw - 2rem));
    max-height: calc(100vh - 3rem);
}

.modal-panel--split .bookee-formpane {
    flex: 1 1 20rem;
    min-width: 0;
    overflow-y: auto;
}

.modal-panel--split .bookee-searchpane {
    flex: 0 0 23rem;
    border-left: 1px solid #E2E8F0;
    padding-left: 24px;
}

/* ── 予約者のモード切替（自分 / 代理予約） ── */
.bookee-mode {
    display: flex;
    gap: 24px;
    padding: 2px 0;
}
.bookee-mode__option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: #333333;
    line-height: 1.3;
    cursor: pointer;
}
.bookee-mode__option input {
    width: 1rem;
    height: 1rem;
    accent-color: #2563EB;
}

/* ── 選択済みの予約者（チップ） ── */
.bookee-selected { margin-top: 8px; }
.bookee-chip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.bookee-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    background: #EFF6FF;
    font-size: 0.875rem;
    color: #1A1A1A;
    line-height: 1.3;
}
.bookee-chip__clear {
    border: none;
    background: none;
    padding: 0 2px;
    font-size: 1rem;
    line-height: 1;
    color: #555555;
    cursor: pointer;
}
.bookee-chip__clear:hover { color: #B91C1C; }

.bookee-change,
.bookee-pick {
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    background: #fff;
    padding: 6px 12px;
    font-size: 0.875rem;
    color: #333333;
    line-height: 1.3;
    cursor: pointer;
}
.bookee-change:hover,
.bookee-pick:hover { background: #F8FAFC; }

.bookee-note {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #555555;
    line-height: 1.6;
}
.bookee-note--warn { color: #92400E; font-weight: 700; }

/* ── 検索ペイン本体 ── */
.bookee-searchpane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}
.bookee-searchpane__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}
.bookee-searchpane__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.3;
}
.bookee-back {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.875rem;
    color: #555555;
    line-height: 1.3;
    cursor: pointer;
}
.bookee-back:hover { color: #1A1A1A; text-decoration: underline; }

/* 検索対象の切替（キャスト / スタッフ） */
.bookee-kind {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.bookee-kind__option {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    background: #fff;
    font-size: 0.875rem;
    color: #333333;
    line-height: 1.3;
    cursor: pointer;
}
.bookee-kind__option input {
    width: 1rem;
    height: 1rem;
    accent-color: #2563EB;
}
.bookee-kind__option.is-active {
    border-color: #2563EB;
    background: #EFF6FF;
    color: #1A1A1A;
    font-weight: 700;
}

/* 検索入力（ops/users.html のツールバーと同じ見た目を流用する） */
.bookee-search {
    flex: none;
    margin-bottom: 12px;
}

/* キャストのみの絞り込み（所属 / 休会を含む） */
.bookee-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.bookee-dept {
    flex: 1 1 12rem;
    width: auto;
    min-width: 0;
}
.bookee-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #333333;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
}
.bookee-check input {
    width: 1rem;
    height: 1rem;
    accent-color: #2563EB;
}

/* ── 結果リスト ── */
.bookee-results {
    flex: 1 1 auto;
    min-height: 8rem;
    max-height: 26rem;
    overflow-y: auto;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
}
.bookee-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid #F1F5F9;
    background: #fff;
    text-align: left;
    cursor: pointer;
}
.bookee-row:last-child { border-bottom: none; }
.bookee-row:hover { background: #F8FAFC; }
.bookee-row.is-selected {
    background: #EFF6FF;
    box-shadow: inset 2px 0 0 #2563EB;
}
.bookee-row__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.bookee-row__name {
    font-size: 1rem;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.3;
}
.bookee-row__badges {
    display: inline-flex;
    gap: 4px;
    flex: none;
}
.bookee-row__sub {
    font-size: 0.75rem;
    color: #555555;
    line-height: 1.6;
    word-break: break-all;
}
.bookee-results__status {
    padding: 16px 14px;
    font-size: 0.875rem;
    color: #555555;
    line-height: 1.6;
}
.bookee-results__status--error { color: #B91C1C; }
.bookee-results__more {
    padding: 12px 14px;
    border-top: 1px solid #FDE68A;
    background: #FEF3C7;
    font-size: 0.75rem;
    color: #92400E;
    line-height: 1.6;
}

/* タブレット（768–1023px）: 2 ペインのままペイン幅を詰める */
@media (max-width: 1023px) {
    .modal-panel--split {
        gap: 16px;
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
    }
    .modal-panel--split .bookee-searchpane {
        flex: 0 0 19rem;
        padding-left: 16px;
    }
    .bookee-results { max-height: 20rem; }
}

/* スマホ（<768px）: 2 ペインにせずモーダル全面を検索ビューに切り替える */
@media (max-width: 767px) {
    .bookee-searchpane {
        border-left: none;
        padding-left: 0;
    }
    .bookee-results { max-height: 60vh; }
}

/* ============================================
   外傷管理: サブナビ（templates/injury/_subnav.html）
   ============================================ */

/* 左＝行き先（セグメント）／右＝その画面の操作。グローバルヘッダーが下線タブなので、
   1段下のこちらは白いタイルで現在地を示して階層を潰さない。 */
/* ナビの幅は本文の幅に追従させない。追従させると、本文が狭い画面（起票 720px）へ
   移動したときにナビの左端が横にずれる。 */
.injury-subnav-bar {
    max-width: 1040px;
    margin: 20px auto 0;
    padding: 0 16px;
}

.injury-subnav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid #E2E8F0;
}

.injury-subnav-links {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 9px;
}

.injury-subnav-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748B;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.injury-subnav-item:hover {
    color: #0F1729;
    background: rgba(255, 255, 255, 0.65);
}

.injury-subnav-item.is-active {
    color: #0F1729;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 41, 0.10);
}

/* 操作は右端へ寄せる。行き先と同じ塊に見せない。 */
.injury-subnav-action {
    display: flex;
    gap: 8px;
    margin-left: auto;
}


/* ============================================================
   時刻入力コンボボックス（5 分刻みの候補 ＋ 1 分単位の直接入力）
   ============================================================ */
.timecombo {
    position: relative;
    flex: none;
}

.timecombo__input {
    width: 5.5rem;
    font-variant-numeric: tabular-nums;
}

.timecombo__list {
    position: absolute;
    z-index: 60;
    top: calc(100% + 2px);
    left: 0;
    width: 100%;
    max-height: 14rem;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* 下に入りきらないときは上向きに開く。モーダルの中で下向きに開くとパネルの外へ
   はみ出し、「保存」などの操作ボタンを覆ってしまう（ボタンが押せず、代わりに
   暗い背景をクリックさせてモーダルを閉じてしまう）。 */
.timecombo__list--up {
    top: auto;
    bottom: calc(100% + 2px);
}

.timecombo__option {
    padding: 4px 10px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.timecombo__option:hover,
.timecombo__option--active {
    background: #eff6ff;
}

/* 保存前の事前警告（営業時間外・同じ場所の重複） */
.timewarn {
    margin: 0;
    padding: 8px 12px;
    list-style: none;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 4px;
}

.timewarn__item {
    font-size: 13px;
    line-height: 1.6;
    color: #92400e;
}

.timewarn__item + .timewarn__item {
    margin-top: 2px;
}


/* ============================================================
   キャストから登録（EU_RD-1036）
   ============================================================ */
.castreg-notice {
    font-size: 12.5px;
    line-height: 1.6;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* 登録前の確認モーダル（対象者の一覧を見せる） */
.castreg-confirm {
    /* 既定の .modal-panel は最大 500px。氏名・社員番号・メール・操作の4列を出すため広げる */
    max-width: 640px;
    width: calc(100vw - 48px);
}

.castreg-confirm__title {
    font-size: 16px;
    font-weight: 700;
    color: #0F1729;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.castreg-confirm__lead {
    font-size: 13.5px;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 12px;
}

/* 対象が多いと画面から溢れるため一覧だけスクロールさせる */
.castreg-confirm__list {
    max-height: 46vh;
    overflow-y: auto;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    margin-bottom: 16px;
}

.castreg-confirm__list thead th {
    position: sticky;
    top: 0;
    background: #F8FAFC;
    z-index: 1;
}

.castreg-confirm__missing {
    color: #B45309;
}

.castreg-confirm__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 4px;
}

.castreg-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}

/* 所属フィルタは伸ばさない（ツールバーの検索欄だけを伸ばす） */
.castreg-dept {
    width: auto;
    min-width: 190px;
    flex: 0 0 auto;
}

.castreg-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: #334155;
    white-space: nowrap;
}

.castreg-error {
    font-size: 12.5px;
    color: #b91c1c;
    margin: 0 0 10px;
}

.castreg-summary {
    font-size: 12.5px;
    color: #14532d;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 0 0 12px;
}

.castreg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.castreg-table th,
.castreg-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.castreg-table thead th {
    font-size: 12px;
    color: #64748B;
    background: #f8fafc;
    white-space: nowrap;
}

.castreg-row--done {
    background: #f0fdf4;
}

.castreg-kana {
    font-size: 11.5px;
    color: #94A3B8;
}

.castreg-email {
    width: 100%;
    min-width: 190px;
}

.castreg-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    background: #eff6ff;
    color: #1d4ed8;
}

.castreg-badge--warn {
    background: #fffbeb;
    color: #92400e;
}

.castreg-badge--muted {
    background: #f1f5f9;
    color: #64748B;
}

.castreg-badge--done {
    background: #dcfce7;
    color: #166534;
}

.castreg-rowerror {
    font-size: 11.5px;
    line-height: 1.5;
    color: #b91c1c;
    margin-top: 3px;
}
