/* boq.css (v53): Cost & BOQ panel */
.cbq-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line, #d9dce3); background: var(--ink, #111); color: var(--bg, #fff); font: 600 14px Inter, system-ui, sans-serif; box-shadow: 0 10px 28px rgba(0, 0, 0, .2); cursor: pointer; }
.cbq-fab span { font-weight: 800; }
.cbq-fab.stack { bottom: 72px; }
.cbq-fab:hover { transform: translateY(-1px); }
html.cbq-lock, html.cbq-lock body { overflow: hidden; }
.cbq-ov { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 12, 18, .55); display: flex; align-items: stretch; justify-content: center; padding: 18px; }
.cbq-ov[hidden] { display: none; }
.cbq-box { background: var(--bg, #fafafa); color: var(--ink, #111); width: min(1440px, 100%); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); font: 14px/1.45 Inter, system-ui, sans-serif; }
.cbq-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid var(--line, #e5e7eb); background: var(--surface, #fff); }
.cbq-eye { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #6b7280); }
.cbq-ttl h2 { margin: 2px 0 0; font-size: 19px; }
.cbq-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cbq-reg { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted, #6b7280); }
.cbq-reg select, .cbq-box input, .cbq-box select { font: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid var(--line, #d1d5db); border-radius: 7px; background: var(--surface, #fff); color: var(--input-ink, var(--ink, #111)); }
.cbq-x { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--muted, #6b7280); padding: 2px 8px; }
.cbq-dl { position: relative; }
.cbq-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 290px; background: var(--surface, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18); padding: 6px; display: grid; }
.cbq-menu[hidden] { display: none; }
.cbq-menu button { text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 7px; font: inherit; color: inherit; cursor: pointer; }
.cbq-menu button:hover { background: color-mix(in srgb, #2563eb 9%, transparent); }
.cbq-tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line, #e5e7eb); background: var(--surface, #fff); overflow-x: auto; }
.cbq-tabs button { border: 0; background: transparent; padding: 10px 12px; font: 600 13px Inter, sans-serif; color: var(--muted, #6b7280); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.cbq-tabs button[aria-selected="true"] { color: var(--ink, #111); border-bottom-color: #2563eb; }
.cbq-body { overflow: auto; padding: 16px 18px 26px; flex: 1; }
.cbq-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.cbq-k { background: var(--surface, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 10px 12px; }
.cbq-k b { display: block; font-size: 19px; }
.cbq-k span { font-size: 12px; color: var(--muted, #6b7280); }
.cbq-k.main { background: #1f3a5f; color: #fff; border-color: #1f3a5f; }
.cbq-k.main span { color: #dbe5f3; }
.cbq-lmp { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin: 0 0 14px; font-size: 11px; font-weight: 700; color: #fff; }
.cbq-lmp span { display: flex; align-items: center; padding-left: 6px; white-space: nowrap; overflow: hidden; }
.cbq-lmp .l { background: #3b82f6; } .cbq-lmp .m { background: #10b981; } .cbq-lmp .p { background: #f59e0b; }
.cbq-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cbq-tw { overflow-x: auto; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; background: var(--surface, #fff); }
.cbq-tab { width: 100%; border-collapse: collapse; font-size: 13px; }
.cbq-tab th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); padding: 8px; border-bottom: 1px solid var(--line, #e5e7eb); position: sticky; top: 0; background: var(--surface, #fff); }
.cbq-tab td { padding: 5px 8px; border-bottom: 1px solid color-mix(in srgb, var(--line, #e5e7eb) 70%, transparent); vertical-align: top; }
.cbq-tab .r { text-align: right; white-space: nowrap; }
.cbq-tab tr.cbq-g td { background: color-mix(in srgb, #1f3a5f 8%, var(--surface, #fff)); font-weight: 700; }
.cbq-tab small { display: block; color: var(--muted, #6b7280); font-size: 11px; }
.cbq-no { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cbq-d { min-width: 240px; }
.cbq-tab input[type="number"] { width: 96px; text-align: right; padding: 3px 6px; }
.cbq-tab input.ed, .cbq-box input.ed { border-color: #2563eb; background: color-mix(in srgb, #2563eb 7%, var(--surface, #fff)); }
.cbq-del { border: 0; background: transparent; color: var(--muted, #9ca3af); font-size: 17px; cursor: pointer; line-height: 1; }
.cbq-del:hover { color: #dc2626; }
.cbq-sum { display: block; background: var(--surface, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 12px; position: sticky; top: 0; }
.cbq-sum h3, .cbq-src h3 { margin: 0 0 8px; font-size: 15px; }
.cbq-mk { display: grid; gap: 6px; margin-bottom: 10px; }
.cbq-mk label { display: grid; grid-template-columns: 1fr 76px 42px; gap: 6px; align-items: center; font-size: 12.5px; }
.cbq-mk input { width: 100%; text-align: right; }
.cbq-mk i { font-style: normal; color: var(--muted, #6b7280); font-size: 11px; }
.cbq-tot { width: 100%; border-collapse: collapse; font-size: 13px; }
.cbq-tot td { padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--line, #e5e7eb) 60%, transparent); }
.cbq-tot td.r { text-align: right; }
.cbq-tot tr.sub td { font-weight: 700; }
.cbq-tot tr.grand td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--ink, #111); border-bottom: 0; padding-top: 8px; }
.cbq-tot small { color: var(--muted, #6b7280); }
.cbq-note, .cbq-hint { font-size: 12px; color: var(--muted, #6b7280); }
.cbq-empty { padding: 18px; border: 1px dashed var(--line, #d1d5db); border-radius: 10px; color: var(--muted, #6b7280); background: var(--surface, #fff); }
.cbq-add { margin-top: 12px; display: grid; gap: 8px; }
.cbq-search { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; }
.cbq-search input { width: 100%; }
.cbq-res { display: grid; gap: 2px; max-height: 260px; overflow: auto; }
.cbq-res button { text-align: left; border: 1px solid var(--line, #e5e7eb); background: var(--surface, #fff); border-radius: 7px; padding: 6px 8px; font: inherit; font-size: 12.5px; color: inherit; cursor: pointer; }
.cbq-res button i { color: var(--muted, #6b7280); font-style: normal; float: right; }
.cbq-cus summary { cursor: pointer; font-size: 12.5px; font-weight: 600; }
.cbq-cusf { display: grid; grid-template-columns: 2fr .7fr .7fr 1fr auto; gap: 6px; margin-top: 6px; }
.cbq-src { max-width: 1100px; }
.cbq-src p { margin: 0 0 10px; }
.cbq-pf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 8px 14px; }
.cbq-p { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; align-items: center; font-size: 13px; background: var(--surface, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 6px 8px; }
.cbq-p.wide { grid-template-columns: 160px 1fr; margin-top: 8px; max-width: 640px; }
.cbq-p i { font-style: normal; color: var(--muted, #6b7280); font-size: 11px; }
.cbq-p em, .cbq-hint em { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: #eef0f4; color: #6b7280; white-space: nowrap; }
.cbq-p em.dsg, .cbq-hint em.dsg { background: #dcfce7; color: #166534; }
.cbq-p em.man, .cbq-hint em.man { background: #dbeafe; color: #1e40af; }
.cbq-p input[type="checkbox"] { justify-self: start; width: 18px; height: 18px; }
.cbq-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.cbq-row input[type="search"] { flex: 1; min-width: 200px; }
.cbq-file { cursor: pointer; }
.linklike { border: 0; background: none; color: #2563eb; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.muted { color: var(--muted, #6b7280); }
.cbq-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 1100; background: #111827; color: #fff; padding: 9px 14px; border-radius: 9px; font: 13px Inter, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
@media (max-width: 980px) { .cbq-grid { grid-template-columns: 1fr; } .cbq-sum { position: static; } }
@media (max-width: 640px) { .cbq-ov { padding: 0; } .cbq-box { border-radius: 0; } .cbq-fab { right: 12px; padding: 10px 13px; } .cbq-fab b { display: none; } .cbq-fab.stack { bottom: 66px; } .cbq-cusf { grid-template-columns: 1fr 1fr; } .cbq-p { grid-template-columns: 1fr 110px; } .cbq-p em { grid-column: 1 / -1; justify-self: start; } .cbq-top { padding: 12px; } .cbq-body { padding: 12px; } }
@media print { .cbq-fab { display: none !important; } }
.cbq-box input, .cbq-box select { box-sizing: border-box; min-width: 0; max-width: 100%; margin: 0; }
.cbq-box label { margin: 0; }
