/* ========================================
   献金受付システム - 共通スタイル (Bootstrap拡張)
   ======================================== */

/* レイアウト: ナビ + メイン + フッター で100vh */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: "Meiryo", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}

.main-content {
  flex: 1 1 0;
  overflow: auto;
  padding-top: 12px;
  padding-bottom: 12px;
}

.toolbar {
  flex-shrink: 0;
}

/* kbd スタイル */
kbd {
  font-size: 0.7em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,.08);
  color: inherit;
  border: 1px solid rgba(0,0,0,.15);
  box-shadow: none;
  margin-left: 4px;
}

.btn kbd {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.3);
}

/* min-h-0: flexbox子要素のoverflow用 */
.min-h-0 { min-height: 0; }

/* ========== 科目検索ドロップダウン ========== */

#kamokuSearchWrap,
#bunruiSearchWrap {
  position: relative;
}

#kamokuDropdown,
#bunruiDropdown {
  font-size: 0.875rem;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
}

#kamokuDropdown .dropdown-header,
#bunruiDropdown .dropdown-header {
  font-size: 0.72rem;
  padding: 5px 10px 2px;
  text-transform: none;
  letter-spacing: 0;
}

#kamokuDropdown .dropdown-item,
#bunruiDropdown .dropdown-item {
  font-size: 0.84rem;
  padding: 4px 10px;
}

#kamokuDropdown .dropdown-item.active,
#kamokuDropdown .dropdown-item:focus,
#bunruiDropdown .dropdown-item.active,
#bunruiDropdown .dropdown-item:focus {
  background: #e8f0fe;
  color: inherit;
}

/* 明細追加エリアはドロップダウンのためにスタックコンテキストを上に */
#addDetailArea {
  position: relative;
  z-index: 10;
}

/* 明細テーブル領域はドロップダウンの下に */
#entryListWrap {
  position: relative;
  z-index: 1;
}

/* 金額入力欄: IMEを無効化（半角入力強制） */
.amount-input,
#entryTable .entry-amount {
  ime-mode: disabled;
}

/* 入力済み明細テーブル */
#entryTable .entry-amount {
  font-size: 0.95rem;
}

#entryTable .entry-amount:focus {
  background: #fffff0;
}

/* ========== 仕訳管理: テーブル ========== */

.cursor-pointer tr { cursor: pointer; }

#journalTableBody tr.table-active {
  --bs-table-accent-bg: #cfe2ff;
  font-weight: 600;
}

/* ========== 仕訳管理: 編集パネル ========== */

/* ステータスバッジ */
.mode-view  { background: #6c757d !important; }
.mode-edit  { background: #fd7e14 !important; }
.mode-new   { background: #198754 !important; }

/* 編集フォーム */
.edit-form .row { margin-bottom: 4px; }

/* 仕訳明細テーブル */
.detail-table {
  font-size: 0.85rem;
}

.detail-table .font-monospace {
  font-size: 0.9rem;
}

.detail-table .form-control {
  font-family: "Consolas", "Menlo", monospace;
}

/* 明細追加行 */
.add-detail-row {
  background: #f8f9fa;
  border: 1px dashed #ced4da;
  border-radius: 6px;
  padding: 8px;
}

/* 合計行 */
.detail-total-bar {
  background: #fff3cd;
  border-top: 2px solid #ffc107;
}
