.op-page {
  --op-border: var(--line, #e2ded5);
  --op-muted: var(--muted, #676257);
  width: min(1420px, 100%);
  padding: clamp(22px, 3vw, 46px) clamp(18px, 3.6vw, 58px) 64px;
  margin: 0 auto;
  color: var(--ink, #1b1915);
}
.workspace .op-page { width: 100%; padding: 6px 0 36px; }
.op-page *, .op-print * { box-sizing: border-box; }
.op-page :where(h1,h2,h3,p,ul,dl,dd) { margin: 0; }
.op-page :where(button,select,input) { font: inherit; color: inherit; }
.op-page :where(button,a,select) { -webkit-tap-highlight-color: transparent; }
.op-page :where(button,a,summary,input,select):focus-visible { outline: 2px solid #876620; outline-offset: 3px; }
.op-icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex: none; }
.op-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.op-page-heading, .op-subheading, .op-detail-header, .op-detail-meta, .op-detail-footer, .op-table-actions, .op-total, .op-lines li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.op-page-heading { margin-bottom: 30px; }
.op-page-heading h1 { font: 700 clamp(37px, 4vw, 55px)/1.04 var(--display, "Bricolage Grotesque", Inter, sans-serif); letter-spacing: -.058em; }
.op-page-heading h1 span { color: var(--gold, #c99c39); }
.op-page-heading p { color: var(--op-muted); font-size: .91rem; line-height: 1.5; margin: 8px 0 0; }
.op-button, .op-page a.op-button {
  display: inline-flex; justify-content: center; align-items: center; gap: .5rem; min-height: 40px;
  border: 1px solid var(--op-border); background: white; color: var(--ink, #1b1915); border-radius: 9px;
  padding: .58rem .9rem; font: 630 .83rem/1.25 var(--body, Inter, sans-serif);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.op-button:hover, .op-page a.op-button:hover { background: #f6f4ef; }
.op-icon-button { width: 36px; min-height: 36px; padding: .4rem; }
.op-primary { color: white; border-color: #232119; background: #232119; }
.op-primary:hover { color: white; background: #403c33; }
.op-button:disabled { opacity: .48; cursor: not-allowed; }
.op-worklist, .op-origin, .op-table-card { border: 1px solid var(--op-border); border-radius: 16px; background: #fff; }
.op-worklist { overflow: hidden; }
.op-page-heading .op-location { display: flex; align-items: center; gap: 7px; }
.op-location .op-icon, .op-tabs .op-icon { width: 16px; height: 16px; }
.op-worklist, .op-origin, .op-table-card { box-shadow: var(--panel-shadow); }
.op-order-list td:nth-last-child(2), .op-total { font-variant-numeric: tabular-nums; }
.op-tabs { display: flex; gap: 24px; padding: 0 22px; border-bottom: 1px solid var(--op-border); }
.op-tabs button { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 19px 0 17px; background: transparent; border: 0; font-size: .93rem; font-weight: 640; color: var(--op-muted); cursor: pointer; }
.op-tabs button[aria-pressed="true"] { color: var(--ink, #1b1915); }
.op-tabs button[aria-pressed="true"]::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: var(--gold, #c99c39); }
.op-tabs button span, .op-subheading h2 small { font-family: var(--body, Inter, sans-serif); background: #f1eee7; border-radius: 30px; padding: 2px 8px; font-size: .72rem; letter-spacing: 0; line-height: 1.4; }
.op-tabs button[aria-pressed="true"] span { color: #70501a; background: #f5e8ca; }
.op-filters { display: flex; gap: 12px; padding: 18px 22px; }
.op-search, .op-field { display: inline-flex; align-items: center; border: 1px solid var(--op-border); background: white; border-radius: 8px; min-height: 40px; }
.op-field { padding: .45rem .65rem; font-size: .88rem; }
.op-search { width: min(330px, 100%); gap: 8px; padding: 0 12px; }
.op-search .op-icon { color: var(--op-muted); }
.op-search input { width: 100%; min-width: 0; border: 0; padding: 10px 0; background: transparent; font-size: .85rem; outline: none; }
.op-search:focus-within { outline: 2px solid #876620; outline-offset: 2px; }
.op-search input:focus-visible { outline: 0; }
.op-list-scroll { overflow-x: auto; }
.op-order-list { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; line-height: 1.45; }
.op-order-list th, .op-order-list td { padding: 14px clamp(10px,1.6vw,24px); vertical-align: middle; }
.op-order-list th { background: #f8f7f3; border-block: 1px solid var(--op-border); color: var(--op-muted); white-space: nowrap; font-weight: 570; font-size: .77rem; }
.op-order-list tbody tr + tr { border-top: 1px solid var(--op-border); }
.op-order-list th:first-child, .op-order-list td:first-child { padding-left: 22px; }
.op-order-list td:first-child, .op-order-list td:nth-last-child(2) { white-space: nowrap; }
.op-order-list td:nth-child(2) { overflow-wrap: anywhere; min-width: 9rem; }
.op-order-list td:last-child { text-align: right; }
.op-order-list b, .op-order-number { font-weight: 640; }
.op-order-number { padding: 2px 0; border: 0; background: none; color: inherit; cursor: pointer; }
.op-order-number:hover { text-decoration: underline; }
.op-order-list small, .op-lines small { display: block; margin-top: 3px; color: var(--op-muted, #676257); font-size: .75rem; }
.op-badge, .op-paid { display: inline-flex; align-items: center; gap: 6px; border-radius: 2rem; padding: 4px 9px; font-size: .75rem; line-height: 1.35; font-weight: 640; }
.op-badge::before, .op-paid::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.op-badge[data-status="new"] { background: #fff0ce; color: #805a0b; }
.op-badge[data-status="preparing"] { background: #e9eef7; color: #3e5a81; }
.op-badge[data-status="ready"], .op-paid { background: #e5f1e8; color: #396345; }
.op-badge[data-status="completed"] { background: #f0eee9; color: #656054; }
.op-empty { display: grid; justify-items: center; text-align: center; place-content: center; min-height: 245px; padding: 36px 20px 52px; }
.op-empty .op-icon { width: 44px; height: 44px; color: #897242; background: #f6efdf; padding: 10px; border-radius: 13px; }
.op-empty h2 { font: 680 1.3rem/1.25 var(--display, Inter, sans-serif); letter-spacing: -.035em; margin-top: 12px; }
.op-empty p, .op-history-limit, .op-origin p, .op-pay-hint { color: var(--op-muted); font-size: .81rem; line-height: 1.55; }
.op-empty p { margin-top: .35rem; }
.op-history-limit { padding: 14px 22px; border-top: 1px solid var(--op-border); }
.op-error { border-radius: 8px; background: #fff2ec; padding: 10px 12px; color: #8a361c; font-size: .84rem; }
.op-worklist > .op-error { margin: 0 22px 14px; }
.op-dialog {
  --op-border: var(--line, #e2ded5); --op-muted: var(--muted, #676257);
  width: min(480px, calc(100vw - 24px)); max-height: min(85dvh, 840px); margin: auto; padding: 0;
  background: #fff; color: var(--ink, #1b1915); border: 1px solid var(--op-border); border-radius: 18px;
  box-shadow: 0 20px 70px #2924162e; overflow-y: auto;
}
.op-dialog::backdrop { background: rgb(31 28 22 / .42); }
.op-detail-header { padding: 20px 24px 17px; border-bottom: 1px solid var(--op-border); }
.op-detail-header span, .op-detail-meta time, .op-facts dt { display: block; color: var(--op-muted); font-size: .8rem; }
.op-detail-header h2 { margin-top: 3px; font: 690 1.9rem/1.05 var(--display, Inter, sans-serif); letter-spacing: -.055em; }
.op-detail-body { padding: 20px 24px; }
.op-detail-meta time { text-align: right; }
.op-facts { display: grid; gap: 12px; margin: 18px 0; padding-bottom: 15px; border-bottom: 1px solid var(--op-border); }
.op-facts > div { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 8px; }
.op-facts dd { font-size: .87rem; overflow-wrap: anywhere; font-weight: 550; }
.op-lines { padding: 0; margin: 0; list-style: none; }
.op-lines li { align-items: start; padding: 6px 0; font-size: .88rem; }
.op-lines li > span { min-width: 0; overflow-wrap: anywhere; }
.op-lines b, .op-lines strong { font-weight: 590; }
.op-total { border-top: 1px dashed var(--op-border, #ccc); margin: 13px 0 10px; padding: 13px 0 0; font-size: .94rem; font-weight: 620; }
.op-total strong { font-size: 1.1rem; }
.op-note { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: #f7f5f0; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.op-pay { margin-top: 16px; }
.op-pay label, .op-origin label { display: block; font-size: .81rem; font-weight: 610; }
.op-pay > div, .op-origin-form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.op-pay-hint, .op-detail-body > .op-error { margin-top: 12px; }
.op-detail-footer { padding: 14px 24px; border-top: 1px solid var(--op-border); background: #fcfbf9; }
.op-origin { margin-bottom: 28px; padding: 14px 18px; font-size: .87rem; }
.op-origin summary { cursor: pointer; font-weight: 600; }
.op-origin summary .op-icon { margin: 0 5px 0 3px; }
.op-origin-form { margin-top: 14px; }
.op-origin-form label { flex: 1; max-width: 420px; min-width: min(220px,100%); }
.op-origin-form input { width: 100%; margin-top: 4px; font-weight: 400; }
.op-origin p { margin-top: 6px; }
.op-subheading { margin: 0 0 12px; }
.op-subheading h2 { display: flex; align-items: center; gap: 8px; font: 680 1.5rem/1.2 var(--display, Inter, sans-serif); letter-spacing: -.04em; }
.op-subheading a { color: var(--ink, #1b1915); font-size: .86rem; font-weight: 580; text-underline-offset: 3px; }
.op-subheading a .op-icon { width: 15px; height: 15px; }
.op-table-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(200px,100%),1fr)); gap: 14px; }
.op-table-card { padding: 16px; text-align: center; }
.op-table-card h3 { font: 660 1.2rem/1.2 var(--display, Inter, sans-serif); letter-spacing: -.035em; }
.op-qr-link { display: block; width: fit-content; margin: 12px auto; }
.op-qr { display: block; width: 132px; height: auto; max-width: 100%; }
.op-table-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,76px),1fr)); gap: 6px; }
.op-table-actions .op-button, .op-page .op-table-actions a.op-button { padding: 7px 5px; gap: 5px; font-size: .79rem; min-height: 36px; }
.op-table-actions .op-icon { width: 15px; height: 15px; }
.op-print { display: none; }
@media (max-width: 720px) {
  .op-page-heading { flex-wrap: wrap; gap: 16px; }
  .op-page { padding-inline: 16px; }
  .op-tabs, .op-filters { padding-inline: 14px; }
  .op-filters { gap: 8px; }
  .op-filters .op-field { max-width: 42%; }
  .op-order-list, .op-order-list tbody { display: block; width: 100%; }
  .op-order-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .op-order-list tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 14px; padding: 14px; align-items: start; }
  .op-order-list tbody { border-top: 1px solid var(--op-border); }
  .op-order-list td, .op-order-list td:first-child { display: block; padding: 0; min-width: 0; }
  .op-order-list td:nth-child(1) { grid-area: 1 / 1; }
  .op-order-list td:nth-child(2) { grid-area: 2 / 1; min-width: 0; }
  .op-order-list td:nth-child(3) { grid-area: 3 / 1; color: var(--op-muted); font-size: .77rem; align-self: center; }
  .op-order-list td:nth-child(4) { grid-area: 1 / 2; text-align: right; }
  .op-order-list td:nth-child(5) { grid-area: 2 / 2; text-align: right; }
  .op-order-list td:nth-child(6) { grid-area: 3 / 2; }
  .op-table-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .op-table-card { padding: 12px; }
  .op-subheading { flex-wrap: wrap; }
  .op-subheading h2 { font-size: 1.3rem; }
  .op-detail-header, .op-detail-body, .op-detail-footer { padding-inline: 16px; }
  .op-detail-footer { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .op-filters { display: grid; grid-template-columns: minmax(0,1fr); }
  .op-filters .op-search, .op-filters .op-field { width: 100%; max-width: 100%; }
}
@media print {
  body:has(> #op-print) { display: block !important; padding: 0 !important; margin: 0 !important; background: white !important; min-height: 0 !important; }
  body:has(> #op-print) > :not(#op-print), body:has(> #op-print) dialog { display: none !important; }
  body:has(> #op-print) ::backdrop { display: none !important; }
  #op-print { display: block !important; position: static; color: black; background: white; font: 11pt/1.4 Arial,sans-serif; }
  .op-print-brand { display: inline-flex; align-items: center; gap: 1.2mm; color: #161616; font: 430 15pt/1 var(--display, Arial, sans-serif); letter-spacing: -.06em; white-space: nowrap; }
  .op-print-brand img { display: block; width: 7mm; height: 7mm; }
  .op-print-brand b { font-weight: 760; }
  #op-print.op-print-tables { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5mm; }
  .op-print-table { break-inside: avoid; border: .3mm solid #aaa; border-radius: 3mm; min-height: 77mm; padding: 6mm 3mm; text-align: center; }
  .op-print-table h1 { margin: 2mm 0; font: bold 24pt/1.2 Arial,sans-serif; color: black; }
  .op-print-table p { margin: 2mm 0 0; }
  .op-print-table .op-qr { width: 42mm; margin: 0 auto; }
  .op-receipt { width: min(100%,72mm); margin: 0 auto; }
  .op-receipt h1 { margin: 1mm 0 0; font: bold 12pt/1.2 Arial,sans-serif; }
  .op-receipt header { text-align: center; padding: 3mm 0; border-bottom: 1px dashed #aaa; }
  .op-receipt .op-lines, .op-receipt .op-total { margin-top: 3mm; border-top: 1px dashed #aaa; }
  .op-receipt .op-lines li { break-inside: avoid; font-size: 10pt; }
  .op-receipt .op-note { padding: 0; background: white; }
}
