/* =================================================================
   川本鋼材 現場タブレット用 CSS (v2 — refined / 1画面前提)

   目的:
   - タッチ操作 (最小タップ 44px) を確保しつつ、KONY 添付の配置に厳密に寄せる
   - タブレット 1280×800 / 1024×768 で詳細画面が縦スクロール無しに収まる
   - モダンで控えめな配色 (白基調 + 1色の青アクセント + ピンク表ヘッダ)
   ================================================================= */

:root {
  --c-bg:      #f7f8fa;
  --c-card:    #ffffff;
  --c-border:  #e5e7eb;
  --c-border-strong: #d1d5db;
  --c-text:    #111827;
  --c-text-2:  #4b5563;
  --c-text-3:  #6b7280;
  --c-text-4:  #9ca3af;
  --c-accent:  #2563eb;     /* primary blue */
  --c-accent-2:#1d4ed8;
  --c-accent-soft: #eff6ff;
  --c-pink:    #fdebe9;     /* table header pink (KONY) */
  --c-pink-2:  #f7d8d4;
  --c-yellow:  #fefce8;
  --c-yellow-b:#facc15;
  --c-yellow-t:#854d0e;
  --c-success: #10b981;
  --c-danger:  #ef4444;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:    0 2px 6px rgba(15, 23, 42, 0.06);
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

input, button, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

.main { padding: 0; }

/* ── Flash ───────────────────────────────────────── */
.flash-area { position: fixed; top: 16px; left: 16px; right: 16px; z-index: 200; }
.flash {
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.flash-danger  { background: #fef2f2; color: #991b1b; border-left: 4px solid #dc2626; }
.flash-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; }
.flash-success { background: #ecfdf5; color: #065f46; border-left: 4px solid #10b981; }
.flash-info    { background: #eff6ff; color: #1e3a8a; border-left: 4px solid #3b82f6; }

/* ── ログイン画面 ───────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f3a5f 0%, #1f5fa3 100%);
  padding: 24px;
}
.login-card {
  background: #fff; border-radius: 14px;
  padding: 44px 36px; width: 100%; max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-text { font-size: 28px; font-weight: 700; color: var(--c-accent); letter-spacing: 0.05em; }
.login-logo .logo-sub  { font-size: 14px; color: var(--c-text-3); margin-top: 4px; }
.login-form .field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text-2); margin-bottom: 6px; }
.field-input {
  width: 100%; height: 52px; padding: 0 14px; font-size: 18px;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-md); background: #fff;
}
.field-input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.btn-primary {
  width: 100%; height: 56px; margin-top: 8px;
  font-size: 16px; font-weight: 700; color: #fff;
  background: var(--c-accent); border: none; border-radius: var(--r-md);
  transition: background 0.15s;
}
.btn-primary:hover  { background: var(--c-accent-2); }
.login-hint { margin-top: 20px; text-align: center; font-size: 12px; color: var(--c-text-3); }

/* ── ダッシュボード ───────────────────────────── */
.dashboard-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: #fff; color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
}
.user-info .user-name { font-size: 18px; font-weight: 700; }
.user-info .user-meta { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }
.btn-logout {
  height: 40px; padding: 0 16px; font-size: 13px; font-weight: 600;
  background: #fff; color: var(--c-text-2);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-md);
}
.btn-logout:hover { background: #f3f4f6; }

.dashboard-body { padding: 28px 24px; max-width: 1100px; margin: 0 auto; }
.placeholder-title { font-size: 18px; color: var(--c-text); margin-bottom: 16px; font-weight: 700; }
.placeholder-text  { color: var(--c-text-2); line-height: 1.7; margin-bottom: 20px; font-size: 14px; }
.placeholder-text code { background: var(--c-bg); padding: 2px 6px; border-radius: 4px; font-family: "Consolas", monospace; font-size: 13px; }
.placeholder-list { padding-left: 24px; color: var(--c-text-2); }
.placeholder-list li { margin-bottom: 6px; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; margin-top: 8px;
}
.menu-card {
  display: block; padding: 18px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  text-decoration: none; color: var(--c-text);
  min-height: 96px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  box-shadow: var(--shadow-sm);
}
.menu-card:hover  { border-color: var(--c-accent); box-shadow: 0 4px 14px rgba(37,99,235,0.10); }
.menu-card:active { transform: translateY(1px); }
.menu-card-title { font-size: 16px; font-weight: 700; color: var(--c-text); margin-bottom: 4px; }
.menu-card-desc  { font-size: 12px; color: var(--c-text-3); line-height: 1.5; }
.menu-card-disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; }

/* =================================================================
   共通ボタン
   ================================================================= */
.kbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  text-decoration: none; white-space: nowrap;
  min-height: 36px;
  transition: background 0.15s, border-color 0.15s;
}
.kbtn-blue   { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.kbtn-blue:hover  { background: var(--c-accent-2); border-color: var(--c-accent-2); }
.kbtn-light  { background: #fff; color: var(--c-text-2); border-color: var(--c-border-strong); }
.kbtn-light:hover { background: #f9fafb; border-color: #9ca3af; }
.kbtn-gray   { background: #6b7280; color: #fff; border-color: #6b7280; }
.kbtn-gray:hover  { background: #4b5563; }
.kbtn:disabled, .kbtn[disabled] { opacity: 0.45; cursor: not-allowed; }
.kbtn-sm { padding: 4px 10px; font-size: 12px; min-height: 28px; }
.kbtn-md { padding: 6px 12px; font-size: 13px; min-height: 32px; }
.kbtn-lg { padding: 12px 24px; font-size: 15px; min-height: 48px; }
.kbtn-icon { font-size: 15px; line-height: 1; }

.muted { color: var(--c-text-4); font-size: 12px; }

/* =================================================================
   一覧画面 (KONY 切断残の機械割当て)
   ================================================================= */
.kony-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 14px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 30;
}
.kh-left   { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kh-center { display: flex; align-items: center; gap: 8px; }
.kh-right  { display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-size: 12px; }

.kh-back {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 8px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  background: #fff; color: var(--c-text-2);
  text-decoration: none; font-size: 10px; font-weight: 600;
  min-width: 56px;
}
.kh-back:hover { background: #f9fafb; }
.kh-back-icon { font-size: 18px; line-height: 1; }
.kh-back-text { font-size: 10px; }

.kh-title-block { min-width: 0; }
.kh-title-row { display: flex; align-items: baseline; gap: 8px; }
.kh-title-icon { font-size: 18px; }
.kh-title { font-size: 18px; font-weight: 700; color: var(--c-text); }
.kh-subtitle { font-size: 11px; color: var(--c-text-3); margin-top: 1px; }

.kh-cutdate {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  background: #fff; font-size: 11px;
}
.kh-cutdate-label { color: var(--c-text-2); font-weight: 600; line-height: 1.1; }
.kh-cutdate-form { display: inline-flex; }
.kh-cutdate-input {
  height: 28px; padding: 0 8px; font-size: 13px;
  border: 1px solid var(--c-border); border-radius: var(--r-sm); background: #fff;
}
.kh-meta-line { color: var(--c-text-2); }
.kh-pill {
  display: inline-block; padding: 2px 8px;
  background: var(--c-accent-soft); border-radius: 999px;
  color: #1e3a8a; font-weight: 600; font-size: 11px;
}
.kh-side-link { font-size: 11px; color: var(--c-accent); text-decoration: underline; }
.kh-user { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.kh-user-label { font-size: 10px; color: var(--c-text-3); }
.kh-user-name  { font-size: 13px; font-weight: 700; color: var(--c-text); }
.kh-user-dept  { font-size: 10px; color: var(--c-text-3); }

/* タブ */
.kh-tabs { gap: 0; }
.ktab {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  background: #f3f4f6; color: var(--c-text-3);
  border: 1px solid var(--c-border);
  border-bottom: none;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  margin-right: 1px;
  cursor: default;
  min-width: 90px;
}
.ktab-active {
  background: #fff; color: var(--c-text);
  border-color: var(--c-border-strong);
  border-bottom: 2px solid #fff; position: relative; top: 1px;
}
.ktab-disabled { opacity: 0.7; }

/* クイックバー */
.quickbar {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
}
.qb-field { display: flex; flex-direction: column; gap: 2px; }
.qb-label { font-size: 11px; color: var(--c-text-3); font-weight: 600; }
.qb-select {
  height: 32px; padding: 0 10px; font-size: 13px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm); background: #fff;
  min-width: 220px;
}
.qb-apply { padding: 6px 14px; min-height: 32px; font-size: 13px; }

.refresh-warn {
  padding: 6px 14px; background: #fff7ed; color: #9a3412;
  border-bottom: 1px solid #fde7c4; font-size: 12px;
}

/* 一覧テーブル */
.ktable-wrap { padding: 10px 14px 24px; overflow-x: auto; }
.ktable {
  width: 100%; min-width: 1300px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.ktable-head-1 th {
  background: #f9fafb;
  color: var(--c-text-3);
  font-weight: 600; padding: 4px 8px;
  border-bottom: 1px solid var(--c-border);
  font-size: 11px; text-align: left;
}
.ktable-head-1 .th-pink { background: var(--c-pink); color: #6b3f3a; }
.ktable-head-2 th {
  background: var(--c-pink);
  color: #6b3f3a;
  padding: 6px 6px;
  font-size: 11px; font-weight: 700;
  border-bottom: 1px solid var(--c-pink-2);
  text-align: left; white-space: nowrap;
}
.ktable-head-2 .num { text-align: right; }
.ktable-row td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
  white-space: nowrap;
}
.ktable-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.ktable-row { cursor: pointer; transition: background 0.1s; }
.ktable-row:hover { background: var(--c-accent-soft); }
.cell-arrow { color: var(--c-accent); font-size: 18px; line-height: 1; text-align: center; }
.cell-check { color: var(--c-text-4); font-size: 14px; line-height: 1; text-align: center; }
.cell-machine .machine-tag {
  display: inline-block; padding: 1px 6px;
  background: var(--c-accent-soft); color: var(--c-accent);
  border-radius: 3px; font-weight: 700; font-size: 11px;
}
.cell-machine .machine-empty { color: var(--c-text-4); font-size: 11px; }
.cell-juchu .juchu-no { color: var(--c-accent); font-weight: 700; font-size: 13px; }
.cell-juchu .juchu-sub { font-size: 10px; color: var(--c-text-3); }
.cell-juchu .juchu-customer { font-size: 11px; color: var(--c-text-2); margin-top: 1px; }
.cell-issue { color: var(--c-accent); font-size: 11px; }
.cell-due .due-main, .cell-due .due-sub { display: flex; gap: 4px; align-items: center; }
.cell-due .due-tag, .cell-due .due-tag-2 {
  font-size: 9px; padding: 1px 4px; border-radius: 2px;
  background: #e0e7ff; color: #312e81;
}
.cell-due .due-tag-2 { background: #f3f4f6; color: var(--c-text-3); }
.cell-due .due-date  { font-size: 12px; font-weight: 600; }
.cell-due .due-date-2 { font-size: 11px; color: var(--c-text-3); }
.cell-due .muted { color: var(--c-text-4); font-size: 10px; }
.qty-main { font-weight: 600; }
.qty-sub  { font-size: 10px; color: var(--c-text-3); }
.cell-zanpu div { font-size: 11px; }
.cell-zanpu .muted { color: var(--c-text-3); }
.cell-loc .loc-id   { font-weight: 700; color: var(--c-text); font-size: 12px; }
.cell-loc .loc-name { font-size: 11px; color: var(--c-text-3); }
.op { color: var(--c-text-4); }
.empty { text-align: center; padding: 40px 16px; color: var(--c-text-4); font-size: 14px; }
.ktable-foot { padding: 8px 14px; font-size: 12px; color: var(--c-text-3); background: #fff; }

/* 検索 / 並び替え モーダル */
.search-panel {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 200; overflow: auto;
  padding: 24px 16px;
  align-items: flex-start; justify-content: center;
}
.search-panel.open { display: flex; }
.sp-card {
  background: #fff; width: 100%; max-width: 1080px;
  border-radius: var(--r-lg);
  padding: 18px 22px 22px;
  box-shadow: 0 20px 50px rgba(15,23,42,0.25);
}
.sp-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--c-border); }
.sp-title { font-size: 16px; font-weight: 700; color: var(--c-text); }
.sp-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--c-text-3); }
.sp-close:hover { color: var(--c-text); }
.sp-form { padding-top: 14px; }
.sp-fs { border: none; padding: 6px 0 8px; }
.sp-legend { font-size: 12px; font-weight: 700; color: var(--c-accent); padding: 4px 0; }
.sp-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.sp-field { display: flex; flex-direction: column; gap: 2px; }
.sp-field-grow { flex: 1 1 280px; }
.sp-field-num input { min-width: 80px; }
.sp-label { font-size: 11px; color: var(--c-text-3); font-weight: 600; }
.sp-input {
  height: 34px; padding: 0 10px; font-size: 13px;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); background: #fff;
  min-width: 130px;
}
.sp-date { min-width: 140px; }
.sp-x { font-size: 16px; color: var(--c-text-3); padding-bottom: 6px; }
.sp-quicklinks { gap: 16px; padding-left: 4px; }
.sp-link { font-size: 12px; color: var(--c-accent); text-decoration: underline; }
.sp-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding-bottom: 4px; }
.sp-check input { width: 16px; height: 16px; }
.sp-actions { display: flex; gap: 8px; margin-top: 6px; }
.sp-actions-search { padding: 6px 0 12px; border-bottom: 1px solid var(--c-border); margin-bottom: 8px; }
.kbtn-classify {
  flex: 1 1 auto; min-height: 48px; flex-direction: column;
  font-weight: 600;
}
.kbtn-classify small { font-size: 10px; opacity: 0.85; font-weight: 500; }
.sp-classify { gap: 8px; padding: 6px 0; }

/* =================================================================
   詳細画面 (タブレット 1画面収まり前提)
   ================================================================= */
.detail-page {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh; overflow: hidden;
}

/* 詳細用ヘッダ (薄ピンク帯) */
.detail-header {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 6px 16px;
  background: #fdf3f1;
  border-bottom: 1px solid var(--c-border);
}
.dh-tabs { display: flex; gap: 0; align-self: end; }
.dh-tabs .ktab {
  padding: 6px 14px;
  font-size: 13px;
  background: #fff; color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border);
}
.dh-tabs .ktab-active {
  color: var(--c-text); font-weight: 700;
  border-bottom: 2px solid var(--c-accent);
  background: #fff;
}
.dh-right { display: flex; align-items: center; gap: 12px; font-size: 11px; }

.detail-main {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 10px 14px;
  overflow: hidden;
  height: 100%;
}
.detail-side {
  display: flex; flex-direction: column; gap: 8px;
  align-self: start;
  margin-top: 80px; /* spec table 横にくるよう */
}
.kbtn-back-large {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 18px;
  background: var(--c-accent); color: #fff;
  font-size: 14px; font-weight: 700;
  border-radius: var(--r-md); text-decoration: none;
  border: 1px solid var(--c-accent);
}
.kbtn-back-large:hover { background: var(--c-accent-2); }
.kbtn-back-large .back-icon { font-size: 18px; }

/* 詳細ペーパーカード — 1画面に収まる縦グリッド構成 */
.dpaper {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  display: grid;
  grid-template-rows:
    auto                              /* 取引情報メタ */
    auto                              /* spec table  */
    auto                              /* cutter mode */
    1fr                               /* allocation table (flex) */
    auto                              /* customer / notes */
    auto                              /* tolerance + machine */
    auto;                             /* breaks  */
  overflow: hidden;
  font-size: 12px;
}

/* 取引情報メタ */
.dp-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px 16px;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--c-border);
  font-size: 11px; color: var(--c-text);
}
.dp-meta b { color: var(--c-text-3); font-weight: 600; margin-right: 4px; }

/* 寸法・素材 spec */
.dp-spec {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--c-border);
}
.spec-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  background: #fff;
}
.spec-table th, .spec-table td {
  border: 1px solid var(--c-border);
  padding: 4px 8px;
  text-align: center;
}
.spec-table thead th {
  background: #f9fafb; font-weight: 700; font-size: 11px; color: var(--c-text-2);
}
.spec-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.spec-strong { font-size: 14px; font-weight: 700; }
.spec-sub { display: block; font-size: 10px; color: var(--c-text-3); }
.spec-subhead th {
  background: #fafbfc !important;
  font-size: 10px; font-weight: 600; color: var(--c-text-3);
}
.spec-note-row td {
  background: var(--c-yellow);
  border-color: var(--c-yellow-b);
  text-align: left;
  padding: 4px 8px;
  font-size: 12px;
}
.spec-note-tag {
  display: inline-block; padding: 1px 6px;
  background: #fef9c3; color: var(--c-yellow-t);
  border: 1px solid var(--c-yellow-b);
  border-radius: 2px; font-size: 10px; font-weight: 600;
  margin-right: 8px;
}
.dp-spec-side {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
}
.action-yellow-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px;
  background: var(--c-yellow);
  border: 1px solid var(--c-yellow-b);
  border-radius: var(--r-sm);
  font-size: 11px; font-weight: 600; color: var(--c-yellow-t);
  text-align: center; line-height: 1.3;
  flex: 1;
}
.action-yellow-box small { font-size: 9px; opacity: 0.9; font-weight: 500; }
.action-input-btn {
  background: var(--c-accent); color: #fff;
  border: none; border-radius: var(--r-sm);
  padding: 6px; font-size: 11px; font-weight: 700;
  line-height: 1.2; cursor: not-allowed; opacity: 0.55;
  min-height: 38px;
}
.action-side-id {
  display: flex; flex-direction: column;
  padding: 3px 6px; border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-sm);
  background: #fafafa;
  font-size: 10px; color: var(--c-text-3);
}
.action-side-id .ss-value {
  font-size: 14px; font-weight: 700; color: var(--c-accent);
  font-variant-numeric: tabular-nums;
}

/* 切断者モード */
.dp-cutter-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 12px;
  border-bottom: 1px solid var(--c-border);
  background: #fafbfc;
}
.cutter-title { font-size: 13px; font-weight: 700; color: var(--c-text); }
.cutter-sub { font-size: 11px; color: var(--c-text-3); }
.cutter-time-box { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--c-text-3); }
.ct-val {
  display: inline-block; min-width: 56px; padding: 3px 8px;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
  background: #fff; font-variant-numeric: tabular-nums; font-size: 11px; text-align: center;
}

.dp-cutter-actions {
  display: flex; gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--c-border);
}

.dp-alloc {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 0;
  border-bottom: 1px solid var(--c-border);
  min-height: 0;
}
.alloc-table {
  width: 100%; border-collapse: collapse; font-size: 11px; background: #fff;
}
.alloc-table th, .alloc-table td {
  border: 1px solid var(--c-border);
  padding: 4px 6px; text-align: left;
}
.alloc-table thead th { background: #f9fafb; font-weight: 700; font-size: 10px; color: var(--c-text-2); }
.alloc-empty td { background: #fafafa; padding: 14px 8px; text-align: center; color: var(--c-text-3); }
.dp-alloc-side {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6px;
  border-left: 1px solid var(--c-border);
  background: #fafafa;
}
.qr-img {
  width: 110px; height: 110px;
  border: 1px solid var(--c-border);
  background: #fff;
}
.qr-cancel {
  margin-top: 6px; padding: 4px 8px;
  background: #fff; color: var(--c-text-2);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
  font-size: 10px; line-height: 1.2; text-align: center;
  cursor: not-allowed; opacity: 0.6;
}

.dp-yield {
  display: flex; gap: 24px;
  padding: 4px 12px;
  font-size: 11px; color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border);
}

/* 客先 / 備考 */
.dp-customer {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1fr;
  gap: 6px 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--c-border);
  font-size: 11px;
}
.dp-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dp-block-wide { grid-column: span 2; }
.dp-label { font-size: 10px; color: var(--c-text-3); font-weight: 600; }
.dp-value {
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  padding: 4px 6px;
  background: #fff; min-height: 26px;
  font-size: 12px; word-break: break-word;
}
.dp-value-multi { min-height: 44px; white-space: pre-wrap; line-height: 1.3; }
.dp-stamp { padding: 4px 8px; border: 1px solid var(--c-border); border-radius: var(--r-sm); background: #fafafa; }
.dp-stamp-title { font-size: 11px; color: var(--c-accent); font-weight: 700; margin-bottom: 4px; }
.dp-stamp-row { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.dp-stamp-label { font-size: 11px; min-width: 56px; color: var(--c-text-3); }

/* 公差 + 切断機 */
.dp-tol {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr auto;
  gap: 8px 14px;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--c-border);
  font-size: 11px; color: var(--c-text-2);
}
.tol-title { font-size: 12px; font-weight: 700; color: var(--c-text); }
.tol-trio { display: flex; gap: 6px; }
.tol-trio label { display: flex; flex-direction: column; gap: 1px; font-size: 10px; color: var(--c-text-3); align-items: center; }
.tol-input {
  width: 50px; height: 24px; padding: 0 6px;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); background: #fff;
  font-variant-numeric: tabular-nums; font-size: 12px; text-align: right;
}

.dp-machine {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto auto auto;
  gap: 6px 12px; align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--c-border);
  background: #fafbfc;
  font-size: 11px;
}
.mc-label { color: var(--c-text-3); font-weight: 600; }
.mc-value { color: var(--c-text); padding: 2px 6px; border: 1px solid var(--c-border); border-radius: var(--r-sm); background: #fff; min-width: 60px; }
.mc-select { height: 28px; padding: 0 8px; min-width: 240px; border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); font-size: 12px; }

.dp-breaks {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 6px 12px;
  font-size: 11px;
}
.breaks-label { color: var(--c-text-3); font-weight: 600; }
.breaks-checks { display: flex; gap: 16px; }
.breaks-check { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.breaks-check input { width: 14px; height: 14px; }
.breaks-compare { font-size: 10px; color: var(--c-text-3); text-align: right; }

/* レスポンシブ縮退 */
@media (max-width: 1100px) {
  .dp-meta { grid-template-columns: repeat(2, 1fr); }
  .dp-customer { grid-template-columns: 1fr 1fr; }
  .dp-block-wide { grid-column: auto; }
  .dp-tol { grid-template-columns: 1fr 1fr; }
  .dp-machine { grid-template-columns: auto 1fr; row-gap: 4px; }
}
