/* Shared workbench rhythm; retain the existing green identity and role-specific controls. */
:root{--ink:#172e28;--ink-soft:#566c62;--line:#dce6e0;--green:#15694e;--wash:#f4f7f5;color:var(--ink);background:var(--wash);font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif}
button,input,select,textarea{font-family:inherit}
button{line-height:1.45;font-weight:550;transition:background-color .14s,color .14s,box-shadow .14s}
button:not(:disabled):hover{filter:brightness(.96)}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #60a58a;outline-offset:2px}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #37856a;outline-offset:1px}
textarea{resize:vertical}
.actions{align-items:center}
.actions>button{align-self:center}
main>header{gap:20px}
main>header>div{min-width:0}
main>header h1{letter-spacing:-.035em;color:#18362d}
main>header>div:first-child>small{color:#687e72}
main>header #identity{max-width:65%;overflow-wrap:anywhere}
main .card{box-shadow:0 2px 7px #173b2805;border-color:#dfe8e2}
.stats .card{border-radius:12px;padding:20px 22px}
.stats .card>small{color:var(--ink-soft);font-weight:550}
.stats strong{font-variant-numeric:tabular-nums;line-height:1.12}
nav{gap:5px}nav button.active{box-shadow:inset 3px 0 #95d9b7}
th{color:#50675c;font-weight:600}td{line-height:1.55}
.muted{color:#65796e}
#app>.card>h2:first-child,.proc-head h2{margin-top:0;letter-spacing:-.025em}
html:has(dialog[open]){overflow:hidden}
@media(max-width:560px){main>header{flex-wrap:wrap;gap:8px}main>header #identity{max-width:100%}.stats .card{padding:14px 15px}nav button.active{box-shadow:inset 0 -2px #95d9b7}.toolbar{flex-wrap:wrap;gap:10px}.toolbar>input{max-width:100%}.toolbar .actions{margin:0}}
@media(prefers-reduced-motion:reduce){button{transition:none}}

/* Product sheet */
.draft-basics { align-items:start; }
.draft-basics .draft-image-field { grid-column:span 2; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:8px 12px; }
.draft-basics #pasteZone { margin:0; padding:8px 12px; }
.draft-measurements { margin:20px 0 16px; }
.draft-measurements h3 { margin:0; }
.draft-measurements > p { margin:4px 0 10px; color:var(--ink-soft); font-size:13px; }
.draft-measure-group { min-width:0; margin:8px 0 0; padding:6px 12px 12px; border:1px solid var(--line); border-radius:10px; background:#f7faf8; }
.draft-measure-group legend { padding:0 5px; font-size:13px; font-weight:650; color:var(--green); }
.draft-measure-row { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px 12px; align-items:end; }
.draft-measure-row label,.draft-measure-row input { min-width:0; }
@media (max-width:600px) {
  .draft-measure-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .draft-basics .draft-image-field { grid-column:1/-1; grid-template-columns:1fr; }
}

#modal:has(.pd-sheet){padding:0;width:min(740px,calc(100vw - 32px));max-height:min(88vh,960px);max-height:min(88dvh,960px);color:var(--ink);border:1px solid #d9e4dd;border-radius:18px;box-shadow:0 24px 80px #102a2540;overscroll-behavior:contain}
#modal:has(.pd-sheet)::backdrop{background:#0b201bb3}
#modal:has(.pd-sheet)>button{display:none}
.pd-sheet{min-width:0;background:#f6f8f6;font-size:14px;line-height:1.5}
.pd-sheet h2,.pd-sheet h3,.pd-sheet h4,.pd-sheet p,.pd-sheet dl,.pd-sheet dd{margin:0}
.pd-sheet [hidden]{display:none!important}
.pd-sheet svg{width:19px;height:19px;flex:none}
.pd-bar{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;padding:10px 22px;border-bottom:1px solid var(--line);background:#fff}
.pd-bar>span{display:flex;align-items:center;gap:9px;font-weight:650;color:#466458;font-size:13px}
.pd-close{display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--line);background:#fff;color:#506559}
.pd-content{display:grid;gap:12px;padding:18px 20px 22px}
.pd-summary,.pd-task,.pd-fold,.pd-branches{min-width:0;border:1px solid var(--line);border-radius:12px;background:white}
.pd-summary,.pd-task,.pd-branches{padding:18px 20px}
.pd-hero{display:flex;align-items:center;gap:16px}
.pd-thumb{width:78px;height:78px;object-fit:contain;background:#f6f8f6;border:1px solid var(--line);border-radius:10px;flex:none}
.pd-placeholder{display:grid;place-items:center;color:#93a59b}
.pd-placeholder svg{width:30px;height:30px}
.pd-identity{min-width:0;overflow-wrap:anywhere}
.pd-identity h2{margin:6px 0 2px;line-height:1.35;letter-spacing:-.025em;font-size:21px}
.pd-identity p,.pd-identity a{font-size:12px}
.pd-identity p{color:var(--ink-soft)}
.pd-identity p:empty{display:none}
.pd-identity a{display:inline-block;margin-top:4px;text-underline-offset:3px}
.pd-status{display:flex;align-items:center;gap:4px 12px;flex-wrap:wrap}
.pd-status .task-time{margin:0;font-size:12px}
.pd-pill{background:#e6f4ec;color:#196047;font-size:11px;line-height:1.6;font-weight:650;border-radius:6px;padding:3px 8px}
.pd-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.pd-summary .pd-metrics{border-top:1px solid #e7eee9;margin-top:15px;padding-top:13px}
.pd-metrics dt{color:var(--ink-soft);font-size:12px}
.pd-metrics dd{font-size:19px;font-weight:650;line-height:1.35;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.pd-metrics dd small{font-size:11px;font-weight:450;color:var(--ink-soft);margin-left:4px;white-space:nowrap}
.pd-summary .notice{margin-top:14px}
.pd-task h3,.pd-branches>h3{font-size:17px;line-height:1.4;letter-spacing:-.01em}
.pd-task h3{display:flex;gap:8px;align-items:center}
.pd-task h3:before{content:"";width:3px;height:16px;border-radius:5px;background:#3b9774}
.pd-task-buttons,.pd-review-footer{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:15px}
.pd-task-buttons button,.pd-review-footer button{min-height:38px;line-height:1.4;padding:9px 15px}
.pd-task .danger{background:#fff1eb;color:#8e4734;border:1px solid #ebc8bb}
.pd-fields{display:grid;gap:12px;margin-top:14px}
.pd-fields>label:has(input[type=number]),.pd-fields>label:has(input[type=date]){max-width:260px}
.pd-note{color:var(--ink-soft);overflow-wrap:anywhere}
.shipping-date-line {display:flex;align-items:end;flex-wrap:wrap;gap:8px}
.shipping-date-line label {flex:1 1 145px;max-width:260px;min-width:0}
.shipping-date-line button {min-height:38px}
.shipping-picker {width:min(570px,94vw);max-height:86dvh;padding:20px;border:1px solid var(--line);border-radius:14px;color:var(--ink);box-shadow:0 18px 54px #102a2540}
.shipping-picker[open] {display:flex;flex-direction:column;gap:12px}
.shipping-picker::backdrop {background:#102a2573}
.shipping-picker-header h2,.shipping-picker p {margin:0}
.shipping-picker-header p,.shipping-picker [data-status] {color:var(--ink-soft);font-size:13px}
.shipping-picker-tools {display:flex;align-items:end;gap:12px;flex-wrap:wrap}
.shipping-picker-tools>label:first-child {flex:1 1 190px}
.shipping-picker label.shipping-check,.shipping-picker label.shipping-pick-row {display:flex;align-items:center;gap:10px}
.shipping-picker input[type=checkbox] {width:16px;height:16px;margin:0;flex:none}
.shipping-check {min-height:38px;white-space:nowrap}
.shipping-picker-list {overflow:auto;min-height:48px;max-height:44dvh;overscroll-behavior:contain;border-block:1px solid var(--line)}
.shipping-pick-row {padding:9px 4px;cursor:pointer}
.shipping-pick-row+.shipping-pick-row {border-top:1px solid var(--line)}
.shipping-pick-row img {width:42px;height:42px;object-fit:contain}
.shipping-pick-row strong,.shipping-pick-row small {display:block;overflow-wrap:anywhere}
.shipping-pick-row strong {color:var(--ink);font-size:14px}
.shipping-pick-row small {color:var(--ink-soft)}
.shipping-picker-actions {display:flex;justify-content:end;gap:8px}
.pd-task .pd-note{margin-top:9px}
.pd-match{display:flex;gap:10px;align-items:center}.pd-match img{width:52px;height:52px;object-fit:contain}.pd-match small{display:block}
.pd-review fieldset{margin:14px 0 0;padding:0;min-width:0;border:0}
.pd-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pd-choice{position:relative;display:flex;align-items:center;gap:10px;padding:13px 30px 13px 12px;min-width:0;border:1px solid #d5e0d8;border-radius:9px;cursor:pointer;background:#fff;color:var(--ink)}
.pd-choice strong,.pd-choice small{display:block;line-height:1.45}
.pd-choice strong{font-size:14px;font-weight:650}
.pd-choice small{margin-top:3px;color:var(--ink-soft);font-size:12px}
.pd-choice-symbol{display:grid;place-items:center;width:29px;height:29px;flex:none;border-radius:8px;background:#ebf5ef;color:#246849}
.pd-choice:nth-child(2) .pd-choice-symbol{background:#faf0e7;color:#975d33}
.pd-choice-symbol svg{width:17px;height:17px}
.pd-choice input{position:absolute;right:11px;top:14px;width:15px;height:15px;margin:0;padding:0;accent-color:var(--green)}
.pd-choice:has(:checked){background:#f0f8f3;border-color:#3e8e6e;box-shadow:0 0 0 1px #3e8e6e}
.pd-choice:nth-child(2):has(:checked){background:#fff8f1;border-color:#b47848;box-shadow:0 0 0 1px #b47848}
.pd-choice:nth-child(2) input{accent-color:#986034}
.pd-choice:has(:focus-visible){outline:2px solid #43866f;outline-offset:3px}
.pd-reason{margin-top:14px}
.pd-reason label{display:flex;align-items:center;gap:7px;color:var(--ink);font-weight:600}
.pd-reason label small{color:var(--ink-soft);font-weight:400}
.pd-reason textarea{display:block;margin:6px 0 2px;min-height:70px;line-height:1.55}
.pd-reason>small{display:block;text-align:right;color:#64766e}
.pd-review-footer{justify-content:space-between;border-top:1px solid #e8eee9;padding-top:12px}
.pd-review-footer span{font-size:12px;color:var(--ink-soft)}
.pd-review-footer button:disabled{background:#e5ebe7;color:#65766c;opacity:1}
.pd-task [data-action-error]{margin-top:10px;color:#9b422d;font-size:13px}
.pd-fold summary{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;list-style:none;padding:13px 17px;cursor:pointer;border-radius:12px}
.pd-fold summary::-webkit-details-marker{display:none}
.pd-fold summary small{color:#557061;background:#eef3ef;border-radius:5px;padding:1px 6px;font-weight:500}
.pd-fold summary:after{content:"";width:7px;height:7px;border-right:1.5px solid #728479;border-bottom:1.5px solid #728479;transform:rotate(45deg);margin:-3px 2px 0 auto;flex:none}
.pd-fold[open]>summary:after{transform:rotate(225deg);margin-top:4px}
.pd-fold-body{padding:0 17px 16px;min-width:0;overflow-x:auto;overflow-wrap:anywhere}
.pd-fold-body>.card,.pd-branches .card{padding:14px;margin:12px 0 0;box-shadow:none}
.pd-fold-body h3,.pd-fold-body h4,.pd-branches .card h3{font-size:15px;margin:0 0 9px}
.pd-fold-body p,.pd-fold-body label,.pd-branches label{margin:7px 0}
.pd-fold-body table{font-variant-numeric:tabular-nums}
.pd-fold-body th,.pd-fold-body td{padding:9px 8px}
.pd-profit{grid-template-columns:repeat(3,minmax(0,1fr));background:#edf6ef;border-radius:8px;padding:12px}
.pd-history{list-style:none;margin:3px 0 0;padding:0}
.pd-history li{position:relative;display:flex;align-items:baseline;justify-content:space-between;gap:4px 12px;padding:4px 0 10px 18px;font-size:13px;overflow-wrap:anywhere}
.pd-history li:before{content:"";position:absolute;left:1px;top:11px;width:7px;height:7px;background:#b8cac0;border-radius:50%}
.pd-history li:first-child:before{background:#277451}
.pd-history li:not(:last-child):after{content:"";position:absolute;left:4px;top:19px;bottom:-9px;width:1px;background:#dce6e0}
.pd-history time{color:var(--ink-soft);font-size:12px;white-space:nowrap}
@media(max-width:600px){#modal:has(.pd-sheet){width:calc(100vw - 12px);max-width:none;max-height:94dvh;border-radius:14px}.pd-bar{padding:7px 13px}.pd-content{padding:10px;gap:9px}.pd-summary,.pd-task,.pd-branches{padding:14px}.pd-hero{gap:10px}.pd-thumb{width:58px;height:58px}.pd-identity h2{font-size:17px}.pd-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.pd-profit{grid-template-columns:repeat(3,minmax(0,1fr))}.pd-metrics dd{font-size:17px}.pd-review fieldset{margin-top:10px}.pd-choices{grid-template-columns:1fr;gap:7px}.pd-choice{padding:9px 32px 9px 10px}.pd-choice small{margin-top:1px}.pd-review-footer{gap:7px}.pd-review-footer button{min-height:44px}.pd-history li{flex-wrap:wrap}.pd-fold summary{padding:12px 14px}.pd-close{width:40px;height:40px}}

.stats .stat-shortcut{position:relative;display:block;min-width:0;width:100%;text-align:left;color:var(--ink);background:#fff;padding-right:38px;cursor:pointer}
.stats .stat-shortcut small{display:block}
.stats .stat-shortcut>span{position:absolute;top:18px;right:17px;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;color:#37715b;background:#edf5ef;font-size:14px}
.stats .stat-shortcut:hover,.stats .stat-shortcut:focus-visible{background:#f7fbf8;border-color:#7fb79a;filter:none}
.stats .stat-shortcut:active{background:#eef6f0}
@media(max-width:560px){.stats .stat-shortcut{padding-right:34px}.stats .stat-shortcut>span{right:9px;top:12px;width:20px;height:20px}}

.sale-filter-area {
  container-type: inline-size;
  margin: 20px 0 16px;
}
.sale-filter-bar {
  display: flex;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border: 1px solid #dfe8e2;
  border-radius: 10px;
  background: #f6f9f7;
}
.sale-filter-field { flex: 1 1 0; min-width: 0; gap: 6px; font-weight: 600; color: #455e51; }
.sale-filter-bar :is(input, select) {
  height: 40px;
  min-width: 0;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
}
.sale-filter-bar :is(input, select).is-filtered { border-color: #80ac96; background-color: #f4fbf6; color: #175d44; }
.sale-filter-query { position: relative; flex: 1.65 1 85px; }
.sale-filter-query input { padding-left: 35px; }
.sale-filter-query::before, .sale-filter-query::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.sale-filter-query::before {
  bottom: 15px;
  left: 12px;
  width: 9px;
  height: 9px;
  border: 1.5px solid #678273;
  border-radius: 50%;
}
.sale-filter-query::after {
  bottom: 13px;
  left: 22px;
  width: 6px;
  height: 1.5px;
  background: #678273;
  transform: rotate(45deg);
}
.sale-filter-bar .sale-filter-reset {
  flex: none;
  justify-self: start;
  height: 40px;
  padding: 0 13px;
  white-space: nowrap;
  color: #205d47;
  border: 1px solid #c8d9ce;
  background: white;
}
.sale-filter-reset:disabled { opacity: .62; }
@container (max-width: 880px) {
  .sale-filter-bar { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@container (520px < width <= 880px) {
  .sale-filter-query { grid-column: 1 / -1; }
  .sale-filter-bar:has([data-owner]) .sale-filter-query { grid-column: 2 / -1; }
}
@container (max-width: 520px) {
  .sale-filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 12px; }
  .sale-filter-query { grid-column: 1 / -1; }
}

.full-tasks-panel .full-search-label { width: min(100%, 420px); min-width: 0; }
.full-search-label textarea { width: 100%; box-sizing: border-box; min-height: 4.5em; line-height: 1.45; resize: vertical; }
.full-task-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.full-task-heading h3 { margin: 0; }
.full-task-heading button[data-reserve-all] { color: #155b43; background: #edf6f1; border: 1px solid #77a990; white-space: nowrap; }
.full-task-heading button[data-reserve-all]:enabled:hover { background: #daeee2; }
.full-select-groups { display: grid; gap: 8px; margin-block: 16px; }
.full-select-groups button { text-align: start; }
.search-last { align-items: end; flex-wrap: wrap; }
.search-last > :last-child { margin-inline-start: auto; }
.search-last > input[type=search], .search-last > label:has(input[type=search]) {
  min-width: min(210px,100%);
  max-width: min(380px,100%);
  flex: 1 1 230px;
}
.search-last > select { width: auto; max-width: 100%; }
.toolbar:has(.actions:only-child) { justify-content: flex-end; }
.toolbar:has([data-inbox-type]) { justify-content:flex-start; align-items:end; gap:12px; }
.toolbar:has([data-inbox-type]) label { min-width:min(200px,100%); }
.toolbar:has([data-inbox-type]) .actions { margin:0; }
#app .card[hidden], #app .proc-item[hidden], #app label[hidden] { display:none; }
@media (max-width:560px) {
  .search-last > input[type=search], .search-last > label:has(input[type=search]) {
    flex-basis: 100%; max-width: 100%; width: 100%; margin-inline-start: 0;
  }
}

.inbox-batch-tools { flex-wrap: wrap; margin: 0 0 12px; }
.inbox-batch-tools[hidden], .inbox-batch-form fieldset[hidden] { display: none; }
.inbox-batch-form .proc-list { margin-block: 14px; }
.inbox-batch-form .proc-check small { display: block; margin-top: 4px; }
.inbox-batch-form fieldset { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
