.sales-cards,.workflow-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:22px 0}.sales-cards>.card,.workflow-counts>.card{padding:20px}.sales-cards strong,.workflow-counts strong{display:block;font-size:26px;color:#1e5445;margin-top:8px}.sales-quantity{font-size:14px;margin:14px 0}.sales-details{margin-bottom:24px;display:grid;gap:10px}.sales-details>.card{padding:20px}.sales-details summary{cursor:pointer;font-size:14px;font-weight:600}.sales-table{width:100%;border-collapse:collapse;margin-top:12px;font-size:13px}.sales-table td,.sales-table th{text-align:left;padding:12px;border-bottom:1px solid #e4e9de}.sales-table th{background:#f2f5ed}.sales-table small{display:block}.workflow-counts{grid-template-columns:repeat(6,minmax(0,1fr))}.workflow-toolbar{display:grid;grid-template-columns:1fr 2fr;padding:20px;gap:20px;margin-bottom:20px}.workflow-order{padding:24px;margin:14px 0}.workflow-order header{display:flex;justify-content:space-between;gap:20px}.workflow-order h2{font-size:18px}.workflow-order p{line-height:1.8;white-space:pre-wrap;font-size:13px}.workshop-details{margin:12px 0;padding:10px 12px;border:1px solid var(--border);border-radius:6px}.workshop-details summary{cursor:pointer;color:var(--green)}.workshop-item{margin-top:10px}.workshop-item p{margin:4px 0}.flow-context{display:flex;gap:20px;flex-wrap:wrap;font-size:12px;color:#66796b}.flow-event{padding:12px 0;border-bottom:1px solid #dce4d8}.flow-event p{font-size:12px;white-space:pre-wrap}.customer-bill-dialog{width:min(880px,96vw);max-width:96vw;padding:0;background:#e9ede7;max-height:94vh}.bill-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:16px;background:white;position:sticky;top:0;z-index:1}.bill-toolbar>span{margin-right:auto;font-size:12px}.customer-bill{background:white;padding:42px;color:#233d35;font:15px/1.7 "Microsoft YaHei",sans-serif}.bill-head{border-bottom:3px solid #235749;padding-bottom:20px;display:flex;justify-content:space-between;align-items:center}.bill-head>span{font-size:24px;font-weight:600}.bill-head h1{font-size:22px}.bill-meta{padding:24px 0;display:flex;flex-direction:column;gap:5px}.bill-meta strong{font-size:21px}.bill-meta span{font-size:13px;color:#62746a}.bill-row{border-bottom:1px solid #dce4da;padding:20px 0}.bill-row h2{font-size:17px;line-height:1.6}.bill-parameters{white-space:pre-wrap;font-size:14px;margin:10px 0;color:#4f6559}.bill-line-amount{display:flex;justify-content:space-between;gap:16px;margin-top:14px}.bill-totals{margin-left:auto;width:min(400px,100%);padding:24px 0}.bill-totals p{display:flex;justify-content:space-between;gap:20px;margin:10px 0}.bill-grand{border-top:1px solid #dce4da;padding-top:12px;font-size:24px;color:#174f43}.bill-extra{white-space:pre-wrap}.customer-bill footer{border-top:1px solid #dce4da;padding-top:20px;margin-top:16px;color:#6c7f72;font-size:12px}.dialog-actions{flex-wrap:wrap}@media(max-width:900px){.sales-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.workflow-counts{grid-template-columns:repeat(3,minmax(0,1fr))}.bill-toolbar{flex-wrap:wrap}.customer-bill{padding:24px}.bill-head{align-items:start}.bill-head>span,.bill-head h1{font-size:20px}}@media print{body>*{display:none!important}#customer-bill-dialog{display:block!important;position:static;max-height:none;width:100%;max-width:none;border:0}.bill-toolbar{display:none!important}.customer-bill{padding:0}}

/* Keep an ordinary one-product bill readable in a desktop screenshot. */
.customer-bill{padding:22px 30px;font-size:14px;line-height:1.45}.bill-toolbar{padding:10px 16px}.bill-head{padding-bottom:10px}.bill-head>span{font-size:22px}.bill-head h1{font-size:20px}.bill-meta{padding:12px 0;gap:3px}.bill-meta strong{font-size:18px}.bill-meta span{font-size:12px}.bill-row{padding:10px 0}.bill-row h2{font-size:16px}.bill-parameters{font-size:13px;line-height:1.45;margin:6px 0}.bill-line-amount{margin-top:8px}.bill-totals{padding:12px 0}.bill-totals p{margin:5px 0}.bill-grand{padding-top:6px;font-size:22px}.bill-extra{font-size:13px}.customer-bill footer{margin-top:10px;padding-top:10px;font-size:11px}
.checkout-action { display: contents; }
.order-fulfillment { margin-top: 22px; }
.order-fulfillment .section-head { margin-bottom: 10px; }
.order-fulfillment h3 { margin: 0; font-size: 14px; }
.rx-copy-actions, .order-next-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.order-next-actions { margin-top: 12px; }
.order-delivery-options { margin: 14px 0; padding: 10px 14px; background: #f4f6ef; border-radius: 6px; }
.order-delivery-options summary, .cart-edit-options summary { cursor: pointer; }
.cart-group { border: 1px solid var(--border); border-radius: 8px; margin: 10px 0; padding: 8px 12px; }
.cart-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-group .cart-item { margin: 4px 0; }
#cart-edit-dialog { width: min(680px, calc(100% - 24px)); max-height: 90vh; overflow: auto; }
.edit-quantity { display: block; max-width: 210px; }
.cart-edit-section { margin-top: 12px; }
.cart-edit-section h3 { margin-bottom: 6px; }
.cart-edit-section fieldset { border: 1px solid var(--border); border-radius: 6px; margin: 8px 0; min-width: 0; }
.cart-edit-eyes { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.cart-edit-eyes input { min-width: 0; }
.cart-edit-options { margin: 10px 0; }
#review-fulfillment .order-fulfillment { padding: 14px; border: 1px solid var(--border); border-radius: 7px; }
.fulfillment-card .business-date-field { margin-bottom: 0; }
.sku-picker, .return-card { padding: 16px; margin: 14px 0; }
.lens-frame-pairing{margin:14px 0}.lens-frame-pairing>p{margin:8px 0}.sku-picker { border: 1px solid var(--border); border-radius: 8px; background: #f6f9f4; }
.sku-picker summary { cursor: pointer; font-weight: 600; color: #174f43; }
.sku-picker label, .return-card label { display: block; }
.sku-picker [data-sku-controls] { margin-top: 12px; }
.sku-picker .family-search { margin-bottom: 10px; }
.return-card h2 { margin: 0 0 12px; font-size: 17px; }
.return-card h2:not(:first-child) { margin-top: 20px; }
.return-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.return-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin: 12px 0; }
.sku-results { max-height: 290px; overflow: auto; }
.sku-result { display: block; width: 100%; text-align: left; min-height: 48px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.sku-result:hover, .sku-result:focus-visible { background: #e7efe3; }
.sku-result small, .return-line small { display: block; margin-top: 4px; color: #61766c; }
.sku-pagination, .return-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; }
.return-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.return-line > div { min-width: 0; }
.return-card p { margin: 8px 0; overflow-wrap: anywhere; }
.return-card label + .button { margin-top: 12px; }
.return-total { padding: 12px; background: #edf5e9; border-radius: 6px; color: #174f43; }
#return-error, [data-return-review-error] { color: #91652c; }
.login-shell { max-width: 430px; margin: 12vh auto; }
.login-shell > p { margin: 12px 0 26px; color: #66796b; }
.login-shell form { padding: 28px; }
.login-shell form label + label { margin-top: 14px; }
.login-shell #password-help { margin-top: 8px; color: #66796b; }
.login-shell form button { margin-top: 22px; }
.login-shell #error { margin-top: 15px; font-size: 13px; color: #91652c; }

@media screen and (max-width: 760px) {
  .sidebar { flex-direction: column; align-items: stretch; padding: 12px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 0; }
  .nav-item { width: 100%; justify-content: center; min-height: 44px; font-size: 12px; padding: 7px 3px; text-align: center; }
  main { padding: 12px 12px 0; }
  .demo-banner { align-items: center; font-size: 11px; }
  .demo-banner button { display: block; flex: none; min-height: 44px; }
  .page-heading { gap: 8px; align-items: flex-start; }
  .page-heading h1 { font-size: 22px; }
  .page-heading p { font-size: 12px; }
  .page-heading .button, .button { min-height: 44px; font-size: 13px; }
  .page-heading > .button { flex: none; max-width: 36%; white-space: normal; }
  .order-main, .quote-column, .field-grid > *, .fulfillment-grid > * { min-width: 0; }
  .order-main .card, .summary-card, .quote-card { padding-left: 14px; padding-right: 14px; }
  input:not([type="checkbox"]), select, textarea { min-width: 0; min-height: 44px; font-size: 16px !important; }
  input, select, textarea { max-width: 100%; }
  .category-tabs button, #indices button, .choice, #copy-eye { min-height: 44px; }
  .category-tabs button { font-size: 12px; }
  .live-account-row, .selected-customer { flex-wrap: wrap; }
  .live-account-row select { max-width: 100%; }
  .customer-results { top: calc(100% + 4px); max-height: min(46vh, 360px); }
  .customer-option { min-height: 52px; }
  .model-fields, .fulfillment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fulfillment-grid > label:first-child { grid-column: 1 / -1; }
  .fulfillment-grid > label:last-child { display: block; grid-column: auto; }
  .prescription { overflow: visible; }
  .prescription .rx-header { display: none; }
  .prescription .rx-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    gap: 8px;
    padding: 10px;
  }
  .prescription .rx-row + .rx-row { border-top: 1px solid var(--border); }
  .rx-row .eye-label { grid-column: 1 / -1; }
  .rx-row .eye-label small { font-size: 12px; }
  .rx-row .sr-only {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin: 0 0 4px;
    clip: auto;
    overflow: visible;
    font-size: 11px;
  }
  .rx-row input, .rx-row select { min-height: 44px; }
  .add-item-row { flex-wrap: wrap; gap: 10px; }
  .add-item-row > span { font-size: 13px; }
  #add-item { width: 100%; }
  .quote-column { grid-template-columns: minmax(0, 1fr); }
  .quote-card { height: auto; }
  .quote-foot { margin-left: -14px; margin-right: -14px; }
  .summary-card .summary-note { font-size: 11px; }
  #page-order { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .checkout-action {
    position: fixed;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, .75fr);
    align-items: center;
    gap: 12px;
    inset: auto 0 0;
    z-index: 20;
    padding: 9px max(12px, env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 22px #19372615;
  }
  .checkout-action .summary-total { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; }
  .checkout-action .summary-total strong { font-size: 17px; overflow-wrap: anywhere; }
  .checkout-action #preview-order { min-height: 46px; font-size: 14px; }
  #toast { max-width: calc(100vw - 24px); white-space: normal; bottom: calc(75px + env(safe-area-inset-bottom)); }
  .record-top, .record-bottom, .review-item > div, .review-section-caption { flex-wrap: wrap; }
  .record-bottom p { max-width: none; font-size: 12px; }
  .record-actions { flex-direction: row; width: 100%; }
  .record-actions .button { min-height: 44px; font-size: 12px; }
  .cart-price-edit input { max-width: 100%; }
  .table-scroll { max-width: 100%; overflow-x: auto; }
  .stock-table { min-width: 540px; }
  .workflow-toolbar { grid-template-columns: minmax(0, 1fr); }
  .workflow-order { padding: 14px; }
  .erp-preview-content { padding: 14px; overflow-wrap: anywhere; }
  .erp-preview-content .button { margin-bottom: 6px; }
  dialog { width: calc(100% - 16px); padding: 14px; max-height: calc(100dvh - 20px); overflow: auto; }
  #order-dialog { max-height: calc(100dvh - 20px); }
  #order-dialog .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    bottom: -14px;
    margin: 16px -14px -14px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  #order-dialog .dialog-actions .button { justify-content: center; padding: 8px; text-align: center; }
  #upload-erp-order, #print-save-erp-order { grid-column: 1 / -1; }
  .review-shipping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-shipping-grid > :last-child { grid-column: 1 / -1; }
  .customer-bill-dialog { padding: 0; }
  .customer-bill { padding: 14px; overflow-wrap: anywhere; }
  .bill-line-amount { flex-wrap: wrap; gap: 4px; }
  .bill-toolbar > span { width: 100%; }
  .bill-toolbar .button { flex: 1; justify-content: center; padding: 8px; }
  .login-shell { margin: 10vh auto 0; padding: 0 16px; }
  .login-shell form { padding: 20px; }
}
#order-dialog .review-edit-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#order-dialog .review-edit-totals > div:last-child { display: block; grid-column: auto; text-align: right; }
#order-dialog .review-edit-totals small { margin-bottom: 7px; }
#review-total { font-size: 20px; }
