:root {
    --black: #161616;
    --ink: #272727;
    --muted: #777;
    --line: #d8d8d4;
    --soft: #f4f4f1;
    --white: #fff;
    --danger: #b42318;
    --nav-primary-width: 96px;
    --nav-secondary-width: 148px;
    --sidebar-width: calc(var(--nav-primary-width) + var(--nav-secondary-width));
    --nav-brand-height: 56px;
    --nav-utility-height: 0px;
    --topbar-height: 56px;
    --content-padding: 24px;
    --font-body: 13px;
    --font-small: 12px;
    --font-topbar: 16px;
    --font-page-title: 22px;
    --font-section-title: 16px;
    --font-card-title: 17px;
    --font-stat: 26px;
    --control-height: 32px;
    --control-padding-x: 12px;
    --table-padding-y: 8px;
    --table-padding-x: 12px;
    --row-line-height: 1.42;
    --list-table-header-height: 32px;
    --list-table-row-height: 32px;
    --list-table-target-height: 700px; /* 32px header + 20 rows * 32px + scrollbar/border room */
}

@media (min-width: 1440px) {
    :root {
        --nav-secondary-width: 148px;
        --topbar-height: 56px;
        --content-padding: 24px;
        --font-body: 13px;
        --font-small: 12px;
        --font-topbar: 16px;
        --font-page-title: 22px;
        --font-section-title: 16px;
        --font-card-title: 17px;
        --font-stat: 26px;
        --control-height: 32px;
        --control-padding-x: 12px;
        --table-padding-y: 8px;
        --table-padding-x: 12px;
    }
}

@media (max-width: 900px) {
    :root {
        --content-padding: 16px;
        --font-body: 12px;
        --font-small: 12px;
        --font-topbar: 15px;
        --font-page-title: 20px;
        --font-section-title: 15px;
        --font-card-title: 16px;
        --font-stat: 24px;
        --control-height: 32px;
        --control-padding-x: 10px;
        --table-padding-y: 7px;
        --table-padding-x: 10px;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    color: var(--ink);
    background: #f7f7f5;
    font-family: "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    font-size: var(--font-body);
    line-height: var(--row-line-height);
    letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: var(--nav-brand-height) minmax(0, 1fr);
    min-height: 100vh;
}
.app-shell.nav-secondary-collapsed {
    --sidebar-width: var(--nav-primary-width);
}
.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-row: 1 / 3;
    height: 100vh;
    padding: 0;
    color: #eee;
    background: var(--black);
    display: grid;
    grid-template-rows: var(--nav-brand-height) minmax(0, 1fr);
}
.sidebar::after {
    content: "";
    position: absolute;
    top: var(--nav-brand-height);
    right: 0;
    bottom: 0;
    width: 1px;
    background: #d8d8d4;
    pointer-events: none;
}
.app-shell.nav-secondary-collapsed .sidebar::after {
    background: #2b2b2b;
}
.sidebar-brand {
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 0 14px;
    background: var(--black);
    border-bottom: 1px solid #333;
}
.brand-row {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: nowrap;
    padding: 0;
}
.brand { color: #fff; font-size: 34px; font-weight: 800; line-height: 1; }
.brand-version {
    color: #8f8f8f;
    font-size: 7px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}
.brand-subtitle {
    display: none;
}
.app-shell.nav-secondary-collapsed .brand-row {
    align-items: flex-start;
}
.app-shell.nav-secondary-collapsed .brand {
    font-size: 31px;
}
.app-shell.nav-secondary-collapsed .brand-version {
    display: none;
}
.app-shell.nav-secondary-collapsed .brand-subtitle {
    font-size: 10px;
}
.sidebar nav {
    grid-row: 2;
    position: relative;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    background: #111;
}
.sidebar nav::before {
    content: "";
    position: absolute;
    left: var(--nav-primary-width);
    top: 0;
    right: 0;
    bottom: 0;
    background: #f7f7f5;
    border-left: 1px solid #d8d8d4;
    pointer-events: none;
}
.nav-section {
    display: block;
    width: var(--nav-primary-width);
}
.nav-section-panel {
    position: absolute;
    left: var(--nav-primary-width);
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: none;
    min-height: 0;
    max-height: none;
    overflow: auto;
    background: #f7f7f5;
    scrollbar-width: thin;
    scrollbar-color: #c5c5c0 transparent;
}
.nav-section[open] > .nav-section-panel {
    display: block;
}
.app-shell.nav-secondary-collapsed .sidebar nav::before,
.app-shell.nav-secondary-collapsed .nav-section-panel {
    display: none !important;
}
.nav-section > summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    align-self: start;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 8px 8px;
    color: #c9c9c9;
    background: #111;
    border: 0;
    border-bottom: 1px solid #2b2b2b;
    cursor: pointer;
    user-select: none;
    list-style: none;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-section > summary::before {
    content: none;
}
.nav-section > summary:hover {
    color: #fff;
    background: #1f1f1f;
}
.nav-section[open] > summary {
    color: #111;
    background: #fff;
    border-bottom-color: #fff;
    font-weight: 800;
}
.nav-group { margin: 18px 8px 8px; color: #777; font-size: 12px; font-weight: 600; }
.sidebar nav a {
    display: block;
    min-height: 28px;
    padding: 6px 10px;
    border-left: 3px solid transparent;
    color: #242424;
    font-size: 12px;
    font-weight: 600;
}
.sidebar nav .nav-section-panel > a,
.sidebar nav .nav-section-panel > .nav-disabled {
    position: relative;
    margin-left: 0;
    padding-left: 18px;
}
.nav-section-panel > a::before,
.nav-section-panel > .nav-disabled::before,
.nav-section-panel > a::after,
.nav-section-panel > .nav-disabled::after {
    content: none;
}
.sidebar nav a:hover {
    color: #111;
    background: #ecece8;
    border-left-color: #999;
}
.sidebar nav a.is-current {
    color: #111;
    background: #e4e4df;
    border-left-color: #111;
    font-weight: 700;
}
.sidebar nav > a {
    margin: 0;
    padding: 9px 12px;
    color: #f5f5f5;
    background: #111;
    border-left-color: transparent;
    border-bottom: 1px solid #2e2e2e;
    font-size: 13px;
    font-weight: 700;
}
.sidebar nav > a:hover,
.sidebar nav > a.is-current {
    color: #fff;
    background: #222;
    border-left-color: #fff;
}
.quick-nav {
    position: relative;
    width: var(--nav-primary-width);
    margin: 0;
    min-height: 0;
    padding: 7px 0 8px;
    background: transparent;
    border-bottom: 1px solid #2b2b2b;
}
.quick-nav > summary {
    justify-content: center;
    width: calc(100% - 18px);
    height: 32px;
    min-height: 32px;
    margin: 10px 9px 8px;
    padding: 0 8px;
    color: #d6d6d6;
    background: transparent;
    border: 1px solid #565656;
    font-size: 12px;
    font-weight: 700;
}
.quick-nav > summary:hover {
    color: #fff;
    background: #1f1f1f;
    border-color: #888;
}
.quick-nav[open] > summary {
    color: #111;
    background: #fff;
    border-color: #fff;
}
.quick-nav-list {
    display: grid;
    gap: 2px;
}
.quick-nav-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: center;
}
.quick-nav-item a {
    margin: 0;
    min-height: 22px;
    padding: 4px 3px 4px 2px;
    color: #c9c9c9;
    background: #111;
    border-left: 2px solid transparent;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar nav .quick-nav .quick-nav-item a {
    padding: 4px 3px 4px 2px;
    border-left-width: 2px;
    color: #c9c9c9;
    background: #111;
}
.quick-nav-custom,
.quick-nav-remove {
    min-height: 22px;
    color: #c9c9c9;
    background: #111;
    border: 1px solid #4a4a4a;
    cursor: pointer;
    font-weight: 700;
}
.quick-nav-custom {
    width: 58px;
    min-height: 24px;
    margin: 0 0 6px 6px;
    padding: 0 6px;
    text-align: center;
    font-size: 11px;
}
.quick-nav-custom[aria-expanded="true"] {
    color: #111;
    background: #fff;
    border-color: #fff;
}
.quick-nav-custom:hover,
.quick-nav-remove:hover {
    color: #fff;
    background: #222;
    border-color: #777;
}
.quick-nav-item a:hover {
    color: #fff;
    background: #1f1f1f;
    border-left-color: #777;
}
.quick-nav-item a.is-current {
    color: #fff;
    background: #1f1f1f;
    border-left-color: #fff;
}
.sidebar nav .quick-nav .quick-nav-item a.is-current {
    color: #fff;
    background: #1f1f1f;
    border-left-color: #fff;
}
.quick-nav-remove {
    width: 16px;
    height: 18px;
    min-height: 18px;
    margin-right: 0;
    padding: 0;
    color: #c9c9c9;
    border: 0;
    line-height: 16px;
}
.quick-nav-empty {
    padding: 2px 0;
    color: #666;
    font-size: 11px;
}
.quick-nav-picker {
    position: absolute;
    left: var(--nav-primary-width);
    top: -7px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: var(--quick-nav-picker-width, var(--nav-secondary-width));
    height: calc(100vh - var(--nav-brand-height));
    margin: 0;
    padding: 0;
    color: #242424;
    border: 0;
    border-left: 1px solid #d8d8d4;
    border-right: 1px solid #d8d8d4;
    background: #f7f7f5;
    box-shadow: 8px 0 18px rgba(0, 0, 0, .08);
}
.quick-nav-picker[hidden] {
    display: none;
}
.quick-nav-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 12px 12px;
    background: #fff;
    border-bottom: 1px solid #d8d8d4;
}
.quick-nav-picker-head > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.quick-nav-picker-head strong {
    color: #111;
    font-size: 14px;
    font-weight: 800;
}
.quick-nav-picker-head span {
    color: #777;
    font-size: 11px;
    line-height: 1.45;
}
.quick-nav-picker-close {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #555;
    background: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 18px;
    line-height: 24px;
}
.quick-nav-picker-close:hover {
    color: #111;
    background: #ecece8;
    border-color: #999;
}
.quick-nav-options {
    min-height: 0;
    padding: 6px 0 18px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c5c5c0 transparent;
}
.quick-nav-picker-group {
    margin: 10px 12px 4px;
    color: #111;
    font-size: 12px;
    font-weight: 800;
}
.quick-nav-picker-subgroup {
    margin: 8px 12px 3px;
    color: #777;
    font-size: 11px;
    font-weight: 700;
}
.quick-nav-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 5px 12px;
    color: #242424;
    border-bottom: 1px solid #e6e6e2;
    font-size: 12px;
}
.quick-nav-option span {
    min-width: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.quick-nav-option button {
    min-height: 26px;
    padding: 0 5px;
    color: #333;
    background: #fff;
    border: 1px solid #aaa;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}
.quick-nav-option button:hover {
    color: #111;
    background: #e8e8e4;
    border-color: #777;
}
.quick-nav-option button.is-locked {
    color: #fff;
    background: #161616;
    border-color: #161616;
}
.app-shell.quick-nav-picker-open .sidebar nav::before {
    display: block !important;
}
.app-shell.quick-nav-picker-open .nav-section-panel {
    display: none !important;
}
.app-shell.quick-nav-picker-open .nav-secondary-toggle,
.app-shell.quick-nav-picker-open .nav-secondary-resizer {
    display: none;
}
.nav-subsection {
    min-width: 0;
    margin: 4px 8px 8px;
    padding: 0 0 6px;
    border: 0;
    border-bottom: 1px solid #e0e0dc;
    background: transparent;
}
.nav-subsection > summary {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    min-height: 32px;
    padding: 7px 10px;
    color: #666;
    background: #ededeb;
    border: 1px solid #e0e0dc;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-size: 12px;
    font-weight: 800;
}
.nav-subsection > summary::-webkit-details-marker { display: none; }
.nav-subsection > summary::before {
    content: "›";
    width: 8px;
    color: #888;
    transition: transform .15s ease;
}
.nav-subsection[open] > summary::before { transform: rotate(90deg); }
.nav-subsection > summary:hover { color: #111; background: #e5e5e1; }
.nav-subsection.is-current-branch > summary {
    color: #111;
    background: #e2e2de;
}
.nav-subsection a,
.nav-subsection .nav-disabled {
    position: relative;
    min-height: 34px;
    margin-left: 0;
    padding: 8px 8px 8px 24px;
    border-left: 3px solid transparent;
    font-size: 12.5px;
    font-weight: 600;
}
.nav-subsection a::before,
.nav-subsection .nav-disabled::before,
.nav-subsection a::after,
.nav-subsection .nav-disabled::after {
    content: none;
}
.nav-subsection a.is-current {
    background: #deded9;
    border-left-color: #111;
}
.nav-section > a + .nav-subsection,
.nav-section > summary + a + .nav-subsection {
    border-top: 0;
}
.nav-subgroup-title {
    margin: 12px 10px 4px 22px;
    padding-top: 8px;
    color: #9c9c9c;
    border-top: 1px solid #e2e2de;
    font-size: 12px;
    font-weight: 600;
}
.nav-section summary + .nav-subgroup-title,
.nav-section summary + a + .nav-subgroup-title { border-top: 0; }
.nav-disabled {
    display: block;
    padding: 7px 12px 7px 26px;
    color: #777;
    border-left: 3px solid transparent;
    cursor: not-allowed;
}
.nav-logout-form {
    margin: 6px 10px 0 18px;
}
.nav-logout-form button {
    width: 100%;
    height: var(--control-height);
    padding: 0 var(--control-padding-x);
    color: #242424;
    background: transparent;
    border: 1px solid #b8b8b2;
    cursor: pointer;
    text-align: left;
    font-weight: 600;
}
.nav-logout-form button:hover {
    background: #ecece8;
}
.nav-secondary-toggle {
    position: absolute;
    top: calc(var(--nav-brand-height) + 8px);
    right: -10px;
    z-index: 35;
    display: flex;
    width: 20px;
    height: 28px;
    align-items: center;
    justify-content: center;
    color: #555;
    background: #f7f7f5;
    border: 1px solid #d8d8d4;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.nav-secondary-toggle:hover {
    color: #111;
    background: #fff;
}
.app-shell.nav-secondary-collapsed .nav-secondary-toggle {
    right: -10px;
    color: #ddd;
    background: #111;
    border-color: #333;
}
.nav-secondary-resizer {
    position: absolute;
    top: var(--nav-brand-height);
    right: -5px;
    bottom: 0;
    z-index: 34;
    width: 10px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: col-resize;
}
.nav-secondary-resizer::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4px;
    width: 1px;
    background: #d8d8d4;
}
.nav-secondary-resizer::after {
    content: "";
    position: absolute;
    top: 42px;
    left: -1px;
    width: 9px;
    height: 30px;
    background:
        linear-gradient(#777, #777) center 8px / 1px 10px no-repeat,
        linear-gradient(#777, #777) center 18px / 1px 10px no-repeat,
        #f7f7f5;
    border: 1px solid #d8d8d4;
}
.nav-secondary-resizer:hover::before,
.app-shell.is-nav-resizing .nav-secondary-resizer::before {
    background: #888;
}
.nav-secondary-resizer:hover::after,
.app-shell.is-nav-resizing .nav-secondary-resizer::after {
    border-color: #888;
}
.app-shell.nav-secondary-collapsed .nav-secondary-resizer {
    display: none;
}

.main {
    position: relative;
    grid-column: 2;
    grid-row: 1 / 3;
    display: grid;
    grid-template-rows: var(--nav-brand-height) minmax(0, 1fr);
    min-width: 0;
    min-height: 100vh;
}
.packing-workspace-shell {
    grid-template-columns: minmax(0, 1fr);
}
.packing-workspace-shell .main {
    grid-column: 1;
}
.packing-workspace-header {
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
    height: var(--nav-brand-height);
    padding: 0 var(--content-padding);
    color: #fff;
    background: var(--black);
    border-bottom: 1px solid #333;
}
.packing-workspace-brand,
.packing-workspace-account,
.packing-workspace-account form {
    display: flex;
    align-items: center;
}
.packing-workspace-brand {
    gap: 14px;
}
.packing-workspace-brand strong {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}
.packing-workspace-brand span,
.packing-workspace-account span {
    color: #d6d6d6;
    font-size: 13px;
    font-weight: 600;
}
.packing-workspace-account {
    gap: 14px;
}
.packing-workspace-account button {
    height: 30px;
    padding: 0 12px;
    color: #eee;
    background: #222;
    border: 1px solid #555;
    cursor: pointer;
}
.packing-workspace-account button:hover {
    color: #111;
    background: #fff;
}
.workspace-tabs {
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: end;
    gap: 6px;
    min-width: 0;
    padding: 0 14px 8px;
    background: var(--black);
    border-bottom: 1px solid #333;
}
.mobile-nav-toggle,
.mobile-nav-backdrop {
    display: none;
}
.workspace-tab-list {
    display: flex;
    align-items: end;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}
.workspace-home-tab,
.workspace-current-tab {
    display: inline-flex;
    align-items: center;
    height: 28px;
    max-width: 180px;
    color: #d6d6d6;
    background: #1d1d1d;
    border: 1px solid #343434;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
}
.workspace-home-tab {
    padding: 0 10px;
}
.workspace-current-tab {
    background: #222;
    border-color: #333;
}
.workspace-current-tab a {
    min-width: 0;
    padding: 0 8px 0 10px;
    color: #d8d8d8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.workspace-current-tab.is-current {
    background: #f7f7f5;
    border-color: #f7f7f5;
}
.workspace-current-tab.is-current a {
    color: #111;
}
.workspace-current-tab button {
    width: 24px;
    height: 26px;
    padding: 0;
    color: #aaa;
    background: transparent;
    border: 0;
    border-left: 1px solid #333;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}
.workspace-current-tab.is-current button {
    color: #555;
    border-left-color: #d8d8d4;
}
.workspace-current-tab button:hover {
    color: #111;
    background: #ecece8;
}
.main:has(.packing-detail-tabs) {
    height: 100vh;
    overflow: hidden;
}
.topbar {
    height: var(--topbar-height); padding: 0 var(--content-padding); border-bottom: 1px solid var(--line); background: #fff;
    display: flex; align-items: center; justify-content: space-between;
}
.topbar strong { font-size: var(--font-topbar); }
.topbar span { color: var(--muted); }
.topbar-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.topbar-meta b,
.topbar-meta em {
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
}
.topbar-meta b {
    padding: 3px 7px;
    color: #333;
    background: #f3f0e8;
    border: 1px solid #ddd6c8;
}
.topbar-meta em { color: #777; }
.content {
    grid-row: 2;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding: var(--content-padding);
}
.app-shell.nav-secondary-collapsed .content {
    padding-left: calc(var(--content-padding) + 14px);
}
.content:has(> .packing-detail-tabs) {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: calc(100vh - var(--nav-brand-height));
    min-height: calc(100vh - var(--nav-brand-height));
    padding-top: 0;
    padding-bottom: 8px;
    overflow: hidden;
}
.content:has(.list-table) {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: calc(100vh - var(--nav-brand-height));
    min-height: calc(100vh - var(--nav-brand-height));
    padding-bottom: 8px;
    overflow: hidden;
}
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 18px; }
.page-heading h1 { margin: 0 0 4px; font-size: var(--font-page-title); line-height: 1.2; }
.page-heading p { margin: 0; color: var(--muted); }
.total-page-heading {
    align-items: center;
    margin-bottom: 6px;
}
.total-page-heading h1 {
    margin-bottom: 1px;
    font-size: 18px;
    line-height: 1.08;
}
.total-page-heading p {
    font-size: 12px;
    line-height: 1.2;
}

.button {
    display: inline-flex; min-height: var(--control-height); padding: 0 var(--control-padding-x); align-items: center; justify-content: center;
    border: 1px solid #aaa; background: #fff; color: var(--ink); cursor: pointer;
    line-height: 1.2;
}
.button:hover { border-color: var(--black); }
.button.primary { color: #fff; background: var(--black); border-color: var(--black); }
.button.danger { color: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: #fff0ed; }
.button.small { min-height: 30px; padding: 0 10px; font-size: var(--font-small); }
.button.full { width: 100%; }

.label-designer {
    margin: calc(var(--content-padding) * -1);
    height: calc(100vh - 0px);
    min-height: 0;
    background: #222;
    color: #eee;
    overflow: hidden;
}
.label-designer-toolbar {
    min-height: 52px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: #343434;
    border-bottom: 1px solid #151515;
}
.designer-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-right: 8px;
    margin-right: 4px;
    border-right: 1px solid #575757;
}
.designer-tool-group-title {
    color: #aaa;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.tool-button {
    min-height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f2f2f2;
    background: #444;
    border: 1px solid #5c5c5c;
    cursor: pointer;
    font-size: 12px;
}
.tool-button:hover { background: #505050; border-color: #777; }
.tool-button.is-active {
    color: #111;
    background: #ffd34d;
    border-color: #ffd34d;
    font-weight: 700;
}
.tool-separator { width: 1px; height: 26px; background: #666; margin: 0 3px; }
.designer-status { margin-left: auto; color: #d8d8d8; font-size: var(--font-small); font-weight: 500; }
.label-insert-popover {
    position: fixed;
    z-index: 40;
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #2c2c2c;
    border: 1px solid #777;
    box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
.label-insert-popover[hidden] { display: none; }
.insert-choice-group { display: flex; gap: 8px; flex-wrap: wrap; max-width: 420px; }
.insert-choice-group[hidden] { display: none; }
.insert-choice-group button {
    min-height: 34px;
    padding: 0 12px;
    color: #f6f6f6;
    background: #444;
    border: 1px solid #777;
    cursor: pointer;
}
.insert-choice-group button:hover { background: #555; border-color: #aaa; }
.label-designer-body {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    height: calc(100vh - 47px);
    min-height: 0;
}
.label-inspector {
    padding: 12px;
    background: #3c3c3c;
    border-right: 1px solid #171717;
    overflow: auto;
}
.label-inspector h2 { margin: 0 0 10px; color: #ffd34d; font-size: 15px; }
.label-inspector label {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
    color: #ddd;
    font-size: 12px;
}
.label-inspector input,
.label-inspector textarea,
.label-inspector select {
    width: 100%;
    padding: 6px 7px;
    color: #111;
    background: #fff;
    border: 1px solid #999;
    min-height: 30px;
}
.inspector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.muted-help { color: #bbb; font-size: var(--font-small); }
.label-designer.canvas-mode {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}
.label-canvas-editor {
    height: calc(100vh - 53px);
    min-height: 0;
    display: grid;
    grid-template-columns: 174px minmax(0, 1fr) 286px;
    overflow: hidden;
}
.label-designer-panel {
    min-height: 0;
    padding: 10px 8px 16px;
    overflow: auto;
    background: #3c3c3c;
    border-color: #171717;
    color: #eee;
}
.label-template-config {
    border-right: 1px solid #171717;
}
.label-field-sidebar {
    border-left: 1px solid #171717;
}
.label-designer-panel h2 {
    margin: 0 0 10px;
    color: #ffd34d;
    font-size: 15px;
}
.label-designer-panel h2:not(:first-child) {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #555;
}
.label-designer-panel label {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #ddd;
}
.label-designer-panel input,
.label-designer-panel select {
    width: 100%;
    min-height: 28px;
    padding: 4px 7px;
    border: 1px solid #999;
    background: #fff;
    color: #111;
    font: inherit;
}
.label-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.label-config-grid .wide {
    grid-column: 1 / -1;
}
.label-object-tools {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}
.label-object-tools button {
    min-height: 42px;
    padding: 7px 8px;
    display: grid;
    gap: 3px;
    text-align: left;
    color: #f2f2f2;
    background: #454545;
    border: 1px solid #666;
    cursor: pointer;
    font: inherit;
}
.label-object-tools button span,
.label-object-tools button strong {
    font-size: 14px;
    font-weight: 800;
}
.label-object-tools button small {
    color: #bdbdbd;
    font-size: 10px;
}
.label-object-tools button:hover {
    background: #515151;
    border-color: #aaa;
}
.label-object-tools button.is-active {
    color: #111;
    background: #ffd34d;
    border-color: #ffd34d;
}
.label-object-tools button.is-active small {
    color: #333;
}
.label-element-summary {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}
.label-element-summary div {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px;
    min-height: 30px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid #555;
    background: #353535;
}
.label-element-summary span {
    color: #bbb;
    font-size: 12px;
}
.label-element-summary strong {
    min-width: 0;
    overflow: hidden;
    color: #f2f2f2;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.label-toggle-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px !important;
}
.label-toggle-row input {
    width: auto;
    min-height: 0;
}
.label-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 10px;
}
.label-mode-switch button,
.label-data-source button {
    min-height: 30px;
    border: 1px solid #666;
    background: #444;
    color: #eee;
    font: inherit;
    cursor: pointer;
}
.label-mode-switch button.is-active {
    border-color: #ffd34d;
    background: #111;
    color: #ffd34d;
    font-weight: 700;
}
.label-data-source {
    margin: 0 0 12px;
    padding: 8px;
    border: 1px solid #555;
    background: #353535;
}
.label-data-source.is-disabled {
    opacity: .55;
}
.label-data-source button {
    width: 100%;
}
.zoom-value {
    margin-top: -4px;
    color: #ffd34d;
    font-weight: 700;
}
.label-canvas-stage {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: 42px minmax(0, 1fr);
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        #202020;
    background-size: 20px 20px;
}
.label-canvas-controlbar {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    border-bottom: 1px solid #151515;
    background: #2f2f2f;
    color: #e5e5e5;
}
.canvas-size-indicator {
    font-size: 13px;
    font-weight: 700;
    color: #ffd34d;
}
.canvas-zoom-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.canvas-zoom-buttons button,
.canvas-zoom-buttons strong {
    min-width: 36px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid #666;
    background: #444;
    color: #f3f3f3;
    font: inherit;
    line-height: 26px;
    text-align: center;
}
.canvas-zoom-buttons button {
    cursor: pointer;
}
.canvas-zoom-buttons button:hover {
    border-color: #aaa;
    background: #555;
}
.canvas-zoom-buttons strong {
    min-width: 52px;
    color: #ffd34d;
}
.label-canvas-workspace {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: 26px minmax(0, 1fr);
    overflow: hidden;
}
.label-canvas-scroll {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: 100%;
    overflow: auto;
    display: grid;
    place-items: center;
    padding: 36px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        #2b2b2b;
    background-size: 18px 18px;
}
.label-canvas-ruler-frame {
    display: block;
}
.label-ruler-corner {
    grid-column: 1;
    grid-row: 1;
    width: 34px;
    height: 26px;
    border-right: 1px solid #6e6e6e;
    border-bottom: 1px solid #6e6e6e;
    background: #2f2f2f;
}
.label-ruler {
    position: relative;
    overflow: hidden;
    background: #d9eef6;
    color: #555;
    font-size: 10px;
    line-height: 1;
    user-select: none;
}
.label-ruler-horizontal {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 26px;
    border-bottom: 1px solid #6e6e6e;
}
.label-ruler-vertical {
    grid-column: 1;
    grid-row: 2;
    width: 34px;
    height: 100%;
    border-right: 1px solid #6e6e6e;
}
.label-ruler-tick {
    position: absolute;
    background: #6f7f86;
}
.label-ruler-horizontal .label-ruler-tick {
    bottom: 0;
    width: 1px;
}
.label-ruler-vertical .label-ruler-tick {
    right: 0;
    height: 1px;
}
.label-ruler-tick.minor {
    opacity: .55;
}
.label-ruler-tick.zero {
    background: #1d7ec2;
}
.label-ruler-horizontal .label-ruler-tick.zero {
    height: 21px;
}
.label-ruler-vertical .label-ruler-tick.zero {
    width: 25px;
}
.label-ruler-horizontal .label-ruler-tick.minor {
    height: 5px;
}
.label-ruler-horizontal .label-ruler-tick.mid {
    height: 8px;
}
.label-ruler-horizontal .label-ruler-tick.major {
    height: 13px;
}
.label-ruler-vertical .label-ruler-tick.minor {
    width: 5px;
}
.label-ruler-vertical .label-ruler-tick.mid {
    width: 8px;
}
.label-ruler-vertical .label-ruler-tick.major {
    width: 13px;
}
.label-ruler-label {
    position: absolute;
    color: #555;
    font-size: 10px;
    white-space: nowrap;
}
.label-ruler-label.zero {
    color: #1d7ec2;
    font-weight: 800;
}
.label-ruler-horizontal .label-ruler-label {
    top: 3px;
    transform: translateX(-50%);
}
.label-ruler-vertical .label-ruler-label {
    right: 15px;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center;
}
.label-canvas-surface {
    display: block;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0,0,0,.5);
    cursor: move;
    touch-action: none;
}
.label-field-buttons {
    display: grid;
    gap: 8px;
}
.label-field-buttons.compact {
    gap: 5px;
}
.label-field-buttons button {
    min-height: 32px;
    padding: 0 10px;
    text-align: left;
    border: 1px solid #666;
    background: #4a4a4a;
    color: #f2f2f2;
    cursor: pointer;
    font: inherit;
}
.label-field-buttons.compact button {
    min-height: 28px;
    font-size: 12px;
}
.label-field-buttons button:hover {
    background: #555;
    border-color: #aaa;
}
.label-field-group {
    margin-top: 12px;
}
.label-field-group summary {
    min-height: 30px;
    display: flex;
    align-items: center;
    color: #eee;
    cursor: pointer;
    font-weight: 700;
}
@media (max-width: 1180px) {
    .label-canvas-editor {
        grid-template-columns: 160px minmax(0, 1fr) 250px;
    }
    .designer-status {
        flex-basis: 100%;
        margin-left: 0;
    }
}
.label-page-config {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #555;
}
.label-designer-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .7fr);
    gap: 16px;
}
.label-template-panel {
    grid-row: span 2;
}
.compact-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.label-field-list {
    display: grid;
    gap: 8px;
}
.label-field-list code {
    display: block;
    padding: 9px 10px;
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--ink);
}
.label-template-preview {
    display: grid;
    gap: 14px;
}
.label-template-preview pre {
    margin: 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--line);
    background: #f7f7f4;
    color: var(--ink);
    font-size: var(--font-small);
}
.label-preview-card {
    width: 320px;
    min-height: 210px;
    padding: 18px;
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 8px 14px;
    align-items: start;
    border: 1px solid var(--line);
    background: var(--white);
}
.label-preview-card span,
.label-preview-card small {
    grid-column: 2;
    color: var(--muted);
}
.label-preview-card strong {
    grid-column: 2;
}
.label-preview-qr {
    grid-row: 1 / span 4;
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border: 1px solid var(--black);
    background: repeating-linear-gradient(45deg, #fff, #fff 4px, #e6e6e0 4px, #e6e6e0 8px);
    font-weight: 800;
}
@media (max-width: 1100px) {
    .label-designer-overview {
        grid-template-columns: 1fr;
    }
    .label-template-panel {
        grid-row: auto;
    }
}
@media (max-width: 700px) {
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) {
        max-width: 100%;
        overflow-x: hidden;
    }
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .section-head {
        display: grid;
        gap: 12px;
    }
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .section-head .actions,
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .section-head .button {
        width: 100%;
    }
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .data-panel {
        max-width: 100%;
        overflow: hidden;
    }
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .data-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .data-table th,
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .data-table td {
        min-width: 132px;
    }
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .data-table th:last-child,
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .data-table td:last-child {
        min-width: 230px;
    }
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .data-table .inline-form {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .content:has(.data-table input[type="file"][accept*=".muye-label"]) .data-table input[type="file"] {
        width: 100%;
        max-width: 100%;
    }
}

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { min-height: 150px; padding: 20px; border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; }
.stat span { color: var(--muted); }
.stat strong { margin-top: auto; font-size: var(--font-stat); }
.stat small { margin-top: 5px; color: var(--muted); }
.stat.muted { background: var(--soft); }
.stat.alert { border-color: var(--danger); }
.stat.alert strong { color: var(--danger); }
.dashboard-section { margin-bottom: 30px; }
.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}
.section-heading h2 { margin: 0; font-size: var(--font-section-title); }
.section-heading span { color: var(--muted); font-size: var(--font-small); }
.dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-stats .stat { min-height: 132px; }
.overdue-row td:first-child,
.overdue-row td:nth-child(2) { color: var(--danger); font-weight: 600; }
.compact-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.compact-stats a {
    min-width: 220px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: var(--white);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 20px;
}
.compact-stats span { color: var(--muted); }
.compact-stats strong { font-size: var(--font-page-title); }
.compact-stats small { grid-column: 1 / -1; color: var(--muted); }
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.module-grid.compact .module-card { min-height: 160px; }
.module-group-list {
    display: grid;
    gap: 16px;
}
.module-group {
    border: 1px solid var(--line);
    background: var(--white);
}
.module-group-summary {
    min-height: 82px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    cursor: pointer;
    border-bottom: 1px solid transparent;
}
.module-group[open] .module-group-summary { border-bottom-color: var(--line); }
.module-group-summary::-webkit-details-marker { display: none; }
.module-group-summary::before {
    content: "›";
    font-size: 26px;
    color: var(--muted);
    transition: transform 0.15s ease;
}
.module-group[open] .module-group-summary::before { transform: rotate(90deg); }
.module-group-summary span {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}
.module-group-summary b { font-size: var(--font-section-title); }
.module-group-summary small {
    color: var(--muted);
    font-size: var(--font-body);
}
.module-group-summary strong {
    font-size: var(--font-page-title);
    line-height: 1;
}
.module-group > .module-grid {
    padding: 18px;
}
.module-card {
    min-height: 190px;
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--white);
    display: flex;
    flex-direction: column;
}
.module-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}
.module-card h2 { margin: 0 0 6px; font-size: var(--font-card-title); }
.module-card p { margin: 0; color: var(--muted); }
.module-card header strong { font-size: var(--font-stat); line-height: 1; }
.module-meta { margin-top: 18px; color: var(--muted); }
.module-card footer { margin-top: auto; display: flex; gap: 8px; }
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.detail-grid > div,
.audit-card {
    padding: 18px;
    border: 1px solid var(--line);
    background: var(--white);
}
.detail-grid span { display: block; margin-bottom: 8px; color: var(--muted); }
.detail-grid strong { font-size: var(--font-topbar); }
.audit-card { margin-bottom: 16px; }
.audit-card h2 { margin: 0 0 12px; font-size: var(--font-section-title); }
.audit-card p { margin: 0; }
.audit-card pre {
    margin: 0;
    padding: 14px;
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--line);
    background: #f7f7f5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.audit-json-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.muted-text { color: var(--muted); }

.filterbar { display: flex; gap: 6px; margin-bottom: 8px; }
.filterbar input:not([type="checkbox"]) { min-width: min(320px, 100%); }
input, select, textarea, .field {
    min-height: var(--control-height); border: 1px solid #aaa; background: #fff; color: var(--ink); border-radius: 0;
}
input, select, .field {
    height: var(--control-height);
    padding: 0 10px;
}
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    padding: 0;
}
textarea { width: 100%; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #333; outline-offset: -1px; }
.searchable-select-wrap { position: relative; width: 100%; }
.searchable-select-native { display: none; }
.searchable-select-input { width: 100%; padding-right: 34px; }
.searchable-select-toggle {
    position: absolute; top: 1px; right: 1px; width: 34px; height: calc(var(--control-height) - 2px);
    padding: 0; border: 0; background: #fff; cursor: pointer;
}
.searchable-select-menu {
    position: absolute; z-index: 40; top: calc(100% + 3px); left: 0; right: 0;
    display: none; max-height: 280px; overflow: auto;
    border: 1px solid #777; background: #fff; box-shadow: 0 8px 22px rgb(0 0 0 / 12%);
}
.searchable-select-menu.open { display: block; }
.searchable-select-menu-floating {
    position: fixed;
    z-index: 3000;
    right: auto;
}
.searchable-select-option {
    display: block; width: 100%; padding: 10px 12px; border: 0;
    border-bottom: 1px solid #ededeb; background: #fff; color: var(--ink);
    text-align: left; cursor: pointer;
}
.searchable-select-option:hover,
.searchable-select-option.active { background: #ecece8; }
.searchable-select-empty { padding: 16px 12px; color: var(--muted); }

.table-wrap { overflow: auto; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: var(--table-padding-y) var(--table-padding-x); border-bottom: 1px solid #e8e8e5; text-align: left; }
th, td { vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; height: 36px; background: #ecece8; font-weight: 600; }
td { height: 40px; }
tbody tr:hover { background: #f4f4f1; }
.packing-scan-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 6px 12px 10px;
    background: #ededea;
    height: auto;
    min-height: 0;
    overflow: hidden;
}
.packing-column-head {
    flex: 0 0 auto;
    margin-bottom: 6px;
}
.packing-column-head h2 {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 1.2;
}
.packing-work-headline {
    display: flex;
    min-height: 26px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.packing-work-headline p {
    margin: 0;
    font-size: 12px;
    white-space: nowrap;
}
.woodwork-color-summary {
    flex: 0 0 auto;
    margin: 0 0 8px;
    padding: 8px;
    border: 1px solid #d0d0ca;
    background: #fafaf8;
}
.woodwork-color-summary h3 {
    margin: 0 0 6px;
    font-size: 14px;
}
.woodwork-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px;
}
.woodwork-color-card {
    display: flex;
    min-height: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 7px 9px;
    border: 1px solid #c8c8c2;
    background: #fff;
}
.woodwork-color-card strong {
    font-size: 14px;
}
.woodwork-color-card span {
    color: #555;
    font-size: 12px;
}
.woodwork-color-card.is-complete {
    border-color: #277a32;
    background: #eff9ed;
}
.packing-scan-headline {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    min-height: 26px;
    margin-bottom: 6px;
}
.packing-scan-headline h2 {
    flex: 0 0 auto;
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
}
.packing-scan-head {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(360px, .9fr);
    gap: 16px;
    align-items: end;
}
.packing-scan-form {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    margin-bottom: 8px;
    padding: 6px;
    border: 2px solid var(--black);
    background: #fff;
}
.packing-scan-form label {
    flex: 0 0 44px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
}
.packing-scan-form input[type="text"] {
    flex: 1 1 0;
    min-width: 0;
    height: 38px;
    border: 2px solid var(--black);
    padding: 0 10px;
    background: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    letter-spacing: 0;
}
.packing-scan-form input[type="text"]:focus {
    outline: 3px solid #f5d64a;
    outline-offset: 2px;
}
.packing-scan-form .button {
    flex: 0 0 62px;
    min-width: 62px;
    min-height: 38px;
    padding: 0 8px;
    font-size: 15px;
    font-weight: 800;
}
.packing-scan-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 12px;
    align-items: stretch;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}
.packing-scan-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 12px;
    border: 1px solid #d0d0ca;
    background: #fff;
}
.packing-scan-column:first-child {
    overflow: hidden;
}
.packing-scan-column:last-child {
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
    position: static;
    border-color: #222;
    box-shadow: 0 12px 28px rgb(0 0 0 / 10%);
}
.packing-scan-column h3 {
    flex: 0 0 auto;
    margin: 6px 0 4px;
    font-size: 15px;
}
.packing-work-list,
.packing-scan-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.packing-work-item {
    display: flex;
    gap: 16px;
    align-items: center;
    min-height: 88px;
    padding: 16px;
    border: 2px solid #d7d7d2;
    background: #fffdf8;
    box-shadow: 0 1px 0 rgb(0 0 0 / 4%);
}
.packing-work-item.is-scanned {
    border-color: #2f8f3c;
    background: #eff9ed;
}
.packing-work-no {
    flex: 0 0 150px;
    padding-right: 14px;
    border-right: 1px solid #e0e0dc;
}
.packing-work-no span {
    display: block;
    color: #777;
    font-size: 13px;
    font-weight: 700;
}
.packing-work-no strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
    line-height: 1.05;
    overflow-wrap: anywhere;
}
.packing-work-status span {
    display: inline-flex;
    min-width: 74px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid #999;
    background: #f3f3f0;
    color: #333;
    font-weight: 800;
}
.packing-work-item.is-scanned .packing-work-status span {
    border-color: #277a32;
    background: #277a32;
    color: #fff;
}
.packing-work-main strong {
    display: block;
    font-size: 22px;
    line-height: 1.2;
}
.packing-work-main small {
    display: block;
    margin-top: 4px;
}
.packing-work-main {
    flex: 1 1 auto;
    min-width: 0;
}
.packing-work-main > span {
    display: inline-block;
    margin-top: 8px;
    color: #555;
    font-size: 16px;
    font-weight: 700;
}
.packing-work-status {
    flex: 0 0 auto;
}
.packing-work-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 12px;
    color: #555;
    font-size: 13px;
}
.packing-work-table-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: scroll;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    border-color: #d0d0ca;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(90deg, transparent, rgb(0 0 0 / 4%)) border-box;
}
.packing-work-table-wrap::-webkit-scrollbar,
.packing-scanned-table-wrap::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}
.packing-work-table-wrap::-webkit-scrollbar-track,
.packing-scanned-table-wrap::-webkit-scrollbar-track {
    border: 1px solid #ddddda;
    background: #eeeeeb;
}
.packing-work-table-wrap::-webkit-scrollbar-thumb,
.packing-scanned-table-wrap::-webkit-scrollbar-thumb {
    min-height: 46px;
    min-width: 46px;
    border: 3px solid #eeeeeb;
    border-radius: 999px;
    background: #9f9f9b;
}
.packing-work-table-wrap::-webkit-scrollbar-thumb:hover,
.packing-scanned-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #6f6f6b;
}
.packing-work-table-wrap::-webkit-scrollbar-corner,
.packing-scanned-table-wrap::-webkit-scrollbar-corner {
    background: #eeeeeb;
}
.packing-work-table {
    min-width: 980px;
}
.packing-work-table .packing-work-item {
    display: table-row;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.packing-work-table th,
.packing-work-table td {
    height: 34px;
}
.packing-work-table .packing-work-item.is-scanned {
    background: #eff9ed;
}
.packing-work-table .packing-scan-status {
    display: inline-flex;
    min-width: 58px;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    border: 1px solid #999;
    background: #f3f3f0;
    color: #333;
    font-weight: 800;
}
.packing-work-table .is-scanned .packing-scan-status {
    border-color: #277a32;
    background: #277a32;
    color: #fff;
}
.packing-scan-message {
    margin-bottom: 14px;
    padding: 16px;
    border: 3px solid var(--black);
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}
.packing-scan-message.is-success {
    border-color: #277a32;
    background: #eaf5e8;
    color: #14591e;
}
.packing-scan-message.is-warning {
    border-color: #b7791f;
    background: #fff4d6;
    color: #7a4b00;
}
.packing-scan-message.is-error {
    border-color: #b42318;
    background: #fff0ed;
    color: #8a1c13;
}
.packing-bind-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid #d4d4ce;
    background: #f7f7f4;
}
.packing-bind-status strong {
    flex: 0 0 72px;
    color: var(--muted);
}
.packing-bind-status span {
    flex: 1 1 220px;
    min-width: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.packing-package-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 0 0 auto;
    margin: 0 0 8px;
}
.packing-package-actions .button {
    flex: 1 1 0;
    justify-content: center;
    min-height: 38px;
    font-size: 14px;
    font-weight: 800;
}
.packing-info-panel {
    background: #fff;
}
.packing-info-layout {
    display: grid;
    grid-template-columns: minmax(360px, .95fr) minmax(480px, 1.25fr);
    gap: 16px;
    align-items: start;
}
.packing-info-actions {
    justify-content: center;
    margin-top: 18px;
}
.packing-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 22px;
}
.packing-summary-grid > div {
    border: 1px solid var(--line);
    background: #fff;
    padding: 12px 14px;
}
.packing-summary-grid span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}
.packing-summary-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
}
.packing-progress {
    width: 130px;
    height: 10px;
    border: 1px solid var(--line);
    background: #f3f3f3;
    overflow: hidden;
}
.packing-progress span {
    display: block;
    height: 100%;
    background: #111;
}
.packing-zhumu-shell {
    border: 1px solid var(--line);
    background: #fff;
}
.packing-tabs {
    display: flex;
    min-height: 56px;
    border-bottom: 1px solid var(--line);
    background: #f7f7f4;
}
.packing-tabs a,
.packing-tabs strong {
    display: inline-flex;
    min-width: 118px;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    font-size: 18px;
}
.packing-tabs strong {
    border-bottom: 3px solid var(--black);
    background: #fff;
}
.packing-detail-tabs {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    min-height: 46px;
    margin: 0;
    border-bottom: 1px solid var(--line);
}
.packing-detail-tab-links {
    display: flex;
    align-items: flex-end;
    gap: 26px;
}
.packing-detail-tabs a,
.packing-detail-tabs strong {
    display: inline-flex;
    min-width: 128px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}
.packing-detail-tabs > .button {
    min-width: auto;
    min-height: 32px;
    margin-bottom: 6px;
    font-size: 14px;
}
.packing-detail-tabs strong {
    border-bottom: 3px solid #2f74d0;
    color: #2f74d0;
}
.packing-zhumu-layout {
    display: grid;
    grid-template-columns: 150px minmax(520px, 1fr) 330px;
    min-height: 560px;
}
.packing-type-nav {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: #f4f4f1;
}
.packing-type-nav strong,
.packing-type-nav a {
    padding: 14px 16px;
    border-bottom: 1px solid #e0e0dc;
    color: var(--ink);
    text-decoration: none;
}
.packing-type-nav a.active {
    border-left: 4px solid #1f75ff;
    background: #fff;
    font-weight: 800;
}
.packing-pending-panel {
    min-width: 0;
    padding: 12px;
    border-right: 1px solid var(--line);
}
.packing-panel-head {
    margin-bottom: 10px;
}
.packing-order-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.packing-order-strip a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    background: #f4f4f1;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}
.packing-order-strip a.active {
    border-color: var(--black);
    background: var(--black);
    color: #fff;
}
.packing-operation-panel {
    padding: 14px;
    background: #fafafa;
}
.packing-operation-panel h2 {
    margin: 0 0 10px;
}
.packing-inline-scan-form {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin: 14px 0 10px;
}
.packing-inline-scan-form input[type="text"] {
    height: 48px;
    border: 2px solid var(--black);
    padding: 0 10px;
    font-size: 18px;
    font-weight: 800;
}
.packing-inline-scan-form input[type="text"]:focus {
    outline: 3px solid #f5d64a;
}
.packing-small-table {
    max-height: 160px;
    margin-bottom: 14px;
}
.packing-current-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1 1 auto;
    gap: 4px;
    margin: 0;
}
.packing-current-strip span {
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid #d8d8d2;
    background: #f7f7f4;
    color: #666;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.packing-current-strip strong {
    display: inline;
    margin: 0 0 0 4px;
    color: var(--ink);
    font-size: 12px;
}
@media (max-width: 1180px) {
    .packing-scan-headline {
        align-items: stretch;
        flex-direction: column;
    }
    .packing-current-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.packing-scanned-table-wrap {
    position: relative;
    min-height: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    max-height: none;
    overflow-x: scroll;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    border-color: #d0d0ca;
}
.packing-scanned-table {
    width: 100%;
    min-width: 640px;
}
.packing-scanned-table input[type="radio"] {
    width: 18px;
    height: 18px;
}
.packing-scanned-table .packing-empty-scan-row td {
    height: 68px;
    color: #777;
    text-align: center;
}
.packing-pack-setting {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.packing-pack-setting input {
    width: 80px;
}
.is-muted-row {
    background: #eef8ed;
    color: #277a32;
    font-weight: 700;
}
.packing-scan-log {
    min-height: 220px;
    max-height: 360px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #deded9;
    background: #fafaf8;
}
.packing-scan-log-item {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    padding: 12px 14px;
    border-left: 4px solid #277a32;
    background: #f7fbf6;
    box-shadow: 0 1px 0 rgb(0 0 0 / 5%);
}
.packing-scan-log-item time {
    flex: 0 0 74px;
    color: #666;
    font-weight: 700;
}
.packing-scan-log-item strong {
    flex: 1 1 180px;
    min-width: 0;
    overflow-wrap: anywhere;
}
.packing-scan-log-item span {
    flex: 0 0 100%;
    padding-left: 86px;
    color: #555;
    font-size: 13px;
}
.packing-scan-log-item b {
    flex: 0 0 auto;
    color: #277a32;
}
.packing-action-bar {
    flex: 0 0 auto;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #deded9;
    display: grid;
    grid-template-columns: minmax(116px, 0.7fr) minmax(0, 1fr) minmax(142px, 0.8fr);
    gap: 8px;
    align-items: center;
}
.packing-scan-note {
    flex: 0 0 auto;
    margin: 6px 0 0;
    color: #777;
    font-size: 12px;
    line-height: 1.3;
}
.packing-action-bar .button {
    justify-content: center;
    min-height: 38px;
    font-size: 14px;
    font-weight: 800;
}
.packing-action-bar form {
    display: contents;
}
.packing-action-bar .muted {
    min-width: 0;
    overflow: hidden;
    color: #777;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.packing-action-bar .button.danger {
    justify-self: start;
    min-width: 116px;
}
.packing-action-bar .button.primary {
    justify-self: end;
    min-width: 142px;
}
@media (max-width: 960px) {
    .packing-scan-head,
    .packing-scan-workspace {
        display: block;
    }
    .packing-scan-column:last-child {
        position: static;
        margin-top: 16px;
    }
    .packing-work-item {
        align-items: flex-start;
        flex-direction: column;
    }
    .packing-work-no {
        border-right: 0;
        border-bottom: 1px solid #e0e0dc;
        padding: 0 0 10px;
    }
}
.packing-scan-workspace {
    display: grid !important;
}
@media (max-width: 900px) {
    .packing-scan-workspace {
        display: block !important;
    }
}

/* 木工齐套扫描：以查缺件为主的单表工作区 */
.packing-lookup-panel {
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
}
.packing-lookup-summary {
    display: grid;
    grid-template-columns: minmax(200px, 1.15fr) repeat(3, minmax(74px, .42fr)) minmax(340px, 2.2fr) auto;
    gap: 5px;
    flex: 0 0 auto;
    padding: 6px;
    border: 1px solid #d0d0ca;
    background: #fff;
}
.packing-summary-cell {
    display: flex;
    min-width: 0;
    min-height: 46px;
    align-items: center;
    gap: 8px;
    padding: 5px 9px;
    border: 1px solid #deded9;
    background: #f8f8f6;
    white-space: nowrap;
}
.packing-summary-cell span {
    color: #666;
    font-weight: 700;
}
.packing-summary-cell strong {
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    line-height: 1;
    text-overflow: ellipsis;
}
.packing-summary-missing strong {
    color: var(--danger);
}
.packing-lookup-scan-form {
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 5px;
}
.packing-lookup-scan-form label {
    flex-basis: 40px;
    font-size: 13px;
}
.packing-lookup-scan-form input[type="text"] {
    height: 34px;
    font-size: 13px;
}
.packing-lookup-scan-form .button {
    min-height: 34px;
    font-size: 13px;
}
.packing-lookup-complete-form {
    display: flex;
}
.packing-lookup-complete-form .button {
    min-width: 108px;
    min-height: 46px;
    font-size: 13px;
    font-weight: 800;
}
.packing-lookup-message {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 12px;
    border-width: 2px;
    font-size: 14px;
}
.packing-lookup-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.packing-lookup-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.packing-filter-tabs {
    display: flex;
    align-items: center;
    gap: 5px;
}
.packing-filter-button {
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid #b8b8b3;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-weight: 800;
}
.packing-filter-button:hover {
    border-color: var(--black);
}
.packing-filter-button.is-active {
    border-color: #2b76d2;
    background: #2b76d2;
    color: #fff;
}
.packing-filter-button.is-missing:not(.is-active) {
    border-color: #d8aaa4;
    background: #fffafa;
    color: var(--danger);
}
.packing-lookup-search {
    width: min(380px, 36vw);
    height: 32px;
    padding: 0 11px;
    border: 1px solid #aaa;
    background: #fff;
}
.packing-lookup-table-panel {
    display: flex;
    flex: 1 0 220px;
    min-height: 220px;
    flex-direction: column;
    border: 1px solid #bdbdb8;
    background: #fff;
}
.packing-lookup-table-caption {
    display: flex;
    min-height: 34px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 12px;
    border-bottom: 1px solid #d8d8d4;
    background: #fafaf8;
}
.packing-lookup-table-caption strong {
    font-size: 14px;
}
.packing-lookup-table-caption span {
    color: #666;
    font-size: 12px;
}
.packing-lookup-table-caption b {
    color: var(--danger);
}
.packing-work-table-wrap.packing-lookup-table-wrap {
    flex: 1 1 auto;
    min-height: 160px;
    max-height: none;
    overflow: auto;
    border: 0;
    scrollbar-gutter: stable;
}
.packing-work-table.packing-lookup-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.packing-lookup-table .packing-col-code { width: 24%; }
.packing-lookup-table .packing-col-color { width: 12%; }
.packing-lookup-table .packing-col-cabinet { width: 14%; }
.packing-lookup-table .packing-col-name { width: 30%; }
.packing-lookup-table .packing-col-size { width: 20%; }
.packing-work-table.packing-lookup-table th,
.packing-work-table.packing-lookup-table td {
    height: 36px;
    padding: 0 10px;
    overflow: hidden;
    border-right: 1px solid #dfdfdb;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.packing-work-table.packing-lookup-table th {
    height: 34px;
    padding: 0;
}
.packing-work-table.packing-lookup-table th:last-child,
.packing-work-table.packing-lookup-table td:last-child {
    border-right: 0;
}
.packing-sort-button {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-weight: 800;
    text-align: left;
}
.packing-sort-button:hover {
    color: #2b76d2;
}
.packing-sort-indicator {
    color: #999;
    font-size: 11px;
}
.packing-lookup-table th[aria-sort="ascending"] .packing-sort-indicator,
.packing-lookup-table th[aria-sort="descending"] .packing-sort-indicator {
    color: #2b76d2;
}
.packing-work-table.packing-lookup-table .packing-work-item.is-scanned {
    background: #fff;
}
.packing-work-table.packing-lookup-table .packing-work-item.is-unscanned {
    background: #fff2f0;
}
.packing-work-table.packing-lookup-table .packing-work-item.is-unscanned:hover {
    background: #ffe8e4;
}
.packing-work-table.packing-lookup-table .packing-work-item[hidden] {
    display: none;
}
.packing-work-table.packing-lookup-table .packing-scan-status {
    min-width: 66px;
    min-height: 27px;
    border-color: var(--danger);
    background: #fff;
    color: var(--danger);
    font-weight: 800;
}
.packing-work-table.packing-lookup-table .is-scanned .packing-scan-status {
    border-color: #8bb791;
    background: #eff9ed;
    color: #277a32;
}
.packing-lookup-table .packing-scan-code {
    color: #111;
    font-weight: 800;
}
.packing-lookup-table .is-unscanned .packing-scan-code {
    color: var(--danger);
}
.packing-work-empty-row td {
    height: 74px !important;
    color: #777;
    text-align: center;
}
.packing-lookup-hint {
    min-height: 34px;
    margin: 0;
    padding: 8px 12px;
    border-top: 1px solid #d8d8d4;
    color: #666;
    background: #fafaf8;
    font-size: 12px;
}
.packing-scan-history {
    flex: 0 0 auto;
    border: 1px solid #d0d0ca;
    background: #fff;
}
.packing-scan-history > summary {
    min-height: 34px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
}
.packing-scan-history > summary b {
    color: #277a32;
}
.packing-scan-history-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 0 8px 8px;
}
.packing-scan-history .packing-scanned-table-wrap {
    width: 100%;
    height: auto;
    max-height: 220px;
    overflow: auto;
}
.packing-scan-history .packing-scanned-table {
    min-width: 640px;
}
.packing-scan-history .button {
    min-width: 130px;
}

/* 打包作业：左右等分，左侧把查缺所需字段一次展示完整 */
.packing-scan-workspace.packing-package-workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.packing-package-workspace .packing-scan-column {
    padding: 8px;
}
.packing-package-summary {
    display: grid;
    grid-template-columns: minmax(150px, 1.5fr) repeat(3, minmax(62px, .55fr));
    gap: 5px;
    margin-bottom: 6px;
}
.packing-package-summary > div {
    display: flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    padding: 4px 7px;
    border: 1px solid #deded9;
    background: #f8f8f6;
    white-space: nowrap;
}
.packing-package-summary span {
    color: #666;
    font-size: 11px;
    font-weight: 700;
}
.packing-package-summary strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
}
.packing-package-summary .is-missing strong {
    color: var(--danger);
}
.packing-package-toolbar {
    margin-bottom: 6px;
}
.packing-package-toolbar .packing-filter-button,
.packing-package-toolbar .button,
.packing-package-toolbar .packing-lookup-search {
    min-height: 30px;
    height: 30px;
    font-size: 11px;
}
.packing-package-toolbar .packing-filter-button {
    padding: 0 9px;
}
.packing-package-toolbar .packing-lookup-actions {
    flex: 1 1 auto;
}
.packing-package-toolbar .packing-lookup-search {
    width: auto;
    min-width: 120px;
    flex: 1 1 180px;
}
.packing-package-toolbar .button {
    flex: 0 0 auto;
    padding: 0 9px;
}
.packing-package-table-panel {
    flex: 1 1 auto;
    min-height: 0;
}
.packing-work-table.packing-package-lookup-table {
    font-size: 12px;
}
.packing-package-lookup-table .packing-col-status { width: 7%; }
.packing-package-lookup-table .packing-col-code { width: 12%; }
.packing-package-lookup-table .packing-col-color { width: 14%; }
.packing-package-lookup-table .packing-col-cabinet { width: 13%; }
.packing-package-lookup-table .packing-col-name { width: 34%; }
.packing-package-lookup-table .packing-col-size { width: 20%; }
.packing-work-table.packing-package-lookup-table th,
.packing-work-table.packing-package-lookup-table td {
    height: 32px;
    padding: 0 6px;
}
.packing-work-table.packing-package-lookup-table th {
    height: 31px;
    padding: 0;
}
.packing-package-lookup-table .packing-sort-button {
    gap: 4px;
    padding: 0 6px;
    font-size: 11px;
}
.packing-work-table.packing-package-lookup-table .packing-scan-status {
    display: inline-grid;
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    place-items: center;
    font-size: 15px;
    line-height: 1;
}
.packing-work-table.packing-package-lookup-table td:nth-child(2) {
    text-align: left;
}
.packing-package-lookup-table .packing-code-end-lock {
    display: flex;
    width: 100%;
    overflow: hidden;
    justify-content: flex-end;
    font-size: 12px;
    white-space: nowrap;
}
.packing-package-lookup-table .packing-code-full {
    flex: 0 0 auto;
}
.packing-package-workspace .packing-lookup-table-caption {
    min-height: 30px;
    padding: 0 8px;
}
.packing-package-workspace .packing-lookup-table-caption strong,
.packing-package-workspace .packing-lookup-table-caption span {
    font-size: 11px;
}
@media (max-width: 1280px) {
    .packing-lookup-summary {
        grid-template-columns: minmax(170px, 1.1fr) repeat(3, minmax(62px, .4fr)) minmax(250px, 2fr) minmax(100px, auto);
    }
    .packing-summary-order {
        grid-column: span 1;
    }
    .packing-lookup-scan-form {
        grid-column: auto;
    }
    .packing-lookup-complete-form .button {
        width: 100%;
    }
}
@media (max-height: 760px) and (min-width: 901px) {
    .packing-lookup-summary {
        gap: 5px;
        padding: 5px;
    }
    .packing-summary-cell,
    .packing-lookup-scan-form,
    .packing-lookup-complete-form .button {
        min-height: 44px;
    }
    .packing-summary-cell {
        padding: 5px 8px;
    }
    .packing-summary-cell strong {
        font-size: 16px;
    }
    .packing-lookup-scan-form input[type="text"],
    .packing-lookup-scan-form .button {
        height: 34px;
        min-height: 34px;
    }
    .packing-lookup-table-panel {
        flex-basis: 230px;
        min-height: 230px;
    }
    .packing-work-table-wrap.packing-lookup-table-wrap {
        min-height: 168px;
    }
    .packing-lookup-hint {
        display: none;
    }
    .packing-scan-history > summary {
        min-height: 30px;
        padding: 5px 10px;
    }
}
@media (max-width: 900px) {
    .packing-lookup-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .packing-lookup-scan-form {
        grid-column: 1 / -1;
    }
    .packing-lookup-complete-form {
        grid-column: 1 / -1;
    }
    .packing-lookup-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    .packing-filter-tabs {
        flex-wrap: wrap;
    }
    .packing-lookup-actions,
    .packing-lookup-search {
        width: 100%;
    }
    .packing-lookup-actions .button {
        flex: 0 0 auto;
    }
    .packing-scan-history-body {
        display: block;
    }
    .packing-scan-history .button {
        margin-top: 8px;
    }
}
.quote-list-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border: 1px solid #cfcfca;
}
.quote-list-wrap { overflow: auto; }
.quote-list-table th,
.quote-list-table td {
    height: 44px;
    padding: 6px 8px;
    border: 1px solid #d7d7d2;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
    vertical-align: middle;
}
.quote-list-table th {
    height: 36px;
    padding-top: 0;
    padding-bottom: 0;
    background: #ecece8;
    text-align: center;
    white-space: nowrap;
}
.quote-list-table td {
    font-size: 14px;
}
.quote-list-table td:first-child {
    text-align: center;
}
.quote-list-table td:nth-child(4),
.quote-list-table td:nth-child(7),
.quote-list-table td:nth-child(8) {
    text-align: center;
}
.quote-list-table td:nth-child(9),
.quote-list-table td:nth-child(10) {
    text-align: right;
    white-space: nowrap;
}
.quote-action-toolbar {
    align-items: center;
    gap: 12px 18px;
}
.quote-action-toolbar > span {
    min-width: 260px;
    color: var(--muted);
}
.quote-action-toolbar .toolbar {
    flex: 1 1 auto;
}
.quote-action-toolbar .button:disabled {
    border-color: #d8d8d4;
    background: #f3f3f0;
    color: #aaa;
    cursor: not-allowed;
}
.quote-list-table .col-select { width: 4%; }
.quote-list-table .col-status { width: 8%; }
.quote-list-table .col-order { width: 15%; }
.quote-list-table .col-version { width: 5%; }
.quote-list-table .col-customer { width: 9%; }
.quote-list-table .col-project { width: 17%; }
.quote-list-table .col-mode { width: 8%; }
.quote-list-table .col-date { width: 10%; }
.quote-list-table .col-money { width: 8%; }
.quote-list-table .col-updated { width: 8%; }
.table-wrap:has(.list-table) {
    flex: 0 1 auto;
    overflow: auto;
    min-height: 0;
    height: auto;
    max-height: min(var(--list-table-target-height), 58vh);
    margin-bottom: 0;
    border: 1px solid #cfcfca;
    background: #fff;
    overscroll-behavior: contain;
}
.table-wrap:has(.list-table) .list-table {
    border: 0;
}
.quote-list-wrap {
    overflow: auto;
}
.list-table {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
    border: 1px solid #cfcfca;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
}
.list-table th,
.list-table td {
    height: var(--list-table-row-height);
    padding: 0 10px;
    border-right: 1px solid #d7d7d2;
    border-bottom: 1px solid #d7d7d2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    vertical-align: middle;
}
.list-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: var(--list-table-header-height);
    background: #ecece8;
    text-align: center;
    font-size: var(--font-body);
    font-weight: 700;
    overflow: visible;
    user-select: none;
}
.list-table td {
    font-size: var(--font-body);
}
.list-table th:first-child,
.list-table td:first-child {
    text-align: center;
}
.list-table td:nth-child(2) {
    text-align: center;
}
.list-table .status-pill {
    max-width: 100%;
}
.list-table th.is-resize-ready {
    cursor: col-resize;
}
.list-table th:has(.column-menu-trigger) {
    padding-right: 22px;
}
.column-menu-trigger {
    position: absolute;
    top: 50%;
    right: 7px;
    z-index: 7;
    width: 14px;
    height: 18px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: rgb(51 51 51 / 38%);
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    opacity: .72;
    transition: color .12s ease, opacity .12s ease, background .12s ease;
}
.list-table th:hover .column-menu-trigger,
.column-menu-trigger:hover {
    background: transparent;
    color: rgb(51 51 51 / 75%);
    opacity: 1;
}
.column-menu-trigger:focus-visible {
    outline: 1px solid #777;
    outline-offset: 1px;
    color: rgb(51 51 51 / 85%);
    opacity: 1;
}
.column-menu {
    position: fixed;
    z-index: 6000;
    width: 240px;
    padding: 6px 0;
    border: 1px solid #c4c4c0;
    background: #fff;
    box-shadow: 0 10px 24px rgb(0 0 0 / 18%);
}
.column-menu button,
.column-menu-filter {
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 0;
    background: #fff;
    color: var(--ink);
    text-align: left;
    font: inherit;
    font-size: 14px;
}
.column-menu button {
    cursor: pointer;
}
.column-menu button:hover {
    background: #f2f2ef;
}
.column-menu-filter {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 10px 14px;
    border-top: 1px solid #ededeb;
    border-bottom: 1px solid #ededeb;
    color: #666;
    font-weight: 700;
}
.column-menu-filter input {
    width: 100%;
    height: 32px;
    margin-top: 6px;
    padding: 0 8px;
    border: 1px solid #bdbdb8;
    font: inherit;
}
.column-menu-values {
    max-height: 180px;
    overflow: auto;
    padding: 6px 0;
    border-bottom: 1px solid #ededeb;
}
.column-menu-values label {
    display: flex;
    min-height: 30px;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    font-size: 13px;
    cursor: pointer;
}
.column-menu-values label:hover {
    background: #f2f2ef;
}
.column-menu-values input {
    width: 14px;
    height: 14px;
}
.column-menu-values span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.column-menu-values small {
    display: block;
    padding: 6px 14px 2px;
    color: #777;
    font-size: 12px;
}
.list-column-resizer {
    position: absolute;
    top: 0;
    right: -7px;
    z-index: 10;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}
.list-column-resizer::after {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 4px;
    width: 2px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.12s ease, width 0.12s ease, left 0.12s ease;
}
.list-column-resizer:hover::after,
.list-table th.is-resize-ready .list-column-resizer::after,
body.is-resizing-list-column .list-column-resizer::after {
    left: 3px;
    width: 4px;
    background: #5b9bd5;
}
.list-column-resizer:hover {
    background: rgb(91 155 213 / 10%);
}
body.is-resizing-list-column {
    cursor: col-resize;
    user-select: none;
}
.wrap-cell { max-width: 360px; white-space: normal; overflow-wrap: anywhere; }
.clickable-row { cursor: pointer; }
.list-table tr.is-selected td {
    background: #eaf3ff;
}
.list-table tr.is-selected td:first-child {
    box-shadow: inset 3px 0 0 #2f80ed;
}
.production-list-controls [data-production-selected-label] {
    margin-right: auto;
}
.production-list-controls .button:disabled {
    border-color: #d8d8d4;
    background: #f3f3f0;
    color: #aaa;
    cursor: not-allowed;
}
.production-list-table .status-generated {
    border-color: #86b37e;
    background: #eef7ea;
    color: #256529;
}
.production-list-table .status-pending {
    border-color: #d8b4ad;
    background: #fff7f5;
    color: #8c2b1f;
}
.production-list-wrap:has(.production-summary-table) {
    overflow-x: hidden;
}
.production-summary-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.production-summary-table th,
.production-summary-table td {
    box-sizing: border-box;
}
.production-summary-table .production-status-cell,
.production-summary-table .production-count-cell {
    text-align: center;
}
.production-summary-table .production-count-cell {
    font-weight: 700;
}
.actions { display: flex; gap: 12px; }
.actions a { text-decoration: underline; text-underline-offset: 3px; }
.actions form { margin: 0; }
.inline-action-form { display: inline; margin: 0; }
.link-button {
    padding: 0; border: 0; background: transparent; text-decoration: underline;
    text-underline-offset: 3px; cursor: pointer;
}
.danger { color: var(--danger); }
.empty { padding: 50px; color: var(--muted); text-align: center; }
.empty-state { padding: 70px; border: 1px solid var(--line); background: #fff; text-align: center; }
.empty-state p { margin-bottom: 24px; color: var(--muted); }

.data-form { max-width: 920px; padding: 26px; border: 1px solid var(--line); background: #fff; }
.form-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 16px; }
.form-row label { padding-top: 9px; font-weight: 600; }
.form-row label b { margin-left: 4px; color: var(--danger); }
.form-row input:not([type="checkbox"]), .form-row select { width: 100%; }
.form-row input[type="date"] {
    max-width: 240px;
    cursor: pointer;
}
.form-row small { display: block; margin-top: 5px; color: var(--muted); }
.payment-form .form-row-amount input,
.payment-form .form-row-payment_date input,
.payment-form .form-row-method select,
.payment-form .form-row-payment_account select { max-width: 360px; }
.payment-form .form-row-note input { max-width: 640px; }
.permission-section { margin: 28px 0; padding-top: 24px; border-top: 1px solid var(--line); }
.permission-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.permission-heading h2 { margin: 0 0 4px; font-size: var(--font-section-title); }
.permission-heading p { margin: 0; color: var(--muted); }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.permission-card { display: flex; gap: 12px; min-height: 76px; padding: 16px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.permission-card:hover { border-color: #777; background: #fafafa; }
.permission-check { padding-top: 2px; }
.permission-card input[type="checkbox"] { width: 18px; height: 18px; }
.permission-card strong { display: block; margin-bottom: 5px; }
.permission-card small { display: block; color: var(--muted); line-height: 1.5; }
.role-status-section > .permission-card { max-width: 420px; }
.permission-summary span { display: inline-block; margin: 2px 5px 2px 0; padding: 3px 7px; border: 1px solid var(--line); background: #f7f7f7; font-size: 12px; white-space: nowrap; }
@media (max-width: 760px) {
    .permission-grid { grid-template-columns: 1fr; }
    .permission-heading { align-items: flex-start; }
}
.errorlist { margin: 5px 0 0; padding: 0; color: var(--danger); list-style: none; }
.form-actions { display: flex; gap: 8px; margin: 24px 0 0 198px; }
.message {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-left: 3px solid var(--black);
    background: #fff;
    line-height: 1.35;
}
.message.warning,
.message.error,
.message.message-warning,
.message.message-error,
.message.message-level-30,
.message.message-level-40 {
    color: var(--danger);
    border-left-color: var(--danger);
    background: #fff7f6;
}
.section-tabs { display: flex; gap: 0; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-tabs a { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; }
.section-tabs a.active { color: var(--black); border-bottom-color: var(--black); font-weight: 600; }

.personnel-detail-tabs {
    overflow-x: auto;
    white-space: nowrap;
}
.personnel-form h2 {
    margin: 28px 0 16px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.personnel-form h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.personnel-gate-panel { margin-bottom: 16px; }
.info-panel { scroll-margin-top: 72px; }
.inline-form { display: inline-flex; margin: 0; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--black); }
.login-panel { width: min(420px, calc(100vw - 32px)); padding: 42px; background: #fff; }
.login-brand { font-size: 40px; font-weight: 800; }
.login-panel p { margin: 8px 0 12px; color: var(--muted); }
.login-factory {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13px;
}
.login-factory span,
.login-factory em { color: var(--muted); font-style: normal; }
.login-factory strong { color: #111; font-weight: 700; }
.login-release {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
    padding: 9px 12px;
    color: #555;
    background: #f3f0e8;
    border: 1px solid #ddd6c8;
    font-size: 13px;
}
.login-release strong { color: #111; }
.login-panel label { display: block; margin: 14px 0 6px; }
.login-panel input { width: 100%; }
.login-panel button { margin-top: 24px; }
.form-error { color: var(--danger); }
.form-error-box, .line-error { padding: 12px; color: var(--danger); background: #fff0ee; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; align-items: center; margin: 0; }
.toolbar input[type="file"] {
    width: 210px;
    height: var(--control-height);
    padding: 4px 9px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--muted);
    font: inherit;
}
.label-module-nav {
    display: flex;
    align-items: flex-end;
    gap: 0;
    margin: 18px 0 18px;
    border-bottom: 1px solid var(--line);
}
.label-module-tab {
    min-width: 112px;
    padding: 11px 18px 10px;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    font-weight: 700;
    text-align: center;
}
.label-module-tab + .label-module-tab {
    margin-left: 6px;
}
.label-module-tab:hover {
    color: var(--black);
    background: #efefeb;
}
.label-module-tab.is-active {
    color: var(--black);
    border-bottom-color: var(--black);
    background: transparent;
}
.filterbar-wrap {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 0;
}
.filterbar-wrap input[type="text"],
.filterbar-wrap input:not([type]) {
    flex: 0 0 210px;
    width: 210px;
    min-width: 210px;
    max-width: 210px;
}
.filterbar-wrap input[type="date"] {
    flex: 0 0 130px;
    width: 130px;
    min-width: 130px;
    max-width: 130px;
}
.filterbar-wrap input[type="month"] {
    flex: 0 0 150px;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}
.filterbar-wrap select {
    flex: 0 0 118px;
    width: 118px;
    min-width: 118px;
    max-width: 118px;
}
.filterbar-wrap .button {
    flex: 0 0 auto;
    min-width: auto;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
}
.check-label {
    display: inline-flex;
    flex: 0 0 auto;
    order: 20;
    gap: 4px;
    align-items: center;
    font-size: var(--font-small);
    white-space: nowrap;
    color: var(--muted);
}
.check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    padding: 0;
}

.quote-header-grid {
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.25fr) minmax(240px, 1.4fr) minmax(170px, 0.9fr);
    width: 100%;
    min-width: 0;
    gap: 3px 10px;
    margin-bottom: 3px;
}
.compact-field label {
    display: block;
    margin-bottom: 1px;
    font-size: var(--font-small);
    font-weight: 600;
    line-height: 1.1;
}
.compact-field label b { margin-left: 3px; color: var(--danger); }
.quote-workbench-page .compact-field input,
.quote-workbench-page .compact-field select {
    width: 100%;
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
}
.compact-field.span-2 { grid-column: 2 / 4; }
.quote-form {
    min-width: 0;
}
.line-editor {
    min-width: 0;
    max-width: 100%;
    margin-top: 3px;
    border: 1px solid #cfcfca;
    background: #fff;
    overscroll-behavior: contain;
}
.line-editor-toolbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 3px 8px;
    min-height: 38px;
    border-bottom: 1px solid var(--line);
    background: #f7f7f4;
}
.line-editor-toolbar span {
    font-weight: 600;
}
.line-editor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.line-editor-toolbar > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.line-toolbar-field {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: var(--font-small);
    font-weight: 600;
    white-space: nowrap;
}
.line-toolbar-field select {
    width: auto;
    min-width: 116px;
    height: 32px;
    min-height: 32px;
    padding: 0 26px 0 10px;
}
.line-editor-toolbar .button {
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 0 12px;
}
.line-density-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: var(--font-small);
    font-weight: 600;
    white-space: nowrap;
}
.line-density-toggle button {
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid #b8b8b4;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}
.line-density-toggle button.is-active {
    border-color: var(--black);
    background: var(--black);
    color: #fff;
}
.line-scroll-x-top {
    position: sticky;
    top: 43px;
    z-index: 11;
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
    border-bottom: 1px solid #c8c8c3;
    background: #eeeeeb;
    box-shadow: 0 1px 0 rgb(0 0 0 / 8%);
}
.line-scroll-x-top > div {
    height: 1px;
}
.line-scroll-x-top::-webkit-scrollbar,
.line-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.line-scroll-x-top::-webkit-scrollbar-track,
.line-scroll::-webkit-scrollbar-track {
    background: #ededeb;
}
.line-scroll-x-top::-webkit-scrollbar-thumb,
.line-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #bcbcbc;
}
.line-scroll-x-top::-webkit-scrollbar-thumb:hover,
.line-scroll::-webkit-scrollbar-thumb:hover {
    background: #9f9f9f;
}
.line-scroll {
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #bcbcbc #ededeb;
    height: calc(100vh - 268px);
    min-height: 430px;
}
.line-table {
    min-width: 100%;
    table-layout: fixed;
    white-space: nowrap;
    border-collapse: separate;
    border-spacing: 0;
}
.line-table th,
.line-table td {
    height: 36px;
    padding: 0;
    border-right: 1px solid #d7d7d2;
    border-bottom: 1px solid #d7d7d2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    vertical-align: middle;
}
.line-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 38px;
    padding: 0 14px 0 8px;
    background: #ecece8;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    user-select: none;
}
.line-table th.is-resize-ready {
    cursor: col-resize;
}
.line-table input,
.line-table select {
    width: 100%;
    min-width: 0;
    min-height: 35px;
    height: 35px;
    padding: 5px 8px;
    border: 1px solid transparent;
    background: transparent;
    outline: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.line-table input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}
.line-table input[type="number"]::-webkit-outer-spin-button,
.line-table input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}
.line-table select { padding-right: 18px; }
.line-editor[data-density="compact"] .line-table th,
.line-editor[data-density="compact"] .line-table td {
    height: 30px;
}
.line-editor[data-density="compact"] .line-table th {
    height: 32px;
    font-size: 12px;
}
.line-editor[data-density="compact"] .line-table input,
.line-editor[data-density="compact"] .line-table select {
    min-height: 29px;
    height: 29px;
    padding: 3px 7px;
    font-size: 12px;
}
.line-editor[data-density="compact"] .line-table select {
    padding-right: 14px;
}
.line-editor[data-density="comfortable"] .line-table th,
.line-editor[data-density="comfortable"] .line-table td {
    height: 44px;
}
.line-editor[data-density="comfortable"] .line-table th {
    height: 46px;
    font-size: 14px;
}
.line-editor[data-density="comfortable"] .line-table input,
.line-editor[data-density="comfortable"] .line-table select {
    min-height: 43px;
    height: 43px;
    padding: 6px 9px;
    font-size: 14px;
}
.line-column-resizer {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 8;
    width: 12px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}
.line-column-resizer::after {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 5px;
    width: 2px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.12s ease, width 0.12s ease, left 0.12s ease;
}
.line-column-resizer:hover::after,
.line-table th.is-resize-ready .line-column-resizer::after,
body.is-resizing-line-column .line-column-resizer::after {
    left: 4px;
    width: 4px;
    background: #5b9bd5;
}
.line-column-resizer:hover {
    background: rgb(91 155 213 / 10%);
}
body.is-resizing-line-column {
    cursor: col-resize;
    user-select: none;
}
.line-table select.quote-linked-select {
    padding-right: 22px;
    background-color: #fafaf8;
    cursor: pointer;
}
.line-table select.quote-linked-select:hover { background-color: #f1f1ed; }
.quote-color-cell-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px;
    align-items: center;
    gap: 2px;
}
.quote-color-cell-tools select {
    min-width: 0;
    width: 100%;
}
.quote-custom-color-button {
    width: 26px;
    min-width: 26px;
    height: 24px;
    padding: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 20px;
}
.quote-custom-color-popover {
    position: fixed;
    z-index: 6100;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 6px;
    align-items: center;
    width: min(420px, calc(100vw - 16px));
    padding: 8px;
    border: 1px solid #222;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.quote-custom-color-popover[hidden] { display: none; }
.quote-custom-color-popover .field,
.quote-custom-color-popover .button {
    min-height: 34px;
}
.craft-cell-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px;
    align-items: center;
    gap: 2px;
}
.mini-button {
    height: 28px;
    padding: 0 6px;
    border: 1px solid #aaa;
    background: #fff;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}
.mini-button:hover { border-color: #111; }
.craft-add-button {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 18px;
    line-height: 20px;
    font-weight: 700;
}
.line-table tr.free-rework-row td {
    background: #fff7df;
}
.line-table td.field-required-soft {
    background: #fff8e6;
}
.line-table input:focus,
.line-table select:focus {
    border-color: var(--black);
    background: #fff;
    outline: 1px solid var(--black);
    outline-offset: -1px;
}
.line-table tbody tr:not(.free-rework-row):not(.line-row-selected):not(.line-row-deleted):hover td {
    background: #f4f4f1;
}
.line-table .errorlist { white-space: normal; }
.line-table .is-hidden { display: none; }
.line-table tbody tr {
    outline: 0;
}
.line-table tbody tr.line-row-selected {
    background: #eef6ff;
    box-shadow: inset 0 0 0 2px #5b9bd5;
}
.line-table td.line-cell-range-selected {
    background: #eaf4ff;
    box-shadow: inset 0 0 0 1px #8bb7e2;
}
.line-table td.line-cell-range-anchor,
.line-table td.line-cell-range-target {
    box-shadow: inset 0 0 0 2px #2f74bd;
}
.line-table td.line-cell-range-selected input,
.line-table td.line-cell-range-selected select {
    background: #fbfdff;
}
.line-table tbody tr.line-row-deleted {
    opacity: 0.45;
    text-decoration: line-through;
}
.line-hidden-fields { display: none; }
.material-field-with-faces {
    display: flex;
    align-items: center;
    gap: 6px;
}
.material-field-with-faces input {
    min-width: 0;
    flex: 1 1 auto;
}
.material-faces-badge {
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--ink);
    font-size: var(--font-small);
    font-weight: 600;
    white-space: nowrap;
}
.product-picker-input { cursor: text; background: #fff; }
.quote-line-menu {
    position: fixed;
    z-index: 6000;
    min-width: 136px;
    padding: 6px;
    border: 1px solid #b8c2cc;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.quote-line-menu[hidden] { display: none; }
.quote-line-menu button {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 6px 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.quote-line-menu button:hover,
.quote-line-menu button:focus {
    background: #eef6ff;
    outline: 0;
}
.quote-line-menu button:disabled {
    color: #aaa;
    cursor: not-allowed;
}
.modal-open { overflow: hidden; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.38);
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
    width: min(1180px, calc(100vw - 56px));
    max-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    border: 1px solid #222;
    background: #fff;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 16px 22px 12px;
    border-bottom: 1px solid var(--line);
}
.modal-header h2 { margin: 0 0 5px; font-size: var(--font-page-title); }
.modal-header p { margin: 0; color: var(--muted); }
.icon-button {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.product-picker-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    min-height: 58px;
    padding: 10px 22px 16px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.product-picker-filters .field {
    flex: 0 0 150px;
    height: 36px;
}
.product-picker-filters .product-picker-query {
    flex-basis: 320px;
}
.product-picker-table-wrap {
    min-height: 320px;
    flex: 1 1 auto;
    overflow: auto;
    border-top: 1px solid var(--line);
}
.product-picker-resultbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 12px;
}
.product-picker-count { color: var(--text); font-weight: 600; }
.product-picker-table { min-width: 980px; }
.product-picker-table th { top: 35px; }
.product-picker-table tbody tr { cursor: pointer; }
.product-picker-table tbody tr.selected { background: #e8e8e3; }
.table-row-action {
    float: right;
    border: 0;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.product-picker-empty { padding: 60px 20px; color: var(--muted); text-align: center; }
.modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
}
.order-chain-delete-panel {
    width: min(820px, calc(100vw - 56px));
}
.order-chain-delete-body {
    padding: 18px 22px 4px;
}
.order-chain-delete-warning {
    display: grid;
    gap: 5px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid var(--danger);
    background: #fff8f6;
}
.order-chain-delete-preview {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: #f7f7f4;
    line-height: 1.7;
}
.order-chain-delete-blockers {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--danger);
    color: var(--danger);
    font-weight: 600;
}
.label-new-file-panel {
    width: min(900px, calc(100vw - 36px));
    max-height: min(760px, calc(100vh - 36px));
    min-height: min(620px, calc(100vh - 36px));
}
.label-new-file-form {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 0;
}
.label-new-file-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(280px, 1fr);
    overflow: hidden;
}
.label-new-file-fields {
    min-height: 0;
    display: grid;
    align-content: start;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 22px;
    overflow: auto;
    border-right: 1px solid #ececec;
    background: #fff;
}
.label-new-file-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column: 1 / -1;
    gap: 14px;
}
.label-new-file-fields label,
.label-new-file-grid label {
    display: grid;
    gap: 6px;
    color: #333;
    font-size: 13px;
    font-weight: 600;
}
.label-new-file-fields .wide {
    grid-column: 1 / -1;
}
.label-new-file-fields input,
.label-new-file-fields select,
.label-new-file-grid input,
.label-new-file-grid select {
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid #d8d8d8;
    border-radius: 2px;
    background: #fff;
    font: inherit;
}
.label-new-file-fields input:focus,
.label-new-file-fields select:focus,
.label-new-file-grid input:focus,
.label-new-file-grid select:focus {
    border-color: #2b8fe8;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(43, 143, 232, .14);
}
.label-new-section-title {
    grid-column: 1 / -1;
    margin-top: 2px;
    color: #444;
    font-size: 14px;
    font-weight: 700;
}
.label-new-unit-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: center;
    border: 1px solid #d8d8d8;
    border-radius: 2px;
    background: #fff;
}
.label-new-unit-field input {
    border: 0;
    box-shadow: none !important;
}
.label-new-unit-field em {
    color: #888;
    font-style: normal;
    text-align: center;
}
.label-new-more {
    grid-column: 1 / -1;
}
.label-new-more summary {
    margin: 2px 0 10px;
    color: #444;
    font-weight: 700;
    cursor: pointer;
}
.label-new-preview {
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 22px 30px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(0,0,0,.025) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,.025) 1px, transparent 1px),
        #f6f8fb;
    background-size: 12px 12px;
}
.label-new-preview-stage {
    position: relative;
    width: min(360px, 90%);
    height: min(300px, 78%);
}
.preview-label-sheet {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 240px;
    height: 170px;
    transform: translate(-50%, -50%);
    border: 2px solid #d2d8df;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0,0,0,.08);
}
.preview-width,
.preview-height {
    position: absolute;
    z-index: 1;
    color: #4d9ad6;
    font-size: 13px;
    font-weight: 700;
}
.preview-width {
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
}
.preview-width::before,
.preview-width::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 70px;
    border-top: 1px solid #8fb8d8;
}
.preview-width::before {
    right: calc(100% + 8px);
}
.preview-width::after {
    left: calc(100% + 8px);
}
.preview-height {
    left: 2px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}
.preview-height::before,
.preview-height::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 46px;
    border-top: 1px solid #8fb8d8;
}
.preview-height::before {
    right: calc(100% + 8px);
}
.preview-height::after {
    left: calc(100% + 8px);
}
.label-new-file-form .muted-help {
    margin: 0;
    padding: 9px 22px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    font-size: 12px;
}
.product-picker-manual label { white-space: nowrap; font-weight: 600; }
.product-manual-name { flex: 1; min-width: 180px; }
.craft-items-panel {
    width: min(980px, calc(100vw - 48px));
}
.craft-items-body {
    padding: 14px 22px;
    overflow: auto;
}
.craft-items-preview {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 40px;
    margin-bottom: 10px;
    padding: 9px 10px;
    border: 1px solid #d8d8d4;
    background: #fffaf0;
    font-size: 14px;
    line-height: 1.45;
}
.craft-items-preview b {
    color: var(--ink);
}
.craft-items-preview span {
    color: var(--text);
}
.craft-items-table {
    min-width: 760px;
    margin-bottom: 12px;
    table-layout: fixed;
}
.craft-items-table th:nth-child(1) { width: 230px; }
.craft-items-table th:nth-child(2) { width: 320px; }
.craft-items-table th:nth-child(3) { width: 120px; }
.craft-items-table th:nth-child(4) { width: 80px; }
.craft-items-table th {
    height: 38px;
}
.craft-items-table th,
.craft-items-table td {
    padding: 6px;
}
.craft-items-table select,
.craft-items-table input {
    width: 100%;
    height: 34px;
}
.craft-items-table .craft-item-addon {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .product-picker-manual { flex-wrap: wrap; }
    .product-picker-manual label { width: 100%; }
}

@media (max-width: 720px) {
    .modal-backdrop { padding: 10px; }
    .modal-panel {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
    .product-picker-filters { padding: 10px; }
    .product-picker-filters .field { flex-basis: 140px; }
    .product-picker-filters .product-picker-query { flex-basis: 260px; }
}
.quote-summary {
    position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 18px;
    min-height: 40px;
    padding: 4px 12px; border: 1px solid var(--line); background: #fff;
    font-size: var(--font-topbar);
}
.quote-summary-tax-rate,
.quote-summary-tax {
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-size: var(--font-body);
    font-weight: 600;
}
.quote-summary-tax-rate {
    margin-right: 0;
}
.quote-summary-tax-rate input {
    width: 72px;
    min-width: 72px;
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    text-align: right;
    font: inherit;
}
.quote-summary-tax {
    margin-right: auto;
    color: var(--text);
}
.quote-summary-money {
    display: inline-flex;
    justify-content: flex-end;
    min-width: 72px;
    text-align: right;
    font-weight: 700;
}
.quote-summary-tax b {
    color: var(--text);
    font-weight: 700;
}
.quote-summary input[type="hidden"] {
    display: none !important;
}
.my-import-compact form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.my-import-compact input[type="file"] {
    display: none;
}
.my-import-compact .button {
    white-space: nowrap;
}
.content:has(> .quote-workbench-page) {
    padding-top: 14px;
}
.quote-workbench-page .page-heading {
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 1px;
}
.quote-workbench-page .page-heading h1 {
    margin-bottom: 0;
    font-size: 18px;
    line-height: 1.08;
}
.quote-workbench-page .toolbar {
    gap: 6px;
}
.quote-workbench-actions {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: nowrap;
    margin: 0;
}
.quote-action-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.quote-workbench-actions .button {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
}
.quote-action-group form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.quote-action-group-status {
    flex: 0 0 auto;
}
.quote-action-group-status .field {
    width: 180px;
}
.quote-action-group-nav {
    margin-left: 0;
}
.floating-window {
    position: fixed;
    width: min(920px, calc(100vw - 80px));
    height: min(680px, calc(100vh - 110px));
    display: flex;
    flex-direction: column;
    border: 1px solid #1f1f1f;
    background: #fff;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
}
.floating-window[hidden] {
    display: none !important;
}
.floating-window.is-maximized {
    inset: 4px !important;
    width: auto;
    height: auto;
}
.floating-window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 0 8px 0 12px;
    border-bottom: 1px solid var(--line);
    background: #f1f3f5;
    cursor: move;
    user-select: none;
}
.floating-window.is-maximized .floating-window-titlebar { cursor: default; }
.floating-window.is-dragging iframe { pointer-events: none; }
.floating-window-titlebar strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.floating-window-controls {
    display: inline-flex;
    gap: 4px;
}
.floating-window-controls button,
.window-dock button {
    min-width: 30px;
    height: 28px;
    border: 1px solid #aaa;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}
.floating-window-controls button:hover,
.window-dock button:hover {
    border-color: var(--black);
    background: #f8f8f6;
}
.floating-window iframe {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}
.window-dock {
    position: fixed;
    z-index: 7000;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: flex;
    gap: 8px;
    pointer-events: none;
}
.window-dock-item {
    display: inline-flex;
    max-width: 220px;
    pointer-events: auto;
}
.window-dock-restore {
    min-width: 92px;
    max-width: 180px;
    border-right: 0 !important;
}
.window-dock-close {
    width: 30px;
    min-width: 30px;
    padding: 0;
    font-weight: 700;
}
.window-dock button {
    max-width: 180px;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.embedded-page .app-shell {
    display: block;
}
.embedded-page .sidebar,
.embedded-page .workspace-tabs,
.embedded-page .topbar {
    display: none;
}
.embedded-page .content {
    padding: 16px;
}
.embedded-page .page-heading {
    margin-bottom: 14px;
}
.embedded-page .page-heading h1 {
    font-size: var(--font-section-title);
}
.embedded-page .data-form {
    max-width: none;
    border: 0;
    padding: 0;
}
.template-form .table-wrap { max-width: 860px; }
.template-table th,
.template-table td { height: 38px; }
.template-table .check-cell {
    width: 64px;
    text-align: center;
}
.template-table .width-input { max-width: 110px; }
.inline-actions { display: inline-flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline-actions form { margin: 0; }
.text-link { text-decoration: underline; text-underline-offset: 3px; }
.payment-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.payment-summary > div {
    min-height: 105px;
    padding: 18px;
    border: 1px solid var(--line);
    background: var(--white);
    display: flex;
    flex-direction: column;
}
.payment-summary span { color: var(--muted); }
.payment-summary strong { margin-top: auto; font-size: var(--font-stat); }
.payment-summary small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}
.invoice-filter-bar .invoice-search {
    min-width: min(520px, 100%);
}
.invoice-quick-filters {
    margin-bottom: 12px;
    gap: 8px;
    flex-wrap: wrap;
}
.invoice-table-wrap {
    max-height: 62vh;
}
.invoice-table th:nth-child(1) { min-width: 170px; }
.invoice-table th:nth-child(2) { min-width: 130px; }
.invoice-table th:nth-child(3) { min-width: 150px; }
.invoice-table th:nth-child(6) { min-width: 220px; }
.invoice-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.inline-form {
    display: inline;
    margin: 0;
}
.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.text-button:hover {
    color: var(--black);
}
.status-pill {
    display: inline-flex;
    min-height: 28px;
    padding: 3px 9px;
    align-items: center;
    border: 1px solid #c9c9c3;
    background: #f7f7f4;
    font-weight: 600;
    white-space: nowrap;
}
.status-ready,
.status-waiting_customer,
.status-pending_invoice {
    border-color: #b9c9a8;
    background: #f2f8ec;
}
.status-waiting_customer {
    border-color: #d8c8a0;
    background: #fff7df;
}
.status-invoiced {
    border-color: #9fbf9f;
    background: #edf7ed;
    color: #176b2c;
}
.status-no_invoice {
    border-color: #d2d2cc;
    background: #f2f2ef;
    color: #666;
}
.status-pending,
.status-pending_material {
    border-color: #d8c8a0;
    background: #fff7df;
}
.invoice-detail-form {
    max-width: none;
}
.invoice-detail-form textarea {
    min-height: 180px;
}
.invoice-detail-form .form-row-full {
    display: block;
}
.invoice-detail-form .form-row-full textarea {
    margin-top: 8px;
}
.invoice-attachment-section {
    max-width: none;
}
.collection-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cell-muted {
    color: var(--muted);
    font-size: var(--font-sm);
    line-height: 1.45;
    min-width: 150px;
}
.form-hint { color: var(--muted); }
.summary-strip {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    background: var(--white);
}
.summary-strip span { color: var(--muted); }
.summary-strip strong { margin-left: 8px; color: var(--text); }
.production-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.production-actions form { margin: 0; }
.production-sheet-card {
    margin-bottom: 10px;
    border: 0;
    background: transparent;
}
.production-sheet-card > header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}
.production-sheet-card h2 { margin: 0 0 4px; font-size: var(--font-section-title); }
.production-sheet-card p { margin: 0; color: var(--muted); }
.sheet-metrics { display: flex; gap: 18px; align-items: center; }
.production-sheet-card .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
}
.production-standard-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    border: 2.25px solid #111;
    background: #fff;
    empty-cells: show;
    font-size: 13px;
}
.production-standard-table .prod-col-label { width: 8.5%; }
.production-standard-table th,
.production-standard-table td {
    height: 38px;
    padding: 5px 6px;
    border: 1.2px solid #111;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
}
.production-standard-table th {
    background: #edece8;
    font-weight: 600;
}
.production-standard-table .section-bottom > th,
.production-standard-table .section-bottom > td {
    border-bottom-width: 2px;
}
.production-standard-table .production-title {
    height: 52px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
}
.production-standard-table .production-top-row th,
.production-standard-table .production-top-row td {
    border-top-width: 2px;
}
.production-standard-table .production-meta-row th,
.production-standard-table .production-count-head th,
.production-standard-table .production-station-head th,
.production-standard-table .production-special-row th {
    background: #efefec;
}
.production-standard-table .production-value-row td {
    height: 48px;
    font-size: 15px;
}
.production-standard-table .production-number {
    font-weight: 600;
}
.production-standard-table .production-write-row td {
    height: 46px;
    background: #fff;
}
.production-standard-table .production-special-row td {
    height: 42px;
}
.empty-panel {
    padding: 48px 24px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--muted);
    text-align: center;
}
.order-progress-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px 24px;
}
.daily-report-create {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--white);
}
.daily-report-create label { font-weight: 600; }
.print-toolbar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 14px; }
.daily-report-sheet { padding: 18px; border: 1px solid var(--line); background: #fff; }
.daily-report-sheet > header {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 24px;
    margin-bottom: 14px;
}
.daily-report-sheet h1 { margin: 0; font-size: 26px; }
.daily-report-sheet table { white-space: normal; table-layout: fixed; font-size: 12px; }
.daily-report-sheet th, .daily-report-sheet td {
    padding: 7px 5px;
    border: 1px solid #333;
    vertical-align: top;
    overflow-wrap: anywhere;
}
.daily-report-sheet tbody tr { height: 52px; }
.daily-report-sheet th:nth-child(4) { width: 105px; }
.daily-report-sheet th:nth-child(6) { width: 115px; }
.daily-report-sheet th:nth-child(8) { width: 105px; }
.daily-report-sheet th:nth-child(14) { width: 115px; }
.daily-record-wrap { max-height: calc(100vh - 270px); }
.daily-record-table { min-width: 2700px; }
.daily-record-table th, .daily-record-table td { padding: 6px; vertical-align: top; }
.daily-record-table input, .daily-record-table select {
    width: 132px;
    min-height: 34px;
    padding: 5px 6px;
}
.daily-record-table td:nth-child(13) input,
.daily-record-table td:nth-child(14) input,
.daily-record-table td:nth-child(18) input { width: 220px; }
.sticky-savebar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    background: #fff;
}
.sticky-savebar span { color: var(--muted); }
.daily-note-input {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.daily-note-input input {
    min-width: 0;
    width: 100%;
}
.daily-note-input .button {
    min-height: 36px;
    white-space: nowrap;
}
.daily-note-input .button.is-active {
    background: #111;
    color: #fff;
}
.daily-report-photos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: #fff;
}
.daily-report-photos h2 { margin: 0 0 4px; font-size: var(--font-section-title); }
.daily-report-photos p { margin: 0; color: var(--muted); }
.daily-report-photos form { display: flex; align-items: center; gap: 8px; }
.daily-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.daily-photo-grid article { border: 1px solid var(--line); background: #fff; }
.daily-photo-grid img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f3f3f1;
}
.daily-photo-grid footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
}
.daily-photo-grid footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-record-workspace {
    display: grid;
    grid-template-columns: minmax(330px, 36vw) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.daily-record-workspace.no-photo { display: block; }
.daily-record-photo-panel {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 150px);
    overflow: auto;
    border: 1px solid var(--line);
    background: #fff;
}
.daily-record-photo-panel header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.daily-record-photo-panel header span { color: var(--muted); font-size: 12px; }
.daily-record-photo-panel img {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--line);
}
.daily-record-form { min-width: 0; }
.selection-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 32px;
    margin-bottom: 6px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    background: #fff;
}
.selection-toolbar span {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.selection-toolbar .button {
    min-height: 28px;
    margin-left: auto;
    padding: 0 10px;
    white-space: nowrap;
}
.delivery-sheet {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid #bbb;
    background: #fff;
    color: #111;
}
.delivery-sheet > header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 2px solid #111;
}
.delivery-brand { font-size: 30px; font-weight: 800; letter-spacing: 0; }
.delivery-sheet h1 { margin: 0; font-size: 28px; text-align: center; }
.delivery-sheet header p { margin: 2px 0 0; color: #666; text-align: center; font-size: 11px; }
.delivery-number { text-align: right; }
.delivery-number span { display: block; color: #666; font-size: 12px; }
.delivery-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 16px 0;
    border-top: 1px solid #777;
    border-left: 1px solid #777;
}
.delivery-meta span {
    min-height: 42px;
    padding: 10px;
    border-right: 1px solid #777;
    border-bottom: 1px solid #777;
}
.delivery-meta .wide { grid-column: span 2; }
.delivery-sheet table { white-space: normal; table-layout: fixed; }
.delivery-sheet th, .delivery-sheet td { padding: 9px 7px; border: 1px solid #555; }
.package-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 14px;
    border: 1px solid #555;
}
.package-summary span { padding: 12px; border-right: 1px solid #555; text-align: center; }
.package-summary span:last-child { border-right: 0; }
.delivery-notes { min-height: 88px; padding: 12px 0; border-bottom: 1px solid #555; }
.delivery-notes p { margin: 5px 0; }
.delivery-sheet footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding-top: 28px;
}
.status-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid #c8c8c2;
    background: #f7f7f3;
    color: #222;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.status-mark.settled,
.status-mark.outstanding {
    border-color: #c8c8c2;
    background: #f7f7f3;
    color: #222;
}

@media print {
    @page production-sheet { size: A4 landscape; margin: 5mm 4mm 5mm 9mm; }
    @page daily-report { size: A4 landscape; margin: 5mm; }
    .sidebar, .topbar, .print-toolbar, .message, .no-print { display: none !important; }
    .app-shell { display: block; }
    html, body {
        width: 100%;
        margin: 0;
        background: #fff;
    }
    .main,
    .content {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .daily-report-sheet {
        page: daily-report;
        width: 287mm;
        min-height: 200mm;
        padding: 0;
        border: 0;
        box-sizing: border-box;
    }
    .daily-report-sheet > header { margin-bottom: 6px; }
    .daily-report-sheet h1 { font-size: 20px; }
    .daily-report-sheet table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
        font-size: 8px;
    }
    .daily-report-sheet th, .daily-report-sheet td {
        padding: 3px 2px;
        line-height: 1.25;
        overflow-wrap: anywhere;
        word-break: break-all;
    }
    .daily-report-sheet tbody tr { height: 34px; }
    .daily-report-sheet th:nth-child(1), .daily-report-sheet td:nth-child(1) { width: 16mm; }
    .daily-report-sheet th:nth-child(2), .daily-report-sheet td:nth-child(2) { width: 12mm; }
    .daily-report-sheet th:nth-child(3), .daily-report-sheet td:nth-child(3) { width: 14mm; }
    .daily-report-sheet th:nth-child(4), .daily-report-sheet td:nth-child(4) { width: 32mm; }
    .daily-report-sheet th:nth-child(5), .daily-report-sheet td:nth-child(5) { width: 20mm; }
    .daily-report-sheet th:nth-child(6), .daily-report-sheet td:nth-child(6) { width: 24mm; }
    .daily-report-sheet th:nth-child(7), .daily-report-sheet td:nth-child(7) { width: 22mm; }
    .daily-report-sheet th:nth-child(8), .daily-report-sheet td:nth-child(8) { width: 29mm; }
    .daily-report-sheet th:nth-child(9), .daily-report-sheet td:nth-child(9) { width: 18mm; }
    .daily-report-sheet th:nth-child(10), .daily-report-sheet td:nth-child(10),
    .daily-report-sheet th:nth-child(11), .daily-report-sheet td:nth-child(11),
    .daily-report-sheet th:nth-child(12), .daily-report-sheet td:nth-child(12),
    .daily-report-sheet th:nth-child(13), .daily-report-sheet td:nth-child(13) { width: 14mm; }
    .daily-report-sheet th:nth-child(14), .daily-report-sheet td:nth-child(14) { width: 30mm; }
    .delivery-sheet { max-width: none; padding: 0; border: 0; }
    .production-sheet-card {
        page: production-sheet;
        break-inside: avoid;
        page-break-inside: avoid;
        width: 280mm;
        height: 176mm;
        margin: 0;
        border: 0;
        background: #fff;
        display: flex;
        flex-direction: column;
    }
    .production-sheet-card:not(:last-of-type) {
        break-after: page;
        page-break-after: always;
    }
    .production-sheet-card > header {
        display: none;
    }
    .production-sheet-card .table-wrap {
        width: 100%;
        flex: 1;
        overflow: visible;
        border: 0;
    }
    .production-standard-table {
        width: 100% !important;
        height: 176mm;
        min-width: 0;
        table-layout: fixed;
        border: 1.8px solid #111;
        box-sizing: border-box;
        font-size: 13.4px;
        empty-cells: show;
    }
    .production-standard-table tr:nth-child(1) { height: 14mm; }
    .production-standard-table tr:nth-child(2),
    .production-standard-table tr:nth-child(3) { height: 12mm; }
    .production-standard-table tr:nth-child(4),
    .production-standard-table tr:nth-child(5),
    .production-standard-table tr:nth-child(6),
    .production-standard-table tr:nth-child(7),
    .production-standard-table tr:nth-child(8) { height: 10.5mm; }
    .production-standard-table tr:nth-child(9) { height: 10.5mm; }
    .production-standard-table tr:nth-child(10),
    .production-standard-table tr:nth-child(11) { height: 14mm; }
    .production-standard-table tr:nth-child(12),
    .production-standard-table tr:nth-child(13) { height: 11.5mm; }
    .production-standard-table th,
    .production-standard-table td {
        height: auto;
        padding: 1px 4px;
        border: 0.9px solid #161616;
        color: #000;
        background: #fff;
    }
    .production-standard-table th {
        background: #f0f0ed !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .production-standard-table .production-title {
        font-size: 22px;
        letter-spacing: 0;
    }
    .production-standard-table .section-bottom > th,
    .production-standard-table .section-bottom > td {
        border-bottom-width: 1.6px;
    }
    .production-standard-table .production-value-row td {
        font-size: 14px;
        font-weight: 600;
    }
    .production-standard-table .production-write-row td {
        background: #fff;
    }
}

@media (max-width: 900px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }
    body.mobile-nav-lock {
        overflow: hidden;
    }
    .app-shell {
        display: block;
        min-height: 100vh;
    }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 80;
        grid-row: auto;
        width: 320px;
        max-width: calc(100vw - 24px);
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 160ms ease-out;
        box-shadow: none;
    }
    .app-shell.mobile-nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 20px rgba(0, 0, 0, 0.2);
    }
    .sidebar nav {
        min-height: 0;
        overflow: hidden;
    }
    .nav-secondary-toggle,
    .nav-secondary-resizer {
        display: none !important;
    }
    .quick-nav-picker {
        width: calc(min(320px, calc(100vw - 24px)) - var(--nav-primary-width));
        box-shadow: none;
    }
    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 70;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgba(0, 0, 0, 0.38);
        border: 0;
    }
    .app-shell.mobile-nav-open .mobile-nav-backdrop {
        display: block;
    }
    .main {
        grid-column: auto;
        grid-row: auto;
        display: grid;
        grid-template-rows: var(--nav-brand-height) minmax(0, 1fr);
        width: 100%;
        min-width: 0;
        min-height: 100vh;
    }
    .main::before { display: none; }
    .workspace-tabs {
        align-items: center;
        gap: 5px;
        padding: 0 8px;
    }
    .mobile-nav-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 32px;
        padding: 0 8px;
        color: #fff;
        background: #292929;
        border: 1px solid #555;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }
    .mobile-nav-toggle[aria-expanded="true"] {
        color: #111;
        background: #fff;
        border-color: #fff;
    }
    .workspace-home-tab,
    .workspace-current-tab {
        height: 32px;
    }
    .workspace-current-tab button {
        height: 30px;
    }
    .content,
    .app-shell.nav-secondary-collapsed .content {
        padding-left: var(--content-padding);
    }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .module-grid { grid-template-columns: 1fr; }
    .detail-grid, .audit-json-grid { grid-template-columns: 1fr; }
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .filterbar:not(.filterbar-wrap) input,
    .filterbar:not(.filterbar-wrap) select,
    .filterbar:not(.filterbar-wrap) .button,
    .filterbar:not(.filterbar-wrap) .check-label,
    .selection-toolbar .button {
        width: 100%;
    }
    .selection-toolbar { align-items: flex-start; }
    table { min-width: 760px; }
    .quote-list-table { min-width: 0; }
}

.subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}
.subnav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    color: var(--ink);
    background: #fff;
    text-decoration: none;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid #c8c8c2;
    background: #f7f7f3;
    color: #222;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.status-settled,
.status-quoted,
.status-transferred,
.status-shipped {
    border-color: #b7c7b1;
    background: #f4f8f2;
    color: #234f2a;
}
.status-outstanding,
.status-overdue {
    border-color: #d8b4ad;
    background: #fff7f5;
    color: #8c2b1f;
}
.status-draft,
.status-pending {
    border-color: #c8c8c2;
    background: #f7f7f3;
    color: #222;
}
.status-normal { border-color: #86b37e; background: #eef7ea; color: #256529; }
.status-repairing { border-color: #d5a642; background: #fff4d8; color: #7c4f00; }
.status-stopped { border-color: #c88a8a; background: #fff0f0; color: #8c1f1f; }
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.equipment-detail-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.equipment-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.info-panel {
    border: 1px solid var(--line);
    background: #fff;
    padding: 18px;
}
.equipment-photo {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border: 1px solid var(--line);
    margin-bottom: 14px;
}
.compact-dl {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px 14px;
    margin: 0;
}
.compact-dl dt { color: var(--muted); font-weight: 700; }
.compact-dl dd { margin: 0; }
.qr-url {
    padding: 14px;
    border: 1px solid var(--line);
    background: #f8f8f4;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.equipment-qr {
    width: 180px;
    height: 180px;
    padding: 10px;
    border: 1px solid var(--line);
    background: #fff;
    margin: 10px 0 12px;
}
.equipment-purpose-qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.equipment-purpose-qr {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: #fafaf7;
}
.equipment-purpose-qr h3 {
    margin: 0;
    font-size: 16px;
}
.equipment-purpose-qr .equipment-qr {
    display: block;
    width: min(180px, 100%);
    height: auto;
    aspect-ratio: 1;
}
.equipment-purpose-qr .qr-url {
    padding: 9px;
    font-size: 11px;
}
.print-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.qr-print-sheet {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10mm;
    max-width: 190mm;
    margin: 0 auto;
    padding: 8mm;
    background: #fff;
    border: 1px solid var(--line);
}
.qr-label {
    min-height: 54mm;
    padding: 5mm;
    border: 1.4px solid #111;
    break-inside: avoid;
}
.qr-label-main {
    display: grid;
    grid-template-columns: 34mm 1fr;
    gap: 5mm;
    align-items: center;
}
.qr-label-main img {
    width: 34mm;
    height: 34mm;
}
.qr-label h2 {
    margin: 0 0 2mm;
    font-size: 18px;
}
.qr-label p {
    margin: 1mm 0;
    font-size: 12px;
    color: #333;
}
.qr-label .qr-label-purpose {
    margin-bottom: 2mm;
    color: #111;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.25;
}
.qr-label-code {
    font-weight: 800;
    color: #111 !important;
}
.qr-label-footer {
    margin-top: 4mm;
    padding-top: 3mm;
    border-top: 1px solid #ccc;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.scan-page { max-width: 860px; margin: 0 auto; }
.scan-hero {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    background: #fff;
}
.scan-hero img {
    width: 128px;
    height: 128px;
    object-fit: cover;
    border: 1px solid var(--line);
}
.scan-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.scan-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 76px;
    padding: 14px;
    border: 2px solid #111;
    background: #fff;
    color: var(--ink);
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
}
.scan-button.primary { background: #111; color: #fff; }
.scan-button.danger { border-color: #c92525; color: #b71515; }
.scan-section {
    margin: 18px 0;
    padding: 18px;
    border: 1px solid var(--line);
    background: #fff;
}
.material-card {
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
.material-card:first-of-type { border-top: 0; }
.material-card h3 { margin: 0 0 8px; }
.material-content {
    color: var(--ink);
    line-height: 1.7;
}
.check-group {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.check-group h3 {
    margin: 0 0 8px;
}
.check-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #ecece8;
}
.check-item:first-of-type {
    border-top: 0;
}
.check-item p {
    margin: 4px 0;
    color: #333;
    line-height: 1.55;
}
.check-item small {
    color: var(--muted);
    font-weight: 700;
}
.sop-fallback {
    padding: 14px;
    border: 1px solid #e4dccb;
    background: #fffaf0;
    margin-bottom: 12px;
}
.sop-fallback h3 { margin-top: 0; }
.sop-fallback ol { margin: 0 0 0 20px; padding: 0; line-height: 1.7; }
.muted { color: var(--muted); }

.line-subtext {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}
.line-cell-text {
    display: inline-block;
    color: var(--text);
    white-space: nowrap;
}

.scan-mobile-body {
    margin: 0;
    background: #f2f2ef;
    color: #222;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.scan-mobile-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 14px;
}
.scan-device-card,
.scan-check-card,
.scan-info-card {
    border: 1px solid #d7d7d2;
    background: #fff;
}
.scan-device-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px;
}
.scan-device-photo {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #cfcfca;
    background: #eeeeea;
    font-weight: 800;
    color: #777;
}
.scan-device-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.scan-device-main h1 {
    margin: 8px 0 4px;
    font-size: 26px;
    line-height: 1.12;
}
.scan-device-main p {
    margin: 3px 0;
    color: #666;
    font-size: 15px;
    line-height: 1.35;
}
.scan-device-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: #555;
    font-weight: 800;
}
.scan-purpose-banner {
    margin-top: 12px;
    padding: 12px 14px;
    border: 2px solid #111;
    background: #111;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    text-align: center;
}
.scan-message-stack {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}
.scan-message {
    padding: 12px;
    border: 1px solid #d4d4cf;
    background: #fff;
    font-weight: 800;
}
.scan-message.success {
    border-color: #9fc79f;
    background: #f2fbf1;
}
.scan-message.error {
    border-color: #dca0a0;
    background: #fff2f2;
}
.scan-check-card,
.scan-info-card {
    margin-top: 12px;
    padding: 14px;
}
.scan-section-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e2dd;
}
.scan-section-title span {
    display: block;
    color: #777;
    font-weight: 800;
    font-size: 14px;
}
.scan-section-title h2,
.scan-info-card h2 {
    margin: 2px 0 0;
    font-size: 24px;
    line-height: 1.2;
}
.scan-done-badge {
    flex: 0 0 auto;
    padding: 7px 10px;
    background: #111;
    color: #fff;
    font-size: 14px;
}
.scan-complete-panel {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    padding: 12px;
    background: #f7f7f3;
    border: 1px solid #dfdfd9;
}
.scan-complete-panel span {
    color: #666;
    font-weight: 800;
}
.scan-finished-list,
.scan-check-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.scan-finished-row {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e0e0da;
    background: #fff;
}
.scan-finished-row span {
    display: flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff;
    font-weight: 900;
}
.scan-finished-row p,
.scan-check-copy strong,
.scan-check-copy em,
.scan-check-copy small {
    display: block;
}
.scan-finished-row p {
    margin: 0;
    font-weight: 800;
}
.scan-check-row {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e0e0da;
    background: #fff;
}
.scan-result-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.scan-result-choice {
    position: relative;
    cursor: pointer;
}
.scan-result-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.scan-result-choice span {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 2px solid #777;
    background: #fff;
    font-weight: 900;
}
.scan-result-choice.normal input:checked + span {
    border-color: #111;
    background: #111;
    color: #fff;
}
.scan-result-choice.abnormal input:checked + span {
    border-color: #b42318;
    background: #b42318;
    color: #fff;
}
.scan-item-note {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
    color: #666;
    font-size: 14px;
    font-weight: 800;
}
.scan-item-note input {
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #b9b9b3;
    box-sizing: border-box;
    font: inherit;
}
.scan-done-badge.abnormal {
    background: #b42318;
}
.scan-check-copy strong {
    margin-bottom: 4px;
    font-size: 17px;
    line-height: 1.35;
}
.scan-check-copy em {
    color: #444;
    font-style: normal;
    line-height: 1.5;
}
.scan-check-copy small {
    margin-top: 5px;
    color: #777;
    font-weight: 800;
}
.scan-note-field {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    color: #555;
    font-weight: 800;
}
.scan-note-field textarea {
    width: 100%;
    min-height: 64px;
    padding: 10px;
    border: 1px solid #b9b9b3;
    box-sizing: border-box;
    font: inherit;
    resize: vertical;
}
.scan-submit-row {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 10px;
    margin-top: 12px;
}
.scan-primary-button,
.scan-secondary-button,
.scan-action-card {
    min-height: 54px;
    border: 2px solid #111;
    font: inherit;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}
.scan-primary-button {
    background: #111;
    color: #fff;
}
.scan-secondary-button {
    background: #fff;
    color: #111;
}
.scan-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.scan-action-grid.single {
    grid-template-columns: 1fr;
}
.scan-action-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 64px;
    padding: 10px;
    background: #fff;
    color: #111;
    text-decoration: none;
    box-sizing: border-box;
}
.scan-action-card.danger {
    border-color: #b71a1a;
    color: #a51111;
}
.scan-empty {
    padding: 14px;
    color: #666;
    background: #f8f8f5;
    border: 1px solid #e1e1dc;
    font-weight: 800;
}
.scan-recheck {
    margin-top: 12px;
}
.scan-recheck summary {
    cursor: pointer;
    font-weight: 900;
    color: #555;
}
.scan-safety-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.scan-safety-list p {
    margin: 0;
    padding: 10px 12px;
    background: #f8f8f5;
    border-left: 4px solid #111;
    line-height: 1.55;
}
.scan-material {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e2dd;
}
.scan-material h3 {
    margin: 0 0 8px;
}
.scan-material a {
    color: #111;
    font-weight: 900;
}

.listpage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 6px;
    margin: 6px 0 8px;
}
.listpage-stat {
    min-height: 36px;
    padding: 5px 9px;
    border: 1px solid #d9d9d4;
    background: #fff;
    box-sizing: border-box;
}
.listpage-stat span {
    display: block;
    color: #747474;
    font-size: var(--font-small);
    font-weight: 800;
}
.listpage-stat strong {
    display: block;
    margin-top: 2px;
    color: #242424;
    font-size: 17px;
    line-height: 1;
}
.listpage-stat small {
    display: block;
    margin-top: 2px;
    color: #888;
    font-size: 10px;
    font-weight: 700;
}
.sort-link {
    color: inherit;
    text-decoration: none;
}
.sort-link span {
    margin-left: 4px;
    color: #111;
}
.sort-link.active {
    text-decoration: underline;
    text-underline-offset: 4px;
}
.listpage-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    color: #666;
    font-weight: 800;
}
.button.disabled {
    opacity: 0.45;
    pointer-events: none;
}

@media (max-width: 900px) {
    .listpage-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .equipment-detail-grid,
    .equipment-two-col,
    .scan-hero,
    .scan-actions {
        grid-template-columns: 1fr;
    }
    .scan-hero img {
        width: 100%;
        height: 180px;
    }
    .scan-button {
        min-height: 68px;
        font-size: 20px;
    }
    .mobile-form .form-row,
    .mobile-form .form-actions {
        grid-template-columns: 1fr;
        margin-left: 0;
    }
    .check-item {
        grid-template-columns: 1fr;
    }
    .check-item .button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .listpage-stats,
    .listpage-pagination {
        grid-template-columns: 1fr;
    }
    .listpage-pagination {
        align-items: stretch;
        flex-direction: column;
    }
    .scan-mobile-shell {
        padding: 10px;
    }
    .scan-device-card {
        grid-template-columns: 82px 1fr;
        gap: 10px;
        padding: 12px;
    }
    .scan-device-photo {
        width: 82px;
        height: 82px;
    }
    .scan-device-main h1 {
        font-size: 23px;
    }
    .scan-submit-row,
    .scan-action-grid {
        grid-template-columns: 1fr;
    }
}

.reprint-action-bar {
    display: grid;
    grid-template-columns: minmax(120px, 150px) 220px minmax(280px, 1fr) auto;
    gap: 12px;
    align-items: end;
    border: 1px solid var(--line);
    background: #f7f7f5;
    padding: 12px 14px;
    margin: 14px 0 10px;
}

.reprint-action-bar label {
    display: grid;
    gap: 6px;
    margin: 0;
    font-weight: 700;
}

.reprint-action-bar select,
.reprint-action-bar input {
    width: 100%;
    min-width: 0;
}

.reprint-selected-count {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-weight: 700;
}

.reprint-selected-count b {
    color: #111;
    font-size: 22px;
}

.reprint-action-submit {
    display: flex;
    align-items: end;
}

.reprint-action-submit .button {
    height: 38px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .reprint-action-bar {
        grid-template-columns: 1fr 1fr;
    }
    .reprint-selected-count,
    .reprint-action-bar label:last-of-type,
    .reprint-action-submit {
        grid-column: 1 / -1;
    }
}

@media print {
    .sidebar,
    .topbar,
    .print-toolbar,
    .message {
        display: none !important;
    }
    .app-shell {
        display: block;
    }
    .main,
    .content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .qr-print-sheet {
        width: 190mm;
        max-width: none;
        margin: 0;
        padding: 6mm;
        border: 0;
        gap: 7mm;
        box-sizing: border-box;
    }
    .qr-label {
        border: 1.2px solid #111;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    @page {
        size: A4 portrait;
        margin: 8mm;
    }
}
