/* カスタムスタイル - 既存CSSを上書きせずに追加 */

.tfDate2{
  width: 85px;
}

.p-search-input > dl.no-margin-right {
  margin-right: 0;
}

/* マイページ パスワード変更ボタンの幅調整 */
.c-btn.editS.btn-password {
  width: auto;
  padding-left: 30px;
  padding-right: 15px;
}

/* 材料登録フォーム - エラーメッセージ表示時のレイアウト崩れ防止 */
.combination-bl-fm dl.item dd {
  position: relative;
}

.combination-bl-fm dl.item dd .p-err__fm {
  position: absolute;
  left: 0;
  top: 100%;
  white-space: nowrap;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  z-index: 10;
}

/* エラーメッセージが表示されている行のみ下部に余白を追加 */
/* item__wrapにpadding-bottomを追加してitem__headingのborder-rightが途切れないようにする */
.combination-bl-item.has-error .item__wrap {
  padding-bottom: 25px;
}

/* 材料編集フォーム (テーブルレイアウト) - エラーメッセージ表示時のレイアウト崩れ防止 */
.c-tbl.p-tbl2 td {
  position: relative;
}

.c-tbl.p-tbl2 td .p-err__fm {
  position: absolute;
  left: 10px;
  top: 100%;
  white-space: nowrap;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  z-index: 10;
  transform: translateY(-100%);
}

/* エラーメッセージが表示されている行のみ下部に余白を追加 */
.c-tbl.p-tbl2 tr.has-error td {
  padding-bottom:27px;
}

/* エラーメッセージのアイコンと文言を中央揃え */
.p-err__fm {
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 16px;
}

.p-err__fm::before {
  width: 16px;
  height: 16px;
  font-size: 12px;
  line-height: 16px;
  top: 5px;
}

/* 登録完了メッセージ */
.p-msg--complete {
  text-align: center;
  padding: 30px 20px;
  margin-bottom: 20px;
  background-color: #f0f9f0;
  border: 1px solid #8bc34a;
  border-radius: 4px;
}

.p-msg--complete__title {
  font-size: 18px;
  font-weight: bold;
  color: #4caf50;
  margin-bottom: 10px;
}

.p-msg--complete__text {
  font-size: 14px;
  color: #666;
}

/* アカウント詳細画面 - セクションレイアウト */
.info-section-narrow {
  max-width: calc(100% - 200px);
  margin: 0 auto;
  margin-bottom: 20px;
}

.log-section {
  max-width: calc(100% - 200px);
  margin: 0 auto;
}

/* モーダル内登録フォーム - エラー表示スタイル */

/* フォームをflex-wrapで折り返し可能にする */
.combination__modal .combiDl.modal-register-form {
  flex-wrap: wrap;
}

/* エラーフィールドの赤枠 */
.modal-register-form dd.has-error input,
.modal-register-form dd.has-error select,
.modal-register-form dd.has-error .c-select {
  border-color: #d32f2f;
}

/* モーダル内エラーサマリー */
.modal-error-summary {
  background: #fff5f5;
  border: 1px solid #d32f2f;
  border-radius: 4px;
  padding: 12px 15px;
  margin-bottom: 15px;
  /* flexbox内でフルワイドにして改行させる */
  flex: 0 0 100%;
  width: 100%;
}

.modal-error-summary .error-summary__title {
  color: #d32f2f;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-error-summary .error-summary__title::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #d32f2f;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.modal-error-summary .error-summary__list {
  margin: 0;
  padding-left: 26px;
  list-style: none;
  font-size: 12px;
}

.modal-error-summary .error-summary__list li {
  margin-bottom: 4px;
  color: #d32f2f;
}

.modal-error-summary .error-summary__list li::before {
  content: '・';
}

.modal-error-summary .error-summary__list li:last-child {
  margin-bottom: 0;
}

/* ========================================
   エラーサマリー（パターン4: 上部サマリー + 赤枠）
======================================== */
.error-summary {
  background: #fff5f5;
  border: 1px solid #d32f2f;
  border-radius: 4px;
  padding: 15px 20px;
  margin-top: 15px;
  margin-bottom: 20px;
}

.error-summary__title {
  color: #d32f2f;
  font-weight: bold;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-summary__title::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #d32f2f;
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
}

.error-summary__list {
  margin: 0;
  padding-left: 32px;
  list-style: none;
}

.error-summary__list li {
  margin-bottom: 5px;
  color: #d32f2f;
}

.error-summary__list li::before {
  content: '・';
}

.error-summary__list li:last-child {
  margin-bottom: 0;
}

.error-summary__list a {
  color: #d32f2f;
  text-decoration: underline;
}

.error-summary__list a:hover {
  text-decoration: none;
}

/* エラーフィールドの赤枠（背景色は変更しない） */
.is-invalid,
input.is-invalid,
select.is-invalid {
  border: 2px solid #d32f2f !important;
}

/* ========================================
   ログイン画面エラーメッセージ
======================================== */
.login .p-err__fm {
  margin-top: 5px;
  margin-bottom: 20px;
}

.login input.is-invalid {
  border: 2px solid #d32f2f !important;
}

/* エラーメッセージが表示されている場合、ID入力欄の下余白を調整 */
.login__input:first-child:has(+ .p-err__fm) {
  margin-bottom: 0;
}

/* ========================================
   ページング要素のリンクスタイル
======================================== */
.p-paging a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 最初・前へ・次へ・最後のリンク領域をdiv全体に広げる */
.p-paging .first,
.p-paging .prev,
.p-paging .next,
.p-paging .last {
    padding: 0;
}

.p-paging .first a,
.p-paging .last a {
    padding: 5px 4px;
}

.p-paging .prev a {
    padding: 5px 4px 5px 20px;
}

.p-paging .next a {
    padding: 5px 20px 5px 4px;
}

/* ホバー時の背景色 */
.p-paging .first a:hover,
.p-paging .prev a:hover,
.p-paging .next a:hover,
.p-paging .last a:hover,
.p-paging .num a:hover {
    background-color: #dcdcdc;
}

/* ========================================
   Flashメッセージ
======================================== */
.l-flash {
  max-width: 1080px;
  margin: 10px auto 0;
  padding: 0 20px;
}

.p-flash {
  font-size: 14px;
  font-weight: bold;
  padding: 10px 15px 10px 45px;
  margin-bottom: 10px;
  position: relative;
}

.p-flash::before {
  content: '!';
  width: 25px;
  height: 25px;
  color: #fff;
  font-size: 20px;
  text-align: center;
  border-radius: 50%;
  line-height: 25px;
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.p-flash--info {
  color: #1976d2;
  border: dashed 2px #1976d2;
}

.p-flash--info::before {
  content: 'i';
  background-color: #1976d2;
}

/* ========================================
   詳細画面セクションヘッダー
======================================== */
.p-sec2__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  margin-right: 20px;
}
