/* ===== 新UI ページ共通部品（各画面の *_v2.php で使う） =====
   nvx-pagehead : ページ見出し＋主な操作
   nvx-tiles    : 操作のタイル
   nvx-card     : 白いカード
   nvx-seg      : 状態の切り替えタブ
   nvx-item     : 一覧の1件（スマホでも読める）
   nvx-steps    : 進み具合のバー
   nvx-chip     : 状態ラベル */

.nvx-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 6px 0 20px; }
.nvx-pagehead h1 { margin: 0; font-size: 26px !important; }
.nvx-pagehead .nvx-lead { margin: 4px 0 0; color: #5b6470; font-size: 14px; }
.nvx-pagehead .nvx-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.nvx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid transparent; border-radius: 14px; padding: 10px 18px; min-height: 46px;
  background: var(--nv-strong, #2c7a76); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
}
.nvx-btn:hover { color: #fff; filter: brightness(.95); }
.nvx-btn.is-ghost { background: #fff; color: #1f2329; border-color: #e3e7ec; }
.nvx-btn.is-ghost:hover { color: #1f2329; border-color: #cfd6de; filter: none; }
.nvx-btn.is-warn { background: #ffd84d; color: #3a2d00; }
.nvx-btn.is-sm { min-height: 38px; padding: 6px 14px; font-size: 13px; border-radius: 12px; }
.nvx-btn.is-block { width: 100%; }

.nvx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.nvx-tile {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 2px solid #e8ecf0; border-radius: 18px; padding: 14px 16px; min-height: 92px;
  color: #1f2329; text-decoration: none; font-family: inherit; text-align: left; cursor: pointer;
}
.nvx-tile:hover { color: #1f2329; border-color: #cfd6de; }
.nvx-tile i { font-size: 20px; color: var(--nv-strong, #2c7a76); }
.nvx-tile b { font-size: 15px; }
.nvx-tile small { font-size: 12px; color: #5b6470; line-height: 1.4; }
.nvx-tile.is-main { background: var(--nv-strong, #2c7a76); border-color: transparent; color: #fff; }
.nvx-tile.is-main i, .nvx-tile.is-main small { color: #fff; }
.nvx-tile .nvx-badge { position: absolute; top: 10px; right: 12px; }

.nvx-subnav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -8px 0 22px; font-size: 13px; }
.nvx-subnav a { color: #4b5563; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
.nvx-subnav a:hover { color: #1f2329; text-decoration: underline; }

.nvx-card { background: #fff; border: 2px solid #e8ecf0; border-radius: 22px; padding: 18px 20px; margin-bottom: 20px; }
.nvx-card.is-alert { border-color: #f3c4c0; background: #fff6f5; }
.nvx-card.is-warn { border-color: #f2c94c; background: #fffbea; }
.nvx-card.is-admin { border-style: dashed; }
.nvx-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 12px; }
.nvx-card-head h2 { margin: 0; font-size: 18px !important; font-weight: 700; }
.nvx-card-head p { margin: 0; font-size: 12px; color: #5b6470; }

.nvx-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #eef1f4; padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.nvx-seg button {
  border: none; background: transparent; border-radius: 10px; padding: 8px 14px; min-height: 38px;
  font-family: inherit; font-weight: 500; font-size: 14px; color: #4b5563;
}
.nvx-seg button[aria-selected="true"] { background: #fff; color: #1f2329; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.nvx-seg .n { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #dfe4ea; font-size: 12px; }
.nvx-seg button[aria-selected="true"] .n { background: var(--nv-strong, #2c7a76); color: #fff; }

.nvx-list { display: flex; flex-direction: column; gap: 10px; }
.nvx-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  background: #fff; border: 2px solid #e8ecf0; border-radius: 16px; padding: 14px 16px;
}
.nvx-item.is-action { border-color: color-mix(in srgb, var(--primary-color) 55%, #fff); }
.nvx-item.is-alert { border-color: #f3c4c0; background: #fff6f5; }
.nvx-item .nvx-main { flex: 1 1 260px; min-width: 0; }
.nvx-item .nvx-title { font-weight: 700; font-size: 15px; }
.nvx-item .nvx-meta { font-size: 12px; color: #5b6470; margin-top: 2px; }
.nvx-item .nvx-amount { font-weight: 700; font-size: 18px; white-space: nowrap; }
.nvx-item .nvx-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.nvx-item .nvx-note { flex-basis: 100%; font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 10px; background: #fffbea; color: #6b5300; }
.nvx-item .nvx-note.is-red { background: #fff1f0; color: #9b2119; }
.nvx-empty { text-align: center; padding: 26px 10px; color: #5b6470; font-weight: 500; border: 2px dashed #e3e7ec; border-radius: 16px; background: #fff; }

.nvx-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: #eef1f4; color: #33404c; }
.nvx-chip.is-wait   { background: #fff1c2; color: #6b5300; }
.nvx-chip.is-go     { background: color-mix(in srgb, var(--primary-color) 20%, #fff); color: #1f2329; }
.nvx-chip.is-done   { background: #dcf3e4; color: #1d5e36; }
.nvx-chip.is-ng     { background: #fde2e0; color: #9b2119; }
.nvx-chip.is-strong { background: var(--nv-strong, #2c7a76); color: #fff; }

.nvx-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; flex-basis: 100%; }
.nvx-steps li { font-size: 11px; font-weight: 500; color: #6b7280; text-align: center; }
.nvx-steps li::before { content: ""; display: block; height: 6px; border-radius: 999px; background: #e5e7eb; margin-bottom: 5px; }
.nvx-steps li.is-done { color: #1f2329; }
.nvx-steps li.is-done::before { background: var(--nv-strong, #2c7a76); }
.nvx-steps li.is-now { color: #8a5a00; font-weight: 700; }
.nvx-steps li.is-now::before { background: #ffc61a; }

.nvx-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #fff; border: 2px dashed #cfd6de; border-radius: 16px; padding: 10px 14px; margin-bottom: 18px; font-size: 14px; }
.nvx-switch .form-select { width: auto; min-width: 200px; }

@media (max-width: 767.98px) {
  .nvx-pagehead h1 { font-size: 22px !important; }
  .nvx-pagehead .nvx-actions { width: 100%; }
  .nvx-pagehead .nvx-actions .nvx-btn { flex: 1; }
  .nvx-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .nvx-tile { min-height: 84px; padding: 12px 14px; }
  .nvx-card { padding: 14px; border-radius: 18px; }
  .nvx-item .nvx-ops { width: 100%; }
  .nvx-item .nvx-ops .nvx-btn { flex: 1; min-height: 44px; }
  .nvx-seg { display: flex; }
  .nvx-seg button { flex: 1; padding: 8px 6px; font-size: 13px; }
}
