/* The working surface is the ledger. Documents open beside it. */
.workbook-layout { display: block; min-height: 0; height: 100dvh; overflow: hidden; background: #fff; }
.workbook-layout .workspace { height: 100%; }
.workbook-layout #workflow-slot { display: none; }
.workbook-layout main { padding: 0; max-width: none; margin: 0; height: calc(100dvh - 48px); }
.workbook-bar { display: flex; gap: 20px; align-items: center; height: 48px; padding: 0 16px; background: #185b42; color: #fff; }
.workbook-bar a { color: #fff; text-decoration: none; }
.workbook-brand { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.workbook-brand .icon { width: 21px; height: 21px; }
.workbook-user { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 11px; }
.workbook-user .scope-label, .workbook-user .link-btn { color: #e1f0e8; font-size: 11px; }
.workbook-user .kind-switch { background: #ffffff18; padding: 2px; }
.workbook-user .kind-switch button { color: white; font-size: 11px; padding: 4px 10px; min-width: 44px; }
.workbook-user .kind-switch button.on { color: #185b42; background: #fff; }
.sheet-workspace { height: 100%; display: flex; flex-direction: column; min-height: 0; --primary: #217346; --primary-dark: #185b36; --primary-soft: #eaf4ee; color: #252e36; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; flex-shrink: 0; }
.sheet-title { display: flex; align-items: center; gap: 10px; }
.sheet-title > .icon { color: #217346; }
.sheet-title h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: 0; }
.sheet-heading-actions { display: flex; gap: 22px; }
.sheet-text-button { border: 0; background: none; padding: 3px 0; font-size: 12px; color: #52665b; cursor: pointer; text-decoration: none; white-space: nowrap; }
.sheet-text-button:hover { color: #185b42; text-decoration: underline; }
.sheet-text-button .icon { width: 15px; height: 15px; vertical-align: -3px; }
/* 緑の帯の右：一覧以外の画面へのリンク（帯のアプリ名が見出しを兼ねるので、表の上に見出しの行は置かない） */
.workbook-links { display: flex; align-items: center; gap: 16px; margin-left: auto; font-size: 12px; }.workbook-links a { display: inline-flex; align-items: center; gap: 4px; color: #e1f0e8; }.workbook-links a:hover { color: #fff; text-decoration: underline; }.workbook-links .icon { width: 14px; height: 14px; }
.workbook-user { margin-left: 0; padding-left: 16px; border-left: 1px solid #ffffff45; }
.sheet-export { margin-left: auto; min-height: 30px; font-weight: 500; font-size: 12px; padding: 4px 11px; border-radius: 3px; border-color: #c7d2ca; box-shadow: none; flex-shrink: 0; }.sheet-export:disabled { opacity: .55; background: #f7f8f7; color: #637268; }
/* 表の上の3段（絞り込み・状況・部署）は一つの面。段の間に線を引かず、横の余白は 16px でそろえる */
.sheet-filters { display: flex; align-items: center; gap: 10px; padding: 8px 16px 4px; background: #f6f8f6; flex-shrink: 0; }
.sheet-filters > label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #5d6b62; }
.sheet-filters select { min-height: 30px; padding: 4px 24px 4px 8px; border-radius: 3px; border-color: #ccd7cf; max-width: 220px; }
.sheet-search { flex: 1; min-width: 180px; max-width: 370px; background: #fff; border: 1px solid #ccd7cf; border-radius: 3px; padding: 0 8px; }
.sheet-search .icon { width: 15px; height: 15px; flex-basis: 15px; color: #7f9185; }
.sheet-search input { background: transparent; border: 0; min-width: 0; width: 100%; min-height: 30px; font-size: 12px; outline: none; }
.sheet-search:focus-within { outline: 2px solid #217346; }
.sheet-statusbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: #f6f8f6; min-height: 30px; flex-shrink: 0; }
.sheet-status-tabs { display: flex; align-items: center; gap: 20px; }
.sheet-status-tabs button { padding: 6px 0 4px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 12px; color: #55635a; cursor: pointer; white-space: nowrap; }
.sheet-status-tabs button.on { color: #185b42; border-bottom-color: #217346; font-weight: 700; }
.sheet-status-tabs button span { margin-left: 5px; font-variant-numeric: tabular-nums; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: 0; border: 1px solid #b8c4bc; }
.status-dot.unplaced { background: #fff; }.status-dot.quoting { background: #dce8f8; border-color: #9dbde8; }.status-dot.quoted { background: #b7d0f1; border-color: #6f9fdc; }.status-dot.waiting { background: #fff0bd; border-color: #e8ce7b; }.status-dot.delivered { background: #d9eadb; border-color: #a0c7a5; }.status-dot.reconciled { background: #9fcaa6; border-color: #5fa86a; }.status-dot.skipped { background: #e6e8e6; }
.sheet-save { color: #63796a; font-size: 11px; white-space: nowrap; }
#sheet-error { padding: 10px 20px; font-size: 12px; color: #ad3022; background: #fff1ed; }
/* 部署のシート（資材は部署ごと、機材はひとまとめ） */
.dept-tabs { display: flex; align-items: center; gap: 4px; padding: 6px 16px 0; background: #f6f8f6; border-bottom: 1px solid #c4d1c7; flex-shrink: 0; overflow-x: auto; }
.dept-caption { font-size: 11px; color: #5d6b62; margin-right: 6px; white-space: nowrap; }
.dept-tabs button { border: 1px solid #cdd8d1; border-bottom: 0; border-radius: 6px 6px 0 0; background: #e6ece8; color: #4f6357; font-size: 12px; padding: 4px 12px; cursor: pointer; white-space: nowrap; }
.dept-tabs button span { margin-left: 6px; font-size: 11px; color: #66786c; font-variant-numeric: tabular-nums; }
.dept-tabs button.on { background: #fff; color: #185b42; font-weight: 700; border-color: #9fb5a6; box-shadow: 0 1px 0 #fff; }
.dept-tabs button.dept-kizai { margin-left: 14px; }
.sheet-grid { flex: 1; min-height: 140px; overflow: auto; background: #fff; position: relative; outline-offset: -3px; overscroll-behavior: contain; }
.arrangement-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; }
.arrangement-table th, .arrangement-table td { border-right: 1px solid #d8dfda; border-bottom: 1px solid #d8dfda; padding: 4px 7px; font-size: 13px; vertical-align: middle; height: 32px; overflow-wrap: anywhere; }
.arrangement-table thead th { position: sticky; top: 0; z-index: 8; background: #edf2ee; color: #36493b; text-align: center; font-size: 12px; font-weight: 600; padding: 3px 6px; height: 26px; }
.arrangement-table thead tr:nth-child(2) th { top: 28px; }
.arrangement-table thead th[rowspan] { border-bottom: 2px solid #aabfaf; }
.arrangement-table thead tr:nth-child(2) th { border-bottom: 2px solid #aabfaf; }
.arrangement-table .quote-tone-0 { background: #e8eff7; color: #3b5874; }
.arrangement-table .quote-tone-1 { background: #f2eddf; color: #70603c; }
.arrangement-table .quote-tone-2 { background: #eceaf5; color: #635681; }
/* 注文が決まった行：注文した業者以外の見積（と空の枠）は灰色。どの業者に注文したかがひと目で分かる */
.arrangement-table .item-row td[data-decided="off"] { background: #ebeeec !important; color: #98a39c; }
.arrangement-table .item-row td[data-decided="off"] .grid-input, .arrangement-table .item-row td[data-decided="off"] .vendor-input:disabled { color: #98a39c; }
.arrangement-table .item-row td[data-decided="off"] .grid-input.unconfirmed, .arrangement-table .item-row td[data-decided="off"].unconfirmed { color: #d19a93; }
.arrangement-table .item-row td[data-decided="won"] .vendor-input:disabled { font-weight: 700; color: #1d4a30; }
.arrangement-table .quote-start { border-left: 2px solid #b8c6bf; }
.arrangement-table .col-0 { position: sticky; left: 0; z-index: 4; font-size: 11px; }
.arrangement-table .col-1 { position: sticky; left: var(--col-1-left, 122px); z-index: 4; text-align: center; }
.arrangement-table .col-2 { position: sticky; left: var(--col-2-left, 162px); z-index: 4; border-right: 2px solid #9fb5a6; font-weight: 500; }
.arrangement-table td.row-handle { color: #4e5f54; user-select: none; }
/* 品名・規格・申請数もセルで直せる（申請書の間違いの訂正）。単位と「要確認」は入力欄の右端に重ねる */
.arrangement-table .col-2 .grid-input.name-input { font-weight: 600; }
/* col-2 は sticky（位置指定あり）なので、そのまま絶対配置の基準になる */.arrangement-table td.name-cell .cell-review { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: inline; pointer-events: none; }
.arrangement-table td.name-cell:has(.cell-review) > .grid-input { padding-right: 46px; }
.arrangement-table td.qty-cell { position: relative; }.arrangement-table td.qty-cell > .grid-input.grid-input { padding-right: 34px; }
.arrangement-table td.qty-cell > small { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); max-width: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; color: #55635a; }
.arrangement-table td.qty-cell > .grid-input::-webkit-inner-spin-button { display: none; }
/* 積込（航海名）ごとに縦に結合した欄 */
.block-moved { font-size: 11px; color: #a3551a; background: #fff1e3; padding: 1px 6px; border-radius: 3px; }
/* 申請ごとに縦に結合した左の欄（Excel の結合セルと同じ見え方） */
.arrangement-table td.block-cell { background: #f5f8f6 !important; vertical-align: top; border-bottom: 2px solid #aabfaf; padding: 8px 8px; }
.block-date { font-size: 13px; font-weight: 700; color: #253c2e; }
.block-info { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.block-info > * { align-self: flex-start; margin: 0; text-align: left; white-space: normal; max-width: 100%; }
.block-info .group-select { font-size: 13px; font-weight: 700; color: #1d4a30; padding: 0; line-height: 1.3; text-align: left; }
.block-info .group-select:hover { text-decoration: underline; }
.block-dept { font-size: 12px; font-weight: 600; color: #3f5a48; }
.block-meta { font-size: 11px; color: #6b7d72; }
.block-info .group-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin: 8px 0 0; white-space: nowrap; }
.block-info .group-actions button { font-size: 11px; color: #217346; text-decoration: underline; }
/* 積込（航海名）ごとのブロック：上に帯を置き、ブロックの間を空ける */
.arrangement-table .voyage-row td { padding: 0; border-left: 0; border-right: 0; background: #eef2ef; border-top: 14px solid #eef1ee; border-bottom: 2px solid #217346; }
.arrangement-table tbody .voyage-row:first-child td { border-top: 0; }
.voyage-band { position: sticky; left: 0; display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 14px 0 12px; max-width: calc(100vw - 24px); box-sizing: border-box; border-left: 6px solid #217346; background: #e3ede6; }
.voyage-band-name { padding: 0; border: 0; background: none; font-size: 15px; font-weight: 700; color: #1d4a30; cursor: pointer; letter-spacing: .02em; }.voyage-band-name:hover { text-decoration: underline; }
.voyage-band small { font-size: 11px; color: #4f6656; }.voyage-band-caption { font-size: 12px; color: #4f6656; margin-right: -6px; }
.arrangement-table thead .base-col:nth-child(-n+3) { z-index: 14; }
.arrangement-table .item-row td { background: #fff; }
.arrangement-table .item-row.row-quoting td, .arrangement-table .item-row.row-quoted td { background: #f4f8fd; }
.arrangement-table .item-row.row-waiting td { background: #fff9e9; }
.arrangement-table .item-row.row-delivered td, .arrangement-table .item-row.row-reconciled td { background: #eef6ed; }
.arrangement-table .item-row.row-skipped td { background: #f2f3f2; color: #7c837f; }
.arrangement-table .item-row:hover td { background: #f0f6f2; }
.arrangement-table .item-row.selected-row td { background: #e1efe7; }
.arrangement-table td.range { background: #d7e8dc !important; box-shadow: inset 0 0 0 1px #217346; }
.sheet-grid.ranging, .sheet-grid.ranging * { user-select: none; cursor: cell; }
.sheet-menu .menu-head { font-size: 11px; color: #55665b; padding: 6px 12px 5px; border-bottom: 1px solid #dfe6e1; margin-bottom: 4px; white-space: nowrap; }
.arrangement-table .sheet-group td { padding: 0; height: 36px; background: #e8eee9; border-top: 1px solid #b9cbbd; border-bottom: 1px solid #c4d3c7; }
.sheet-group td > div { display: flex; align-items: center; gap: 20px; position: sticky; left: 0; width: calc(100vw - 24px); padding: 6px 12px; min-height: 36px; }
.group-select { border: 0; background: transparent; color: #284d34; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }.group-select span { font-size: 11px; font-weight: 400; color: #58705f; }
.group-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; white-space: nowrap; }.group-actions button { border: 0; background: none; color: #4f6b58; cursor: pointer; font-size: 11px; padding: 0; }.group-actions button:hover { text-decoration: underline; color: #185b42; }
/* 機器の見出し行。結合した左の欄と同じ行に並ぶので、見出しのセルだけに当てる */
.arrangement-table .equipment-row td.equipment-label { height: 27px; padding: 4px 12px; background: #f5f7f5; color: #45664e; font-weight: 600; font-size: 11px; }
.equipment-row td.equipment-label > span { position: sticky; left: calc(var(--col-1-left, 122px) + 12px); display: inline-block; max-width: calc(100vw - var(--col-1-left, 122px) - 60px); }
/* Excel と同じく、入力欄はセルいっぱいに広げる（セルの中に小さな枠を作らない）。
   入力欄だけのセルは高さも行に合わせる（td の height:1px は、子の height:100% を行の高さに解決させるための書き方） */
.arrangement-table td:has(.grid-input) { padding: 0; cursor: text; }
.arrangement-table td:has(> .grid-input) { height: 1px; }
.arrangement-table td:has(> .grid-input) > .grid-input { height: 100%; }
.arrangement-table .grid-input { width: 100%; min-width: 0; max-width: none; min-height: 30px; padding: 4px 7px; margin: 0; border: 1px solid transparent; border-radius: 0; font-size: 13px; background: transparent; color: #253c2e; box-shadow: none; font-variant-numeric: tabular-nums; }
.arrangement-table .grid-input:hover:not(:disabled) { background: #fff; border: 1px solid #b3cbbb; }
.arrangement-table .grid-input:focus { outline: 2px solid #217346; outline-offset: -2px; background: #fff; position: relative; z-index: 5; }
.arrangement-table .grid-input:disabled { color: #59675e; cursor: default; }
.arrangement-table .grid-input.saving { background: #fff7d6; }
.arrangement-table .grid-input.save-error { background: #ffe4df; border-color: #bc3824; }
.arrangement-table input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.arrangement-table input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.arrangement-table input[type=checkbox] { width: 14px; height: 14px; margin: 0; vertical-align: middle; }
.cell-link, .cell-add { font-size: 11px; background: none; color: #236f43; border: 0; padding: 0; cursor: pointer; text-align: left; }
.cell-link:hover { text-decoration: underline; }.cell-add { color: #779181; white-space: nowrap; }.cell-add:hover { color: #217346; }
.cell-placeholder { color: #a0aaa3; font-size: 11px; }
.sheet-grid.dragging, .sheet-grid.dragging * { user-select: none; cursor: default; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* ドラッグ中（行の上でないとき）は、表の下の「申請書の入れ口」だけを光らせる。表全体を点線で囲まない */
.arrangement-table .item-row.row-new td { animation: row-new-flash 6s ease-out forwards; }
@keyframes row-new-flash { 0%, 40% { background: #cfeed9; } 100% { background: #fff; } }
.arrangement-table .sheet-dropzone td { padding: 0; height: 48px; border-right: 0; background: #fff; }
.sheet-dropzone td > div { display: flex; align-items: center; gap: 10px; position: sticky; left: 0; width: calc(100vw - 32px); min-height: 44px; padding: 6px 14px; margin: 12px 0 16px; border: 1px dashed #a9c4b3; border-radius: 4px; color: #5d7466; font-size: 12px; }
.sheet-dropzone td > div > small { margin-left: auto; font-size: 11px; color: #7f9186; }
.sheet-dropzone .icon { width: 16px; height: 16px; color: #217346; }
.sheet-dropzone [data-pick-file] { margin-left: 4px; color: #217346; text-decoration: underline; cursor: pointer; }
.sheet-grid.drop-over .sheet-dropzone td > div { border-color: #217346; background: #e9f3ec; color: #185b42; }
.sheet-grid.filling, .sheet-grid.filling * { user-select: none; cursor: crosshair; }
.arrangement-table .vendor-cell { position: relative; }
.fill-handle { position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; background: #217346; border: 1px solid #fff; cursor: crosshair; display: none; z-index: 6; }
.arrangement-table .vendor-cell:hover .fill-handle, .arrangement-table .vendor-cell:focus-within .fill-handle { display: block; }
.arrangement-table td.fill-target { outline: 2px dashed #217346; outline-offset: -2px; background: #e9f3ec !important; }
.arrangement-table .item-row td { cursor: default; }
.arrangement-table .vendor-input::placeholder { color: #7f9588; }
.arrangement-table .vendor-input:disabled { color: #253c2e; }
.arrangement-table td.num-date { font-size: 12px; color: #4e5f54; white-space: nowrap; text-align: center; }.arrangement-table td.num-date.overdue { color: #c0392b; font-weight: 700; }
.arrangement-table td.quote-date { font-size: 12px; color: #4e5f54; white-space: nowrap; text-align: center; }.arrangement-table td.quote-date.waiting { color: #2c5fa8; }
.arrangement-table th.sortable { cursor: pointer; }.arrangement-table th.sortable:hover { background: #dfe9e2; }.sort-mark { margin-left: 4px; font-size: 10px; color: #217346; }
.cell-due { display: block; padding: 3px 7px 0; font-size: 11px; color: #c0392b; white-space: nowrap; }
/* 納入日（上に「予定」の小さな表示）と業者名（下に「回答あり」などの小さな表示）も、入力欄はセルいっぱい。小さな表示は欄の上に重ねる */
.arrangement-table td:has(> .cell-due) { height: 1px; position: relative; }
.arrangement-table td:has(> .cell-due) > .grid-input { height: 100%; padding-top: 18px; }
.arrangement-table td:has(> .cell-due) > .cell-due { position: absolute; top: 3px; left: 0; pointer-events: none; }
.arrangement-table td.vendor-cell { height: 1px; }
.arrangement-table td.vendor-cell > .vendor-input { height: 100%; }
.arrangement-table td.vendor-cell:has(.vendor-notes:not(:empty)) > .vendor-input { padding-bottom: 22px; }
.vendor-notes { position: absolute; left: 7px; right: 7px; bottom: 4px; display: flex; flex-direction: column; gap: 1px; pointer-events: none; line-height: 1.2; }
.vendor-notes:empty { display: none; }.vendor-notes .vendor-chip { padding: 0; }
.vendor-new { display: flex; gap: 8px; margin: 12px 0 4px; }
.vendor-new input { flex: 1; min-width: 0; }.cell-review { display: block; font-size: 11px; color: #ab6624; }.arrangement-table small { font-size: 11px; }
.quote-amount { font-variant-numeric: tabular-nums; color: #354c3e; }
/* 進み具合：5段（見積依頼→見積回答→発注→納入→照合）の帯と、今の段階の名前 */
.arrangement-table td.stage-cell { padding: 4px 8px; vertical-align: middle; }
.stage { display: flex; flex-direction: column; gap: 4px; }
.stage-bar { display: flex; gap: 2px; }.stage-bar i { flex: 1; height: 5px; background: #e2e7e3; border-radius: 1px; }
.stage-bar i.on { background: #217346; }.stage-quoting .stage-bar i.on, .stage-quoted .stage-bar i.on { background: #3b7dd8; }.stage-waiting .stage-bar i.on { background: #d9a520; }.stage-skipped .stage-bar i { background: #d5d9d6; }
.stage-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.stage-text b { font-size: 12px; font-weight: 700; color: #4e5f54; white-space: nowrap; }
.stage-quoting .stage-text b, .stage-quoted .stage-text b { color: #2c5fa8; }.stage-waiting .stage-text b { color: #95611e; }.stage-delivered .stage-text b, .stage-reconciled .stage-text b { color: #37703d; }.stage-skipped .stage-text b { color: #7c837f; font-weight: 400; }
.stage-text small { font-size: 11px; color: #586a5f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 赤字：書類から入れた未確認の金額。確かめて Enter か「赤字を確定」で黒字になる */
.arrangement-table .grid-input.unconfirmed, .arrangement-table td.unconfirmed { color: #c0392b; font-weight: 700; }
.arrangement-table td.cell-diff { background: #fdecea !important; box-shadow: inset 3px 0 0 #e57368; }
.btn-confirm:not(:disabled) { border-color: #c0392b; color: #c0392b; font-weight: 700; }
.block-info .block-stages.has-red { color: #b03a2e; }
/* 積込ごとの業者別合計：品目の計・送料など・合計 */
/* 積込ごとの業者別合計：業者の枠ごとに小さな集計表。品目の列は使わない */
.arrangement-table .voyage-sum td { background: #f4f8f5 !important; border-right: 0; border-bottom: 3px solid #217346; vertical-align: top; padding: 6px 10px 8px; height: auto; }
/* 見出しのセルは結合して幅が広いので、セル自体は固定せず中の文字だけを左に固定する（セルを固定すると右の集計表を覆ってしまう） */
.arrangement-table .voyage-sum td.sum-caption { font-size: 12px; font-weight: 700; color: #35563f; line-height: 1.5; vertical-align: top; }
.arrangement-table .voyage-sum td.sum-caption > span { position: sticky; left: 10px; display: inline-block; }
.arrangement-table .voyage-sum td.sum-card { border-left: 2px solid #b8c6bf; padding: 6px 10px 8px !important; cursor: default; }
.sum-box { display: flex; flex-direction: column; gap: 3px; max-width: 460px; }
.sum-vendor { font-size: 13px; font-weight: 700; color: #1d4a30; margin-bottom: 2px; }
.sum-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #4e5f54; min-height: 24px; }
.sum-line > span:first-child { flex: 1; }.sum-line small { margin-left: 4px; font-size: 11px; color: #7f9086; }
.sum-line b { min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; color: #24322a; font-weight: 500; }
.sum-line.sum-total { border-top: 1px solid #9fb5a6; margin-top: 2px; padding-top: 5px; }.sum-line.sum-total > span:first-child { font-weight: 700; color: #1d4a30; }.sum-line.sum-total b { font-weight: 700; font-size: 13px; }
.sum-del { width: 18px; color: #b03a2e; padding: 0; text-align: center; }.sum-del-space { width: 18px; flex: none; }
.arrangement-table .voyage-sum .grid-input.sum-input { width: 92px; flex: none; min-height: 24px; height: 24px; padding: 2px 6px; text-align: right; border: 1px solid #cdd8d1; background: #fff; font-size: 12px; }
.arrangement-table .voyage-sum .grid-input.sum-name-input { flex: 1; width: auto; text-align: left; }
.arrangement-table .voyage-sum .grid-input.sum-input::placeholder { color: #93a399; font-weight: 400; }
.arrangement-table .voyage-sum .grid-input.sum-input.unconfirmed { color: #c0392b; font-weight: 700; }
.doc-form { display: flex; flex-direction: column; gap: 12px; }.doc-form h2 { margin: 0; font-size: 17px; }.doc-file { margin: 0; font-size: 12px; color: #5d6f63; word-break: break-all; }.doc-file span { margin-left: 8px; color: #66786c; }
.doc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #4e5f54; }.doc-form select, .doc-form input { font: inherit; padding: 6px 8px; border: 1px solid #b8c6bb; border-radius: 4px; }
.doc-row { display: flex; gap: 12px; }.doc-row label { flex: 1; }.doc-note { margin: 0; font-size: 12px; color: #b03a2e; }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.vendor-chip { display: block; padding: 0 7px 3px; font-size: 11px; white-space: nowrap; }.vendor-chip.asked { color: #2c5fa8; }.vendor-chip.replied { color: #37703d; }
.block-info .block-bar { display: flex; align-self: stretch; height: 6px; gap: 1px; margin-top: 4px; }.block-bar i { display: block; height: 100%; background: #e2e7e3; }
.block-bar .seg-quoting { background: #9dbde8; }.block-bar .seg-quoted { background: #3b7dd8; }.block-bar .seg-waiting { background: #e8ce7b; }.block-bar .seg-delivered { background: #8fc496; }.block-bar .seg-reconciled { background: #4f9a5b; }.block-bar .seg-skipped { background: #c9cfcb; }
.block-info .block-stages { font-size: 11px; color: #5d6f63; line-height: 1.35; }.block-info .block-notice { font-size: 11px; color: #37703d; }
/* ドラッグ中：落とす先の申請の行と、業者の列 */
.arrangement-table .item-row.drop-target td, .arrangement-table td.block-cell.drop-target { background: #e3f0e7 !important; }
.doc-where { margin: 0; padding: 8px 10px; background: #f1f6f2; border-radius: 4px; font-size: 13px; font-weight: 700; color: #1d4a30; }.doc-where span { margin-left: 8px; font-size: 11px; font-weight: 400; color: #5d6f64; }.doc-targets { margin: 0; font-size: 12px; color: #4e5f54; line-height: 1.6; }.doc-warn { margin: 0; font-size: 12px; color: #b03a2e; }
.sheet-bottom { display: flex; align-items: center; gap: 14px; height: 34px; background: #f6f8f6; border-top: 1px solid #c4d1c7; flex-shrink: 0; padding: 0 16px 0 0; }
.ship-tabs { display: flex; overflow: auto; align-self: stretch; margin-right: auto; min-width: 0; }.ship-tabs button { display: flex; align-items: center; gap: 7px; border: 0; border-right: 1px solid #d9e0da; border-top: 3px solid transparent; background: transparent; font-size: 12px; color: #526859; padding: 7px 20px; cursor: pointer; white-space: nowrap; }.ship-tabs .on { background: #fff; color: #185b42; border-top-color: #217346; font-weight: 700; }.ship-tabs .icon { width: 15px; height: 15px; flex-basis: 15px; }
#sheet-selection { font-size: 11px; color: #6b7d72; white-space: nowrap; }
.sheet-loading, .sheet-empty { padding: 80px 20px; text-align: center; color: #64756a; }.sheet-empty h2 { font-size: 17px; color: #344f3d; margin: 18px 0 8px; }.sheet-empty p { font-size: 13px; margin-bottom: 24px; }.sheet-empty .icon { width: 36px; height: 36px; color: #87a38f; }
.sheet-drawer { position: fixed; top: 48px; right: 0; bottom: 0; width: min(1100px, 88vw); z-index: 40; background: #f7f9f7; border-left: 1px solid #adbfb2; box-shadow: -12px 0 40px #173b2626; display: flex; flex-direction: column; }
/* 引き出しの帯は1段：戻る・工程のタブ・対象の選択。題名は中身の見出しに任せる */
.drawer-bar { display: flex; align-items: center; gap: 20px; min-height: 46px; padding: 0 24px; background: #fff; border-bottom: 1px solid #d6dfd8; }.drawer-bar .btn { font-size: 12px; min-height: 30px; padding: 4px 10px; flex-shrink: 0; }.drawer-bar select { margin-left: auto; max-width: 300px; min-height: 30px; padding-top: 3px; padding-bottom: 3px; }
#drawer-nav { display: flex; align-self: stretch; min-width: 0; overflow-x: auto; gap: 22px; }#drawer-nav:empty { display: none; }#drawer-nav button { border: 0; border-bottom: 2px solid transparent; padding: 14px 0 12px; background: none; font-size: 12px; color: #607367; cursor: pointer; white-space: nowrap; }#drawer-nav .on { border-bottom-color: #217346; color: #185b42; font-weight: 700; }
.drawer-content { padding: 20px 24px 40px; overflow: auto; min-height: 0; flex: 1; }.drawer-content .crumb { display: none; }.drawer-content h1 { font-size: 18px; margin-bottom: 2px; }.drawer-content h2 { font-size: 14px; margin-bottom: 8px; }.drawer-content .page-head { margin-bottom: 16px; align-items: center; }.drawer-content .lead { font-size: 12px; line-height: 1.6; }.drawer-content .two-col { grid-template-columns: 175px minmax(0, 1fr); gap: 16px; }.drawer-content .split { grid-template-columns: minmax(0, 1fr); }.drawer-content .metrics { display: none; }.drawer-content .card { padding: 16px 18px; margin-bottom: 14px; border-radius: 4px; box-shadow: none; }.drawer-content .card.compact { padding: 12px 18px; }.drawer-content .table-wrap { border-radius: 3px; margin-top: 10px; }.drawer-content .btn { border-radius: 3px; min-height: 34px; padding: 6px 12px; }.drawer-content .btn-primary { padding: 7px 16px; }
/* 引き出しの表・枠・入力欄の余白は一覧と同じ密度に近づける */
.drawer-content th, .drawer-content td { padding: 8px 12px; }.drawer-content thead th { padding-top: 8px; padding-bottom: 8px; }.drawer-content .actions { margin: 14px 0; }.drawer-content .notice { padding: 9px 12px; margin-bottom: 10px; }.drawer-content .info-grid { gap: 10px 20px; }.drawer-content .info-grid dt { margin-bottom: 3px; }.drawer-content input[type="text"], .drawer-content input[type="number"], .drawer-content input[type="date"], .drawer-content select { min-height: 32px; padding: 5px 9px; }.drawer-content .mail-field { margin-bottom: 10px; }.drawer-content .mail-value { padding: 8px 10px; line-height: 1.7; }.drawer-content .tabs { margin-bottom: 14px; }.drawer-content .tab { padding: 7px 14px; }.drawer-content .todo li a { padding: 10px 10px; }.drawer-content .todo h2 { padding-bottom: 10px; }.drawer-content .import-guide { margin-bottom: 16px; }.drawer-content .import-guide div { padding: 14px 16px; }.drawer-content .dropzone { min-height: 140px; padding: 24px 20px; }
.vendor-dialog { border: 1px solid #bdcec2; border-radius: 6px; padding: 24px; width: min(480px, calc(100vw - 32px)); max-height: 85dvh; color: #2f4537; box-shadow: 0 16px 64px #193b2b38; }.vendor-dialog::backdrop { background: #142c2255; }.vendor-options { display: flex; flex-direction: column; max-height: 45vh; overflow: auto; gap: 0; border-top: 1px solid #e2e9e4; }.vendor-options label { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid #e2e9e4; }.vendor-dialog .actions { margin-bottom: 0; }
@media (max-width: 600px) {
  .sheet-heading { flex-wrap: wrap; gap: 6px; }
  .sheet-title { flex: 1 1 100%; }.sheet-title h1 { white-space: nowrap; }.sheet-title #sheet-total { white-space: nowrap; }
  .sheet-heading-actions { margin-left: auto; }
  
}
@media (max-width: 1100px) { .sheet-filters { gap: 10px; padding: 8px 14px; }.sheet-status-tabs { gap: 14px; }.sheet-save { max-width: 220px; overflow: hidden; text-overflow: ellipsis; } }
@media (max-width: 800px) { .workbook-bar { padding: 0 12px; gap: 10px; }.workbook-brand strong { font-size: 12px; }.workbook-user-name, .workbook-user .scope-label, .workbook-links { display: none; }.workbook-user { gap: 8px; }.sheet-heading { padding: 12px 14px 8px; }.sheet-title h1 { font-size: 17px; }.sheet-title > .icon { display: none; }.sheet-heading-actions { gap: 12px; }.sheet-heading-actions a { font-size: 11px; }.sheet-filters { flex-wrap: wrap; gap: 8px; }.sheet-filters select { max-width: 140px; }.sheet-search { order: 5; flex-basis: 100%; max-width: none; }.sheet-filters > .sheet-text-button { display: none; }.sheet-statusbar { padding: 0 12px; }.sheet-status-tabs { gap: 12px; overflow: auto; }.sheet-status-tabs button { font-size: 11px; }.sheet-save, #sheet-selection, .sheet-dropzone td > div > small { display: none; }.arrangement-table .col-1,.arrangement-table .col-2,.arrangement-table .col-3,.arrangement-table .col-4 { position: static; }.group-actions { display: none; }.sheet-group td > div { width: calc(100vw - 20px); }.sheet-bottom { height: 42px; padding-right: 8px; gap: 8px; }.ship-tabs button { padding: 7px 12px; font-size: 11px; }#sheet-selection { font-size: 11px; max-width: 100px; white-space: normal; }.sheet-drawer { width: 100%; }.drawer-bar { flex-wrap: wrap; gap: 10px; padding: 8px 12px; }#drawer-nav { gap: 14px; }#drawer-nav button { padding: 8px 0; }.drawer-bar select { width: 100%; max-width: none; }.drawer-content { padding: 16px 12px 32px; }.drawer-content .two-col { grid-template-columns: minmax(0, 1fr); }.sheet-export { margin-left: 0; min-height: 32px; } }
@media print { .workbook-bar, .sheet-filters, .sheet-statusbar, .sheet-bottom, .sheet-drawer, .group-actions, .cell-add { display: none !important; }.workbook-layout, .workbook-layout main, .sheet-workspace, .sheet-grid { display: block; height: auto; overflow: visible; }.arrangement-table { width: 100% !important; font-size: 8px; }.arrangement-table th, .arrangement-table td { position: static !important; font-size: 8px; }.arrangement-table .grid-input { font-size: 8px; }.sheet-heading { padding: 0 0 12px; } }

/* ---- 行は常に Excel と同じ密度（切り替えなし。以下が基本の規則より優先される） ---- */
/* 入力欄のあるセルは余白 0 のまま（入力欄 = セル。Excel と同じ見え方）。高さは入力欄の最小高さで決まる */
.sheet-grid .arrangement-table th, .sheet-grid .arrangement-table td:not(:has(.grid-input)) { height: 26px; padding: 2px 6px; }
.sheet-grid .arrangement-table td:has(.grid-input) { padding: 0; }
.sheet-grid .arrangement-table .grid-input { min-height: 26px; padding: 2px 6px; font-size: 13px; }
.sheet-grid .arrangement-table td.stage-cell { padding: 2px 6px; }.sheet-grid .stage { flex-direction: row; align-items: center; gap: 6px; }.sheet-grid .stage-bar { width: 44px; flex: none; }.sheet-grid .stage-text small { display: none; }
.sheet-grid .vendor-notes { display: none; }.sheet-grid .arrangement-table td.vendor-cell:has(.vendor-notes:not(:empty)) > .vendor-input { padding-bottom: 2px; }
.sheet-grid .arrangement-table td:has(> .cell-due) > .grid-input { padding-top: 2px; }.sheet-grid .cell-due { display: none; }
/* 詰めた表示では申請の欄を横並びにして、品目が少ない申請でも行が高くならないようにする */
.sheet-grid .arrangement-table td.block-cell { padding: 3px 8px; }.sheet-grid .block-info { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.sheet-grid .block-info .block-stages, .sheet-grid .block-info .block-bar { display: none; }.sheet-grid .block-info .block-date { font-size: 12px; }.sheet-grid .block-info .block-meta { font-size: 11px; }

.sheet-grid .arrangement-table .voyage-row td { border-top-width: 8px; }.sheet-grid .voyage-band { height: 28px; }
/* ---- 列幅の変更 ---- */
.arrangement-table th { position: relative; }
.col-resizer { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 3; }.col-resizer:hover { background: #217346; opacity: .5; }
.sheet-grid.resizing, .sheet-grid.resizing * { cursor: col-resize !important; user-select: none; }
/* ---- 担当区分と部署の並び ---- */
.dept-tabs .kind-switch { display: flex; gap: 2px; padding: 2px; margin-bottom: 4px; background: #dfe7e1; border-radius: 5px; }
.dept-tabs .kind-switch button { border: 0; border-radius: 4px; background: transparent; color: #4f6357; font-size: 12px; font-weight: 600; padding: 4px 14px; cursor: pointer; }.dept-tabs .kind-switch button.on { background: #185b42; color: #fff; }
.dept-divider { width: 1px; height: 22px; background: #c4d1c7; margin: 0 10px 4px 8px; }
/* ---- リボンの案内 ---- */
/* 右クリックのメニュー */
.sheet-menu { position: fixed; z-index: 60; min-width: 230px; padding: 4px; background: #fff; border: 1px solid #b8c6bb; border-radius: 4px; box-shadow: 0 8px 24px #1d3b2a33; display: flex; flex-direction: column; }
.sheet-menu[hidden] { display: none; }
.sheet-menu button { text-align: left; border: 0; background: none; padding: 7px 12px; font-size: 12px; color: #24322a; cursor: pointer; border-radius: 3px; white-space: nowrap; }
.sheet-menu button:hover:not(:disabled), .sheet-menu button:focus-visible { background: #e9f3ec; outline: none; }
.sheet-menu button:disabled { color: #9aa79f; cursor: default; }
.sheet-menu hr { border: 0; border-top: 1px solid #dfe6e1; margin: 4px 0; }

/* 設定の利用者の表：無効にした人は薄く */
.drawer-content tr.is-disabled td { color: #98a39c; }
