/* ユーザ管理画面 CSS */
.internal-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e40af;
  font-size: 0.85rem;
  line-height: 1.4;
}

.user-management-container {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.user-management-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-type-tabs { display: flex; gap: 8px; }

.user-type-tab {
  padding: 8px 16px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}
.user-type-tab:hover { background: #f9fafb; }
.user-type-tab.active { background: #17a2b8; color: #fff; border-color: #17a2b8; }

.header-actions { display: flex; gap: 8px; }

.btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.btn-primary { background: #17a2b8; color: #fff; }
.btn-primary:hover { background: #138496; }
.btn-secondary { background: #fff; border: 1px solid #dadce0; color: #374151; }
.btn-secondary:hover { background: #f9fafb; }

/* 検索バー */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid #f3f4f6;
}
.search-bar svg { width: 16px; height: 16px; color: #9ca3af; flex-shrink: 0; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  color: #374151;
}
.search-bar input::placeholder { color: #d1d5db; }

/* 件数ラベル */
.user-count-label {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: #fafafa;
  border-bottom: 1px solid #f3f4f6;
}

/* テーブル */
.user-table { width: 100%; border-collapse: collapse; }
.user-table th {
  text-align: left;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
}
.user-table td {
  padding: 12px 20px;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.user-table tr:last-child td { border-bottom: none; }
.user-table tbody tr:hover { background: #fafbfc; }

/* ステータスバッジ */
.status { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.status-active { background: #d1fae5; color: #065f46; }
.status-disabled { background: #fee2e2; color: #991b1b; }
.status-admin { background: #dbeafe; color: #1e40af; }
.status-general { background: #f3f4f6; color: #6b7280; }
.row-admin { background: #eff6ff; }

/* 社員: 管理者権限トグルボタン */
.btn-toggle-admin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-toggle-admin svg { width: 14px; height: 14px; }
.btn-toggle-admin:hover { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.btn-toggle-admin.is-admin { border-color: #fca5a5; color: #dc2626; }
.btn-toggle-admin.is-admin:hover { background: #fef2f2; }

/* 外部技術者: 操作アイコン */
.actions { display: flex; gap: 4px; }
.icon-btn {
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: #9ca3af;
  border-radius: 4px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: #f3f4f6; color: #374151; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn-admin { color: #2563eb; background: #eff6ff; }
.icon-btn-admin:hover { background: #dbeafe; color: #1d4ed8; }
.icon-btn-general { color: #9ca3af; }
.icon-btn-general:hover { background: #eff6ff; color: #2563eb; }

/* モーダル */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: umFadeIn 0.15s ease-out;
}
@keyframes umFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 94%;
  max-width: 900px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: umScaleIn 0.2s ease-out;
}
@keyframes umScaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.modal-header { padding: 20px 24px; border-bottom: 1px solid #e5e7eb; }
.modal-header h2 { font-size: 16px; font-weight: 700; color: #1f2937; }
.modal-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 8px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-group label .required { color: #ef4444; }
.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #dadce0;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: #17a2b8; box-shadow: 0 0 0 2px rgba(23,162,184,0.15); }
.form-group input:disabled { background: #f9fafb; color: #9ca3af; }
.form-group .hint { font-size: 11px; color: #9ca3af; margin-top: 4px; }

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
  margin-top: 12px;
}
.form-actions .btn-reset {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.form-actions .btn-reset:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.form-actions .btn-reset svg { width: 14px; height: 14px; }

/* CSVプレビューモーダル - B2改デザイン */
.csv-modal { max-width: 960px; }
.csv-modal-header { background: #1f2937; display: flex; align-items: center; gap: 10px; }
.csv-modal-header h2 { color: white; font-size: 15px; font-weight: 600; }
.csv-modal-header svg { color: #9ca3af; }

.csv-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.csv-summary-card { padding: 12px 14px; border-radius: 10px; display: flex; align-items: center; gap: 10px; }
.csv-summary-card .sc-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.csv-summary-card .sc-icon svg { width: 18px; height: 18px; }
.csv-summary-card .sc-num { font-size: 20px; font-weight: 700; line-height: 1.1; }
.csv-summary-card .sc-label { font-size: 11px; font-weight: 500; opacity: 0.8; }
.sc-new { background: #ecfdf5; color: #065f46; }
.sc-new .sc-icon { background: #a7f3d0; color: #065f46; }
.sc-update { background: #eff6ff; color: #1e40af; }
.sc-update .sc-icon { background: #bfdbfe; color: #1e40af; }
.sc-disable { background: #fef3c7; color: #92400e; }
.sc-disable .sc-icon { background: #fcd34d; color: #92400e; }
.sc-skip { background: #f3f4f6; color: #6b7280; }
.sc-skip .sc-icon { background: #d1d5db; color: #6b7280; }

.csv-tabs { display: flex; gap: 4px; background: #f3f4f6; border-radius: 10px; padding: 4px; margin-bottom: 0; }
.csv-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; font-size: 12px; font-weight: 600; color: #6b7280; cursor: pointer; border-radius: 7px; transition: all 0.15s; }
.csv-tab svg { width: 14px; height: 14px; }
.csv-tab:hover { color: #374151; background: #e5e7eb; }
.csv-tab.csv-tab-on { color: #1f2937; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.csv-tab .csv-tab-cnt { font-size: 11px; opacity: 0.6; }

.csv-tab-content { display: none; }
.csv-tab-active { display: block; }

.csv-table-wrap { max-height: 320px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 10px; margin-top: 12px; }
.csv-preview-table td { padding: 9px 12px; font-size: 13px; }
.csv-preview-table th { padding: 9px 12px; position: sticky; top: 0; z-index: 1; }

.csv-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.csv-badge svg { width: 12px; height: 12px; }
.csv-badge-new { background: #ecfdf5; color: #065f46; }
.csv-badge-update { background: #eff6ff; color: #1e40af; }
.csv-badge-disable { background: #fef3c7; color: #92400e; }
.csv-badge-error { background: #fef2f2; color: #991b1b; }

.csv-empty { text-align: center; padding: 40px; color: #9ca3af; font-size: 13px; }
.csv-empty svg { width: 32px; height: 32px; margin-bottom: 8px; opacity: 0.4; display: block; margin: 0 auto 8px; }

/* 進捗バー */
.csv-progress-wrap { padding: 20px 0; }
.csv-progress-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 8px; text-align: center; }
.csv-progress-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.csv-progress-fill { height: 100%; background: #2563eb; border-radius: 4px; transition: width 0.2s; width: 0; }

/* 結果表示 */
.csv-result-msg { font-size: 14px; margin-bottom: 10px; }
.csv-error-list { max-height: 200px; overflow-y: auto; }
.csv-error-item { font-size: 12px; color: #991b1b; padding: 4px 0; border-bottom: 1px solid #fecaca; }
