/* v6.5.0: ユーザー管理画面（独立化）
   DESIGN.md 準拠: 白基調 / ピル型 / 広い余白 */

.container.gs-page {
  padding: 24px 28px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

.card.gs-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-1);
}

/* ===== v6.16.15: 左サイドバーレイアウト（業務担当者判断 1: 固定 240px、コラプシブルなし）。
   旧 .users-filter-row 上部横並びを撤去し、Google Workspace スタイルの 2 カラム grid に変更。
   既存フィルタ要素の id は 100% 維持（JS 変更ゼロ、新メタ教訓「JS 変更ゼロで UI 再配置」確立）。 ===== */
.users-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}
.users-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}
.users-sidebar .sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-divider);
}
.users-sidebar .sidebar-section:first-child { padding-top: 0; }
.users-sidebar .sidebar-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.users-sidebar .sidebar-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}
.users-main {
  display: flex;
  flex-direction: column;
  min-width: 0; /* grid item の overflow 防止 */
}

/* サイドバー内の検索 input / select は幅 100%（240px - padding） */
.users-sidebar .search-box {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 9999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
}
.users-sidebar .search-box:focus,
.users-sidebar .filter-select:focus { border-color: var(--color-primary); }
.filter-select {
  height: 40px;
  padding: 0 28px 0 14px;
  border-radius: 9999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
}
.users-sidebar .filter-select {
  width: 100%;
}

/* v6.8.48: 「廃止部署も表示」トグル（DESIGN.md §2-8 標準、departments.css と同パターン）。
   v6.16.15: サイドバー内では幅 100% で展開、左寄せ。 */
.users-sidebar .toggle-with-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  height: 40px;
  justify-content: flex-start;
}
.users-sidebar .toggle-with-label .label-text {
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 9999px;
  transition: background 180ms;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 180ms;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== 操作行 ===== */
.users-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.users-action-row .left,
.users-action-row .right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.selection-summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.selection-summary strong {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 15px;
}
.sel-sep { margin-left: 8px; }
.link-btn {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  font-family: inherit;
}
.link-btn:hover { background: var(--color-primary-soft, rgba(26,115,232,.08)); }

/* ===== テーブル ===== */
.table-wrapper {
  overflow-x: auto;
  margin: 0 -4px;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.users-table th,
.users-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 0.5px solid var(--color-divider);
  vertical-align: middle;
  white-space: nowrap;
}
.users-table th {
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.users-table tbody tr:hover { background: var(--color-surface-2); }
.users-table tbody tr.selected { background: rgba(26, 115, 232, 0.06); }
.users-table tbody tr.selected:hover { background: rgba(26, 115, 232, 0.10); }

.col-check { width: 36px; }
.col-empno { width: 120px; }
.col-contract { width: 100px; }
.col-role { width: 110px; }
.col-dept { width: 140px; }
.col-actions { width: 260px; text-align: right !important; }

.users-table .empno-main { font-weight: 600; }
.users-table .empno-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 2px;
}
.users-table .empno-sub.unset { color: var(--color-amber, #f29900); }
.users-table .name-main { font-weight: 500; }
.users-table .name-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  font-family: ui-monospace, monospace;
}

/* v6.6.0: 氏名の右隣に並ぶ画面別表示バッジ（週間予定表 ON = 「配」、社員シフト ON = 「シ」）
   OFF 時は renderUsers() 側で HTML 出力自体を省略するため CSS での display:none 不要。 */
.name-badges {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.vis-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.vis-badge.vb-haichi { background: rgba(26, 115, 232, 0.20); color: #0b5394; }
.vis-badge.vb-shifts { background: rgba(52, 168, 83, 0.20); color: #1e7e34; }

/* v6.16.15: 外注先バッジ（業務担当者判断 3 + 4 採用、ピンク色・氏名右側にインライン）
   設計知見 #92「水平展開は意図された複製」継続応用 4 ファイル目（v6.14.7 dashboard /
   v6.16.13 attendance/ok-management post-name-badge の青色 → ピンク色違い並列定義）。
   親要素 .name-badges は v6.6.0 時点で既に inline-flex 化済 → 縦中央揃え自動成立
   （v6.16.13-hotfix.1「親要素 flex 化が縦中央揃えの最も確実な手段」教訓予防適用）。 */
.name-badges .outsource-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 9999px;
  background: #fce4ec;
  color: #c2185b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  vertical-align: middle;
}
[data-theme="dark"] .name-badges .outsource-badge {
  background: rgba(194, 24, 91, 0.20);
  color: #f48fb1;
}

/* ラベルバッジ */
.contract-badge,
.role-tag,
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.contract-badge.contract-director { background: #fce8e6; color: #c5221f; }
.contract-badge.contract-regular  { background: #e8f0fe; color: #1a73e8; }
.contract-badge.contract-contract { background: #fef7e0; color: #b8671a; }
.contract-badge.contract-parttime { background: #e6f4ea; color: #188038; }
.contract-badge.contract-null     { background: #f1f3f4; color: #5f6368; }

.role-tag.general   { background: #f1f3f4; color: #5f6368; }
.role-tag.manager   { background: #fef7e0; color: #b8671a; }
.role-tag.sub_admin { background: #e8f0fe; color: #1a73e8; }
.role-tag.admin     { background: #fce8e6; color: #c5221f; }

.status-badge.active   { background: #e6f4ea; color: #188038; }
.status-badge.inactive { background: #fef7e0; color: #b8671a; }
.status-badge.deleted  { background: #f1f3f4; color: #5f6368; }

/* 操作ボタン */
.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}
/* v6.5.1d: 一覧の操作列は行内配置のため、共通 .gs-btn-pill の 44px よりコンパクトに。
   .gs-btn-pill が !important で height/padding/font-size を強制するので、こちらも !important で上書き。 */
.row-actions .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  min-width: 84px !important;
}

/* v6.5.1: 状態ボタン（一覧の操作列で状態バッジと兼用）
   - active   → 水色「有効」 → クリックで一時停止確認
   - inactive → アンバー「一時停止」 → クリックで有効化確認
   - deleted  → グレー「削除済み」 → クリックで復元確認（inactive へ）
   DESIGN.md §2 ピル型準拠。行内配置のため 32px にコンパクト化（編集ボタンと同寸）。 */
.status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 84px;
  padding: 0 14px;
  border-radius: 9999px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: transform var(--tr), box-shadow var(--tr), filter var(--tr);
}
.status-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
  filter: brightness(0.95);
}
/* v6.5.1c: 背景色を 20% 透過に抑え、文字色は状態色のフル彩度で読みやすさを確保
   （DESIGN.md §10 バッジパターンと同系統の表現）
   「有効」は緑 → 水色（--color-primary 系）に変更 */
.status-btn.status-active   { background: rgba(26, 115, 232, 0.20);  color: #0b5394; }
.status-btn.status-inactive { background: rgba(242, 153, 0, 0.20);   color: #8a5500; }
.status-btn.status-deleted  { background: rgba(128, 134, 139, 0.20); color: #3c4043; }

/* ===== ページネーション ===== */
.users-pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.users-pagination-row .left,
.users-pagination-row .right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-info {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-left: 12px;
}
.pg-btn {
  height: 32px;
  min-width: 40px;
  padding: 0 10px;
  border-radius: 9999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-btn:not(:disabled):hover { background: var(--color-surface-2); }
.pg-numbers { display: inline-flex; gap: 4px; }
.pg-num {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.pg-num:hover { background: var(--color-surface-2); }
.pg-num.current {
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
}
.pg-ellipsis {
  padding: 0 4px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ===== モーダル（追加/編集・一括変更） ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal-box {
  position: relative;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-2);
  /* v6.5.2: 編集モーダルの 2 カラム化に合わせて 560px → 720px に拡張 */
  max-width: 720px;
  width: 100%;
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: 50%;
}
.modal-close:hover { background: var(--color-surface-2); }
.modal-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 14px;
}
.modal-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 14px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.form-group { margin-bottom: 12px; }

/* v6.5.2: 編集モーダルの 2 カラムレイアウト
   ペア化された基本情報（ユーザーID / 社員番号 など）を横並びにし、
   モーダルの縦長さを半分程度に圧縮。所属部署 / 機能アクセスなど複雑な項目は
   .form-grid の外に置くか `.form-grid-full` で全幅に戻す。 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;             /* 行間 12 / 列間 16 */
  margin-bottom: 12px;
  align-items: start;          /* 注釈付き/なしでも上端が揃う */
}
.form-grid .form-group { margin-bottom: 0; }  /* gap で代替 */
.form-grid-full { grid-column: span 2; }

/* モバイルは 1 カラムに戻す */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-full { grid-column: span 1; }
}

/* v6.16.15: 編集モーダル内の外注フラグトグル専用 form-group。
   .form-grid の 2 カラム内に配置（左 トグル / 右 空 div）。
   label の下に余白を取って toggle-with-label を配置（他 form-group の select 高さ 40px と
   視覚的に揃えるため auto + padding 調整）。 */
#editModal .form-group-toggle {
  display: flex;
  flex-direction: column;
}
#editModal .form-group-toggle .toggle-with-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 0;
  height: auto;
  min-height: 40px;
}
#editModal .form-group-toggle .toggle-with-label .label-text {
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}
#editModal .form-group-toggle .form-hint {
  margin-top: 6px;
  line-height: 1.5;
}
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--color-primary); }
.form-group .form-hint {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.form-group .required { color: var(--color-red, #c5221f); }
.error-message {
  color: var(--color-red, #c5221f);
  background: #fce8e6;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* v6.6.2: フィールドレベルのエラー表示
   各 .form-group に data-field 属性、直下に .field-error を置くと、
   .has-error クラスで枠を赤くして .field-error.is-visible でメッセージを見せる。 */
.field-error {
  color: var(--color-red, #c5221f);
  font-size: 12px;
  margin-top: 4px;
  display: none;
  line-height: 1.4;
}
.field-error.is-visible {
  display: block;
}
.form-group.has-error input[type="text"],
.form-group.has-error input[type="password"],
.form-group.has-error input[type="number"],
.form-group.has-error input[type="email"],
.form-group.has-error select {
  border-color: var(--color-red, #c5221f) !important;
  box-shadow: 0 0 0 1px rgba(197, 34, 31, 0.20);
}
.form-group.has-error > label {
  color: var(--color-red, #c5221f);
}
/* 所属部署 (UI が div 群) ではフォームコントロールの枠代わりに dept-row 全体をほんのり赤く */
.form-group.has-error #editDeptRows {
  outline: 1px solid var(--color-red, #c5221f);
  outline-offset: 4px;
  border-radius: 6px;
}

/* v6.6.2: 画面下部のエラーサマリー（フィールド個別エラーと併用の全体説明） */
.form-error-summary {
  color: var(--color-red, #c5221f);
  background: rgba(197, 34, 31, 0.08);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 12px;
  margin-bottom: 4px;
  line-height: 1.5;
}

/* v6.6.4: 週間予定表チェックボックスをインラインで表示する label。
   contract_type / role の select と高さ (input と同じ 40px) を揃え、
   .form-grid 内の 2 カラムグリッドで隣と自然に並ぶようにする。
   ラベルデフォルトの太字を打ち消して (input + テキスト) として見せる。 */
.form-group .checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 0;
  font-size: var(--text-sm);
  font-weight: normal;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.form-group .checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-primary, #1a73e8);
  cursor: pointer;
}

/* 部署行（編集モーダル内） */
.dept-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.dept-row .dept-sel,
.dept-row .pos-sel { flex: 1 1 140px; min-width: 120px; }
.dept-row .dept-remove {
  background: transparent; border: none; color: var(--color-red, #c5221f);
  cursor: pointer; font-size: 18px; padding: 0 6px;
}
.dept-row-primary { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }

/* v6.5.3: 編集モーダルの削除 / ロック解除ボタンを .modal-actions 内の 1 行に統合。
   左端: 削除・ロック解除（ピル型・30% 透過の薄色背景 + 濃色文字）
   右端: キャンセル・保存（既存 .gs-btn-pill / .gs-btn-primary）
   旧 .danger-section / .danger-btn / .unlock-btn（全幅・フルカラー）は撤去済み。
   #editModal スコープで .modal-actions を flex レイアウトに上書き、
   他モーダル（bulk 等）は既存 .modal-actions の right-align を保つ。 */
#editModal .modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-divider);
}
#editModal .modal-actions .action-spacer { flex: 1; }

.danger-btn-pill,
.unlock-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 9999px;
  border: none;
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--tr);
}
.danger-btn-pill { background: rgba(197, 34, 31, 0.30);  color: #c5221f; }
.unlock-btn-pill { background: rgba(242, 153, 0, 0.30);  color: #8a5500; }
.danger-btn-pill:hover { background: rgba(197, 34, 31, 0.40); }
.unlock-btn-pill:hover { background: rgba(242, 153, 0, 0.40); }

/* 編集モーダル内の「保存」ボタンだけ 30% 透過の水色調に（他画面の .gs-btn-primary には影響させない）。
   .gs-btn-primary の元定義が !important で塗り潰しているため、こちらも !important で上書き。 */
#editModal .modal-actions .gs-btn-primary {
  background: rgba(26, 115, 232, 0.30) !important;
  color: #0b5394 !important;
  box-shadow: none !important;
}
#editModal .modal-actions .gs-btn-primary:hover {
  background: rgba(26, 115, 232, 0.40) !important;
}

/* 確認モーダル（users.html 独自） */
.confirm-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 110;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-overlay.active { display: flex; }
.confirm-box {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: var(--shadow-2);
  max-width: 440px;
  width: 100%;
}
.confirm-title { font-weight: 600; font-size: var(--text-base); margin-bottom: 8px; }
.confirm-body  { font-size: var(--text-sm); color: var(--color-text); margin-bottom: 16px; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 9999px;
  color: #fff;
  background: var(--color-green, #188038);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms;
  z-index: 200;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--color-red, #c5221f); }
.toast.warning { background: var(--color-amber, #f29900); }

/* アクセス権限なしの表示 */
.no-access {
  padding: 60px 20px;
  text-align: center;
  color: var(--color-red, #c5221f);
  font-size: var(--text-base);
}

/* モバイル */
@media (max-width: 900px) {
  .container.gs-page { padding: 16px 12px 32px; }
  .card.gs-panel { padding: 16px; }
  /* v6.16.15: サイドバーは上部折り返し（業務担当者判断 Q5 採用、既存挙動と整合）。
     2 カラム grid → 1 カラム block 化、サイドバー内セクションは横並びに変更。 */
  .users-layout { grid-template-columns: 1fr; gap: 12px; }
  .users-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-divider);
  }
  .users-sidebar .sidebar-section {
    border-bottom: none;
    padding: 8px 0 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 200px;
  }
  .users-sidebar .sidebar-section-title { width: 100%; margin-bottom: 0; }
  .users-sidebar .search-box,
  .users-sidebar .filter-select { flex: 1 1 140px; min-width: 140px; font-size: 12px; padding: 0 22px 0 10px; }
  .users-table { font-size: 12px; }
  .users-table th, .users-table td { padding: 8px 6px; }
  .users-action-row { flex-direction: column; align-items: stretch; }
}

/* v6.15.5: 「ユーザー ID を変更する」リンクボタン + ユーザー ID 変更専用モーダル */
.link-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--color-primary, #1a73e8);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { filter: brightness(1.15); }
#changeUserIdModal #cuiOldUserId {
  background: var(--color-surface-2, #f8fafd);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
}
.cui-warning {
  background: rgba(242, 153, 0, 0.08);
  border: 1px solid rgba(242, 153, 0, 0.30);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text, #202124);
}
.cui-warning-title { font-weight: 600; margin-bottom: 4px; }
.cui-warning ul { margin: 0; padding-left: 20px; }
.cui-warning li { margin: 2px 0; }

/* ==========================================================================
   v6.16.24 Phase 1: 仮スタッフタブ + 仮バッジスタイル
   業務担当者判断 Q3 採用: ユーザー管理ページに「仮スタッフ」タブを追加
   業務担当者判断 Q5 採用: オレンジ系（v6.16.19 配置中アラート色と統一）
   設計知見 #92「水平展開は意図された複製」: syukan.css の .chip-temp-badge と並列定義
   ========================================================================== */
.user-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(60, 64, 67, 0.10);
}
.user-tab {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #5f6368;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 180ms, border-color 180ms;
}
.user-tab:hover {
  color: #1a73e8;
}
.user-tab.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}
.user-tab-count {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  line-height: 1.4;
}
.user-tab[data-user-tab="temporary"] .user-tab-count {
  background: #f59e0b;
}
.user-tab.active[data-user-tab="temporary"] {
  color: #d97706;
  border-bottom-color: #f59e0b;
}

/* 仮スタッフ一覧テーブル内の「仮」バッジ */
.temp-user-badge {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 4px;
  line-height: 1.4;
}
