/* ============================================================
   ランプコア統合業務システム — Midnight Executive テーマ
   ネイビー×ゴールド基調 / 状態色(緑赤黄)維持 / 全画面レスポンシブ
   ============================================================ */
:root {
  --navy:    #12244a;
  --navy-2:  #0c1830;
  --navy-3:  #1c356b;
  --navy-line: #24365f;
  --gold:    #c9a227;
  --gold-2:  #e2c766;
  --bg:      #eef1f5;
  --card:    #ffffff;
  --line:    #e3e7ee;
  --text:    #1e2a3a;
  --muted:   #6b7688;
  --ok:      #1e9e57;
  --warn:    #d9822b;
  --bad:     #d64545;
  --ok-bg:   #e6f5ec;
  --warn-bg: #fdf1e3;
  --bad-bg:  #fbeaea;
  --radius:  8px;
  /* 事業部識別色（彩度を抑えた8種。マス背景=白文字） */
  --div-mobile:  #2c6e8f;
  --div-event:   #5b5f97;
  --div-fcc:     #a4603a;
  --div-refa:    #4f7d6a;
  --div-sticker: #9a5b7e;
  --div-popcorn: #8a7d3f;
  --div-wataame: #7d6f9e;
  --div-hq:      #5a6470;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
a { color: #1f5fbf; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- ヘッダ / ナビ ---- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 0 16px; min-height: 52px;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 2px solid var(--gold);
}
.topbar .brand {
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .02em;
  white-space: nowrap; padding: 14px 0;
}
.topbar .brand::before { content: "◆ "; color: var(--gold); }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a {
  color: #cdd6e6; padding: 15px 11px; font-size: 13.5px; border-bottom: 3px solid transparent;
}
.topbar nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.05); }
.topbar nav a.active { color: #fff; border-bottom-color: var(--gold); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #aeb9cc; white-space: nowrap; }
.userbox a { color: var(--gold-2); }
.hamburger { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 8px; }

main { max-width: 1180px; margin: 20px auto; padding: 0 16px; }
footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 0; }

h1 { font-size: 20px; margin: 0 0 16px; color: var(--navy); }
h2 { font-size: 15.5px; margin: 22px 0 10px; color: var(--navy); border-left: 3px solid var(--gold); padding-left: 8px; }
h3 { font-size: 14px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(18,36,74,.04);
}

/* ---- テーブル ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f3f5f9; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
th a { color: var(--muted); }
tbody tr:hover td { background: #f7f9fc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot th { background: #eef1f6; }

.badge { display: inline-block; color: #fff; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---- ボタン ---- */
.btn {
  display: inline-block; border: 1px solid #cdd4de; background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.3;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f1f4f9; text-decoration: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: #1b3568; color: #fff; }
.btn-danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #3a2f05; font-weight: 600; }
.btn-gold:hover { background: var(--gold-2); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---- フォーム ---- */
form.stack label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 13px; }
form.stack .req::after { content: " *"; color: var(--bad); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #cdd4de; border-radius: 6px; font-size: 15px;
  font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-2); outline-offset: -1px; border-color: var(--gold); }
textarea { min-height: 70px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.flash-ok { background: var(--ok-bg); color: #14603a; border: 1px solid #9ad4b3; }
.flash-err { background: var(--bad-bg); color: #8f2b2b; border: 1px solid #e6a3a3; }
.flash-info { background: #e8eefb; color: #294a92; border: 1px solid #a9c0ee; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters > div { display: flex; flex-direction: column; }
.filters label { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.filters select, .filters input { width: auto; font-size: 14px; }

.login-wrap { max-width: 360px; margin: 56px auto; }
.muted { color: var(--muted); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }
.bundle-tag { background: #efe6cf; color: #7a5c12; padding: 1px 7px; border-radius: 4px; font-size: 12px; }
.rowline { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rowline > * { flex: 1; min-width: 120px; }

/* 判定色ユーティリティ */
.st-ok { color: var(--ok); } .st-warn { color: var(--warn); } .st-bad { color: var(--bad); }

/* ============================================================
   カレンダー盤面
   ============================================================ */
.board-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid #cdd4de; border-radius: 6px; overflow: hidden; }
.seg a { padding: 6px 12px; font-size: 13px; color: var(--text); background: #fff; border-left: 1px solid #cdd4de; }
.seg a:first-child { border-left: 0; }
.seg a:hover { text-decoration: none; background: #f1f4f9; }
.seg a.on { background: var(--navy); color: #fff; }

.board-wrap { overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: 78vh; }
table.board { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
table.board th, table.board td { border: 1px solid var(--line); padding: 0; }
table.board thead th {
  position: sticky; top: 0; z-index: 3; background: #f3f5f9; text-align: center;
  font-size: 11.5px; color: var(--muted); padding: 5px 4px; min-width: 78px;
}
table.board thead th.sat { color: #2456b0; } table.board thead th.sun { color: #b03a3a; }
table.board .rowhead {
  position: sticky; left: 0; z-index: 2; background: #fff; min-width: 130px; max-width: 160px;
  padding: 6px 8px; font-size: 12.5px; text-align: left; box-shadow: 1px 0 0 var(--line);
}
table.board thead th.corner { position: sticky; left: 0; z-index: 4; background: #eef1f6; text-align: left; }
.cell { min-height: 40px; height: 100%; padding: 3px; }
.cell-empty { background: #fff; }
.cell-out { background: repeating-linear-gradient(45deg,#f4f5f7,#f4f5f7 5px,#eef0f3 5px,#eef0f3 10px); }
.chip {
  display: block; color: #fff; border-radius: 4px; padding: 3px 5px; font-size: 11px; line-height: 1.25;
  margin-bottom: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip .sub { opacity: .85; font-size: 10px; }
.chip.sub-primary { box-shadow: inset 3px 0 0 var(--gold); }
.chip.sub-secondary { opacity: .7; box-shadow: inset 3px 0 0 rgba(255,255,255,.5); }
.rowhead .cap-warn { color: var(--bad); font-weight: 700; }
.rowhead .retired { color: var(--muted); font-style: italic; }
.rowhead .sub2 { color: var(--muted); font-size: 11px; }

/* 案件軸の充足マス */
.fill { display: block; text-align: center; padding: 8px 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.fill-ok   { background: var(--ok-bg);  color: #14603a; }
.fill-short{ background: var(--bad-bg); color: #8f2b2b; }
.fill-warn { background: var(--warn-bg);color: #8a5316; }
.fill-ship { background: #eceef1; color: #5a6470; }

/* 詳細ポップ */
.pop-bg { position: fixed; inset: 0; background: rgba(12,24,48,.45); z-index: 100; display: none; }
.pop-bg.show { display: block; }
.pop {
  position: fixed; z-index: 101; left: 50%; top: 50%; transform: translate(-50%,-50%);
  background: #fff; border-radius: 10px; padding: 16px 18px; min-width: 260px; max-width: 92vw;
  box-shadow: 0 10px 40px rgba(12,24,48,.35); display: none;
}
.pop.show { display: block; }
.pop h3 { margin: 0 0 8px; color: var(--navy); }
.pop .close { position: absolute; right: 10px; top: 8px; cursor: pointer; color: var(--muted); font-size: 18px; }

.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; align-items: center; }
.legend .sw { display: inline-block; width: 13px; height: 13px; border-radius: 3px; vertical-align: -2px; margin-right: 3px; }

/* ============================================================
   レスポンシブ（スマホ）
   ============================================================ */
@media (max-width: 720px) {
  main { margin: 12px auto; padding: 0 10px; }
  .hamburger { display: block; margin-left: auto; }
  .topbar { flex-wrap: wrap; gap: 0; }
  .topbar .brand { flex: 1; font-size: 14px; }
  .topbar nav {
    flex-basis: 100%; flex-direction: column; gap: 0; display: none;
    background: var(--navy-2); margin: 0 -16px; padding: 4px 0;
  }
  .topbar nav.open { display: flex; }
  .topbar nav a { padding: 12px 16px; border-bottom: 1px solid var(--navy-line); border-left: 3px solid transparent; }
  .topbar nav a.active { border-bottom-color: var(--navy-line); border-left-color: var(--gold); }
  .userbox { flex-basis: 100%; order: 3; padding: 8px 0; justify-content: flex-end; }
  h1 { font-size: 18px; }
  .card { padding: 14px 12px; }
  /* 通常テーブルは横スクロール可能に包む */
  .card > table { display: block; overflow-x: auto; white-space: nowrap; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .btn, .seg a { padding: 9px 14px; }  /* 指で押せるサイズ */
  input, select, textarea { font-size: 16px; }  /* iOSズーム防止 */
  .board-wrap { max-height: 70vh; }
  table.board .rowhead { min-width: 108px; max-width: 120px; }
}

/* 希望休・依頼状態（森崎レビュー対応） */
.cell-off { background: repeating-linear-gradient(45deg,#f3e6ee,#f3e6ee 4px,#fff 4px,#fff 8px); }
.offmark { display:block; font-size:9px; color:#9a5b7e; text-align:center; padding-top:10px; }
.chip-requested { opacity:.75; border:1px dashed #fff; }
.chip-declined  { opacity:.55; text-decoration: line-through; }

/* ============================================================
   PC表示の磨き込み（森崎指示: スマホより先にPCで綺麗に。1280px想定）
   ============================================================ */
@media (min-width: 1100px) {
  /* シフト割当画面は横幅を活かす */
  body.wide main { max-width: 1500px; }
}
/* 役割ブロックの区切りを明確に（シフト割当） */
.role-block { border-left: 4px solid var(--navy); }
.role-block > .role-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px; margin: -18px -18px 12px; background: #f3f5f9;
  border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.role-head h2 { margin: 0; border: 0; padding: 0; font-size: 15px; }
.role-head .req-sum { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.role-head .fulfil { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
/* 行間・可読性 */
.shift-table th, .shift-table td { padding: 9px 8px; }
.shift-table tbody tr + tr td { border-top: 1px solid var(--line); }
.shift-table select, .shift-table input { font-size: 13.5px; padding: 6px 8px; }
/* 集計バーは常時見えるように下部固定（PC） */
.sticky-summary {
  position: sticky; bottom: 0; z-index: 20;
  background: #fff; border-top: 2px solid var(--gold);
  box-shadow: 0 -4px 14px rgba(18,36,74,.08);
}
.sum-figs { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.sum-figs .fig { font-size: 13px; color: var(--muted); }
.sum-figs .fig b { display: block; font-size: 18px; color: var(--navy); font-variant-numeric: tabular-nums; }
.sum-figs .fig.margin b { color: var(--ok); }
/* 月表示は密度を上げる（PCで1画面に収める） */
table.board.dense thead th { min-width: 34px; font-size: 10.5px; padding: 4px 2px; }
table.board.dense .chip { font-size: 9.5px; padding: 2px 3px; }
table.board.dense .fill { padding: 6px 2px; font-size: 11px; }

/* ===== 仮押さえ（tentative）＝受注前の当て込み =====
   確定と一目で区別できるよう、色・字体・斜線の3つを同時に変える。
   （色だけだと印刷・色覚・小さい画面で潰れるため、斜体＋斜線ハッチを併用）
   希望休の斜線は「空きマスの背景」、仮の斜線は「チップの中身」なので用途が衝突しない。 */
.chip-tentative {
  font-style: italic;                       /* 字体: 仮は斜体 */
  border: 1px dashed rgba(18, 36, 74, .55); /* 枠: 破線 */
  opacity: .92;
  /* 斜線ハッチを事業部色の上に重ねる（事業部の識別色は保つ） */
  background-image: repeating-linear-gradient(
    45deg, rgba(255,255,255,.55) 0 3px, rgba(255,255,255,0) 3px 6px);
}
.chip-tentative .sub { font-style: normal; font-weight: 700; }

/* 案件軸: 仮しか居ないマス（確定の緑と混同させない紫系） */
.fill-tent { background: #efedfb; color: #4b3fa7; font-style: italic; }
.sw-tent   { background: #efedfb; border: 1px dashed #6d5bd0; }

/* 案件軸の行頭: 未受注案件の「仮」バッジ */
.is-tent-row a { font-style: italic; }
.tent-tag {
  display: inline-block; margin-left: 4px; padding: 0 5px;
  font-size: 10px; font-style: normal; font-weight: 700;
  color: #4b3fa7; background: #efedfb;
  border: 1px dashed #6d5bd0; border-radius: 3px;
}

/* 凡例内のチップは事業部色を持たないので下地を敷く */
.chip-legend { background: #dfe3ea; padding: 0 6px; }

/* シフト画面: 仮押さえモードのバナーと状態プルダウン */
.flash-tentative {
  background: #f4f2fd; border: 1px solid #6d5bd0; border-left-width: 4px;
  color: #3b3170;
}
select.is-tentative { font-style: italic; border-color: #6d5bd0; background: #f8f7fe; }

/* 案件詳細: 仮押さえボタン（確定系のゴールドと区別） */
.btn-tentative {
  background: #efedfb; color: #4b3fa7; border: 1px dashed #6d5bd0; font-weight: 700;
}
.btn-tentative:hover { background: #e5e1f8; }

/* ===== 労務アラート（月21日超過・6連勤）=====
   労基に関わるため、他の警告（ポイント未設定・週上限・兼務）より一段強く見せる。
   ただしブロックはしない（警告レイヤー思想は維持。強行は変更ログに残る）。 */
.rowwarn-labor {
  color: #991b1b; background: #fee2e2;
  border: 1px solid #dc2626; border-left-width: 4px;
  border-radius: 4px; padding: 4px 8px; margin-top: 4px;
}
.flash-labor {
  background: #fee2e2; border: 1px solid #dc2626; border-left-width: 5px;
  color: #991b1b; font-weight: 700;
}
/* 希望稼働: 最低未達（＝もっと入れてあげたい人）は控えめな青系。労務の赤とは別物 */
.wish-under { color: #1d4ed8; background: #dbeafe; border-radius: 3px; padding: 0 4px; font-size: 11px; }

/* ===== 案件軸の役割別充足（三瓶FB 1.3）=====
   運用の単位は役割別人数（総数が合っていてもクローザーが欠けたら現場は破綻する）。
   不足している役割だけ赤くし、充足は控えめに。略号は役割マスタで編集可。 */
.rf { display:inline-block; font-size:11px; line-height:1.5; padding:0 3px; margin:1px 1px 0 0;
      border-radius:3px; white-space:nowrap; }
.rf b { font-weight:700; margin-right:1px; }
.rf-ok    { background:#e6f5ec; color:#166534; }
.rf-short { background:#fbeaea; color:#b91c1c; font-weight:700; }

/* ===== 転置（行列入替）=====
   列＝スタッフ/案件、行＝日付。列が増えるので幅を詰め、見出しは縦書き寄りに。 */
table.board.transposed th.colhead {
  font-size:11px; font-weight:600; padding:4px 2px; min-width:56px; max-width:80px;
  white-space:normal; word-break:break-all; vertical-align:bottom;
}
table.board.transposed td.rowhead { min-width:82px; width:82px; font-size:12px; }
table.board.transposed td.cell { min-width:56px; }
table.board.transposed .chip { font-size:10px; }

/* 人なしコンテンツ時に配送費の入力を促す（限定はしない＝全案件で入力可） */
input.promote { border-color: #c9a227; background: #fffbea; }

/* ===== 希望稼働枠の入力欄（月次画面）=====
   数値欄に日本語のプレースホルダを入れると、欄が狭いため縦に潰れて
   「最」「⊥」のような表示になる。文字はラベル側に出し、欄内は数字だけにする。 */
.wish-head { min-width: 190px; }
.wish-cell { min-width: 190px; white-space: nowrap; }
.wish-row  { display: flex; align-items: center; gap: 4px; }
.wish-row label {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--muted, #6b7280); white-space: nowrap;
}
.wish-row input[type="number"] {
  width: 52px; min-width: 52px; padding: 4px 6px; text-align: right; font-size: 13px;
}
.wish-unit { font-size: 11px; }
.wish-note { width: 100%; margin-top: 3px; font-size: 11px; padding: 3px 6px; }

/* ===== キャリアバッジ（識別色）=====
   案件の属性としてのキャリアを一覧・盤面・詳細で一目で分かるようにする。
   色は carriers マスタで編集可（識別のためのもので、事業部色とは別レイヤー）。 */
.carrier-tag {
  display: inline-block; padding: 0 6px; margin-left: 4px;
  font-size: 10px; font-weight: 700; line-height: 1.6;
  color: #fff; border-radius: 3px; white-space: nowrap;
  vertical-align: middle;
}

/* ===== 連続日のコピー =====
   ボタンは条件を満たさない時も必ず表示し、無効状態＋理由で伝える
   （使える場面でしか出さないと、機能の存在自体に気づけない）。 */
.copy-card { padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* カード内の select は既定で幅100%になるため、ここだけ内容幅に戻す（縦積みを防ぐ） */
.copy-card select { width: auto; min-width: 84px; display: inline-block; margin: 0 2px; }
.copy-card form { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.copy-card .hint { flex-basis: 100%; margin: 0; }
.copy-card .btn[disabled] { opacity: .45; cursor: not-allowed; }
.copy-card select[disabled] { opacity: .5; }
.copy-why { color: #8a6d3b; background: #fdf6e3; border-radius: 4px; padding: 4px 8px; margin-top: 6px; }

/* ===== 盤面の絞り込み中インジケータ（第1便②）=====
   何で絞っているかを明示し、個別・一括で解除できるようにする。 */
.board-activefilter { margin: -4px 0 10px; font-size: 13px; }
.board-activefilter .afchip {
  display: inline-block; margin: 0 6px 0 2px; padding: 2px 8px;
  background: #12244a; color: #fff; border-radius: 12px;
}
.board-activefilter .afchip a { color: #ffd35a; text-decoration: none; margin-left: 4px; font-weight: 700; }
.board-activefilter .afclear { color: #12244a; font-weight: 700; margin-left: 6px; }

/* ===== 距離区分バッジ（第1便③）。遠方は目立たせる ===== */
.area-tag { display:inline-block; padding:0 6px; margin-left:4px; font-size:10px; font-weight:700;
  line-height:1.6; border-radius:3px; white-space:nowrap; vertical-align:middle; }
.area-near { background:#e6f0ff; color:#1d4ed8; }          /* 近隣: 落ち着いた青 */
.area-mid  { background:#fff3e0; color:#b45309; }          /* 中距離: 橙 */
.area-far  { background:#d94f4f; color:#fff; }             /* 遠方: 赤で目立たせる */

/* ===== 希望休×仮割当の衝突（第2便§2）=====
   希望休の人に未確定(仮/依頼中)で割り当てた安全網表示。確定すると消える（＝本人合意済み）。
   スタッフ軸チップ・案件軸マスの両方で見える。希望休斜線の透かし＋⚠。 */
.chip-offconflict {
  box-shadow: inset 0 0 0 2px #d64545;
  background-image: repeating-linear-gradient(45deg,
    rgba(214,79,69,.28) 0 4px, rgba(214,79,69,0) 4px 8px) !important;
}
.offconf-mark { color: #b91c1c; font-weight: 700; margin-right: 2px; }
.fill-offconflict { outline: 2px solid #d64545; outline-offset: -2px; }

/* ===== 第2便§1 候補パネル + D&D ===== */
.shift-layout { display: flex; gap: 16px; align-items: flex-start; }
.shift-main { flex: 1; min-width: 0; }
.cand-panel {
  width: 264px; flex: 0 0 264px; position: sticky; top: 12px;
  background: #fff; border: 1px solid #d7dce5; border-radius: 8px; padding: 10px;
  max-height: calc(100vh - 24px); overflow: auto;
}
.cand-panel .cp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cand-panel .cp-filters { display: flex; gap: 6px; margin-bottom: 8px; }
.cand-panel .cp-filters select { flex: 1; font-size: 12px; padding: 3px; }
.cp-list { display: flex; flex-direction: column; gap: 5px; }
.cp-card {
  border: 1px solid #cfd6e2; border-radius: 6px; padding: 5px 8px; background: #f7f9fc;
  cursor: grab; touch-action: none; user-select: none;
}
.cp-card:active { cursor: grabbing; }
.cp-card .cp-name { font-size: 13px; font-weight: 600; }
.cp-card .cp-meta { font-size: 11px; color: #6b7280; }
.cp-warn, .cp-warn-txt { color: #b45309; }
.cp-nopt { color: #b91c1c; }
.cp-nowage { color: #b91c1c; margin-left: 3px; }
.cp-booked { margin-top: 10px; border-top: 1px dashed #d7dce5; padding-top: 8px; }
.cp-booked-toggle { background: none; border: 0; color: #12244a; font-size: 12px; cursor: pointer; padding: 0; }
.cp-booked-list { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.cp-booked-list .cp-card { opacity: .7; background: #eef1f6; }
/* ドラッグ中のゴースト・ドロップ先ハイライト */
.dnd-ghost {
  position: fixed; z-index: 9999; pointer-events: none; transform: translate(8px, 8px);
  background: #12244a; color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-block.dnd-over { outline: 2px dashed #c9a227; outline-offset: 2px; background: #fffdf3; }
#candpanel.dnd-over { outline: 2px dashed #d64545; outline-offset: 2px; }
.row-drag { cursor: grab; touch-action: none; color: #9aa5b1; margin-right: 4px; user-select: none; }
.dnd-flash {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 9999;
  background: #b91c1c; color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 13px;
}
@media (max-width: 900px) { .shift-layout { flex-direction: column; } .cand-panel { width: 100%; flex-basis: auto; position: static; max-height: none; } }

/* ★売上の計算過程（予定登録・確定・案件詳細で共通） */
.sales-formula {
  margin: 6px 0 2px; padding: 10px 12px; border: 1px solid var(--line, #d9dee7);
  border-left: 3px solid var(--gold, #c8a24a); border-radius: 6px;
  background: color-mix(in srgb, var(--gold, #c8a24a) 7%, transparent); font-size: 13px;
}
.sales-formula .sf-title { font-weight: 700; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.sales-formula .sf-lines { list-style: none; margin: 2px 0; padding: 0; }
.sales-formula .sf-line { padding: 1px 0; color: #334155; }
.sales-formula .sf-subtotal { margin: 3px 0; padding-top: 3px; border-top: 1px dashed #cbd5e1; }
.sales-formula .sf-modeline { margin-top: 6px; }
.sales-formula .sf-final { font-size: 14px; }
.sales-formula .sf-final b { font-size: 15px; }
.sales-formula .sf-basis, .sales-formula .sf-ref, .sales-formula .sf-note { color: #64748b; font-size: 12px; margin-top: 2px; }
.sales-formula .sf-nomul { color: #b45309; font-size: 12px; }
.sales-formula .sf-override {
  margin-top: 4px; padding: 3px 6px; border-radius: 4px; background: #fff7ed;
  border: 1px solid #fed7aa; color: #9a3412; font-size: 12px;
}
.sales-formula .sf-override .sf-live { font-weight: 700; color: #b91c1c; }
.sf-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  margin-right: 6px; vertical-align: 1px;
}
.sf-badge-daily { background: #dbeafe; color: #1e40af; }
.sf-badge-total { background: #dcfce7; color: #166534; }
.sf-badge-plan  { background: #f1f5f9; color: #475569; }

/* ★候補パネル: この案件で配置済み（グレー＋バッジ・掴める） */
.cp-placed-sec { margin-top: 8px; border-top: 1px dashed #cbd5e1; padding-top: 6px; }
.cp-placed-title { font-size: 11px; font-weight: 700; color: #64748b; margin-bottom: 4px; }
.cp-card-placed { opacity: .62; background: #f1f5f9; border-style: dashed; }
.cp-card-placed:hover { opacity: .85; }
.cp-placedbadge {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
  padding: 0 6px; border-radius: 999px; background: #e2e8f0; color: #475569; vertical-align: 1px;
}

/* ★宿泊バッジ（原価漏れ防止で目立たせる） */
.lodging-tag {
  display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700;
  padding: 0 6px; border-radius: 4px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
}

/* ★(1) 候補パネル: 全員表示＋状態注釈 */
.cp-card-off {
  opacity: .8;
  background: repeating-linear-gradient(-45deg, #f1f5f9, #f1f5f9 6px, #e6eaf0 6px, #e6eaf0 12px);
  color: #64748b;
}
.cp-offbadge {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
  padding: 0 6px; border-radius: 999px; background: #cbd5e1; color: #475569; vertical-align: 1px;
}
.cp-card-booked { background: #fef2f2; border-color: #fecaca; }
.cp-bookednote { font-size: 11px; color: #b91c1c; margin-top: 2px; }
.cp-legend { display: inline-block; font-size: 10px; padding: 0 6px; border-radius: 3px; margin-right: 4px; border: 1px solid transparent; }
.cp-lg-free   { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
.cp-lg-booked { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.cp-lg-off    { background: #e6eaf0; border-color: #cbd5e1; color: #64748b; }
.cp-lg-placed { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }

/* ★第3ラウンド① 人数は足りるがポイント不足のときの理由表示（盤面 案件軸） */
.rf-pt { margin-left: 3px; font-size: 9px; font-weight: 700; color: #b91c1c; }

/* ★第3ラウンド② 必要ポイントの備考（現場の所感）をシフト割当の役割ブロックに出す */
.req-note {
  margin: 0 0 8px; padding: 6px 10px; border-radius: 6px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px;
}

/* ★第3ラウンド③ 制限情報バッジ（strong=出禁・ハラスメント関連は一段強く） */
.restrict-tag { display:inline-block; font-size:11px; font-weight:700; padding:1px 8px; border-radius:4px; }
.restrict-normal { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }
.restrict-strong { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
/* シフト候補パネルの制限注釈 */
.cp-restrict { display:block; font-size:11px; margin-top:2px; color:#92400e; }
.cp-restrict-strong { color:#b91c1c; font-weight:700; }
.cp-card-restrict-strong { border-color:#fca5a5; box-shadow: inset 3px 0 0 #dc2626; }

/* ★第3ラウンド④ 複数日選択カレンダー（共通UI） */
.md-cal { display:inline-block; border:1px solid var(--line,#d9dee7); border-radius:8px; padding:8px; background:#fff; user-select:none; max-width:280px; }
.md-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.md-title { font-weight:700; font-size:13px; }
.md-nav { border:1px solid #cbd5e1; background:#f8fafc; border-radius:4px; width:26px; height:26px; cursor:pointer; }
.md-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.md-dow { text-align:center; font-size:10px; color:#94a3b8; padding:2px 0; }
.md-empty { }
.md-day { text-align:center; padding:5px 0; font-size:12px; border-radius:4px; cursor:pointer; border:1px solid transparent; }
.md-day:hover { background:#eef2ff; }
.md-on { background:#1e3a5f; color:#fff; font-weight:700; }
.md-on:hover { background:#1e3a5f; }
.md-dis { color:#cbd5e1; cursor:not-allowed; background:#f8fafc; }
.md-dis:hover { background:#f8fafc; }
.md-foot { display:flex; align-items:center; justify-content:space-between; margin-top:6px; font-size:12px; }
.md-count { color:#475569; font-weight:700; }
.md-clear { border:1px solid #cbd5e1; background:#fff; border-radius:4px; padding:2px 8px; cursor:pointer; font-size:11px; }
/* 通し変更アラート（確定後のメンバー変更） */
.through-badge { display:inline-block; margin-left:4px; font-size:11px; font-weight:700; padding:0 6px; border-radius:4px; background:#ede9fe; color:#5b21b6; border:1px solid #c4b5fd; }

/* ★第3ラウンド⑤⑥ アラート一覧・確定後変更ビュー */
.tabbar { display:flex; gap:4px; border-bottom:2px solid var(--line,#d9dee7); margin-bottom:12px; }
.tabbar .tab { padding:8px 16px; text-decoration:none; color:#475569; border:1px solid transparent; border-bottom:none; border-radius:6px 6px 0 0; }
.tabbar .tab.active { background:#fff; border-color:var(--line,#d9dee7); color:#1e3a5f; font-weight:700; margin-bottom:-2px; }
.alert-filters { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.afbtn { font-size:12px; padding:3px 10px; border-radius:999px; border:1px solid #cbd5e1; background:#fff; color:#334155; text-decoration:none; }
.afbtn.on { background:#1e3a5f; color:#fff; border-color:#1e3a5f; }
.sevbadge { display:inline-block; font-size:11px; font-weight:700; padding:1px 8px; border-radius:4px; }
.sevbadge.sev0 { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.sevbadge.sev1 { background:#ffedd5; color:#9a3412; border:1px solid #fdba74; }
.sevbadge.sev2 { background:#fef9c3; color:#854d0e; border:1px solid #fde047; }
.sevbadge.sev3 { background:#e2e8f0; color:#475569; border:1px solid #cbd5e1; }
.alert-sev-0 td { background:#fef2f2; }
.chgtag { display:inline-block; font-size:11px; padding:0 6px; border-radius:4px; background:#e0e7ff; color:#3730a3; }
