:root {
  --bg: #f5f5f4; --panel: #fff; --ink: #1c1917; --muted: #78716c; --line: #e7e5e4; --soft: #fafaf9;
  --accent: #1d4ed8; --accent-soft: #dbeafe;
  --warn: #b45309; --warn-soft: #fef3c7; --ok: #047857; --ok-soft: #d1fae5;
  --bad: #b91c1c; --bad-soft: #fee2e2; --purple: #6d28d9; --purple-soft: #ede9fe; --sky: #0369a1; --sky-soft: #e0f2fe;
  --note: #fffbeb; --note-line: #fde68a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
input, select, textarea { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; background: #fff; min-width: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: #93c5fd; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .pad { padding: 10px 0; } .center { text-align: center; margin-top: 14px; }
.grow { flex: 1; } .full { width: 100%; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.tight { gap: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* buttons, pills, chips */
.btn { border: 1px solid var(--line); background: var(--panel); padding: 7px 13px; border-radius: 8px; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 20px; padding: 11px; }
.btn:disabled { opacity: .6; cursor: default; }
.link { background: none; border: none; color: var(--muted); padding: 3px 6px; font-size: 13px; }
.link:hover { color: var(--ink); } .link.on { color: var(--ink); font-weight: 600; } .link.danger { color: var(--bad); margin-top: 10px; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.fac { background: #f0efed; color: var(--ink); font-weight: 500; } .pill.fac.muted { color: var(--muted); }
.pill.client { background: var(--sky-soft); color: var(--sky); }
.st-quote { background: var(--sky-soft); color: var(--sky); } .st-sampling { background: var(--warn-soft); color: var(--warn); }
.st-approved { background: var(--purple-soft); color: var(--purple); } .st-production { background: #fce7f3; color: #9d174d; }
.st-shipped { background: #e0e7ff; color: #3730a3; } .st-delivered { background: var(--ok-soft); color: var(--ok); }
.st-cancelled { background: var(--bad-soft); color: var(--bad); }
.wait-me { background: var(--bad-soft); color: var(--bad); } .wait-other { background: #f0efed; color: var(--muted); font-weight: 500; }
.badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; margin-left: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; } .chips.tight { margin: 0 0 10px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 11px; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { background: var(--panel); padding: 32px; border-radius: 14px; width: 100%; max-width: 360px; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05); }
.login h1 { margin: 0 0 4px; font-size: 22px; } .login p { margin: 0 0 20px; color: var(--muted); }
.login label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.login input { width: 100%; padding: 10px 12px; } .login .err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 10px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 0 18px; height: 52px; background: var(--ink); color: #fff; }
.brand { font-weight: 700; color: #fff; white-space: nowrap; } .brand span { opacity: .55; font-weight: 500; margin-left: 6px; }
.top nav { display: flex; gap: 2px; }
.nav { color: #d6d3d1; padding: 6px 11px; border-radius: 7px; font-size: 14px; white-space: nowrap; }
.nav:hover { color: #fff; } .nav.on { background: rgba(255,255,255,.12); color: #fff; }
.top .link { color: #d6d3d1; } .top .link.on { color: #fff; }
.menu { position: relative; } .menu-btn { font-size: 17px; }
.menu-pop { position: absolute; right: 0; top: 38px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); min-width: 200px; overflow: hidden; }
.menu-pop button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 10px 14px; }
.menu-pop button:hover { background: var(--bg); } .menu-who { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }

/* page */
.page { max-width: 1320px; margin: 0 auto; padding: 18px 18px 60px; }
.page-reminders .narrow, .narrow { max-width: 760px; margin: 0 auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 220px; max-width: 360px; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel h3 { margin: 0; font-size: 15px; } .panel h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 3px; }
.field input, .field select, .field textarea { width: 100%; } .field .ro { padding: 6px 0; }
.field.inline { display: flex; align-items: center; gap: 6px; } .field.inline label { margin: 0; } .field.inline input { width: auto; }

/* project list */
.group { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.group-h { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--soft); border-bottom: 1px solid var(--line); color: var(--ink); }
a.group-h:hover b { text-decoration: underline; }
.prow { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); align-items: center; }
.prow:last-child { border-bottom: none; } .prow:hover { background: var(--soft); }
.prow-main { flex: 1; min-width: 0; } .prow-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-name .sub { color: var(--muted); font-weight: 400; }
.meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; }

/* board */
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; margin-top: 12px; padding-bottom: 8px; }
.col { background: #ecebe9; border-radius: 12px; padding: 10px; min-height: 200px; }
.col-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card { display: block; background: #fff; border-radius: 10px; padding: 9px 10px; margin-bottom: 8px; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); } .card-name { font-weight: 600; font-size: 13.5px; }

/* dashboard */
.dstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.dstat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); }
.dstat:hover { border-color: #d6d3d1; } .dstat-n { font-size: 24px; font-weight: 700; }
.dstat.hot { background: var(--bad-soft); border-color: #fecaca; } .dstat.hot .dstat-n { color: var(--bad); }
.dstat.warnv .dstat-n { color: var(--warn); font-size: 19px; }
.dlist { margin: 0 -16px; }
.drow { display: flex; gap: 10px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.drow:hover { background: var(--soft); } .drow-date { text-align: right; font-size: 13px; white-space: nowrap; }
.timeline { margin: 0 -16px; }
.tl-row { display: flex; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.tl-row:hover { background: var(--soft); } .tl-row.late .tl-date b { color: var(--bad); }
.tl-date { width: 76px; flex-shrink: 0; }

/* project page */
.phead { margin-bottom: 14px; }
.crumb, .crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.phead h1 { margin: 6px 0 10px; font-size: 22px; }
.title-input { font-size: 21px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 3px 6px; margin: 4px 0 8px -6px; width: 100%; max-width: 640px; }
.title-input:hover { border-color: var(--line); background: #fff; }
.title-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .title-row .title-input { flex: 1; }
.fac-select { font-weight: 600; }
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; } .tbl .num { text-align: right; white-space: nowrap; }
.tbl.click tbody tr { cursor: pointer; } .tbl.click tbody tr:hover { background: var(--soft); }
.tbl tr.sel td { background: var(--ok-soft); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0; }
.stat { background: var(--soft); border-radius: 9px; padding: 8px 10px; }
.stat-v { font-weight: 700; font-size: 15px; } .stat.pos .stat-v { color: var(--ok); } .stat.neg .stat-v { color: var(--bad); } .stat.warn .stat-v { color: var(--warn); }
.ledger-add { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; } .ledger-add input { width: 110px; flex: 1 1 100px; }
select.mini { padding: 2px 6px; font-size: 12.5px; border-radius: 6px; }
select.ok { background: var(--ok-soft); color: var(--ok); } select.due { background: var(--warn-soft); color: var(--warn); }

/* product page */
.stepper { display: flex; gap: 4px; margin: 8px 0 12px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px 4px 5px; font-size: 13px; color: var(--muted); }
.step .dot { width: 20px; height: 20px; border-radius: 50%; background: #f0efed; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.step.past { color: var(--ok); } .step.past .dot { background: var(--ok-soft); color: var(--ok); }
.step.cur { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; } .step.cur .dot { background: #fff; color: var(--ink); }
.step:disabled { cursor: default; }
.fields { display: flex; flex-wrap: wrap; gap: 10px; }
.fields > .field { flex: 1 1 150px; min-width: 150px; }
.siblings { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.product-cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.thread-col { position: sticky; top: 66px; }
.thread-panel { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 86px); min-height: 420px; overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 7px 12px; color: var(--muted); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); } .tab.internal.on { border-bottom-color: #d97706; }
.thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: min(560px, 88%); align-self: flex-start; } .msg.mine { align-self: flex-end; }
.msg .who { font-size: 12px; color: var(--muted); margin: 0 4px 3px; } .msg.mine .who { text-align: right; }
.bubble { background: #fff; border: 1px solid var(--line); padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.msg.mine .bubble { background: var(--accent); color: #fff; border-color: var(--accent); }
.msg.note .bubble { background: var(--note); color: var(--ink); border-color: var(--note-line); }
.msg.auto .bubble { background: #f0f9ff; color: var(--ink); border: 1px dashed #7dd3fc; }
.bubble .tag { background: rgba(29,78,216,.12); border-radius: 4px; padding: 0 3px; } .msg.mine .bubble .tag { background: rgba(255,255,255,.25); }
.msg .tr { font-size: 13px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(127,127,127,.4); }
.msg .tools { font-size: 12px; margin: 2px 4px; }
.event { align-self: center; font-size: 12px; color: var(--muted); background: #e9e8e6; border-radius: 999px; padding: 3px 12px; max-width: 92%; text-align: center; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .msg.mine .atts { justify-content: flex-end; }
.att-img { width: 150px; height: 112px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
.att-file { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; color: var(--ink); max-width: 260px; }
.att-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; background: #fff; }
.composer.internal { background: var(--note); } .composer.drag { outline: 2px dashed var(--accent); outline-offset: -6px; }
.composer .row { align-items: flex-end; } .composer textarea { flex: 1; resize: none; max-height: 160px; border-radius: 10px; }
.pending { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; } .pending b { cursor: pointer; font-weight: 400; }
.tagbox { display: flex; gap: 6px; flex-wrap: wrap; } .tagbox:not(:empty) { margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pack { display: flex; flex-direction: column; gap: 6px; }
.pack-row { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.pack-row.s-na { opacity: .55; } .pack-row.s-confirmed { background: #f6fef9; border-color: #bbf7d0; } .pack-row.s-needed { border-left: 3px solid var(--warn); }
.pack-top { display: flex; align-items: center; gap: 8px; } .pack-name { flex: 1; font-weight: 500; }
select.s-needed { background: var(--warn-soft); color: var(--warn); } select.s-sent { background: var(--sky-soft); color: var(--sky); }
select.s-confirmed { background: var(--ok-soft); color: var(--ok); }
.pack-files { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; } .pack-row textarea { margin-top: 6px; }
.filesgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.fcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: var(--ink); }
.fcard .thumb { height: 86px; background: var(--soft); display: grid; place-items: center; font-size: 13px; color: var(--muted); font-weight: 700; }
.fcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.fcard .info { padding: 6px 8px; font-size: 11.5px; color: var(--muted); }
.fcard .info b { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* reminders */
.remform { display: flex; flex-direction: column; gap: 8px; } .remform .grow-input { flex: 1; }
.check { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; }
.remlist { display: flex; flex-direction: column; }
.rem { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rem:last-child { border-bottom: none; } .rem-main { flex: 1; } .rem.done .rem-main { text-decoration: line-through; color: var(--muted); }
.rem.over .rem-main .muted { color: var(--bad); }

/* modals */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; padding: 20px; }
.modal h3 { margin: 0 0 14px; } .modal .field { margin-bottom: 10px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.prod-row { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; margin-bottom: 6px; }
.notice { background: var(--ok-soft); color: var(--ok); padding: 10px; border-radius: 8px; font-size: 14px; margin: 10px 0; word-break: break-all; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 60; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 94vh; }

@media (max-width: 900px) {
  .cols2, .product-cols { grid-template-columns: 1fr; }
  .thread-col { position: static; } .thread-panel { height: 70vh; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .page { padding: 12px 10px 50px; }
  .top { gap: 8px; padding: 0 10px; } .brand span { display: none; } .nav { padding: 6px 7px; font-size: 13px; }
  .grid3, .grid2 { grid-template-columns: 1fr; } .prod-row { grid-template-columns: 1fr 1fr; }
  .msg { max-width: 94%; } .board { grid-template-columns: repeat(6, 78vw); }
}

.field:has(.checkin) { grid-column: span 2; } .checkin select { flex: 1; min-width: 120px; }
@media (max-width: 640px) { .field:has(.checkin) { grid-column: auto; } }
.remform .row { flex-wrap: wrap; } .remform .grow-input { min-width: 160px; }
.cols2 > div, .product-cols > div { min-width: 0; }
@media (max-width: 640px) { .remform input[type=datetime-local] { flex: 1 1 100%; } }
.top nav { min-width: 0; overflow-x: auto; scrollbar-width: none; } .top nav::-webkit-scrollbar { display: none; }
.checkin { flex-wrap: wrap; }
@media (max-width: 640px) { .top .grow { display: none; } .top nav { flex: 1; } }

.pill.s-needed { background: var(--warn-soft); color: var(--warn); } .pill.s-sent { background: var(--sky-soft); color: var(--sky); }
.pill.s-confirmed { background: var(--ok-soft); color: var(--ok); } .pill.draft { background: #f0efed; color: var(--muted); font-weight: 500; margin-left: 6px; }
.pack-action { margin-top: 6px; display: flex; justify-content: flex-end; }
.pack-row.s-sent { background: #f5fbff; border-color: #bae6fd; }

.qcbox { margin-top: 6px; } .qc { margin-top: 6px; padding: 7px 10px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.qc-match { background: var(--ok-soft); color: var(--ok); } .qc-over, .qc-under { background: var(--bad-soft); color: var(--bad); }

.closed-banner { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #f0efed; border-radius: 10px; padding: 10px 14px; margin: 8px 0 12px; }
.closed-banner .btn { margin-left: auto; } .close-row { margin: -6px 0 8px; } .close-row .link { color: var(--muted); }

.qcompare td.best { color: var(--ok); font-weight: 700; } .qcompare th.selcol { color: var(--ok); }
.tbl tr.curqty td { background: var(--accent-soft); } td.pos { color: var(--ok); }
.qrequest { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.qform input { width: 120px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 5px 12px; } .seg button.on { background: var(--ink); color: #fff; }

input.missing, textarea.missing { border-color: #f87171; background: #fff7f7; }
.miss { color: var(--bad); font-weight: 600; white-space: nowrap; }
.qstatus { margin: 8px 0; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.qstatus.bad { background: var(--bad-soft); color: var(--bad); } .qstatus.ok { background: var(--ok-soft); color: var(--ok); }

.prod-block { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.prod-block .prod-row { margin-bottom: 6px; }
.art-drop { border: 1.5px dashed #d6d3d1; border-radius: 8px; padding: 10px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.art-drop:hover, .art-drop.drag, .artbox.drag { border-color: var(--accent); background: var(--accent-soft); }
.art-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .art-list b { cursor: pointer; font-weight: 400; }
.art-warn { color: var(--warn); font-size: 12.5px; margin-top: 6px; } .art-warn:empty { display: none; }
.artbox { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-bottom: 12px; }
.artbox.empty { border: 1.5px dashed #fbbf24; background: #fffbeb; }

.icon-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 7px; color: var(--muted); font-size: 14px; opacity: .55; }
.group-h:hover .icon-btn { opacity: 1; } .icon-btn:hover { border-color: #fecaca; background: var(--bad-soft); }
.btn.danger-btn { color: var(--bad); border-color: #fecaca; } .btn.danger-btn:hover { background: var(--bad-soft); }
.title-row .danger-btn { margin-left: auto; }

.fac-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 8px; } .warnc { color: var(--warn); }

.brief-in { margin-bottom: 8px; }
.brief { margin-top: 12px; background: #fffbeb; border: 1px solid var(--note-line); border-radius: 10px; padding: 8px 10px; }
.brief label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--warn); font-weight: 700; display: block; margin-bottom: 4px; }
.brief textarea { background: #fff; } .brief-text { white-space: pre-wrap; line-height: 1.45; }

.handled-btn { color: var(--ok); border-color: #bbf7d0; } .handled-btn:hover { background: var(--ok-soft); }
.tick-btn { order: 9; margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 7px; width: 30px; height: 28px; color: var(--ok); font-weight: 700; flex-shrink: 0; }
.tick-btn:hover { background: var(--ok-soft); border-color: #86efac; }

.drow.attn { align-items: flex-start; } .drow.attn > .pill { margin-top: 2px; min-width: 132px; text-align: center; }
.attn-detail { font-size: 13.5px; margin-top: 3px; line-height: 1.45; color: #44403c; }
@media (max-width: 640px) { .drow.attn { flex-wrap: wrap; } .drow.attn > .pill { min-width: 0; } }

.field.deadline label { color: var(--bad); font-weight: 700; } .field.deadline input { border-color: #fca5a5; }
.deadline-q { border: 1px solid #fecaca; background: #fff7f7; border-radius: 9px; padding: 8px 10px; margin-bottom: 10px; }
.deadline-q.missing { border-color: #f87171; box-shadow: 0 0 0 2px #fee2e2; }
.seg.big { margin: 6px 0; } .seg.big button { padding: 6px 18px; } .seg button.on.yes { background: var(--ok); } .seg button.on.no { background: var(--bad); }
.ok-txt { color: var(--ok); font-weight: 600; } tr.meetsrow td { background: #fffafa; }

.pill.asap { background: #fef9c3; color: #854d0e; }

.brief-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.info { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #e7e5e4; color: #57534e;
  font: italic 700 11px Georgia, serif; text-transform: none; letter-spacing: 0; cursor: help; vertical-align: 1px; }
.info:hover, .info:focus, .info.open { background: var(--ink); color: #fff; outline: none; }
.info-pop { display: none; position: absolute; left: -8px; top: 22px; z-index: 40; width: min(320px, 80vw); background: var(--ink); color: #fff;
  font: 400 12.5px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; text-align: left;
  padding: 9px 11px; border-radius: 9px; box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: default; white-space: normal; }
.info:hover .info-pop, .info:focus .info-pop, .info.open .info-pop { display: block; }
.mini-label { font-size: 12px; color: var(--warn); font-weight: 700; margin: 2px 0 4px; }
.brief label { overflow: visible; }
/* quote comparison always fits its panel: wrap long text, keep prices on one line */
.qcompare { table-layout: fixed; }
.qcompare th:first-child, .qcompare td:first-child { width: 38%; }
.qcompare td, .qcompare th { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.qcompare td.num { text-align: right; }
.qcompare tr td .miss, .qcompare .ok-txt { white-space: normal; }
.tbl.qcompare td, .tbl.qcompare td.num, .tbl.qcompare th { white-space: normal; overflow-wrap: anywhere; }

.qcompare tr:has(td:first-child.muted) td.num.small:only-child { text-align: left; }

.upbar { position: relative; height: 18px; background: #eef2ff; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.upbar-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #93c5fd; transition: width .15s; }
.upbar-txt { position: relative; display: block; text-align: center; font-size: 11.5px; line-height: 18px; color: #1e3a8a; font-weight: 600; }
.brand::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #78716c; margin-left: 8px; vertical-align: 2px; }
body.live .brand::after { background: #22c55e; }

.order-banner { margin: 4px 0 10px; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.order-banner > div { flex-basis: 100%; } .order-banner .row { flex-basis: auto; }
.order-banner.todo { background: #f5f5f4; border: 1px dashed #d6d3d1; }
.order-banner.pending { background: var(--warn-soft); color: #78350f; border: 1px solid #fde68a; flex-direction: column; align-items: flex-start; }
.order-banner.counter { background: var(--bad-soft); color: #7f1d1d; border: 1px solid #fecaca; flex-direction: column; align-items: flex-start; }
.order-banner.ok { background: var(--ok-soft); color: #065f46; border: 1px solid #bbf7d0; }
.order-sum { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; padding: 8px 10px; background: var(--soft); border-radius: 8px; font-size: 13.5px; }
.order-sum .pos b { color: var(--ok); } .order-sum .neg b { color: var(--bad); }
/* sample requests */
.size-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; align-items: flex-end; }
.size-cell { display: flex; flex-direction: column; gap: 2px; width: 64px; }
.size-cell label { font-size: 12px; font-weight: 600; text-align: center; color: var(--muted, #666); }
.size-cell input { width: 100%; text-align: center; }
.size-grid .size-cell:has(input:not([type=number])) { width: 140px; flex-direction: row; }
.size-grid .size-cell:has(input:not([type=number])) input[type=number] { width: 56px; }
.size-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 4px; }
.sample-card { border: 1px solid var(--line, #e4e4e7); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.sample-card.latest { border-color: #c7d2fe; background: #f8faff; }
.sample-card.old { opacity: .75; }
.sample-card .pre { white-space: pre-wrap; }
.sample-card .changes { background: #fff7ed; border-radius: 6px; padding: 4px 6px; }
.sample-act { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line, #e4e4e7); }
.sample-act input[type=date] { max-width: 150px; }
.live-track { display:flex; align-items:center; gap:4px; flex-wrap:wrap; margin-top:4px; }
.field .addr-opt { display: flex; text-transform: none; letter-spacing: normal; font-size: 13px; font-weight: 400; color: inherit; margin: 0; }
.field .addr-opt.on { font-weight: 500; }
.addr-opt input[type=radio] { width: auto; flex: none; margin: 3px 0 0; padding: 0; }
.addr-pick { display: flex; flex-direction: column; gap: 6px; }
.field .addr-opt { align-items: flex-start; gap: 8px; border: 1px solid var(--line, #e4e4e7); border-radius: 8px; padding: 8px 10px; cursor: pointer; background: #fff; }
.field .addr-opt.on { border-color: #2563eb; background: #f5f8ff; }
.addr-opt .addr-text { white-space: pre-wrap; flex: 1; }
.addr-opt .link { opacity: .5; } .addr-opt .link:hover { opacity: 1; }
/* security */
.gate { align-items: flex-start; }
.gate-card { background: #fff; border-radius: 12px; padding: 22px 24px; max-width: 520px; width: 100%; box-shadow: 0 6px 24px rgba(0,0,0,.08); margin-top: 6vh; }
.gate-card h2 { margin: 14px 0 4px; font-size: 20px; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.qr img { width: 180px; height: 180px; margin: 8px 0; border: 1px solid var(--line, #e4e4e7); border-radius: 8px; image-rendering: pixelated; }
.secret { display: block; font-size: 13px; padding: 6px 8px; background: #f4f4f5; border-radius: 6px; margin-top: 4px; user-select: all; word-break: break-all; }
.code-input { font-size: 22px; letter-spacing: 6px; text-align: center; max-width: 180px; }
.recovery { background: #f4f4f5; padding: 10px 14px; border-radius: 8px; font-size: 15px; line-height: 1.7; columns: 2; user-select: all; }
.sec-list { list-style: none; padding: 0; margin: 4px 0 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.audit-wrap { max-height: 60vh; overflow: auto; margin: 8px 0; }
.warnrow td { background: #fff7ed; }
.users-tbl tr.inactive td { opacity: .55; }
.user-acts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-items: center; }
.inline-check { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.inline-check input { width: auto; }
.btn.danger { color: #b91c1c; border-color: #fecaca; }
.pw-fields .muted.small { margin: -4px 0 8px; }
.thread-links { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cemail { border: 1px solid var(--line, #e4e4e7); border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cemail.drafted { border-color: #fdba74; background: #fffbf5; }
.cemail.sent, .cemail.handled, .cemail.skipped { opacity: .7; }
.thread-links li.unconfirmed { background: #fffbf5; border: 1px solid #fdba74; border-radius: 8px; padding: 6px 8px; }
.confirm-thread { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.danger-zone { border: 1px solid #fecaca; border-radius: 8px; padding: 8px 12px; margin: 12px 0; } .danger-zone summary { cursor: pointer; color: #b91c1c; font-weight: 600; }
.att-wrap, .fcard { position: relative; }
.att-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 22px; padding: 0; cursor: pointer; opacity: 0; transition: opacity .15s; }
.att-wrap:hover .att-del, .fcard:hover .att-del { opacity: 1; }
@media (hover: none) { .att-del { opacity: .8; } }
.fb-read { background: #f8fafc; border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.cemail { align-items: stretch; text-align: left; }
.cq-tbl td { padding: 3px 4px; }
.cq-tbl input[type=checkbox] { width: auto; }
.cq-tbl .cq-label { width: 100%; min-width: 150px; }
.cq-tbl .cq-val { width: 100%; min-width: 200px; font-weight: 500; }
.cq-tbl tr.off input:not([type=checkbox]) { opacity: .45; }
.qcompare th .optname { font-weight: 600; color: var(--accent, #2563eb); font-size: 12px; }
.qcompare th.optcol, .qcompare td.optcol { border-right-style: dashed; }
.optform td input { width: 100%; min-width: 110px; }
.optform th { white-space: nowrap; }
.cq-tbl th input.cq-val { font-weight: 600; }
.pill.client { --cc: #64748b; background: color-mix(in srgb, var(--cc) 13%, #fff); color: color-mix(in srgb, var(--cc) 85%, #000); border: 1px solid color-mix(in srgb, var(--cc) 35%, #fff); }
.pill.client::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cc); margin-right: 5px; vertical-align: 1px; }
.client-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.client-pick select { min-width: 180px; }
.client-pick .cdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cswatch { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line, #ddd); border-radius: 6px; background: none; cursor: pointer; }
.fields > .field.deadline.wide { flex: 0 0 auto; }
.field.deadline.wide > label { white-space: nowrap; }
.deadline-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.deadline-row input[type=date] { flex: 0 0 auto; width: 150px; }
.field.deadline .asap-check { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--bad); text-transform: none; letter-spacing: 0; margin: 0; }
.field.deadline .asap-check input { width: auto; margin: 0; }
.qcompare .pickrow td { vertical-align: middle; white-space: nowrap; }
.qcompare .pickrow .btn { padding: 4px 9px; font-size: 12px; }
.qcompare .qhead-f { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.qcompare th.num, .qcompare td.num { min-width: 92px; }
.qcompare th .optname { white-space: normal; }
.qcompare .qremove { font-size: 11px; color: var(--muted, #999); padding: 0 2px; }
.qcompare .qremove:hover { color: var(--bad, #dc2626); }
.qcompare td:first-child, .qcompare th:first-child { min-width: 120px; }
.qcompare .pickrow td { padding-left: 4px; padding-right: 4px; }
.pricing-tbl th, .pricing-tbl td { padding-left: 6px; padding-right: 6px; }
.pricing-tbl th { white-space: normal; }
.pricing-tbl td:last-child { padding-right: 2px; text-align: right; }
.pricing-tbl td:last-child .btn { padding: 3px 9px; font-size: 12px; }
.order-banner .impact { flex-basis: 100%; background: #fff; color: var(--text, #111); border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.impact-tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.impact-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted, #777); font-weight: 600; padding: 3px 8px; }
.impact-tbl td { padding: 4px 8px; border-top: 1px solid #f1f1f1; }
.impact-tbl .num { text-align: right; white-space: nowrap; }
.impact-tbl .pos { color: #047857; } .impact-tbl .neg { color: #b91c1c; }
.inv-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line, #eee); flex-wrap: wrap; }
.inv-row:last-of-type { border-bottom: none; }
.inv-ship { margin-top: 8px; padding: 6px 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; border-radius: 6px; background: var(--soft, #f6f7f9); }
.inv-ship.warn { background: #fff7ed; color: #9a3412; }
.inv-warn { background: #fff7ed; color: #9a3412; padding: 6px 8px; border-radius: 6px; margin-bottom: 6px; }
.inv-line { border: 1px solid var(--line, #eee); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.logo-prev { max-height: 48px; max-width: 120px; border: 1px solid var(--line, #eee); border-radius: 4px; }
.ap-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.sc-piece { border: 1px solid var(--line, #eee); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.sc-grid th input { width: 110px; font-weight: 600; } .sc-grid td input { width: 76px; } .sc-grid th, .sc-grid td { padding: 4px; white-space: nowrap; }
.pack-spec { background: var(--soft, #f6f7f9); border-radius: 6px; padding: 6px 8px; margin-top: 6px; line-height: 1.5; white-space: pre-line; }
.pack-spec .spec-tag { margin-bottom: 4px; }
.bc-warn td { background: #fff4d6; }
.ship-addr { display: flex; flex-direction: column; gap: 4px; } .ship-addr input { width: 100%; }
.ship-grid th, .ship-grid td { padding: 3px; white-space: nowrap; font-size: 12px; } .ship-grid input { font-size: 12px; padding: 4px; }
.ship-sum { margin: 8px 0; } .warn-txt { color: #b45309; font-weight: 600; }
.sku-row td { background: #f6f7f9; }
.zh-flag { background: #fff4d6 !important; border-color: #f59e0b !important; }
