﻿/* カスタムプロパティ ------------------------------- */
/* ViewData["AccentClass"] に "accent-admin" を設定することで上書き */
:root {
  --main-theme-color: #00b0f0;  /* 水色 */
  --main-btn-color: #2e75b6     /* 藍色 */
}

.accent-admin {
  --main-theme-color: #3dcf90;  /* 薄緑色 */
  --main-btn-color: #12a35b;    /* 深緑色 */
}
/* -------------------------------------------------- */

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
}

a.menu-link {
  color: white;
  font-weight: bold;
  font-size: 18px;
  display: block;
  text-decoration: none; /* 下線を消す */
}

/* カスタムボタン ----------------------------------- */
.btn {
  font-weight: bold;
  align-content: center;
  padding: 0.2rem 1rem;
  min-width: 80px;
}

  /* 押下不可状態のボタンの見た目 */
  .btn.disabled, .btn:disabled, fieldset:disabled .btn {
    opacity: .2;
  }

  .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
  }

.btn-primary-custom {
  color: #ffffff;
  background-color: var(--main-btn-color); /* 藍色 */
  border: 2px solid var(--main-btn-color);
}

  .btn-primary-custom:hover {
    color: #cccccc;
    filter: brightness(1.2);
  }

.btn-primary-accent-custom {
  color: #ffffff;
  background-color: #e67820; /* 橙色 */
  border: 2px solid #e67820;
}

  .btn-primary-accent-custom:hover {
    color: #cccccc;
    filter: brightness(1.2);
  }

.btn-secondary-custom {
  color: var(--main-btn-color);
  background-color: #ffffff;
  border: 2px solid var(--main-btn-color);
}

  .btn-secondary-custom:hover {
    color: var(--main-btn-color);
    background-color: #cccccc;
    filter: brightness(1.2);
  }

.btn-danger-custom {
  color: #ffffff;
  background-color: #dc3545; /* 赤色 */
  border: 2px solid #dc3545;
}

  .btn-danger-custom:hover {
    color: #cccccc;
    filter: brightness(1.2);
  }

.btn-sm {
  font-size: 0.875rem;
  white-space: nowrap; /* 折り返ししない */
  padding: 0.2rem 0.5rem;
  min-width: 15px;
}

.btn-lg {
  /* 将来的に必要になりそうだからとっとく */
}

.btn-xl {
  font-size: 2rem;
  text-align: center; /* 横方向中央寄せ */
  padding: 0 2rem;
  width: 100%;
  max-width: 420px;
  min-height: 80px;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .btn-xl {
    min-height: 90px;
  }
}
/* -------------------------------------------------- */

/* チェックボックス --------------------------------- */
.checkbox-cell {
  text-align: center; /* 横方向中央寄せ */
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

  .checkbox-cell input[type="checkbox"] {
    pointer-events: none; /* ラベル側でクリックを受けるため */
  }

.select-all-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.3rem;
  cursor: pointer;
  white-space: nowrap; /* 折り返ししない */
}

  .select-all-wrapper input[type="checkbox"] {
    flex-shrink: 0; /* サイズ固定 */
  }

  .select-all-wrapper span {
    display: inline-block;
    line-height: 1.2;
  }
/* -------------------------------------------------- */

/* トグルボタン ------------------------------------- */
.dir-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

  /* 非チェック時 */
  .dir-switch-input:not(:checked) + .dir-switch-btn .txt-asc {
    display: inline;
  }

  /* チェック時 */
  .dir-switch-input:checked + .dir-switch-btn .txt-desc {
    display: inline;
  }

.dir-switch-btn {
  display: inline-flex; /* フレックスにする */
  flex: 0 0 auto;
}

  .dir-switch-btn .txt-asc,
  .dir-switch-btn .txt-desc {
    display: none; /* 非表示 */
  }
/* -------------------------------------------------- */

/* カードコンテナ ----------------------------------- */
.card-frame {
  background-color: #ffffff;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin: 1.5rem auto;
  border-radius: 4px;
  padding: 1.5rem;
}

.card-short {
  max-width: 600px;
}

.card-medium {
  max-width: 768px;
}

.card-wide {
  max-width: 1250px;
}

/* スマホ・狭画面ではすべて統一的に表示させる */
@media (max-width: 576px) {
  .card-short,
  .card-medium,
  .card-wide {
    margin: 1rem auto; /* 上下1rem、左右auto */
    max-width: 100% !important;
  }
}

.card-vertical-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
/* -------------------------------------------------- */

/* パンくずリスト ----------------------------------- */
.breadcrumb-title-row {
  display: flex;
  align-items: flex-end;
  gap: 0.1rem;
}

  .breadcrumb-title-row > * {
    color: inherit;
    margin: 0;
  }
/* -------------------------------------------------- */

/* 検索フォーム ------------------------------------- */
.search-form {
  display: inline-grid;           /* 幅は中身に合わせる */
  width: auto;                    /* コンテンツ幅 */
  align-self: flex-start;         /* 左寄せ */
  grid-template-rows: auto auto;  /* 上段（基本行）・下段（詳細行） */
  background-color: #F5F5F5;
  padding: 12px;
  border-radius: 5px;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.1);
}

  /* 上段 */
  .search-form .search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
  }

  /* 入力欄群 */
  .search-form .search-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* 各項目 */
  .search-form .search-field {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    gap: 5px;
  }

  .search-form #advancedFields {
    margin-top: 12px; /* 上段との隙間 */
  }
  /* 右端のボタン群 */
  .search-form .search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 3px;
  }
/* -------------------------------------------------- */

/* モーダル ----------------------------------------- */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
}

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2010;
}
/* -------------------------------------------------- */

/* カスタムテーブル --------------------------------- */
.table-custom {
  background-color: #f8f9fa; /* 薄灰色 */
}

  .table-custom thead {
    background-color: var(--main-theme-color);
  }

    .table-custom thead th {
        /* 縦スクロール時に固定する */
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        /* tbody内のセルより手前に表示する */
        z-index: 1;
    }

  .table-custom th,
  .table-custom td {
    border: 1px solid #dee2e6;
    padding: 0.2rem;
    width: 1%;            /* 最小限確保 */
    white-space: nowrap;  /* 折り返ししない */
  }

  .table-custom th {
    color: white;
    background-color: var(--main-theme-color);
    text-align: center; /* 横方向中央寄せ */
    padding-top: 1px;
    padding-bottom: 1px;
  }

    .table-custom .gray-row {
        background-color: lightgray;
    }

/* 最右用の列の固定 */
.sticky-right-button {
  background-color: #f8f9fa; /* 薄灰色 */
  position: sticky;
  right: 0;
  border: 1px solid black;
}

/* 入力付きセル共通スタイル（見た目をエクセル風に） */
.cell-editable {
  padding: 0 !important;
  vertical-align: middle;
}

  .cell-editable input {
    border: none;
    background-color: transparent;
    width: 100%;
    padding: 2px 4px;
    outline: none;
  }

    .cell-editable input:focus {
      background-color: #e6f7ff;
      outline: 1px solid #1890ff;
    }

/* 幅サイズクラス */
.cell-xs {
  min-width: 50px;
}

.cell-sm {
  min-width: 80px;
}

.cell-md {
  min-width: 120px;
}

.cell-lg {
  min-width: 200px;
}

.cell-vlg {
  min-width: 250px;
}

.cell-vvlg {
  min-width: 530px;
}

/* ボタン風の行 */
.button-like-row {
  cursor: pointer;
  background-color: white;
  transition: background-color 0.2s ease;
}

  .button-like-row:hover {
    filter: brightness(0.9);
  }

  .button-like-row:active {
    filter: brightness(0.8);
  }
/* -------------------------------------------------- */

/* カスタム詳細テーブル ----------------------------- */
.table-keyvalue-custom {
  width: 100%;
  background-color: white;
}

  .table-keyvalue-custom th,
  .table-keyvalue-custom td {
    border: 1px solid #ccc;
    padding: 0.5rem;
    text-align: left;
    vertical-align: middle;
    width: 50%; /* 左右均等にする */
    word-break: break-word;
  }

  .table-keyvalue-custom th {
    background-color: #f2f2f2;
    font-weight: bold;
  }
/* -------------------------------------------------- */

/* 右端固定バナー ----------------------------------- */
.fixed-banner-top-right {
  position: absolute;
  top: 4rem;
  right: 1rem;
  z-index: 100;
}

/* カードの上に移動 */
@media (max-width: 1024px) {
  .fixed-banner-top-right {
    position: static;
    display: block;
    width: 100%;
    margin-top: 1rem;
    text-align: right; /* 横方向中央寄せ */
  }
}
/* -------------------------------------------------- */

/* カスタムページネーション ------------------------- */
.pagination {
  margin: 0;
}

  .pagination .page-item .page-link {
    color: var(--main-btn-color);
    background-color: #ffffff;
    font-weight: bold;
    text-decoration: none;
    border: 2px solid transparent; /* 共通で確保 */
    padding: 0.3rem 0.8rem;
  }

    .pagination .page-item .page-link:hover {
      background-color: #cccccc;
      border-color: var(--main-btn-color);
      filter: brightness(1.2);
    }

  .pagination .page-item.active .page-link {
    color: #ffffff;
    background-color: var(--main-btn-color);
    border-color: var(--main-btn-color);
  }

    .pagination .page-item.active .page-link:hover {
      color: #cccccc;
      filter: brightness(1.2);
    }
/* -------------------------------------------------- */

/* 2列入力画面 -------------------------------------- */
.form-2col .form-control-plaintext {
  white-space: normal;    /* 折り返しを許可 */
  word-break: break-word; /* 単語の途中で改行 */
}

@media (min-width: 768px) {
  .form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 左：入力、右：参照 */
    gap: 0 1.5rem;
  }
}
/* -------------------------------------------------- */

/* 数値入力のスピンボタン非表示 */
.no-spinner {
  -moz-appearance: textfield; /* Firefox */
}

  .no-spinner::-webkit-inner-spin-button,
  .no-spinner::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
/* -------------------------------------------------- */

/* 合計金額の下線 ----------------------------------- */
.totalAmount:after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5px;
  background: repeating-linear-gradient(-45deg, skyblue, skyblue 2px, white 2px, white 4px);
}

.totalAmount {
  position: relative;
  padding: 0.3em;
}
/* -------------------------------------------------- */

/* disabledが効かないタグの無効化----------------------------------- */
.is-press-disabled {
    pointer-events: none;
    opacity: .2;
}
/* -------------------------------------------------- */