/* Dedicated production workbook editor: all palette and font values come from design-tokens.css */
.order-workspace { max-width: 1440px; width: 100%; margin: 0 auto; padding-top: 28px; }
.order-heading { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-bottom:22px; }
.order-heading h1 { margin:6px 0; font-family:var(--font-title); font-weight:900; font-size:clamp(24px,2.3vw,34px); letter-spacing:-.02em; overflow-wrap:anywhere; }
.order-heading p, .order-overline { color:var(--muted); font-size:12px; }
.order-overline { font-weight:700; color:var(--accent); letter-spacing:.08em; }
.order-panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:24px; }
.order-panel-top { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:20px; }
.order-panel-top h2 { font:900 24px/1.1 var(--font-title); }
.order-panel-top p { color:var(--muted); font-size:11px; margin-top:6px; overflow-wrap:anywhere; }
.order-header-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; max-width:700px; padding-bottom:24px; }
.order-header-fields label { display:grid; gap:8px; font-size:12px; font-weight:600; }
.order-header-fields input { width:100%; background:var(--field); color:var(--text); border:1px solid var(--border); border-radius:var(--radius-control); padding:10px 12px; min-height:40px; font:inherit; font-weight:400; }
.order-header-fields input:focus, .production-table input:focus { outline:2px solid var(--focus); border-color:var(--accent); }
.order-table-header { display:flex; align-items:baseline; flex-wrap:wrap; gap:12px; justify-content:space-between; margin-bottom:13px; }
.order-table-header h3 { font:900 19px/1.1 var(--font-title); }
.order-table-header span { color:var(--muted); font-size:12px; }
.order-table-scroll { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius-control); }
.production-table { width:100%; border-collapse:collapse; min-width:900px; table-layout:fixed; }
.production-table th { text-align:left; color:var(--text-soft); background:var(--surface-muted); text-transform:uppercase; letter-spacing:.045em; font-size:10px; font-weight:700; padding:14px 10px; border-bottom:1px solid var(--border); }
.production-table td { border-bottom:1px solid var(--border); padding:8px 5px; }
.production-table tbody tr:last-child td { border-bottom:0; }
.production-table td:first-child, .production-table th:first-child { width:60px; text-align:center; color:var(--muted); }
.production-table th:nth-child(2) { width:18%; }
.production-table th:nth-child(3) { width:16%; }
.production-table th:nth-child(4) { width:15%; }
.production-table th:nth-child(5) { width:11%; }
.production-table th:nth-child(7) { width:42px; }
.production-table input { background:transparent; border:1px solid transparent; border-radius:5px; color:var(--text); width:100%; min-width:0; padding:9px 7px; font-size:13px; transition:background .12s ease,border-color .12s ease; }
.production-table input:hover { background:var(--surface-muted); }
.production-table input:focus { background:var(--field); }
.order-pos { font-variant-numeric:tabular-nums; font-size:12px; }
.order-remove { background:transparent; color:var(--muted); border:0; border-radius:6px; padding:6px 10px; cursor:pointer; font-size:19px; }
.order-remove:hover { background:var(--negative-bg); color:var(--negative); }
.order-rows-tools { display:flex; align-items:center; flex-wrap:wrap; gap:9px; padding:14px 0 8px; }
.order-rows-tools label { font:600 12px/1 var(--font-body); color:var(--text-soft); }
.order-rows-tools input { width:64px; min-height:38px; padding:7px 9px; border:1px solid var(--border); border-radius:var(--radius-control); background:var(--field); color:var(--text); font:500 13px/1.3 var(--font-body); font-variant-numeric:tabular-nums; }
.order-rows-tools input:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
.order-rows-tools .order-row-limit { font-size:11px; color:var(--muted); }
.order-rows-tools .order-row-limit[hidden] { display:none; }
.order-save-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:15px; border-top:1px solid var(--border); margin-top:18px; padding-top:20px; }
.order-save-bar p { font-size:11px; color:var(--muted); max-width:460px; }
.order-empty { max-width:670px; margin-top:16px; }
.order-empty-icon { font-size:40px; color:var(--muted); margin-bottom:6px; }
.order-empty h2 { font:900 24px/1.1 var(--font-title); }
.order-empty p { color:var(--muted); font-size:13px; margin:12px 0 20px; }
.ticket-open { color:inherit; text-decoration:none; }
.ticket-open:hover, .ticket-open:focus-visible { color:var(--text); text-decoration:underline; text-decoration-color:var(--accent); text-underline-offset:3px; }
@media(max-width:640px){ .order-workspace{padding-top:18px}.order-panel{padding:14px}.order-heading{align-items:flex-start}.order-heading .btn{font-size:11px}.order-header-fields{grid-template-columns:1fr}.order-save-bar .btn{width:100%}}

/* Embedded order: two independent scroll zones, never a scrollable modal page. */
body.is-embedded { min-width:0; height:100dvh; overflow:hidden; background:var(--surface); }
.order-embed-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(320px,1fr); width:100%; height:100dvh; max-height:100dvh; min-height:0; overflow:hidden; }
.order-embed-main { min-width:0; min-height:0; height:100%; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-gutter:stable; }
body.is-embedded .order-workspace { max-width:none; min-height:0; padding:25px 23px; margin:0; }
body.is-embedded .order-workspace > .admin-breadcrumb,body.is-embedded .order-heading { display:none; }
body.is-embedded .order-panel { padding:0; border:0; border-radius:0; background:transparent; }
body.is-embedded .order-table-scroll { border-radius:var(--radius-control); }
body.is-embedded .production-table { min-width:810px; }
body.is-embedded .order-empty { max-width:none; margin:0; padding:30px 0; }
body.is-embedded .order-save-bar { position:sticky; bottom:0; z-index:3; background:var(--surface); padding-bottom:14px; }
.production-table select.order-product-select { background:transparent; border:1px solid transparent; color:var(--text); width:100%; min-width:0; border-radius:5px; padding:9px 6px; font:inherit; font-size:13px; }
.production-table select.order-product-select:hover { background:var(--surface-muted); }
.production-table select.order-product-select:focus { outline:2px solid var(--focus); border-color:var(--accent); background:var(--field); }
.production-table select.order-product-select option { background:var(--surface); color:var(--text); }
.order-embed-sidebar { display:flex; flex-direction:column; gap:0; min-width:0; min-height:0; height:100%; padding:23px 22px 0; border-left:1px solid var(--border); background:var(--surface-muted); overflow:hidden; }
.order-side-block { flex:0 0 auto; padding-bottom:16px; margin-bottom:16px; border-bottom:1px solid var(--border); }
.order-side-block h2 { font:900 20px/1.2 var(--font-title); margin-bottom:12px; }
.order-sidebar-muted { color:var(--muted); font-size:12px; line-height:1.6; }
.order-quick-notes { display:block; width:100%; min-height:90px; height:95px; resize:none; padding:11px; background:var(--field); color:var(--text); border:1px solid var(--border); border-radius:var(--radius-control); font:400 13px/1.6 var(--font-body); }
.order-quick-notes:focus { outline:2px solid var(--focus); outline-offset:1px; }
.order-note-status { display:block; margin-top:7px; color:var(--muted); font-size:11px; min-height:17px; }
.order-note-status.is-error { color:var(--negative); }
.order-totals-block { padding-bottom:12px; margin-bottom:12px; }
.order-totals-block h2 { margin-bottom:8px; }
.order-summary-list { display:grid; gap:6px; margin:0; padding:0; }
.order-summary-list > div { display:flex; align-items:baseline; justify-content:space-between; gap:12px; font-size:12px; }
.order-summary-list dt { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-soft); }
.order-summary-list dd { margin:0; white-space:nowrap; font-variant-numeric:tabular-nums; font-weight:600; }
.order-summary-more { margin-top:8px; color:var(--muted); font-size:11px; }
.order-total-line { display:flex; justify-content:space-between; gap:12px; padding-top:11px; margin-top:11px; border-top:1px solid var(--border); font-size:13px; font-variant-numeric:tabular-nums; }
.order-total-line strong:last-child { color:var(--text); }
.order-history-block { flex:1 1 auto; min-height:100px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; padding-bottom:18px; margin:0; border-bottom:0; }
.order-history-block h2 { position:sticky; top:0; z-index:1; padding:0 0 10px; margin:0 0 5px; background:var(--surface-muted); }
.order-activity-list { list-style:none; margin:0; padding:0 0 0 13px; border-left:1px solid var(--border-strong); }
.order-activity-list li { position:relative; padding:0 0 21px 14px; }
.order-activity-list li:last-child { padding-bottom:0; }
.order-activity-list li::before { content:''; position:absolute; top:5px; left:-18px; width:9px; height:9px; border:2px solid var(--border-strong); border-radius:50%; background:var(--surface-muted); }
.order-activity-list strong { display:block; color:var(--text); font-size:12px; font-weight:600; }
.order-activity-list time, .order-activity-list small { display:block; margin-top:4px; color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
@media(max-width:900px) {
  .order-embed-grid { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,58%) minmax(0,42%); }
  .order-embed-sidebar { border-left:0; border-top:1px solid var(--border); padding:16px 18px; overflow-y:auto; }
  .order-history-block { flex:0 0 auto; min-height:160px; overflow-y:auto; }
}
@media(max-width:640px) {
  body.is-embedded .order-workspace { padding:16px; }
  .order-embed-grid { grid-template-rows:minmax(0,56%) minmax(0,44%); }
  .order-embed-sidebar { padding:16px; }
  .order-quick-notes { height:84px; min-height:84px; }
}

/* v0.1.16 — compact order history; independent scrolling stays intact */
.cycle-list{display:grid;gap:7px;max-height:180px;overflow:auto;scrollbar-width:thin}
.cycle-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid var(--border)}
.cycle-row:last-child{border:0}
.cycle-row strong{display:block;font-size:11px;overflow-wrap:anywhere}
.cycle-row small{display:block;color:var(--muted);font-size:10px;margin-top:4px}
.order-embed-main .cycle-actions{margin-top:18px;padding:18px;border:1px solid var(--border);border-radius:var(--radius-control)}
.cycle-actions h2{font:900 19px/1.2 var(--font-title);margin:0 0 8px}
.cycle-actions form{margin-top:12px}
.cycle-actions .btn{max-width:100%}
.history-delete{margin-top:12px}
.history-delete summary{font-size:12px;color:var(--muted);cursor:pointer}
.order-history-copy{display:grid;gap:7px;margin:12px 0;font-size:12px}
.order-history-copy select{width:100%;padding:10px;background:var(--field);border:1px solid var(--border);border-radius:var(--radius-control);color:var(--text)}
