/* =========================================================
   会員管理システム（第1ステップ）モックアップ
   Claude.ai 風デザイントークン + 共通シェル
   ========================================================= */

:root {
  /* --- カラー (国連支援計画チャットボット系：ビビッド水色 × ゴールド) --- */
  --bg:            #eef1f3;   /* 全体背景(ライトグレー) */
  --surface:       #ffffff;   /* カード面 */
  --surface_2:     #f3f6f8;   /* うっすら面 */
  --sidebar_bg:    #e8f1fb;   /* 左メニュー(淡い水色／Docker参考) */
  --ink:           #1f2a33;   /* 基本テキスト */
  --ink_soft:      #5c6770;   /* 補助テキスト */
  --ink_faint:     #93a0a8;
  --line:          #e2e8ec;   /* 罫線 */
  --line_strong:   #d3dbe0;
  /* プライマリ＝ヘッダーの水色。変数名は便宜上 --clay を踏襲 */
  --clay:          #00a0e9;   /* アクセント(ビビッド水色) */
  --clay_hover:    #0086c6;
  --clay_soft:     #e1f3fc;
  --focus:         #00a0e933;
  /* セカンダリ＝カテゴリチップのゴールド/オレンジ */
  --gold:          #d9912f;
  --gold_hover:    #c47f22;
  --gold_soft:     #fbf1df;
  --ok:            #3f9e5a;
  --warn:          #d9912f;
  --danger:        #e0533a;

  --radius:   12px;
  --radius_sm: 8px;
  --shadow:   0 1px 2px rgba(31,30,29,.04), 0 6px 20px rgba(31,30,29,.05);
  --sidebar_w: 244px;

  --font: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo",
          system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* =========================================================
   アプリ全体レイアウト
   ========================================================= */
/* ---------- 画面テーマ ----------
   画面ごとに色味を切り替える仕組み。Blade側で
     @section('app_theme', 'theme_danger')
   と書くと、レイアウトの .app にそのクラスが付く。
   テーマは「変数を差し替えるだけ」で、部品側（.topbar など）は変数を見に行く作り。
   別テーマを足したいときは、下の theme_danger を真似して4つの変数を上書きするだけでいい。 */
.app {
  --theme_head_from: #00a4ed;      /* ヘッダー左の色 */
  --theme_head_to:   #009ae0;      /* ヘッダー右の色 */
  --theme_head_line: #0089c6;      /* ヘッダー下の境界線 */
  --theme_accent:      var(--clay_hover); /* 見出し・チェックなど、その画面の強調文字色 */
  --theme_accent_line: #b9dcef;           /* 同じ系統の細い枠線 */
  --theme_accent_bg:   var(--clay_soft);  /* 同じ系統の淡い背景 */
}
/* 取り返しのつかない操作の画面（会員退会など）。水色と同じトーンの並びで作った赤 */
.app.theme_danger {
  --theme_head_from: #e04a35;
  --theme_head_to:   #d43f2b;
  --theme_head_line: #b83421;
  --theme_accent:      #c8352a;
  --theme_accent_line: #e3b4ac;
  --theme_accent_bg:   #fbecea;
}

.app { display: flex; min-height: 100vh; }

/* ---------- サイドバー ---------- */
.sidebar {
  width: var(--sidebar_w);
  flex: 0 0 var(--sidebar_w);
  background: var(--sidebar_bg);
  border-right: 1px solid #cfe0f2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: margin-left .22s ease;
}

/* たたんだ状態：左メニューを画面外へスライド、本文が全幅に広がる */
.app.is_collapsed .sidebar { margin-left: calc(var(--sidebar_w) * -1); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
}
.brand .logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--clay);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
  font-family: var(--serif);
}
.brand .title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.brand .title small { display:block; color: var(--ink_faint); font-weight: 400; font-size: 11px; }

.nav_panel { padding: 6px 10px 24px; }
.nav_group { margin-top: 14px; }
.nav_group_title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink_faint);
  padding: 4px 10px;
  text-transform: none;
}
.nav_item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin: 1px 0;
  border-radius: var(--radius_sm);
  color: var(--ink_soft);
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav_item:hover { background: #d8e8f8; color: var(--ink); }
.nav_item.active {
  background: #ffffff;
  color: var(--clay_hover);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,90,160,.12);
}
.nav_item .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .45; flex: 0 0 auto; }

/* 折りたたみ可能なメニューグループ（マスタ登録など、普段使わない項目向け） */
.nav_group_toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: left;
}
.nav_group_arrow {
  color: var(--ink_faint); flex: 0 0 auto;
  transform: rotate(-90deg);
  transition: transform .15s ease;
}
.nav_group_collapsible.is_open .nav_group_arrow { transform: rotate(0deg); }
.nav_group_body {
  overflow: hidden;
  max-height: 320px;
  transition: max-height .18s ease, opacity .15s ease;
}
.nav_group_collapsible:not(.is_open) .nav_group_body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ---------- メイン ---------- */
.main_col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(90deg, var(--theme_head_from), var(--theme_head_to));
  border-bottom: 1px solid var(--theme_head_line);
  position: sticky; top: 0; z-index: 5;
}
.topbar_left { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* トグル共通（開く／たたむ 兼用の下地） */
.menu_toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: 0 0 auto;
  cursor: pointer; border-radius: var(--radius_sm);
  transition: background .12s, color .12s;
}
.menu_toggle svg { width: 16px; height: 16px; }

/* 「開く」ボタン：トップバー（青地）に置く。たたんでいる時だけ出す */
.menu_open {
  display: none;
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.35);
}
.menu_open:hover { background: rgba(255,255,255,.24); }
.app.is_collapsed .menu_open { display: inline-flex; }

/* サイドバーをたたんだ時だけ、ロゴをトップバー（青地）に残す */
.collapsed_logo {
  display: none;
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
  color: var(--clay_hover);
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  font-family: var(--serif);
  box-shadow: 0 1px 3px rgba(0,80,140,.25);
}
.app.is_collapsed .collapsed_logo { display: flex; }

/* サイドバーをたたんだ時だけ、システム名もトップバーに残す */
.collapsed_name {
  display: none;
  color: #fff; font-weight: 700; font-size: 13px;
  font-family: var(--serif);
  flex: 0 0 auto; white-space: nowrap;
  margin-right: 16px; /* パンくずリストとの間隔を広めに */
}
.app.is_collapsed .collapsed_name { display: inline-flex; }

/* 「たたむ」ボタン：サイドバー内・ブランド右端（にじちぇく参考） */
.menu_close {
  margin-left: auto; align-self: flex-start;
  color: var(--ink_faint);
  background: transparent;
  border: 1px solid transparent;
}
.menu_close:hover { color: var(--clay_hover); background: #d8e8f8; }
.crumb { font-size: 13px; color: rgba(255,255,255,.82); display: flex; align-items: center; gap: 8px; }
.crumb b { color: #fff; font-weight: 700; }
.crumb .sep { color: rgba(255,255,255,.55); }
.path_pill {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  color: #fff;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  padding: 2px 8px;
  border-radius: 999px;
}

/* 右上のユーザー表示：クリックで簡易情報＋ログアウトのポップオーバーを開く */
.user_menu { position: relative; }
.user_trigger {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  padding: 4px 6px; border-radius: var(--radius_sm);
  transition: background .12s;
}
.user_trigger:hover { background: rgba(255,255,255,.14); }
.user_trigger .name { font-size: 13px; color: rgba(255,255,255,.85); }
.user_trigger .name b { color: #fff; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #ffffff;
  color: var(--clay_hover); display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,80,140,.25);
  flex: 0 0 auto;
}
.avatar_lg { width: 40px; height: 40px; font-size: 15px; }

.user_popover {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: none;
  z-index: 50;
}
.user_menu.is_open .user_popover { display: block; }
.user_popover_head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.user_popover_name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.user_popover_role { font-size: 11.5px; color: var(--ink_soft); margin-top: 2px; }
.user_popover_item {
  display: block; width: 100%;
  padding: 8px; margin-top: 2px;
  font-size: 13px; font-weight: 600; text-align: center;
  color: var(--danger);
  border: none; background: none; border-radius: var(--radius_sm);
  cursor: pointer;
}
.user_popover_item:hover { background: #f7ebe8; }

.content { padding: 26px 28px 60px; max-width: 1200px; width: 100%; }

/* ---------- ページ見出し ---------- */
.page_head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.page_title { font-size: 22px; font-weight: 700; font-family: var(--serif); letter-spacing: .01em; }
.page_sub { color: var(--ink_soft); font-size: 13px; margin-top: 2px; }
/* 見出しをその画面のテーマ色にする（退会画面のように、見出しから色で知らせたいとき） */
.page_title_accent { color: var(--theme_accent); }
.page_sub_accent { color: var(--theme_accent); }

/* =========================================================
   カード / セクション
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card_head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.card_head h2 { font-size: 14px; font-weight: 700; margin: 0; }
.card_body { padding: 18px; }

.section_label {
  font-size: 12px; font-weight: 700; color: var(--clay_hover);
  margin: 4px 0 10px; display: flex; align-items: center; gap: 8px;
}
.section_label::before { content: ""; width: 3px; height: 14px; background: var(--clay); border-radius: 2px; }

/* =========================================================
   フォーム
   ========================================================= */
.form_grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
  /* 高さを揃えない。説明文が2行に伸びた欄があっても、隣の欄が下にずれないようにする */
  align-items: start;
}
/* 金融機関名の複合行：選択／自由入力／支店名・店番（ゆうちょ選択時は記号・番号に切替）を横一列に */
.bank_grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 12px;
  margin-bottom: 16px;
}
.bank_col { display: flex; flex-direction: column; gap: 6px; }
.bank_col label { font-size: 12px; font-weight: 600; color: var(--ink_soft); }
/* ラベル・入力欄を横1列に（紙帳票に近い並び。省スペース優先） */
:root { --field_label_w: 150px; }
.field {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 12px;
}
.field.col_2 { grid-column: 1 / -1; }
/* 1行ぶん使うが、入力欄だけは隣の列と同じ幅（2分の1）にとどめる欄。
   説明文が長くて折り返す場合に使う（入力欄が横いっぱいに伸びると目で追いづらいため）。
   「その他」の自由入力欄も同じ幅に揃えて、上の選択欄と右端が合うようにする */
.field.col_2.input_half > input,
.field.col_2.input_half > select,
.field.col_2.input_half > .other_toggle_input {
  flex: 0 1 calc(50% - 11px - var(--field_label_w) - 12px);
}
.field > label {
  flex: 0 0 var(--field_label_w);
  font-size: 12px; font-weight: 600; color: var(--ink_soft);
  display: flex; align-items: center; gap: 6px;
}
.field > input, .field > select, .field > textarea, .field > .q_box {
  flex: 1 1 200px; min-width: 0;
}
.field > .hint,
.field > .hint_confirm {
  flex: 1 1 100%;
  margin-left: calc(var(--field_label_w) + 12px);
}
/* 「その他」選択時に出す自由入力欄：選択欄の下に全幅で表示 */
.field > .other_toggle_input {
  flex: 1 1 100%;
  margin-left: calc(var(--field_label_w) + 12px);
  width: auto;
}
/* 自由入力欄のラベル（その他の場合）。主ラベルのような固定幅ではなく、文字の幅だけ取る */
.field > .other_toggle_label { flex: 0 0 auto; }
/* 選択欄を半分幅にしている欄では、ラベルと自由入力欄を選択欄の右どなりに並べる */
.field.col_2.input_half > .other_toggle_input {
  flex: 1 1 160px;
  margin-left: 0;
}
/* ログイン画面のカードは幅が狭いため、ラベルは上・入力欄は下の縦並びのまま */
.auth_card .field {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
}
.auth_card .field > label { flex: 0 0 auto; }
.auth_card .field > .hint { margin-left: 0; }
/* flex-direction:columnの中ではflex-basisが「高さ」の基準になるため、
   横並び用の flex:1 1 200px（幅の基準）をここで打ち消す */
.auth_card .field > input,
.auth_card .field > select,
.auth_card .field > textarea,
.auth_card .field > .q_box { flex: 0 0 auto; }
.req { color: var(--clay); font-size: 11px; }

input[type=text], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=time],
input[type=email], input[type=tel], input[type=search],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line_strong);
  border-radius: var(--radius_sm);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 72px; }
/* 入力済みの文字と見分けやすいよう、プレースホルダーは薄いピンクにする */
input::placeholder, textarea::placeholder { color: #f4b6c2; opacity: 1; }
input:focus, select:focus, textarea:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px var(--focus);
}
/* 変更できない欄（自動発行の暗号番号など）。触れないことが見た目で分かるようにグレーにする */
input:disabled, select:disabled, textarea:disabled {
  background-color: var(--surface_2);
  border-color: var(--line);
  color: var(--ink_soft);
  cursor: not-allowed;
}
.field:has(> input:disabled) > label,
.field:has(> select:disabled) > label,
.field:has(> textarea:disabled) > label { color: var(--ink_faint); }
/* セレクトの右はじの「▼」。昔ながらの下向き三角で出す（appearance:none でブラウザ標準の矢印を消しているため自前で描く） */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 3h7L5 8z' fill='%236b6660'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}

/* 既存会員からコピーした欄（更新・増口の登録画面）。どこが引き継がれたか一目で分かるようピンクにする。
   ※ 背景は background-color で塗ること。background 一括指定にするとセレクトの「▼」画像まで消える */
.is_copied > label { color: #c2185b; }
.is_copied > input,
.is_copied > select,
.is_copied > textarea { background-color: #fdeff5; border-color: #f3b6cd; }
.is_copied .pill_choice.checked { background-color: #fdeff5; border-color: #f3b6cd; color: #c2185b; }
.hint { font-size: 11px; color: var(--ink_faint); }
/* 確認事項（クライアントへの質問・要確認事項）：赤で目立たせる。システム的な注意書きは通常の.hint(灰)のまま。
   ただし普段は隠しておき、アクセスログ画面で表示に切り替えた人だけに見せる（2026-09-02 當山さんご指示）。
   表示に戻すときは display:revert で、pなら段落・spanなら行内と、本来の並び方に戻す */
.hint_confirm { display: none; font-size: 11px; color: var(--danger); font-weight: 600; }
.app.show_notes .hint_confirm { display: revert; }

.radio_row, .check_row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill_choice {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px;
  border: 1px solid var(--line_strong); border-radius: 999px;
  cursor: pointer; background: var(--surface); color: var(--ink_soft);
}
.pill_choice input { accent-color: var(--gold); }
.pill_choice:hover { border-color: var(--gold); }
.pill_choice.checked { background: var(--gold_soft); border-color: var(--gold); color: var(--gold_hover); font-weight: 600; }
/* 同意チェックをテーマ色にする（退会の同意など、ふつうの同意と区別したいとき） */
.pill_choice_accent { color: var(--theme_accent); border-color: var(--theme_accent_line); }
.pill_choice_accent input { accent-color: var(--theme_accent); }
.pill_choice_accent:hover { border-color: var(--theme_accent); }
.pill_choice_accent.checked { background: var(--theme_accent_bg); border-color: var(--theme_accent); color: var(--theme_accent); }

/* =========================================================
   ボタン
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 600; font-family: inherit;
  border-radius: var(--radius_sm); border: 1px solid var(--line_strong);
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background .12s, border-color .12s, transform .04s;
}
.btn:hover { background: var(--surface_2); }
.btn:active { transform: translateY(1px); }
.btn_primary { background: var(--clay); border-color: var(--clay); color: #fff; }
.btn_primary:hover { background: var(--clay_hover); border-color: var(--clay_hover); }
.btn_ghost { background: transparent; border-color: transparent; color: var(--ink_soft); }
.btn_ghost:hover { background: var(--surface_2); }
.btn_danger { color: var(--danger); border-color: #e3c4be; }
.btn_danger:hover { background: #f7ebe8; }
/* =========================================================
   モーダル（添付資料ビューア）
   ========================================================= */
.modal_overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(31, 42, 51, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal_overlay[hidden] { display: none; }
.modal_panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  width: min(900px, 100%);
  max-height: 100%;
  display: flex; flex-direction: column;
}
.modal_head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal_title { font-size: 14px; font-weight: 700; word-break: break-all; }
.modal_close {
  border: none; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--ink_soft); padding: 4px 8px;
}
.modal_close:hover { color: var(--ink); }
.modal_body {
  flex: 1; min-height: 0; overflow: auto;
  padding: 18px; background: var(--surface_2);
  display: flex; align-items: center; justify-content: center;
}
/* 参照画面の添付資料リンク（押せることが伝わるよう、種別アイコン＋リンク色＋下線） */
.attachment_link {
  display: flex; align-items: center; gap: 6px;
  color: var(--clay); cursor: pointer;
}
.attachment_link span { text-decoration: underline; }
.attachment_link svg { flex: 0 0 auto; }
.attachment_link:hover { color: var(--clay_hover); }
.attachment_link + .attachment_link { margin-top: 5px; }

.attachment_image { max-width: 100%; max-height: 60vh; object-fit: contain; background: #fff; }
.attachment_frame { width: 100%; height: 60vh; border: none; background: #fff; }
.modal_foot {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-top: 1px solid var(--line);
}
.modal_foot .spacer { flex: 1; }

/* 最新付与番号（受付情報・会員登録・プラン情報の上部に出す帯） */
.latest_no_row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 32px;
}
.latest_no_title { font-size: 13px; font-weight: 700; color: var(--ink); }
.latest_no_item { display: flex; align-items: baseline; gap: 10px; }
.latest_no_item span { font-size: 12px; color: var(--ink_soft); }
.latest_no_item b { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* 退会など、後戻りしにくい操作へ進むボタン（赤地・白字） */
.btn_danger_solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn_danger_solid:hover { background: #c8452e; border-color: #c8452e; color: #fff; }
.btn_sm { padding: 6px 12px; font-size: 12.5px; }

.actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; justify-content: flex-end; }
.actions.between { justify-content: space-between; }

/* =========================================================
   ツールバー / フィルタ
   ========================================================= */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.search {
  position: relative; flex: 1 1 240px; max-width: 360px;
}
.search input { padding-left: 34px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); }
.spacer { flex: 1 1 auto; }

/* =========================================================
   テーブル
   ========================================================= */
.table_wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data_table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data_table thead th {
  text-align: left; font-weight: 700; font-size: 12px; color: var(--ink_soft);
  background: var(--surface_2);
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data_table tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink);
  white-space: nowrap;
}
.data_table tbody tr:last-child td { border-bottom: none; }
.data_table tbody tr:hover { background: #f3f9fd; }
.data_table tbody tr.is_selected { background: var(--clay_soft); }
.data_table td.num, .data_table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data_table td.center, .data_table th.center { text-align: center; }
input[type=checkbox] { accent-color: var(--clay); width: 15px; height: 15px; }
/* テーマがある画面では、チェックが入ったときの色もその画面の色に合わせる */
.app.theme_danger input[type=checkbox] { accent-color: var(--theme_accent); }

.badge {
  display: inline-block; padding: 2px 9px; font-size: 11.5px; font-weight: 600;
  border-radius: 999px; line-height: 1.5;
}
.badge.plan_g  { background: #eae3f4; color: #6b4ea0; }
.badge.new     { background: #e3efe3; color: var(--ok); }
.badge.update  { background: #fdf0dd; color: var(--warn); }
.badge.gold    { background: #f6ecd0; color: #8a6d1f; }
.badge.silver  { background: #eceef1; color: #5d6671; }
.badge.bronze  { background: #f1e2d6; color: #8a5a30; }
.badge.web     { background: var(--clay_soft); color: var(--clay_hover); }
.badge.muted   { background: var(--surface_2); color: var(--ink_soft); }

/* 受付情報のWEB登録情報テーブル：最大8行分の高さでスクロール（それ以上はスクロールバー） */
.reception_scroll { max-height: 340px; overflow-y: auto; }
.reception_scroll thead th { position: sticky; top: 0; z-index: 1; }

/* 受付情報のツールバー：WEB取込〜一括登録は幅60%の中で等間隔、全体は右寄せ。
   選択削除だけは別枠で、さらに右端に離して置く
   （.table_footとの2クラス指定で明示的に上書き。CSS内の記述順に依存させない） */
.table_foot.reception_toolbar { justify-content: flex-end; gap: 28px; }
.reception_toolbar_group {
  display: flex; align-items: center; justify-content: space-between;
  width: 60%;
}

.table_foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-top: 1px solid var(--line); color: var(--ink_soft); font-size: 12.5px;
}
.pager { display: flex; gap: 4px; }
.pager button {
  min-width: 30px; height: 30px; border: 1px solid var(--line_strong);
  background: var(--surface); border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--ink_soft);
}
.pager button.active { background: var(--clay); border-color: var(--clay); color: #fff; }

/* =========================================================
   マスタ編集モード（右上の「編集」→ その場でテーブルを編集）
   ========================================================= */
.master_edit_actions { display: flex; gap: 6px; align-items: center; }
.master_cancel_btn, .master_save_btn { display: none; }
.card.is_editing .master_edit_btn { display: none; }
.card.is_editing .master_cancel_btn,
.card.is_editing .master_save_btn { display: inline-flex; }

/* 行を追加ボタンは編集モード中だけ表示（フッターごと隠す） */
.master_table_foot { display: none; justify-content: flex-end; }
.card.is_editing .master_table_foot { display: flex; }

/* 編集モード中：セル自体ではなく、セルの中に一回り小さい入力箱を表示する
   （セルの枠＝表の罫線と紛れないよう、あえて独立した箱として見せる） */
.cell_edit_box {
  display: block;
  width: 100%;
  min-height: 1.4em;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--line_strong);
  border-radius: var(--radius_sm);
  box-shadow: 0 1px 2px rgba(31,30,29,.04);
  cursor: text;
  outline: none;
}
.cell_edit_box:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 2px var(--focus);
}

/* =========================================================
   ログイン画面（サイドバー無し・中央寄せ）
   ========================================================= */
.auth_wrap {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(1200px 520px at 50% -10%, #d4eefb, transparent),
    var(--bg);
  padding: 24px;
}
.auth_card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(31,30,29,.08);
  padding: 34px 32px 30px;
}
.auth_brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth_brand .logo {
  width: 46px; height: 46px; border-radius: 12px; background: var(--clay); color: #fff;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 22px;
}
.auth_brand h1 { font-size: 18px; margin: 2px 0 0; font-family: var(--serif); }
.auth_brand p { margin: 0; font-size: 12px; color: var(--ink_faint); }
.auth_card .field { margin-bottom: 14px; }
.auth_card .btn_primary { width: 100%; padding: 11px; font-size: 14.5px; margin-top: 6px; }
.auth_foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--ink_faint); }
.q_box {
  background: var(--surface_2); border: 1px dashed var(--line_strong);
  border-radius: var(--radius_sm); padding: 10px 12px; font-size: 12.5px; color: var(--ink_soft);
}

/* =========================================================
   参照表示（確認専用・コンパクト）
   入力欄を使わず「項目：値」で詰めて見せる。面積を取らず、
   触れないことが見た目で伝わる。
   ========================================================= */
.ref_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 22px;
  margin: 0;
  padding: 10px 14px;
  background: var(--surface_2);
  border: 1px solid var(--line);
  border-radius: var(--radius_sm);
}
.ref_item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line_strong);
}
.ref_item dt {
  flex: 0 0 112px;
  font-size: 11.5px; font-weight: 600; color: var(--ink_faint);
}
.ref_item dd { margin: 0; font-size: 13.5px; color: var(--ink); }
.ref_item dd .empty { color: var(--ink_faint); }
.ref_item.wide { grid-column: 1 / -1; }

/* 参照画面：姓名・フリガナ・生年月日（クライアント提供のエクセル通りの並びを再現）
   項目名と値が交互に続くため、間隔を詰めると「姓 名護 名 愛」が一続きの文章に見えてしまう。
   ゆとりを取り、値は一回り大きく太くして、項目名（小さい・薄い）と見分けられるようにする */
.ref_name_block {
  background: var(--surface_2); border: 1px solid var(--line); border-radius: var(--radius_sm);
  padding: 16px 20px;
}
.ref_name_row {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 8px 10px; padding: 10px 0;
}
.ref_name_row + .ref_name_row { border-top: 1px dotted var(--line_strong); }
.ref_name_label {
  flex: 0 0 auto; min-width: 3.5em;
  font-size: 11.5px; font-weight: 600; color: var(--ink_faint);
}
/* 値に最小幅を持たせて、上段（姓・名）と下段（セイ・メイ）の位置を縦に揃える */
.ref_name_value {
  flex: 0 0 auto; min-width: 7em;
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin-right: 26px;
}
.ref_name_divider { color: var(--line_strong); margin: 0 6px; font-weight: 300; }

/* 参照画面で唯一「修正できる」箇所を囲って目立たせる */
.edit_box {
  border: 1px solid var(--clay);
  background: var(--clay_soft);
  border-radius: var(--radius_sm);
  padding: 12px 14px;
}
.edit_box .section_label { margin-top: 0; }

/* 受付情報から持って来た申込の確認バー。処理中であることが常に見えているようにする */
.entry_bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 18px;
  padding: 14px 18px; margin-bottom: 18px;
  background: #fff8e6; border: 1px solid #e6c982; border-left: 4px solid var(--gold);
  border-radius: var(--radius_sm);
}
.entry_bar_body { flex: 1 1 320px; min-width: 0; }
.entry_bar_title { font-size: 14px; font-weight: 700; color: var(--gold_hover); }
.entry_bar_detail { font-size: 12px; color: var(--ink_soft); margin-top: 4px; }
.entry_bar_actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.entry_bar_done { background: #eef1f4; border-color: var(--line_strong); border-left-color: var(--ink_soft); }
.entry_bar_done .entry_bar_title { color: var(--ink); }

/* =========================================================
   ユーティリティ
   ========================================================= */
.muted { color: var(--ink_soft); }
.right { text-align: right; }
.mt_0 { margin-top: 0; } .mt_8 { margin-top: 8px; } .mt_16 { margin-top: 16px; }
.unit_note { font-size: 12px; color: var(--ink_soft); }
.two_col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .form_grid, .two_col { grid-template-columns: 1fr; }
  /* 1列になると「2分の1」は狭すぎるので、他の欄と同じ幅に戻す */
  .field.col_2.input_half > input,
  .field.col_2.input_half > select { flex: 1 1 200px; }
  .field.col_2.input_half > .other_toggle_input { flex: 1 1 100%; }
}
