/* ================================================
   spsv サポートサービス – メインスタイルシート
   カラーテーマ: 落ち着いたグリーン
   ================================================ */

/* ===== CSS カスタムプロパティ ===== */
:root {
  --color-primary:        #2D8653;
  --color-primary-dark:   #1B5E35;
  --color-primary-light:  #43A573;
  --color-primary-bg:     #E8F5EE;
  --color-primary-bg-lt:  #F5FAF7;

  --color-white:   #ffffff;
  --color-text:    #1A2B22;
  --color-muted:   #4A6458;
  --color-border:  #C5DDD2;

  --color-error:      #C62828;
  --color-error-bg:   #FFEBEE;
  --color-success:    #2D8653;
  --color-success-bg: #E8F5EE;
  --color-warning:    #E65100;
  --color-warning-bg: #FFF3E0;
  --color-info:       #1565C0;
  --color-info-bg:    #E3F2FD;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 18px rgba(45,134,83,0.12);
  --shadow-lg: 0 8px 32px rgba(45,134,83,0.16);

  --radius-sm: 6px;
  --radius-md: 12px;

  --transition: 0.2s ease;

  --font: 'Segoe UI', 'Hiragino Sans', 'Meiryo', 'Yu Gothic', sans-serif;
}

/* ===== リセット & ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-primary-bg-lt);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

/* ===== レイアウト ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

main { flex: 1; padding: 2rem 0; }

/* ===== 開発中バナー ===== */
.dev-banner {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.4px;
}
.dev-banner .badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 1px 9px;
  margin-right: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  vertical-align: middle;
}

/* ===== ヘッダー ===== */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 0.85rem 0;
  box-shadow: var(--shadow-sm);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo-link { display: inline-flex; align-items: center; }
.logo-link:hover { opacity: 0.88; text-decoration: none; }

.nav-links { display: flex; gap: 0.75rem; align-items: center; }

/* ===== フッター ===== */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 1.4rem 1rem;
  font-size: 0.82rem;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,0.85); }

/* ===== ヒーロー（作成中ページ） ===== */
.hero-section { text-align: center; padding: 5rem 1.5rem; }
.hero-logo { margin-bottom: 2.5rem; }

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--color-muted);
  margin: 0 auto 2.5rem;
  max-width: 500px;
  line-height: 1.8;
}

/* プログレスバー */
.hero-progress { max-width: 380px; margin: 0 auto 2.5rem; }
.progress-track {
  background: var(--color-border);
  border-radius: 8px;
  height: 7px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.progress-fill {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
  border-radius: 8px;
  animation: pulse-bar 2s ease-in-out infinite;
}
@keyframes pulse-bar { 0%,100%{opacity:1} 50%{opacity:.65} }
.progress-label { font-size: 0.78rem; color: var(--color-muted); text-align: right; }

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

/* フィーチャーグリッド */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 3rem 0 2rem;
}
.feature-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  text-align: center;
  transition: box-shadow var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.feature-title { font-size: 0.95rem; font-weight: 700; color: var(--color-text); margin-bottom: 0.4rem; }
.feature-desc { font-size: 0.85rem; color: var(--color-muted); }

/* ===== カード ===== */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.card-header {
  background: var(--color-primary-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1.75rem 2rem 1.5rem;
  text-align: center;
}
.card-header .logo-wrap { margin-bottom: 1rem; }
.card-header h1 { font-size: 1.35rem; font-weight: 700; color: var(--color-text); margin-bottom: 0.25rem; }
.card-header p  { font-size: 0.88rem; color: var(--color-muted); }
.card-body { padding: 2rem; }

/* 認証カードコンテナ */
.auth-wrap { max-width: 460px; margin: 2rem auto; padding: 0 1rem; }

/* ===== フォーム ===== */
.form-group { margin-bottom: 1.4rem; }

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}
.form-label .req { color: var(--color-error); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.68rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45,134,83,0.13);
}
.form-control::placeholder { color: #adbdb6; }
.form-control.is-invalid { border-color: var(--color-error); }

.form-hint  { font-size: 0.78rem; color: var(--color-muted); margin-top: 0.28rem; }
.field-error { font-size: 0.78rem; color: var(--color-error); margin-top: 0.28rem; }

/* パスワードラッパー */
.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--color-muted); padding: 0.2rem; font-size: 1rem;
  display: flex; align-items: center; line-height: 1;
}
.pw-toggle:hover { color: var(--color-primary); }

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.7rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--color-primary); color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark); border-color: var(--color-primary-dark);
  color: #fff; text-decoration: none; box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent; color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--color-primary-bg); text-decoration: none;
}

.btn-ghost {
  background: transparent; color: var(--color-muted); border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-primary-bg); color: var(--color-text); text-decoration: none;
}

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.88rem; }
.btn-lg { padding: 0.9rem 2.1rem; font-size: 1.05rem; }

/* ===== アラート ===== */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.alert-success { background: var(--color-success-bg); border-color: var(--color-success); color: #1B5E35; }
.alert-error,
.alert-danger  { background: var(--color-error-bg);   border-color: var(--color-error);   color: var(--color-error); }
.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning); color: var(--color-warning); }
.alert-info    { background: var(--color-info-bg);    border-color: var(--color-info);    color: var(--color-info); }

/* ===== 区切り線 ===== */
.divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.4rem 0; color: var(--color-muted); font-size: 0.82rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

/* ===== フォームリンク ===== */
.form-links { text-align: center; font-size: 0.88rem; color: var(--color-muted); margin-top: 1.4rem; }
.form-links a { color: var(--color-primary); font-weight: 600; }

/* ===== タブ（ログイン） ===== */
.tabs { display: flex; border-bottom: 2px solid var(--color-border); margin-bottom: 1.5rem; }
.tab-btn {
  flex: 1; padding: 0.75rem 1rem;
  background: none; border: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; cursor: pointer;
  font-size: 0.92rem; font-family: inherit; font-weight: 600;
  color: var(--color-muted); transition: all var(--transition);
}
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-btn:hover:not(.active) { background: var(--color-primary-bg); color: var(--color-text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== ダッシュボード ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.sidebar {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.sidebar-head {
  background: var(--color-primary-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
}
.sidebar-head .user-name { font-weight: 700; font-size: 0.95rem; color: var(--color-text); margin-top:.3rem; }
.sidebar-head .user-email { font-size: 0.78rem; color: var(--color-muted); margin-top: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.8rem 1.25rem;
  color: var(--color-text); font-size: 0.92rem;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--color-primary-bg); color: var(--color-primary);
  border-left-color: var(--color-primary); text-decoration: none;
}

/* ロールバッジ */
.role-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; letter-spacing: .5px; margin-bottom:.3rem;
}
.role-admin { background: #C62828; color: #fff; }
.role-staff { background: #1565C0; color: #fff; }

/* ダッシュボードサマリーカード */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dash-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1rem;
  text-align: center;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
}
.dash-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.dash-card-urgent { border-top: 3px solid var(--color-error); }
.dash-card-critical { border-top: 3px solid #C62828; }
.dash-card-num {
  font-size: 2rem; font-weight: 800; line-height: 1; color: var(--color-primary);
}
.dash-card-urgent .dash-card-num  { color: var(--color-error); }
.dash-card-critical .dash-card-num { color: #C62828; }
.dash-card-label { font-size: .78rem; color: var(--color-muted); font-weight: 600; }

/* ダッシュボード機能ボタングリッド */
.dash-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}
.dash-btn {
  display: flex; align-items: center; gap: .55rem;
  padding: .75rem 1rem;
  background: var(--color-primary-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: .9rem; font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}
.dash-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); text-decoration: none; }
.dash-btn-alert { border-left: 3px solid var(--color-error); }
.dash-btn-alert:hover { background: var(--color-error); border-color: var(--color-error); }

/* コンテンツカード */
.content-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}
.content-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--color-text); }

/* スピナー */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: white;
  border-radius: 50%; animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== お問い合わせフォーム ===== */
.inquiry-wrap { max-width: 760px; margin: 1.5rem auto; padding: 0 1rem; }

/* ステップインジケーター */
.step-indicator {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin: 1.5rem auto 2rem; max-width: 400px;
}
.step {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; font-size: 0.78rem; font-weight: 600; color: var(--color-muted);
}
.step span {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-border); color: var(--color-muted);
  font-size: 0.85rem; font-weight: 700;
}
.step.active span { background: var(--color-primary); color: #fff; }
.step.done  span  { background: var(--color-primary-light); color: #fff; }
.step.active { color: var(--color-primary); }
.step-line {
  flex: 1; height: 2px; background: var(--color-border);
  margin: 0 4px; margin-bottom: 20px; min-width: 32px;
}
.step-line.done { background: var(--color-primary-light); }

/* FAQバナー */
.faq-banner {
  background: var(--color-info-bg);
  border: 1px solid #BBDEFB;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  margin: 0 auto 1.5rem;
  max-width: 760px;
}
.faq-banner a { font-weight: 700; }

/* セクション区切り */
.inquiry-section {
  border-top: 2px solid var(--color-primary-bg);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}
.inquiry-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.section-title {
  font-size: 1rem; font-weight: 700;
  color: var(--color-primary); margin-bottom: 1.1rem;
}

/* 2カラムレイアウト */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* チェックボックスラベル */
.checkbox-label {
  display: flex; align-items: flex-start; gap: 0.6rem;
  cursor: pointer; font-size: 0.92rem;
}
.checkbox-label input[type="checkbox"] {
  margin-top: 2px; width: 16px; height: 16px;
  accent-color: var(--color-primary); flex-shrink: 0;
}
.checkbox-label.is-invalid { color: var(--color-error); }

/* 送信ボタン */
.form-actions {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ファイルアップロード */
.file-upload-area { position: relative; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 1.2rem;
  border: 2px dashed var(--color-border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition); text-align: center;
  background: var(--color-primary-bg-lt);
}
.file-upload-area:hover .file-label,
.file-input:focus + .file-label {
  border-color: var(--color-primary); background: var(--color-primary-bg);
}
.file-upload-area.is-dragover .file-label {
  border-color: #1565C0;
  background: #E3F2FD;
}
.file-icon { font-size: 1.5rem; }
.file-text { font-size: 0.9rem; font-weight: 600; color: var(--color-text); }
.file-hint { font-size: 0.75rem; color: var(--color-muted); }

/* 管理画面: 対応履歴 添付 */
.note-attachment-card {
  width: 168px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.note-image-thumb-btn {
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: #f7f7f7;
  cursor: zoom-in;
  display: block;
}
.note-image-thumb {
  display: block;
  width: 100%;
  height: 108px;
  object-fit: cover;
}
.note-file-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 108px;
  background: #D32F2F;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.note-attachment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem;
}
.note-attachment-name {
  font-size: 0.76rem;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.note-attachment-pdf-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  background: #fff;
  min-width: 260px;
  max-width: 460px;
}
.note-attachment-deleted {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px dashed #B0BEC5;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  color: #607D8B;
  background: #F5F7F9;
  font-size: 0.82rem;
}
.note-attachment-edit-list {
  display: grid;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}
.note-attachment-edit-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: #37474F;
}
.note-attachment-edit-item.is-deleted {
  color: #90A4AE;
}
.note-attachment-edit-item em {
  font-style: normal;
  color: #78909C;
}

.note-type-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
  max-width: 760px;
}
.note-type-picker .js-note-type-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0.62rem 0.75rem;
  font-weight: 600;
  background: #fff;
  color: #546E7A;
  border: 1px solid #CFD8DC;
}
.note-type-picker .js-note-type-btn.is-active {
  border-color: #1565C0;
  background: #E3F2FD;
  color: #0D47A1;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #90CAF9;
}
.reply-template-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.reply-template-picker .js-reply-template-btn.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
  color: var(--color-primary-dark);
  font-weight: 700;
}
@media (max-width: 760px) {
  .note-type-picker {
    grid-template-columns: 1fr;
  }
}

/* 確認画面テーブル */
.confirm-section { margin-bottom: 1.5rem; }
.confirm-section:last-of-type { margin-bottom: 0; }
.confirm-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.confirm-table th,
.confirm-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left; vertical-align: top;
}
.confirm-table th {
  width: 35%; background: var(--color-primary-bg);
  font-weight: 600; color: var(--color-text); white-space: nowrap;
}
.confirm-table td { color: var(--color-text); }
.preserve-nl { white-space: pre-wrap; word-break: break-word; }

/* 緊急度バッジ */
.urgency-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  color: #fff; font-size: 0.82rem; font-weight: 700;
}

/* 完了画面 問い合わせ番号 */
.inquiry-no-box {
  background: var(--color-primary-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 1rem; margin: 1.25rem 0;
}
.inquiry-no {
  font-size: 1.4rem; font-weight: 800; letter-spacing: 2px;
  color: var(--color-primary); margin-top: 4px;
}

/* ===== ユーティリティ ===== */
.text-center { text-align: center; }
.text-muted  { color: var(--color-muted); }
.text-sm     { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ===== Admin 共通テーブル・レイアウト ===== */
.admin-wrap { max-width: 1200px; margin: 0 auto; }
.admin-page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.admin-page-head h1 { font-size: 1.4rem; font-weight: 800; }
.admin-page-head-actions { display: flex; gap: .5rem; align-items: center; }

/* タブ */
.admin-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--color-border); margin-bottom: 1rem; }
.admin-tab {
  padding: .55rem 1.1rem; font-size: .88rem; font-weight: 600;
  color: var(--color-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition);
}
.admin-tab:hover { color: var(--color-primary); text-decoration: none; }
.admin-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* フィルターバー */
.admin-filter-bar {
  display: flex; gap: .5rem; align-items: center;
  flex-wrap: wrap; margin-bottom: 1rem;
}

/* テーブル */
.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--color-white); font-size: .88rem;
}
.admin-table th {
  background: var(--color-primary-bg); color: var(--color-text);
  font-weight: 700; padding: .65rem .9rem;
  border-bottom: 2px solid var(--color-border); white-space: nowrap; text-align: left;
}
.admin-table td {
  padding: .65rem .9rem; border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--color-primary-bg); }
.admin-table tr.row-inactive td { opacity: .5; }

/* テーブル行アクション */
.admin-row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.btn-xs {
  padding: .25rem .65rem; font-size: .78rem; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-danger-ghost { color: var(--color-error) !important; border-color: var(--color-error) !important; }
.btn-danger-ghost:hover { background: var(--color-error) !important; color: #fff !important; }

/* バッジ */
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
}
.badge-ok   { background: #E8F5E9; color: #2D8653; }
.badge-warn { background: #FFF8E1; color: #E65100; }
.badge-off  { background: #F5F5F5; color: #757575; }

/* ページネーション */
.pagination { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1.25rem; }
.page-btn {
  padding: .45rem .75rem; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); color: var(--color-text);
  font-size: .85rem; font-weight: 600; text-decoration: none;
  transition: all var(--transition);
}
.page-btn:hover  { background: var(--color-primary-bg); border-color: var(--color-primary); text-decoration: none; }
.page-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ===== ユーザー管理専用スタイル ===== */

/* ページヘッダー */
.users-page-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem;
}
.users-page-head-left  { display: flex; align-items: center; gap: .75rem; }
.users-page-head-right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.users-page-title     { font-size: 1.4rem; font-weight: 800; }
.users-total-badge {
  background: var(--color-primary-bg); color: var(--color-primary);
  font-size: .78rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; border: 1px solid var(--color-border);
}

/* 検索バー */
.users-search-form  { display: flex; align-items: center; gap: .5rem; }
.users-search-inner {
  position: relative; display: flex; align-items: center;
}
.users-search-icon  {
  position: absolute; left: .7rem; font-size: .9rem; pointer-events: none; opacity: .55;
}
.users-search-input {
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: .45rem .75rem .45rem 2.1rem;
  font-size: .88rem; width: 240px;
  background: var(--color-white); color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.users-search-input:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45,134,83,.12);
}
.users-search-clear {
  position: absolute; right: .6rem; font-size: .75rem; color: var(--color-muted);
  line-height: 1; text-decoration: none;
}
.users-search-clear:hover { color: var(--color-error); }

/* タブ */
.users-tabs {
  display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.users-tab {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 30px;
  border: 1.5px solid var(--color-border);
  font-size: .85rem; font-weight: 600; color: var(--color-muted);
  text-decoration: none; transition: all var(--transition);
  background: var(--color-white);
}
.users-tab:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.users-tab.active {
  background: var(--color-primary); border-color: var(--color-primary);
  color: #fff;
}
.users-tab-icon  { font-size: .95rem; }
.users-tab-count {
  background: rgba(0,0,0,.08); border-radius: 20px;
  padding: 1px 7px; font-size: .72rem; font-weight: 700;
  min-width: 20px; text-align: center;
}
.users-tab.active .users-tab-count { background: rgba(255,255,255,.25); }

/* 空状態 */
.users-empty {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 3rem; text-align: center;
}
.users-empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.users-empty-text { color: var(--color-muted); font-size: .95rem; }

/* テーブルラッパー */
.users-table-wrap {
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 2px solid #BFD4C8;
  background: var(--color-white);
}
.users-table {
  width: 100%; border-collapse: collapse;
  background: var(--color-white); font-size: .88rem;
}
.users-table thead th {
  background: #F3F8F5;
  color: var(--color-muted); font-size: .8rem; font-weight: 700;
  letter-spacing: 0;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap; text-align: left;
}
.users-table tbody tr { transition: background var(--transition); }
.users-table tbody tr:nth-child(even) td { background: #FCFDFC; }
.users-table tbody tr:hover td { background: #F4FAF6; }
.users-table tbody td {
  padding: .95rem 1rem; border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.users-table thead th + th,
.users-table tbody td + td {
  border-left: 1px solid #E1ECE5;
}
.users-table tbody tr:last-child td { border-bottom: none; }
.users-row-off td { opacity: .72; }

/* アバター＋氏名セル */
.ut-name-cell  { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.ut-name-wrap  { min-width: 0; }

/* アバター */
.ut-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--role-color, var(--color-primary));
  color: #fff; font-size: .88rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

/* 氏名 */
.ut-name { font-weight: 700; color: var(--color-text); white-space: nowrap; }
.ut-id   { color: var(--color-muted); font-size: .74rem; margin-top: 2px; }
.ut-you  {
  display: inline-block; font-size: .65rem; font-weight: 700;
  background: var(--color-primary); color: #fff;
  padding: 1px 6px; border-radius: 20px;
}
.ut-sub  { color: var(--color-muted); font-size: .83rem; }
.ut-email {
  color: var(--color-text); font-size: .84rem; font-weight: 500;
  word-break: break-word;
}

/* ロールピル */
.ut-role-pill {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  color: #fff; font-size: .75rem; font-weight: 700; white-space: nowrap;
}

/* 状態バッジ（塗りつぶし） */
.ut-status-pill {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.ut-pill-on  { background: #2D8653; color: #fff; }
.ut-pill-off { background: #9E9E9E; color: #fff; }

/* アクション列 */
.ut-actions { display: flex; gap: .4rem; align-items: center; }

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  .hero-title { font-size: 1.5rem; }
  .card-body  { padding: 1.5rem 1.25rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-btn-grid  { grid-template-columns: 1fr 1fr; }
  .form-row       { grid-template-columns: 1fr; }
  .users-page-head  { flex-direction: column; align-items: flex-start; }
  .users-search-input { width: 180px; }
  .users-table thead th:nth-child(3),
  .users-table tbody td:nth-child(3) { display: none; } /* 電話番号非表示 */
}
@media (max-width: 480px) {
  .hero-section  { padding: 3rem 1rem; }
  .btn-lg        { padding: 0.75rem 1.5rem; }
  .auth-wrap     { margin: 1rem auto; }
  .dash-btn-grid { grid-template-columns: 1fr; }
  .dash-cards    { grid-template-columns: 1fr 1fr; }
  .users-search-form { width: 100%; }
  .users-search-inner { flex: 1; width: 100%; }
  .users-search-input { width: 100%; }
  .users-table thead th:nth-child(6),
  .users-table tbody td:nth-child(6) { display: none; } /* 最終ログイン非表示 */
  .ut-actions { flex-direction: column; align-items: stretch; }
}
