/* 生産管理WEB（Fkz00010s01〜Fkz00040s01）共通スタイル */
/* ※SVN同期で common-style.css／style-components.css の生産管理WEB用定義が
     消失したため、独立ファイルとして復旧（他画面のCSSには影響させない） */
/* l-＝レイアウト用クラス／c-＝共通コンポーネント用クラス */

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: "Meiryo UI", "Yu Gothic UI", sans-serif;
  background: #eef1f5;
  color: #14202e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

:root {
  --primary: #1259b0;
  --primary-light: #e3f2fd;
  --primary-dark: #0d3f7a;
  --success: #2e7d32;
  --warning: #e65100;
  --danger: #c62828;
  --calc: #5e35b1;
  --border: #c7ccd4;
  --bg-card: #fff;
  --shadow: 0 1px 3px rgba(0, 0, 0, .12);
  --radius: 5px;
  --cell-h: 30px;
  --cell-w: 64px;
  --ink: #14202e;
}

/* ヘッダー部 */
/* タイトル部のレイアウトデザインは全画面（Fkz00010s01〜Fkz00040s01）で統一する
   （日次画面・ダッシュボードの .p-app-header と同一のグラデーション・影・文字サイズ） */
.l-app-header {
  background: linear-gradient(135deg, #0d47a1, #1976d2);
  color: #fff;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.l-app-header h1 { font-size: 1.1rem; font-weight: 800; letter-spacing: .3px; }
.l-header-right { font-size: .85rem; display: flex; gap: 14px; align-items: center; }
/* 時計は日次画面・ダッシュボードと同一のチップ表示にする */
.l-header-right .p-clock {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .18);
  padding: 3px 12px;
  border-radius: 6px;
}
/* ツールバーの[受注表示]ボタン（受注の数量行の表示／非表示を切り替える） */
/* 修正指示により、ヘッダーから[表示]ボタンの横（ツールバー）へ移動した。
   ツールバー（白背景）に並ぶ他のボタン（.c-btn）と大きさをそろえる */
.c-btn-jyutyu {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid #dba0a0;
  border-radius: var(--radius);
  background: #fff;
  color: var(--danger);
  font-family: inherit;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
}
.c-btn-jyutyu:hover { background: #fdeaea; }
/* 受注表示ONの状態は赤背景＋白文字にして、押下中であることがわかるようにする */
.c-btn-jyutyu.is-active { background: var(--danger); border-color: var(--danger); color: #fff; }
.c-btn-jyutyu .c-jyutyu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f9c9c9;
  color: var(--danger);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}
/* ONの状態は赤背景のため、アイコンは白丸＋赤文字にして判別できるようにする */
.c-btn-jyutyu.is-active .c-jyutyu-icon { background: #fff; color: var(--danger); }

/* ヘッダー部タブ */
.l-tab-bar {
  background: #d6dce6;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 42px;
}
.c-tab-btn {
  background: #b7c0cf;
  color: #26364d;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 0 18px;
  height: 32px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .15s, height .15s;
}
.c-tab-btn:hover { background: #c8d0dc; }
.c-tab-btn.is-active {
  background: #fff;
  color: var(--primary-dark);
  height: 36px;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, .08);
  border-top: 3px solid var(--primary);
}
.c-tab-btn.c-tab-set.is-active { border-top-color: var(--calc); }
.c-tab-btn .c-badge-on { font-size: .64rem; background: var(--success); color: #fff; border-radius: 3px; padding: 1px 5px; font-weight: 700; }
.c-tab-btn .c-badge-off { font-size: .64rem; background: #6b7787; color: #fff; border-radius: 3px; padding: 1px 5px; font-weight: 700; }
.c-tab-hint { margin-left: 12px; font-size: .76rem; color: #2f4059; align-self: center; }
.c-nav-screen-btn {
  margin-left: auto;
  align-self: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  padding: 0 20px;
  height: 34px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.c-nav-screen-btn:hover { background: var(--primary-dark); }

/* ツールバー */
.l-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.l-toolbar label { font-size: .84rem; color: #2b3a50; font-weight: 600; }
.l-toolbar input,
.l-toolbar select {
  font-size: .86rem;
  padding: 3px 6px;
  border: 1px solid #b7bdc7;
  border-radius: var(--radius);
  height: 30px;
  color: var(--ink);
  background: #fff;
}
.l-toolbar input[type="month"] { width: 140px; }
/* ツールバーのチェックボックス付きラベル（計画なしを表示する 等）
   ※ツールバーの入力項目共通のスタイル（高さ30px・枠線・余白）がチェックボックスへ適用されないよう打ち消す */
.l-toolbar .c-toolbar-check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; user-select: none; }
.l-toolbar .c-toolbar-check input[type="checkbox"] { width: 15px; height: 15px; padding: 0; margin: 0; border: none; accent-color: var(--primary); cursor: pointer; }
/* ツールバーの改行（確定を右揃えで単独配置する行） */
.l-toolbar-break { flex-basis: 100%; height: 0; }
.l-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* メインコンテンツ */
.l-main-content { display: flex; flex-direction: row; flex: 1; overflow: hidden; }

/* ステータスバー */
.l-status-bar {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  color: #33445c;
  position: sticky;
  bottom: 0;
  z-index: 100;
}
.l-status-bar .c-cell-info { font-weight: 700; color: var(--primary-dark); }

/* ==========================================================================
   共通コンポーネント（c-）
   ========================================================================== */

/* ボタン */
.c-btn {
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 700;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: #26364d;
}
.c-btn:hover { filter: brightness(.96); }
.c-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.c-btn-calc { background: var(--calc); border-color: var(--calc); color: #fff; }
.c-btn-save { background: var(--success); border-color: var(--success); color: #fff; }
.c-btn-danger { background: #fff; border-color: #dba0a0; color: var(--danger); }
.c-btn-danger:hover { background: #fdeaea; }
.c-btn-confirm { background: var(--success); border-color: var(--success); color: #fff; }
.c-btn-ghost { background: #fff; color: #33445c; }
.c-shortcut-hint {
  font-size: .6rem;
  background: rgba(255, 255, 255, .25);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 3px;
  font-weight: 700;
}

/* 確定状況の表示チップ */
.c-confirm-status {
  font-size: .8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid;
  white-space: nowrap;
}
.c-confirm-status.is-not-confirmed { background: #fff3e0; color: #b5560a; border-color: #e0a469; }
.c-confirm-status.is-confirmed { background: #e2f3e6; color: #1b6b2c; border-color: #86c493; }

/* 件数バッジ */
.c-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  background: rgba(255, 255, 255, .28);
  border-radius: 9px;
  font-size: .72rem;
  font-weight: 700;
}

/* モーダル */
.c-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 46, .45);
  z-index: 900;
  align-items: center;
  justify-content: center;
}
.c-modal-overlay.is-open { display: flex; }
.c-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.c-modal-header {
  background: var(--primary-dark);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.c-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  margin-left: auto;
}
.c-modal-close:hover { background: rgba(255, 255, 255, .2); }
.c-modal-body { padding: 14px 16px; overflow: auto; }
.c-modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* メッセージ用ポップアップ子画面（ワーニング・確認）
   ブラウザ特有のバナー（window.confirm等）の代わりに使用する共通ポップアップ */
.c-msg-modal { min-width: 340px; max-width: 560px; }
.c-msg-modal--warn .c-modal-header { background: #b5560a; }
.c-msg-modal-text { white-space: pre-line; font-size: .88rem; color: #2b3a50; line-height: 1.6; }

/* 業務メッセージ・エラーメッセージの表示（ヘッダー直下の帯は廃止した）
   ※修正指示により、表示方法はUIモック（参考資料/UI_mock）の
     画面下部中央のトースト表示へ統一している（.c-toast を参照） */

/* ハンバーガーメニューアイコン（ヘッダー・フッターをしまうボタン用）
   文字ではなく横棒が縦に並んだアイコンで表示する */
.c-hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 16px;
  vertical-align: middle;
}
.c-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
}

/* トーストメッセージ（業務メッセージ・エラーメッセージ共通）
   UIモック（参考資料/UI_mock）のトースト表示に合わせ、画面下部の中央へ
   角丸のトーストをふわっと表示する。
   ・業務メッセージ（「登録しました」等）… 緑（--success）
   ・エラー系メッセージ（「取得できませんでした」等）… 赤（--danger）
   ※画面下部の操作バーに重ならないよう、表示位置は --c-toast-bottom で調整する */
.c-toast {
  position: fixed;
  left: 50%;
  bottom: var(--c-toast-bottom, 56px);
  transform: translateX(-50%) translateY(20px);
  z-index: 10010;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 22px;
  max-width: 80vw;
  white-space: pre-line;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.c-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.c-toast--error { background: var(--danger); }
.c-toast-icon { font-size: 1rem; line-height: 1; }
.c-toast-text { line-height: 1.4; }

/* ローディング表示 */
.c-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .55);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
}
.c-loading-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.c-loading-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: c-loading-spin .8s linear infinite;
}
.c-loading-text { font-size: .88rem; font-weight: 700; color: var(--primary-dark); }
@keyframes c-loading-spin { to { transform: rotate(360deg); } }
