:root {
  --navy: #17324d;
  --blue: #2563a8;
  --sky: #eaf3fb;
  --green: #14866d;
  --ink: #17202a;
  --muted: #657382;
  --line: #dce3e9;
  --paper: #ffffff;
  --bg: #f3f6f8;
  --column-head-height: 74px;
  --collapsed-column-width: 72px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: "Pretendard", "Noto Sans KR", Arial, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 8px; padding: 10px 16px; color: white; background: var(--blue); cursor: pointer; font-weight: 700; }
button.secondary, .import-label { color: var(--navy); background: #edf2f6; border: 1px solid #d7e0e7; }
button.dark { background: var(--navy); }
button.small { padding: 7px 11px; font-size: 13px; }
#sharedStatus { flex-basis: 100%; max-width: 100%; color: #e3edf6; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.topbar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 224px; padding: 16px 16px 24px; color: white; background: linear-gradient(165deg, #102b44, #245a86); display: flex; flex-direction: column; gap: 18px; box-shadow: 8px 0 24px rgba(18, 42, 64, .16); transition: width .2s ease, padding .2s ease; }
.collapse-toggle { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(255,255,255,.12); color: white; font-size: 18px; line-height: 1; }
.nav-collapse-toggle { position: absolute; top: calc((var(--column-head-height) - 28px) / 2); right: 12px; z-index: 2; }
.brand-block { flex: 0 0 var(--column-head-height); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 22px 0 8px; border-bottom: 1px solid rgba(255,255,255,.18); text-align: center; }
.topbar h1 { margin: 0; font-size: 18px; line-height: 1.22; letter-spacing: -.2px; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: 1.6px; font-weight: 800; opacity: .72; }
.top-actions { display: flex; gap: 8px; order: 1; }
.document-action-bar { display: none; }
.user-session-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; padding-right: 42px; color: white; font-size: 11px; font-weight: 800; }
#currentUserBadge { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; max-width: 144px; min-width: 0; min-height: 34px; padding: 5px 9px; border-radius: 10px; background: rgba(255,255,255,.14); overflow: hidden; line-height: 1.15; }
#currentUserBadge span, #currentUserBadge small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#currentUserBadge small { margin-top: 2px; opacity: .82; font-size: 9.5px; }
.user-session-bar #logoutButton, .user-session-bar #changePasswordButton { flex: 0 0 auto; min-height: 28px; padding: 5px 8px; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.12); color: white; font-size: 11px; }
.main-nav { display: grid; gap: 8px; }
.main-nav button { display: grid; grid-template-columns: 28px 22px 1fr; align-items: center; gap: 5px; width: 100%; min-height: 50px; padding: 9px 7px; border: 1px solid transparent; background: transparent; color: rgba(255,255,255,.78); text-align: left; white-space: nowrap; }
.main-nav button .nav-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.9); font-style: normal; font-size: 14px; }
.main-nav button span { color: rgba(255,255,255,.46); font-size: 10.5px; font-weight: 900; letter-spacing: 0; }
.main-nav button b { min-width: 0; overflow: visible; text-overflow: clip; font-size: 13.5px; }
.main-nav button:hover { background: rgba(255,255,255,.1); color: white; }
.main-nav button.active { color: var(--navy); background: white; box-shadow: 0 10px 24px rgba(0,0,0,.13); }
.main-nav button.active .nav-icon { background: #e8f1f8; color: var(--blue); }
.main-nav button.active span { color: #7890a3; }
.main-nav button.permission-hidden { display: none; }
.permission-entry { margin-top: auto; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 9px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.1); color: rgba(255,255,255,.92); text-align: left; }
.permission-entry.hidden { display: none; }
.permission-entry .nav-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.14); font-style: normal; }
.permission-entry b { font-size: 12px; }
main { margin-left: 224px; padding: 0 24px 50px; }
body.nav-collapsed .topbar { width: var(--collapsed-column-width); padding: 0 10px 18px; align-items: center; }
body.nav-collapsed .brand-block { width: 100%; flex-basis: var(--column-head-height); justify-content: flex-end; padding: 0 0 8px; text-align: center; }
body.nav-collapsed .brand-block .eyebrow, body.nav-collapsed .brand-block h1, body.nav-collapsed .main-nav button span, body.nav-collapsed .main-nav button b, body.nav-collapsed .permission-entry b, body.nav-collapsed .user-session-bar { display: none; }
body.nav-collapsed .main-nav button { grid-template-columns: 1fr; justify-items: center; min-height: 44px; padding: 8px; }
body.nav-collapsed .main-nav button .nav-icon { width: 32px; height: 32px; }
body.nav-collapsed .permission-entry { grid-template-columns: 1fr; justify-items: center; padding: 8px; }
body.nav-collapsed .nav-collapse-toggle { top: calc((var(--column-head-height) - 28px) / 2); right: 50%; transform: translateX(50%); }
body.nav-collapsed main { margin-left: var(--collapsed-column-width); }
.app-page { display: none; }
.app-page.active { display: block; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-heading h2 { margin: 4px 0; color: var(--navy); }
.page-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: 0 5px 18px rgba(27,54,76,.05); }
.panel h3 { margin: 0 0 15px; color: var(--navy); font-size: 16px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.summary-grid article { background: var(--paper); border: 1px solid var(--line); padding: 17px 20px; border-radius: 12px; box-shadow: 0 5px 16px rgba(27, 54, 76, .05); }
.summary-grid span, .calculation-panel span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.summary-grid strong { font-size: 22px; }
.summary-grid .profit-card { border-left: 5px solid var(--green); }
.workspace { display: grid; grid-template-columns: 280px minmax(700px, 1fr); gap: 18px; align-items: start; padding-top: 0; }
body.doc-list-collapsed .workspace { grid-template-columns: var(--collapsed-column-width) minmax(900px, 1fr); }
.sidebar, .draft-editor-column, .document-preview { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 18px rgba(27, 54, 76, .05); }
.sidebar { padding: 18px; position: sticky; top: 0; overflow: hidden; transition: padding .2s ease; border-top-left-radius: 0; border-top-right-radius: 0; align-self: start; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--column-head-height); margin: -18px -18px 14px; padding: 0 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #f8fbfd); }
.sidebar h2 { margin: 0; font-size: 17px; }
.sidebar-collapse-toggle { flex: 0 0 auto; border-color: #d7e0e7; background: #edf2f6; color: var(--navy); }
body.doc-list-collapsed .sidebar { min-height: calc(100vh - 90px); padding: 0; display: grid; grid-template-rows: var(--column-head-height) 1fr; justify-items: center; }
body.doc-list-collapsed .sidebar-head { justify-content: center; align-items: start; min-height: var(--column-head-height); width: 100%; margin: 0; padding: calc((var(--column-head-height) - 28px) / 2) 0 0; }
body.doc-list-collapsed .sidebar h2, body.doc-list-collapsed .sidebar .filters, body.doc-list-collapsed .sidebar .document-list, body.doc-list-collapsed .sidebar .full { display: none; }
body.doc-list-collapsed .sidebar-collapse-toggle { transform: none; }
body.doc-list-collapsed .sidebar::after,
body.editor-pane-collapsed .draft-editor-column::after,
body.preview-pane-collapsed .document-preview::after {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  align-self: start;
  justify-self: center;
  margin-top: 14px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.1;
  opacity: .76;
}
body.doc-list-collapsed .sidebar::after { content: "문서 목록"; }
body.nav-collapsed.doc-list-collapsed .editor { grid-template-columns: minmax(920px, 1.35fr) minmax(430px, .65fr); }
.filters { display: grid; gap: 8px; }
input, select, textarea { width: 100%; border: 1px solid #ccd7df; border-radius: 7px; padding: 9px 10px; background: white; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #b8d6ef; border-color: var(--blue); }
.document-list { margin: 14px 0; max-height: 560px; overflow-y: auto; }
.document-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.document-card:hover { border-color: var(--blue); background: #f7fbff; }
.document-card strong, .document-card small { display: block; }
.document-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.document-card .document-no { color: #5c6b76; font-size: 11px; font-weight: 800; }
.document-card .doc-line { margin-top: 4px; color: var(--ink); line-height: 1.25; }
.document-card .date-line { color: var(--muted); font-size: 11px; }
.document-card .project-line { font-size: 13px; font-weight: 900; }
.document-card small { color: var(--muted); margin-top: 4px; }
.document-card .amount { margin-top: 7px; color: var(--green); font-weight: 800; }
.document-card-actions { display: flex; gap: 5px; margin-top: 8px; }
.document-card-actions button { flex: 1; padding: 5px 6px; font-size: 10px; }
.editor.archived-locked { position: relative; background: #f8fafb; }
.editor.archived-locked::before { content: "읽기 전용"; position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: block; padding: 8px 10px; border: 1px solid #d5dde3; border-radius: 8px; background: rgba(238, 242, 245, .96); color: #5b6570; font-weight: 900; text-align: center; pointer-events: none; }
.editor.archived-locked .draft-editor-column,
.editor.archived-locked .document-preview { padding-top: 40px; }
.editor.archived-locked input:disabled,
.editor.archived-locked select:disabled,
.editor.archived-locked textarea:disabled {
  opacity: 1;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  background: #f8fafc;
  cursor: default;
}
.editor.archived-locked button:disabled { opacity: .72; cursor: default; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; padding: 3px 7px; border-radius: 999px; color: #25445e; background: #edf2f6; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-quoteDone { color: #6b4a0c; background: #fff4d6; }
.status-ordered { color: #146b5b; background: #e4f4ef; }
.status-delivered { color: #5b6570; background: #eef0f2; }
.full { width: 100%; display: block; text-align: center; margin-top: 8px; }
.import-label { padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 13px; }
.import-label input { display: none; }
.editor { display: grid; grid-template-columns: minmax(720px, 1.12fr) minmax(560px, .88fr); gap: 14px; align-items: start; overflow: visible; align-self: start; min-width: 0; }
.draft-editor-column { grid-column: 1; position: relative; min-width: 0; padding: 14px; overflow: hidden; border-top-left-radius: 0; border-top-right-radius: 0; }
.editor-heading, #documentForm, .calculation-panel { min-width: 0; }
.document-preview { grid-column: 2; grid-row: 1; position: sticky; top: 0; min-width: 0; align-self: start; }
.editor-heading, .section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-title-row h3 { margin: 0; }
.editor-heading { display: grid; grid-template-columns: minmax(170px, 1fr) auto minmax(210px, 1fr) 28px; align-items: center; gap: 12px; min-height: var(--column-head-height); border-bottom: 1px solid var(--line); padding-bottom: 0; margin: -14px -14px 16px; padding-left: 14px; padding-right: 14px; background: linear-gradient(180deg, #fff, #f8fbfd); }
.editor-heading h2 { margin: 4px 0 0; font-size: 23px; }
.type-switch { display: flex; justify-self: center; gap: 5px; padding: 4px; background: #edf2f6; border-radius: 9px; }
.type-switch button { background: transparent; color: var(--muted); padding: 8px 11px; }
.type-switch button.active { background: white; color: var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.editor-actions { display: flex; align-items: center; justify-self: end; gap: 8px; }
.editor-actions button { min-height: 36px; padding: 8px 14px; white-space: nowrap; }
.editor-pane-toggle, .preview-pane-toggle { flex: 0 0 auto; border-color: #d7e0e7; background: #edf2f6; color: var(--navy); }
body.editor-pane-collapsed .editor { grid-template-columns: var(--collapsed-column-width) minmax(640px, 1fr); }
body.editor-pane-collapsed .draft-editor-column { min-height: calc(100vh - 90px); padding: 0; display: grid; grid-template-rows: var(--column-head-height) 1fr; justify-items: center; }
body.editor-pane-collapsed .editor-heading { display: grid; place-items: start center; min-height: var(--column-head-height); width: 100%; padding: calc((var(--column-head-height) - 28px) / 2) 0 0; margin: 0; border: 0; background: transparent; }
body.editor-pane-collapsed .editor-heading > div, body.editor-pane-collapsed .editor-heading .type-switch, body.editor-pane-collapsed .editor-heading .editor-actions { display: none; }
body.editor-pane-collapsed .editor-heading .editor-pane-toggle { display: inline-grid !important; visibility: visible; opacity: 1; position: absolute; top: calc((var(--column-head-height) - 28px) / 2); left: 50%; z-index: 5; transform: translateX(-50%); }
body.editor-pane-collapsed #documentForm, body.editor-pane-collapsed .calculation-panel { display: none; }
body.editor-pane-collapsed .document-preview { grid-column: 2; grid-row: 1; position: sticky; top: 0; margin-top: 0; }
body.editor-pane-collapsed .editor-pane-toggle { transform: translateX(-50%); }
body.editor-pane-collapsed .draft-editor-column::after { content: "문서 작성"; }
body.preview-pane-collapsed .editor { grid-template-columns: var(--collapsed-column-width) minmax(760px, 1fr); }
body.preview-pane-collapsed .draft-editor-column { grid-column: 2; grid-row: 1; }
body.preview-pane-collapsed .document-preview { grid-column: 1; grid-row: 1; min-height: calc(100vh - 90px); padding: 0; display: grid; grid-template-rows: var(--column-head-height) 1fr; justify-items: center; }
body.preview-pane-collapsed .document-preview .section-title-row { width: 100%; min-height: var(--column-head-height); margin: 0; padding: calc((var(--column-head-height) - 28px) / 2) 0 0; display: grid; place-items: start center; }
body.preview-pane-collapsed .document-preview .section-title-row > div:first-child, body.preview-pane-collapsed .document-preview .preview-zoom-tools, body.preview-pane-collapsed .document-preview #printDocument, body.preview-pane-collapsed .document-preview-body { display: none; }
body.preview-pane-collapsed .preview-pane-toggle { transform: none; }
body.preview-pane-collapsed .document-preview::after { content: "출력 미리보기"; }
body.editor-pane-collapsed.preview-pane-collapsed .editor { grid-template-columns: var(--collapsed-column-width) var(--collapsed-column-width) minmax(0, 1fr); }
body.editor-pane-collapsed.preview-pane-collapsed .draft-editor-column { grid-column: 1; }
body.editor-pane-collapsed.preview-pane-collapsed .document-preview { grid-column: 2; }
body.nav-collapsed.doc-list-collapsed.editor-pane-collapsed .editor { grid-template-columns: var(--collapsed-column-width) minmax(680px, 1fr); }
body.nav-collapsed.doc-list-collapsed.preview-pane-collapsed .editor { grid-template-columns: var(--collapsed-column-width) minmax(920px, 1fr); }
body.nav-collapsed.doc-list-collapsed.editor-pane-collapsed.preview-pane-collapsed .editor { grid-template-columns: var(--collapsed-column-width) var(--collapsed-column-width) minmax(0, 1fr); }
.form-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.form-section h3 { color: var(--navy); font-size: 15px; margin: 0 0 14px; }
.form-section h4 { margin: 0 0 10px; color: var(--blue); font-size: 14px; }
.info-overview-section { padding-top: 0; }
.info-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(6px, .7vw, 10px); align-items: stretch; overflow: visible; padding: 0 0 8px; }
.info-card { min-width: 0; padding: clamp(8px, .8vw, 12px); border: 1px solid #d5e0e8; border-radius: 12px; background: #f8fafc; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.info-card h3 { margin: -12px -12px 12px; padding: 12px 14px; border-bottom: 1px solid #d5e0e8; border-radius: 12px 12px 0 0; background: linear-gradient(180deg, #eaf3fa, #f4f8fb); color: var(--navy); }
.info-card label { margin-bottom: 8px; overflow-wrap: anywhere; line-height: 1.25; }
.info-card label:last-child { margin-bottom: 0; }
.info-card input, .info-card select, .info-card textarea { min-width: 0; padding: 7px clamp(5px, .55vw, 8px); min-height: 31px; font-size: clamp(9.5px, .72vw, 11px); }
.info-card textarea { min-height: 72px; }

.order-only-field { display: none; }
body.order-document-mode .info-overview-grid { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
body.order-document-mode .order-only-field { display: block; }
body.order-document-mode .order-only-field.wide { grid-column: 1 / -1; }
body.order-document-mode .quote-business-field,
body.order-document-mode .quote-status-field,
body.order-document-mode .quote-project-select-field,
body.order-document-mode .quote-site-field,
body.order-document-mode .quote-capacity-field,
body.order-document-mode .delivery-card { display: none; }
label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
label input, label select, label textarea { margin-top: 5px; color: var(--ink); font-weight: 500; }
input[readonly] { background: #f1f5f8; color: var(--navy); font-weight: 700; }
.form-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.five { grid-template-columns: repeat(5, 1fr); }
.form-grid.six { grid-template-columns: repeat(6, 1fr); }
.form-grid.compact { gap: 8px; }
.shipping-grid { grid-template-columns: repeat(6, minmax(92px, 1fr)); align-items: end; }
.shipping-title { margin: 12px 0 8px; }
.shipping-grid label { margin-bottom: 0; }
.shipping-grid input { padding: 7px 6px; min-height: 32px; font-size: 12px; }
.shipping-grid input[readonly] { background: #f2f5f7; color: var(--navy); font-weight: 800; }
.other-fee-title { margin-top: 12px; }
.other-fee-title h3 { margin: 0; color: var(--navy); }
.other-fee-grid { grid-template-columns: 1.1fr 1.4fr repeat(3, minmax(92px, 1fr)); align-items: end; }
.other-fee-grid label { margin-bottom: 0; }
.other-fee-grid input, .other-fee-grid select { padding: 7px 6px; min-height: 32px; font-size: 12px; }
.other-fee-grid input[readonly] { background: #f2f5f7; color: var(--navy); font-weight: 800; }
.contract-entry-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 260px); gap: 16px; align-items: start; }
.contract-entry-fields { min-width: 0; }
.contract-photo-panel { margin: 8px 0 14px; padding: 10px 12px; border: 1px solid #cfe0ec; border-radius: 10px; background: #f7fbfe; }
.contract-entry-layout .contract-photo-panel { position: sticky; top: 78px; align-self: start; margin: 0; }
.contract-photo-panel .section-title-row { align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.contract-entry-layout .contract-photo-panel .section-title-row { display: block; }
.contract-entry-layout .contract-photo-panel .row-actions { margin-top: 8px; justify-content: stretch; }
.contract-entry-layout .contract-photo-panel .import-label { display: block; width: 100%; text-align: center; }
.contract-photo-panel h3 { margin: 0 0 4px; color: var(--navy); font-size: 14px; }
.contract-photo-panel p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.contract-photo-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.contract-image-preview { display: grid; place-items: center; min-height: 170px; max-height: 280px; border: 1px dashed #b8c8d4; border-radius: 9px; background: white; color: var(--muted); font-size: 12px; font-weight: 800; overflow: auto; }
.contract-image-preview img { display: block; width: 100%; max-height: 270px; object-fit: contain; background: #eef3f7; }
.contract-entry-layout .contract-image-preview { min-height: 260px; max-height: 420px; }
.contract-entry-layout .contract-image-preview img { max-height: 400px; }
.contract-photo-status { margin-top: 7px; padding: 7px 10px; border-radius: 8px; background: white; color: var(--muted); font-size: 11px; line-height: 1.35; }
.contract-photo-status.success { background: #e8f6f1; color: #256c5c; }
.contract-photo-status.warning { background: #fff7e2; color: #7a5012; }
.contract-input-grid { gap: 14px 12px; margin-bottom: 14px; align-items: start; }
.contract-input-grid label { margin-bottom: 0; }
.contract-input-grid input, .contract-input-grid select { min-height: 34px; padding: 7px 9px; font-size: 12px; }
.contract-party-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 2px 0 14px; }
.contract-party-editor { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7fbff; }
.contract-party-editor h4 { margin: 0 0 10px; color: var(--navy); font-size: 14px; }
.contract-party-editor .form-grid { gap: 9px; }
.contract-party-editor .form-grid .wide { grid-column: 1 / -1; }
.contract-party-editor label { margin: 0; font-size: 11.5px; }
.contract-party-editor input { min-height: 32px; padding: 7px 9px; font-size: 12px; }
.contract-payment-grid { margin-top: 2px; margin-bottom: 16px; }
.contract-wide-field { display: block; margin: 0 0 14px; }
.contract-wide-field input, .contract-wide-field textarea { margin-top: 6px; padding: 8px 9px; font-size: 12px; line-height: 1.35; }
.contract-wide-field textarea { min-height: 82px; }
.order-edit-table th, .order-edit-table td { text-align: center; }
.order-edit-table input { min-width: 0; padding: 6px 7px; font-size: 12px; text-align: center; }
.order-edit-table td:nth-child(2) input, .order-edit-table td:nth-child(3) input { text-align: left; }
.order-edit-table th:nth-child(1), .order-edit-table td:nth-child(1) { width: 42px; }
.order-edit-table th:last-child, .order-edit-table td:last-child { width: 64px; }
.order-total-grid input[readonly] { background: #f2f5f7; color: var(--navy); font-weight: 800; }
.supplier-editor { margin-top: 10px; }
.row-actions.right { justify-content: flex-end; margin-bottom: 10px; }
.party-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.party-grid > div { padding: 14px; border-radius: 9px; background: #f7f9fb; }
.party-grid label { margin-bottom: 9px; }
.party-grid select { border-color: #90b7d8; background: #f4faff; font-weight: 700; color: var(--navy); }
.toolbar-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-bottom: 16px; }
.register-table, .profile-table { min-width: 820px; table-layout: fixed; }
.register-table th, .profile-table th { padding: 7px 5px; white-space: nowrap; }
.register-table td, .profile-table td { padding: 6px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-action { padding: 5px 7px; font-size: 10.5px; white-space: nowrap; }
.two-line-button { min-width: 54px; line-height: 1.05; white-space: normal; }
.table-action.price-supplier { color: var(--blue); background: #edf6ff; }
.table-action.secondary { color: #a13f48; }
.row-actions { display: flex; gap: 5px; }
.empty-row { text-align: center; color: var(--muted); padding: 25px !important; }
.profile-columns { display: grid; grid-template-columns: 1fr; gap: 18px; }
.company-employee-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.company-employee-grid .panel, .trade-profile-grid .panel { display: flex; flex-direction: column; min-height: 0; }
.company-employee-grid .panel { height: auto; }
.company-editor.form-grid.six { grid-template-columns: repeat(2, 1fr); padding: 10px; border: 1px solid #d7e3eb; border-radius: 9px; background: #f7fafc; }
.company-editor .wide { grid-column: 1 / -1; }
.company-edit-grid { flex: 0 0 252px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 0; overflow: visible; }
.company-edit-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; align-content: start; padding: 9px; border: 1px solid #d7e3eb; border-radius: 9px; background: #f7fafc; }
.company-edit-card h4 { grid-column: 1 / -1; margin: 0 0 2px; color: var(--navy); font-size: 13px; }
.company-card-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.company-card-head h4 { margin: 0; }
.company-view-card p { grid-column: 1 / -1; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; margin: 0; padding: 7px 8px; border-radius: 6px; background: white; font-size: 11.2px; line-height: 1.45; }
.company-view-card p strong { color: var(--navy); }
.company-view-card p span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.company-edit-card label { margin-bottom: 0; font-size: 11px; }
.company-edit-card input { padding: 7px 8px; min-height: 32px; font-size: 12px; }
.company-edit-card .wide { grid-column: 1 / -1; }
.company-image-upload input { padding: 5px; font-size: 11px; background: white; }
.company-image-preview { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 42px; padding: 6px 8px; border-radius: 6px; background: white; font-size: 11px; }
.company-image-preview strong { color: var(--navy); }
.company-image-preview img { max-width: 92px; max-height: 36px; object-fit: contain; justify-self: start; }
.employee-editor { padding: 7px 8px; border: 1px solid #d7e3eb; border-radius: 9px; background: #f7fafc; }
.employee-editor.form-grid.four { grid-template-columns: .72fr .78fr 1fr 1.26fr auto; align-items: end; }
.employee-editor label, .company-editor label { margin-bottom: 0; }
.employee-editor input, .company-editor input, .company-editor select { padding: 6px 8px; min-height: 30px; font-size: 12px; }
.employee-save-actions { align-items: end; justify-content: flex-end; margin-bottom: 0; }
.employee-save-actions button { height: 30px; padding: 0 10px; white-space: nowrap; }
.trade-profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.trade-profile-grid .panel { height: 500px; }
.trade-profile-grid .section-title-row.single-line { min-height: 38px; align-items: center; margin-bottom: 10px; }
.section-title-row.single-line { flex-wrap: nowrap; }
.section-title-row.single-line h3 { white-space: nowrap; }
.section-title-row.single-line input { min-width: 150px; }
.supplier-filter-actions { align-items: center; flex-wrap: nowrap; }
.supplier-filter-actions input, .supplier-filter-actions select { height: 31px; padding: 6px 8px; }
.supplier-filter-actions button { height: 31px; padding: 0 10px; white-space: nowrap; min-width: max-content; }
.supplier-editor { margin: 0 0 12px; padding: 12px; border: 1px solid #d7e3eb; border-radius: 9px; background: #f7fafc; }
.supplier-editor .row-actions.right { grid-column: 1 / -1; margin: 0; }
.sales-profile-table { min-width: 720px; }
.purchase-table { min-width: 780px; }
.purchase-table th:last-child, .purchase-table td:last-child { width: 158px; overflow: visible; text-overflow: clip; }
.purchase-table td:last-child .row-actions { justify-content: center; gap: 4px; }
.purchase-table .table-action { padding: 4px 6px; font-size: 10px; }
.profile-card-grid { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); align-content: start; gap: 14px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.profile-card-grid.stacked { grid-template-columns: 1fr; }
.profile-card { padding: 11px 12px; border-radius: 9px; background: #f4f8fb; border-left: 4px solid var(--blue); }
.profile-card h4 { margin: 0 0 6px; color: var(--navy); }
.profile-card p { margin: 3px 0; color: var(--muted); font-size: 11.5px; line-height: 1.25; }
.employee-table-wrap { flex: 1 1 252px; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 0; }
.employee-table { min-width: 600px; margin: 0; font-size: 11px; table-layout: fixed; }
.employee-table th { position: sticky; top: 0; z-index: 1; padding: 5px 4px; }
.employee-table td { padding: 3px 4px; height: 24px; border-bottom: 1px solid #e6edf2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.employee-table th:nth-child(1), .employee-table td:nth-child(1) { width: 56px; }
.employee-table th:nth-child(2), .employee-table td:nth-child(2) { width: 64px; }
.employee-table th:nth-child(3), .employee-table td:nth-child(3) { width: 112px; }
.employee-table th:nth-child(4), .employee-table td:nth-child(4) { width: 190px; }
.employee-table th:nth-child(5), .employee-table td:nth-child(5) { width: 84px; }
.employee-table .row-actions { justify-content: center; gap: 3px; }
.employee-table .table-action { padding: 3px 5px; font-size: 9.5px; }
.permission-modal-card { width: min(1320px, 96vw); }
.permission-toolbar { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
#permissionSaveStatus { padding: 10px 12px; background: #eef5fa; border-radius: 8px; color: var(--navy); }
.permission-table .delete-employee-account { color: var(--navy); background: transparent; border: 0; box-shadow: none; font-family: inherit; font-size: 10.5px; font-weight: 800; }
.permission-table { min-width: 1280px; font-size: 11px; table-layout: fixed; }
.permission-table th, .permission-table td { padding: 5px 4px; }
.permission-table th:nth-child(1), .permission-table td:nth-child(1) { width: 48px; }
.permission-table th:nth-child(2), .permission-table td:nth-child(2) { width: 64px; }
.permission-table th:nth-child(3), .permission-table td:nth-child(3) { width: 260px; }
.permission-table th:nth-child(4), .permission-table td:nth-child(4) { width: 105px; }
.permission-table th:last-child, .permission-table td:last-child { width: 86px; text-align: center; }
.permission-table th:nth-child(-n+2), .permission-table td:nth-child(-n+2) { text-align: center; }
.permission-account-actions { display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.permission-check { display: inline-flex; align-items: center; justify-content: center; gap: 4px; margin: 0; font-size: 10.5px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.permission-check input { width: 14px; height: 14px; min-width: 14px; margin: 0; }
.permission-login-input { width: 248px; min-height: 28px; padding: 5px 7px; font-size: 10.5px; }
.permission-login-input.password-input { width: 92px; text-align: center; }
.password-modal-card { width: min(760px, 94vw); }
.badge { font-size: 11px; color: var(--green); background: #e4f4ef; border-radius: 20px; padding: 5px 9px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.dashboard-grid article { padding: 20px; color: white; background: linear-gradient(140deg,#17324d,#285d87); border-radius: 12px; }
.dashboard-grid article.green { background: linear-gradient(140deg,#146b5b,#199476); }
.dashboard-grid span, .dashboard-grid small { display: block; opacity: .78; font-size: 12px; }
.dashboard-grid strong { display: block; font-size: 24px; margin: 8px 0; }
.dashboard-panels { display: grid; grid-template-columns: 1fr; gap: 18px; }
.dashboard-panels .wide { grid-column: 1 / -1; }
.bar-list { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 35px; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.bar-track { height: 9px; border-radius: 10px; background: #e8eef2; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 10px; }
.bar-row:nth-child(2) .bar-fill { background: var(--green); }
.bar-row:nth-child(3) .bar-fill { background: #d39b37; }
.dashboard-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.dashboard-chart-card, .monthly-customer-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfdff; }
.chart-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--navy); }
.chart-card-head strong { font-size: 15px; }
.chart-card-head span { color: var(--green); font-size: 13px; font-weight: 900; }
.share-stack { display: flex; height: 16px; overflow: hidden; border-radius: 999px; background: #e8eef2; }
.share-stack span { min-width: 0; height: 100%; }
.share-list { display: grid; gap: 7px; margin-top: 12px; }
.share-row { display: grid; grid-template-columns: 10px minmax(70px, 1fr) 48px 92px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.share-row i { width: 10px; height: 10px; border-radius: 999px; }
.share-row span { color: var(--navy); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row strong { text-align: right; color: var(--ink); }
.share-row em { color: var(--green); font-style: normal; font-weight: 900; text-align: right; }
.monthly-customer-bars { display: grid; gap: 14px; }
.monthly-customer-card h4 { margin: 0 0 11px; color: var(--navy); font-size: 15px; }
.customer-bar-list { display: grid; gap: 9px; }
.customer-bar-row { display: grid; grid-template-columns: 160px minmax(180px, 1fr) 120px; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.customer-bar-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-weight: 800; }
.customer-bar-row strong { text-align: right; color: var(--green); font-size: 12.5px; }
.empty-chart { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.dashboard-panels > .panel, .dashboard-chart-card, .monthly-customer-card {min-width:0;}
.dashboard-chart-grid {grid-template-columns:minmax(0,1fr);}
.dashboard-columns {position:relative;padding:32px 0 0 100px;margin:8px 0 12px;color:var(--navy);}
.column-axis {position:absolute;left:0;top:32px;height:220px;width:88px;font-size:11px;color:var(--muted);}
.column-axis > span {position:absolute;right:0;transform:translateY(-50%);white-space:nowrap;}
.column-axis > .column-unit {top:-22px;transform:none;font-weight:700;}
.column-scroll {overflow-x:auto;padding-top:28px;margin-top:-28px;scrollbar-gutter:stable;}
.column-canvas {position:relative;}
.column-grid {position:absolute;left:0;right:0;top:0;height:220px;pointer-events:none;}
.column-grid i {position:absolute;left:0;right:0;border-top:1px solid #e1e8ef;}
.column-grid i.zero-line {border-top:2px solid #8398ab;}
.column-groups {display:flex;gap:20px;}
.column-group {min-width:0;}
.column-slots {display:flex;height:220px;gap:4px;}
.column-slot {flex:1;min-width:108px;position:relative;}
.column-bar {position:absolute;left:50%;transform:translateX(-50%);width:56%;max-width:72px;border-radius:4px 4px 0 0;min-height:0;}
.column-value {position:absolute;left:0;width:100%;text-align:center;transform:translateY(calc(-100% - 5px));font-size:11px;font-weight:800;white-space:nowrap;z-index:1;}
.column-value.below {transform:translateY(5px);color:#b43c45;}
.column-category {margin-top:30px;padding:0 6px;text-align:center;font-size:12px;font-weight:700;overflow-wrap:anywhere;}
.column-detail {margin-top:4px;text-align:center;font-size:11px;color:var(--muted);}
.dashboard-legend {display:flex;gap:20px;flex-wrap:wrap;margin:8px 0 20px;font-size:12px;color:var(--muted);}
.dashboard-legend span {display:flex;align-items:center;gap:6px;}
.dashboard-legend i {display:inline-block;width:10px;height:10px;border-radius:2px;}
.dashboard-chart-note {font-size:12px;color:var(--muted);}
.dashboard-details {margin-top:20px;border-top:1px solid var(--line);padding-top:12px;}
.dashboard-details > summary {cursor:pointer;font-size:13px;font-weight:700;color:var(--navy);}
.dashboard-details .table-wrap {margin-top:12px;}
@media(max-width:600px) {
  .dashboard-columns {padding-left:76px;}
  .column-axis {width:68px;font-size:10px;}
}
.positive { color: var(--green); font-weight: 800; }
.negative { color: #b43c45; font-weight: 800; }
.calendar-tabs { display: inline-flex; gap: 6px; margin: 0 0 14px; padding: 4px; border-radius: 10px; background: #edf2f6; }
.calendar-tabs button { padding: 8px 14px; border-radius: 8px; background: transparent; color: var(--muted); }
.calendar-tabs button.active { background: white; color: var(--navy); box-shadow: 0 2px 8px rgba(18,44,70,.08); }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(420px, .9fr); gap: 16px; align-items: start; }
.calendar-panel .section-title-row input[type="month"] { width: 150px; min-width: 150px; padding: 7px 8px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.calendar-weekday { padding: 8px 4px; background: #17324d; color: white; text-align: center; font-size: 12px; font-weight: 900; }
.calendar-day { min-height: 112px; padding: 7px; background: white; }
.calendar-day.muted { background: #f6f8fa; color: #9aa8b3; }
.calendar-day.today { outline: 2px solid var(--green); outline-offset: -2px; background: #f1fbf7; }
.calendar-date { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 999px; font-size: 12px; font-weight: 900; color: var(--navy); }
.calendar-day.today .calendar-date { background: var(--green); color: white; }
.calendar-events { display: grid; gap: 4px; margin-top: 5px; }
.calendar-event { display: block; width: 100%; padding: 4px 5px; border-radius: 6px; background: #e8f2ff; color: #123957; text-align: left; font-size: 10.5px; line-height: 1.18; white-space: normal; overflow: hidden; }
.calendar-event strong { display: inline-block; margin-right: 4px; color: var(--blue); }
.calendar-event.payable { background: #fff2e3; color: #744511; }
.calendar-event.payable strong { color: #b65f00; }
.calendar-event.receivable { background: #e7f7f1; color: #165d4d; }
.calendar-event.receivable strong { color: var(--green); }
.calendar-event.order-event { background: #eef2ff; color: #29356e; }
.calendar-event.order-event strong { color: #3f51b5; }
.schedule-table { min-width: 760px; }
.schedule-table input[type="date"] { min-width: 116px; padding: 5px; }
.schedule-chip { display: inline-flex; justify-content: center; min-width: 40px; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 900; background: #e7f7f1; color: var(--green); }
.schedule-chip.payable { background: #fff2e3; color: #b65f00; }
.schedule-chip.order { background: #eef2ff; color: #3f51b5; }
.schedule-chip.receivable { background: #e7f7f1; color: var(--green); }
.table-wrap { overflow-x: auto; margin-bottom: 10px; }
.trade-profile-grid .table-wrap { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.trade-profile-grid .profile-table { margin: 0; }
.trade-profile-grid .profile-table th { position: sticky; top: 0; z-index: 1; }
table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 11.5px; }
th { padding: 7px 5px; color: white; background: var(--navy); text-align: center; white-space: nowrap; line-height: 1.15; }
td { padding: 4px; border-bottom: 1px solid var(--line); text-align: center; line-height: 1.2; }
td input, td select { text-align: center; }
td input, td select { padding: 5px 4px; min-width: 58px; }
.structure-fields { display: grid; grid-template-columns: minmax(135px, .9fr) minmax(210px, 1.4fr); gap: 6px; }
.bom-panel { margin: 12px 0; padding: 12px; border: 1px solid #bfd5e6; border-radius: 10px; background: #f5faff; overflow: visible; }
.bom-panel > .section-title-row { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start; }
.bom-panel > .section-title-row > div:first-child { min-height: 0; padding-bottom: 0; box-sizing: border-box; }
.bom-panel > .section-title-row > .row-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: end; justify-content: stretch; min-width: 0; }
.bom-panel h4 { margin: 0 0 4px; color: var(--navy); line-height: 1.15; }
.bom-panel p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.25; }
.bom-source-meta { display: grid; gap: 4px; margin: 8px 0; }
.bom-source-meta div { display: grid; grid-template-columns: 82px 1.2fr 1.8fr 96px; gap: 6px; padding: 5px 8px; border: 1px solid #b8d2dc; background: #e7f4f8; font-size: 10px; }
.bom-source-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-supplier-controls { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(150px, 1.4fr) minmax(72px, .58fr) minmax(72px, .58fr) minmax(150px, 1.4fr) minmax(72px, .58fr); gap: 8px 10px; align-items: start; min-width: 0; }
.bom-supplier-controls .bom-control { display: grid; grid-template-rows: 17px 34px; gap: 5px; align-items: start; min-width: 0; margin: 0; color: var(--navy); font-size: clamp(10px, .75vw, 12px); font-weight: 900; line-height: 1.1; white-space: nowrap; }
.bom-supplier-controls { width:100%;grid-template-columns:1.1fr 1.3fr 1fr 1.25fr 1fr;gap:8px 6px; }
.bom-supplier-controls .bom-control[hidden] { display:none; }
.weight-factor-label { grid-column: 1; grid-row: 1; }
.steel-pricing-mode { grid-column: 2; grid-row: 1; }
.bom-supplier-controls[data-pricing="direct"] .steel-pricing-mode {grid-column:2 / 4;}
.structure-supplier-control { grid-column: 3; grid-row: 1; }
.square-factor-control,.square-direct-control { grid-column: 4; grid-row: 1; }
.csteel-factor-control,.csteel-direct-control { grid-column: 5; grid-row: 1; }
.accessory-supplier-control { grid-column: 2; grid-row: 2; }
.accessory-factor-control { grid-column: 4; grid-row: 2; }
.bolt-supplier-control { grid-column: 3; grid-row: 2; }
.bolt-factor-control { grid-column: 5; grid-row: 2; }
.bolt-increase-control { grid-column:1;grid-row:2; }
.bom-supplier-controls .bom-control>span:first-child {white-space:normal;overflow-wrap:anywhere;font-size:clamp(9px,.7vw,11px);line-height:1.1;}
.bom-sheet-tabs { display:flex;gap:5px;overflow-x:auto;padding:3px 0; }
.bom-sheet-tabs button { flex:0 0 auto;padding:6px 12px;font-size:12px;background:#e6eef5;color:#234f71;border:1px solid #b8cddd; }
.bom-sheet-tabs button.active { background:#255f98;color:white; }
.structure-print .print-summary small.print-kw-price { margin-top:2px;text-align:right;font-size:10px;line-height:1.2; }
.profit-factor-label { text-align: center; }
.bom-supplier-controls select, .bom-supplier-controls input { padding: 8px clamp(4px, .45vw, 7px); min-width: 0; font-size: clamp(10px, .78vw, 13px); height: 34px; align-self: start; box-sizing: border-box; }
.bom-supplier-controls input { text-align: center; }
.factor-field { display: grid; grid-template-columns: 1fr 16px; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; height: 34px; box-sizing: border-box; }
.factor-field input { grid-column: 1 !important; width: 100%; border: 0; padding: 0 2px; height: 32px; line-height: 32px; box-sizing: border-box; text-align: center; vertical-align: middle; appearance: textfield; -moz-appearance: textfield; transform: translateY(-3px); }
.factor-field input::-webkit-outer-spin-button,
.factor-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.factor-field b { display: grid; place-items: center start; height: 32px; color: var(--muted); font-size: 13px; line-height: 32px; }
/* Shared label/input rows: remove inherited label margins and number offsets. */
.bom-supplier-controls .bom-control>span:first-child {display:flex;align-items:center;justify-content:center;text-align:center;height:17px;}
.bom-supplier-controls input,.bom-supplier-controls select {margin:0; padding:0 6px;line-height:32px;text-align:center;}
.bom-supplier-controls select {text-align-last:center;}
.bom-supplier-controls .factor-field {width:100%;margin:0;align-self:start;}
.bom-supplier-controls .factor-field input {height:32px;margin:0;padding:0 2px;line-height:32px;transform:none;align-self:center;}
.bom-supplier-controls .factor-field b {height:32px;line-height:32px;align-self:center;place-items:center;}
.bom-table { min-width: 1040px; width: max-content; border-collapse: collapse; font-size: 10.5px; table-layout: auto; }
.bom-table tbody td { padding: 2px 1px; height: 24px; border: 1px solid #c2cdd3; background: white; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.05; }
.bom-table input, .bom-table select { min-width: 0; width: 100%; max-width: none; height: 20px; padding: 1px 1px; border: 0; border-radius: 0; background: transparent; text-align: center; font-size: 10.5px; white-space: nowrap; line-height: 1.05; }
.bom-table select { padding-right: 14px; }
.bom-table input[type="checkbox"] { min-width: auto; width: 13px; height: 13px; vertical-align: middle; }
.bom-table td:nth-child(1) { width: 42px; }
.bom-table td:nth-child(2) { width: 76px; }
.bom-table td:nth-child(3) { width: 38px; }
.bom-table td:nth-child(4) { width: 86px; }
.bom-table td:nth-child(5) { width: 62px; }
.bom-table td:nth-child(6), .bom-table td:nth-child(7), .bom-table td:nth-child(8), .bom-table td:nth-child(9), .bom-table td:nth-child(10), .bom-table td:nth-child(11), .bom-table td:nth-child(12), .bom-table td:nth-child(13), .bom-table td:nth-child(14) { width: 54px; }
.bom-table td:nth-child(15), .bom-table td:nth-child(17) { width: 78px; }
.bom-table td:nth-child(16) { width: 46px; }
.bom-table td:nth-child(18) { width: 34px; }
.bom-table td {width:auto !important;overflow:visible;white-space:normal;overflow-wrap:anywhere;}
.bom-table .bom-edit-text {display:block;min-width:48px;max-width:none;box-sizing:border-box;border:0;background:transparent;resize:none;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:center;font-size:10.5px;line-height:1.4;padding:2px;}
.bom-material-tables {min-width:0;width:100%;}
.bom-material-group {min-width:0;margin:0 0 8px;}
.bom-material-heading {padding:4px 6px;background:#426884;color:white;font-size:10.5px;font-weight:800;}
.bom-material-group .table-wrap {max-width:100%;margin:0;}
.bom-material-group .bom-table {width:100%;table-layout:fixed;}
.bom-material-group .bom-table .bom-edit-text {min-width:0;}
.bom-material-group .bom-table thead td {white-space:normal;height:auto;}
.bom-material-group .bom-table td,.bom-material-group .bom-table input,.bom-material-group .bom-table select,.bom-material-group .bom-table .bom-edit-text {font-size:9.5px;}
.bom-material-group .bom-table td {padding:1px;min-width:0;}
.bom-material-group .bom-table input[type="number"] {padding:1px;box-sizing:border-box;appearance:textfield;-moz-appearance:textfield;}
.bom-material-group .bom-table input[type="number"]::-webkit-inner-spin-button,.bom-material-group .bom-table input[type="number"]::-webkit-outer-spin-button {-webkit-appearance:none;margin:0;}
.bom-material-group .bom-table select {padding:0 10px 0 0;}
.bom-material-group .bom-table .bom-edit-text {padding:1px;}
.bom-final { font-weight: 800; color: #183c57; }
.bom-group-row td { padding: 4px 6px; height: auto; color: white; background: #426884 !important; font-weight: 800; text-align: center !important; font-size: 10.5px; line-height: 1.05; }
.bom-group-row td { display: table-cell; }
.bom-subhead-row td { padding: 3px 1px; height: 21px; background: #e8f3f7 !important; color: #0d344f; font-weight: 800; font-size: 10px; white-space: nowrap; line-height: 1.05; }
.bom-group-row-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bom-group-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.bom-group-controls label { display: flex; align-items: center; gap: 3px; margin: 0; color: white; font-size: 9px; white-space: nowrap; }
.bom-group-controls input { width: 76px; min-width: 76px; padding: 2px 4px; border: 1px solid rgba(255,255,255,.55); border-radius: 4px; background: white; color: #111; text-align: right; font-size: 9px; }
.bom-group-controls button { padding: 2px 7px; border: 1px solid rgba(255,255,255,.5); border-radius: 4px; background: rgba(255,255,255,.15); font-size: 9px; }
.bom-summary { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11px; }
.bom-summary strong { color: var(--navy); margin-left: 4px; }
.bom-file-label { width: 112px; min-width: 112px; height: 34px; margin: 0; padding: 8px 12px; display: grid; place-items: center; text-align: center; line-height: 1.05; box-sizing: border-box; border-radius: 8px; border: 0; background: var(--blue); box-shadow: 0 2px 8px rgba(37,99,168,.18); color: white; font-size: 12px; font-weight: 900; cursor: pointer; }
.hidden-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bom-import-status { display: grid; grid-template-columns: 112px max-content 1fr; gap: 10px; align-items: center; margin: 14px 0; padding: 8px 10px; border-radius: 8px; background: white; color: var(--muted); font-size: 12px; }
.bom-import-status strong { color: var(--navy); }
.bom-import-status.success { background: #e8f6f1; color: #256c5c; }
.bom-import-status.error { background: #fff0f1; color: #a13f48; }
.bom-confirm-row { display: flex; justify-content: flex-end; align-items: center; gap: 15px; margin-top: 14px; }
.bom-confirm-row label { color: var(--navy); }
.bom-confirm-row input { width: auto; margin-right: 5px; }
.structure-quote-details { margin: 10px 0; padding: 10px; border: 1px solid #c9d9e3; border-radius: 10px; background: #f8fbfd; }
.structure-quote-details > .section-title-row { margin-bottom: 8px; }
.structure-quote-details .quote-title-row { align-items: flex-end; justify-content: space-between; gap: 10px; }
.quote-format-save { flex: 0 0 auto; white-space: nowrap; }
.structure-quote-details h4 { margin: 0 0 4px; color: var(--navy); }
.structure-quote-details p { margin: 0; color: var(--muted); font-size: 11px; }
.structure-quote-group { margin: 0 0 8px; }
.structure-quote-group h3 { margin: 0 0 3px; color: var(--navy); font-size: 13px; }
.small-select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; background: #fff; }
.quote-edit-input { width: 100%; min-width: 30px; height: 20px; box-sizing: border-box; border: 1px solid transparent; border-radius: 4px; padding: 1px; background: transparent; text-align: center; font: inherit; }
.quote-edit-input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.quote-edit-input[type="number"]::-webkit-outer-spin-button,
.quote-edit-input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quote-edit-input:focus { border-color: var(--blue); background: #fff; outline: none; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.product-name .quote-edit-input { min-width: 90px; text-align: center; }
.structure-category-table { min-width: 520px; width: max-content; border-collapse: collapse; font-size: 10px; table-layout: auto; }
.structure-category-table.steel-table { min-width: 760px; }
.structure-category-table th { padding: 2px 1px; border: 1px solid #52636d; background: #dceff4; color: #111; line-height: 1.05; text-align: center; vertical-align: middle; white-space: nowrap; }
.structure-category-table.steel-table th { background: #fbe9d9; }
.structure-category-table td { min-width: 34px; padding: 1px; border: 1px solid #aab7be; background: white; text-align: center; vertical-align: middle; line-height: 1.05; white-space: nowrap; overflow: visible; text-overflow: clip; }
.structure-category-table.resizable-table,
.structure-category-table[data-resizable="true"] { table-layout: fixed; }
.structure-category-table .resizable-cell { position: relative; }
.col-resize-handle { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 3; }
.col-resize-handle:hover { background: rgba(37, 99, 235, .22); }
.quote-column-width-guide { position: fixed; z-index: 9999; display: none; padding: 4px 7px; border-radius: 999px; background: #183c57; color: white; font-size: 11px; font-weight: 900; pointer-events: none; box-shadow: 0 4px 12px rgba(15, 23, 42, .22); }
.quote-column-width-guide.show { display: block; }
.row-resize-handle { position: absolute; left: 0; bottom: -3px; width: 100%; height: 6px; cursor: row-resize; z-index: 2; }
.row-resize-handle:hover { background: rgba(37, 99, 235, .18); }
.structure-category-table .product-name { min-width: 96px; text-align: center; }
.structure-category-table.bolt-table td:nth-child(4) { min-width: 86px; }
.structure-category-table .region-cell { min-width: 28px; width: 28px; font-weight: 900; color: var(--blue); }
.structure-category-table .amount-col { color: #ed1c24; font-weight: 800; }
.structure-category-table .weight-subtotal { color: var(--navy); font-weight: 900; background: #eef6fb !important; }
.structure-category-table .quote-delete-cell { min-width: 40px; width: 40px; }
.structure-quote-group .structure-category-table.steel-table th:nth-child(1),
.structure-quote-group .structure-category-table.steel-table td:nth-child(1) { width: 56px; }
.structure-quote-group .structure-category-table.steel-table th:nth-child(2),
.structure-quote-group .structure-category-table.steel-table td:nth-child(2) { width: 120px; }
.structure-quote-group .structure-category-table.steel-table th:nth-child(n+3),
.structure-quote-group .structure-category-table.steel-table td:nth-child(n+3) { width: 70px; }
.structure-quote-group .structure-category-table.steel-table th:nth-last-child(-n+4),
.structure-quote-group .structure-category-table.steel-table td:nth-last-child(-n+4) { width: 86px; }
.structure-quote-group .structure-category-table.steel-table th:last-child,
.structure-quote-group .structure-category-table.steel-table td:last-child { width: 40px; }
.quote-delete-row { padding: 4px 7px; border: 1px solid #f0c7cc; border-radius: 6px; background: #fff1f2; color: #b4232f; font-size: 11px; font-weight: 800; cursor: pointer; }
.quote-delete-row:hover { background: #ffe4e6; }
.quote-add-cell { text-align: center; }
.quote-add-row { padding: 3px 6px; border: 1px solid #bad7ea; border-radius: 7px; background: #eef8ff; color: var(--blue); font-size: 10px; font-weight: 900; cursor: pointer; white-space: nowrap; }
.quote-add-row:hover { background: #e1f1ff; }
.structure-category-table .subtotal-row td { background: #f3f6f8; font-weight: 800; }
button:disabled { cursor: not-allowed; opacity: .45; }
td:nth-child(1), td:nth-child(8), td:nth-child(9) { text-align: center; }
.remove-item { background: #edf2f6; color: #9c3640; padding: 6px 9px; }
.company-editor .wide { grid-column: span 2; }
.calculation-panel { margin-top: 20px; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.calculation-panel div { padding: 16px; border-right: 1px solid var(--line); }
.calculation-panel div:last-child { border: 0; }
.calculation-panel strong { display: block; font-size: 16px; }
.calculation-panel .highlight { background: #eaf7f3; }
.calculation-panel .highlight strong { color: var(--green); }
.calculation-panel small { color: var(--green); font-weight: 800; }
.document-preview { margin-top: 0; padding: 12px; border-top-left-radius: 0; border-top-right-radius: 0; background: #f8fafc; }
.document-preview .section-title-row { min-height: var(--column-head-height); margin: -12px -12px 12px; padding: 0 12px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #f8fbfd); }
.document-preview h3 { margin: 0 0 4px; color: var(--navy); font-size: 16px; }
.document-preview p { margin: 0; color: var(--muted); font-size: 12px; }
.preview-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.preview-zoom-tools { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid #d7e0e7; border-radius: 999px; background: white; }
.preview-zoom-tools button { width: 28px; height: 28px; min-width: 28px; padding: 0; border-radius: 999px; font-size: 15px; line-height: 1; }
#previewZoomValue { min-width: 42px; color: var(--navy); font-size: 11px; font-weight: 900; text-align: center; }
.document-preview-body { max-height: calc(100vh - 145px); overflow: auto; padding: 12px; border: 1px solid #d7e0e7; border-radius: 10px; background: #e9eef3; cursor: grab; user-select: none; }
.document-preview-body.dragging { cursor: grabbing; }
.document-preview-body.dragging * { cursor: grabbing !important; user-select: none !important; }
.document-preview .preview-sheet { width: 210mm; min-height: 297mm; margin: 0 auto; background: white; box-shadow: 0 14px 36px rgba(25, 49, 70, .18); zoom: var(--preview-zoom, .58); transform: none; }
.preview-page-wrap { position: relative; margin: 0 auto 22px; width: fit-content; max-width: 100%; }
.preview-page-label { position: sticky; top: 0; z-index: 2; width: max-content; margin: 0 0 6px; padding: 4px 8px; border-radius: 999px; background: rgba(23,50,77,.88); color: white; font-size: 10px; font-weight: 900; }
.document-preview .structure-print { display: block; box-sizing: border-box; padding: 8mm; }
.document-preview .contract-preview-sheet { padding: 0; }
.document-preview .contract-preview-sheet .contract-print-page { width: 210mm; min-height: 297mm; max-height: none; box-shadow: none; }
.simple-preview-sheet { padding: 18mm; color: #111; font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif; }
.simple-preview-sheet h1 { margin: 0 0 20px; text-align: center; font-size: 28px; }
.simple-preview-sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.simple-preview-sheet th, .simple-preview-sheet td { padding: 10px; border: 1px solid #222; text-align: left; }
.simple-preview-sheet th { width: 110px; background: #edf2f6; text-align: center; }
.hidden { display: none; }
.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; max-width: calc(100vw - 48px); padding: 12px 18px; background: var(--navy); color: white; border-radius: 8px; box-shadow: 0 8px 24px rgba(12, 32, 52, .28); overflow-wrap: anywhere; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(13, 32, 48, .45); }
.modal-layer.hidden { display: none; }
.modal-card { width: min(1100px, 96vw); max-height: 88vh; overflow: auto; padding: 22px; border-radius: 14px; background: white; box-shadow: 0 24px 70px rgba(12, 32, 52, .28); }
.profile-edit-modal { width: min(760px, 94vw); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.modal-head h2 { margin: 2px 0 4px; color: var(--navy); }
.modal-head p { margin: 0; color: var(--muted); font-size: 12px; }
.supplier-price-table { min-width: 960px; table-layout: fixed; }
.supplier-price-info-grid input[readonly] { background: #f3f7fa; color: var(--navy); font-weight: 800; cursor: default; }
.supplier-price-table th { background: #163753; }
.supplier-price-table td { padding: 3px; }
.supplier-price-table input, .supplier-price-table select { width: 100%; min-width: 0; padding: 5px 4px; text-align: center; }
.supplier-price-table input:disabled { background: #f0f3f6; color: #9aa7b0; }
.supplier-price-table th:nth-child(1) { width: 10%; }
.supplier-price-table th:nth-child(2) { width: 8%; }
.supplier-price-table th:nth-child(3) { width: 13%; }
.supplier-price-table th:nth-child(4) { width: 8%; }
.supplier-price-table th:nth-child(5) { width: 23%; }
.supplier-price-table th:nth-child(6) { width: 6%; }
.supplier-price-table th:nth-child(7), .supplier-price-table th:nth-child(8) { width: 9%; }
.supplier-price-table th:nth-child(9) { width: 10%; }
.supplier-price-table th:nth-child(10) { width: 4%; }
.supplier-image-cell { display: grid; grid-template-columns: 44px 1fr; gap: 4px; align-items: center; }
.supplier-image-preview { width: 44px; height: 34px; padding: 0; border: 1px solid #c9d4dc; border-radius: 6px; background: #f8fafc; color: var(--muted); font-size: 10px; overflow: hidden; }
.supplier-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.supplier-image-actions { display: grid; grid-template-rows: 16px 16px; gap: 3px; align-items: stretch; }
.supplier-image-upload { display: grid; place-items: center; height: 16px; margin: 0; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 800; cursor: pointer; }
.supplier-image-upload input { display: none; }
.supplier-image-remove { height: 16px; padding: 0 4px; border-radius: 5px; color: #a13f48; background: #fff2f2; border: 1px solid #f1c5c5; font-size: 10px; line-height: 1; }
.supplier-price-table tr.detail-required td:nth-child(2),
.supplier-price-table tr.detail-required td:nth-child(4) { background: #fff9e8; }
.modal-actions { justify-content: flex-end; gap: 8px; margin-top: 12px; }
.auth-layer { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(400px, 1fr); overflow-y: auto; background: #fff; }
.auth-layer.hidden { display: none; }
.session-loading { display: none; }
html.session-restoring #authLayer { display: none; }
html.session-restoring .topbar, html.session-restoring main { visibility: hidden; }
html.session-restoring .session-loading { display: grid; place-items: center; position: fixed; inset: 0; z-index: 99; background: #f3f6f8; color: var(--navy); font-size: 14px; font-weight: 700; }
body:has(.auth-layer:not(.hidden)) { overflow: hidden; }
.auth-visual { position: relative; min-height: 100%; overflow: hidden; background: #91b6df; }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 38% center; }
.auth-panel { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100%; padding: 64px clamp(32px, 5vw, 88px) 82px; background: #fff; }
.auth-card { position: relative; width: min(390px, 100%); padding: 0; background: white; }
.auth-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 52px; color: #12365a; font-size: 38px; font-weight: 900; letter-spacing: -2px; }
.auth-brand img { display: block; width: 305px; max-width: 100%; height: auto; }
.auth-card .eyebrow { margin-bottom: 12px; color: #58768c; font-size: 10px; font-weight: 700; letter-spacing: 2.5px; }
.auth-panel .auth-footer { position: absolute; bottom: 28px; margin: 0; color: #94a0ab; font-size: 9px; letter-spacing: 1.5px; }
.toast.auth-toast { position: absolute; top: calc(100% + 16px); right: auto; bottom: auto; left: 50%; width: max-content; max-width: 100%; text-align: center; transform: translate(-50%, 10px); }
.toast.auth-toast.show { transform: translate(-50%, 0); }
.auth-card h2 { margin: 6px 0 14px; color: var(--navy); font-size: 30px; letter-spacing: -1px; }
.auth-card p { margin: 0 0 32px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.auth-card label { margin-bottom: 20px; color: #334b60; font-size: 12px; }
.auth-card input { height: 50px; margin-top: 8px; padding: 12px 14px; border-radius: 7px; background: #fafcfd; font-size: 14px; }
.auth-card input:focus { outline: 2px solid #7ca8d0; outline-offset: 2px; }
.auth-card #authSubmit { min-height: 50px; margin-top: 4px; border-radius: 7px; background: #153b60; font-size: 14px; }
.auth-card #authSubmit:hover { background: #245680; }
.auth-card .auth-mode-switch:has(#showRegister.hidden) { display: none; }
.auth-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin: 14px 0; border-radius: 10px; background: #edf2f6; }
.auth-mode-switch button { background: transparent; color: var(--muted); }
.auth-mode-switch button.active { background: white; color: var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.auth-card small { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
@media (max-width: 720px) {
  .auth-layer { grid-template-columns: 1fr; grid-template-rows: minmax(180px, 28vh) 1fr; }
  .auth-visual { min-height: 180px; }
  .auth-visual img { object-position: center 52%; }
  .auth-panel { min-height: auto; padding: 30px 28px 72px; }
  .auth-brand { margin-bottom: 22px; font-size: 30px; }
  .auth-card h2 { font-size: 26px; }
  .auth-card p { margin-bottom: 24px; }
  .auth-card label { margin-bottom: 16px; }
  .toast.auth-toast { top: auto; bottom: 0; }
}
.structure-print { display: none; }
.structure-print .print-title { margin-bottom: 6px; text-align: center; }
.structure-print .print-title h1 { margin: 0; font-size: 25px; }
.structure-print .print-header-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 8px; align-items: stretch; margin-bottom: 6px; }
.structure-print .print-meta { width: 100%; height: 100%; border-collapse: collapse; }
.structure-print .print-meta th { width: 82px; padding: 4px 5px; color: #111; background: white; text-align: left; font-size: 10px; letter-spacing: 0; }
.structure-print .print-meta td { padding: 4px 5px; border-bottom: 1px solid #333; font-weight: 700; font-size: 10px; }
.structure-print .company-stamp-card { display:flex; flex-direction:column; height: 100%; border: 1px solid #333; box-sizing: border-box; }
.structure-print .company-card-title { display: grid; grid-template-columns: 74px 1fr; flex:1 0 auto; min-height: 74px; border-bottom: 1px solid #333; }
.structure-print .print-logo { display: flex; align-items: center; justify-content: center; padding: 8px; border-right: 1px solid #333; }
.structure-print .print-logo img { display: block; max-width: 62px; max-height: 42px; object-fit: contain; }
.structure-print .company-card-title h2 { margin: 0; align-self: center; text-align: center; font-size: 20px; }
.structure-print .company-card-body { display: grid; flex:0 0 auto; grid-template-columns: 74px minmax(0, 1fr) 76px; }
.structure-print .company-card-body .label, .structure-print .company-card-body .value, .structure-print .company-seal {
  min-height: 22px; padding: 3px 5px; border-bottom: 1px solid #333; border-right: 1px solid #333; text-align: center; font-size: 10px;
}
.structure-print .company-card-body .address-value { grid-column: 2; overflow-wrap:anywhere; }
.structure-print .company-seal { grid-column: 3; grid-row: 1 / 7; display: grid; place-items: center; border-right: 0; border-bottom: 0; }
.structure-print .company-seal img { display: block; max-width: 64px; max-height: 64px; object-fit: contain; }
.structure-print .company-seal img.company-solarmore { max-width: 52px; max-height: 52px; }
.structure-print .company-card-body .address-value.no-right { border-right: 1px solid #333; }
/* The enclosing company card supplies the bottom edge; do not draw it twice. */
.structure-print .company-card-body > :nth-last-child(-n+2) { border-bottom: 0; }
.structure-print .print-group { margin: 0 0 4px; break-inside: avoid; }
.structure-print .print-group h3 { margin: 2px 0 2px; color: #111; font-size: 10.5px; }
.structure-print table { min-width: 0; width: 100%; border-collapse: collapse; font-size: 8.7px; }
.structure-print th, .structure-print td { padding: 2px 2px; color: #111; border: 1px solid #333; text-align: center; }
.structure-print .table-wrap { overflow: visible; margin: 0; }
.structure-print .structure-category-table.steel-table { min-width: 0; }
.structure-print .steel-table th { background: #fbe9d9; }
.structure-print .material-table th, .structure-print .fee-table th { background: #eaf1dd; }
.structure-print .standard-print-table th { background: #eaf1dd; }
.structure-print .standard-print-table td { font-size: 9.2px; }
.structure-print .standard-print-group h3 { margin-top: 4px; }
.structure-print .product-quote-table { table-layout: fixed; }
.structure-print .product-quote-table th,
.structure-print .product-quote-table td { min-width: 0; padding: 5px 3px; border: 1px solid #333; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; font-size: 10px; }
.structure-print .product-quote-table thead th,
.structure-print .product-quote-table .quote-totals-row th { background: #eee; color: #111; font-weight: 500; }
.structure-print .product-quote-table .quote-product-row td { height: 28px; }
.structure-print .product-quote-table .quote-line-amount,
.structure-print .product-quote-table .quote-totals-row td { color: #111; font-weight: 700; }
.structure-print .product-quote-table .quote-notes-row td { height: 72px; padding: 9px 6px; text-align: left; vertical-align: top; }
.structure-print .product-quote-table .special-note > div { margin-top: 6px; }
.structure-print .amount-col { color: red; font-weight: 800; }
.structure-print .product-name { min-width: 86px; text-align: center; }
.structure-print .steel-table thead tr:first-child th, .structure-print .material-table thead tr:first-child th { height: 20px; }
.structure-print .subtotal-row td { font-weight: 800; }
.structure-print .print-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 5px; border: 1px solid #333; background: white; font-size: 10.5px; }
.structure-print .print-summary div { min-height: 28px; padding: 4px 7px; border-right: 1px solid #333; border-bottom: 1px solid #333; background: white; }
.structure-print .print-summary div:nth-child(3n) { border-right: 0; }
.structure-print .print-summary div:nth-child(n+4) { border-bottom: 0; }
.structure-print .print-summary span { display: block; color: #4b5b66; }
.structure-print .print-summary strong { display: block; margin-top: 2px; color: #111; font-size: 12px; text-align: right; }
.structure-print .print-summary small { display: block; color: #697782; text-align: right; }
.structure-print .print-summary p { margin: 0; padding: 5px 8px; border-top: 1px solid #333; background: white; }
.structure-print .print-summary .special-note { grid-column: 1 / -1; font-size: 11px; }
.structure-print .print-summary.compact-quote-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.structure-print .print-summary.compact-quote-summary > div { border-right: 1px solid #333; border-bottom: 1px solid #333; }
.structure-print .print-summary.compact-quote-summary > div:nth-child(2n) { border-right: 0; }
.structure-print .print-summary.compact-quote-summary > div:nth-child(n+3) { border-bottom: 0; }
.contract-print-mode .structure-print { color: #000; }
.order-print-mode .structure-print { color: #000; }
.document-preview .order-preview-sheet { padding: 0; }
.document-preview .order-preview-sheet .order-print-page { width: 210mm; min-height: 297mm; box-shadow: none; }
.order-print-page { box-sizing: border-box; width: 210mm; min-height: 297mm; max-height: 297mm; padding: 18mm 17.5mm; background: white; color: #000; font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif; font-size: 14px; overflow: hidden; break-after: page; page-break-after: always; }
.order-print-head { display: grid; grid-template-columns: 41mm 1fr 52mm; width: 175mm; margin: 0 auto 9mm; border: 1.2px solid #000; align-items: stretch; }
.order-logo-box { display: flex; align-items: center; justify-content: center; min-height: 26mm; border-right: 1px solid #000; }
.order-logo-box img { max-width: 32mm; max-height: 16mm; object-fit: contain; }
.order-print-head h1 { display: flex; align-items: center; justify-content: center; margin: 0; font-size: 28px; letter-spacing: 8px; font-weight: 800; }
.order-meta-table { width: 100%; border-collapse: collapse; border-left: 1px solid #000; font-size: 13px; table-layout: fixed; }
.order-meta-table th, .order-meta-table td { height: 8.6mm; border-bottom: 1px dotted #777; text-align: center; font-weight: 400; }
.order-meta-table tr:last-child th, .order-meta-table tr:last-child td { border-bottom: 0; }
.order-meta-table th { width: 20mm; border-right: 1px dotted #777; letter-spacing: 2px; }
.order-party-table, .order-delivery-table, .order-items-print-table { width: 175mm; margin: 0 auto; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.order-party-table { border: 1.2px solid #000; }
.order-party-table thead th { height: 8mm; border: 1px solid #000; background: #e8e8e8; font-size: 15px; letter-spacing: 14px; text-align: center; }
.order-party-table tbody th, .order-party-table tbody td { height: 8.6mm; border: 1px dotted #777; font-weight: 400; }
.order-party-table tbody th { width: 27mm; background: #eee; text-align: center; letter-spacing: 2px; }
.order-party-table tbody td { padding: 0 7px; }
.order-delivery-table { border-left: 1.2px solid #000; border-right: 1.2px solid #000; border-bottom: 1.2px solid #000; }
.order-delivery-table th, .order-delivery-table td { height: 8mm; border: 1px dotted #777; font-weight: 400; }
.order-delivery-table th { width: 27mm; background: #eee; text-align: center; letter-spacing: 1px; }
.order-delivery-table td { padding: 0 8px; }
.order-request-text { width: 175mm; margin: 0 auto; box-sizing: border-box; padding: 4px 6px; border-left: 1.2px solid #000; border-right: 1.2px solid #000; font-size: 13px; }
.order-items-print-table { border: 1.2px solid #000; font-size: 13px; }
.order-items-print-table th, .order-items-print-table td { height: 9.1mm; border: 1px dotted #777; text-align: center; font-weight: 400; }
.order-items-print-table thead th { background: #eee; }
.order-items-print-table th:nth-child(1), .order-items-print-table td:nth-child(1) { width: 14mm; }
.order-items-print-table th:nth-child(2), .order-items-print-table td:nth-child(2) { width: 35mm; }
.order-items-print-table th:nth-child(3), .order-items-print-table td:nth-child(3) { width: 36mm; }
.order-items-print-table th:nth-child(4), .order-items-print-table td:nth-child(4) { width: 11mm; }
.order-items-print-table th:nth-child(5), .order-items-print-table td:nth-child(5) { width: 26mm; }
.order-items-print-table th:nth-child(6), .order-items-print-table td:nth-child(6) { width: 28mm; }
.order-items-print-table th:nth-child(7), .order-items-print-table td:nth-child(7) { width: 25mm; }
.order-items-print-table .order-total-row td { border-left: 1px dotted #777; border-right: 1px dotted #777; }
.order-items-print-table .order-total-row th { background: white; font-size: 13px; }
.order-special-box { display: grid; grid-template-columns: 14mm 1fr; width: 175mm; min-height: 20mm; margin: 0 auto; border-left: 1.2px solid #000; border-right: 1.2px solid #000; border-bottom: 1.2px solid #000; font-size: 13px; }
.order-special-box strong { display: flex; align-items: center; justify-content: center; border-right: 1px dotted #777; font-weight: 400; line-height: 1.5; }
.order-special-box div { padding: 8px 10px; line-height: 1.45; white-space: pre-wrap; }
.order-template-page { position: relative; padding: 0; background: #fff url("assets/templates/order-form-template.png") center / 210mm 297mm no-repeat !important; color: #000 !important; font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif; font-size: 10px; }
.order-template-page, .order-template-page * { color: #000 !important; background-color: transparent !important; border-color: transparent; }
.order-fill { position: absolute; display: flex; align-items: center; justify-content: center; box-sizing: border-box; height: 6mm; padding: 0 1.4mm; color: #000 !important; font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif; font-size: 10px; font-weight: 700; line-height: 1.12; white-space: normal; overflow: hidden; overflow-wrap: break-word; word-break: keep-all; text-align: center; pointer-events: none; }
.order-fill.meta-doc-no { left: 157mm; top: 20.6mm; width: 31mm; }
.order-fill.meta-author { left: 157mm; top: 29.4mm; width: 31mm; }
.order-fill.meta-date { left: 157mm; top: 38.2mm; width: 31mm; }
.order-fill.party-left { left: 44.4mm; width: 34.7mm; height: 8.8mm; }
.order-fill.party-right { left: 134.1mm; width: 54.3mm; height: 8.8mm; }
.order-fill.receiver { left: 44.4mm; top: 137.8mm; width: 55.9mm; height: 8.8mm; }
.order-fill.receiver-phone { left: 134.1mm; top: 137.8mm; width: 54.3mm; height: 8.8mm; }
.order-fill.arrival-place { left: 44.4mm; top: 146.8mm; width: 144mm; height: 8.8mm; }
.order-fill.item-no { left: 18.2mm; width: 13.5mm; }
.order-fill.item-plant { left: 31.8mm; width: 34.1mm; }
.order-fill.item-name { left: 66.2mm; width: 35.2mm; }
.order-fill.item-qty { left: 101.6mm; width: 10.6mm; }
.order-fill.item-unit { left: 112.4mm; width: 26.2mm; }
.order-fill.item-no, .order-fill.item-plant, .order-fill.item-name, .order-fill.item-qty, .order-fill.item-unit, .order-fill.item-price, .order-fill.item-amount { height: 9.14mm; padding: 0 .8mm; font-size: 10px; font-weight: 700; line-height: 1.12; }
.order-fill.item-price { left: 138.7mm; width: 28mm; }
.order-fill.item-amount { left: 166.9mm; width: 21.5mm; }
.order-fill.vat-value { left: 166.9mm; top: 220.3mm; width: 21.5mm; height: 9.1mm; padding: 0 1mm; font-size: 10px; font-weight: 700; line-height: 1.12; }
.order-fill.total-value { left: 166.9mm; top: 229.5mm; width: 21.5mm; height: 9.1mm; padding: 0 1mm; font-size: 10px; font-weight: 700; line-height: 1.12; }
.special-note-fill { position: absolute; left: 72.5mm; top: 247mm; width: 79mm; height: 15mm; padding: 0 2mm; color: #000 !important; font-size: 11px; font-weight: 400; line-height: 1.45; white-space: normal; overflow: hidden; pointer-events: none; display: flex; align-items: center; justify-content: center; text-align: center; overflow-wrap: break-word; word-break: keep-all; }
.contract-print-page { --contract-content-width: 180mm; position: relative; box-sizing: border-box; width: 210mm; min-height: 297mm; max-height: 297mm; padding: 18mm 15mm; background: white; font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif; font-size: 10.2px; overflow: hidden; break-after: page; page-break-after: always; }
.contract-print-page:last-child { break-after: auto; page-break-after: auto; }
.contract-template-page { padding: 0; background-color: #fff !important; background-position: center !important; background-size: 210mm 297mm !important; background-repeat: no-repeat !important; }
.contract-template-page-1 { background-image: url("assets/templates/contract-form-template-1.png") !important; }
.contract-template-page-2 { background-image: url("assets/templates/contract-form-template-2.png") !important; }
.contract-template-page-3 { background-image: url("assets/templates/contract-form-template-3.png") !important; }
.contract-template-page-4 { background-image: url("assets/templates/contract-form-template-4.png") !important; }
.contract-template-page-5 { background-image: url("assets/templates/contract-form-template-5.png") !important; }
.contract-fill { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 0 1mm; color: #000 !important; font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif; font-size: 13px; font-weight: 400; line-height: 1.18; text-align: center; white-space: normal; overflow: hidden; overflow-wrap: break-word; word-break: keep-all; pointer-events: none; }
.contract-fill.cover { background: #fff; }
.contract-fill.multiline { align-items: center; justify-content: flex-start; padding: .8mm 2mm; text-align: left; line-height: 1.35; white-space: normal; }
.contract-manager-fill { font-size: 11px; }
.contract-row-fill { font-size: 13px; }
.contract-money-fill { justify-content: center; padding: 0; font-size: 13px; font-weight: 600; }
.contract-due-fill { font-size: 10px; }
.contract-check-fill { padding: 0; background: transparent; font-size: 17px; font-weight: 900; line-height: 1; }
.contract-long-fill { font-size: 12px; }
.contract-date-fill, .contract-date-part-fill { font-size: 12px; }
.contract-party-fill { align-items: center; justify-content: center; padding: 0 1.4mm; font-size: 10.4px; line-height: 1.08; text-align: center; }
.contract-party-address-fill { font-size: 9.6px; line-height: 1.05; }
/* The template ends above its sample date; the live signing fields finish the same frame. */
.contract-filled-template { --contract-sign-top: 217mm; background-image: none !important; }
.contract-filled-template::before { content: ""; position: absolute; inset: 0; background: #fff url("assets/templates/contract-form-template-1.png") left top / 210mm 297mm no-repeat; clip-path: inset(0 0 calc(297mm - var(--contract-sign-top)) 0); pointer-events: none; }
.contract-signing-section { position: absolute; left: 12.196mm; top: var(--contract-sign-top); z-index: 5; box-sizing: border-box; width: 177.223mm; height: 55.874mm; padding: 0; border: solid #000; border-width: 0 .35mm .25mm; background: #fff !important; color: #000 !important; font-family: "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif; font-size: 10pt; font-weight: 400; pointer-events: none; }
.contract-sign-date { display: flex; align-items: center; justify-content: flex-start; box-sizing: border-box; height: 10.035mm; padding: 0 1.5mm; border-bottom: .1mm solid #000; font: inherit; }
.contract-sign-columns { display: grid; grid-template-columns: 2fr 3fr; grid-template-rows: minmax(0, 1fr); height: calc(100% - 10.035mm); }
.contract-sign-party { display: grid; grid-template-rows: 5mm repeat(5, minmax(0, 1fr)); min-width: 0; min-height: 0; padding: 0 1.5mm; }
.contract-sign-party-title { display: flex; align-items: center; font: inherit; }
.contract-sign-row { display: grid; grid-template-columns: 25mm minmax(0, 1fr); gap: 1.2mm; align-items: center; min-width: 0; min-height: 0; font: inherit; line-height: 1.15; }
.contract-sign-label { display: flex; align-items: center; justify-content: space-between; white-space: nowrap; }
.contract-sign-value { min-width: 0; white-space: normal; overflow-wrap: anywhere; word-break: keep-all; }
.contract-sign-row-5 { grid-template-columns: 25mm minmax(0, 1fr) 7mm; }
.contract-sign-mark { white-space: nowrap; }
.contract-print-page h1 { width: var(--contract-content-width); margin: 0 auto 7mm; text-align: center; font-size: 27px; font-weight: 800; letter-spacing: 8px; }
.contract-manager-box { display: grid; grid-template-columns: 26mm 1fr; width: 78mm; min-height: 10.5mm; margin: 0 0 -0.8px auto; border: 1px solid #000; font-size: 13px; }
.contract-manager-box b, .contract-manager-box span { display: flex; align-items: center; justify-content: center; padding: 2px 4px; }
.contract-manager-box b { background: #e8e8e8; border-right: 1px solid #000; }
.contract-main-table { width: var(--contract-content-width); margin: 0 auto; border-collapse: collapse; table-layout: fixed; font-size: 13px; line-height: 1.1; border: 1.2px solid #000; }
.contract-main-table .contract-label-col { width: 45mm; }
.contract-main-table .contract-kind-col { width: 20mm; }
.contract-main-table .contract-amount-col { width: 70mm; }
.contract-main-table .contract-note-col { width: 45mm; }
.contract-main-table th, .contract-main-table td { border: 1px solid #000; padding: 2px 6px; color: #000; vertical-align: middle; }
.contract-main-table th { background: #e5e5e5; text-align: center; font-weight: 800; letter-spacing: 6px; }
.contract-main-table td { height: 8mm; text-align: left; }
.contract-main-table .contract-pay-kind { text-align: center; }
.contract-main-table .muted-note { margin-left: 8px; }
.contract-confirm-text { width: var(--contract-content-width); min-height: 20mm; box-sizing: border-box; margin: 0 auto; padding: 4px 8px; border-left: 1px solid #000; border-right: 1px solid #000; font-size: 13px; line-height: 1.75; }
.contract-date { width: var(--contract-content-width); box-sizing: border-box; margin: 0 auto; padding: 0 70px 9px 0; border-left: 1px solid #000; border-right: 1px solid #000; text-align: right; font-size: 13px; }
.contract-sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18mm; width: var(--contract-content-width); min-height: 46mm; box-sizing: border-box; margin: 0 auto; padding: 6px 9px 6px; border: 1.2px solid #000; align-items: start; }
.contract-sign-grid h3 { margin: 0 0 8px; font-size: 13px; font-weight: 400; }
.contract-sign-grid p { display: grid; grid-template-columns: 30mm 1fr; gap: 6px; min-height: 8.4mm; margin: 0; align-items: center; font-size: 13px; line-height: 1.1; }
.contract-sign-grid b { font-weight: 400; letter-spacing: 7px; }
.contract-terms-page { padding: 18mm 17mm; font-size: 14px; line-height: 1.58; }
.contract-terms-page h1 { margin: 0 0 20mm; text-align: center; font-size: 22px; letter-spacing: 10px; font-weight: 700; }
.contract-term-block { width: 176mm; max-width: 100%; margin: 0 auto 9mm; break-inside: avoid; page-break-inside: avoid; }
.contract-term-block h2 { margin: 0 0 3px; font-size: 14px; font-weight: 800; color: #000; }
.contract-term-block p { margin: 0 0 2px 10mm; color: #000; font-size: 14px; line-height: 1.58; text-align: justify; }
.contract-term-block p.no-indent { margin-left: 0; }
.contract-terms-page.continued h1 { display: none; }
.contract-terms-page.continued { padding-top: 18mm; }
@media (max-width: 1100px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .main-nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid.four, .form-grid.five, .form-grid.six { grid-template-columns: repeat(2, 1fr); }
  .company-employee-grid { grid-template-columns: 1fr; }
  .trade-profile-grid { grid-template-columns: 1fr; }
  .contract-entry-layout { grid-template-columns: 1fr; }
  .contract-entry-layout .contract-photo-panel { position: static; }
  .info-overview-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .calendar-layout { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; overflow: visible; }
  .draft-editor-column, .document-preview { grid-column: 1; }
  .document-preview { grid-row: auto; position: static; }
  .document-preview .preview-sheet { zoom: .55; }
}
@media (max-width: 720px) {
  .info-overview-grid { grid-template-columns: 1fr; }
}
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; background: white; }
  .document-action-bar, .top-actions, .summary-grid, .sidebar, .type-switch, .section-title-row button, .remove-item, .bom-panel { display: none !important; }
  main { padding: 0; }
  .workspace { display: block; }
  .editor, .draft-editor-column { border: 0; box-shadow: none; padding: 10px; }
  input, select, textarea { border: 0; padding: 2px; appearance: none; resize: none; }
  .calculation-panel { break-inside: avoid; }
  body.structure-print-mode .topbar, body.structure-print-mode .document-action-bar, body.structure-print-mode main, body.structure-print-mode .toast { display: none !important; }
  body.structure-print-mode .structure-print { display: block; box-sizing: border-box; width: 210mm; min-height: 297mm; padding: 8mm; }
  body.structure-print-mode.contract-print-mode .structure-print { padding: 0; }
  body.structure-print-mode.order-print-mode .structure-print { padding: 0; }
  body.structure-print-mode .print-logo, body.structure-print-mode .company-seal, body.structure-print-mode .print-summary, body.structure-print-mode .order-template-page, body.structure-print-mode .contract-template-page {
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  body.contract-print-mode .contract-main-table th,
  body.contract-print-mode .contract-manager-box b {
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
}

/* Project plants: one delivery destination, independent document snapshots. */
.quote-plants-field { display:none; }
body.quote-document-mode .quote-plants-field { display:block; }
body.quote-document-mode .project-name-field { display:none; }
body.order-document-mode .quote-project-select-field { display:block; }
.plant-choices { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
.plant-choice { display:flex !important; align-items:center; gap:6px; padding:7px 10px; border:1px solid #cbd8e3; border-radius:6px; cursor:pointer; }
.plant-choice input { width:auto; margin:0; }
.plant-help { font-size:12px; color:#536b7b; margin:6px 0; }
.project-plants-editor { margin:16px 0; padding:12px; border:1px solid #d8e3ec; border-radius:8px; }
.project-plant-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:12px 0; border-top:1px solid #e1e8ef; }
.project-plant-row .remove-plant { justify-self:end; grid-column:1/-1; }
.project-plant-summary { display:block; color:#536b7b; margin-top:5px; }
.order-plant-selector { margin-bottom:12px; }
@media(max-width:700px) { .project-plant-row { grid-template-columns:1fr; } }

/* Move the dates out of the party block into the continuous delivery rows. */
.order-template-page .order-date-mask { position:absolute; left:18mm; top:126.3mm; width:170.7mm; height:11.5mm; background:#fff !important; }
.order-template-page .order-date-block { position:absolute; left:18.2mm; top:129mm; width:170.2mm; height:8.8mm; display:grid; grid-template-columns:26.2mm 55.9mm 33.8mm 54.3mm; border:1px solid #000; box-sizing:border-box; background:#fff !important; font-size:10px; }
.order-template-page .order-date-block span { display:flex; align-items:center; justify-content:center; border-right:1px dotted #777; color:#000; }
.order-template-page .order-date-block span:last-child { border-right:0; }
.order-template-page .order-page-number { position:absolute; bottom:8mm; left:95mm; width:20mm; text-align:center; font-size:10px; }

/* Flowing order tables: no fixed-position text boxes or clipped values. */
.order-flow-page { display:flex; flex-direction:column; min-height:297mm; max-height:none; overflow:visible; padding:18mm 20mm; color:#000; background:#fff; font-size:10px; line-height:1.35; }
.order-flow-page, .order-flow-page * { box-sizing:border-box; }
.order-flow-page table { width:170mm; min-width:0; max-width:100%; table-layout:fixed; border-collapse:collapse; margin:0; }
.order-flow-page th, .order-flow-page td { border:1px solid #333; text-align:center; vertical-align:middle; padding:1.5mm 1mm; white-space:pre-wrap; overflow-wrap:anywhere; word-break:normal; height:auto; min-width:0; color:#000; }
.order-flow-page th { background:#eee; font-weight:400; font-size:11px; }
.order-flow-page td { font-weight:600; }
.order-flow-heading { display:grid; grid-template-columns:40mm 77mm 53mm; width:170mm; border:1px solid #333; margin-bottom:8mm; }
.order-flow-heading > div, .order-flow-heading h1 { display:flex; align-items:center; justify-content:center; border-right:1px solid #333; margin:0; padding:2mm; }
.order-flow-heading img { max-width:34mm; max-height:18mm; object-fit:contain; }
.order-flow-heading h1 { font-size:23px; letter-spacing:4px; }
.order-flow-heading table { width:53mm; border-style:hidden; }
.order-flow-heading th { width:20mm; }
.order-flow-heading td { height:8mm; }
.order-flow-party td { height:8mm; }
.order-flow-party thead th { height:8mm; letter-spacing:5px; }
.order-seal-cell img { width:17mm; max-width:100%; height:auto; }
.order-flow-delivery { margin-top:3mm !important; }
.order-flow-delivery td { height:8mm; }
.order-transport-request-value {text-align:left!important;white-space:pre-wrap!important;}
/* The adjacent delivery/items tables supply the horizontal edges. */
.order-flow-request { margin:0; padding:2mm; border:1px solid #333; border-top:0; border-bottom:0; text-align:left; font-weight:400; }
.order-flow-items td { height:9mm; }
/* Keep long model codes inside item cells in both browser and canvas/PDF rendering. */
.order-flow-items .order-data-row td { word-break:break-all; }
.order-flow-items th { height:8mm; }
.order-flow-items .order-flow-special-notes-cell {height:18mm;font-weight:400!important;text-align:left!important;}
.order-flow-special-notes-cell strong {font-weight:700;margin-right:3mm;}
.order-flow-special-notes-cell span {white-space:pre-wrap;overflow-wrap:anywhere;}
.order-flow-page footer { text-align:center; padding-top:2mm; margin-top:auto; }
.order-flow-page tr { break-inside:avoid; page-break-inside:avoid; }
.order-flow-page thead { display:table-header-group; }
.order-layout-probe { position:fixed; left:-20000px; top:0; visibility:hidden; pointer-events:none; width:210mm; }
.order-layout-probe .order-flow-page { min-height:0; }
/* One owner per table edge also avoids doubled collapsed borders in PDF rasterization. */
.structure-print .print-meta, .structure-print .print-group table,
.order-flow-page table {
  border-collapse:separate; border-spacing:0;
  border:0; border-top:1px solid #333; border-left:1px solid #333;
}
.structure-print .print-meta th, .structure-print .print-meta td,
.structure-print .print-group table th, .structure-print .print-group table td,
.order-flow-page th, .order-flow-page td {
  border:0; border-right:1px solid #333; border-bottom:1px solid #333;
}
/* This nested table shares the heading's outer frame and left divider. */
.order-flow-heading table { border:0; }
.order-flow-heading tr > :last-child { border-right:0; }
.order-flow-heading tr:last-child > * { border-bottom:0; }
.order-edit-table { min-width:1050px; table-layout:fixed; }
.order-edit-table th:nth-child(2) { width:150px; }
.order-edit-table th:nth-child(3), .order-edit-table th:nth-child(4), .order-edit-table th:nth-child(9) { width:150px; }
.order-edit-table th:nth-child(5), .order-edit-table th:nth-child(6) { width:65px; }
.order-edit-table input, .order-edit-table td:nth-child(2) input, .order-edit-table td:nth-child(3) input, .order-edit-table textarea { width:100%; text-align:center; }
.order-edit-table textarea { min-height:48px; padding:7px; font:inherit; white-space:pre-wrap; overflow-wrap:anywhere; resize:vertical; overflow:hidden; }
@media print {
  .order-flow-page, .order-flow-page th { print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  .order-flow-page { max-height:none; overflow:visible; }
  .order-flow-page:last-child { break-after:auto; page-break-after:auto; }
}

.project-work-kinds { margin:0; padding:8px; border:1px solid #d5e0e8; border-radius:8px; }
.project-work-kinds legend { font-size:12px; font-weight:700; color:var(--muted); }
.project-work-kinds label { display:inline-flex; align-items:center; gap:5px; margin:4px; }
.project-work-kinds input { width:auto; margin:0; }
.project-distribution-options { padding-top:5px; border-top:1px solid #d5e0e8; }
.plant-receiving-settings { grid-column:1/-1; background:#eef5f8; padding:10px; border-radius:6px; }
.plant-receiving-settings select { max-width:320px; }
.project-table { min-width:1900px; }
.project-table td { white-space:pre-wrap; overflow-wrap:anywhere; vertical-align:middle; }
.project-table td:first-child { font-weight:700; }
/* Compact, equal-height order entry controls; print wrapping remains unchanged. */
.order-edit-table input:not([type=checkbox]), .order-edit-table textarea, .order-plant-picker summary { height:32px; min-height:32px; max-height:32px; box-sizing:border-box; padding:6px 7px; font-size:12px; line-height:18px; }
.order-edit-table textarea { resize:none; overflow:auto; }
.order-plant-picker { position:relative; text-align:left; }
.order-plant-picker summary { border:1px solid #c7d6e5; border-radius:7px; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.order-plant-options { position:relative; min-width:130px; background:white; border:1px solid #c7d6e5; padding:6px; }
.order-plant-options label { display:flex; align-items:center; gap:6px; padding:5px; white-space:normal; }
.order-edit-table .order-plant-options input { width:14px; height:14px; margin:0; }
.order-plant-selector[hidden] { display:none !important; }
.order-plant-picker .order-plant-options { position:fixed; z-index:10000; max-height:240px; overflow-y:auto; box-shadow:0 6px 20px #16344f33; border-radius:7px; box-sizing:border-box; }
.order-plant-picker .order-plant-options label { justify-content:flex-start; min-height:32px; font-size:12px; }
.order-plant-picker .order-plant-options input[type=checkbox] { flex:0 0 14px; min-width:14px; padding:0; }
.project-table { min-width:1350px; table-layout:fixed; }
.project-table th, .project-table td { padding:5px 4px; font-size:11px; }
.project-table th:nth-child(4) { width:55px; }
.project-table th:nth-child(5) { width:115px; }
.project-table th:nth-child(10), .project-table th:nth-child(13) { width:155px; }
.project-table th:last-child { width:120px; }
.project-work-kinds [hidden] { display:none !important; }
#projectWorkCategory { width:100%; margin-bottom:5px; }
/* Order unit price: manual entry without spinner buttons. */
#orderItemsBody input[data-order-field="unitPrice"] { appearance:textfield; -moz-appearance:textfield; }
#orderItemsBody input[data-order-field="unitPrice"]::-webkit-inner-spin-button,
#orderItemsBody input[data-order-field="unitPrice"]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
/* Project header: one aligned control row with inline work options. */
.project-editor.form-grid.four { grid-template-columns:minmax(140px,1fr) minmax(140px,1fr) minmax(390px,1.8fr) 110px; align-items:start; }
.project-work-kinds { border:0; padding:0; min-width:0; display:flex; align-items:center; gap:8px; }
.project-work-kinds legend { padding:0; margin-bottom:5px; }
.project-work-kinds #projectWorkCategory { width:82px; flex:0 0 82px; margin:0; height:38px; padding:6px; }
.project-work-kinds .project-distribution-options, .project-work-kinds .project-construction-options { display:flex; align-items:center; flex-wrap:wrap; gap:5px; border:0; padding:0; min-height:38px; }
.project-work-kinds label { margin:0; gap:3px; white-space:nowrap; font-size:11px; }
#projectMasterName, #projectMasterCompany, #projectMasterCapacity { height:38px; box-sizing:border-box; }
@media(max-width:1100px) { .project-editor.form-grid.four { grid-template-columns:1fr 1fr; } .project-work-kinds { grid-column:1/-1; } #projectMasterCapacity { max-width:110px; } }
/* Unified project header typography and balanced full-width spacing. */
.project-editor.form-grid.four { grid-template-columns:minmax(140px,1fr) minmax(140px,1fr) minmax(400px,1.65fr) 110px; gap:10px; }
.project-editor > label > input, .project-work-kinds #projectWorkCategory, .project-work-kinds label { font-family:inherit; font-size:12px; font-weight:500; color:var(--ink); }
.project-work-kinds { gap:8px; }
.project-work-kinds #projectWorkCategory { flex:0 0 76px; width:76px; }
.project-work-kinds .project-distribution-options, .project-work-kinds .project-construction-options { flex:1; justify-content:space-between; flex-wrap:nowrap; gap:6px; }
.project-work-kinds label { gap:4px; }
@media(max-width:1050px) { .project-editor.form-grid.four { grid-template-columns:1fr 1fr; } .project-work-kinds { grid-column:1/-1; } }
/* Document search/actions now live in document & schedule management. */
body #page-draft .workspace { grid-template-columns:minmax(0,1fr); }
.legacy-document-list[hidden] { display:none !important; }
.document-backup-tools { display:flex; flex-wrap:wrap; gap:10px; margin:12px 0 20px; }
.document-backup-tools .full { display:inline-flex; align-items:center; justify-content:center; width:192px; min-height:42px; margin:0; padding:7px 9px; font-size:12px; white-space:nowrap; }
#page-calendar .toolbar-grid { grid-template-columns:minmax(220px,1fr) 150px 150px; }
/* Balanced project registration row. */
.project-editor.form-grid.four { grid-template-columns:minmax(150px,1fr) minmax(150px,1fr) minmax(370px,1.45fr) 160px; gap:12px; }
.project-work-kinds .project-distribution-options, .project-work-kinds .project-construction-options { justify-content:flex-start; gap:10px; }
#projectMasterCapacity { width:100%; max-width:none; }
@media(max-width:1050px) { .project-editor.form-grid.four { grid-template-columns:1fr 160px; } .project-work-kinds { grid-column:1/-1; } }
#quotePlantChoices { display:block; margin:5px 0 8px; }
.quote-plant-picker { width:100%; }
.quote-plant-picker summary { height:38px; min-height:38px; padding:8px; font-size:12px; line-height:20px; box-sizing:border-box; background:white; }
.quote-plant-picker .order-plant-options label { display:flex; margin:0; font-weight:500; color:var(--ink); }
.quote-plant-picker .order-plant-options input[type=checkbox] { width:14px; height:14px; margin:0; flex:0 0 14px; }
/* Category in heading; options in a single aligned field below. */
.project-editor.form-grid.four { grid-template-columns:minmax(150px,1fr) minmax(150px,1fr) 340px 160px; gap:10px; }
.project-work-kinds { display:block; position:relative; padding:0; border:0; }
.project-work-kinds legend { display:flex; align-items:center; justify-content:space-between; width:100%; height:17px; line-height:17px; margin-bottom:5px; overflow:visible; }
.project-work-kinds #projectWorkCategory { width:76px; height:22px; min-height:22px; padding:0 5px; font-size:12px; margin:0; border-radius:4px; }
.project-work-kinds .project-distribution-options, .project-work-kinds .project-construction-options { height:38px; min-height:38px; box-sizing:border-box; border:1px solid #c7d6e5; border-radius:7px; padding:0 9px; gap:9px; width:100%; }
@media(max-width:1050px) { .project-editor.form-grid.four { grid-template-columns:1fr 160px; } .project-work-kinds { grid-column:1; } }
.plant-select-heading { display:flex; justify-content:space-between; align-items:center; }
.plant-select-heading label { display:flex; gap:4px; align-items:center; margin:0; }
.plant-select-heading input { width:14px; height:14px; margin:0; }
.quote-plants-field textarea, .info-card textarea[name=siteAddress] { min-height:38px; resize:none; overflow:hidden; white-space:pre-wrap; overflow-wrap:anywhere; }
.project-work-kinds legend { justify-content:flex-start; gap:2em; }
/* Content-sized business choices; capacity absorbs the remaining row width. */
.project-editor.form-grid.four { grid-template-columns:minmax(150px,1fr) minmax(150px,1fr) max-content minmax(180px,1fr); column-gap:10px; }
.project-work-kinds { width:max-content; }
.project-work-kinds legend { width:100%; justify-content:flex-start; gap:24px; }
.project-work-kinds .project-distribution-options, .project-work-kinds .project-construction-options { width:max-content; flex:none; }
@media(max-width:1050px) { .project-editor.form-grid.four { grid-template-columns:max-content minmax(180px,1fr); } .project-editor > label:nth-child(1), .project-editor > label:nth-child(2) { grid-column:auto; } .project-work-kinds { grid-column:1; } }
.project-work-kinds { padding-top:22px; }
.project-work-kinds legend { position:absolute; top:0; left:0; width:max-content; margin:0; }
#documentSwitchDialog { border:1px solid #c7d6e5; border-radius:12px; padding:24px; max-width:440px; color:#17344f; box-shadow:0 12px 50px #0003; }
#documentSwitchDialog::backdrop { background:#102c4966; }
#documentSwitchDialog p { line-height:1.6; }
#documentSwitchDialog div { display:flex; gap:10px; justify-content:flex-end; }
#plantAddressWarning { border:1px solid #c7d6e5; border-radius:12px; padding:24px; max-width:440px; color:#17344f; box-shadow:0 12px 50px #0003; }
#plantAddressWarning::backdrop { background:#102c4966; }
#plantAddressWarning p { line-height:1.6; }
.extra-fee-row { grid-template-columns:1.2fr 1fr 1fr 1fr auto; gap:8px; margin:8px 0; align-items:end; }
.extra-fee-row:has([data-manual]:not([hidden])) { grid-template-columns:1fr 1fr 1fr 1fr 1fr auto; }
.extra-fee-row [hidden] { display:none !important; }
.order-flow-party .order-email { display:block; text-align:center; line-height:1.25; }
.order-flow-party .order-email > span { display:block; white-space:nowrap; text-align:center; font-size:9px; }
/* Quote header: bold company labels and normal-weight entered metadata. */
.print-header-grid .company-card-body .label { font-weight:700; }
.print-header-grid .print-meta td { font-weight:400; }
/* Email uses the same font size as the other order party values. */
.order-flow-party .order-email > span { font-size:inherit; }
/* Keep the business field stable when switching to construction. */
.project-work-kinds .project-distribution-options,
.project-work-kinds .project-construction-options { width:274px; }
.project-work-kinds .project-construction-options { justify-content:space-around; }
.contract-legacy-fields[hidden] { display:none !important; }
.contract-editor-layout { grid-template-columns:1fr !important; }
#documentPreview > .contract-photo-panel { display:none; }
#documentPreview.actual-contract-mode > .section-title-row,
#documentPreview.actual-contract-mode > #documentPreviewBody { display:none; }
#documentPreview.actual-contract-mode > .contract-photo-panel { display:block; width:100%; box-sizing:border-box; }
.contract-payment-table { width:100%; min-width:650px; table-layout:fixed; }
.contract-payment-table th,.contract-payment-table td { padding:5px 3px; text-align:center; }
.contract-payment-table input { width:100%; min-width:0; padding:6px 3px; font-size:12px; }
.contract-payment-table th:first-child { width:60px; }
.contract-payment-table th:last-child { width:45px; }
.contract-party-editor-grid { margin-top:18px; }
.contract-entry-layout { grid-template-columns:1fr !important; }
.contract-photo-zoom { display:flex; align-items:center; justify-content:center; gap:10px; margin:10px 0; }
#contractImagePreview { display:block; height:65vh; max-height:none; overflow:auto; padding:8px; box-sizing:border-box; }
#contractImagePreview img { width:calc(100% * var(--contract-photo-scale,1)); max-width:none; max-height:none; height:auto; object-fit:initial; }

#contractImagePreview:has(img) { cursor:grab; touch-action:none; user-select:none; }
#contractImagePreview.is-panning { cursor:grabbing; }
.contract-photo-panel .row-actions { flex-shrink:0; }
.contract-photo-panel .row-actions button, .contract-photo-panel .row-actions label { white-space:nowrap; }
.file-preview-dialog {width:90vw;max-width:1400px;height:88vh;border:1px solid #cad8e6;border-radius:12px;padding:16px;}
.file-preview-dialog header {display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;}
.file-preview-dialog iframe {width:100%;height:calc(100% - 55px);border:0;}
.pdf-source-frame {position:fixed;left:-15000px;top:0;width:1280px;height:900px;}
.pdf-render-stage {display:block!important;width:210mm;min-height:297mm;background:white;position:absolute;left:0;top:0;z-index:-1;}
.document-mail-dialog {width:min(680px,90vw);border:1px solid #cad8e6;border-radius:12px;padding:24px;}
.document-mail-dialog label {display:block;margin:12px 0;}
.document-mail-dialog input,.document-mail-dialog textarea {width:100%;}
.file-preview-pages {height:calc(100% - 65px);overflow:auto;background:#e8edf2;padding:16px;text-align:center;} .file-preview-pages canvas,.file-preview-pages img {display:block;max-width:100%;height:auto;margin:0 auto 16px;background:white;}
.image-preview-dialog[open] {display:flex;flex-direction:column;overflow:hidden;}
.image-preview-dialog header {flex-shrink:0;flex-wrap:wrap;}
.image-preview-viewport {position:relative;flex:1;min-height:0;height:auto;padding:0;overflow:hidden;touch-action:none;user-select:none;}
.image-preview-viewport img {position:absolute;left:50%;top:50%;max-width:none;max-height:none;margin:0;transform-origin:center;pointer-events:none;}
.image-preview-viewport img[hidden] {display:none;}
.image-preview-viewport.can-pan {cursor:grab;}
.image-preview-viewport.is-panning {cursor:grabbing;}
.image-preview-viewport:focus-visible {outline:2px solid #2865a9;outline-offset:-2px;}
.file-preview-image-tools {display:flex;align-items:center;gap:6px;margin-left:auto;}
.file-preview-image-tools button {padding:6px 10px;border:1px solid #cad8e6;border-radius:7px;background:#f3f7fb;color:#17354f;font-size:13px;white-space:nowrap;}
.file-preview-image-tools output {min-width:46px;text-align:center;font-size:13px;font-variant-numeric:tabular-nums;color:#17354f;}
.image-preview-dialog .file-preview-actions {margin-left:0;}
.file-preview-image-tools [data-image-save] {font-size:12px;color:#41627d;white-space:nowrap;}
.file-preview-dialog.has-contract-details[open] {display:flex;flex-direction:column;overflow:hidden;}
.has-contract-details header,.file-preview-contract-details {flex-shrink:0;}
.has-contract-details .file-preview-pages {flex:1;min-height:0;height:auto;}
.file-preview-contract-details {padding:8px 12px 12px;background:#f3f7fb;border:1px solid #cad8e6;border-radius:8px;margin-bottom:10px;color:#17354f;}
.file-preview-contract-details>strong {display:block;font-size:13px;margin-bottom:8px;}
.file-preview-contract-values {display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.file-preview-contract-values>div {flex:1;min-width:130px;}
.file-preview-contract-values span,.file-preview-contract-values b {display:block;}
.file-preview-contract-values span {font-size:12px;color:#587086;margin-bottom:4px;}
.file-preview-contract-values b {font-size:16px;}
.subcontract-upload-dialog {width:min(740px,92vw);max-height:90vh;overflow:auto;border:1px solid #cad8e6;border-radius:12px;padding:22px;}
.subcontract-upload-dialog header {display:flex;align-items:center;justify-content:space-between;gap:12px;}
.subcontract-upload-dialog label {display:flex;flex-direction:column;gap:5px;font-size:13px;margin:10px 0;}
.subcontract-input-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 12px;}
.subcontract-input-grid input,.subcontract-input-grid select {width:100%;min-width:0;}
.subcontract-upload-dialog footer {text-align:right;}
.subcontract-upload-dialog [role=alert] {color:#a12a2a;}
@media(max-width:650px){.subcontract-input-grid {grid-template-columns:1fr 1fr;}}
/* Compact wrapping toolbar and unified mail composition. */
body:not(.editor-pane-collapsed) .editor-heading {display:flex;flex-wrap:wrap;gap:8px;padding-top:10px;padding-bottom:10px;height:auto;}
.editor-heading > div:first-child {flex:1 1 140px;}
.editor-heading .type-switch,.editor-heading .editor-actions {flex:0 0 auto;gap:4px;}
.editor-heading .type-switch button,.editor-heading .editor-actions button {font-size:12px;padding:7px 9px;min-height:32px;white-space:nowrap;}
#referenceFiles,#referenceFiles::file-selector-button,#referenceFiles + p,#referenceFileList button {font-size:12px;}
#referenceFiles + p {color:var(--muted);margin:8px 0;}
.document-mail-dialog {max-height:90vh;overflow:auto;}
.mail-content {border:1px solid #cad8e6;border-radius:8px;padding:16px;background:white;font-size:13px;line-height:1.65;}
#mailBody {white-space:pre-wrap;min-height:110px;outline:none;}
#mailBody:focus {box-shadow:inset 3px 0 #c7ddf5;}
#mailSignature {margin-top:20px;}
#mailSignature p {margin-bottom:0;}
.mail-attachments {padding:10px 12px;background:#f7fafd;border:1px solid #dbe5ee;border-radius:8px;margin-top:12px;}
.mail-attachments input[type=file],.attachment-hint {font-size:12px;}
.attachment-hint {color:var(--muted);margin:8px 0;}
.document-mail-dialog .mail-attachment-choice {display:flex;align-items:center;gap:8px;font-size:12px;margin:6px 0;overflow-wrap:anywhere;}
.document-mail-dialog .mail-attachment-choice input {width:auto;flex:none;}
/* Center document types against the full editor width. */
.draft-editor-column {container-type:inline-size;container-name:document-editor;}
body:not(.editor-pane-collapsed) .editor-heading {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);position:relative;}
.editor-heading > div:first-child {grid-column:1;grid-row:1;min-width:0;}
.editor-heading .type-switch {grid-column:2;grid-row:1;justify-self:center;}
.editor-heading .editor-actions {grid-column:3;grid-row:1;justify-self:end;padding-right:34px;}
body:not(.editor-pane-collapsed) .editor-heading .editor-pane-toggle {position:absolute;right:14px;top:50%;transform:translateY(-50%);}
@container document-editor (max-width:740px) {
  body:not(.editor-pane-collapsed) .editor-heading {grid-template-columns:minmax(0,1fr) auto;}
  .editor-heading .editor-actions {grid-column:2;}
  .editor-heading .type-switch {grid-column:1 / -1;grid-row:2;}
  body:not(.editor-pane-collapsed) .editor-heading .editor-pane-toggle {top:26px;}
}

.preview-tools {flex-wrap:wrap;justify-content:flex-end;}
.preview-tools > button {white-space:nowrap;}
/* Keep centered document tabs level with the editor title. */
body:not(.editor-pane-collapsed) .editor-heading {grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:end;}
body:not(.editor-pane-collapsed) .editor-heading .type-switch {grid-column:2;grid-row:1;align-self:end;}
body:not(.editor-pane-collapsed) .editor-heading .editor-actions {grid-column:3;grid-row:1;align-self:end;}
body:not(.editor-pane-collapsed) .editor-heading .editor-pane-toggle {top:auto;bottom:10px;transform:none;}
@container document-editor (max-width:560px) {
  .editor-heading .type-switch button,.editor-heading .editor-actions button {font-size:11px;padding:6px;}
  .editor-heading .type-switch {gap:2px;padding:2px;}
  .editor-heading h2 {font-size:20px;}
}

.editor-heading .type-switch button {font-weight:700;}
.file-preview-dialog header strong {overflow-wrap:anywhere;min-width:0;}
.file-preview-dialog header button {flex-shrink:0;}
body.order-document-mode .quote-status-field {display:block;}
body.order-document-mode .quote-plants-field {display:block;}

body.order-document-mode .quote-business-field {display:block;}
.order-transport-section {margin-bottom:24px;padding-bottom:20px;border-bottom:1px solid var(--line);}
.order-transport-section h3 {margin:0 0 14px;}
.order-transport-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.order-transport-grid label {min-width:0;}
.order-transport-date-line,.order-transport-receiver-line {grid-column:1 / -1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:end;}
.order-transport-date-line label,.order-transport-receiver-line label {min-width:0;}
.order-transport-receiver-line .order-arrival-place-field {grid-column:span 4;}
.order-transport-request-line {grid-column:1 / -1;min-width:0;}
.order-transport-request-control {display:grid;grid-template-columns:minmax(0,1fr);gap:6px;min-width:0;}
.transport-request-composer {display:grid;grid-template-columns:minmax(0,1fr);gap:6px;align-items:stretch;}
.transport-request-composer.has-custom {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
.transport-request-picker {position:relative;min-width:0;}
.transport-request-picker summary {display:flex;align-items:center;justify-content:space-between;min-height:36px;padding:8px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);cursor:pointer;list-style:none;}
.transport-request-picker summary::-webkit-details-marker {display:none;}
.transport-request-picker summary::after {content:"▾";color:var(--muted);}
.transport-request-options {display:grid;gap:5px;padding:9px;border:1px solid var(--line);border-radius:8px;background:#fff;}
.transport-request-options label {display:flex;align-items:flex-start;gap:7px;margin:0;padding:4px 2px;color:var(--ink);font-size:11px;line-height:1.4;}
.transport-request-options input[type="checkbox"] {width:14px;min-width:14px;height:14px;margin:1px 0 0;}
.transport-request-entry {width:100%;min-width:0;height:36px;min-height:36px;box-sizing:border-box;}
.transport-request-entry[hidden] {display:none!important;}
.transport-request-selected {min-height:0;padding:8px 10px;border:1px solid #d9e3eb;border-radius:7px;background:#f7fafc;color:var(--ink);font-size:11px;line-height:1.5;text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;}
.transport-request-selected[hidden] {display:none!important;}
#orderSection textarea[name="orderSpecialNotes"] {height:30px;min-height:30px;padding:4px 10px;line-height:18px;overflow-y:hidden;resize:none;box-sizing:border-box;}
@container document-editor (max-width:500px) {
  .order-transport-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .order-transport-date-line,.order-transport-receiver-line {grid-template-columns:repeat(2,minmax(0,1fr));}
  .order-transport-receiver-line .order-arrival-place-field {grid-column:span 2;}
  .transport-request-composer.has-custom {grid-template-columns:minmax(0,1fr);}
}
.order-source-panel p,.order-import-dialog p {font-size:12px;color:#63768a;line-height:1.5;}
.order-import-dialog {width:min(1000px,94vw);max-height:88vh;overflow:auto;border:1px solid #cbd9e5;border-radius:12px;padding:22px;}
.order-import-dialog .table-wrap {max-height:46vh;overflow:auto;margin:14px 0;}
.order-import-dialog table {min-width:680px;}
.order-import-dialog td {white-space:normal;overflow-wrap:anywhere;}
.order-import-dialog input[type=number] {width:110px;}
.order-import-dialog input[type=checkbox] {width:auto;}
/* Compact PO editor: each item uses two complete rows without horizontal scrolling. */
.order-edit-table-wrap {overflow:visible;min-width:0;}
.order-edit-table {display:block;width:100%;min-width:0;table-layout:auto;}
.order-edit-table thead {display:none;}
.order-edit-table tbody {display:grid;gap:8px;width:100%;}
.order-edit-table tbody tr {display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:5px 6px;padding:8px;border:1px solid #d4e0eb;border-radius:8px;background:#f7fafc;}
.order-edit-table tbody td {display:block;width:auto!important;min-width:0;padding:0;border:0;text-align:left;}
.order-edit-table tbody td::before {display:block;margin-bottom:3px;color:#61758b;font-size:10px;font-weight:700;line-height:14px;}
.order-edit-table tbody td:nth-child(1) {grid-column:span 1;align-self:center;text-align:center;font-size:11px;font-weight:700;}
.order-edit-table tbody td:nth-child(2) {grid-column:span 3;}
.order-edit-table tbody td:nth-child(2)::before {content:'발전소명';}
.order-edit-table tbody td:nth-child(3),.order-edit-table tbody td:nth-child(4) {grid-column:span 4;}
.order-edit-table tbody td:nth-child(3)::before {content:'품명';}
.order-edit-table tbody td:nth-child(4)::before {content:'규격';}
.order-edit-table tbody td:nth-child(5) {grid-column:span 2;}
.order-edit-table tbody td:nth-child(5)::before {content:'수량';}
.order-edit-table tbody td:nth-child(6) {grid-column:span 1;}
.order-edit-table tbody td:nth-child(6)::before {content:'단위';}
.order-edit-table tbody td:nth-child(7),.order-edit-table tbody td:nth-child(8) {grid-column:span 2;}
.order-edit-table tbody td:nth-child(7)::before {content:'구매 단가';}
.order-edit-table tbody td:nth-child(8)::before {content:'금액';}
.order-edit-table tbody td:nth-child(8) {font-size:11px;overflow-wrap:anywhere;}
.order-edit-table tbody td:nth-child(9) {grid-column:span 4;}
.order-edit-table tbody td:nth-child(9)::before {content:'비고';}
.order-edit-table tbody td:nth-child(10) {grid-column:span 1;align-self:end;}
.order-edit-table tbody td:last-child button {width:100%;padding:6px 2px;min-width:0;font-size:10px;}
.order-edit-table input:not([type=checkbox]),.order-edit-table textarea,.order-edit-table .order-plant-picker summary {width:100%;min-width:0;font-size:11px;padding:5px;}
@media(max-width:700px) {
 .order-edit-table tbody tr {grid-template-columns:repeat(6,minmax(0,1fr));}
 .order-edit-table tbody td:nth-child(1) {grid-column:span 1;}
 .order-edit-table tbody td:nth-child(2) {grid-column:span 5;}
 .order-edit-table tbody td:nth-child(3),.order-edit-table tbody td:nth-child(4) {grid-column:span 3;}
 .order-edit-table tbody td:nth-child(5),.order-edit-table tbody td:nth-child(6),.order-edit-table tbody td:nth-child(7) {grid-column:span 2;}
 .order-edit-table tbody td:nth-child(8) {grid-column:span 2;}
 .order-edit-table tbody td:nth-child(9) {grid-column:span 3;}
}
/* Single-line PO items, sized to the editor rather than a fixed wide table. */
.order-edit-table {display:table;width:100%;min-width:0;table-layout:fixed;}
.order-edit-table thead {display:table-header-group;}
.order-edit-table tbody {display:table-row-group;}
.order-edit-table tbody tr {display:table-row;padding:0;border:0;background:white;}
.order-edit-table tbody td {display:table-cell;width:auto!important;padding:4px 2px;border-bottom:1px solid #d4e0eb;text-align:center;vertical-align:middle;}
.order-edit-table tbody td::before {display:none;}
.order-edit-table th {padding:5px 1px;font-size:10px;white-space:nowrap;}
.order-edit-table th:nth-child(1) {width:4%;}
.order-edit-table th:nth-child(2) {width:14%;}
.order-edit-table th:nth-child(3) {width:17%;}
.order-edit-table th:nth-child(4) {width:14%;}
.order-edit-table th:nth-child(5) {width:7%;}
.order-edit-table th:nth-child(6) {width:6%;}
.order-edit-table th:nth-child(7) {width:11%;}
.order-edit-table th:nth-child(8) {width:11%;}
.order-edit-table th:nth-child(9) {width:11%;}
.order-edit-table th:last-child {width:5%;}
.order-edit-table input:not([type=checkbox]),.order-edit-table textarea,.order-edit-table .order-plant-picker summary {height:30px;min-height:30px;max-height:30px;font-size:10px;line-height:18px;padding:5px 2px;border-radius:5px;}
.order-edit-table input[type=number] {appearance:textfield;-moz-appearance:textfield;}
.order-edit-table input[type=number]::-webkit-inner-spin-button,.order-edit-table input[type=number]::-webkit-outer-spin-button {appearance:none;margin:0;}
.order-edit-table tbody td:nth-child(8) {font-size:9px;overflow-wrap:anywhere;}
.order-edit-table tbody td:last-child button {height:28px;padding:3px 0;font-size:9px;border-radius:4px;}
.project-plant-row {display:block;padding:10px 0;}
.plant-basic-line {display:grid;grid-template-columns:1.15fr 1.2fr 1fr .8fr 1fr 1.7fr .65fr;gap:6px;}
.plant-receiving-line {display:grid;grid-template-columns:1.4fr 1fr 1.1fr 2fr auto;gap:6px;align-items:end;margin-top:7px;}
.project-plant-row label {min-width:0;font-size:11px;gap:3px;}
.project-plant-row input,.project-plant-row select {width:100%;min-width:0;height:30px;padding:4px 6px;font-size:11px;}
.plant-basic-line { align-items: end; }
.plant-phone-heading { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.project-plant-row .plant-phone-heading select { flex: 0 1 70px; width: 70px; height: 20px; padding: 0 2px; margin: 0; }
.plant-receiving-line .plant-receiving-settings {grid-column:auto;padding:0;background:none;}
.plant-receiving-line .plant-receiving-settings select {max-width:none;}
.plant-receiving-line .remove-plant {grid-column:auto;height:30px;padding:4px 8px;}
@media(max-width:750px) {.plant-basic-line {grid-template-columns:repeat(3,minmax(0,1fr));}.plant-receiving-line {grid-template-columns:repeat(2,minmax(0,1fr));}}
.main-nav {gap:4px;}
.main-nav button { grid-template-columns:28px 1fr;min-height:40px;padding:6px 7px; }
.construction-info {display:grid;grid-template-columns:1fr 1fr 2fr 1fr 1fr;gap:12px;align-items:end;}
.construction-summary {grid-template-columns:repeat(5,minmax(0,1fr));}
.construction-import {display:grid;grid-template-columns:minmax(200px,1fr) 160px auto;gap:8px;}
.construction-table {table-layout:fixed;width:100%;min-width:0;}
.construction-table input,.construction-table select {width:100%;min-width:0;font-size:11px;padding:5px;height:32px;}
.construction-table th,.construction-table td {padding:5px;font-size:11px;overflow-wrap:anywhere;}
.construction-table th:last-child {width:58px;}
.construction-table button {white-space:nowrap;padding:5px;}
.construction-save {display:flex;justify-content:space-between;align-items:center;gap:12px;}
#constructionBody .section-title {display:flex;justify-content:space-between;align-items:center;}
#constructionBody .help {font-size:12px;color:#60748a;line-height:1.6;}
@media(max-width:800px){.construction-info,.construction-summary {grid-template-columns:repeat(2,minmax(0,1fr));}.construction-import{grid-template-columns:1fr;}.construction-table{min-width:720px;}}
/* Compact quote editor only; printed quotation retains its existing geometry. */
#manualStructureEntry {display:flex;align-items:end;gap:10px;padding:12px;margin:8px 0;background:#f3f8fc;border:1px solid #d5e1ec;border-radius:10px;}
#manualStructureEntry.hidden {display:none;}
#manualStructureEntry>div {flex:1;}
#manualStructureEntry h3 {font-size:14px;margin:0 0 4px;}
#manualStructureEntry p {font-size:11px;color:#657382;margin:0;}
#manualStructureEntry label {width:140px;}
#structureQuoteDetails {padding:8px;}
#structureQuoteDetails .structure-category-table {width:100%;min-width:0;table-layout:fixed;}
#structureQuoteDetails .structure-category-table th,#structureQuoteDetails .structure-category-table td {width:auto;min-width:0;padding:2px 1px;white-space:normal;overflow-wrap:anywhere;font-size:10px;line-height:1.2;}
#structureQuoteDetails .quote-edit-input,#structureQuoteDetails .product-name .quote-edit-input {min-width:0;width:100%;height:28px;padding:3px 2px;border:1px solid #d5e1ec;background:#fff;border-radius:5px;font-size:10px;}
#structureQuoteDetails textarea.quote-edit-text {display:block;resize:none;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.4;box-sizing:border-box;text-align:center;}
#structureQuoteDetails .structure-category-table th,#structureQuoteDetails .structure-category-table td {font-size:9.5px;padding:1px;}
#structureQuoteDetails .quote-edit-input,#structureQuoteDetails .product-name .quote-edit-input {height:24px;padding:1px;font-size:9.5px;}
#structureQuoteDetails .quote-delete-row,#structureQuoteDetails .quote-add-row {font-size:9px;padding:3px 0;max-width:100%;}
#bomBody .bom-table thead td,#structureQuoteDetails .structure-category-table th {word-break:keep-all;overflow-wrap:normal;white-space:normal;}
.bom-header-word {display:inline-block;white-space:nowrap;}
#structureQuoteDetails .quote-delete-row,#structureQuoteDetails .quote-add-row {padding:4px 1px;font-size:10px;white-space:nowrap;}
#itemsSection .section-title-row {gap:6px;}
#standardItemsTableWrap table {width:100%;min-width:0;table-layout:fixed;}
#standardItemsTableWrap td,#standardItemsTableWrap th {padding:3px;overflow-wrap:anywhere;}
#standardItemsTableWrap input,#standardItemsTableWrap select {min-width:0;width:100%;padding:4px;font-size:11px;}

.bom-import-status .bom-delete-button {margin-left:auto;flex-shrink:0;color:#b4232f;border-color:#f0c7cc;background:#fff1f2;}

.quote-input-mode {max-width:260px;margin:8px 0;}

.quote-input-mode {max-width:none;}
#quoteInputMode {display:flex;gap:4px;padding:4px;background:#eaf0f6;border-radius:8px;width:fit-content;margin-top:5px;}
#quoteInputMode button {background:transparent;color:var(--muted);border:0;font-weight:700;padding:8px 18px;}
#quoteInputMode button[aria-pressed="true"] {background:#fff;color:#225f9f;box-shadow:0 1px 4px #16324a20;}
.bom-import-status {grid-template-columns:auto minmax(0,max-content) minmax(0,1fr) auto;gap:8px;font-size:11px;}
.bom-import-status strong,.bom-import-status>span {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.bom-import-status .bom-file-label {white-space:nowrap;padding:8px 12px;}

#bomPanel > .bom-import-status:first-child {margin-top:0;}

.calculation-panel {grid-template-columns:repeat(6,minmax(0,1fr));}
.calculation-panel.compact-quote-calculation {grid-template-columns:repeat(4,minmax(0,1fr));}
.calculation-panel > [hidden] {display:none;}
.calculation-panel div {padding:12px 8px;}
.calculation-panel span {font-size:11px;}
.calculation-panel #vat[hidden] {display:none;}

.calculation-panel {grid-template-columns:repeat(6,minmax(0,1fr));}
.calculation-panel > div {min-width:0;padding:10px 7px;}
.calculation-panel > div > span {height:30px;line-height:15px;margin-bottom:6px;}
.calculation-panel .profit-value-line {display:flex;align-items:baseline;gap:4px;flex-wrap:nowrap;border:0;padding:0;min-width:0;}
.calculation-panel strong {font-size:13px;line-height:18px;white-space:nowrap;}
.calculation-panel .profit-value-line small {font-size:10px;white-space:nowrap;}

#bomPanel.bom-awaiting-file > :not(#bomImportStatus) {display:none!important;}
#quoteModeConfirm {max-width:440px;border:1px solid #ccdbe7;border-radius:12px;padding:24px;color:#17334d;}
#quoteModeConfirm::backdrop {background:#10203066;}

.mail-dialog-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;background:white;z-index:2;padding:8px 0;}
.mail-dialog-heading h3 {margin:0;}

@media (min-width: 901px) {.draft-editor-column {position:sticky;top:0;height:calc(100vh - 90px);overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;align-self:start;}}
@media (max-width: 900px) {.draft-editor-column {position:relative;height:auto;max-height:none;overflow:visible;}}

#orderItemsTableWrap.hidden {display:none;}
.order-edit-table.structure-order-table th:nth-child(1) {width:7%;}
.order-edit-table.structure-order-table th:nth-child(2),
.order-edit-table.structure-order-table th:nth-child(3),
.order-edit-table.structure-order-table th:nth-child(4) {width:29.33%;}
.order-edit-table.structure-order-table th:last-child {width:5%;}
.order-edit-table.structure-order-table td:nth-child(2) input,
.order-edit-table.structure-order-table td:nth-child(3) input,
.order-edit-table.structure-order-table td:nth-child(4) input {text-align:left;}
.reference-help {margin-left:6px;color:var(--muted);font-size:11px;font-weight:400;}

.transport-request-composer.has-custom .transport-request-entry {height:auto;min-height:0;margin:0;align-self:stretch;resize:none;}

.quote-layout-probe {display:block!important;position:fixed;left:-20000px;top:0;width:194mm;min-height:0!important;height:auto!important;padding:0!important;visibility:hidden;}
.structure-print .print-group {break-inside:auto;}
.structure-print thead {display:table-header-group;}
.structure-print tr {break-inside:avoid;}

.structure-print:has(> .quote-print-page) {padding:0!important;}
.quote-print-page {box-sizing:border-box;width:210mm;min-height:297mm;padding:8mm;break-after:page;page-break-after:always;}
.quote-print-page:last-child {break-after:auto;page-break-after:auto;}

/* V1.1 sidebar account and environment information */
.account-info { width:100%; border-radius:10px; background:rgba(255,255,255,.14); }
.account-info #currentUserBadge { background:transparent; }
.account-settings { padding:0 8px 6px; }
.account-settings summary { cursor:pointer; padding:4px 0; font-size:11px; }
.account-actions { display:flex; flex-wrap:wrap; gap:5px; padding-top:5px; }
.sidebar-footer { margin-top:auto; width:100%; flex-shrink:0; }
.sidebar-footer .permission-entry { margin-top:0; }
.sidebar-system-info { display:grid; gap:4px; padding:10px 2px 12px; font-size:10px; font-weight:700; }
body.nav-collapsed .sidebar-system-info { display:none; }

.permission-password-controls { display:grid; gap:5px; min-width:160px; padding:4px 0; }
.permission-password-controls [data-password-status] { font-size:11px; color:var(--muted); }
.permission-password-controls .reset-login-password { font-size:11px; white-space:nowrap; }

/* Compact permission matrix: seven visible destinations, existing shared dashboard permission. */
.permission-table { min-width:1240px; }
.permission-table th:nth-child(3), .permission-table td:nth-child(3) { width:210px; }
.permission-table .permission-login-input { width:100%; }
.permission-table th:nth-child(4), .permission-table td:nth-child(4) { width:246px; }
.permission-password-controls { display:flex; align-items:center; gap:5px; min-width:0; padding:0; white-space:nowrap; }
.permission-password-controls [data-password-status] { flex:0 0 66px; font-size:10px; }
.permission-password-controls .password-input { width:104px; min-width:0; flex:1 1 104px; }
.permission-password-controls .reset-login-password { flex:0 0 auto; padding:5px 7px; }
.permission-table th { white-space:normal; line-height:1.35; text-align:center; }
.permission-table td:nth-child(n+5):nth-child(-n+11) { text-align:center; }
.permission-check .permission-column-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

/* Equal-height contract payment rows, including the total. */
.contract-payment-table tbody tr, .contract-payment-table tfoot tr { height:42px; }
.contract-payment-table tbody th, .contract-payment-table tbody td, .contract-payment-table tfoot th, .contract-payment-table tfoot td { height:42px; padding:5px 3px; vertical-align:middle; }
.contract-payment-table input { height:30px; min-height:30px; margin:0; }
.contract-payment-table th:last-child { width:50px; }
.contract-payment-table button.small { height:30px; min-height:30px; padding:4px 6px; white-space:nowrap; line-height:20px; font-size:11px; }
.contract-unit-price { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; color: var(--navy); font-weight: 700; }
.contract-unit-price span, .contract-unit-price output { white-space: nowrap; }

/* Keep the complete permission matrix inside the desktop dialog. */
.modal-card.permission-modal-card { width:min(1320px,96vw); padding:18px; }
.permission-modal-card .permission-table { width:100%; min-width:0; table-layout:fixed; }
.permission-table th, .permission-table td { padding:5px 2px; }
.permission-table th:nth-child(1), .permission-table td:nth-child(1) { width:4%; }
.permission-table th:nth-child(2), .permission-table td:nth-child(2) { width:4.5%; }
.permission-table th:nth-child(3), .permission-table td:nth-child(3) { width:19%; }
.permission-table th:nth-child(4), .permission-table td:nth-child(4) { width:20%; }
.permission-table th:last-child, .permission-table td:last-child { width:7%; }
.permission-table th:nth-child(n+5):nth-child(-n+11) { width:6.5%; }
.permission-table .permission-login-input { padding:4px; font-size:10px; min-width:0; }
.permission-password-controls { gap:3px; }
.permission-password-controls [data-password-status] { flex:0 0 57px; font-size:10px; }
.permission-password-controls .password-input { width:0; flex:1 1 0; }
.permission-password-controls .reset-login-password { padding:4px 5px; font-size:10px; }
.permission-account-actions { gap:3px; }
.permission-account-actions .table-action { padding:4px 5px; font-size:10px; }

body:not(.editor-pane-collapsed) .editor-heading { min-height:54px; padding-top:5px; padding-bottom:5px; margin-bottom:10px; }

/* Keep quote/PO content vertically centered in preview, print and mail PDF. */
.structure-print table:not(.print-meta) th, .structure-print table:not(.print-meta) td,
.order-flow-page th, .order-flow-page td,
.simple-preview-sheet th, .simple-preview-sheet td,
.order-edit-table th, .order-edit-table td,
.structure-category-table th, .structure-category-table td {
  vertical-align:middle;
  line-height:1.35;
}
.structure-print .print-summary > div {
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.project-table .project-created-date { width:82px; white-space:nowrap; font-variant-numeric:tabular-nums; }

.document-register-table { min-width:1100px; }
.document-register-table th:nth-child(1) { width:120px; }
.document-register-table th:first-child .column-filter-trigger { position:relative; }
.document-register-table th:first-child .column-filter-trigger > span { position:absolute; right:0; }
.document-register-table tbody td:first-child { text-align:center; }
.document-register-table th:nth-child(2) { width:125px; }
.document-register-table th:nth-child(3) { width:65px; }
.document-register-table th:nth-child(9) { width:100px; }
.document-register-table th:nth-child(10) { width:70px; }
.document-register-table th:nth-child(11) { width:60px; }
.document-register-table th:last-child { width:140px; }
.document-register-table select { width:100%; min-width:0; padding:4px; }

.document-register-table .column-filter-trigger { display:inline-flex; align-items:center; justify-content:center; gap:4px; width:100%; padding:2px 0; border:0; border-radius:3px; background:transparent; color:inherit; font:inherit; white-space:nowrap; }
.document-register-table .column-filter-trigger:hover, .document-register-table .column-filter-trigger:focus-visible { background:#315b7b; }
.document-register-table .column-filter-trigger.filter-active { background:#e0f2fe; color:#16476a; }
.column-filter-popup { position:fixed; z-index:100050; display:grid; gap:10px; width:290px; max-width:calc(100vw - 16px); max-height:calc(100vh - 16px); overflow:auto; padding:14px; background:white; color:var(--ink); border:1px solid #b5c8db; border-radius:9px; box-shadow:0 8px 28px #17344f40; box-sizing:border-box; font-size:13px; }
.column-filter-popup input[type=search] { width:100%; min-width:0; padding:7px; }
.column-filter-popup label { display:flex; align-items:flex-start; gap:8px; font-size:12px; font-weight:400; margin:0; padding:5px 0; overflow-wrap:anywhere; }
.column-filter-popup input[type=checkbox] { flex:0 0 14px; width:14px; height:14px; margin:2px 0 0; }
.column-filter-options { min-height:32px; max-height:220px; overflow:auto; border-top:1px solid #e0e7ef; border-bottom:1px solid #e0e7ef; padding:4px 0; }
.column-filter-actions { display:flex; justify-content:flex-end; gap:6px; }
.column-filter-actions button { font-size:12px; padding:6px 12px; }
.column-filter-summary { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:8px 0; color:#245b80; font-size:12px; }
.column-filter-summary[hidden] { display:none; }

.project-list-group + .project-list-group { margin-top:24px; }
.project-list-group .section-title-row { margin-bottom:8px; flex-wrap:wrap; gap:8px; }
.project-list-hint, .project-category-note { font-size:12px; color:var(--muted); }
.project-category-note { margin:12px 0 0; }
.project-list-scroll { overflow:auto; border:1px solid #d5e0e8; border-radius:5px; }
.project-list-scroll:focus-visible { outline:2px solid #2b6cb0; outline-offset:2px; }
.project-list-scroll .project-table thead th { position:sticky; top:0; z-index:2; background:#17344f; }
.project-list-scroll .project-table { margin:0; }

.column-filter-popup .date-filter-field { flex-direction:column; gap:5px; }
.column-filter-popup input[type=date] { width:100%; min-width:0; box-sizing:border-box; }
.column-filter-popup [data-filter-error] { color:#b42318; margin:0; font-size:12px; }
.column-filter-popup small { color:var(--muted); line-height:1.5; }

/* Single-line master lists with email detail dialogs. */
.profile-total { font-size:11px; font-weight:500; color:#526b80; white-space:nowrap; }
.trade-profile-grid .section-title-row.single-line { flex-wrap:nowrap; gap:7px; }
.trade-profile-grid .section-title-row h3 { flex:0 0 auto; font-size:15px; }
.trade-profile-grid .supplier-filter-actions { flex:1; flex-wrap:nowrap; min-width:0; gap:4px; justify-content:flex-end; }
.trade-profile-grid .supplier-filter-actions input { flex:1 1 90px; width:90px; min-width:0; max-width:220px; padding:5px; }
.trade-profile-grid .supplier-filter-actions select { flex:0 1 90px; width:90px; min-width:65px; padding:4px; }
.trade-profile-grid .supplier-filter-actions button { padding:0 6px; font-size:11px; }
.trade-profile-grid .profile-table { width:100%; min-width:0; table-layout:fixed; }
.trade-profile-grid .profile-table th, .trade-profile-grid .profile-table td { padding:5px 2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:10px; line-height:1.3; }
.trade-profile-grid .sales-profile-table th:nth-child(1) { width:25%; }
.trade-profile-grid .sales-profile-table th:nth-child(2) { width:13%; }
.trade-profile-grid .sales-profile-table th:nth-child(3) { width:15%; }
.trade-profile-grid .sales-profile-table th:nth-child(4) { width:22%; }
.trade-profile-grid .sales-profile-table th:nth-child(5) { width:7%; }
.trade-profile-grid .sales-profile-table th:last-child { width:18%; }
.trade-profile-grid .purchase-table th:nth-child(1) { width:22%; }
.trade-profile-grid .purchase-table th:nth-child(2) { width:14%; }
.trade-profile-grid .purchase-table th:nth-child(3) { width:6%; }
.trade-profile-grid .purchase-table th:nth-child(4) { width:12%; }
.trade-profile-grid .purchase-table th:nth-child(5) { width:18%; }
.trade-profile-grid .purchase-table th:nth-child(6) { width:7%; }
.trade-profile-grid .purchase-table th:last-child, .trade-profile-grid .purchase-table td:last-child { width:21%; }
.trade-profile-grid .profile-table .row-actions { flex-wrap:nowrap; justify-content:center; gap:2px; }
.trade-profile-grid .profile-table .table-action { padding:3px 2px; font-size:9px; min-width:0; white-space:nowrap; }
.profile-email-dialog { width:min(480px,90vw); border:1px solid #cbd8e3; border-radius:10px; padding:20px; }
.profile-email-dialog p { overflow-wrap:anywhere; user-select:text; }

#projectPlants label[hidden], #projectPlants .plant-receiving-settings[hidden] { display:none !important; }
#projectPlants.distribution-project-fields .plant-basic-line { grid-template-columns:repeat(3,minmax(0,1fr)); }
#projectPlants.distribution-project-fields .plant-receiving-line { grid-template-columns:repeat(3,minmax(0,1fr)) auto; }

.project-table .project-plant-name { display:block; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.file-preview-dialog header{gap:16px}.file-preview-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto;flex-shrink:0}.file-preview-actions button,.file-preview-actions .preview-toolbar-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;padding:9px 14px;border:1px solid #2865a9;border-radius:7px;background:#2865a9;color:#fff;font:inherit;font-size:13px;font-weight:700;line-height:1.4;text-decoration:none;cursor:pointer}.file-preview-actions button:hover,.file-preview-actions .preview-toolbar-button:hover{background:#1d528d}.file-preview-pages [role="status"]{color:#49657e;font-size:13px}

/* Project workspace only: original registration controls retain their styles. */
#page-organize .project-workspace-header { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:16px; padding:18px 4px; }
#page-organize .project-workspace-brand { font-size:23px; font-weight:800; color:#183249; }
#page-organize .project-workspace-brand span { font-size:11px; letter-spacing:2px; margin-left:8px; }
#page-organize .project-workspace-tabs { display:flex; grid-column:2; justify-self:center; gap:4px; padding:4px; background:#edf2f6; border-radius:9px; overflow-x:auto; max-width:100%; }
@media(max-width:1100px) { #page-organize .project-workspace-brand { grid-column:1/-1; } #page-organize .project-workspace-tabs { grid-column:1/-1; } }
#page-organize .project-workspace-tabs button { flex-shrink:0; padding:7px 9px; min-height:32px; font-size:12px; font-weight:800; border:0; color:var(--navy); background:transparent; white-space:nowrap; }
#page-organize .project-workspace-tabs button.active { background:white; color:var(--navy); box-shadow:0 2px 8px rgba(0,0,0,.08); }
#page-organize .project-workspace-tabs button:focus-visible { outline:2px solid #14877f; outline-offset:-2px; }
#projectWorkspaceFrame { display:block; width:100%; height:calc(100vh - 130px); min-height:520px; border:0; border-radius:12px; background:#f3f6f9; }
#projectWorkspacePilot[hidden], #projectWorkspaceRegister[hidden], #projectWorkspaceStatus[hidden] { display:none; }

.calendar-event.delivery-event {background:#fff4cc;color:#123957;}
.calendar-event span,.calendar-event small {display:block;margin-top:3px;overflow-wrap:anywhere;}
.schedule-help,.schedule-undated {font-size:12px;color:#65788c;line-height:1.5;}
.schedule-undated {display:block;white-space:normal;}

/* Full-width combined schedule; date entry lives beside document status. */
#calendarDeliveryPanel .calendar-layout {grid-template-columns:minmax(0,1fr)}
.document-register-table .document-expected-date {min-width:116px;width:116px;font-size:11px;padding:4px}
.document-register-table {min-width:1230px}
.document-register-table th:nth-child(10){width:128px}
.document-register-table th:nth-child(11){width:70px}
.document-register-table th:nth-child(12){width:60px}
#deliveryCalendar .calendar-event {width:100%;text-align:left;line-height:1.45;padding:6px}
#deliveryCalendar .calendar-event strong,#deliveryCalendar .calendar-event span {display:block;overflow-wrap:anywhere}

.sidebar-brand-logo {display:block;max-width:100%;height:auto;object-fit:contain;}

/* Light-blue sidebar, with the white content workspace retained. */
@media screen {
  body>.topbar {background:#e8f2fb!important;border-right-color:#c8dbea;}
  body>.topbar * {background-color:transparent!important;}
  body>.topbar button {background-color:#f7fbff!important;border-color:#bfd1e0;}
  body>.topbar .main-nav button {background-color:transparent!important;}
  body>.topbar .main-nav button:hover {background-color:#d9eafa!important;}
  body>.topbar .main-nav button.active {background-color:#fff!important;border-color:#8caac2;}
  body>.topbar .brand-block {border-bottom-color:#bfd1e0;}
  body>.topbar .sidebar-brand-logo {mix-blend-mode:multiply;}
}

/* Keep each calendar entry on one line and its event kind visible. */
#deliveryCalendar .calendar-event,#paymentCalendar .calendar-event {display:flex;align-items:center;gap:5px;min-width:0;max-width:100%;padding:5px 6px;white-space:nowrap;line-height:1.4;}
#deliveryCalendar .calendar-event .calendar-event-subject,#paymentCalendar .calendar-event .calendar-event-subject {display:block;min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;overflow-wrap:normal;}
#deliveryCalendar .calendar-event .calendar-event-kind,#paymentCalendar .calendar-event .calendar-event-kind {display:block;flex:0 0 auto;white-space:nowrap;overflow-wrap:normal;font-weight:700;}

/* Restore the original navy sidebar with a compact, legible brand plate. */
@media screen {
  body>.topbar {background:linear-gradient(165deg,#102b44,#245a86)!important;border-right:0;color:#fff!important;}
  body>.topbar * {color:#fff!important;background-color:transparent!important;}
  body>.topbar button {color:#fff!important;background:rgba(255,255,255,.12)!important;border-color:rgba(255,255,255,.22);}
  body>.topbar .main-nav button {background:transparent!important;border-color:transparent;}
  body>.topbar .main-nav button:hover {background:rgba(255,255,255,.1)!important;}
  body>.topbar .main-nav button.active {background:#fff!important;border-color:#fff;box-shadow:none;}
  body>.topbar .main-nav button.active,body>.topbar .main-nav button.active * {color:#17324d!important;}
  body>.topbar .brand-block {border-bottom-color:rgba(255,255,255,.18);}
  body>.topbar .sidebar-brand-logo {width:130px;padding:7px 9px;background:#fff!important;border-radius:7px;mix-blend-mode:normal;}
  body.nav-collapsed>.topbar .sidebar-brand-logo {width:44px;padding:3px;}
  body>.topbar :is(button,a,summary):focus-visible {outline:2px solid #fff;}
  .expected-date-na {display:block;text-align:center;}
}

.sidebar-utilities {display:grid;gap:6px;margin-bottom:8px;width:100%;}
.sidebar-utilities button {display:grid;grid-template-columns:26px minmax(0,1fr);align-items:center;gap:8px;width:100%;min-height:38px;padding:7px 9px;text-align:left;}
.sidebar-utilities button.hidden {display:none;}
.sidebar-utilities .nav-icon {display:inline-grid;place-items:center;width:26px;height:26px;font-style:normal;font-size:14px;text-align:center;line-height:1;}
.sidebar-utilities b {font-size:12px;white-space:nowrap;}
body.nav-collapsed .sidebar-utilities button {grid-template-columns:1fr;justify-items:center;padding:7px 3px;}
body.nav-collapsed .sidebar-utilities b {display:none;}

@media screen {
 #page-draft {background:var(--bg);}
 .sidebar-footer {margin-bottom:28px;}
 body>.topbar .sidebar-brand-logo {width:130px;padding:0;background:transparent!important;border-radius:0;filter:brightness(0) invert(1);mix-blend-mode:normal;}
 body>.topbar .sidebar-brand-logo:not([src]) {visibility:hidden;}
 body.nav-collapsed>.topbar .sidebar-brand-logo {width:44px;padding:0;}
}

/* Schedule first; document register shows approximately fifteen rows. */
#page-calendar .document-management-panel {margin-top:24px;}
.document-register-scroll {max-height:636px;overflow:auto;scrollbar-gutter:stable;}
.document-register-scroll .document-register-table thead {position:sticky;top:0;z-index:2;background:var(--navy);}
.document-register-scroll .document-register-table thead th {height:36px;}
.document-register-scroll .document-register-table tbody td {height:40px;padding-top:4px;padding-bottom:4px;white-space:nowrap;}
.document-register-table tr[data-document-id] {scroll-margin-block:52px 24px;}
.document-register-table tr.calendar-selected-document > td {background:#e6f2ff;box-shadow:inset 0 2px #2877c6,inset 0 -2px #2877c6;}
.document-register-table tr.calendar-selected-document > td:first-child {box-shadow:inset 4px 0 #2877c6,inset 0 2px #2877c6,inset 0 -2px #2877c6;}
.document-register-table tr.calendar-selected-document:focus {outline:none;}

/* Align sidebar branding with menu labels and center connection details. */
@media screen {
 body:not(.nav-collapsed)>.topbar .brand-block {padding:12px 4px 12px 12px;align-items:flex-start;}
 .sidebar-system-info {text-align:center;align-items:center;justify-content:center;width:100%;}
 .sidebar-system-info small {width:100%;text-align:center;}
}

@media screen {
 #page-draft .contract-payment-table thead {background:linear-gradient(165deg,#102b44,#245a86);}
 #page-draft .contract-payment-table thead th {background:transparent;color:#fff;}
 #page-draft .contract-payment-table tbody th, #page-draft .contract-payment-table tfoot th {background:linear-gradient(165deg,#102b44,#245a86);color:#fff;}
}

.sidebar-footer .permission-entry .nav-icon {font-size:14px;line-height:1;}

#page-organize .project-workspace-header {padding:10px 4px;}

.delivery-time{display:flex;gap:4px;margin-top:5px}.delivery-time input,.delivery-time select{width:50%;min-width:0}.order-transport-date-line label>small{display:block;font-size:9px;margin-top:3px;color:var(--muted)}

/* Compact project lists, with a wider single-line plant address. */
.project-list-scroll .project-table {width:100%;min-width:1100px;table-layout:fixed;}
.project-list-scroll .project-table th,.project-list-scroll .project-table td {padding:4px 3px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;}
.project-list-scroll .project-table .row-actions {gap:3px;flex-wrap:nowrap;}
.project-list-scroll .project-table .table-action {padding:3px 5px;}
[data-project-group="distribution"] .project-table {min-width:850px;}
[data-project-group="construction"] .project-table th:nth-child(1) {width:8%;}
[data-project-group="construction"] .project-table th:nth-child(2) {width:6%;}
[data-project-group="construction"] .project-table th:nth-child(3) {width:5%;}
[data-project-group="construction"] .project-table th:nth-child(4) {width:7%;}
[data-project-group="construction"] .project-table th:nth-child(5) {width:5%;}
[data-project-group="construction"] .project-table th:nth-child(6) {width:6%;}
[data-project-group="construction"] .project-table th:nth-child(7) {width:6%;}
[data-project-group="construction"] .project-table th:nth-child(8) {width:8%;}
[data-project-group="construction"] .project-table th:nth-child(9) {width:6%;}
[data-project-group="construction"] .project-table th:nth-child(10) {width:8%;}
[data-project-group="construction"] .project-table th:nth-child(11) {width:21%;}
[data-project-group="construction"] .project-table th:nth-child(12) {width:4%;}
[data-project-group="construction"] .project-table th:nth-child(13) {width:10%;}
[data-project-group="distribution"] .project-table th:nth-child(1) {width:16%;}
[data-project-group="distribution"] .project-table th:nth-child(2) {width:10%;}
[data-project-group="distribution"] .project-table th:nth-child(3) {width:9%;}
[data-project-group="distribution"] .project-table th:nth-child(4) {width:15%;}
[data-project-group="distribution"] .project-table th:nth-child(5) {width:9%;}
[data-project-group="distribution"] .project-table th:nth-child(6) {width:12%;}
[data-project-group="distribution"] .project-table th:nth-child(7) {width:12%;}
[data-project-group="distribution"] .project-table th:nth-child(8) {width:6%;}
[data-project-group="distribution"] .project-table th:nth-child(9) {width:11%;}

.project-registration-heading{gap:10px;flex-wrap:wrap}.project-registration-actions{margin-left:auto;display:flex;gap:8px;align-items:center}.project-plants-editor:has(#projectPlants:empty){display:none}

.order-transport-date-line {grid-template-columns:1fr 1.45fr 1fr 1fr;gap:10px;}
.delivery-date-field {min-width:0;}
.delivery-date-line {display:flex;align-items:center;gap:4px;}
.delivery-date-line>.editable-date-wrap {flex:1;min-width:0;}
#deliveryTimePicker {position:relative;flex-shrink:0;}
#deliveryTimePicker summary {list-style:none;cursor:pointer;padding:8px 5px;border:1px solid #cad8e1;border-radius:6px;background:#edf3f8;font-size:11px;white-space:nowrap;}
.delivery-time-popover {position:absolute;z-index:30;top:calc(100% + 5px);left:0;width:190px;padding:10px;background:#fff;border:1px solid #cad8e1;border-radius:8px;box-shadow:0 5px 18px #18324925;}
.delivery-time-actions {display:flex;justify-content:space-between;gap:6px;margin-top:8px;}
@media(max-width:650px){.order-transport-date-line {grid-template-columns:1fr 1.45fr;}}

/* Calendar weeks expand only as needed for their events. */
.calendar-grid {grid-auto-rows:auto;align-content:start;}
.calendar-day {min-height:44px;height:auto;padding:6px;}
.calendar-events:empty {margin-top:5px;}

/* Equal transport inputs; the delivery column reserves only its time-button width. */
.order-transport-date-line {grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end;}
.order-transport-date-line>label:first-child {grid-column:1;}
.order-transport-date-line>.delivery-date-field {grid-column:2 / span 2;}
.order-transport-date-line>label:has([name="orderReceiver"]) {grid-column:4;}
.order-transport-date-line>label:has([name="orderReceiverPhone"]) {grid-column:5;}
.delivery-date-line {gap:8px;}
#deliveryTimePicker {width:40px;}
#deliveryTimePicker summary {height:36px;display:flex;align-items:center;justify-content:center;padding:0 2px;}
.order-transport-date-line input:not(.native-date-picker),.order-transport-date-line .delivery-time select {height:36px;min-height:36px;font-size:12px;box-sizing:border-box;margin-top:0;}
.order-transport-date-line>.delivery-date-field>label {margin-bottom:6px;}
@media(max-width:650px){.order-transport-date-line{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px;}.order-transport-date-line>label:has([name="orderReceiver"]){grid-column:1;}.order-transport-date-line>label:has([name="orderReceiverPhone"]){grid-column:2;}}

.order-flow-delivery td.order-delivery-datetime {text-align:center;vertical-align:middle;}

/* Company master images: reserve their own space and let cards grow. */
.company-edit-grid { flex: 0 0 auto; }
.company-edit-card .company-image-preview {
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  justify-items: start;
  gap: 4px;
  padding: 4px;
  min-height: 36px;
}
.company-edit-card .company-image-preview img {
  display: block;
  width: 100%;
  height: 28px;
  max-width: 72px;
  max-height: none;
  object-fit: contain;
  object-position: center;
  justify-self: center;
}

.project-search-row { margin-bottom: 5px; gap: 12px; }
.project-search-row #projectSearch { height: 30px; min-height: 30px; padding: 4px 9px; font-size: 12px; }
.project-list-scroll .project-column-filter { background: transparent; color: inherit; border: 0; padding: 0; font: inherit; border-radius: 2px; white-space: nowrap; }
.project-list-scroll .project-column-filter.filter-active { color: #ffe08a; text-decoration: underline; }
.project-filter-dialog { width: 340px; max-width: calc(100vw - 32px); border: 1px solid #ccdbe6; border-radius: 10px; padding: 18px; color: var(--navy); }
.project-filter-dialog::backdrop { background: #102b4440; }
.project-filter-dialog label { display: block; margin: 10px 0; }
.project-filter-dialog input { margin-top: 5px; }
.project-filter-options { max-height: 280px; overflow: auto; margin: 10px 0; }
.project-filter-options label { display: flex; align-items: center; gap: 8px; }
.project-filter-options label[hidden] { display: none; }
.project-filter-options input { width: auto; margin: 0; }
.project-filter-error { color: #a13f48; }
.project-filter-dialog .row-actions { justify-content: flex-end; }

/* Reserve one schedule line even on empty calendar weeks. */
#deliveryCalendar .calendar-events, #paymentCalendar .calendar-events { min-height: 28px; }
#deliveryCalendar .calendar-event, #paymentCalendar .calendar-event { min-height: 28px; }
.calendar-panel .panel > .section-title-row { flex-wrap: nowrap; align-items: center; gap: 12px; }
.calendar-panel .panel > .section-title-row h3 { flex: 0 0 auto; white-space: nowrap; margin: 0; }
.calendar-panel .panel > .section-title-row .editable-date-wrap { flex: 0 0 160px; width: 160px; margin-left: auto; }
.calendar-panel .panel > .section-title-row input[data-date-kind="month"] { width: 100%; min-width: 0; }

#calendarDeliveryPanel .section-title-row .editable-date-wrap { flex-basis: 140px; width: 140px; }
.delivery-calendar-filters { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.delivery-calendar-filters label { display: flex; align-items: center; gap: 5px; margin: 0; white-space: nowrap; font-size: 12px; }
.delivery-calendar-filters input { width: 14px; height: 14px; margin: 0; padding: 0; }
#deliveryCalendar .calendar-event.quote-event { background: #e7f7f1; color: #165d4d; }

/* Compact manual structure entry toolbar. */
#manualStructureEntry { align-items: center; padding: 8px 10px; gap: 8px; margin: 6px 0; }
#manualStructureEntry label { margin: 0; flex: 0 0 120px; width: 120px; }
#manualStructureEntry select { height: 32px; min-height: 32px; padding: 5px 8px; margin: 0; }
#manualStructureEntry h3 { margin-bottom: 2px; }
#manualStructureEntry #addManualStructure { height: 32px; min-height: 32px; padding: 5px 10px; white-space: nowrap; }
#bomPanel.bom-awaiting-file:not(.hidden) {display:grid;align-content:center;min-height:56px;padding:8px 10px;margin:6px 0;background:#f3f8fc;border-color:#d5e1ec;}
#bomPanel.bom-awaiting-file #bomImportStatus {grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title action" "detail action";gap:2px 8px;margin:0;padding:0;background:transparent;}
#bomPanel.bom-awaiting-file #bomImportStatus strong {grid-area:title;font-size:12px;line-height:1.2;white-space:normal;overflow:visible;}
#bomPanel.bom-awaiting-file #bomImportStatus>span {grid-area:detail;font-size:11px;line-height:1.3;color:#657382;white-space:normal;overflow:visible;}
#bomPanel.bom-awaiting-file #bomSelectButton {grid-area:action;align-self:center;width:auto;min-width:0;height:32px;min-height:32px;padding:5px 10px;font-size:12px;}

#calendarDeliveryPanel .section-title-row .editable-date-wrap { flex-basis: 126px; width: 126px; }
#calendarDeliveryPanel #deliveryCalendarMonth,
#calendarDeliveryPanel #deliveryCalendarProduct { height: 28px; min-height: 28px; padding: 3px 7px; margin: 0; font-size: 12px; line-height: 1.4; }
#calendarDeliveryPanel #deliveryCalendarProduct { flex: 0 0 126px; width: 126px; }
#calendarDeliveryPanel .date-picker-button { height: 22px; bottom: 3px; }
#calendarDeliveryPanel .panel > .section-title-row { gap: 8px; }

/* Whole-editor reference file drop feedback. */
.order-document-mode .document-written-date { display: none; }
#documentForm.reference-drop-active, .document-mail-dialog.reference-drop-active { outline: 2px dashed #2874bd; outline-offset: -4px; background-color: #eef6ff; }
#documentSaveStatus { grid-column:1 / -1; margin:0; padding:3px 34px 3px 0; text-align:right; font-size:12px; line-height:1.4; overflow-wrap:anywhere; color:#ae2727; }
#documentSaveStatus[data-state="pending"] { color:#526579; }
#documentSaveStatus[data-state="success"] { color:#087e69; }
#documentSaveStatus[hidden], body.editor-pane-collapsed #documentSaveStatus { display:none; }
body.nav-collapsed .topbar .brand-block { margin-top:16px; }

/* Place PO issue date with document identification, leaving delivery details together. */
.document-order-date {display:none;}
body.order-document-mode .document-order-date {display:grid;}
.order-transport-date-line {grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr) minmax(0,1fr);}
.order-transport-date-line>.delivery-date-field {grid-column:1 / span 2;}
.order-transport-date-line>label:has([name="orderReceiver"]) {grid-column:3;}
.order-transport-date-line>label:has([name="orderReceiverPhone"]) {grid-column:4;}
@media(max-width:650px){
 .order-transport-date-line {grid-template-columns:repeat(2,minmax(0,1fr));}
 .order-transport-date-line>label:has([name="orderReceiver"]) {grid-column:1;}
 .order-transport-date-line>label:has([name="orderReceiverPhone"]) {grid-column:2;}
}
#page-calendar .calendar-tabs {flex:0 0 auto;margin:0;padding:2px;gap:3px;}
#page-calendar .calendar-tabs button {font-size:16px;line-height:1.2;padding:4px 9px;min-height:28px;white-space:nowrap;}
#page-calendar .calendar-panel .section-title-row {margin-bottom:8px;}
@media(max-width:900px){#page-calendar .calendar-panel .section-title-row{flex-wrap:wrap;}}

#calendarPaymentPanel .calendar-layout {grid-template-columns:minmax(0,1fr);}
#calendarPaymentPanel .section-title-row .editable-date-wrap {flex-basis:126px;width:126px;}
#calendarPaymentPanel #paymentCalendarMonth {height:28px;min-height:28px;padding:3px 7px;margin:0;font-size:12px;line-height:1.4;}
#calendarPaymentPanel .date-picker-button {height:22px;bottom:3px;}
#calendarPaymentPanel .panel > .section-title-row {gap:8px;}

/* Delivery period choices share the compact editor control style. */
.delivery-time-modes{display:flex;gap:4px}
.delivery-time-modes button{flex:1;min-width:0;padding:6px 8px}
.delivery-time-modes button[aria-pressed="true"]{background:#2563a8;color:#fff;border-color:#2563a8}
#deliveryExactTime[hidden]{display:none}

/* Structure PO row remarks: folded presets plus freely editable text. */
.order-remark-picker{display:inline-block;width:72px;position:relative;vertical-align:top;font-size:10px;text-align:left;white-space:normal}
.order-remark-picker summary{cursor:pointer;color:#2563a8;height:30px;box-sizing:border-box;padding:7px 2px;font-weight:600;white-space:nowrap}
.order-remark-options{position:absolute;z-index:35;top:100%;right:0;width:220px;box-sizing:border-box;display:grid;gap:5px;padding:8px;background:#f1f6fa;border:1px solid #d5e1eb;border-radius:5px;box-shadow:0 4px 14px #18324925}
#orderItemsTableWrap:has(.order-remark-picker[open]){overflow:visible}
.order-remark-options label{display:flex;align-items:flex-start;gap:5px;margin:0;font-size:11px;line-height:1.4;white-space:normal}
.order-edit-table .order-remark-options input[type="checkbox"]{width:12px;height:12px;min-height:0;flex:0 0 12px;margin:2px 0 0;padding:0}
.order-edit-table textarea.order-remark-text{display:inline-block;vertical-align:top;width:calc(100% - 76px);min-width:0;min-height:30px;height:30px;max-height:none;margin:0 0 0 4px;padding:5px;text-align:left;font-size:11px;line-height:1.4;resize:vertical}

.document-preview>.section-title-row{gap:8px}
.document-preview>.section-title-row>.preview-tools{flex-wrap:nowrap;flex-shrink:0;gap:6px}
.document-preview>.section-title-row h3{margin:0}
body.preview-pane-collapsed #composeDocumentEmail{display:none}
.editor-heading .type-switch button,.editor-heading .type-switch button.active{color:var(--navy);font-weight:800}
#quoteInputMode{display:inline-flex;gap:4px;padding:4px;margin:0;background:#edf2f6;border-radius:9px}
#quoteInputMode button{font-size:12px;line-height:normal;padding:7px 9px;min-height:32px;border-radius:8px;white-space:nowrap;color:var(--navy);font-weight:800}
#quoteInputMode button[aria-pressed="true"]{background:white;color:var(--navy);box-shadow:0 2px 8px rgba(0,0,0,.08)}
@container document-editor (max-width:560px) {
  #quoteInputMode {gap:2px;padding:2px;}
  #quoteInputMode button {font-size:11px;padding:6px;}
}

/* Material orders have eleven columns; reserve space for manual remarks. */
.order-edit-table.material-order-table th:nth-child(1){width:4%}
.order-edit-table.material-order-table th:nth-child(2){width:14%}
.order-edit-table.material-order-table th:nth-child(3){width:16%}
.order-edit-table.material-order-table th:nth-child(4),.order-edit-table.material-order-table th:nth-child(5){width:12%}
.order-edit-table.material-order-table th:nth-child(6){width:6%}
.order-edit-table.material-order-table th:nth-child(7){width:5%}
.order-edit-table.material-order-table th:nth-child(8),.order-edit-table.material-order-table th:nth-child(9),.order-edit-table.material-order-table th:nth-child(10){width:9%}
.order-edit-table.material-order-table th:last-child{width:4%}

/* Construction contract register follows the project list panel and navy header. */
#page-contracts .section-title h2 {font-size:18px; color:#17344f; margin:0;}
.contract-register-toolbar {display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-top:14px;}
.contract-register-filters {margin-top:0; justify-content:space-between;}
.contract-register-filters select {width:auto; max-width:180px; font-size:12px; padding:6px 10px;}
.contract-register-tabs {display:flex; flex-wrap:wrap; padding:3px; border-radius:8px; background:#eaf0f5;}
.contract-register-tabs button {background:transparent; color:#17344f; font-size:12px; font-weight:800; padding:7px 12px; border:0; box-shadow:none;}
.contract-register-tabs button.active {background:#fff; box-shadow:0 1px 4px #17344f22;}
.contract-register-kinds {display:flex; align-items:center; gap:12px; flex-shrink:0;}
.contract-register-kinds label {display:flex; align-items:center; gap:4px; margin:0; white-space:nowrap; color:#17344f; font-size:12px; cursor:pointer;}
.contract-register-kinds input {width:14px; height:14px; margin:0; padding:0; accent-color:#2464ab; cursor:pointer;}
.file-preview-actions [data-delete-preview] {background:#ae3535; border-color:#ae3535;}
.file-preview-actions [data-delete-preview]:hover {background:#8d2929;}
.file-preview-actions button:disabled {opacity:.55; cursor:wait;}
.file-preview-delete-error {color:#ae3535; font-size:13px; margin:0 0 10px;}
#contractRegisterSearch {flex:1; min-width:240px; height:34px; font-size:12px; padding:7px 10px;}
.contract-month-heading {display:flex; justify-content:flex-start; align-items:center; gap:16px; margin:18px 0 10px; color:#17344f;}
.contract-month-heading h3 {margin:0; font-size:15px;}
.contract-month-heading label {display:flex; align-items:center; gap:8px; white-space:nowrap; font-size:12px; font-weight:700;}
.contract-month-heading select {width:148px; padding:6px 8px; font-size:12px;}
#contractRegisterSummary {margin:0 0 14px; grid-template-columns:repeat(3,minmax(0,1fr));}
#contractRegisterSummary strong {font-size:19px; white-space:nowrap;}
.contract-register-table-wrap {max-height:calc(100vh - 350px); min-height:260px; overflow:auto; border:1px solid #d7e2eb; border-radius:6px;}
#contractRegisterTable {width:100%; min-width:0; border-collapse:separate; border-spacing:0; font-size:11px; table-layout:fixed;}
#contractRegisterTable th {position:sticky; top:0; background:#17344f; color:white; z-index:2; padding:7px 3px; white-space:pre-line;}
#contractRegisterTable th button {display:block; width:100%; background:transparent; border:0; border-radius:0; padding:0; color:inherit; font-size:10px; line-height:1.3; font-weight:800; white-space:pre-line; overflow-wrap:anywhere;}
#contractRegisterTable td {height:34px; padding:4px 3px; vertical-align:middle; border-bottom:1px solid #d7e2eb; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.5;}
#contractRegisterTable tr:nth-child(even) td {background:#f7fafc;}
#contractRegisterTable tr:hover td {background:#eef5fa;}
#contractRegisterTable td.contract-cell-name {font-weight:700; color:#17344f;}
#contractRegisterTable .register-number {text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap;}
#contractRegisterTable td.contract-cell-capacity {text-align:center; vertical-align:middle;}
#contractRegisterTable td.contract-cell-note {white-space:pre-wrap; overflow-wrap:anywhere; overflow:visible; text-overflow:clip; font-size:11px;}
#contractRegisterTable .register-cell-text {display:block; width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:transparent; color:inherit; border:0; border-radius:0; padding:0; text-align:inherit; font:inherit;}
#contractRegisterTable .register-cell-text:hover {text-decoration:underline;}
#contractRegisterTable .register-view {border:0; border-radius:5px; padding:4px 5px; font-size:10px; line-height:1.2; white-space:nowrap; color:white; background:#2464ab;}
.register-actions {display:flex; align-items:center; justify-content:center; gap:3px;}
.contract-original-files {display:flex; flex-direction:column; align-items:center; gap:4px; min-width:0;}
.document-content-preview {box-sizing:border-box; width:min(900px,100%); margin:auto; padding:28px; background:white; color:#172b40; line-height:1.65; overflow-wrap:anywhere; text-align:left;}
.document-content-preview p {white-space:pre-wrap; margin:0 0 12px;}
.document-content-preview table {width:100%; min-width:0; table-layout:fixed; border-collapse:collapse; margin:12px 0;}
.document-content-preview td {border:1px solid #cbd5e1; padding:8px; white-space:pre-wrap; vertical-align:top;}
.document-preview-notice {font-size:12px; text-align:center; color:#52677b;}
#contractRegisterTable .register-original-file {display:block; width:100%; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:2px 0; border:0; border-radius:0; background:transparent; color:#2464ab; font-size:10px; text-decoration:underline;}
#contractRegisterTable .register-view:disabled {opacity:.55; cursor:wait;}
#contractRegisterScope {font-size:11px; margin:10px 0; color:#60758b;}
#contractRegisterDialog, #contractRegisterDetailDialog {border:1px solid #d7e2eb; border-radius:14px; width:min(1120px,94vw); max-height:85vh; overflow:auto; color:#17344f; padding:24px;}
#contractRegisterDetailDialog {width:min(620px,90vw);}
#contractRegisterDetailBody {margin-top:18px; font-size:14px;}
#contractRegisterDetailBody b {font-size:12px; color:#60758b; white-space:pre-line;}
#contractRegisterDetailBody p {white-space:pre-wrap; overflow-wrap:anywhere; margin:6px 0 18px;}
#contractRegisterDialog::backdrop, #contractRegisterDetailDialog::backdrop {background:#17344f77;}
#contractRegisterFields {display:grid; grid-template-columns:1fr; gap:12px; margin:18px 0;}
.contract-edit-row {display:grid; grid-template-columns:repeat(var(--field-count),minmax(0,1fr)); gap:12px; align-items:end;}
.contract-edit-row-3 {grid-template-columns:repeat(5,minmax(0,1fr));}
.contract-edit-row-3 .register-edit-note {grid-column:span 3;}
.contract-edit-row-3 .register-edit-note:first-child {grid-column:span 4;}
#contractRegisterFields label {white-space:pre-line; font-size:11px; margin:0; min-width:0;}
#contractRegisterFields textarea, #contractRegisterFields input, #contractRegisterFields select {display:block; width:100%; height:36px; min-height:36px; font-size:12px; padding:7px 9px;}
#contractRegisterFields textarea {resize:vertical;}
.contract-register-save {display:flex; justify-content:flex-end;}
#contractRegisterError {color:#bb3030; font-size:12px;}
@media(max-width:900px){#contractRegisterSummary{grid-template-columns:repeat(3,minmax(0,1fr));}#contractRegisterSummary strong{font-size:15px;}.contract-edit-row{grid-template-columns:repeat(2,minmax(0,1fr));}.contract-edit-row-3 .register-edit-note,.contract-edit-row-3 .register-edit-note:first-child{grid-column:span 1;}}

#page-contracts .section-title, #contractRegisterDialog .section-title, #contractRegisterDetailDialog .section-title {display:flex;align-items:center;justify-content:space-between;gap:12px;}

/* Inline permission account save feedback. */
.permission-account-save{display:flex;flex-direction:column;align-items:center;gap:3px;width:100%}
.permission-account-status{display:block;width:100%;font-size:10px;line-height:1.3;white-space:normal;overflow-wrap:anywhere;text-align:center;color:#64748b}
.permission-account-status:empty{display:none}
.permission-account-status[data-state=success]{color:#16734b;font-weight:600}
.permission-account-status[data-state=error]{color:#b42335}
/* End inline permission account save feedback. */

/* Distribution settlement follows the supplied sales/purchase ledgers. */
.ledger-heading,.ledger-toolbar,.ledger-period,.ledger-editor-footer{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.ledger-heading{justify-content:space-between;margin-bottom:14px}.ledger-heading h2{margin:0}.ledger-heading>span,.ledger-period>span{font-size:12px;color:#64748b}
.ledger-toolbar{flex-wrap:nowrap}.ledger-toolbar>input{flex:1;min-width:180px}.ledger-toolbar button{white-space:nowrap}.ledger-toolbar .segmented{flex-shrink:0}.ledger-period{margin-top:14px}.ledger-period input{width:145px}.ledger-period label{display:flex;align-items:center;gap:8px}.ledger-period #ledgerCount{margin-left:auto}
.ledger-toolbar .segmented{display:flex;background:#eaf0f6;padding:3px;border-radius:8px;gap:2px}.ledger-toolbar .segmented button{background:transparent;color:#284766;border:0;font-size:13px;padding:9px 14px}.ledger-toolbar .segmented button.active{background:white;color:#143b60;box-shadow:0 1px 4px #193c6020}.ledger-period{gap:8px}.ledger-period label{white-space:nowrap;margin:0}.ledger-period label[hidden]{display:none}.ledger-period select{width:auto;min-width:100px}.ledger-date-range{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}.ledger-date-range>.editable-date-wrap{width:130px!important;flex:0 0 130px}.ledger-date-range>input{width:130px;flex:0 0 130px}.ledger-period label>.editable-date-wrap{width:125px!important;flex:0 0 125px}#ledgerWeek{width:155px;font-size:12px}.ledger-period #ledgerCount{font-size:11px}
.ledger-summary{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:14px 0}.ledger-summary article{min-width:0;padding:14px 12px}.ledger-summary strong{font-size:clamp(14px,1.25vw,18px);white-space:nowrap}
.ledger-period input,.ledger-period select{font-size:13px}
.ledger-weekly.panel{padding:9px 14px;margin:10px 0}.ledger-week-heading{display:flex;align-items:center;gap:12px;margin-bottom:5px}.ledger-week-heading h3{font-size:12px;margin:0;color:#193c60}.ledger-week-heading>span{font-size:10px;color:#64748b}.ledger-week-scroll{display:flex;gap:0;overflow-x:auto;overflow-y:hidden;padding:0 2px 3px;min-height:92px}.ledger-week{flex:1 0 132px;max-width:180px;text-align:center;padding:0 4px;box-sizing:border-box}.ledger-week-amount{display:block;font-size:11px;line-height:16px;white-space:nowrap;font-variant-numeric:tabular-nums;color:#245b88}.ledger-week-plot{position:relative;height:56px;margin:2px 0}.ledger-week-zero{position:absolute;left:-4px;right:-4px;height:1px;background:#cdd8e3}.ledger-week-bar{position:absolute;left:50%;width:26px;transform:translateX(-50%);background:#2a71ac;border-radius:2px;min-height:1px}.ledger-week-loss .ledger-week-bar{background:#c84953}.ledger-week-loss .ledger-week-amount{color:#b42335}.ledger-week-date{display:block;font-size:10px;line-height:14px;color:#586a80;white-space:nowrap}.ledger-week-unknown{font-size:14px;color:#8795a5}.ledger-week-empty{font-size:12px;color:#64748b;margin:auto 0}
.ledger-scroll{overflow:auto;max-height:65vh;border:1px solid #d6e1ec;border-radius:6px}.ledger-scroll table{border-collapse:separate;border-spacing:0;width:100%;table-layout:fixed;font-size:11px;font-variant-numeric:tabular-nums}
#ledgerTable th,#ledgerTable td{min-width:0;max-width:none;padding:3px 2px;border-right:1px solid #dce4ed;border-bottom:1px solid #dce4ed;text-align:center;vertical-align:middle;white-space:normal;overflow-wrap:anywhere;line-height:1.2}
#ledgerTable thead th{position:sticky;z-index:3;top:0;height:22px;color:#fff;box-sizing:border-box;background:#193c60}#ledgerTable thead tr:nth-child(2) th{top:22px;height:32px;font-size:10px}#ledgerTable thead .ledger-sales{background:#194b70}#ledgerTable thead .ledger-purchase{background:#276864}#ledgerTable thead .ledger-result{background:#5a4f7d}
#ledgerTable thead tr:nth-child(2) th:first-child{left:0;z-index:5}
#ledgerTable .ledger-head-word{display:block;white-space:nowrap;word-break:keep-all;overflow-wrap:normal}
.ledger-site-dialog{width:min(560px,90vw);max-width:90vw;max-height:80vh;overflow:auto}.ledger-site-dialog h3{margin:0}.ledger-site-value{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;margin-top:16px}
#ledgerTable td{background:#fff}#ledgerTable .ledger-alt td{background:#f6f9fc}#ledgerTable td.ledger-result{background:#f4f1f9}#ledgerTable .negative{color:#b42335;font-weight:600}#ledgerTable td.ledger-date{position:sticky;left:0;z-index:2;font-size:10px;box-shadow:2px 0 3px #142b4210}#ledgerTable .ledger-note{text-align:left}.ledger-note div{white-space:pre-wrap;margin-bottom:3px}.ledger-note div:empty{display:none}.ledger-note small{margin-left:4px;color:#64748b;font-size:10px}#ledgerTable .table-action{font-size:10px;line-height:1.2;padding:2px 4px;min-height:0}.ledger-muted{font-size:10px;color:#6f7e8e}
.ledger-dialog{width:min(1180px,94vw);max-width:94vw;max-height:90vh;overflow:auto}.ledger-editor-common{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.ledger-editor-common input,.ledger-input-grid input{min-width:0;width:100%;box-sizing:border-box}.ledger-dialog fieldset{margin:18px 0;border:1px solid #d6e1ec;border-radius:8px;padding:12px}.ledger-dialog legend{font-weight:700;color:#193c60}.ledger-editor-sides{display:grid;grid-template-columns:1fr 1fr;gap:18px}.ledger-editor-sides section{padding:12px;background:#f6f9fc;border-radius:6px}.ledger-editor-sides section+section{background:#f1f8f5}.ledger-editor-sides h3{margin:0 0 12px}.ledger-input-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.ledger-editor-footer{position:sticky;bottom:-20px;background:white;padding:14px 0}.ledger-editor-footer .help{flex:1}.ledger-pull-dialog{width:min(700px,90vw)}.ledger-pull-dialog label{display:block;margin:14px 0}.ledger-pull-dialog select{width:100%}#ledgerEditError,#ledgerPullError{color:#ac2634}
@media(max-width:1150px){.ledger-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){.ledger-toolbar{flex-wrap:wrap}.ledger-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.ledger-editor-common{grid-template-columns:repeat(2,minmax(0,1fr))}.ledger-editor-sides{grid-template-columns:1fr}.ledger-input-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Fit every ledger column to the panel; long values wrap within their cells. */
.ledger-scroll{container-type:inline-size}
.ledger-scroll #ledgerTable{width:100%;min-width:0;font-size:clamp(8px,.84cqw,11px)}
#ledgerTable th,#ledgerTable td{padding:2px 1px;word-break:normal}
#ledgerTable thead tr:nth-child(2) th{font-size:clamp(7px,.76cqw,10px)}
#ledgerTable td.ledger-date{font-size:inherit}
#ledgerTable .ledger-head-word{white-space:normal;overflow-wrap:anywhere}
#ledgerTable .table-action{font-size:inherit;padding:2px 3px;max-width:100%;white-space:normal}
#ledgerTable .ledger-note{text-align:center}
#ledgerTable .ledger-note .table-action{display:block;margin:1px auto}
#ledgerTable .ledger-note [data-ledger-note]{background:#e8eff6;color:#244c70}
#ledgerTable .ledger-note .has-note{font-weight:700;box-shadow:inset 0 0 0 1px #7f9db9}
#ledgerTable .ledger-filter-head{display:flex;align-items:center;justify-content:center;gap:1px;width:100%;min-width:0;border:0;background:transparent;color:inherit;font:inherit;line-height:inherit;padding:0;border-radius:2px}
#ledgerTable .ledger-filter-head>span:last-child{font-size:7px;flex-shrink:0}
#ledgerTable .ledger-filter-head.is-filtered{background:#dbeeff;color:#133b5e}
#ledgerTable .ledger-filter-head:focus-visible{outline:2px solid #ffdb7c;outline-offset:1px}
.ledger-note-dialog,.ledger-filter-dialog{width:min(540px,90vw);max-width:90vw;max-height:85vh;overflow:auto}
.ledger-note-dialog h3,.ledger-filter-dialog h3{margin:0}
.ledger-note-dialog label{display:block;margin-top:14px}
.ledger-note-dialog textarea{display:block;width:100%;min-height:160px;resize:vertical;box-sizing:border-box;margin-top:6px;white-space:pre-wrap}
.ledger-note-status{color:#a12635;min-height:1.2em}
.ledger-filter-dialog>input{width:100%;margin:12px 0;box-sizing:border-box}
.ledger-filter-tools{display:flex;gap:8px;justify-content:flex-end;margin:8px 0}
.ledger-filter-options{max-height:38vh;overflow:auto;border:1px solid #d6e1ec;border-radius:5px;padding:6px}
.ledger-filter-options label{display:flex;align-items:center;gap:8px;padding:5px;margin:0;overflow-wrap:anywhere;cursor:pointer}
.ledger-filter-options input{width:auto;flex-shrink:0}

/* Combined document project and plant controls. */
.project-name-field[hidden] { display:none !important; }
.document-plant-combo { display:flex; align-items:stretch; margin-top:5px; border:1px solid var(--line, #cbd8e5); border-radius:6px; background:white; }
.document-plant-combo textarea { flex:1; min-width:0; width:0; min-height:32px; border:0; margin:0; resize:none; background:transparent; }
.document-plant-combo .plant-choices { flex:0 0 25px; margin:0; display:block; }
.document-plant-combo .quote-plant-picker { width:100%; height:100%; }
.document-plant-combo .quote-plant-picker summary { display:flex; align-items:center; justify-content:center; height:100%; min-height:32px; padding:0; border:0; background:transparent; list-style:none; }
.document-plant-combo .quote-plant-picker summary::marker { content:''; }
.document-plant-combo .quote-plant-picker summary::-webkit-details-marker { display:none; }
.document-plant-combo:focus-within { outline:2px solid #6da6dc; }
.plant-select-all { border-bottom:1px solid #dbe4ed; padding-bottom:8px; }

.other-fee-grid {grid-template-columns:repeat(4,minmax(0,1fr)) auto;gap:8px;}
.other-fee-grid:has(#extraFeeNameLabel:not(.hidden)) {grid-template-columns:repeat(5,minmax(0,1fr)) auto;}
.other-fee-grid > label {min-width:0;}
.other-fee-grid #addExtraFee {min-height:32px;white-space:nowrap;align-self:end;}

.document-navigation-dialog[open] {display:flex;flex-direction:column;overflow:hidden;}
.document-navigation-dialog .file-preview-pages {flex:1;min-height:0;height:auto;position:relative;cursor:grab;touch-action:none;}
.document-navigation-dialog .file-preview-pages.is-panning {cursor:grabbing;user-select:none;}
.document-navigation-dialog .file-preview-pages > canvas {max-width:none;margin:0 auto 16px;}
.document-navigation-dialog .file-preview-pages > [role=status] {position:absolute;top:0;left:0;right:0;pointer-events:none;}
.document-navigation-dialog header {flex-wrap:wrap;flex-shrink:0;gap:8px;}
.document-navigation-tools {margin-left:auto;}
.document-navigation-dialog .document-content-preview {box-sizing:border-box;max-width:none;margin:0 auto;}
.document-notes-field {margin-top:12px;}
.document-notes-field textarea {width:100%;}
.document-plant-combo {height:32px;min-height:32px;box-sizing:border-box;}
.document-plant-combo textarea {height:30px!important;min-height:0!important;padding:7px 6px;line-height:16px;overflow:auto;}
.document-plant-combo .quote-plant-picker summary {min-height:30px;height:30px;}
.info-overview-grid .info-card {min-height:0;}

.shipping-title {margin:12px 0 0;}

.info-overview-grid .info-card > label {height:54px;margin:0 0 6px;line-height:16px;}
.info-overview-grid .info-card > label > input:not([type=hidden]),.info-overview-grid .info-card > label > select,.info-overview-grid .info-card > label > textarea {height:32px!important;min-height:32px!important;max-height:32px;margin-top:5px;box-sizing:border-box;line-height:16px;}
.info-overview-grid .quote-plants-field {height:54px;margin:0 0 6px;}
.info-overview-grid .quote-plants-field > label {height:16px;line-height:16px;margin:0;}
.info-overview-grid .info-card h3 {height:43px;box-sizing:border-box;}
.info-overview-grid .info-card > label:last-child {margin-bottom:0;}

#manualStructureEntry h3 {font-size:12px;}
body.order-document-mode .quote-capacity-field {display:block;}
.mail-history-dialog {width:94vw;max-width:1450px;height:86vh;border:1px solid #cbd8e5;border-radius:12px;padding:18px;}
.mail-history-filters {display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:14px 0;}
.mail-history-filters label {min-width:150px;}
.mail-history-table {width:100%;table-layout:fixed;border-collapse:collapse;}
.mail-history-table th,.mail-history-table td {padding:8px;border:1px solid #d5e0e8;overflow-wrap:anywhere;text-align:left;font-size:12px;}
.mail-history-table th {background:#eaf2f8;position:sticky;top:0;}
.mail-history-scroll {max-height:calc(100% - 200px);overflow:auto;}
.mail-history-note {font-size:12px;color:#64748b;}

.mail-history-table th {background:var(--navy);color:#fff;}
.mail-history-table th:last-child {width:88px;}
.mail-history-preview .history-body,.mail-history-preview .history-signature p {white-space:pre-wrap;overflow-wrap:anywhere;}
.mail-history-preview .history-signature {margin-top:20px;}
.mail-history-preview .history-signature img {max-width:140px;}
.mail-history-preview .mail-attachments {display:flex;flex-wrap:wrap;gap:8px;}

.document-register-table th:nth-child(4) {width:85px;}
.document-register-table .document-product {white-space:normal;overflow-wrap:anywhere;}
.info-overview-section {border-bottom:0;padding-bottom:0;}
.info-overview-section .info-overview-grid {padding-bottom:0;}
.info-overview-section + #itemsSection {padding-top:8px;}

.form-section:has(> .document-notes-field) {border-bottom:0;padding-bottom:0;}
#documentReferences {padding-top:8px;}
.document-notes-field textarea {height:32px;min-height:32px;max-height:none;padding:6px 10px;line-height:18px;box-sizing:border-box;resize:none;overflow-y:hidden;}

.mail-history-table th,.mail-history-table td {padding:2px 5px;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mail-history-table th {text-align:center;height:28px;}
.mail-history-table td {height:30px;box-sizing:border-box;vertical-align:middle;}
.mail-history-table th:nth-child(2) {width:18%;}
.mail-history-table th:nth-child(3),.mail-history-table th:nth-child(4) {width:15%;}
.mail-history-table th:nth-child(1) {width:165px;}
.mail-history-table th:nth-child(6) {width:100px;}
.mail-history-table th:last-child {width:78px;}
.mail-history-table td:last-child {text-align:center;}
.mail-history-table [data-history-preview] {white-space:nowrap;min-height:0;height:24px;padding:2px 7px;font-size:11px;line-height:18px;}

.mail-history-table td {text-align:center;}

.mail-history-scroll {max-height:min(480px,calc(86vh - 230px));overflow-y:auto;overscroll-behavior:contain;}

.mail-history-filters label:has([data-history-cc]) {width:266px;min-width:0;max-width:100%;flex:0 1 266px;}
.mail-history-filters [data-history-cc] {width:100%;min-width:0;}

body:not(.nav-collapsed) .sidebar-utilities button,
body:not(.nav-collapsed) .sidebar-footer .permission-entry {width:66.6667%;margin-left:auto;margin-right:auto;grid-template-columns:20px minmax(0,1fr);gap:9px;padding-left:6px;padding-right:6px;}
body:not(.nav-collapsed) .sidebar-footer button .nav-icon {width:20px;}
body:not(.nav-collapsed) .sidebar-footer button b {white-space:nowrap;}

.bom-supplier-controls {column-gap:12px;row-gap:14px;}

.document-mail-dialog .mail-cc-controls {margin:12px 0;display:grid;gap:6px;}
.document-mail-dialog .mail-cc-controls label {margin:0;}
.document-mail-dialog .mail-cc-controls select {width:100%;min-width:0;}
.document-mail-dialog .mail-cc-controls small {font-size:11px;line-height:1.4;color:#64748b;}

.document-mail-dialog .mail-cc-controls input,.document-mail-dialog .mail-cc-controls select,.document-mail-dialog .mail-cc-controls small {font-size:12px;font-weight:500;}

.mail-save-action {position:relative;display:inline-flex;flex-shrink:0;}
.mail-save-feedback {position:absolute;top:calc(100% + 5px);right:0;z-index:4;width:max-content;max-width:min(280px,70vw);padding:8px 10px;border:1px solid #b4d7c6;border-radius:6px;background:#effaf4;color:#176044;font-size:12px;font-weight:500;line-height:1.5;white-space:normal;box-shadow:0 3px 10px #17344f20;}
.mail-save-feedback[data-state="error"] {background:#fff3f2;border-color:#efb7b1;color:#a62c23;}
.document-mail-dialog > .row-actions .mail-save-feedback {left:0;right:auto;}

.mail-history-table th:nth-child(1) {width:12%;}
.mail-history-table th:nth-child(2) {width:16%;}
.mail-history-table th:nth-child(3) {width:13%;}
.mail-history-table th:nth-child(4) {width:14%;}
.mail-history-table th:nth-child(5) {width:16%;}
.mail-history-table th:nth-child(6) {width:17%;}
.mail-history-table th:nth-child(7) {width:6%;}
.mail-history-table th:nth-child(8) {width:6%;}

.calendar-project-search {display:flex;gap:4px;align-items:center;flex:0 1 210px;min-width:150px;}
#calendarProjectSearch {height:28px;min-height:28px;padding:3px 7px;font-size:12px;min-width:0;}
#clearCalendarProject {height:28px;min-height:28px;padding:3px 7px;}
#calendarDeliveryPanel .section-title-row {flex-wrap:wrap;}

.construction-calendar-panel .section-title-row {flex-wrap:wrap;gap:12px;}
.construction-calendar-actions {display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12px;}
.construction-calendar-actions a {color:var(--blue);}
.construction-calendar-help {margin:8px 0 12px;font-size:12px;line-height:1.5;color:var(--muted);}
#constructionGoogleCalendar {display:block;width:100%;height:72vh;min-height:560px;border:1px solid #d6e1ec;border-radius:8px;background:white;}

/* Google owns the cross-origin event styles; scale its viewport without horizontal overflow. */
#constructionGoogleCalendar {zoom:0.9;width:100%;height:816px;min-height:816px;}

/* Match the document draft type switch. */
#page-calendar .calendar-tabs {gap:4px;padding:4px;border-radius:9px;background:#edf2f6;}
#page-calendar .calendar-tabs button {font-size:12px;font-weight:800;line-height:normal;padding:7px 9px;min-height:32px;border-radius:8px;color:var(--navy);background:transparent;white-space:nowrap;}
#page-calendar .calendar-tabs button.active {background:white;color:var(--navy);box-shadow:0 2px 8px rgba(0,0,0,.08);}

.main-nav .calendar-nav-entry {margin-bottom:14px;}
#page-calendar[data-calendar-view="documents"] .calendar-panel {display:none!important;}
#page-calendar[data-calendar-view="schedule"] .document-management-panel,
#page-calendar[data-calendar-view="schedule"] .document-backup-tools {display:none!important;}

body:not(.nav-collapsed)>.topbar .brand-block {padding:12px 0;align-items:center;}
.main-nav button.calendar-nav-entry {grid-template-columns:1fr;justify-items:center;text-align:center;}
body.nav-collapsed .main-nav button.calendar-nav-entry b {display:block;font-size:10px;}

/* Calendar is the persistent sidebar home entry. */
body>.topbar .main-nav button.calendar-nav-entry {background:transparent!important;border-color:transparent;box-shadow:none;}
body>.topbar .main-nav button.calendar-nav-entry,body>.topbar .main-nav button.calendar-nav-entry * {color:#fff!important;}

/* Center sidebar content and each icon/label group. */
body:not(.nav-collapsed)>.topbar .user-session-bar {padding-right:0;justify-content:center;text-align:center;}
body:not(.nav-collapsed)>.topbar #currentUserBadge {align-items:center;}
body:not(.nav-collapsed)>.topbar .account-settings summary {text-align:center;}
body:not(.nav-collapsed)>.topbar .main-nav button {grid-template-columns:auto auto;justify-content:center;text-align:center;}
body:not(.nav-collapsed)>.topbar .main-nav button.calendar-nav-entry {grid-template-columns:auto;}
body:not(.nav-collapsed)>.topbar .sidebar-utilities button {grid-template-columns:20px auto;justify-content:center;text-align:center;}

/* Keep the navigation group centered, with consistent left-aligned columns. */
body:not(.nav-collapsed)>.topbar .main-nav button:not(.calendar-nav-entry) {grid-template-columns:26px 82px;justify-content:center;text-align:left;}
body:not(.nav-collapsed)>.topbar .sidebar-footer .permission-entry {grid-template-columns:20px auto;justify-content:center;text-align:center;}

/* Compact menu rhythm, closer calendar home and lower utility group. */
body:not(.nav-collapsed)>.topbar .main-nav {gap:3px;}
body:not(.nav-collapsed)>.topbar .main-nav button:not(.calendar-nav-entry) {min-height:30px;padding-top:1px;padding-bottom:1px;}
body:not(.nav-collapsed)>.topbar .brand-block {margin-bottom:-10px;}
body:not(.nav-collapsed)>.topbar .sidebar-footer {margin-bottom:12px;}

/* Increase the current menu rhythm by ten percent and lower the menu group. */
body:not(.nav-collapsed)>.topbar .main-nav button:not(.calendar-nav-entry) {min-height:33.3px;}
body:not(.nav-collapsed)>.topbar .main-nav .calendar-nav-entry {margin-bottom:26px;}

/* Pair the two month-filtered dashboard charts on desktop. */
.dashboard-panels {grid-template-columns:repeat(2,minmax(0,1fr));}
.dashboard-month-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px;}
.dashboard-month-heading h3 {margin:0;}
.dashboard-month-heading label {display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px;}
.dashboard-month-heading input {width:140px;}
.dashboard-month-panel .dashboard-columns {padding-left:76px;}
@media(max-width:900px) {.dashboard-panels {grid-template-columns:minmax(0,1fr);}}

.trade-status-help {font-size:12px;line-height:1.6;color:#536d83;margin:10px 0 14px;}
.document-register-table th:nth-child(11) {width:96px;}
.document-register-table .trade-status {min-width:0;max-width:100%;display:block;}
.document-register-table td:has(> select.trade-status) {text-overflow:clip;}
.trade-source-review {color:#9a5b00;font-size:12px;line-height:1.5;}
.chart-card-head {flex-wrap:wrap;gap:8px;}

.document-register-table select.trade-status {appearance:none;-webkit-appearance:none;background-image:none;text-align:center;cursor:pointer;}

/* A material schedule has no financial fields; normal quote and PO styles are unchanged. */
.structure-materials-mode #bomBody,.structure-materials-mode #bomSourceMeta,
.structure-materials-mode .bom-summary,.structure-materials-mode .bom-confirm-row,
.structure-materials-mode #standardItemsTableWrap,
.structure-materials-mode .shipping-title,.structure-materials-mode .shipping-grid,
.structure-materials-mode .other-fee-title,.structure-materials-mode .other-fee-grid,
.structure-materials-mode #extraFeeRows,
.structure-materials-mode .calculation-panel>div:not(:first-child),
.structure-materials-mode .bom-control:not(.weight-factor-label):not(.bolt-increase-control) {display:none!important;}
.structure-materials-mode .bom-supplier-controls {grid-template-columns:repeat(2,minmax(0,1fr));}
.structure-materials-entry-table {width:100%;min-width:0;table-layout:fixed;}
.structure-materials-entry-table th:first-child {width:36px;}
#structureMaterialsEntry th:last-child {width:46px;}
.structure-materials-entry-table textarea {width:100%;min-width:0;resize:vertical;}
.structure-materials-entry-table td {white-space:pre-wrap;overflow-wrap:anywhere;}
.materials-print-summary {border:1px solid #222;padding:8px;margin:8px 0;}
.materials-print-summary p:empty {display:none;}

.structure-materials-mode .bom-supplier-controls .bolt-increase-control {grid-column:2;grid-row:1;}

.materials-summary-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0 16px;}
.materials-summary-fields .materials-summary-note {grid-column:1/-1;}
.materials-summary-fields output {display:block;border:1px solid var(--line);border-radius:6px;padding:8px;background:#f3f7fa;min-height:34px;}
.structure-materials-mode .document-notes-field {display:none;}

.materials-summary .special-note {white-space:pre-wrap;overflow-wrap:anywhere;}

/* Match the six A4 summary cells, with the seventh note spanning the row. */
.materials-summary-fields {grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.materials-summary-fields input,.materials-summary-fields output {min-width:0;width:100%;font-size:11px;padding:6px;}
#structureMaterialsRows textarea {height:30px;min-height:30px;padding:5px;line-height:18px;resize:vertical;}
#structureMaterialsRows button {white-space:nowrap;padding:4px;font-size:10px;}
.structure-print .structure-materials-entry-table th {background:#eeeeee!important;color:#111;}
.materials-bom-title {font-size:12px;margin:0 0 8px;break-after:avoid;}

.document-business-jobs {min-width:0;border:1px solid #c7d6e5;border-radius:7px;padding:6px;margin:0;}
.document-business-jobs legend {display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;font-size:11px;color:var(--muted);font-weight:700;}
.document-business-jobs legend select {width:70px;min-width:0;font-size:11px;padding:4px;}
.document-business-jobs>div:not([hidden]) {display:grid;grid-template-columns:repeat(3,max-content);justify-content:space-between;gap:2px;}
.document-business-jobs label {display:flex;align-items:center;gap:3px;margin:0;font-size:10px;white-space:nowrap;}
.document-business-jobs input[type=checkbox] {width:12px;height:12px;min-width:12px;margin:0;}
.document-business-jobs[hidden] {display:none;}

/* Three business choices share one compact row in quotes and purchase orders. */
.document-business-jobs {padding:5px 3px;}
.document-business-jobs label {font-size:9px;gap:2px;}
.document-business-jobs input[type=checkbox] {width:10px;height:10px;min-width:10px;}

.project-work-kinds .project-distribution-options {justify-content:space-around;}

/* Project salesperson sits between project name and partner company. */
.project-editor.form-grid.four {grid-template-columns:minmax(130px,1fr) minmax(100px,.65fr) minmax(130px,1fr) 274px minmax(100px,.65fr);}
#projectMasterSalesperson {width:100%;min-width:0;font-family:inherit;font-size:12px;font-weight:500;}
@media(max-width:1100px){.project-editor.form-grid.four {grid-template-columns:repeat(2,minmax(0,1fr));}.project-editor .project-work-kinds {grid-column:auto;}}

.document-business-jobs {margin-top:-3px;margin-bottom:8px;}
.document-business-jobs input[type=checkbox] {min-height:10px;padding:0;}
.document-business-jobs>div:not([hidden]) {min-height:22px;align-items:center;}

body:not(.nav-collapsed)>.topbar .account-actions {justify-content:center;}


.document-management-heading {display:flex;justify-content:center;margin-bottom:16px;}
#page-calendar .document-management-panel .toolbar-grid {grid-template-columns:minmax(0,1fr) 150px;}


.sales-registration-dialog{width:min(620px,94vw);max-height:90vh;overflow:auto}.sales-registration-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.sales-registration-grid label{display:flex;flex-direction:column;gap:5px}.sales-registration-grid .wide{grid-column:1/-1}.sales-registration-dialog [data-files]{margin:10px 0}.sales-registration-dialog [data-status]{color:#176d59}

.sales-registration-dialog{border:1px solid #c7d6e4;border-radius:12px;padding:20px;color:#163652;box-shadow:0 18px 60px #102c4733;font-size:12px}.sales-registration-dialog .section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.sales-registration-dialog h3{margin:0;font-size:16px}.sales-registration-dialog h4{margin:16px 0 8px}.sales-registration-dialog button,.sales-registration-dialog input,.sales-registration-dialog select{font-size:12px}.sales-registration-dialog [data-close]{border:1px solid #c7d6e4;border-radius:6px;background:#eef3f7;color:#163652;padding:6px 12px}.sales-registration-dialog [data-upload]{margin-top:8px}.sales-registration-dialog .help{font-size:11px;color:#6b8097;line-height:1.5}

.cash-payment-ratios {margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.cash-payment-ratios.hidden {display:none;}
.cash-payment-ratios label {display:block;height:54px;margin:0 0 6px;line-height:16px;font-size:12px;}
.cash-payment-ratios label:last-child {margin-bottom:6px;}
.cash-payment-ratios label span {display:block;position:relative;margin-top:5px;}
.cash-payment-ratios label span b {position:absolute;right:4px;top:0;line-height:32px;font-weight:500;pointer-events:none;}
.cash-payment-ratios input {width:100%;min-width:0;height:32px;box-sizing:border-box;margin-top:0;padding:4px 12px 4px 4px;font-size:inherit;line-height:16px;text-align:center;appearance:textfield;-moz-appearance:textfield;}
.cash-payment-ratios input::-webkit-inner-spin-button,.cash-payment-ratios input::-webkit-outer-spin-button {appearance:none;margin:0;}
#legacyPaymentNotice {font-size:10px;color:#6b8097;}

.order-delivery-card {display:none;}
body.order-document-mode .order-delivery-card {display:block;}
body.order-document-mode .info-overview-grid {grid-template-columns:repeat(4,minmax(0,1fr));}
.order-delivery-card .delivery-date-field {position:relative;height:54px;margin:0 0 6px;line-height:16px;}
.order-delivery-card .delivery-date-field>label {height:16px;line-height:16px;margin:0;}
.order-delivery-card .delivery-date-line {display:block;}
.order-delivery-card .delivery-date-line input[name="orderDeliveryDate"] {height:32px;min-height:32px;max-height:32px;box-sizing:border-box;margin-top:5px;line-height:16px;}
.order-delivery-card #deliveryTimePicker {position:absolute;top:-3px;right:0;}
.order-delivery-card #deliveryTimePicker>summary {font-size:9px;padding:2px 4px;min-height:0;}
.order-delivery-card .delivery-time-popover {left:auto;right:0;}
#orderSection>.order-transport-request-line {margin-top:12px;}
@media(max-width:1050px){body.order-document-mode .info-overview-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:650px){body.order-document-mode .info-overview-grid {grid-template-columns:minmax(0,1fr);}}

/* Arrival time uses the same stacked label/control layout as delivery fields. */
.order-delivery-card .order-arrival-time-field {height:54px;margin:0 0 6px;line-height:16px;font-size:12px;}
.delivery-card .order-arrival-time-field {height:54px;margin:0 0 6px;line-height:16px;font-size:12px;}
.order-arrival-time-label {display:block;font-weight:700;color:var(--muted);}
.order-delivery-card #deliveryTimePicker {position:relative;top:auto;right:auto;width:100%;margin-top:5px;}
.order-delivery-card #deliveryTimePicker>summary {box-sizing:border-box;width:100%;height:32px;min-height:32px;padding:4px 8px;font-size:11px;font-weight:400;justify-content:flex-start;background:#fff;overflow:hidden;text-overflow:ellipsis;}
.delivery-card #deliveryTimePicker {position:relative;top:auto;right:auto;width:100%;margin-top:5px;}
.delivery-card #deliveryTimePicker>summary {box-sizing:border-box;width:100%;height:32px;min-height:32px;padding:4px 8px;font-size:11px;font-weight:400;justify-content:flex-start;background:#fff;overflow:hidden;text-overflow:ellipsis;}
.delivery-card .delivery-time-popover {left:auto;right:0;}

.quote-delivery-time {min-width:0;margin-bottom:6px;}
.quote-delivery-time label {display:block;margin:0 0 6px;line-height:16px;}
.quote-delivery-time label>input,.quote-delivery-time label>select {height:32px;min-height:32px;box-sizing:border-box;margin-top:5px;}
.quote-delivery-time [hidden] {display:none!important;}
.quote-delivery-days {display:flex;align-items:center;gap:6px;margin-top:5px;}
.quote-delivery-days input {width:100%;min-width:0;height:32px;min-height:32px;text-align:center;}
.quote-delivery-days b {font-size:11px;font-weight:400;}
#legacyDeliveryNotice {display:block;overflow-wrap:anywhere;font-size:11px;color:var(--muted);margin-bottom:6px;}

.mail-upload-control {position:relative;display:flex;align-items:center;gap:8px;margin-top:12px;font-size:11px;color:var(--muted);}
.mail-upload-control .mail-upload-button {display:inline-flex;align-items:center;margin:0;padding:7px 10px;border:1px solid #cad8e1;border-radius:6px;background:#edf3f8;cursor:pointer;white-space:nowrap;color:#183249;}
.mail-upload-input {position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;}
.mail-upload-control:focus-within .mail-upload-button {outline:2px solid #2867ac;outline-offset:2px;}
.mail-primary-attachment {margin-top:10px;}
.mail-attachment-choice span {overflow-wrap:anywhere;}

#calendarDeliveryPanel .section-title-row {flex-wrap:wrap;gap:8px;}
.calendar-category-filters {display:flex;gap:8px;align-items:center;}
.calendar-category-filters label {display:flex;align-items:center;gap:3px;margin:0;white-space:nowrap;font-size:12px;}
.calendar-category-filters input {width:auto;margin:0;}
#calendarDeliveryPanel .calendar-project-search {margin-left:auto;flex:0 1 210px;}

.mail-attachment-choice .mail-file-preview {border:0;background:transparent;box-shadow:none;color:#245e99;padding:0;text-align:left;font:inherit;text-decoration:underline;text-underline-offset:2px;white-space:normal;overflow-wrap:anywhere;cursor:pointer;}
.mail-attachment-choice>label {margin:0;font:inherit;overflow-wrap:anywhere;}

.reference-upload-control {border:1px solid #cad8e1;border-radius:6px;padding:8px;background:#fff;}

.document-business-jobs>.document-distribution-options:not([hidden]) {grid-template-columns:repeat(4,max-content);gap:1px;}
.document-business-jobs>.document-distribution-options label {gap:0;}

.calendar-month-navigation {display:flex;align-items:center;gap:3px;flex:0 0 auto;}
.calendar-month-navigation .calendar-month-arrow {width:24px;min-width:24px;height:28px;min-height:28px;padding:0;font-size:20px;line-height:1;}
.calendar-month-navigation input[type=month] {width:126px;min-width:0;margin:0;}
#deliveryCalendarMonth, #paymentCalendarMonth {text-align:center;padding-left:28px!important;padding-right:28px!important;}

.reference-upload-control .reference-upload-hint {font-size:11px;line-height:1.4;min-width:0;}
.reference-upload-control .mail-upload-button {flex-shrink:0;}

.sales-registration-modes {display:flex;gap:18px;background:#eef3f7;border-radius:8px;padding:10px;margin:14px 0;}
.sales-registration-modes label {display:flex;align-items:center;gap:6px;margin:0;cursor:pointer;}
.sales-registration-modes input,.sales-quote-choice input {width:auto;margin:0;}
.sales-quote-list {max-height:270px;overflow:auto;border:1px solid #d5e0e9;border-radius:7px;}
.sales-quote-choice {display:flex;align-items:center;gap:8px;padding:10px;margin:0;border-bottom:1px solid #e5ecf2;}
.sales-quote-choice:last-child {border-bottom:0;}
.sales-quote-choice>span {flex:1;min-width:0;}
.sales-quote-choice small {display:block;font-size:11px;font-weight:400;color:#6b8097;margin-top:4px;overflow-wrap:anywhere;}
.sales-quote-choice>strong {white-space:nowrap;font-size:12px;}
.sales-registration-dialog [hidden] {display:none!important;}

 .quote-delivery-heading {display:flex;align-items:center;justify-content:space-between;gap:3px;height:16px;margin-bottom:5px;}
.quote-delivery-heading>span {font-size:11px;font-weight:700;color:#64748b;white-space:nowrap;}
.quote-delivery-heading>select {width:84px;min-width:0;height:22px;min-height:22px;padding:1px 2px;font-size:10px;line-height:16px;margin:0;}
#quoteDeliveryDaysField {margin:0 0 6px;}
#quoteDeliveryDaysField textarea {height:92px;min-height:92px;max-height:92px;resize:none;margin:0;box-sizing:border-box;line-height:16px;}

/* Project list: creation date first; distribution uses project-level identity. */
[data-project-group="construction"] .project-table th:nth-child(1){width:6%;}
[data-project-group="construction"] .project-table th:nth-child(2){width:8%;}
[data-project-group="distribution"] .project-table th:nth-child(1){width:9%;}
[data-project-group="distribution"] .project-table th:nth-child(2){width:16%;}
[data-project-group="distribution"] .project-table th:nth-child(3){width:9%;}
[data-project-group="distribution"] .project-table th:nth-child(4){width:10%;}
[data-project-group="distribution"] .project-table th:nth-child(5){width:12%;}
[data-project-group="distribution"] .project-table th:nth-child(6){width:9%;}
[data-project-group="distribution"] .project-table th:nth-child(7){width:12%;}
[data-project-group="distribution"] .project-table th:nth-child(8){width:14%;}
[data-project-group="distribution"] .project-table th:nth-child(9){width:9%;}

/* Quote list omits purchase sales-registration and delivery-date columns. */
.document-register-table.quote-list th:nth-child(9),
.document-register-table.quote-list th:nth-child(10),
.document-register-table.quote-list tr[data-document-id] > td:nth-child(9),
.document-register-table.quote-list tr[data-document-id] > td:nth-child(10) {display:none;}

.document-register-table .trade-status.confirmation-yes {background:#dcfce7;color:#166534;border-color:#86efac;font-weight:700;}
.document-register-table .trade-status.confirmation-no {background:#fee2e2;color:#991b1b;border-color:#fca5a5;font-weight:700;}

/* Supplier cost and explicit quotation sale prices */
.bom-supplier-controls .structure-supplier-control{grid-column:2 / 4;grid-row:1;}
.bom-supplier-controls .accessory-supplier-control{grid-column:2;grid-row:2;}
.bom-supplier-controls .accessory-factor-control{grid-column:3;grid-row:2;}
.bom-supplier-controls .bolt-supplier-control{grid-column:4;grid-row:2;}
.bom-supplier-controls .bolt-factor-control{grid-column:5;grid-row:2;}

.calculation-panel{grid-template-columns:repeat(4,minmax(0,1fr));}
.calculation-panel.profit-summary{grid-template-columns:repeat(2,minmax(0,1fr));background:#e7f5ee;margin-top:6px;color:#08755b;}
#bomGroupMargins.profit-summary{grid-template-columns:repeat(4,minmax(0,1fr));}
.calculation-panel.profit-summary>div{background:#e7f5ee;}

.calculation-panel.profit-summary{grid-template-columns:repeat(3,minmax(0,1fr));}
#bomGroupMargins.profit-summary{grid-template-columns:repeat(4,minmax(0,1fr));}

/* Two equal supplier groups with compact percentage inputs. */
.bom-supplier-controls{grid-template-columns:max-content repeat(4,minmax(0,1fr));}
.bom-supplier-controls .weight-factor-label,.bom-supplier-controls .bolt-increase-control{width:88px;}
.bom-supplier-controls .structure-supplier-control,.bom-supplier-controls .accessory-supplier-control{grid-column:2 / 4;}
.bom-supplier-controls .bolt-supplier-control{grid-column:4 / 6;grid-row:2;}

.table-action.secondary.order-amount-register{color:#c62828;}

#draftTradeStatus.confirmation-yes{background:#dcfce7;color:#166534;border-color:#86efac;font-weight:700;}
#draftTradeStatus.confirmation-no{background:#fee2e2;color:#991b1b;border-color:#fca5a5;font-weight:700;}

/* Cost/profit totals and four material results share one summary row. */
.calculation-panel.profit-summary{grid-template-columns:repeat(3,minmax(0,1fr)) minmax(0,2fr);}
#bomGroupMargins{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px;}
#bomGroupMargins>div{min-width:0;padding:0;border:0;}
#bomGroupMargins span{margin-bottom:3px;font-size:11px;}
#bomGroupMargins strong{font-size:11px;overflow-wrap:anywhere;}

.project-search-row{display:grid;grid-template-columns:minmax(180px,320px) 1fr minmax(0,320px);align-items:center;gap:12px;}
.project-search-row #projectSearch{width:100%;min-width:0;}
#projectListTabs{justify-self:center;}
.project-list-group[hidden]{display:none!important;}
@media(max-width:760px){.project-search-row{grid-template-columns:minmax(0,1fr) auto;}}

/* Purchase amount, VAT and total share one row. */
.order-amount-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.order-amount-grid label,.order-amount-grid input{min-width:0}
/* Row order handles are editor-only; print tables omit the entire action cell. */
#structureQuoteDetails .quote-row-actions { display:flex;align-items:center;justify-content:center;gap:3px;white-space:nowrap; }
#structureQuoteDetails .quote-row-drag { padding:1px 3px;min-width:18px;border:1px solid #bad7ea;border-radius:4px;background:#eef8ff;color:#205b88;font-size:15px;line-height:20px;cursor:grab; }
#structureQuoteDetails .quote-row-drag:active { cursor:grabbing; }
#structureQuoteDetails .quote-drop-before > td { box-shadow:inset 0 2px #2476ba; }
#structureQuoteDetails .quote-drop-after > td { box-shadow:inset 0 -2px #2476ba; }
/* Keep entered line breaks and align continuation lines with the note body. */
.structure-print .quote-multiline-note { display:flex;align-items:flex-start;gap:4px;text-align:left;white-space:normal; }
.structure-print .quote-multiline-note > b { flex:none;white-space:nowrap; }
.structure-print .quote-note-text { display:block;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;text-align:left;text-indent:0; }
.structure-print .quote-multiline-note > .quote-note-text { flex:1; }

#structureQuoteDetails .quote-row-copy { padding:1px 3px;min-width:18px;border:1px solid #bad7ea;border-radius:4px;background:#eef8ff;color:#205b88;font-size:15px;line-height:20px;cursor:pointer; }
/* Compact document list, retaining readable action buttons. */
.document-register-table {min-width:1050px;table-layout:fixed;width:100%;}
.document-register-table.quote-list {min-width:950px;}
.document-register-table th,.document-register-scroll .document-register-table tbody td {padding:3px 4px;overflow:hidden;text-overflow:ellipsis;}
.document-register-table th:nth-child(1) {width:90px;}
.document-register-table th:nth-child(2) {width:132px;}
.document-register-table th:nth-child(3) {width:48px;}
.document-register-table th:nth-child(4) {width:62px;}
.document-register-table th:nth-child(8) {width:100px;}
.document-register-table th:nth-child(9) {width:70px;}
.document-register-table th:nth-child(10) {width:105px;}
.document-register-table th:nth-child(11) {width:74px;}
.document-register-table th:nth-child(12) {width:56px;}
.document-register-table th:last-child {width:142px;}
.document-register-table .document-expected-date {width:98px;min-width:0;}
.document-register-table td:last-child .table-action {margin:0 1px;padding:3px 4px;}
.document-register-table .column-filter-trigger {padding-left:0;padding-right:0;gap:2px;}

/* Display thickness is independent of the BOM weight dimensions. */
.bom-supplier-controls {grid-template-columns:88px 88px repeat(4,minmax(0,1fr));}
.bom-supplier-controls .thickness-display-control {grid-column:2;grid-row:1;}
.bom-supplier-controls .structure-supplier-control {grid-column:3 / 5;}
.bom-supplier-controls .square-direct-control {grid-column:5;}
.bom-supplier-controls .csteel-direct-control {grid-column:6;}
.bom-supplier-controls .accessory-supplier-control {grid-column:2 / 5;}
.bom-supplier-controls .bolt-supplier-control {grid-column:5 / 7;}
.structure-materials-mode .bom-control.thickness-display-control {display:grid!important;}
