/* Company & Documents: settings sections (Warehouses, Brands, Departments, Document layouts, Images, Barcode labels, Scanner setup),
   photo gallery, lightbox. Tokens only (docs/BRAND.md). */
.co-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.co-head h2 { font-size: 26px; }
.co-head p { margin: 6px 0 0; max-width: 680px; }
.co-head-acts { display: flex; gap: 8px; align-items: center; }
.co-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.co-facts { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.co-small { font-size: 12px; }
.co-nowrap { flex-wrap: nowrap; justify-content: flex-end; }
.co-h4 { margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--rule-soft); font-family: var(--font-display); font-size: 16px; color: var(--graphite); }
.co-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; box-shadow: inset 0 0 0 1px rgba(38,48,58,.15); flex-shrink: 0; }
.co-chip { display: inline-block; background: var(--concrete); border-radius: 999px; padding: 1px 9px; font-size: 12px; margin: 1px 4px 1px 0; }
.co-err { color: var(--bad); font-size: 13px; min-height: 1em; margin-top: 8px; }
.co-ok { color: var(--ok); font-weight: 600; } .co-bad { color: var(--bad); font-weight: 600; }
.co-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.co-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.co-radio { display: flex; align-items: flex-start; margin: 2px 0; font-weight: 400; min-height: 36px; }
.co-radio input { margin-top: 3px; }
.co-radio small { display: block; font-size: 12px; }
.co-hex { width: 110px; }
.sh-biz { display: grid; gap: 10px; }

/* identities */
.co-id-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.co-id-card { margin: 0; overflow: hidden; }
.co-id-logo { height: 110px; display: flex; align-items: center; justify-content: center; background: var(--concrete); border-bottom: 1px solid var(--rule); padding: 14px; box-shadow: inset 0 4px 0 var(--accent, var(--steel)); }
.co-id-logo img { max-height: 80px; max-width: 100%; object-fit: contain; }
.co-id-noname { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--steel); }
.co-id-card .card-body > div { margin-bottom: 4px; }
.co-id-acts { margin-top: 10px; }
.co-logo-box { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-top: 14px; padding: 12px; border: 1px dashed var(--rule); border-radius: var(--r-panel); flex-wrap: wrap; }
.co-logo-box p { margin: 2px 0 8px; }
.co-logo-prev { min-width: 200px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: repeating-conic-gradient(var(--concrete) 0 25%, var(--paper) 0 50%) 0 0 / 16px 16px; border-radius: var(--r-ctl); padding: 8px; }
.co-logo-prev img { max-height: 64px; max-width: 240px; }
.co-logo-msg.err { color: var(--bad); }
.co-mini-head { margin-top: 14px; }
.co-mini-doc { border: 1px solid var(--rule); border-radius: var(--r-ctl); padding: 14px 18px; background: var(--paper); margin-top: 4px; }

/* document layouts */
.co-tpl { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.co-tpl-list { padding: 8px 0; margin: 0; position: sticky; top: 70px; }
.co-tpl-group { padding: 4px 0 8px; }
.co-tpl-gtitle { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 4px 12px; font-size: 12px; color: var(--steel); font-weight: 600; }
.co-tpl-gtitle .icon-btn { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; }
.co-tpl-item { display: flex; gap: 6px; align-items: center; justify-content: space-between; min-height: 34px; padding: 4px 12px; color: var(--graphite); font-size: 14px; position: relative; }
.co-tpl-item:hover { background: var(--concrete); text-decoration: none; }
.co-tpl-item.active { background: var(--teal-wash); color: var(--teal-dark); font-weight: 600; }
.co-tpl-item.active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.co-tpl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-tpl-def { font-size: 11px; font-weight: 600; color: var(--steel); background: var(--concrete); border-radius: 999px; padding: 0 7px; flex-shrink: 0; }
.co-tpl-item.active .co-tpl-def { background: var(--paper); }
.co-tpl-none { padding: 2px 12px; }
.co-tpl-edit { margin: 0; }
.co-tpl-btns { margin-top: 14px; }
.co-tpl-prev { position: sticky; top: 70px; }
.co-tpl-prev-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.co-paper-wrap { background: #DDE2E7; border-radius: var(--r-panel); padding: 12px; max-height: calc(100vh - 140px); overflow: auto; }
.co-paper .sfdoc { box-shadow: 0 1px 6px rgba(38,48,58,.18); min-height: 10in; }

/* photo gallery */
.co-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.co-tile { position: relative; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--paper); display: flex; flex-direction: column; }
.co-tile.primary { border-color: var(--graphite); }
.co-tile-img { all: unset; cursor: zoom-in; display: block; aspect-ratio: 1; background: var(--concrete); }
.co-tile-img:focus-visible { outline: 2px solid var(--gaffer); outline-offset: -2px; }
.co-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-tile-primary { position: absolute; top: 6px; left: 6px; background: var(--graphite); color: #fff; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.co-tile-cap { font-size: 11.5px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-tile-acts { position: absolute; top: 4px; right: 4px; display: none; gap: 2px; background: rgba(255,255,255,.94); border-radius: var(--r-ctl); box-shadow: 0 1px 3px rgba(38,48,58,.2); }
.co-tile:hover .co-tile-acts, .co-tile:focus-within .co-tile-acts { display: flex; }
.co-tile-acts .icon-btn { width: 28px; height: 28px; padding: 0; display: grid; place-items: center; }
@media (hover: none) { .co-tile-acts { display: flex; } }
.co-add { align-items: center; justify-content: center; gap: 4px; cursor: pointer; aspect-ratio: 1; border-style: dashed; color: var(--steel); font-size: 13px; min-height: 104px; }
.co-add:hover { border-color: var(--teal); color: var(--teal-dark); }
.co-add:focus-within { outline: 2px solid var(--gaffer); }
.co-add-plus { line-height: 0; }
.inv-photos-host.co-drop, .co-drop .co-gal { outline: 2px dashed var(--teal); outline-offset: 4px; border-radius: 8px; }
.co-gal-status { font-size: 12px; margin-top: 6px; min-height: 1em; }

/* lightbox */
.co-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(10,10,12,.92); display: flex; align-items: center; justify-content: center; }
.co-lb figure { margin: 0; max-width: 88vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.co-lb img { max-width: 88vw; max-height: 80vh; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.co-lb figcaption { color: #e5e7eb; font-size: 14px; }
.co-lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; color: #D9DEE4; font-size: 13px; }
.co-lb-meta { display: flex; gap: 14px; }
.co-lb-x, .co-lb-nav { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; cursor: pointer; font-size: 20px; }
.co-lb-x { width: 36px; height: 36px; }
.co-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 30px; line-height: 1; }
.co-lb-nav.prev { left: 18px; } .co-lb-nav.next { right: 18px; }
.co-lb-x:hover, .co-lb-nav:hover { background: rgba(255,255,255,.25); }

/* images library */
.co-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.co-lib-tile { margin: 0; position: relative; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-panel); overflow: hidden; }
.co-lib-tile figcaption { padding: 6px 8px 8px; display: grid; gap: 3px; }
.co-lib-cap { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-lib-tile .row { gap: 6px; }

/* labels */
.co-lbl-stage { background: #DDE2E7; border-radius: var(--r-ctl); padding: 28px; display: flex; justify-content: center; align-items: center; min-height: 180px; overflow: auto; }
.co-lbl { background: #fff; box-shadow: 0 1px 6px rgba(38,48,58,.25); border-radius: 4px; padding: .06in .1in; display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow: hidden; color: #000; font-family: Arial, Helvetica, sans-serif; flex-shrink: 0; }
.co-lbl.qr { flex-direction: row; align-items: center; gap: .08in; }
.co-lbl.qr.big { flex-direction: column; text-align: center; }
.co-lbl-code { display: flex; justify-content: center; min-height: 0; }
.co-lbl-code svg { max-width: 100%; max-height: 100%; height: auto; }
.co-lbl.c128 .co-lbl-code svg { width: 100%; max-height: .5in; }
.co-lbl.c128.big .co-lbl-code svg { max-height: 1.2in; }
.co-lbl-text { min-width: 0; line-height: 1.15; }
.co-lbl-co { font-size: 7pt; font-weight: 600; color: #333; }
.co-lbl-name { font-size: 8.5pt; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-lbl.big .co-lbl-name { font-size: 14pt; white-space: normal; }
.co-lbl.big .co-lbl-co { font-size: 10pt; }
.co-lbl-bc { font-size: 9pt; font-weight: 700; }
.co-lbl-sn { font-size: 7pt; color: #333; }
.co-lbl.big .co-lbl-sn, .co-lbl.big .co-lbl-bc { font-size: 11pt; }

/* scanner test */
.co-steps { margin: 0; padding-left: 20px; line-height: 1.55; }
.co-steps li { margin-bottom: 6px; }
.co-scan-in { width: 100%; height: 52px; font-size: 18px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--r-ctl); }
.co-scan-in:focus { outline: 2px solid var(--gaffer); outline-offset: 0; border-color: var(--graphite); background: var(--gaffer-wash); }
.co-scan-result { margin-top: 12px; }
.co-scan-card { border-radius: var(--r-panel); padding: 12px 14px; border: 1px solid var(--rule); border-left-width: 4px; }
.co-scan-card.ok { border-left-color: var(--ok); }
.co-scan-card.warn { border-left-color: var(--warn); }
.co-scan-verdict { font-weight: 600; margin-bottom: 4px; }
.co-scan-card.ok .co-scan-verdict { color: var(--ok); } .co-scan-card.warn .co-scan-verdict { color: var(--warn); }
.co-scan-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; word-break: break-all; }
.co-scan-raw { margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 2px; }
.co-scan-raw span { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.co-scan-raw span.ctl { background: var(--graphite); color: #fff; border-color: var(--graphite); }

@media (max-width: 1100px) { .co-tpl { grid-template-columns: 200px minmax(0, 1fr); } .co-tpl-prev { grid-column: 1 / -1; position: static; } }
@media (max-width: 900px) { .co-split, .co-tpl { grid-template-columns: 1fr; } .co-tpl-list { position: static; } }
.co-tpl-form .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.co-tpl-form select, .co-tpl-form input:not([type=checkbox]):not([type=color]), .co-tpl-form textarea { width: 100%; min-width: 0; }
.co-lbl-form .field, .co-scan-form .field { margin-bottom: 12px; }
.co-paper .sfdoc-table { table-layout: auto; }
@media (max-width: 1500px) { .co-tpl-edit .form-grid { grid-template-columns: minmax(0, 1fr); } .co-tpl-edit .co-checks { grid-template-columns: 1fr; } }
.co-tpl-form input[type=color] { width: 44px; height: 36px; padding: 2px; }
.co-scan-form select, .co-scan-form input { width: 100%; }
.co-tpl > *, .co-split > * { min-width: 0; }

/* ── Quote layout sections (v0.5) ── */
.co-secs { list-style: none; margin: 8px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.co-sec { border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.co-sec.off { background: var(--concrete); }
.co-sec.off .co-sec-on strong { color: var(--steel); }
.co-sec.drop { box-shadow: inset 0 3px 0 var(--teal); }
.co-sec.dragging { opacity: 0.5; }
.co-sec-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 4px; min-height: 44px; }
.co-sec-grip { cursor: grab; color: var(--steel); display: grid; place-items: center; width: 22px; height: 32px; border-radius: 4px; flex-shrink: 0; }
.co-sec-grip:hover { background: var(--concrete); color: var(--graphite); }
.co-sec-on { display: flex; gap: 8px; align-items: flex-start; flex: 1; min-width: 0; cursor: pointer; }
.co-sec-on input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; }
.co-sec-on span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.co-sec-on strong { white-space: nowrap; }
.co-sec-on small { color: var(--steel); font-size: 12px; line-height: 1.35; }
.co-sec-pb { font-size: 12.5px; color: var(--steel); display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.co-sec-move { display: inline-flex; }
.co-sec-move .icon-btn { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; }
.co-sec-move .icon-btn:disabled { opacity: 0.3; }
.co-sec-set { border-top: 1px solid var(--rule); padding: 10px 12px 12px 34px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.co-sec-set .field { margin: 0; min-width: 160px; flex: 1 1 160px; }
.co-sec-set > .check { flex-basis: 100%; }
.co-sec-set .field.full { flex-basis: 100%; }
.co-sec-set textarea { width: 100%; font-size: 13px; }
.co-sec-set code { font-size: 11.5px; background: var(--concrete); padding: 0 4px; border-radius: 4px; }
.co-hero .row { gap: 8px; align-items: center; } .co-hero-thumb { margin-top: 6px; max-height: 70px; border-radius: 4px; border: 1px solid var(--rule); }
.co-paper .sfq.screen .sfq-sheet { margin-bottom: 14px; }
/* Terms library */
.co-terms { display: grid; grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.co-terms > * { min-width: 0; }
.co-terms-list { padding: 8px 0; margin: 0; position: sticky; top: 70px; }
.co-terms-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; color: var(--graphite); position: relative; text-decoration: none !important; }
.co-terms-item:hover { background: var(--concrete); }
.co-terms-item.active { background: var(--teal-wash); }
.co-terms-item.active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.co-terms-item small { color: var(--steel); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.co-terms-item.archived { opacity: 0.6; }
.co-terms-edit textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; min-height: 460px; }
.co-terms-facts { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--steel); margin: 2px 0 12px; }
.co-terms-facts strong { color: var(--graphite); font-family: var(--font-display); }
.co-terms-legal { font-size: 13px; background: #FFF8DB; border: 1px solid #EAD37A; border-radius: 6px; padding: 8px 12px; margin-bottom: 14px; color: var(--graphite); }
.co-terms-prev .co-paper { padding: 0; }
.co-terms-prev .sfdoc { max-width: none; }
.co-terms-prev .sfmd { font-size: 12px; line-height: 1.55; }
@media (max-width: 1300px) { .co-terms { grid-template-columns: 240px minmax(0, 1fr); } .co-terms-prev { grid-column: 1 / -1; } }
@media (max-width: 900px) { .co-terms { grid-template-columns: 1fr; } .co-terms-list { position: static; } }

.co-tpl:has(.co-secs) { grid-template-columns: 190px minmax(0, 1.1fr) minmax(0, 1fr); }
.co-sec-set { gap: 2px 18px; }
.co-sec-set .check, .co-sec-set .co-sec-pb { padding: 3px 0; font-size: 13.5px; color: var(--graphite); }
