/* =========================================================
   見積システム 共通CSS
   common.css
========================================================= */


/* =========================
   基本設定
========================= */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;

  font-family:
    "Yu Gothic",
    "Meiryo",
    sans-serif;

  color: #2f343a;
  background: #f4f6f8;

  line-height: 1.5;
}


/* =========================
   見出し
========================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
}


/* =========================
   共通ヘッダー
========================= */

.header {
  width: 100%;

  background: #1f4e78;
  color: #fff;

  padding: 18px 30px;

  font-size: 24px;
  font-weight: bold;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}


/* =========================
   ヘッダー上部の「ホームへ戻る」
   （縦に長くなる画面で、下部のボタンと
   合わせて上部からも戻れるようにする）
========================= */

.header-home-link {
  flex-shrink: 0;

  display: inline-block;

  background: #555;
  color: #fff;

  border: none;
  border-radius: 5px;

  padding: 6px 16px;

  font-size: 13px;
  font-weight: normal;

  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.header-home-link:hover {
  background: #444;
}


/* =========================
   共通コンテナ
========================= */

.container {
  width: 1200px;
  max-width: calc(100% - 40px);

  margin: 30px auto;
}


/* =========================
   カード
========================= */

.card {
  background: #fff;

  border-radius: 8px;

  padding: 25px;

  margin-bottom: 25px;

  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.07);
}

.card-title {
  font-size: 18px;
  font-weight: bold;

  margin-bottom: 20px;

  border-left: 5px solid #1f4e78;

  padding-left: 10px;
}


/* =========================
   フォーム
========================= */

label {
  color: #333;
}

input,
select,
textarea {
  font-family: inherit;
}

input,
select {
  min-height: 40px;
}

input,
select,
textarea {
  border: 1px solid #bcc5cd;

  border-radius: 5px;

  background: #fff;

  color: #333;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;

  border-color: #2f75b5;

  box-shadow:
    0 0 0 3px rgba(47, 117, 181, 0.10);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #eeeeee;

  color: #777;

  cursor: not-allowed;
}

input[readonly] {
  background: #f3f5f7;
}


/* =========================
   数字入力欄のスピンボタン非表示
   （Chrome/Edge系とFirefoxの両方に対応。
   select要素の矢印・プルダウン機能には影響しない）
========================= */

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}


/* =========================
   ボタン
========================= */

button {
  font-family: inherit;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    opacity 0.15s ease,
    transform 0.05s ease;
}

button:hover:not(:disabled) {
  opacity: 0.9;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


/* =========================
   共通ボタン色
========================= */

.btn-primary {
  border: none;

  border-radius: 6px;

  background: #1f4e78;

  color: #fff;

  padding: 10px 20px;
}

.btn-secondary {
  border: none;

  border-radius: 6px;

  background: #6c757d;

  color: #fff;

  padding: 10px 20px;
}

.btn-success {
  border: none;

  border-radius: 6px;

  background: #198754;

  color: #fff;

  padding: 10px 20px;
}

.btn-danger {
  border: none;

  border-radius: 6px;

  background: #dc3545;

  color: #fff;

  padding: 10px 20px;
}

.btn-light {
  border: none;

  border-radius: 6px;

  background: #e9ecef;

  color: #333;

  padding: 10px 20px;
}


/* =========================
   テーブル
========================= */

/* =========================
   テストデータ使用中バナー（18-2b）

   js/common.jsが、テストデータ管理ツールで
   「テストデータだけ入れる」を実行した状態のときだけ
   document.bodyの先頭へ挿入する（ローカル環境限定）。
   印刷（見積書プレビューのPDF出力等）には含めない。
========================= */

.test-data-active-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;

  padding: 8px 16px;

  background: #fff4e0;
  border-bottom: 2px solid #e2a33d;
  color: #6b4a12;

  font-size: 13px;
}

.test-data-active-banner-title {
  font-weight: 700;
}

.test-data-active-banner-link {
  margin-left: auto;

  color: #6b4a12;
  text-decoration: underline;
}

@media print {

  .test-data-active-banner {
    display: none !important;
  }

}


.table-wrap {
  width: 100%;

  overflow-x: auto;
}

table {
  border-collapse: collapse;
}

th {
  font-weight: bold;
}

td,
th {
  vertical-align: middle;
}


/* =========================
   共通ステータス
========================= */

.status-active {
  color: #198754;
  font-weight: bold;
}

.status-inactive {
  color: #888;
  font-weight: bold;
}

.status-error {
  color: #b02a37;
  font-weight: bold;
}


/* =========================
   金額
========================= */

.money {
  text-align: right;

  font-variant-numeric:
    tabular-nums;

  white-space: nowrap;
}


/* =========================
   注記
========================= */

.note {
  color: #666;

  font-size: 13px;

  line-height: 1.6;
}

.required {
  color: #dc3545;

  font-size: 12px;

  font-weight: bold;
}


/* =========================
   非表示
========================= */

.hidden {
  display: none !important;
}


/* =========================
   読み込み中
========================= */

.loading {
  opacity: 0.6;

  pointer-events: none;
}


/* =========================
   タブレット
========================= */

@media (max-width: 1000px) {

  .container {
    width: auto;

    max-width: calc(100% - 24px);

    margin: 20px auto;
  }

  .header {
    padding: 16px 20px;

    font-size: 21px;
  }

  .card {
    padding: 20px;
  }

}


/* =========================
   スマートフォン
========================= */

@media (max-width: 600px) {

  .container {
    max-width: calc(100% - 16px);

    margin: 12px auto;
  }

  .header {
    padding: 14px 15px;

    font-size: 19px;
  }

  .card {
    padding: 16px;

    margin-bottom: 16px;
  }

  .card-title {
    font-size: 17px;
  }

}