/* Tablerの見た目（白地・青・細い枠線）にならった自前のスタイル */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e6e7e9;
  --text: #1d273b;
  --muted: #667382;
  --primary: #206bc4;
  --primary-dark: #1a569d;
  --primary-soft: #e9f0f9;
  --success: #2fb344;
  --success-soft: #eaf7ec;
  --danger: #d63939;
  --danger-soft: #fbebeb;
  --warning-soft: #fef6e6;
  --warning-border: #f7d58b;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(29, 39, 59, .05);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
[hidden] { display: none !important; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.navbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 16px; }

.page-header { margin: 28px 0 20px; }
.pretitle { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
h1 { margin: 2px 0 6px; font-size: 24px; line-height: 1.35; }
.subtitle { margin: 0; color: var(--muted); }

.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: step; }
.steps li { flex: 1; position: relative; padding: 10px 12px 10px 44px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-weight: 600; font-size: 14px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); font-size: 13px; }
.steps li.active { color: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.steps li.active::before { background: var(--primary); border-color: var(--primary); color: #fff; }
.steps li.done { color: var(--success); }
.steps li.done::before { content: "✓"; background: var(--success); border-color: var(--success); color: #fff; }

.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 40px; }
.col-main, .col-side { display: grid; gap: 20px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-header h2 { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin: 0; font-size: 16px; }
.card-body { padding: 20px; display: grid; gap: 18px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); background: #fbfcfd; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 700; }
.num.inverse { background: rgba(255, 255, 255, .2); color: #fff; margin-right: 8px; }

.dropzone { display: grid; justify-items: center; gap: 6px; padding: 32px 16px; border: 2px dashed #c8d3e1; border-radius: var(--radius); background: #fafcff; text-align: center; cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.loaded { border-style: solid; border-color: var(--success); background: var(--success-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { font-size: 28px; color: var(--primary); line-height: 1; }
.drop-title { font-weight: 600; word-break: break-all; }
.drop-hint, .hint { font-size: 13px; color: var(--muted); }

.field { display: grid; gap: 6px; max-width: 280px; }
.field label { font-weight: 600; font-size: 14px; }
.input { font: inherit; padding: 8px 12px; border: 1px solid #dadfe5; border-radius: 6px; background: #fff; color: var(--text); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--text); border-color: #dadfe5; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--primary); font: inherit; font-size: 14px; cursor: pointer; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-muted { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.alert { padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.alert-warning { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; background: var(--warning-soft); border-color: var(--warning-border); }
.alert-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-danger { margin: 16px 20px 0; background: var(--danger-soft); border-color: #f2c4c4; color: #8a1f1f; }
.alert-success { background: var(--success-soft); border-color: #bfe6c5; color: #1d6b2a; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 20px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); background: #fbfcfd; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.num-col { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); }
.down { color: var(--danger); font-weight: 600; }
.after { font-weight: 700; color: var(--primary); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.list .empty { color: var(--muted); justify-content: center; }
.list .sub { display: block; font-size: 12px; color: var(--muted); }
.qty { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.stock-card { margin-bottom: 20px; }
.stock-meta { display: flex; align-items: center; gap: 12px; }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding: 20px; }
.stock-grid .empty { color: var(--muted); }

.stock-photo { position: relative; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; font-size: 34px; flex-shrink: 0; }
.stock-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stock-info { display: grid; gap: 4px; align-content: start; min-width: 0; }
.stock { display: flex; align-items: flex-start; gap: 16px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, #fff, #fafcff); transition: .3s; }
.stock.changed { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.stock-title { font-weight: 600; line-height: 1.45; }
.stock-qty { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.stock-now { font-size: 34px; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.stock-now small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stock.changed .stock-now { color: var(--primary); }
.stock-before { font-size: 22px; color: var(--muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.stock-arrow { color: var(--muted); }
.sample { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--primary-soft); }
.sample .hint { color: var(--primary-dark); flex: 1 1 260px; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .steps li { padding-left: 40px; font-size: 13px; }
  h1 { font-size: 20px; }
}
@media (max-width: 520px) {
  .steps { flex-direction: column; }
  .table th, .table td { padding: 10px 12px; }
  .table td:first-child { min-width: 9em; }
  .hide-sm { display: none; }
  .badge { white-space: normal; }
  .card-footer .btn { width: 100%; }
}
