/* ============================================================
   社内ツールUIシェル テンプレートCSS（gd-benri-navi styles.css から抽出・汎用化）
   角丸なし・背景透過・整数px罫線・小さくシャープなコントロールという
   デザイン原則に沿っている。SKILL.md の「デザイン原則」を読んだ上で使うこと。
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   テーマトークン（CSS変数で一元管理する。ここだけ書き換えれば
   ボタン・リンク・ハイライト等の色が全て切り替わる）
   ============================================================ */
:root {
  --brand: #EB6600;        /* 既定は元気でんきオレンジ。アプリごとに変えてよい */
  --brand-hover: #b35a00;  /* hover濃色 */
  --brand-tint: #FBE0CC;   /* 淡色1（バッジ等） */
  --brand-tint-2: #FBE0CC; /* 淡色2（トグルの部分選択状態等） */
  --charcoal: #333333;     /* サイドバー背景・本文色 */
}

body {
  background: #F4F4F1;
  font-family: 'Roboto', 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'Meiryo', sans-serif;
  color: var(--charcoal);
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ============================================================
   アプリ全体レイアウト（サイドバー＋メインコンテンツ）
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

main.app-main {
  flex: 1;
  min-width: 0;
  padding: 0 0 2rem;
}

/* ===== サイドバー本体（nav.js が #app-nav に注入） =====
   position: sticky + height: 100vh でビューポートに固定する（PC）。ページ本体が
   縦に長くなっても、サイドバー自体は常にビューポート内に留まり、footer（利用者名・
   ログアウト等）が画面外へスクロールし去らないようにする。
   モバイル（@media max-width:640px）は position: fixed のオーバーレイに上書きされる。 */
.app-sidebar {
  width: 240px;
  min-width: 240px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--charcoal);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  /* 開閉ボタン（固定位置、top:16px、高さ26px）と垂直中心を合わせるため上端19px */
  padding: 19px 20px 24px;
}

.sidebar-logo svg {
  width: 100px;
  height: auto;
  display: block;
  color: #fff;
}

.sidebar-appname {
  width: 180px;
}

.sidebar-appname svg {
  width: 100%;
  height: auto;
  display: block;
  color: #fff;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

/* 管理者モードのサイドバー見出し（クリック不可のラベル。ミニマル基調） */
.sidebar-section-label {
  padding: 8px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #888;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 0;
  border-left: 3px solid transparent;
  color: #ccc;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(235, 102, 0, 0.18);
  border-left-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-password-link {
  display: block;
  font-size: 12px;
  color: #999;
  text-decoration: none;
  margin-bottom: 8px;
}

.sidebar-password-link:hover {
  color: #fff;
  text-decoration: underline;
}

.sidebar-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #999;
  text-decoration: none;
}

.sidebar-admin-gear {
  display: inline-flex;
  align-items: center;
  font-size: 17px;
  line-height: 1;
}

.sidebar-admin-link:hover {
  color: #fff;
  text-decoration: underline;
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #999;
}

.sidebar-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-row-noname .sidebar-user-name {
  display: none;
}

.sidebar-logout-link {
  color: #999;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-logout-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* ===== ハンバーガー開閉ボタン（nav.js が注入。常時固定表示。完全透過＝背景なし） ===== */
.nav-toggle-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
  width: 26px;
  height: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

/* 3本線は整数px（2px）に統一し、サブピクセルレンダリングでの太さのばらつきを防ぐ。
   小数px（1.5px等）を使うと、ズーム率やディスプレイのDPRによって3本線の太さが
   バラバラに見えることがある。整数pxのルールはこの罫線含め全体で徹底する。 */
.nav-toggle-bar {
  display: block;
  width: 12px;
  height: 2px;
  border-radius: 0;
  background: #333333; /* 既定色（モバイル：閉＝明るいメインコンテンツ上）は濃色 */
  transition: background 0.15s;
}

/* PC: サイドバーは既定で開＝ボタンはダークサイドバー上に重なるため白線。
   折りたたみ時（サイドバー非表示＝明るい背景上）は濃色に切り替える。 */
@media (min-width: 641px) {
  .nav-toggle-bar {
    background: #fff;
  }
  body.sidebar-collapsed .nav-toggle-bar {
    background: #333333;
  }
}

.nav-toggle-btn:hover .nav-toggle-bar {
  background: var(--brand);
}

/* ===== モバイル用backdrop（nav.js が注入。PCでは非表示のまま） ===== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
}

/* PC: サイドバー折りたたみ（幅0へアニメーション） */
body.sidebar-collapsed .app-sidebar {
  width: 0;
  min-width: 0;
}

/* PC・サイドバー折りたたみ時: ハンバーガーボタンがヘッダーバンド帯の上に乗るため、
   タイトル文字の開始位置をボタンの右端より外側まで下げて重ならないようにする */
body.sidebar-collapsed .page-title-band .page-title {
  padding-left: 56px;
}

/* ===== メインコンテンツ最上部のヘッダーバンド（nav.js が #page-title へ
   サイドメニューのactive項目名を注入）。main.app-main の直下・.app の外側に置く
   フルブリード要素。帯自体は全幅に伸ばし、内側の .page-title だけ .app と同じ
   max-width/margin/水平paddingを持たせて、帯の下に続く .app のコンテンツと
   文字の左端を揃える（角丸・影は付けないミニマル方針）。 ===== */
.page-title-band {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

.page-title-band .page-title {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 1.5rem;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============================================================
   共通ボタン（プライマリ・アウトライン系）
   ============================================================ */
.btn-primary {
  height: 38px;
  padding: 0 20px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-primary:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.btn-outline {
  height: 38px;
  padding: 0 20px;
  background: white;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-outline:hover {
  background: var(--brand);
  color: white;
}

/* テキスト入力・パスワード入力の共通スタイル */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"] {
  height: 44px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus {
  border-color: var(--brand);
}

.error-msg {
  color: #d94040;
  font-size: 14px;
  margin-top: 8px;
}

.hidden {
  display: none;
}

/* ============================================================
   一覧テーブル（利用者管理・マスタ管理などの管理画面共通。角丸12px・0.5px罫線）
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 0.5px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 0.5px solid #eee;
  vertical-align: middle;
}

.data-table thead th {
  background: #f5f5f0;
  color: #555;
  font-size: 12px;
  font-weight: 600;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.op-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid #ccc;
  background: white;
  color: #555;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  margin-right: 6px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.op-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.op-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   モーダル（確認ダイアログ・追加/編集ポップアップ共通）
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 13px;
  color: var(--charcoal);
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-error {
  font-size: 12px;
  color: #d94040;
  min-height: 16px;
  margin-bottom: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions .btn-primary,
.modal-actions .btn-outline {
  width: auto;
}

/* フォームラベル（値との視認差をつけるための控えめな見出しスタイル） */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #888;
  margin: 12px 0 4px;
}

.form-label:first-child {
  margin-top: 0;
}

/* ============================================================
   モバイル対応（640px以下）
   ============================================================ */
@media (max-width: 640px) {
  .app {
    padding: 1.5rem 1rem;
  }

  /* サイドバーはオーバーレイ表示（既定は閉＝画面外） */
  .app-layout {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    min-width: 240px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  /* モバイル: サイドバー開時はボタンがダークオーバーレイ上に重なるため白線 */
  body.sidebar-open .nav-toggle-bar {
    background: #fff;
  }

  /* PC由来の sidebar-collapsed クラスが残っていても、モバイルでは
     transform による開閉のみを表示制御に使う（width:0 との競合を断つ） */
  body.sidebar-collapsed .app-sidebar {
    width: 240px;
    min-width: 240px;
  }

  main.app-main {
    padding: 0 0 1.5rem;
  }

  .page-title-band .page-title {
    padding-left: 56px;
  }
}

/* ============================================================
   ジンジナビ独自拡張（Phase 2B）
   意味色トークン・状態バッジ・タブUI・ファイルサムネイルグリッド・簡易ページャ
   デザイン原則を継続: 角丸なし・背景透過・整数px罫線・小さくシャープ
   ============================================================ */
:root {
  --danger: #C62828;       /* 期限切れ */
  --danger-tint: #FBE9E7;
  --warn: var(--brand);    /* 30日以内 */
  --notice: #8A8A85;       /* 60日以内・未登録 */
}

/* ===== 状態バッジ（1px罫線＋文字色。塗り面積を増やさない。角丸なし） ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid currentColor;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
}

.status-badge.status-danger {
  color: var(--danger);
}

.status-badge.status-warn {
  color: var(--warn);
}

.status-badge.status-notice {
  color: var(--notice);
}

.status-badge.status-ok {
  color: #2E7D32;
}

/* ============================================================
   サマリカード（ダッシュボードの期限切れ/30日以内/60日以内/未登録。
   角丸なし・1px罫線・クリックで明細を絞り込みトグル。
   枠色は status-badge と同じ意味色マッピング＝expired:danger crit:brand warn/missing:notice）
   ============================================================ */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}

.summary-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.summary-card:hover {
  background: #faf8f5;
}

.summary-card.active {
  background: #faf8f5;
  box-shadow: inset 0 0 0 1px currentColor;
}

.summary-card-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #888;
}

.summary-card-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.summary-card[data-bucket="expired"] {
  border-color: var(--danger);
}
.summary-card[data-bucket="expired"] .summary-card-value {
  color: var(--danger);
}

.summary-card[data-bucket="crit"] {
  border-color: var(--warn);
}
.summary-card[data-bucket="crit"] .summary-card-value {
  color: var(--warn);
}

.summary-card[data-bucket="warn"],
.summary-card[data-bucket="missing"] {
  border-color: var(--notice);
}
.summary-card[data-bucket="warn"] .summary-card-value,
.summary-card[data-bucket="missing"] .summary-card-value {
  color: var(--notice);
}

/* ============================================================
   タブUI（従業員詳細の3タブ等。角丸なし・下線でactive表現）
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 1.25rem;
}

.tab-item {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #777;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-item:hover {
  color: var(--charcoal);
}

.tab-item.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ============================================================
   ファイルサムネイルグリッド（証書添付・応募者添付。角丸なし・薄枠）
   ============================================================ */
.file-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.file-thumb {
  border: 1px solid #ddd;
  border-radius: 0;
  background: white;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #555;
}

.file-thumb-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5f5f0;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #aaa;
  font-size: 11px;
}

.file-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   簡易ページャ（一覧テーブル下部）
   ============================================================ */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 1rem;
  font-size: 13px;
  color: #777;
}

.pager-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border: 1px solid #ccc;
  border-radius: 0;
  background: white;
  color: #555;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.pager-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.pager-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pager-status {
  margin: 0 6px;
}

/* ============================================================
   フィルタバー（証書・期限一覧など、種別/状態セレクト＋トグル共通。
   角丸なし・小さくシャープ。admin.html の ua-filter-* は未整備のため
   新規に汎用クラスとして定義する）
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 1rem;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #888;
}

.filter-select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 0;
  background: white;
  color: var(--charcoal);
  font-size: 13px;
  font-family: inherit;
  min-width: 160px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--brand);
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  font-size: 13px;
  color: var(--charcoal);
  cursor: pointer;
}

.filter-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* クリックで詳細へ遷移する一覧行 */
.data-table tbody tr.row-clickable {
  cursor: pointer;
}

.data-table tbody tr.row-clickable:hover {
  background: #faf6f2;
}

/* ============================================================
   利用者管理・チーム管理画面（admin.html / team-admin.html）
   gd-benri-navi styles.css からの移植分。
   admin-page.js / team-admin-page.js / user-admin.js / team-admin.js /
   admin.js が参照する .gear-* / .dm-* / .ua-* / .ta-* / .pt-modal系クラス。
   角丸・影は移植元の値をそのまま踏襲する（実リポで確立済みの意匠のため）。
   ============================================================ */

/* 管理者ゲート（未ログイン案内）・管理者ログインフォーム */
.admin-gate {
  background: white;
  border: 0.5px solid #ddd;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  max-width: 420px;
  margin: 2rem auto;
  text-align: center;
}

.admin-gate-msg {
  font-size: 15px;
  color: #555;
  margin-bottom: 1.25rem;
}

.admin-login-input {
  width: 100%;
  height: 40px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 12px;
}

.admin-login-input:focus {
  border-color: var(--brand);
}

.admin-login-btn {
  width: 100%;
}

.admin-login-error {
  font-size: 12px;
  color: #d94040;
  min-height: 14px;
  margin-top: 10px;
}

/* 汎用ボタン・エラー表示（追加/CSV一括登録ボタン、一覧のエラー行） */
.gear-item {
  width: 100%;
  height: 38px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.gear-item:hover {
  background: var(--brand-hover);
}

.gear-item:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.gear-error {
  font-size: 12px;
  color: #d94040;
  min-height: 14px;
}

/* 一覧テーブル本体（利用者管理・チーム管理共通の .dm-table 意匠） */
.dm-input {
  height: 38px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}

.dm-input:focus {
  border-color: var(--brand);
}

.dm-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 0.5px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.dm-table th,
.dm-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 0.5px solid #eee;
  vertical-align: middle;
}

.dm-table thead th {
  background: #f5f5f0;
  color: #555;
  font-size: 12px;
  font-weight: 600;
}

.dm-table tbody tr:last-child td {
  border-bottom: none;
}

.dm-th-ops {
  width: 220px;
}

.dm-cell-ops {
  white-space: nowrap;
}

.dm-op-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid #ccc;
  background: white;
  color: #555;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  margin-right: 6px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.dm-op-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.dm-op-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dm-save-btn {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.dm-save-btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: white;
}

.dm-del-btn:hover {
  border-color: #d94040;
  color: #d94040;
}

.dm-row-error {
  font-size: 12px;
  color: #d94040;
  margin-top: 4px;
  white-space: normal;
}

/* 有効/無効トグル */
.dm-active-btn {
  height: 28px;
  min-width: 52px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1.5px solid #ccc;
  background: #f5f5f5;
  color: #999;
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.dm-active-btn.on {
  background: var(--brand-tint);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.dm-active-btn:hover {
  opacity: 0.8;
}
.dm-th-active {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}
.dm-cell-active {
  text-align: center;
  white-space: nowrap;
}

/* 該当データなし表示（一覧が空のとき） */
.no-results {
  font-size: 13px;
  color: #999;
  padding: 12px 0;
  text-align: center;
}

/* 利用者管理画面（.dm-table / .gear-* を流用し、追加/編集ポップアップ・
   パスワード設定モーダルのみ最小追加）。一覧は閲覧専用（有効トグル・編集・削除の3操作のみ）。 */
.ua-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ua-add-btn {
  width: auto !important;
  padding: 0 20px;
}

.ua-csv-btn {
  width: auto !important;
  padding: 0 20px;
  margin-right: auto;
}

/* 一覧フィルタ（チーム・ロール・名前/ログインID） */
.ua-filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.ua-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.ua-filter-item.hidden {
  display: none;
}

.ua-filter-item-name {
  flex: 1 1 200px;
  min-width: 160px;
}

.ua-filter-label {
  font-size: 11px;
  color: #888;
}

.ua-filter-select,
.ua-filter-input {
  height: 30px;
  border: 1px solid #ccc;
  border-radius: 0;
  padding: 0 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 0.15s;
}

.ua-filter-input {
  width: 100%;
}

.ua-filter-select:focus,
.ua-filter-input:focus {
  border-color: var(--brand);
}

.ua-th-perm-col {
  width: 140px;
  text-align: left;
}

.ua-perm-summary-cell {
  text-align: left;
  color: #555;
}

/* 追加/編集ポップアップ内の縦並びチェックリスト */
.ua-perm-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 14px;
  max-height: 240px;
  overflow-y: auto;
}

.ua-perm-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

.ua-perm-list-row.hidden {
  display: none;
}

.ua-perm-list-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.ua-table-wrap {
  overflow-x: auto;
  border: 0.5px solid #ddd;
  border-radius: 12px;
}

/* 一覧ページャ */
.ua-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.ua-pager-count {
  font-size: 12px;
  color: #888;
}

.ua-pager-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ua-pager-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #ccc;
  border-radius: 0;
  background: white;
  color: #555;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ua-pager-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.ua-pager-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ua-pager-page.active:disabled {
  opacity: 1;
}

.ua-pager-page.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  font-weight: 600;
  cursor: default;
}

.ua-pager-ellipsis {
  padding: 0 4px;
  color: #999;
  font-size: 12px;
}

.ua-table-wrap .dm-table {
  border: none;
  border-radius: 0;
}

.ua-table th,
.ua-table td {
  text-align: center;
  white-space: nowrap;
}

.ua-table .dm-cell-name,
.ua-table td:nth-child(2),
.ua-table td:nth-child(3),
.ua-table td:nth-child(4) {
  text-align: left;
}

.ua-th-team {
  width: 120px;
}

.ua-th-role {
  width: 110px;
  text-align: left;
}

.ua-role-cell {
  text-align: left;
  color: #555;
}

.ua-th-password {
  width: 140px;
}

.ua-password-cell {
  text-align: left;
}

.ua-password-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ua-password-status {
  font-size: 12px;
  white-space: nowrap;
}

.ua-password-status.ua-password-set {
  color: var(--brand);
}

.ua-password-status.ua-password-unset {
  color: #999;
}

.ua-password-mustchange {
  font-size: 11px;
  color: var(--brand);
  white-space: nowrap;
}

.ua-self-tag {
  font-size: 11px;
  color: #999;
  margin-left: 4px;
  white-space: nowrap;
}

.ua-generated-note {
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}

/* 利用者の詳細/追加/編集ポップアップ（.pt-modal系を流用。項目数が多いため少し幅広にする） */
.ua-user-modal {
  max-width: 420px;
}

.ua-form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #888;
  margin: 12px 0 4px;
}

.ua-form-label:first-child {
  margin-top: 0;
}

.ua-modal-password-row {
  margin-bottom: 8px;
}

.ua-detail-row {
  padding: 10px 0;
  border-top: 1px solid #eee;
}

.pt-modal-title + .ua-detail-row {
  padding-top: 0;
  border-top: none;
}

.ua-detail-row .ua-form-label {
  margin: 0 0 4px;
}

.ua-detail-value {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  word-break: break-word;
}

.ua-detail-perm-list {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  line-height: 1.6;
}

/* チーム管理画面（team-admin.html。.dm-table / .gear-* を流用） */
.ta-th-count {
  width: 100px;
  text-align: center;
}

.ta-th-perm {
  width: 90px;
  text-align: center;
}

.ta-perm-summary-cell {
  text-align: center;
  color: #555;
}

.ta-allow-modal-note {
  font-size: 12px;
  color: #777;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* 招待文モーダル（利用者add・setPassword共通） */
.ua-invite-modal {
  max-width: 400px;
}

.ua-invite-text {
  width: 100%;
  min-height: 160px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  color: #333;
  resize: vertical;
  margin-bottom: 8px;
}

.ua-invite-copy-status {
  font-size: 12px;
  color: var(--brand);
  min-height: 16px;
  margin-bottom: 4px;
}

/* CSV一括登録モーダル（選択→プレビュー→登録中→完了の4ステップを同一.pt-modal内で差し替え） */
.ua-csv-modal {
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
}

.ua-csv-step {
  margin-bottom: 14px;
}

.ua-csv-file-input {
  display: block;
  width: 100%;
  font-size: 13px;
  margin-bottom: 8px;
}

.ua-csv-table-wrap {
  overflow: auto;
  max-height: 320px;
  border: 0.5px solid #ddd;
  border-radius: 10px;
  margin-bottom: 10px;
}

.ua-csv-table-wrap .dm-table {
  border: none;
  border-radius: 0;
}

.ua-csv-table th,
.ua-csv-table td {
  font-size: 12px;
  white-space: nowrap;
}

.ua-csv-result-cell {
  white-space: normal;
  min-width: 160px;
}

.ua-csv-row-error {
  background: #fdf1f1;
}

.ua-csv-row-error td {
  color: #d94040;
}

.ua-csv-summary {
  font-size: 13px;
  color: #555;
  margin-bottom: 10px;
}

.ua-csv-progress {
  font-size: 14px;
  color: #555;
  margin: 20px 0;
}

/* 汎用モーダル・ボタン（.pt-modal系。利用者管理・チーム管理の各種ポップアップの土台） */
.pt-btn-primary {
  height: 38px;
  padding: 0 20px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.pt-btn-primary:hover {
  background: var(--brand-hover);
}

.pt-btn-primary:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.pt-btn-bulk {
  height: 38px;
  padding: 0 20px;
  background: white;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pt-btn-bulk:hover {
  background: var(--brand);
  color: white;
}

.pt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.pt-modal {
  background: white;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.pt-modal-title {
  font-size: 13px;
  color: #333333;
  line-height: 1.5;
  margin-bottom: 14px;
}

.pt-modal-input {
  width: 100%;
  height: 40px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 8px;
}

.pt-modal-input:focus {
  border-color: var(--brand);
}

.pt-modal-input:disabled {
  background: #f5f5f5;
}

.pt-modal-error {
  font-size: 12px;
  color: #d94040;
  min-height: 16px;
  margin-bottom: 8px;
}

.pt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pt-modal-actions .pt-btn-primary,
.pt-modal-actions .pt-btn-bulk {
  width: auto;
}
