/* Shared screen-only presentation layer. Keep business selectors, visibility,
   table column widths, print layouts and theme/background preferences intact. */
@media screen {
  :root {
    --ws-radius: 12px;
    --ws-control: 38px;
    --ws-shadow: 0 2px 5px rgba(28, 36, 44, .025), 0 8px 26px rgba(28, 36, 44, .025);
    --ws-ink: #27313b;
    --ws-muted: #697480;
    --ws-line: #e4e7e9;
    --ws-surface: #f8f9fa;
  }
  :root[data-ui-theme="brand"] {
    --bg: #f3f4f4;
    --ui-page: #f3f4f4;
    --ui-page-rgb: 243, 244, 244;
    --text: #30363c;
    --muted: #727982;
    --line: #e1e4e6;
    --line-soft: #eceeef;
    --brand: #98683e;
    --primary: #98683e;
    --brand-dark: #7c512f;
    --brand-soft: #f5ece2;
    --ui-title: #27313b;
    --ui-label: #66707b;
    --ui-border: #e1e4e6;
    --ui-border-strong: #d0d5d9;
    --ui-panel-soft: #f8f9fa;
    --ui-table-head: #f4f6f7;
    --ui-row-alt: #fafbfc;
    --ui-row-hover: #faf5ef;
    --ui-sidebar: #fff;
    --ui-sidebar-text: #47515d;
    --ui-sidebar-border: #e5e7e9;
    --ui-sidebar-hover: #f8f5f0;
    --ui-sidebar-active: #f5ece2;
    --ui-sidebar-active-border: #ead8c5;
    --ui-shadow-tint: rgba(40, 44, 50, .055);
  }
  :root[data-ui-theme="blue"] {
    --bg: #f3f5f8;
    --ui-page: #f3f5f8;
    --ui-table-head: #f3f6fa;
    --ui-sidebar: #fff;
    --ui-sidebar-active: #edf3ff;
    --ui-sidebar-active-border: #d9e5fa;
  }
  body { font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; line-height: 1.55; }
  button, input, select, textarea { font-family: inherit; }
  .app { grid-template-columns: 164px minmax(0, 1fr); }
  .sidebar { padding: 22px 12px; box-shadow: none; }
  .logo { gap: 8px; padding-bottom: 20px; margin-bottom: 22px; }
  .brand-mark { transform: scale(.84); margin: -7px 0; }
  .brand-caption { font-size: 12px; letter-spacing: 3px; font-weight: 500; }
  .menu-item {
    min-height: 44px; padding: 13px 10px 13px 40px;
    margin-bottom: 7px; text-align: left; border-radius: 9px;
    line-height: 18px; font-size: 13px; font-weight: 500; cursor: pointer;
  }
  .menu-item::before {
    content: ""; position: absolute; left: 12px; top: 13px;
    width: 18px; height: 18px; background: currentColor;
    mask: var(--ws-nav-icon) center / contain no-repeat;
    -webkit-mask: var(--ws-nav-icon) center / contain no-repeat;
    opacity: .8;
  }
  .menu-item::after { left: -13px; top: 12px; bottom: 12px; border-radius: 0 3px 3px 0; }
  .menu-item.active { color: var(--brand-dark); font-weight: 700; }
  #menuQuote { --ws-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='3'/%3E%3Cpath d='M8 7h8M8 12h1m6 0h1m-8 5h1m6 0h1'/%3E%3C/svg%3E"); }
  #menuInquiries { --ws-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11a8 8 0 0 1-8 8H4l-2 3V10a8 8 0 0 1 8-8h3a8 8 0 0 1 8 9Z'/%3E%3Cpath d='M7 8h9M7 12h6'/%3E%3C/svg%3E"); }
  #menuOrders { --ws-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='19' rx='3'/%3E%3Cpath d='M8 2v3m8-3v3M8 10h8M8 15l2 2 5-5'/%3E%3C/svg%3E"); }
  #menuProduction { --ws-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M3 21V10l6 3V8l6 3V3h5l1 18H3Zm4-5v2m5-2v2m5-2v2'/%3E%3C/svg%3E"); }
  #menuLogistics { --ws-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M2 5h13v12H2V5Zm13 4h4l3 4v4h-7'/%3E%3Ccircle cx='6' cy='18' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E"); }
  #menuFinance { --ws-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='15' rx='3'/%3E%3Cpath d='M17 5V2L5 5m17 6h-6v5h6m-4-2.5h.01'/%3E%3C/svg%3E"); }
  #menuHistory { --ws-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10a9 9 0 1 1 1 7M3 4v6h6m3-4v6l4 2'/%3E%3C/svg%3E"); }
  #menuCustomerCenter, #menuVendorCenter { --ws-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 22v-3a8 8 0 0 1 16 0v3M8 22v-4m8 4v-4'/%3E%3C/svg%3E"); }
  .flyout { left: calc(100% + 12px); top: -3px; width: 225px; padding: 7px; border-radius: 12px; }
  .nested-flyout { border-radius: 12px; padding: 7px; border-color: var(--ui-border); }
  .flyout button { min-height: 40px; border-radius: 7px; font-weight: 500; }
  .menu-item:has(:focus-visible) > .flyout, .menu-item:focus-visible > .flyout,
  .flyout-group:has(:focus-visible) > .nested-flyout { display: block; }
  .topbar { min-height: 76px; height: auto; padding: 13px 24px; gap: 16px; box-shadow: none; }
  .topbar > div:first-child { min-width: 0; }
  .topbar .title { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .2px; }
  .workspace-context { margin-top: 3px; color: var(--ui-title); font-size: 18px; line-height: 1.35; font-weight: 700; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .topbar-actions .btn, .user-pill { min-height: 32px; font-size: 12px; }
  .user-pill { background: transparent; border-color: transparent; font-weight: 500; }
  .theme-toolbar { border-color: transparent; padding: 2px; }
  .theme-toolbar::before { display: none; }
  .theme-choice { border-radius: 6px; }
  #healthStatus { font-size: 11px; font-weight: 500; background: transparent; padding-inline: 5px; }
  #healthStatus.success::before { content: ""; width: 6px; height: 6px; margin-right: 5px; background: currentColor; border-radius: 50%; }
  .content { max-width: 1920px; padding: 22px 24px 32px; }
  .card { border-color: var(--ui-border); border-radius: var(--ws-radius); padding: 18px; box-shadow: var(--ws-shadow); }
  .card h3 { min-height: 36px; margin-bottom: 16px; padding-bottom: 13px; gap: 12px; flex-wrap: wrap; font-size: 16px; font-weight: 650; color: var(--ui-title); }
  .card h3 > span { font-size: 12px; font-weight: 500; }
  .card h3 > #financeCostBillTitle { font-size: inherit; font-weight: inherit; }
  .card h3 > span:has(.btn) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .card h3 .btn { font-size: 12px; }
  .section-title { font-weight: 650; color: var(--ui-title); margin-bottom: 12px; }
  .section-title::before { height: 12px; background: var(--brand); }
  .grid, .bottom-grid { gap: 16px; }
  .quote-grid { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 16px; }
  .quote-result-column { top: 96px; }
  .quote-result-card { border-color: var(--ui-result-border); box-shadow: var(--ws-shadow); }
  .quote-result-column [data-empty]:empty::before { padding: 16px 2px; }
  #quoteSummary:empty { display: block; }
  .quote-result-column .metric { border-radius: 9px; padding: 13px; }
  .quote-result-column .metric .value { font-size: 24px; font-variant-numeric: tabular-nums; }
  .quote-support-card h3 { font-size: 14px; }
  .quote-support-card [data-empty]:empty::before { font-size: 12px; }
  .customer-profile-strip { margin-top: 15px; padding: 12px; background: var(--ui-panel-soft); border: 0; border-radius: 8px; }
  .param-section { margin-bottom: 14px; padding-top: 14px; }
  .form-grid, .form-grid.compact { gap: 12px; }
  .form-grid.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .field { min-width: 0; }
  .field label { color: var(--ui-label); font-weight: 500; margin-bottom: 6px; line-height: 1.4; }
  .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  .field select, .field textarea, .cc-filter-field input, .cc-filter-field select,
  .vc-filter input, .vc-filter select {
    min-height: var(--ws-control); border: 1px solid var(--ui-border-strong);
    border-radius: 7px; padding: 8px 10px; color: var(--text); background: var(--ui-panel);
    font-size: 13px; line-height: 20px;
  }
  input::placeholder, textarea::placeholder { color: #89939e; opacity: 1; }
  .field input[readonly], .field textarea[readonly] { background: var(--ui-panel-soft); color: var(--muted); }
  .field input:disabled, .field select:disabled { background: var(--ui-panel-soft); color: var(--muted); cursor: not-allowed; }
  .field textarea { line-height: 1.65; }
  input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
  .btn { min-height: var(--ws-control); padding: 8px 14px; border-radius: 7px; font-weight: 600; box-shadow: 0 1px 2px rgba(24, 32, 40, .025); }
  .btn.small { min-height: 30px; padding: 5px 10px; }
  .btn.primary { font-weight: 600; }
  .btn.primary:hover:not(:disabled) { box-shadow: 0 3px 8px var(--ui-shadow-tint); }
  .btn.danger { color: #bf4139; background: #fff; border-color: #f0c8c4; }
  .btn.danger:hover:not(:disabled) { color: #a62f28; background: #fff5f4; border-color: #e9aba5; }
  .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
  :is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
  .filter-row { padding: 14px; margin: 0 0 16px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--ui-panel-soft); gap: 12px; align-items: flex-end; }
  .filter-row .field { min-width: 120px; }
  .filter-row .field.span-2 { min-width: min(280px, 100%); }
  .filter-row > .btn { min-height: var(--ws-control); }
  .filter-row label { font-size: 12px; }
  .table-wrap, .vc-table-wrap { border-color: var(--ui-border); border-radius: 9px; }
  .data-table { font-variant-numeric: tabular-nums; }
  .data-table th, .vc-table th { height: 42px; color: var(--ui-label); font-size: 12px; font-weight: 600; background: var(--ui-table-head); border-bottom-color: var(--ui-border); }
  .data-table td { padding: 12px 10px; line-height: 1.55; }
  .data-table tbody tr:hover td { transition: background-color .1s ease; }
  .data-table .action-cell { gap: 6px; }
  .data-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .data-table select {
    border: 1px solid var(--ui-border-strong); border-radius: 6px;
    min-height: 30px; padding: 4px 6px; font-family: inherit; color: var(--text);
  }
  .data-table .followup-note-input { min-width: 0; width: 100%; }
  .data-table .followup-mini-select.payment-warning { background: #fff7df; color: #936209; border-color: #ebcd83; }
  .data-table .followup-note-input.saved { border-color: #6eb38e; background: #eff8f2; }
  .data-table tbody tr:only-child > td[colspan]:only-child { padding: 30px 16px; text-align: center; color: var(--muted); }
  /* A second native horizontal scrollbar avoids travelling to the bottom of long lists. */
  .ws-table-scroll { margin: -3px 0 6px; }
  .ws-table-scroll[hidden] { display: none; }
  .ws-table-scroll-label { color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 3px; }
  .ws-table-scroll-track { overflow-x: auto; overflow-y: hidden; height: 13px; border-radius: 6px; }
  .ws-table-scroll-space { height: 1px; }
  .ws-table-scroll-track::-webkit-scrollbar { height: 10px; }
  .ws-table-scroll-track::-webkit-scrollbar-track { background: var(--ui-panel-soft); border-radius: 6px; }
  .ws-table-scroll-track::-webkit-scrollbar-thumb { background: var(--ui-border-strong); border: 2px solid var(--ui-panel-soft); border-radius: 6px; }
  .list-pagination, .history-pagination, .vc-pagination, .cc-pagination { padding-top: 16px; gap: 12px; flex-wrap: wrap; font-size: 12px; }
  .list-pagination-actions, .history-pagination-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .list-pagination-size select, .vc-pagination select, .cc-pagination select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--ui-border-strong); border-radius: 6px; background: var(--ui-panel); color: var(--text); font: inherit; }
  :is(.list-pagination, .history-pagination) [id$="PageStatus"] { padding: 5px 8px; color: var(--text); font-variant-numeric: tabular-nums; }
  .status { font-size: 11px; font-weight: 500; padding: 4px 9px; }
  .logistics-tabs { margin: 0 0 14px; gap: 6px; }
  .logistics-tabs .btn { min-height: 34px; padding-inline: 18px; border-radius: 7px; }
  .logistics-batch-actions { padding: 10px 12px; border-radius: 8px; background: var(--ui-panel-soft); gap: 10px; }
  :is(.finance-handle-summary, .finance-design-plate-summary, .finance-cost-summary, .paper-intake-summary, .blade-library-summary) > div {
    padding: 14px 16px; border-radius: 9px; border-color: var(--ui-border); background: var(--ui-panel-soft);
  }
  :is(.finance-handle-summary, .finance-design-plate-summary, .paper-intake-summary, .blade-library-summary) strong { font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
  .modal-backdrop { background: rgba(23, 31, 40, .42); backdrop-filter: blur(4px); }
  .modal { border-color: rgba(255,255,255,.65); border-radius: 15px; box-shadow: 0 24px 90px rgba(18, 26, 34, .22); }
  .modal-header, .modal-footer { padding: 16px 20px; flex-shrink: 0; }
  .modal-header { background: var(--ui-panel); }
  .modal-title { font-size: 17px; line-height: 1.5; }
  .modal-header .muted { margin-top: 3px; font-size: 12px; }
  .modal-body { padding: 20px; gap: 16px; min-height: 0; }
  .modal-section { padding: 16px; border-radius: 10px; border-color: var(--ui-border); }
  .modal-footer { background: var(--ui-panel-soft); }
  .icon-btn { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; border-color: var(--ui-border); }
  .deal-options-row { padding: 12px; border-radius: 8px; }
  .todo-drawer-header, .todo-drawer-toolbar { padding: 16px 20px; }
  .todo-item { border-radius: 11px; box-shadow: var(--ws-shadow); }
  .todo-group-title { font-size: 13px; font-weight: 600; }
  .toast { padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); }
  .customer-center-shell, .vendor-center-shell { color: var(--text); }
  .cc-identity-bar, .vc-heading, .cc-toolbar, .vc-toolbar { border-color: var(--ui-border); background: var(--ui-panel); box-shadow: var(--ws-shadow); border-radius: var(--ws-radius); }
  .cc-toolbar, .vc-toolbar { padding: 14px; gap: 12px; margin-bottom: 16px; }
  .cc-filter-field > span, .vc-filter > span { font-size: 12px; font-weight: 500; color: var(--ui-label); }
  .cc-toolbar .btn, .vc-toolbar .btn { min-height: 38px; height: 38px; }
  .cc-order-card { border-color: var(--ui-border); border-radius: var(--ws-radius); box-shadow: var(--ws-shadow); }
  .cc-order-card.expanded { border-color: var(--ui-border-strong); box-shadow: var(--ws-shadow); }
  .cc-order-summary { background: var(--ui-panel); padding: 12px 16px; }
  .cc-order-summary:hover { background: var(--ui-panel-soft); }
  .cc-order-number, .vc-production-no, .cc-identity-greeting strong, .vc-heading strong { color: var(--ui-title); }
  .cc-order-number { font-size: 18px; }
  .cc-summary-artwork, .vc-sheet-button { border-color: var(--ui-border); background: var(--ui-panel-soft); }
  .cc-panel, .cc-progress-panel { border-color: var(--ui-border); box-shadow: none; }
  .vc-heading-mark { background: var(--brand); }
  .vc-note-editor textarea { border-color: var(--ui-border-strong); color: var(--text); font-family: inherit; }
  .vc-table td { padding-block: 12px; }
  .login-screen { background: radial-gradient(ellipse at 25% 15%, var(--brand-soft), transparent 55%), var(--ui-page); padding: 32px 20px 80px; }
  .login-card { width: min(440px, 94vw); padding: 36px; border-radius: 18px; box-shadow: 0 20px 70px var(--ui-shadow-tint); }
  .login-card::before { content: "吉理包装 · 运营工作台"; padding: 0; background: transparent; font-size: 12px; letter-spacing: 1px; margin-bottom: 20px; }
  .login-card h1 { font-size: 23px; line-height: 1.5; margin-bottom: 10px; }
  .login-card p { margin-bottom: 28px; }
  .login-card .field input { min-height: 44px !important; }
  .login-card #loginSubmit { min-height: 44px; }
  .login-error { min-height: 16px; }
  /* Respect the existing custom background rather than painting over it. */
  body.has-custom-background .filter-row { background: rgba(var(--ui-panel-rgb), var(--custom-module-soft-opacity, .74)); }
  @media (max-width: 1360px) {
    .app { grid-template-columns: 144px minmax(0, 1fr); }
    .sidebar { padding-inline: 9px; }
    .menu-item { padding-left: 36px; padding-right: 6px; }
    .menu-item::before { left: 10px; }
    .topbar { padding-inline: 18px; }
    .content { padding: 18px; }
    .quote-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
    .form-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .form-grid.compact .span-4 { grid-column: 1 / -1; }
  }
  @media (max-width: 1120px) {
    .topbar { align-items: flex-start; }
    .topbar-actions { max-width: 65%; }
    .quote-grid { grid-template-columns: minmax(0, 1fr); }
    .quote-result-column { position: static; }
    .filter-row .field { flex: 1 1 140px; }
    .filter-row .field.span-2 { flex: 2 1 260px; }
  }
  @media (max-width: 820px) {
    .app { grid-template-columns: 94px minmax(0, 1fr); }
    .sidebar { padding: 14px 6px; }
    .brand-caption { letter-spacing: 0; font-size: 11px; }
    .menu-item { text-align: center; padding: 34px 2px 10px; font-size: 12px; }
    .menu-item::before { top: 10px; left: calc(50% - 9px); }
    .flyout { left: calc(100% + 6px); }
    .topbar { flex-wrap: wrap; padding: 12px; }
    .topbar-actions { max-width: 100%; }
    .content { padding: 12px; }
    .workspace-context { font-size: 16px; }
    .card { padding: 14px; }
    .card h3 { font-size: 15px; }
    .filter-row { padding: 10px; gap: 10px; }
    .form-grid, .form-grid.compact, .quote-customer-card .form-grid, .modal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-3, .span-4, .form-grid.compact .span-3 { grid-column: 1 / -1; }
    .modal-backdrop { padding: 10px; }
    .modal { max-height: 94dvh; max-width: 100%; }
    .modal-header, .modal-footer { padding: 13px 14px; }
    .modal-body { padding: 14px; }
    .modal-section { padding: 12px; }
    .modal-footer { flex-wrap: wrap; }
    .list-pagination-actions, .history-pagination-actions { justify-content: flex-start; }
  }
  @media (max-width: 760px) {
    .app.customer-mode, .app.vendor-mode { grid-template-columns: minmax(0, 1fr); }
    .app.customer-center-view .workspace-context, .app.vendor-center-view .workspace-context { display: none; }
  }
  @media (max-width: 520px) {
    .app:not(.customer-mode):not(.vendor-mode) { grid-template-columns: 76px minmax(0, 1fr); }
    .sidebar .brand-mark { transform: scale(.68); margin-block: -14px; }
    .sidebar .logo { margin-bottom: 16px; padding-bottom: 16px; }
    .content { padding: 10px; }
    .card { padding: 12px; }
    .topbar-actions { gap: 5px; justify-content: flex-start; }
    .topbar-actions .btn { padding-inline: 8px; }
    .filter-row .field, .filter-row .field.span-2 { min-width: 0; flex-basis: 100%; }
    .filter-row > .btn { flex-grow: 1; }
    .quote-customer-card .form-grid, .form-grid, .form-grid.compact, .modal-grid { grid-template-columns: minmax(0, 1fr); }
    .span-2, .span-3, .span-4 { grid-column: 1 / -1; }
    .card h3 > span:has(.btn) { width: 100%; }
    .list-pagination-size { width: 100%; }
    .list-pagination-actions, .history-pagination-actions { gap: 4px; }
    .list-pagination .btn.small { padding-inline: 7px; }
    .login-card { padding: 28px 24px; }
    .cc-toolbar, .vc-toolbar { gap: 10px; padding: 12px; }
    .cc-order-summary { padding: 10px; }
    .finance-design-plate-summary, .finance-handle-summary, .paper-intake-summary,
    .blade-library-summary { grid-template-columns: minmax(0, 1fr); }
  }
  @media (prefers-reduced-motion: reduce) {
    .btn, .menu-item, .field input, .data-table tbody tr:hover td { transition: none; }
  }
}

/* v61 layout pass: explicit working areas, not a recolouring of the old grid. */
@media screen {
  .ws-field-group { min-width: 0; margin: 0; }
  .ws-nav-toggle, .ws-nav-scrim { display: none; }
  .field input[readonly], .field textarea[readonly] { background-color: var(--ui-panel-soft) !important; }
  .ws-group-title { margin: 0 0 11px; font-size: 13px; color: var(--ui-title); font-weight: 650; }
  .ws-field-grid { display: grid; grid-template-columns: repeat(var(--ws-columns, 4), minmax(0, 1fr)); gap: 12px; align-items: start; }
  .ws-field-grid > .ws-layout-field { grid-column: span var(--ws-field-span, 1); min-width: 0; }
  .ws-quote-sections { display: grid; gap: 0; counter-reset: quote-section; }
  .ws-quote-sections > .ws-field-group { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
  .ws-quote-sections > .ws-field-group:first-child { padding-top: 0; }
  .ws-quote-sections > .ws-field-group:last-child { border-bottom: 0; padding-bottom: 6px; }
  .ws-quote-sections .ws-group-title { display: flex; align-items: center; gap: 8px; }
  .ws-quote-sections .ws-group-title::before { counter-increment: quote-section; content: counter(quote-section, decimal-leading-zero); font: 600 10px/23px "Segoe UI",sans-serif; width: 23px; height: 23px; text-align: center; border-radius: 6px; background: var(--brand-soft); color: var(--brand-dark); }
  .quote-customer-card .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quote-customer-card .field:has(#customer_name) { grid-column: span 2; }
  .quote-customer-card .field:has(#customer_follow_record) { grid-column: 1 / -1; }
  .ws-customer-profile { margin-top: 13px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
  .ws-customer-profile summary, .ws-production-reference summary { font-size: 12px; color: var(--muted); cursor: pointer; }
  .ws-customer-profile .customer-profile-strip { margin-top: 10px; }
  .quote-form-card > .actions { position: sticky; bottom: 12px; z-index: 4; margin: 16px -6px -6px; padding: 12px; background: var(--ui-panel); border: 1px solid var(--ui-border); border-radius: 9px; box-shadow: 0 5px 24px var(--ui-shadow-tint); }
  .quote-form-card > .actions .btn:first-child { min-width: 120px; }
  .quote-form-card > .actions .btn:last-child:not(.primary) { margin-left: auto; }
  .quote-result-column { max-height: calc(100dvh - 114px); overflow-y: auto; scrollbar-width: thin; padding: 1px 3px 6px 1px; }
  .ws-quote-breakdowns { grid-template-columns: minmax(0, 1fr); margin-top: 0; gap: 12px; }
  .ws-quote-breakdowns .card { padding: 14px 16px; }
  .ws-quote-breakdowns table { min-width: 0; }
  .ws-filter-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 16px; }
  .ws-filter-fields { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 12px; grid-column: 1 / -1; }
  .ws-filter-fields > .field { grid-column: span var(--ws-filter-span,2); min-width: 0 !important; margin: 0; }
  .ws-filter-secondary { grid-column: 1; padding-top: 12px; border-top: 1px solid var(--ui-border); }
  .ws-filter-actions { grid-column: 2; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
  .ws-filter-layout:not(:has(.ws-filter-secondary)) { grid-template-columns: minmax(0,1fr) auto; }
  .ws-filter-layout:not(:has(.ws-filter-secondary)) .ws-filter-fields { grid-column: 1; }
  .ws-filter-actions > .btn { white-space: nowrap; min-height: 38px; }
  .ws-data-tools { position: relative; font-weight: 500; }
  .ws-data-tools > summary { list-style: none; cursor: pointer; gap: 10px; }
  .ws-data-tools > summary::after { content: '⌄'; }
  .ws-data-tools > summary::-webkit-details-marker { display: none; }
  .ws-data-popover { position: absolute; top: calc(100% + 7px); right: 0; z-index: 12; display: grid; gap: 5px; padding: 8px; min-width: 210px; border-radius: 9px; background: var(--ui-panel); border: 1px solid var(--ui-border); box-shadow: var(--shadow); }
  .ws-data-popover .btn { justify-content: flex-start; border: 0; background: transparent; }
  .ws-data-popover .btn:hover { background: var(--brand-soft); }
  .ws-deal-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .ws-deal-layout > .ws-field-group { border: 1px solid var(--ui-border); padding: 16px; border-radius: 10px; }
  .ws-deal-layout > .ws-field-group:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; background: var(--ui-panel-soft); }
  .ws-deal-layout > .ws-field-group:first-child .ws-group-title { grid-column: 1 / -1; }
  .ws-deal-layout .deal-schedule-hint { grid-column: auto; align-self: stretch; margin: 0; }
  .ws-full-row { grid-column: 1 / -1; }
  .ws-deal-layout .deal-options-row { margin: 0 0 12px; padding: 0; background: transparent; }
  #inquiryModalBackdrop .modal-section { padding: 0; border: 0; background: transparent; }
  #inquiryModalBackdrop .modal-section > .section-title { display: none; }
  #logisticsModalBackdrop > .modal { width: min(1200px, 96vw) !important; }
  .ws-logistics-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(270px,1fr); gap: 20px; align-items: start; }
  .ws-logistics-edit { display: grid; gap: 20px; }
  .ws-logistics-edit > .ws-field-group { padding-bottom: 18px; border-bottom: 1px solid var(--ui-border); }
  .ws-logistics-edit > .ws-field-group:last-child { padding-bottom: 0; border: 0; }
  .ws-logistics-preview { position: sticky; top: 0; display: grid; gap: 22px; border-radius: 11px; border: 1px solid var(--ui-border); padding: 16px; background: var(--ui-panel-soft); }
  .ws-logistics-preview .field > label { display: none; }
  .ws-logistics-preview textarea#logistics_edit_pickup_info { min-height: 230px !important; background: #fff; line-height: 1.8; resize: vertical; color: var(--text); }
  .ws-pickup-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .ws-pickup-toolbar label { margin: 0; }
  .ws-pickup-toolbar .btn { flex-shrink: 0; }
  .ws-logistics-preview .logistics-artwork-preview { width: 100%; min-height: 140px; justify-content: center; }
  .ws-logistics-preview .logistics-artwork-preview img { max-height: 200px; width: auto; max-width: 100%; object-fit: contain; }
  .ws-logistics-preview input[type="file"] { width: 100%; min-width: 0; font-size: 11px; }
  .ws-logistics-preview input::file-selector-button { border: 0; border-right: 1px solid var(--ui-border); background: var(--ui-panel-soft); color: var(--text); padding: 8px 10px; margin-right: 8px; cursor: pointer; }
  .ws-tab-panel table :is(input,select):not([type="checkbox"]) { min-height: 32px; min-width: 0; max-width: 100%; border: 1px solid var(--ui-border); border-radius: 6px; padding: 5px 7px; background: #fff; color: var(--text); }
  .ws-logistics-edit .logistics-common-address { display: grid; grid-template-columns: minmax(130px,1fr) auto auto; gap: 8px; padding: 10px; border-radius: 8px; background: var(--ui-panel-soft); }
  .ws-logistics-edit .logistics-common-address textarea { grid-row: 2; grid-column: 1 / -1; min-height: 60px; }
  .ws-logistics-edit .logistics-common-address .btn { grid-row: 1; min-height: 36px; }
  .ws-logistics-edit .logistics-common-address select { min-width: 0; width: 100%; grid-column: 1; grid-row: 1; }
  .ws-logistics-edit .logistics-common-address button:nth-of-type(1) { grid-column: 2; }
  .ws-logistics-edit .logistics-common-address button:nth-of-type(2) { grid-column: 3; }
  .ws-panel-hint { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
  #adminUsersModalBackdrop > .modal { width: min(1200px,96vw) !important; }
  .ws-section-tabs { display: flex; gap: 6px; position: sticky; top: -20px; background: var(--ui-panel); padding: 4px 0 12px; border-bottom: 1px solid var(--ui-border); z-index: 5; }
  .ws-section-tab { border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 10px 14px; font: inherit; }
  .ws-section-tab[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
  .ws-tab-panel { display: grid; gap: 16px; min-width: 0; }
  .ws-tab-panel[hidden] { display: none; }
  #ws-account-panel-0 { grid-template-columns: 260px minmax(0,1fr); align-items: start; }
  #ws-account-panel-0 > .modal-section:first-child .modal-grid { grid-template-columns: minmax(0,1fr); }
  #ws-account-panel-0 .table-wrap { max-height: 60dvh; }
  .ws-shipment-choice .modal-grid { grid-template-columns: minmax(0,1fr); }
  .ws-shipment-choice .modal-grid .span-2 { grid-column: 1 / -1; }
  .ws-shipment-choice .modal-footer { display: grid; grid-template-columns: 1fr 1fr; }
  .ws-shipment-choice .modal-footer > .btn:first-child { grid-row: 2; grid-column: 1 / -1; justify-self: end; }
  .ws-production-reference { grid-column: 1 / -1; padding: 10px 12px; background: var(--ui-panel-soft); border-radius: 8px; }
  .ws-production-reference .field { margin-top: 10px; }
  .production-board-grid { gap: 22px; }
  .production-board-grid > .card > h3 { align-items: center; }
  .production-board-grid .table-wrap { max-height: 55dvh; }
  .production-text-grid { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); }
  #followupModalBackdrop .modal { width: min(760px,96vw); }
  #followupModalBackdrop .modal-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #followupModalBackdrop .field:has(#followup_edit_follower) { grid-column: 3; grid-row: 1; }
  #followupModalBackdrop .field:has(#followup_edit_final_date),
  #followupModalBackdrop .field:has(#followup_edit_ship_date) { grid-row: 2; }
  @media (max-width: 1120px) {
    .quote-result-column { max-height: none; overflow: visible; }
    .ws-quote-breakdowns { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .ws-filter-fields > .field { grid-column: span 4; }
    .ws-filter-fields > .field:has(input:not([type="date"]):not([type="number"])) { grid-column: span 6; }
    .ws-filter-secondary { grid-column: 1 / -1; }
    .ws-filter-actions { grid-column: 1 / -1; }
    .ws-filter-layout:not(:has(.ws-filter-secondary)) .ws-filter-fields { grid-column: 1 / -1; }
    .ws-logistics-layout { grid-template-columns: minmax(0,1.4fr) minmax(250px,1fr); gap: 14px; }
    .ws-logistics-edit .ws-field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ws-logistics-edit .ws-layout-field { grid-column: auto; }
    .ws-logistics-edit .ws-layout-field:is(.ws-span-2,.ws-span-3,.ws-span-4) { grid-column: 1 / -1; }
    #ws-account-panel-0 { grid-template-columns: minmax(0,1fr); }
    #ws-account-panel-0 > .modal-section:first-child .modal-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  }
  @media (max-width: 760px) {
    .app:not(.customer-mode):not(.vendor-mode) { display: block; }
    .app.locked { display: none !important; }
    .app:not(.customer-mode):not(.vendor-mode) .sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; height: 100dvh; overflow-y: auto; transform: translateX(-101%); visibility: hidden; z-index: 50; padding: 18px 12px; }
    .app.ws-nav-open:not(.customer-mode):not(.vendor-mode) .sidebar { transform: translateX(0); visibility: visible; }
    .app:not(.customer-mode):not(.vendor-mode) .ws-nav-toggle { display: inline-flex; }
    .ws-nav-open .ws-nav-scrim { display: block; position: fixed; inset: 0; border: 0; background: rgba(20,28,38,.35); z-index: 49; }
    .app:not(.customer-mode):not(.vendor-mode) .sidebar .menu-item { padding: 12px 10px 12px 38px; text-align: left; }
    .app:not(.customer-mode):not(.vendor-mode) .sidebar .menu-item::before { top: 13px; left: 10px; }
    .app:not(.customer-mode):not(.vendor-mode) .sidebar .flyout,
    .app:not(.customer-mode):not(.vendor-mode) .sidebar .nested-flyout { position: static; width: auto; margin: 10px -6px -6px -30px; box-shadow: none; border-color: var(--line-soft); }
    .app:not(.customer-mode):not(.vendor-mode) .sidebar .nested-flyout { margin: 6px 0 0; }
    .app:not(.customer-mode):not(.vendor-mode) .topbar { gap: 8px 12px; }
    .app:not(.customer-mode):not(.vendor-mode) .topbar-actions { width: 100%; justify-content: flex-start; }
    .cc-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .cc-toolbar .cc-filter-search, .cc-toolbar > .btn { grid-column: 1 / -1; }
    .vc-toolbar { grid-template-columns: minmax(0,1fr) 88px; }
    .vc-toolbar .vc-filter:first-child { grid-column: 1 / -1; }
    .ws-field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ws-field-grid > .ws-layout-field { grid-column: auto; }
    .ws-field-grid > .ws-layout-field:is(.ws-span-2,.ws-span-3,.ws-span-4) { grid-column: 1 / -1; }
    .ws-quote-breakdowns { grid-template-columns: minmax(0,1fr); }
    .ws-logistics-layout, .ws-deal-layout { grid-template-columns: minmax(0,1fr); }
    .ws-logistics-preview { position: static; }
    .ws-deal-layout > .ws-field-group:first-child { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .ws-deal-layout .deal-schedule-hint { grid-column: 1; }
    .ws-filter-fields > .field { grid-column: span 6; }
    .ws-filter-fields > .field:has(input:not([type="date"]):not([type="number"])) { grid-column: 1 / -1; }
    .ws-filter-actions { flex-wrap: wrap; }
    .ws-section-tabs { top: -14px; gap: 2px; }
    .ws-section-tab { padding: 9px 8px; font-size: 12px; }
    #ws-account-panel-0 > .modal-section:first-child .modal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .production-text-grid { grid-template-columns: minmax(0,1fr); }
    #followupModalBackdrop .modal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    #followupModalBackdrop .field:has(#followup_edit_follower),
    #followupModalBackdrop .field:has(#followup_edit_final_date),
    #followupModalBackdrop .field:has(#followup_edit_ship_date) { grid-column: auto; grid-row: auto; }
  }
  @media (max-width: 520px) {
    .quote-customer-card .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ws-filter-actions > .btn { flex: 1 1 auto; }
    .quote-form-card > .actions { position: static; margin: 14px 0 0; }
    .quote-form-card > .actions .btn:first-child { min-width: 0; }
    .ws-field-grid > .field { grid-column: 1 / -1; }
    .ws-logistics-edit .ws-field-grid > .field { grid-column: 1 / -1; }
    .ws-shipment-choice .modal-footer { grid-template-columns: minmax(0,1fr); }
    .ws-shipment-choice .modal-footer > .btn:first-child { grid-row: auto; order: 3; }
    .ws-data-popover { position: fixed; top: auto; right: 12px; left: 90px; min-width: 0; }
  }
}
