/* ============================================================
   共通ヘッダー (C案: ハイブリッド型)
   - 全画面で左上=戻る / セクションホーム / タイトルの並びを統一
   - 右上=主要アクション
   - sticky でスクロールしても常に画面内
   ============================================================ */

.app-header {
  background: #1a237e;
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  gap: 12px;
  min-height: 56px;
}

.app-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.app-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 戻る/ホーム共通ボタン */
.app-header__btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}
.app-header__btn:hover { background: rgba(255, 255, 255, 0.22); }
.app-header__btn:active { background: rgba(255, 255, 255, 0.3); }

.app-header__btn--bug {
  width: 36px;
  padding: 0;
  font-size: 18px;
  margin-left: 4px;
}

.app-header__btn--back {
  width: 36px;
  padding: 0;
  font-size: 18px;
}

.app-header__icon { font-size: 16px; line-height: 1; }
.app-header__label { line-height: 1; }

.app-header__divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.app-header__title {
  font-size: 16px;
  font-weight: 700;
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__user {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

/* ヘルプアイコン（タイトル横） */
.app-header__help {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  flex-shrink: 0;
}

/* ============================================================
   セクション別アクセント（🏠ボタンの色）
   ============================================================ */
.app-header--gyomu .app-header__btn--home {
  background: rgba(59, 130, 246, 0.45);
}
.app-header--gyomu .app-header__btn--home:hover {
  background: rgba(59, 130, 246, 0.65);
}

.app-header--bo .app-header__btn--home {
  background: rgba(34, 197, 94, 0.45);
}
.app-header--bo .app-header__btn--home:hover {
  background: rgba(34, 197, 94, 0.65);
}

.app-header--settings .app-header__btn--home {
  background: rgba(168, 85, 247, 0.5);
}
.app-header--settings .app-header__btn--home:hover {
  background: rgba(168, 85, 247, 0.7);
}

/* ============================================================
   右側プライマリアクション（共通スロット）
   ============================================================ */
.app-header__primary-btn {
  background: #f59e0b;
  color: #111827;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-family: inherit;
}
.app-header__primary-btn:hover { background: #f7b035; }

.app-header__secondary-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.app-header__secondary-btn:hover { background: rgba(255, 255, 255, 0.25); }

/* ============================================================
   モバイル対応 (幅狭時はラベル省略してアイコンのみ)
   ============================================================ */
@media (max-width: 600px) {
  .app-header { padding: 8px 10px; gap: 8px; }
  .app-header__title { font-size: 14px; }
  .app-header__btn { padding: 0 10px; height: 34px; font-size: 13px; }
  .app-header__btn--home .app-header__label { display: none; }
  .app-header__btn--home { width: 36px; padding: 0; }
  .app-header__user { display: none; }
  .app-header__divider { display: none; }
}

/* ============================================================
   トップへ戻る FAB（右下、スクロール時のみ表示）
   ============================================================ */
.app-scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #1a237e;
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 600;
  transition: transform 0.15s, background 0.15s;
  font-family: inherit;
}
.app-scroll-top:hover {
  background: #283593;
  transform: translateY(-2px);
}
.app-scroll-top.is-visible { display: inline-flex; }

@media (max-width: 600px) {
  .app-scroll-top { width: 44px; height: 44px; font-size: 20px; bottom: 16px; right: 16px; }
}
