@import url("./icons.css");
/* Hallmark · genre: modern-minimal · macrostructure: Workbench · theme: studied-DNA (source: user image) · tone: utilitarian · anchor: teal · density: compact · critique: P5 H5 E4 S5 R5 V5 · contrast: pass (40–41) · tokens: pass (48) */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V5 · component: product image viewer */
:root {
    color-scheme: light;
    font-family: var(--font-body);
    color: var(--color-ink);
    background: var(--color-paper);
}

* { box-sizing: border-box; }

body {
    min-height: 100dvh;
    margin: 0;
    display: grid;
    place-items: center;
    background: var(--color-paper-2);
}

input, button { font: inherit; }

input {
    width: 100%;
    margin-top: var(--space-xs);
    padding: var(--space-sm);
    border: 1px solid var(--color-rule-strong);
    border-radius: 9px;
    color: var(--color-ink);
    background: var(--color-surface);
}

textarea {
    width: 100%;
    min-height: 92px;
    margin-top: var(--space-xs);
    padding: var(--space-sm);
    resize: vertical;
    border: 1px solid var(--color-rule-strong);
    border-radius: 9px;
    color: var(--color-ink);
    background: var(--color-surface);
    font: inherit;
}

button {
    border: 0;
    border-radius: 9px;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
    cursor: pointer;
}

select {
    width: 100%;
    margin-top: var(--space-xs);
    padding: var(--space-sm);
    border: 1px solid var(--color-rule-strong);
    border-radius: 9px;
    color: var(--color-ink);
    background: var(--color-surface);
}

.auth-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100dvh;
    padding: 24px;
    place-items: center;
    background: linear-gradient(180deg, #079789 0%, #4d9db5 100%);
}
.auth-card {
    width: max-content;
    min-width: min(388px, calc(100vw - 32px));
    max-width: min(420px, calc(100vw - 32px));
    padding: 36px 58px 40px;
    border: 0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 8px rgb(0 46 56 / 12%);
}
.auth-card h1 { margin: 0 0 14px; color: #078f84; font-size: 1.333333em; white-space: nowrap; text-align: center; }
.auth-card .auth-subtitle { margin: 0 0 20px; color: #527078; text-align: center; }

.form-stack { display: grid; gap: var(--space-lg); margin-top: var(--space-lg); }
.auth-card .form-stack { width: 100%; margin: 0; gap: 16px; }
.auth-card .auth-field { display: block; color: var(--color-ink-2); font-weight: 400; }
.auth-card .auth-field > input,
.auth-card .auth-field .password-input > input {
    width: 100%;
    margin: 0;
    padding: 12px var(--space-sm);
    border: 0;
    border-bottom: 1px solid #e1e7e8;
    border-radius: 0;
    background: #fff;
    font-size: 13px;
}
.auth-card .auth-field .password-input > input { padding-right: 2.25rem; }
.auth-card .auth-field input::placeholder { color: #687c80; opacity: 1; }
.auth-captcha { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.auth-captcha-image { padding: 0; border: 1px solid #e1e7e8; background: #fff; border-radius: 3px; }
.auth-captcha-image:active { transform: none; }
.auth-captcha-image img { display: block; width: 110px; height: auto; }
.auth-captcha input[aria-invalid="true"] { border-color: var(--color-danger); }
.auth-captcha-hint { margin-top: -10px; color: #687c80; font-size: 12px; font-weight: 400; }
.auth-card .form-stack > button { min-height: 42px; margin-top: 0; border-radius: 4px; background: #3ca99e; }
.form-stack label { color: var(--color-ink-2); font-weight: 600; }
.alert { padding: var(--space-sm); border-radius: 9px; color: var(--color-danger); background: var(--color-danger-soft); }
.auth-screen .alert { margin-bottom: 16px; }
@media (max-width: 30rem) {
    .auth-screen { padding: 16px; }
    .auth-card { min-width: min(340px, calc(100vw - 32px)); padding: 32px 28px; }
    .auth-card h1 { font-size: 1.05em; }
}

.app-body { display: block; background: var(--color-paper-2); }
.topbar {
    height: 64px;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
}
.brand { color: inherit; font-size: 18px; font-weight: 700; text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: var(--space-md); }
.user-menu form { margin: 0; }
.link-button { padding: 0; color: var(--color-accent-ink); background: transparent; }
.app-shell { min-height: calc(100dvh - 64px); display: grid; grid-template-columns: 220px 1fr; }
.sidebar { padding: var(--space-lg) var(--space-sm); display: grid; align-content: start; gap: var(--space-xs); background: var(--color-sidebar); }
.sidebar a, .sidebar span { padding: var(--space-sm); border-radius: 8px; color: var(--color-sidebar-text); text-decoration: none; }
.sidebar .active { color: var(--color-accent-ink); background: var(--color-sidebar-2); }
.content { padding: var(--space-xl); }
.page-heading { display: flex; align-items: center; justify-content: space-between; }
.page-heading h1 { margin-bottom: 0; }
.metric-grid { margin-top: var(--space-lg); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); }
.metric-grid article { padding: var(--space-lg); display: grid; gap: var(--space-xs); border: 1px solid var(--color-rule); border-radius: 12px; background: var(--color-surface); }
.metric-grid strong { font-size: 30px; }
.metric-grid span { color: var(--color-muted); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); margin-top: var(--space-lg); }
.panel { padding: var(--space-lg); border: 1px solid var(--color-rule); border-radius: 12px; background: var(--color-surface); }
.panel h2 { margin: 0 0 var(--space-lg); font-size: 18px; }
.form-stack.compact { gap: var(--space-sm); }
.full-panel { margin-top: var(--space-lg); }
.alert.success { margin-top: var(--space-lg); color: var(--color-success); background: var(--color-success-soft); }
.alert.warning { margin-top: var(--space-lg); color: var(--color-warning); background: var(--color-warning-soft); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: var(--space-sm); border-bottom: 1px solid var(--color-rule); text-align: left; white-space: nowrap; }
th { color: var(--color-ink-2); font-size: 13px; }
.primary-action { padding: var(--space-sm); border-radius: 9px; color: var(--color-accent-ink); background: var(--color-accent-deep); text-decoration: none; }
.form-panel { margin-top: var(--space-lg); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-md); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); margin-top: var(--space-lg); }
.details { display: grid; grid-template-columns: 110px 1fr; gap: var(--space-sm); }
.details dt { color: var(--color-muted); }
.details dd { margin: 0; }
.check-label { display: flex; align-items: center; gap: var(--space-xs); }
.check-label input { width: auto; margin: 0; }
.timeline { display: grid; gap: var(--space-sm); }
.timeline article { padding-left: var(--space-sm); border-left: 3px solid var(--color-accent-soft); }
.timeline time, .timeline small { display: block; color: var(--color-muted); font-size: 12px; }
.timeline strong { display: block; margin-top: var(--space-2xs); }
.timeline p { margin: var(--space-2xs) 0; }
.empty { color: var(--color-muted); text-align: center; }
.product-thumb { width: 52px; height: 52px; object-fit: contain; border: 1px solid var(--color-rule); border-radius: 6px; background: var(--color-surface); }
.line-editor input, .line-editor select { min-width: 110px; }
.line-editor td { vertical-align: top; }
.line-editor td input + input { margin-top: var(--space-xs); }
.action-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.action-row form { margin: 0; }
.form-grid small { display: block; margin-top: var(--space-xs); color: var(--color-muted); }
.document-grid { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: end; }
.document-grid form { display: flex; gap: var(--space-xs); align-items: end; margin: 0; }
.document-grid select { min-width: 220px; margin: 0; }
.packing-fields { min-width: 260px; padding: var(--space-xs) 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.packing-fields label { font-size: 12px; }
.packing-fields input { margin-top: var(--space-2xs); padding: var(--space-xs); }
.dashboard-lists { margin-top: var(--space-lg); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); }
.record-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-xs); }
.record-list li { display: grid; gap: var(--space-2xs); padding-bottom: var(--space-xs); border-bottom: 1px solid var(--color-rule); }
.record-list a { color: var(--color-accent-deep); text-decoration: none; font-weight: 600; }
.record-list small { color: var(--color-muted); }

.welcome-card {
    width: min(560px, calc(100% - 32px));
    padding: var(--space-xl);
    border: 1px solid var(--color-rule);
    border-radius: 18px;
    background: var(--color-surface);
    box-shadow: 0 1px 2px var(--color-shadow);
}

.eyebrow {
    margin: 0 0 var(--space-xs);
    color: var(--color-accent-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
}

h1 { min-width: 0; margin: 0 0 var(--space-md); overflow-wrap: anywhere; font-size: clamp(28px, 6vw, 42px); }
p { color: var(--color-muted); line-height: 1.7; }

.status {
    display: inline-block;
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 999px;
    color: var(--color-success);
    background: var(--color-success-soft);
    font-weight: 600;
}

/* ERP workbench layer */
body {
    font-family: var(--font-body);
    color: var(--color-ink);
    background: var(--color-paper-2);
}

a {
    color: var(--color-accent-deep);
    text-underline-offset: var(--space-2xs);
}

a,
button,
summary {
    white-space: nowrap;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

a:active {
    transform: translateY(1px);
}

[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}

input,
textarea,
select {
    min-height: var(--control-height);
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-md);
    color: var(--color-ink);
    background: var(--color-surface);
    outline: 2px solid transparent;
    outline-offset: 1px;
}

input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

[aria-invalid="true"] {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 var(--space-3xs) var(--color-danger-soft);
}

[data-state="success"] {
    border-color: var(--color-success);
    box-shadow: 0 0 0 var(--space-3xs) var(--color-success-soft);
}

button,
.primary-action {
    min-height: var(--control-height);
    border-radius: var(--radius-md);
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
    transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

button:active,
.primary-action:active {
    transform: translateY(1px);
}

button:focus-visible,
.primary-action:focus-visible,
.app-topbar a:focus-visible {
    outline-color: var(--color-accent-ink);
    outline-offset: 0;
    box-shadow: 0 0 0 var(--rule-focus) var(--color-focus);
}

.app-body {
    min-height: 100dvh;
    margin: 0;
    display: grid;
    grid-template-rows: var(--topbar-height) var(--tabs-height) auto minmax(0, 1fr);
    place-items: stretch;
    background: var(--color-paper-2);
}

.app-topbar {
    min-width: 0;
    padding-inline: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    color: var(--color-accent-ink);
    background: linear-gradient(120deg, var(--color-topbar-start), var(--color-topbar-end));
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    line-height: var(--topbar-height);
    text-decoration: none;
}

.brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-mark {
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: var(--rule-thin) solid var(--color-accent-ink);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
}

.user-menu form { margin: 0; }

.topbar-promo,
.topbar-action,
.topbar-icon,
.link-button {
    width: auto;
    min-height: var(--topbar-height);
    margin: 0;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--color-reference-white);
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
}

.topbar-promo-recommend { background: var(--color-topbar-recommend); }
.topbar-promo-purchase { background: var(--color-topbar-purchase); }

.topbar-icon {
    min-width: var(--topbar-height);
    padding: 0 12px;
}





.connection-state,
.user-menu > span:nth-child(2) {
    display: none;
}


.link-button {
    min-height: var(--topbar-height);
    padding: 0 20px;
    color: inherit;
    background: transparent;
}

.topbar-account {
    height: var(--topbar-height);
    position: relative;
}

.topbar-account summary.topbar-user {
    height: var(--topbar-height);
    padding: 0 12px;
    display: flex;
    align-items: center;
    color: var(--color-reference-white);
    cursor: pointer;
    list-style: none;
}

.topbar-account summary::-webkit-details-marker { display: none; }

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    display: block;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 80%);
    border-radius: 50%;
    object-fit: cover;
}
.topbar-user-avatar-fallback { display: grid; place-items: center; background: #e7f4f3; }
.topbar-user-avatar-fallback svg,
.account-avatar-preview-empty svg { width: 76%; height: 76%; fill: #607d8b; }

.topbar-account-menu {
    display: grid;
    min-width: 150px;
    padding: 4px;
    position: absolute;
    z-index: 30;
    inset: var(--topbar-height) 0 auto auto;
    border: 1px solid #d7dfe2;
    background: #fff;
    box-shadow: 0 3px 10px rgb(0 0 0 / 14%);
}

.topbar-account-menu > :is(a, button) {
    width: 100%;
    font-size: 14px;
    min-height: 38px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 2px;
    color: #34495e;
    background: transparent;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
}
.topbar-account-menu > :is(a, button):hover,
.topbar-account-menu > :is(a, button):focus-visible { background: #f2f5f6; }

.mobile-nav {
    border-bottom: var(--rule-thin) solid var(--color-rule);
    background: var(--color-surface);
}

.mobile-nav summary {
    min-height: var(--control-height);
    padding-inline: var(--space-md);
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
}

.mobile-nav nav {
    padding: 0 var(--space-md) var(--space-md);
    display: grid;
    gap: var(--space-2xs);
}

.mobile-nav a {
    min-height: var(--control-height);
    padding-inline: var(--space-sm);
    display: flex;
    align-items: center;
    border: var(--rule-thin) solid var(--color-rule);
    border-radius: var(--radius-md);
    text-decoration: none;
}

.app-shell {
    min-width: 0;
    min-height: 0;
    display: block;
}

.sidebar {
    display: none;
}
.sidebar b { font-weight: 400; }

.content {
    min-width: 0;
    padding: var(--space-md);
}

.page-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
}

.page-heading > div:first-child {
    min-width: 0;
}

.page-heading h1 {
    margin: 0;
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    line-height: 1.15;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.page-heading p {
    margin: var(--space-2xs) 0 0;
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.action-row > a,
.page-heading > a,
.form-actions > a {
    min-height: var(--control-height);
    padding-inline: var(--space-sm);
    display: inline-flex;
    align-items: center;
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-md);
    color: var(--color-ink-2);
    background: var(--color-surface);
    text-decoration: none;
}

.action-row > a.primary-action {
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
    border-color: var(--color-accent-deep);
}

.full-panel,
.form-panel {
    margin-top: var(--space-lg);
}

.workbench,
.panel {
    min-width: 0;
    border: var(--rule-thin) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: 0 1px 2px var(--color-shadow);
}

.workbench {
    padding: 0;
    overflow: clip;
}

.table-toolbar {
    min-height: 4.25rem;
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
    border-bottom: var(--rule-thin) solid var(--color-rule);
}

.table-search {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    font-weight: 700;
}

.table-search input {
    width: min(100%, 26rem);
    margin: 0;
}

.result-count {
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.result-count strong {
    color: var(--color-ink);
    font-variant-numeric: tabular-nums;
}

.table-wrap {
    width: 100%;
    min-width: 0;
    overflow: auto;
}

table {
    width: 100%;
    min-width: 46rem;
    border-collapse: collapse;
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
}

th,
td {
    height: 2.75rem;
    padding: var(--space-xs) var(--space-sm);
    border-bottom: var(--rule-thin) solid var(--color-rule);
    text-align: start;
    white-space: nowrap;
}

th {
    position: sticky;
    top: 0;
    z-index: var(--z-raised);
    color: var(--color-ink-2);
    background: var(--color-paper-3);
    font-size: var(--text-xs);
    font-weight: 700;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr[hidden] {
    display: none;
}

.number-cell {
    text-align: end;
    font-family: var(--font-outlier);
}

.empty {
    min-height: 7rem;
    color: var(--color-muted);
    text-align: center;
    white-space: normal;
}

.workbench-grid {
    min-width: 0;
    display: grid;
    gap: var(--space-sm);
}

.status-rail {
    padding: var(--space-sm);
    display: grid;
    align-content: start;
    gap: var(--space-2xs);
    border: var(--rule-thin) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.status-rail > strong {
    padding: var(--space-xs);
    font-family: var(--font-display);
    font-size: var(--text-sm);
}

.status-rail button {
    min-height: var(--control-height);
    padding-inline: var(--space-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: var(--rule-thin) solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-ink-2);
    background: transparent;
    font-size: var(--text-sm);
    text-align: start;
}

.status-rail button span {
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}

.status-rail button.active {
    border-color: var(--color-rule);
    color: var(--color-accent-deep);
    background: var(--color-accent-soft);
}

.state-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--color-ink-2);
}


.state-badge[data-state="accepted"],
.state-badge[data-state="completed"] {
    color: var(--color-success);
}

.state-badge[data-state="sent"],
.state-badge[data-state="confirmed"] {
    color: var(--color-accent-deep);
}

.state-badge[data-state="rejected"],
.state-badge[data-state="expired"],
.state-badge[data-state="cancelled"] {
    color: var(--color-danger);
}

.state-badge[data-status-color] { color: var(--status-color); }
.status-quick-edit { border: 0; padding: 0; background: none; color: var(--color-accent-deep); font: inherit; cursor: pointer; }
.status-quick-edit:hover { text-decoration: underline; }
.status-quick-edit:focus-visible { outline: 2px solid var(--color-accent-deep); outline-offset: 2px; }
.status-rail h2 { display: flex; align-items: center; justify-content: space-between; }
.status-rail h2 a { color: var(--color-accent-deep); text-decoration: none; }
:is(.quotation-workbench, .sales-order-workbench) .status-rail button[data-status-color] span>.crm-icon { color: var(--status-color); }

.metric-grid {
    margin-top: var(--space-lg);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xs);
}

.metric-grid article {
    min-width: 0;
    padding: var(--space-md);
    display: grid;
    grid-template-areas: "label label" "value link";
    align-items: end;
    gap: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.metric-grid span {
    grid-area: label;
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.metric-grid strong {
    grid-area: value;
    color: var(--color-ink);
    font-family: var(--font-outlier);
    font-size: var(--text-2xl);
    font-variant-numeric: tabular-nums;
}

.metric-grid a {
    grid-area: link;
    justify-self: end;
    font-size: var(--text-xs);
}

.dashboard-lists {
    margin-top: var(--space-sm);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-sm);
}

.dashboard-lists .panel,
.panel {
    padding: var(--space-md);
}

.panel h2 {
    margin: 0 0 var(--space-sm);
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: var(--text-base);
}

.record-list {
    gap: 0;
}

.record-list li {
    min-height: var(--control-height);
    padding-block: var(--space-xs);
    border-color: var(--color-rule);
}

.record-list a {
    color: var(--color-accent-deep);
}

.record-list small,
.details dt,
.timeline time,
.timeline small,
.form-grid small,
p {
    color: var(--color-muted);
}

.alert {
    border: var(--rule-thin) solid var(--color-danger);
    border-radius: var(--radius-md);
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.alert.success {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.alert.warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.form-grid,
.detail-grid,
.settings-grid {
    grid-template-columns: minmax(0, 1fr);
}

.product-thumb {
    border-color: var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

@media (hover: hover) and (pointer: fine) {
    input:hover,
    textarea:hover,
    select:hover {
        background: var(--color-paper-2);
    }

    tbody tr[data-table-row]:hover {
        background: var(--color-accent-soft);
    }

    .sidebar a:hover,
    .nav-section summary:hover,
    .status-rail button:hover {
        color: var(--color-accent-deep);
        background: var(--color-accent-soft);
    }

    button:hover,
    .primary-action:hover {
        background: var(--color-accent-hover);
    }
}

.nav-section summary:active,
.nav-section a:active {
    background: var(--color-sidebar-2);
}

@media (min-width: 40rem) {
    .app-topbar {
        padding-inline: 20px;
    }

    .connection-state,
    .user-menu > span:nth-child(2) {
        display: inline-flex;
        align-items: center;
    }

    .content {
        padding: var(--space-lg);
    }

    .page-heading {
        flex-direction: row;
        align-items: end;
        justify-content: space-between;
    }

    .table-toolbar {
        flex-direction: row;
        align-items: end;
        justify-content: space-between;
    }

    .table-search {
        flex-direction: row;
        align-items: center;
        gap: var(--space-xs);
    }

    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-lists {
        grid-template-columns: 1.15fr minmax(0, 1fr) minmax(0, 1fr);
    }

    .form-grid,
    .detail-grid,
    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 60rem) {
    .app-body {
        grid-template-rows: var(--topbar-height) var(--tabs-height) minmax(0, 1fr);
    }

    .mobile-nav {
        display: none;
    }

    .app-shell {
        min-height: calc(100dvh - var(--topbar-height) - var(--tabs-height));
        display: grid;
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    }

    .sidebar {
        min-height: 100%;
        padding: var(--space-md) var(--space-sm);
        display: grid;
        grid-template-rows: minmax(0, 1fr) auto;
        gap: var(--space-lg);
        color: var(--color-sidebar-text);
        background: var(--color-sidebar);
    }

    .sidebar nav {
        display: grid;
        align-content: start;
        gap: var(--space-2xs);
    }

    .nav-group {
        margin: var(--space-sm) var(--space-xs) var(--space-2xs);
        color: var(--color-rule-strong);
        font-family: var(--font-display);
        font-size: var(--text-xs);
        letter-spacing: .08em;
    }

    .sidebar a {
        min-height: var(--control-height);
        padding-inline: var(--space-xs);
        display: flex;
        align-items: center;
        gap: var(--space-xs);
        border-radius: var(--radius-sm);
        color: var(--color-sidebar-text);
        font-size: var(--text-sm);
        text-decoration: none;
    }

    .sidebar a > span {
        width: 1.5rem;
        height: 1.5rem;
        padding: 0;
        display: grid;
        place-items: center;
        border: var(--rule-thin) solid var(--color-sidebar-2);
        border-radius: var(--radius-sm);
        color: inherit;
        font-size: var(--text-xs);
    }

    .sidebar a.active {
        color: var(--color-accent-ink);
        background: var(--color-sidebar-2);
        box-shadow: inset 3px 0 var(--color-accent);
    }

    .sidebar-footer {
        padding: var(--space-sm) var(--space-xs);
        border-top: var(--rule-thin) solid var(--color-sidebar-2);
    }

    .sidebar-footer strong,
    .sidebar-footer small {
        display: block;
    }

    .sidebar-footer strong {
        font-family: var(--font-display);
        font-size: var(--text-sm);
    }

    .sidebar-footer small {
        margin-top: var(--space-2xs);
        color: var(--color-rule-strong);
        font-size: var(--text-xs);
    }

    .content {
        min-height: 100%;
        padding: var(--space-lg);
    }

    .workbench-grid {
        grid-template-columns: 11rem minmax(0, 1fr);
        align-items: start;
    }
}

/* Product pages: measured from the authenticated reference product list and editors. */
.product-workbench {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.product-type-rail {
    min-height: calc(100dvh - 100px);
    padding: 10px;
    gap: 0;
    border-radius: 0;
}

.product-type-rail h2 {
    height: 38px;
    margin: 0;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 400;
}

.product-type-rail h2 button {
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    justify-content: center;
    color: #333;
    font-size: 17px;
}

.product-type-rail a {
    min-height: 36px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #222;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.product-type-rail a.active { background: #d2d2d2; }



.product-type-rail a > em { margin-left: auto; color: #666; font-style: normal; }
.product-type-children { margin-left: 24px; border-left: 1px dotted #bbb; }
.product-type-children a { position: relative; }
.product-type-children a::before { content: ""; width: 11px; position: absolute; left: -10px; border-top: 1px dotted #bbb; }
.product-type-children a > i { color: #ff8700; }

.product-table-panel { min-width: 0; min-height: calc(100dvh - 100px); }
.product-toolbar { min-height: 92px; padding: 12px; display: flex; flex-direction: column; align-items: stretch; gap: 16px; overflow: visible; }
.product-toolbar .toolbar-actions,
.product-toolbar .product-search { display: flex; align-items: center; gap: 8px; }
.product-toolbar .toolbar-actions > :is(a, button),
.product-toolbar .product-search > :is(a, button),
.product-toolbar .product-search > input:not([type="hidden"]) {
    box-sizing: border-box;
    height: 26px;
    min-height: 26px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
}
.product-toolbar .toolbar-actions > :is(a, button) { width: 60px; padding: 4px; justify-content: center; border: 0; }
.product-toolbar .toolbar-actions > .product-multi-add { width: 92px; }
.product-toolbar .toolbar-actions > .refresh-action { width: 32px; }
.product-toolbar .product-search { position: relative; gap: 8px; }
.product-toolbar .product-search > input:not([type="hidden"]) { width: 180px; padding: 0 10px; }
.product-toolbar .product-search > input[name="item_no"] { width: 180px; max-width: 180px; flex: 0 0 180px; }
.product-toolbar .product-search > input[name="brand"] { width: 180px; max-width: 180px; flex: 0 0 180px; }
.product-toolbar .product-search > :is(.query-action, .reset-action) { width: 60px; padding: 0 10px; justify-content: center; }
.product-toolbar .product-search > .query-action { color: #fff; background: #60b879; border: 0; }
.product-toolbar .product-search > .reset-action { color: #000; background: #e2e2e2; border: 0; }
.product-toolbar .product-search > .quick-quote-action { order: 1; width: 80px; margin-left: auto; padding: 4px; color: #fff; background: #60b879; border: 0; }
.product-toolbar .product-search > .info-action { order: 2; width: 60px; padding: 4px; color: #fff; background: #57a8e8; border: 0; }
.product-toolbar .product-search > .column-settings { order: 3; width: 32px; padding: 0; color: #5d9dbd; background: transparent; border: 0; font-size: 19px; }
.product-more-menu {
    width: 138px;
    position: absolute;
    z-index: 20;
    top: 26px;
    right: 40px;
    display: grid;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
}
.product-more-menu[hidden] { display: none; }
.product-more-menu :is(a, button) { width: 136px; height: 36px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 0; color: #333; background: #fff; font-size: 12px; line-height: 36px; text-align: left; text-decoration: none; }
.product-more-menu :is(a, button):hover { background: #f2f2f2; }

.product-table { min-width: 2760px; table-layout: auto; }
.product-table th { height: 36px; padding: 0 10px; font-size: 12px; font-weight: 400; white-space: nowrap; }
.product-table td { height: 46px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }

.product-reference-form {
    width: min(2190px, calc(100% - 40px));
    padding: 12px 20px 22px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px 16px;
}
.product-reference-form > label:not(.product-upload) { gap: 8px; font-size: 12px; font-weight: 400; }
.product-reference-form input,
.product-reference-form select { width: 100%; height: 26px; min-height: 26px; padding: 0 10px; border: 1px solid #d2d2d2; border-radius: 0; font-size: 12px; }
.product-upload { width: 84px; min-height: 136px; gap: 8px; }
.product-upload > span { width: 84px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 4px; background: #679ab1; font-size: 12px; }
.product-upload img,
.product-upload i { width: 84px; height: 84px; }
.product-detail,
.multi-spec-section { grid-column: 1 / -1; }

.product-detail textarea { width: 100%; min-height: 420px; padding: 12px; border: 1px solid #d2d2d2; resize: vertical; }
.product-folder { grid-column: span 3; }
.product-reference-form h2 { font-size: 14px; font-weight: 400; }
.product-submit { padding-top: 52px; }
.product-submit button { width: 102px; height: 32px; min-height: 32px; padding: 0 10px; border-radius: 4px; background: #009688; font-size: 12px; }
.multi-spec-section { padding: 14px; border: 1px solid #d7e5e8; background: #f8fcfd; }
.multi-spec-section h2 { margin-bottom: 14px; color: #333; }
.multi-spec-section h2 small { margin-left: 10px; color: #777; font-weight: 400; }
.multi-spec-dimensions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.multi-spec-dimensions label { display: grid; grid-template-columns: 95px 1fr; align-items: center; gap: 8px; font-size: 12px; }
.multi-spec-actions { margin-top: 14px; display: flex; gap: 8px; }
.multi-spec-actions button { height: 30px; min-height: 30px; padding: 0 12px; border: 0; border-radius: 4px; color: #fff; background: #009688; }
.multi-spec-actions button:last-child { background: #de4545; }
.multi-spec-results { margin-top: 14px; }
.multi-spec-results table { min-width: 1400px; }
.multi-spec-results :is(th, td) { height: 36px; padding: 4px; }
.multi-spec-results input { min-width: 130px; }
.multi-spec-results [data-delete-product-variant] { width: 26px; height: 26px; min-height: 26px; padding: 0; border: 0; border-radius: 4px; color: #fff; background: #de4545; }

@media (min-width: 90rem) {
    :root {
        --sidebar-width: 14rem;
    }

    .content {
        padding: var(--space-xl);
    }
}

.system-introduction {
    min-width: 75rem;
    min-height: 72rem;
    position: relative;
    overflow: hidden;
    color: var(--color-intro-ink);
    background: var(--color-reference-white);
    font-family: var(--font-body);
}

.intro-workflow {
    width: 75rem;
    min-height: 38rem;
    margin: 18rem auto 0;
    position: relative;
}

.intro-workflow-heading {
    text-align: center;
}

.intro-workflow-heading h1 {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    color: var(--color-intro-heading);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.45;
}

.intro-workflow-heading h1 span {
    color: var(--color-success);
    font-size: 1.5rem;
}

.intro-workflow-heading p {
    margin: .35rem 0 0;
    color: var(--color-intro-muted);
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.65;
}

.intro-flow {
    height: 31.25rem;
    margin-top: 1.75rem;
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: 15.5rem 15.75rem;
}

.intro-avatar-symbols {
    width: 0;
    height: 0;
    position: absolute;
    overflow: hidden;
}

.intro-step {
    width: 9.875rem;
    min-height: 11.75rem;
    padding: 2.5rem 1rem 1rem;
    position: relative;
    z-index: 2;
    justify-self: center;
    border: 1px solid var(--color-intro-line);
    border-radius: .375rem;
    background: var(--color-intro-node);
    box-shadow: 0 1px 6px var(--color-intro-shadow);
    text-align: center;
}

.intro-step-top { grid-row: 1; margin-top: 2.125rem; }
.intro-step-bottom { grid-row: 2; margin-top: 1.75rem; }
.intro-step-1 { grid-column: 1; }
.intro-step-2 { grid-column: 2; }
.intro-step-3 { grid-column: 3; }
.intro-step-4 { grid-column: 4; }
.intro-step-5 { grid-column: 5; }
.intro-step-6 { grid-column: 6; }
.intro-step-7 { grid-column: 7; }
.intro-step-8 { grid-column: 8; }

.intro-step-top::after,
.intro-step-bottom::before {
    content: "";
    width: .75rem;
    height: .75rem;
    position: absolute;
    left: calc(50% - .375rem);
    z-index: -1;
    border: 1px solid var(--color-intro-line);
    background: var(--color-intro-node);
    transform: rotate(45deg);
}

.intro-step-top::after {
    bottom: -.4375rem;
    border-top: 0;
    border-left: 0;
}

.intro-step-bottom::before {
    top: -.4375rem;
    border-right: 0;
    border-bottom: 0;
}

.intro-avatar {
    width: 4.25rem;
    height: 4.25rem;
    position: absolute;
    top: -2.125rem;
    left: calc(50% - 2.125rem);
    display: grid;
    place-items: center;
    border: .5rem solid var(--color-reference-white);
    border-radius: 50%;
    color: var(--color-reference-white);
    background: var(--color-intro-admin);
    box-shadow: 0 1px 5px var(--color-intro-shadow);
}

.intro-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

.avatar-face { fill: var(--color-intro-avatar-skin); }
.avatar-hair { fill: var(--color-intro-avatar-hair); }
.avatar-hair-red { fill: var(--color-intro-avatar-hair-red); }
.avatar-suit { fill: var(--color-intro-avatar-suit); }
.avatar-shirt { fill: var(--color-reference-white); }
.avatar-tie { fill: var(--color-intro-avatar-tie); }
.avatar-blouse { fill: var(--color-intro-avatar-hair-red); }
.avatar-buyer-shirt { fill: var(--color-intro-avatar-buyer-shirt); }
.avatar-helmet { fill: var(--color-intro-avatar-helmet); }

.intro-step-bottom .intro-avatar {
    top: auto;
    bottom: -2.125rem;
}

.intro-step h2 {
    margin: 0 0 .75rem;
    color: var(--color-intro-heading);
    font-size: 1.125rem;
    font-weight: 600;
}

.intro-step ul {
    margin: 0;
    padding: 0;
    display: grid;
    gap: .45rem;
    color: var(--color-intro-muted);
    font-size: .875rem;
    line-height: 1.35;
    list-style: none;
}

.intro-track {
    height: .5rem;
    position: absolute;
    top: 15.25rem;
    left: 6.25%;
    right: 6.25%;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    border-top: .5rem solid var(--color-intro-line);
}

.intro-track span {
    width: 1.625rem;
    height: 1.625rem;
    position: relative;
    flex: 0 0 auto;
    top: -.9375rem;
    border: .5rem solid var(--color-reference-white);
    border-radius: 50%;
    background: var(--color-intro-dot);
    box-shadow: 0 1px 6px var(--color-intro-shadow);
}

.reference-dashboard {
    padding: var(--space-xs) 0;
}

.dashboard-filters {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    color: #52616a;
    font-size: .8rem;
}

.dashboard-filters strong {
    margin-right: .25rem;
    color: #283b45;
    font-weight: 600;
}

.dashboard-filters button {
    min-height: 1.75rem;
    padding: .2rem .6rem;
    border: 1px solid #dce4e7;
    border-radius: 2px;
    color: #5d6870;
    background: #fff;
    font-size: .75rem;
}

.dashboard-filters button.active {
    border-color: #78909c;
    color: #fff;
    background: #78909c;
}

.dashboard-filters button.period-active {
    border-color: #ef7274;
    color: #fff;
    background: #ef7274;
}

.dashboard-filters i {
    width: 1px;
    height: 1.4rem;
    margin: 0 .25rem;
    background: #d7dfe2;
}

.dashboard-filters span {
    margin-left: .45rem;
    color: #839096;
}

.reference-metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .75rem;
}

.reference-metric-grid a {
    min-height: 6.15rem;
    padding: 1rem 1.1rem;
    display: grid;
    align-content: space-between;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(29, 48, 58, .12);
}

.reference-metric-grid span {
    font-size: .8rem;
    opacity: .96;
}

.reference-metric-grid strong {
    font-size: 1.55rem;
    font-weight: 500;
    line-height: 1;
}

.metric-customer { background: linear-gradient(135deg, #52c6d5, #26a7b9); }
.metric-quote { background: linear-gradient(135deg, #fa8a83, #ee6568); }
.metric-order { background: linear-gradient(135deg, #6c91df, #5c70ce); }
.metric-followup { background: linear-gradient(135deg, #9d79d4, #7f61bd); }
.metric-overdue { background: linear-gradient(135deg, #40bcb6, #249b99); }
.metric-amount { background: linear-gradient(135deg, #6ec393, #4da778); }

.dashboard-calendar {
    width: min(52rem, 100%);
    margin-top: 1rem;
    border: 1px solid #dce4e7;
    background: #fff;
}

.dashboard-calendar header {
    min-height: 3rem;
    padding: .5rem .65rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 1px solid #dce4e7;
}

.dashboard-calendar header div {
    display: flex;
    gap: .25rem;
}

.dashboard-calendar header button {
    min-height: 1.75rem;
    padding: .15rem .55rem;
    border: 1px solid #d8e0e3;
    border-radius: 2px;
    color: #5e6a70;
    background: #fff;
    font-size: .75rem;
}

.dashboard-calendar h2 {
    margin: 0;
    color: #35454d;
    font-size: .95rem;
    font-weight: 600;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
    padding: .45rem;
    border-right: 1px solid #e2e8ea;
    color: #65747b;
    font-size: .72rem;
    text-align: center;
}

.calendar-days div {
    min-height: 5.15rem;
    padding: .4rem .5rem;
    border-top: 1px solid #e2e8ea;
    border-right: 1px solid #e2e8ea;
    color: #52616a;
    font-size: .72rem;
}

.calendar-weekdays span:nth-child(7n),
.calendar-days div:nth-child(7n) {
    border-right: 0;
}

.calendar-days div.outside {
    color: #c0c9cd;
    background: #fafcfc;
}

.calendar-days div.today {
    color: #ad6b00;
    background: #fff8dc;
}

.calendar-days div.today time {
    padding: .1rem .35rem;
    border-radius: 50%;
    color: #fff;
    background: #f0a129;
}

@media (max-width: 75rem) {
    .reference-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
    .dashboard-filters { flex-wrap: wrap; }
    .reference-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-days div { min-height: 3.75rem; }
}

@media (pointer: coarse) {
    a,
    button,
    summary {
        min-height: var(--control-height);
    }
}


/* Reference ERP right-side content contract */
.content {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 400;
    line-height: 1.4;
}

.content :where(input, select, textarea, button) {
    font-size: var(--text-sm);
    font-weight: 400;
    min-height: var(--content-control-height);
    border-radius: var(--radius-sm);
}

.content :where(label, p, li, dt, dd) {
    font-size: var(--text-sm);
    font-weight: 400;
}

.content :where(.page-heading h1) {
    font-size: var(--text-lg);
    font-weight: 600;
}

.content :where(.panel h2, .reference-settings-form h2) {
    font-size: var(--text-base);
    font-weight: 600;
}

.content :where(table) {
    font-size: var(--text-sm);
    font-weight: 400;
    line-height: 1.35;
}

.content :where(th) {
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0;
}

.content :where(td) {
    font-weight: 400;
}

.content :where(.primary-action, .query-action, .reset-action, .refresh-action, .info-action, .danger-action) {
    min-height: var(--content-control-height);
    padding-block: var(--space-2xs);
    padding-inline: var(--space-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: var(--rule-thin) solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-accent-ink);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 400;
}

.content :where(.primary-action, .refresh-action) {
    border-color: var(--color-accent-deep);
    background: var(--color-accent-deep);
}

.content .toolbar-actions > .refresh-action,
.content .reference-admin-toolbar > .refresh-action {
    border-color: var(--color-accent-deep);
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
}

.content .query-action {
    border-color: var(--color-action-query);
    background: var(--color-action-query);
}

.content .quotation-toolbar-searches .query-action,
.content .sales-order-toolbar-searches .query-action {
    border-color: #60b879;
    background: #60b879;
}

.content .reset-action {
    border-color: var(--color-rule-strong);
    color: var(--color-ink-2);
    background: var(--color-action-reset);
}

.content .info-action {
    border-color: var(--color-action-info);
    background: var(--color-action-info);
}

.content .danger-action {
    border-color: var(--color-danger);
    color: var(--color-accent-ink);
    background: var(--color-danger);
}

@media (hover: hover) and (pointer: fine) {
    .content :where(.primary-action, .refresh-action):hover {
        border-color: var(--color-accent-hover);
        background: var(--color-accent-hover);
    }

    .content .toolbar-actions > .refresh-action:hover,
    .content .reference-admin-toolbar > .refresh-action:hover {
        border-color: var(--color-accent-hover);
        color: var(--color-accent-ink);
        background: var(--color-accent-hover);
    }

    .content .query-action:hover {
        border-color: var(--color-action-query-hover);
        background: var(--color-action-query-hover);
    }

    .content .quotation-toolbar-searches .query-action:hover,
    .content .sales-order-toolbar-searches .query-action:hover {
        border-color: #4fa66a;
        background: #4fa66a;
    }

    .content .reset-action:hover {
        border-color: var(--color-rule-strong);
        color: var(--color-ink);
        background: var(--color-action-reset-hover);
    }

    .content .info-action:hover {
        border-color: var(--color-action-info-hover);
        background: var(--color-action-info-hover);
    }

    .content .danger-action:hover {
        border-color: var(--color-danger);
        background: var(--color-danger);
        filter: brightness(.92);
    }
}

@media (pointer: coarse) {
    .content :where(input, select, textarea, button, .primary-action, .query-action, .reset-action, .refresh-action, .info-action, .danger-action) {
        min-height: 2.75rem;
    }
}

.reference-admin-page {
    min-height: calc(100dvh - var(--topbar-height) - var(--tabs-height) - 1rem);
    display: flex;
    flex-direction: column;
    background: #fff;
}

.reference-page-strip {
    min-height: 2.15rem;
    padding: .45rem .65rem;
    color: #fff;
    background: linear-gradient(90deg, #5ea0be, #91a2aa);
    font-size: .78rem;
    font-weight: 600;
}

.reference-admin-toolbar {
    min-height: 4.25rem;
    padding: 1.35rem .8rem .7rem;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    color: #68777e;
    font-size: .78rem;
}

.reference-admin-toolbar > span {
    padding-top: .35rem;
}

.system-admin-toolbar {
    align-items: center;
}

.system-admin-toolbar > span {
    flex: 0 0 auto;
    padding-top: 0;
    white-space: nowrap;
}

.system-admin-toolbar [data-result-count] {
    color: var(--color-result-count);
    font-weight: 400;
}

.system-admin-table-stage {
    flex: 0 1 auto;
    padding: 0;
    display: block;
}

.reference-admin-toolbar button,
.reference-admin-toolbar > a,
.reference-admin-toolbar summary,
.toolbar-action {
    min-height: 1.85rem;
    padding: .35rem .85rem;
    border: 0;
    border-radius: 3px;
    color: #fff;
    background: #009688;
    font-size: .75rem;
    line-height: 1.15rem;
    text-decoration: none;
}

.reference-admin-toolbar.system-admin-toolbar > button {
    min-width: 3.75rem;
    min-height: 1.625rem;
    padding: .2rem .625rem;
    border-radius: var(--radius-lg);
    line-height: 1rem;
}

.reference-admin-toolbar button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.reference-admin-toolbar .danger-action,
.reference-admin-table .danger-action {
    color: #fff;
    background: #e64a4f;
}

.reference-admin-table {
    min-width: 100%;
    border-top: 1px solid #d8e0e3;
}

.reference-admin-table th {
    height: 2.25rem;
    color: #fff;
    background: var(--color-table-head);
    font-weight: 600;
    text-align: center;
}

.reference-admin-table td {
    height: 2.55rem;
    border-right: 1px solid #e0e5e7;
    color: #202b30;
    text-align: center;
}

.reference-admin-table th:first-child,
.reference-admin-table td:first-child {
    width: 3.25rem;
}

.reference-admin-table input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
}

.reference-admin-table form {
    margin: 0;
}

.reference-admin-table form button {
    min-height: 1.65rem;
    padding: .2rem .55rem;
    border-radius: 3px;
    font-size: .72rem;
}

.inline-add {
    position: relative;
}

.inline-add summary {
    list-style: none;
    cursor: pointer;
}

.inline-add summary::-webkit-details-marker {
    display: none;
}

.inline-add form {
    position: absolute;
    z-index: 4;
    top: 2.2rem;
    left: 0;
    width: 34rem;
    padding: .75rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    align-items: end;
    gap: .6rem;
    border: 1px solid #cfdadd;
    background: #fff;
    box-shadow: 0 5px 15px rgba(43, 65, 75, .15);
}

.inline-add label {
    color: #506169;
    font-size: .72rem;
}

.inline-add input {
    min-height: 1.9rem;
    margin-top: .25rem;
    padding: .3rem .45rem;
    border-radius: 2px;
}

.table-action {
    color: #008f83;
}

.user-inline-add form {
    width: 46rem;
    grid-template-columns: repeat(4, 1fr) auto;
}

.user-inline-add select {
    min-height: 1.9rem;
    margin-top: .25rem;
    padding: .3rem .45rem;
    border-radius: 2px;
}

.settings-reference-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: minmax(15rem, .55fr) minmax(0, 1.45fr);
    gap: 1rem;
}

.settings-reference-tabs {
    min-height: 2.5rem;
    display: flex;
    align-items: end;
    border-bottom: 1px solid var(--color-border);
    background: #fff;
}

.settings-reference-tabs button {
    min-width: 6rem;
    min-height: 2.5rem;
    padding: var(--space-xs) var(--space-sm);
    border: 0;
    border-radius: 0;
    color: var(--color-ink-2);
    background: var(--color-reference-white);
    font-size: var(--text-sm);
    font-weight: 400;
}

.settings-reference-tabs button.active {
    color: var(--color-accent-deep);
    border-bottom: 2px solid var(--color-accent-deep);
}

.settings-reference-stage {
    padding: var(--space-sm) var(--space-md) var(--space-xl);
}

.settings-reference-stage [data-settings-panel][hidden] {
    display: none !important;
}

.settings-reference-stage [data-settings-panel="basic"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
    align-items: start;
}

.reference-settings-form {
    padding: 1rem;
    align-content: start;
    border: 1px solid var(--color-rule-strong);
    background: var(--color-reference-white);
}

.reference-settings-form h2 {
    margin: -.15rem 0 1rem;
    color: var(--color-ink);
    font-size: .9rem;
}

.reference-settings-form label {
    display: block;
    color: var(--color-ink-2);
    font-size: .76rem;
}

.reference-settings-form small {
    color: var(--color-muted);
}

.reference-settings-form input {
    min-height: 2rem;
    margin-top: .3rem;
    padding: .35rem .5rem;
    border-radius: 2px;
}

.company-reference-form {
    padding: 0 var(--space-md) var(--space-md);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-sm) var(--space-xl);
    border: 0;
}

.company-logo-field {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 10rem;
    gap: var(--space-xs);
}

.company-logo-title {
    padding: var(--space-2xs) var(--space-sm);
    color: var(--color-table-head-ink);
    background: var(--color-table-head);
    font-weight: 500;
}

.company-logo-preview,
.company-logo-placeholder {
    width: 4.75rem;
    height: 4.75rem;
    display: grid;
    place-items: center;
    border: var(--rule-thin) solid var(--color-rule);
    background: var(--color-paper-2);
    object-fit: contain;
}

.company-logo-placeholder {
    color: var(--color-muted);
}

.company-logo-picker {
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-sm);
    color: var(--color-accent-deep);
    cursor: pointer;
}

.company-logo-picker:hover,
.company-logo-picker:focus-within {
    background: var(--color-accent-soft);
}

.company-logo-picker:focus-within {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.company-reference-form > label {
    position: relative;
    padding-left: var(--space-sm);
}

.company-reference-form > label::before {
    content: "";
    width: 2px;
    height: .9rem;
    position: absolute;
    top: .05rem;
    left: 0;
    background: var(--color-accent-deep);
}

.numbering-reference-form {
    max-width: 980px;
    margin: 26px auto;
}

.numbering-rule-row {
    display: grid;
    grid-template-columns: 160px 160px 24px 120px 220px;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 55px;
}

.numbering-rule-row strong,
.numbering-rule-row label {
    color: #009688;
    white-space: nowrap;
}

.numbering-rule-row input,
.numbering-rule-row select {
    height: 27px;
}

.numbering-rule-row label {
    display: flex;
    align-items: center;
    gap: 14px;
}

.numbering-rule-row label input {
    width: 120px;
}

.company-reference-form textarea {
    width: 100%;
    min-height: 6rem;
    margin-top: .3rem;
    padding: .35rem .5rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    resize: vertical;
}

.company-reference-form h2,
.company-reference-form .wide {
    grid-column: 1 / -1;
}

.reference-settings-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.reference-settings-actions button {
    min-height: 1.9rem;
    padding: .35rem .9rem;
    border-radius: 3px;
    background: #009688;
    font-size: .75rem;
}

.company-reference-form > .reference-settings-actions {
    justify-content: center;
}

@media (max-width: 60rem) {
    :root { --topbar-height: 3rem; --tabs-height: 2.75rem; }

    .settings-reference-grid { grid-template-columns: 1fr; }
    .settings-reference-stage [data-settings-panel="basic"] { grid-template-columns: 1fr; }
    .company-reference-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inline-add form,
    .user-inline-add form { width: min(34rem, calc(100vw - 3rem)); grid-template-columns: 1fr; }
}

@media (max-width: 42rem) {
    .company-reference-form { grid-template-columns: 1fr; }
}

/* Reference customer dialog: mirrors the source system's dense add-customer layer. */
.content:has(> .customer-dialog),
.content:has(> .product-dialog),
.content:has(> .quotation-dialog),
.content:has(> .sales-order-dialog),
.content:has(> .sales-order-convert-dialog) {
    padding: 0;
}

.sales-order-reference-form {
    min-width: 0;
    padding: var(--space-md) var(--space-md) var(--space-2xl);
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.sales-order-meta-grid,
.sales-order-totals-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md) var(--space-xl);
}

.sales-order-reference-form label {
    min-width: 0;
    display: grid;
    gap: var(--space-xs);
}

.sales-order-reference-form label > span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.sales-order-reference-form label > span::before {
    content: "";
    width: var(--rule-thin);
    height: var(--text-base);
    flex: 0 0 auto;
    background: var(--color-accent-deep);
}

.sales-order-reference-form input,
.sales-order-reference-form select,
.sales-order-reference-form textarea {
    margin: 0;
    border-color: var(--color-rule);
    border-radius: 0;
    font-size: var(--text-sm);
}

.sales-order-reference-form input,
.sales-order-reference-form select {
    min-height: var(--control-height);
    height: var(--control-height);
    padding: var(--space-2xs) var(--space-xs);
}

.sales-order-lines {
    min-height: 22rem;
    margin-top: var(--space-xl);
    border-top: var(--rule-thin) solid var(--color-rule);
    border-bottom: var(--rule-thin) solid var(--color-rule);
}

.sales-order-lines table {
    min-width: 185rem;
}

.sales-order-lines th,
.sales-order-lines td {
    height: 2.75rem;
    padding: var(--space-2xs);
    border-color: var(--color-rule);
    white-space: nowrap;
}

.sales-order-lines th {
    color: var(--color-ink-2);
    background: var(--color-paper-2);
    font-weight: 500;
}

.sales-order-lines input {
    width: 7rem;
    min-height: 1.75rem;
    height: 1.75rem;
}

.sales-order-lines input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

.sales-order-lines .wrap-cell {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-order-totals-grid {
    margin-top: var(--space-md);
}

.sales-order-totals-grid input[readonly] {
    color: var(--color-danger);
}

.sales-order-shipping-mark,
.sales-order-notes,
.sales-order-folder {
    margin-top: var(--space-md);
}

.sales-order-shipping-mark textarea,
.sales-order-notes textarea {
    min-height: 6rem;
}

.sales-order-folder {
    max-width: 85%;
}


.sales-order-submit {
    display: flex;
    justify-content: center;
    padding-top: var(--space-2xl);
}

.sales-order-submit button {
    border-radius: var(--radius-sm);
}

@media (min-width: 80rem) {
    .sales-order-meta-grid,
    .sales-order-totals-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.sales-order-page-actions {
    width: min(111rem, calc(100% - 4rem));
    min-height: 3.5rem;
    margin-inline: auto;
    padding: var(--space-sm) 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: var(--text-md);
}

.sales-order-page-actions a {
    color: var(--color-ink);
    text-decoration: none;
}

.sales-order-page-actions button[data-open-dialog="document-excel-dialog"] {
    min-height: 2rem;
    padding: .25rem .5rem;
    border: 0;
    color: var(--color-ink);
    background: transparent;
    cursor: pointer;
    font: inherit;
}


.sales-order-paper {
    width: min(111rem, calc(100% - 4rem));
    margin: 0 auto var(--space-2xl);
    padding: var(--space-xl) var(--space-2xl) var(--space-2xl);
    border: var(--rule-thin) solid var(--color-rule);
    box-shadow: 0 .125rem .75rem oklch(35% 0.02 220 / .16);
    background: var(--color-surface);
}

.sales-order-paper > h1 {
    margin: 0;
    text-align: center;
    color: var(--color-ink);
    font-size: var(--text-2xl);
}

.order-progress-track {
    margin: var(--space-xl) auto var(--space-2xl);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(var(--step-count, 4), minmax(0, 1fr));
    list-style: none;
}

.order-progress-track li {
    position: relative;
    display: grid;
    justify-items: center;
    gap: var(--space-xs);
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.order-progress-track li::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: .625rem;
    right: 50%;
    width: 100%;
    height: var(--rule-thin);
    background: var(--color-rule-strong);
}

.order-progress-track li:first-child::before {
    display: none;
}

.order-progress-track i {
    position: relative;
    z-index: 1;
    width: 1.25rem;
    height: 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--color-muted);
    background: var(--color-paper-3);
    font-size: var(--text-xs);
    font-style: normal;
}

.order-progress-track li.active i {
    color: var(--color-accent-ink);
    background: var(--step-color, var(--color-success));
}

.order-progress-track li.active::before { background: var(--step-color, var(--color-success)); }

.order-progress-track li.active {
    color: var(--color-ink);
}

.order-summary-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 var(--space-2xl);
}

.sales-order-paper > .order-summary-grid {
    width: min(87.5rem, 100%);
    margin-inline: auto;
}

.order-summary-grid > div {
    min-width: 0;
    min-height: 2.85rem;
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: center;
    border-bottom: var(--rule-thin) solid var(--color-rule);
}

.order-summary-grid dt,
.order-summary-grid dd {
    margin: 0;
}

.order-summary-grid dt {
    color: var(--color-ink);
    font-weight: 600;
}

.order-summary-grid dd {
    min-width: 0;
    overflow-wrap: anywhere;
}

.order-summary-grid dt [lang="en"] {
    display: block;
    color: var(--color-muted);
    font-weight: 400;
}

.order-products,
.order-actions-panel {
    margin-top: var(--space-xl);
}

.order-products h2,
.order-actions-panel h2 {
    margin: 0 0 var(--space-sm);
    color: var(--color-ink);
    font-size: var(--text-lg);
}

.order-products h2 {
    color: var(--color-success);
}

.order-products table {
    min-width: 115rem;
}

.order-products th,
.order-products td {
    padding: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule);
    vertical-align: middle;
}

.order-products th {
    color: var(--color-ink);
    background: var(--color-surface);
}

.order-products .wrap-cell {
    max-width: 15rem;
    white-space: normal;
}

.order-price-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-xs) var(--space-sm);
    margin-top: var(--space-sm);
    padding: var(--space-md);
    border: var(--rule-thin) solid var(--color-rule-strong);
    background: var(--color-accent-soft);
    color: var(--color-ink);
    font-size: var(--text-lg);
    font-weight: 600;
}

.order-price-summary strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-price-summary small { font-size: var(--text-sm); font-weight: 400; }
.order-price-summary-total { color: var(--color-accent-deep); font-size: var(--text-xl); }
.order-price-summary-freight { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-xs) var(--space-sm); margin-inline-start: auto; font-size: var(--text-sm); }

.order-product-image {
    width: 3rem;
    height: 3rem;
    display: block;
    object-fit: contain;
}

.order-actions-panel {
    padding-top: var(--space-md);
    border-top: var(--rule-thin) solid var(--color-rule);
}

.order-actions-panel .document-grid {
    margin-top: var(--space-md);
}

.order-related {
    margin-top: var(--space-xl);
}

.order-related .customer-detail-tabs {
    margin-top: 0;
}

.order-related [data-customer-tab-panel] {
    min-height: 12rem;
}

.order-related [data-customer-tab-panel] :is(th, td) {
    padding: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule);
    text-align: left;
    vertical-align: top;
}

.order-related [data-customer-tab-panel] h3 {
    margin: var(--space-lg) 0 var(--space-xs);
    font-size: var(--text-md);
}

.order-related .order-profit-summary {
    margin-top: var(--space-lg);
    font-weight: 700;
}

@media (max-width: 70rem) {
    .sales-order-paper {
        width: calc(100% - 1rem);
        padding: var(--space-lg);
    }

    .order-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 60rem) {
    .customer-public-toolbar {
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .customer-public-toolbar .toolbar-searches {
        justify-content: flex-start;
    }
}

.quotation-reference-form {
    min-width: 0;
    padding: var(--space-md) var(--space-md) var(--space-2xl);
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.quotation-meta-grid,
.quotation-totals-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md) var(--space-xl);
}

.table-column-toolbar { display: flex; justify-content: flex-end; padding: .25rem 0; }

.quotation-reference-form label {
    min-width: 0;
    display: grid;
    gap: var(--space-xs);
}

.quotation-customer-field {
    position: relative;
    min-width: 0;
    display: grid;
    gap: var(--space-xs);
}

.quotation-meta-grid--document > [data-quotation-meta-key] {
    align-content: end;
}

.quotation-reference-form .quotation-meta-grid--document > [data-quotation-meta-key] > :is(input, select) {
    width: 100%;
}

.quotation-customer-field > input[readonly] {
    cursor: pointer;
}

.quotation-reference-form label > span,
.product-reference-fields label > span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.quotation-reference-form label > span::before,
.product-reference-fields label > span::before {
    content: "";
    width: var(--rule-thin);
    height: var(--text-base);
    flex: 0 0 auto;
    background: var(--color-accent-deep);
}

.quotation-reference-form input,
.quotation-reference-form select,
.quotation-reference-form textarea {
    margin: 0;
    border-color: var(--color-rule);
    border-radius: 0;
    font-size: var(--text-sm);
}

.quotation-reference-form input,
.quotation-reference-form select {
    min-height: var(--control-height);
    height: var(--control-height);
    padding: var(--space-2xs) var(--space-xs);
}

.quotation-line-actions {
    margin-top: var(--space-xl);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

[data-quotation-base-path] .quotation-line-actions { justify-content: flex-start; }

.quotation-line-actions button {
    min-height: auto;
    padding: var(--space-2xs) var(--space-xs);
    color: var(--color-ink);
    background: transparent;
}

.quotation-line-actions button:hover,
.quotation-line-actions button:focus-visible {
    color: var(--color-accent-deep);
    background: transparent;
}

.quotation-lines {
    height: 23rem;
    overflow: auto;
    margin-top: var(--space-xs);
    border-top: var(--rule-thin) solid var(--color-rule);
    border-bottom: var(--rule-thin) solid var(--color-rule);
}

.quotation-line-editor {
    min-width: 100%;
    table-layout: fixed;
}

.quotation-line-editor th,
.quotation-line-editor td {
    height: 2.5rem;
    padding: var(--space-2xs);
    border-color: var(--color-rule);
    white-space: nowrap;
}

.quotation-line-editor th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: var(--color-ink-2);
    background: var(--color-paper-2);
    font-weight: 500;
}

.quotation-line-editor th,
.quotation-line-editor td {
    text-align: center;
}

.quotation-line-editor input,
.quotation-line-editor select {
    width: 8rem;
    min-height: 1.75rem;
    height: 1.75rem;
}

.quotation-line-editor td:nth-child(4) select,
.quotation-line-editor td:nth-child(4) input,
.quotation-line-editor td:nth-child(6) input,
.quotation-line-editor td:nth-child(10) input {
    width: 11rem;
}

.quotation-line-editor input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

.quotation-line-editor .line-plus,
.quotation-line-editor .line-remove {
    min-height: auto;
    padding: var(--space-2xs);
    border: 0;
    color: var(--color-accent-deep);
    background: transparent;
}

.quotation-product-image {
    width: 2.5rem;
    height: 2.5rem;
    display: block;
    object-fit: contain;
}

.quotation-product-image:not([src]) {
    visibility: hidden;
}

.quotation-totals-grid {
    margin-top: var(--space-md);
    align-items: start;
}

.quotation-totals-grid input[readonly] {
    color: var(--color-danger);
}

.quotation-notes,
.quotation-folder {
    margin-top: var(--space-md);
}

.quotation-notes textarea {
    min-height: 6rem;
}

.quotation-notes {
    max-width: 85%;
}

.quotation-reference-form .quotation-meta-grid :is(input, select) {
    width: 50%;
    min-width: 0;
}

.quotation-reference-form .quotation-totals-grid input:not([type="hidden"]) {
    width: 12rem;
    max-width: 100%;
    min-width: 0;
    min-height: 2.4rem;
    height: 2.4rem;
    font-size: calc(var(--text-sm) + 4px);
}

.quotation-reference-form .quotation-notes-account {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-md);
}

.quotation-reference-form .quotation-notes-account .quotation-notes {
    max-width: none;
    margin-top: 0;
}

.quotation-reference-form .quotation-notes-account textarea {
    min-height: 6rem;
    width: 100%;
}

.quotation-meta-grid--document > [data-quotation-meta-key="customer"] { order: 1; }
.quotation-meta-grid--document > [data-quotation-meta-key="status"] { order: 2; }
.quotation-meta-grid--document > [data-quotation-meta-key="currency"] { order: 3; }
.quotation-meta-grid--document > [data-quotation-meta-key="freight_forwarder"] { order: 4; }
.quotation-meta-grid--document > [data-quotation-meta-key="payment-term"] { order: 5; }
.quotation-meta-grid--document > [data-quotation-meta-key="payment-condition"] { order: 6; }
.quotation-meta-grid--document > [data-quotation-meta-key="price-term"] { order: 7; }
.quotation-meta-grid--document > [data-quotation-meta-key="logistics_company"] { order: 8; }
.quotation-meta-grid--document > [data-quotation-meta-key="validity"] { order: 9; }
.quotation-meta-grid--document > [data-quotation-meta-key="lead-time"] { order: 10; }
.quotation-meta-grid--document > [data-quotation-meta-key="warranty"] { order: 11; }
.quotation-meta-grid--document > [data-quotation-meta-key="shipping-cost"] { order: 12; }
.quotation-meta-grid--document > [data-quotation-meta-key="actual-shipping-cost"] { order: 13; }
.quotation-meta-grid--document > [data-quotation-meta-key="shipping-difference"] { order: 14; }
.quotation-reference-form .quotation-meta-grid--document > [data-quotation-meta-key="logistics_company"] { order: 7; }
.quotation-reference-form .quotation-meta-grid--document > [data-quotation-meta-key="price-term"] { order: 12; }
.quotation-reference-form .quotation-meta-grid--document > [data-quotation-meta-key="shipping-cost"] { order: 11; }
.quotation-reference-form .quotation-meta-grid--document > [data-quotation-meta-key="warranty"] { order: 8; }

.reference-fullscreen-dialog .payment-method-account textarea {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 47.99rem) {
    .quotation-reference-form .quotation-notes-account { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.quotation-folder {
    max-width: 60%;
}

.quotation-product-section.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: var(--space-md);
    overflow: auto;
    background: var(--color-surface);
}

.quotation-product-section.is-fullscreen .quotation-lines {
    height: calc(100dvh - 5rem);
}

.quotation-customer-picker {
    position: absolute;
    z-index: 30;
    top: calc(100% + .25rem);
    left: 0;
    width: min(49rem, calc(100vw - 2rem));
    padding: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule-strong);
    color: var(--color-ink);
    background: var(--color-surface);
    box-shadow: 0 .25rem .75rem rgb(0 0 0 / 18%);
}

.quotation-customer-picker[hidden] {
    display: none;
}

.quotation-customer-picker [data-quotation-customer-row] {
    cursor: pointer;
}

.quotation-customer-picker [data-quotation-customer-row]:hover,
.quotation-customer-picker [data-quotation-customer-row]:focus-visible {
    background: var(--color-paper-2);
}

.quotation-customer-picker table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
}

.quotation-customer-picker th,
.quotation-customer-picker td {
    height: 2.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quotation-customer-picker th {
    height: 2.25rem;
}

.quotation-customer-picker th button {
    width: 100%;
    min-height: auto;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
}

.quotation-customer-picker th button:hover,
.quotation-customer-picker th button:focus-visible {
    color: var(--color-accent-deep);
    background: transparent;
}


.quotation-picker-toolbar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
}

.quotation-product-picker {
    width: min(32rem, calc(100vw - 2rem));
    max-height: min(36rem, calc(100dvh - 2rem));
}

.quotation-picker-toolbar input {
    flex: 1;
}

.quotation-product-picker .quotation-picker-toolbar {
    align-items: center;
    justify-content: flex-start;
    padding: var(--space-md);
}

.quotation-product-picker .quotation-picker-toolbar input {
    flex: 0 0 7.5rem;
    width: 7.5rem;
}

.quotation-product-picker .quotation-picker-toolbar button {
    min-width: 5rem;
    min-height: 2.5rem;
}

.quotation-picker-list {
    max-height: min(26rem, calc(100dvh - 9rem));
    overflow: auto;
}

.quotation-product-picker .quotation-picker-list table {
    min-width: 45rem;
}

.quotation-picker-list th,
.quotation-picker-list td {
    white-space: nowrap;
    text-align: center;
}

.quotation-product-picker input[type="checkbox"],
.quotation-column-settings input[type="checkbox"] {
    width: auto;
    min-height: auto;
    height: auto;
}

.quotation-customer-picker .quotation-picker-toolbar {
    gap: .5rem;
    padding: .35rem;
}

.content .quotation-customer-picker .quotation-picker-toolbar input[type="search"] {
    flex: 0 0 12rem;
    width: 12rem;
    max-width: 12rem;
    height: 30px;
    min-height: 30px;
}

.quotation-customer-picker .quotation-picker-toolbar button {
    width: 2.5rem;
    min-height: 1.875rem;
    padding: 0;
}

.quotation-customer-picker .quotation-picker-list {
    max-height: min(16rem, calc(100dvh - 22rem));
}

.quotation-customer-picker .table-pagination {
    min-height: 2.5rem;
    gap: .25rem;
    margin-top: .25rem;
    padding: .25rem;
    font-size: .75rem;
}

.quotation-reference-form .quotation-customer-picker {
    width: min(70rem, calc(100vw - 12rem));
}

.quotation-reference-form .quotation-customer-picker [data-contact-field] {
    width: 100%; max-width: 100%; min-width: 0;
    height: 1.75rem; min-height: 1.75rem; margin: 0;
    padding: .25rem .35rem; font-size: .75rem;
}

.quotation-customer-picker td { padding: .3rem; }
.quotation-customer-picker th:nth-child(1) { width: 12%; }
.quotation-customer-picker th:nth-child(2) { width: 18%; }
.quotation-customer-picker th:nth-child(3) { width: 17%; }
.quotation-customer-picker th:nth-child(4) { width: 18%; }
.quotation-customer-picker th:nth-child(5) { width: 13%; }
.quotation-customer-picker th:nth-child(6) { width: 22%; }
.customer-contact-combo { display: flex; align-items: center; }
.customer-contact-combo input { flex: 1; }
.quotation-reference-form .quotation-customer-picker [data-customer-contact-choice] {
    flex: 0 0 1.5rem; width: 1.5rem; min-width: 1.5rem; max-width: 1.5rem;
    height: 1.75rem; min-height: 1.75rem; padding: 0; margin: 0;
    border-left: 0; color: var(--color-ink);
}
.quotation-customer-picker [data-customer-contact-choice] option { color: var(--color-ink); }
.quotation-reference-form .quotation-customer-picker .table-pagination {
    display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center;
    white-space: nowrap; gap: .35rem;
}
.quotation-reference-form .quotation-customer-picker .table-pagination :is(input, select) {
    flex: 0 0 3.5rem; width: 3.5rem; max-width: 3.5rem; min-width: 0;
    height: 1.75rem; min-height: 1.75rem; padding: .15rem .2rem; margin: 0; font-size: .65rem;
}
.quotation-reference-form .quotation-customer-picker .table-pagination button {
    min-height: 1.75rem; height: 1.75rem; padding: .15rem .5rem;
    color: var(--color-ink); background: var(--color-paper-2); font-size: .75rem;
}
.quotation-customer-picker [aria-busy="true"] { opacity: .65; pointer-events: none; }
.quotation-customer-picker [data-customer-picker-error] { margin: .35rem; }

.customer-contact-actions { display: flex; justify-content: flex-start; gap: .5rem; margin: 1rem 0 .5rem; }
.customer-contact-actions button { min-height: 1.8rem; padding: .3rem .65rem; font-size: .75rem; }
.customer-contact-table { width: 100%; min-width: 65rem; table-layout: fixed; }
.customer-contact-table th, .customer-contact-table td { white-space: nowrap; }
.customer-contact-table th:nth-child(1) { width: 4.5rem; }
.customer-contact-table th:nth-child(2) { width: 3.5rem; }
.customer-contact-table th:nth-child(3) { width: 15%; }
.customer-contact-table th:nth-child(4) { width: 13%; }
.customer-contact-table th:nth-child(5) { width: 20%; }
.customer-contact-table th:nth-child(7) { width: 6rem; }
.customer-contact-table th:nth-child(8) { width: 5rem; }
.customer-contact-table th:nth-child(9) { width: 12%; }
.customer-contact-table th:nth-child(10) { width: 5rem; }
.customer-contact-table label { display: inline-flex; flex-direction: row; align-items: center; gap: .3rem; margin: 0; }
.customer-contact-table input[type="checkbox"] { width: 1rem; height: 1rem; min-height: 0; margin: 0; }
.reference-modal.customer-contact-dialog { width: min(84rem, calc(100vw - 2rem)); max-width: calc(100vw - 2rem); border-color: #d8e2e5; border-radius: .25rem; }
.reference-modal.customer-contact-dialog header { min-height: 2.75rem; padding: .5rem 1.25rem; color: #263e46; background: #f4f8f9; border-bottom-color: #e0e8eb; font-size: .875rem; font-weight: 600; }
.reference-modal.customer-contact-dialog header button { width: 1.75rem; height: 1.75rem; color: #61757d; font-weight: 400; }
.reference-modal.customer-contact-dialog header button:hover { color: var(--color-accent-deep); background: #e7eff1; }
.customer-contact-dialog form { padding: 1rem 1.25rem 1.25rem; }
.customer-contact-dialog .table-wrap { overflow-x: auto; }
.customer-contact-dialog .customer-contact-table { table-layout: fixed; min-width: 68rem; }
.customer-contact-dialog .customer-contact-table :is(th, td):not(:last-child) { width: auto !important; min-width: 0 !important; }
.customer-contact-dialog .customer-contact-table :is(th, td):last-child { width: 6rem !important; min-width: 6rem !important; max-width: 6rem; text-align: center; }
.customer-contact-dialog th { height: 2.25rem; border: 0; border-bottom: 1px solid #dce6e9; color: #3e5963; background: #edf4f6; font-size: .8rem; font-weight: 500; }
.customer-contact-dialog td { padding: .75rem .3rem .25rem; border: 0; background: #fff; }
.customer-contact-dialog input:not([type="checkbox"]) { width: 100%; min-width: 0; margin: 0; height: 2.25rem; min-height: 2.25rem; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: .8125rem; }
.customer-contact-dialog input:not([type="checkbox"]):focus-visible { outline: 0; box-shadow: inset 0 -2px var(--color-accent-deep); }
.customer-contact-dialog input[readonly] { color: #657780; text-align: center; }
.customer-contact-dialog [data-contact-save] { height: 2.25rem; padding: .35rem .75rem; min-height: 2.25rem; border-radius: .2rem; font-size: .8125rem; white-space: nowrap; }

.quotation-column-settings {
    width: min(44rem, calc(100vw - 2rem));
}

.quotation-column-settings-body {
    max-height: min(30rem, calc(100dvh - 9rem));
    overflow: auto;
}

.quotation-column-option {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 5rem 3rem 3rem;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    border-bottom: var(--rule-thin) solid var(--color-rule);
}

.quotation-column-option input[type="number"] {
    width: 5rem;
}

.quotation-column-option button {
    padding: var(--space-2xs);
}


.quotation-submit {
    display: flex;
    justify-content: center;
    padding-top: var(--space-2xl);
}

.quotation-submit button {
    border-radius: var(--radius-sm);
}

@media (min-width: 48rem) {
    .quotation-reference-form .quotation-meta-grid--document :is(input, select) { width: 100%; }
    .quotation-reference-form .quotation-meta-grid--document { width: calc(50% + var(--space-xl) / 2); }
    .quotation-reference-form .quotation-meta-grid--document > [data-quotation-meta-key] > :is(input, select) { width: 100%; }
}

@media (min-width: 80rem) {
    .quotation-meta-grid,
    .quotation-totals-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .quotation-meta-grid--document {
        grid-template-columns: repeat(var(--entry-columns, 4), minmax(0, 1fr));
    }
    .quotation-reference-form .quotation-meta-grid--document { width: calc(50% + (var(--entry-columns, 4) - 1) * var(--space-xl) / 2); }

    .product-reference-form .product-reference-row,
    .product-reference-form .product-additional-fields {
        /* Keep the former half-track input widths and halve the visible gaps. */
        grid-template-columns: repeat(var(--entry-columns, 4), minmax(0, calc((100% - 3 * var(--space-xl)) / 8)));
        column-gap: calc((100% + 5 * var(--space-xl)) / 16);
    }

    .quotation-totals-grid {
        grid-template-columns: repeat(9, minmax(0, 1fr));
    }
}

@media (min-width: 48rem) and (max-width: 79.99rem) {
    .quotation-meta-grid,
    .quotation-totals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quotation-meta-grid--document {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.reference-dialog {
    min-width: 0;
    min-height: 100%;
    color: var(--color-ink-2);
    background: var(--color-surface);
}

.reference-dialog-title {
    min-height: 44px;
    padding: 4px 24px 4px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-accent-ink);
    background: linear-gradient(90deg, var(--color-table-head), var(--color-rule-strong));
    font-size: var(--text-sm);
}

.reference-dialog-title a {
    padding: var(--space-xs);
    color: var(--color-ink);
    font-size: var(--text-lg);
    line-height: 1;
    text-decoration: none;
}

.reference-dialog > .alert {
    margin: var(--space-sm) var(--space-md) 0;
}

.customer-reference-form {
    padding: var(--space-lg) var(--space-md) var(--space-xl);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space-md) var(--space-xl);
}

.customer-reference-form > label,
.customer-entry-fields > label {
    min-width: 0;
    display: grid;
    gap: var(--space-xs);
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.customer-reference-form > label > span,
.customer-entry-fields > label > span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.customer-reference-form > label > span::before,
.customer-entry-fields > label > span::before {
    content: "";
    width: var(--rule-thin);
    height: var(--text-base);
    flex: 0 0 auto;
    background: var(--color-accent-deep);
}

.customer-reference-form input,
.customer-reference-form select,
.customer-reference-form textarea {
    margin: 0;
    border-color: var(--color-rule);
    border-radius: 0;
    font-size: var(--text-sm);
}

.customer-reference-form input,
.customer-reference-form select {
    width: min(368px, 100%);
    height: 26px;
    min-height: 26px;
    padding: var(--space-2xs) var(--space-xs);
}
.customer-reference-form select[data-country-select][hidden], .product-reference-form select[data-country-select][hidden] { display: none; }
.customer-country-picker { position: relative; width: min(368px, 100%); }
.customer-entry-fields { --customer-entry-control-width: 239.2px; }
.customer-entry-fields input:not([type="checkbox"]), .customer-entry-fields select, .customer-entry-fields .customer-country-picker { width: min(var(--customer-entry-control-width), 100%); }
.customer-entry-fields .customer-country-picker input { width: 100%; }
.customer-entry-fields .customer-entry-address { grid-column: 1 / -1; }
.customer-entry-fields .customer-entry-address input { width: min(478.4px, 100%); }
.customer-reference-form .customer-entry-fields .contact-preference-field > input.contact-preference-choice { left: calc(min(var(--customer-entry-control-width), 100%) + 8px); }
.customer-tax-number { display: block; font-size: var(--text-sm); font-weight: normal; overflow-wrap: anywhere; color: var(--color-ink); }
.customer-country-picker input { width: 100%; }

.customer-country-options {
    position: absolute;
    z-index: 30;
    top: 100%;
    right: 0;
    left: 0;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--color-rule);
    background: #fff;
    box-shadow: 0 4px 10px #0002;
}
.customer-country-options[hidden], .customer-country-options button[hidden], .customer-country-empty[hidden] { display: none; }
.customer-country-options button,
.customer-country-empty {
    display: block;
    width: 100%;
    min-height: 30px;
    padding: 5px 8px;
    border: 0;
    background: #fff;
    color: var(--color-ink);
    font-size: var(--text-sm);
    text-align: left;
}
.customer-country-options button:hover,
.customer-country-options button.active { background: #e8f5f4; }

.customer-entry-fields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space-md) var(--space-xl);
}

.customer-autofill {
    grid-column: 1 / -1;
    min-width: 0;
    display: grid;
    align-content: start;
    gap: var(--space-xs);
}

.customer-autofill label {
    padding-left: var(--space-xs);
    border-left: var(--rule-thin) solid var(--color-accent-deep);
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.customer-autofill textarea {
    width: 100%;
    min-height: 368px;
    resize: vertical;
}

.customer-autofill button { justify-self: center; }
.customer-autofill p { margin: 0; color: var(--color-muted); font-size: var(--text-xs); }

.customer-reference-form .customer-notes {
    grid-column: 1 / -1;
}

.customer-reference-form .customer-notes textarea {
    width: min(2003px, 100%);
    min-height: 25rem;
}

.customer-reference-form .customer-wide-field input {
    width: min(1381px, 100%);
}

.insert-date {
    min-height: auto;
    padding: 0;
    color: var(--color-ink-2);
    background: transparent;
    font-size: var(--text-sm);
}

.insert-date:hover,
.insert-date:focus-visible {
    color: var(--color-accent-deep);
    background: transparent;
}

.customer-wide-field {
    grid-column: 1 / -1;
}

.customer-wide-field small {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    border: 0;
    margin-top: 0;
    vertical-align: middle;
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.customer-submit {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding-top: var(--space-xl);
}

.customer-submit button,
.customer-autofill button {
    box-sizing: border-box;
    width: 102px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    color: #fff;
    border-color: #009688;
    border-radius: var(--radius-sm);
    background: #009688;
    font-size: 14px;
}

@media (min-width: 80rem) {
    .customer-reference-form {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .customer-entry-fields { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .customer-reference-form .customer-entry-fields {
        grid-column: 1 / span 3;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        --customer-entry-control-width: min(239.2px, calc(86.666667% + var(--space-xl) * 0.216666667));
    }
    /* Align the address end with the second control, including the column gap. */
    .customer-entry-fields .customer-entry-address input { width: min(calc(25% + var(--space-xl) / 4 + 239.2px), calc(46.666667% - var(--space-xl) * 0.183333333)); }
    .customer-reference-form .customer-autofill {
        grid-column: 4 / span 2;
        grid-row: 1 / span 2;
        width: min(100%, 500px);
    }

    .customer-reference-form .customer-notes {
        grid-column: 1 / span 3;
    }

    .customer-wide-field {
        grid-column: span 3;
    }
}

@media (min-width: 48rem) and (max-width: 79.99rem) {
    .customer-entry-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--space-md); }
    .customer-entry-fields .customer-entry-address input { width: min(calc(50% - var(--space-md) / 2), calc(25% + var(--space-md) / 4 + 239.2px)); }
}

.product-reference-form {
    padding: var(--space-md) var(--space-md) var(--space-xl);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space-md) var(--space-xl);
}

.product-reference-form > label:not(.product-upload) {
    min-width: 0;
    display: grid;
    gap: var(--space-xs);
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.product-reference-form > label:not(.product-upload)::before {
    content: "";
    position: absolute;
}

.product-reference-form input,
.product-reference-form select,
.product-reference-form textarea {
    margin: 0;
    border-color: var(--color-rule);
    border-radius: 0;
    font-size: var(--text-sm);
}

.product-reference-form input,
.product-reference-form select {
    min-height: var(--control-height);
    height: var(--control-height);
    padding: var(--space-2xs) var(--space-xs);
}

.product-upload {
    grid-column: 1 / -1;
    width: 5.5rem;
    margin: 0 auto;
    display: grid;
    justify-items: center;
    gap: var(--space-xs);
    cursor: pointer;
}

.product-upload > span {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    color: var(--color-accent-ink);
    background: var(--color-table-head);
    white-space: nowrap;
}

.product-upload img,
.product-upload i {
    width: 5.25rem;
    height: 5.25rem;
    display: block;
    border: var(--rule-thin) solid var(--color-rule-strong);
    background: var(--color-surface);
    object-fit: contain;
}

.product-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
}

.product-upload:focus-within > span {
    outline: var(--rule-focus) solid var(--color-focus);
    outline-offset: var(--space-3xs);
}

.product-reference-form .product-spec {
    grid-column: 1 / -1;
}

.product-reference-form .product-spec textarea {
    min-height: 14rem;
}

.product-reference-form h2 {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--color-accent-deep);
    font-size: var(--text-md);
}

.product-submit {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding-top: var(--space-lg);
}

.product-submit button {
    border-radius: var(--radius-sm);
}

@media (min-width: 80rem) {
    .product-reference-form {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .product-reference-form .product-spec-zh {
        grid-column: span 3;
    }

    .product-reference-form .product-spec-en {
        grid-column: span 2;
    }
}

.module-title {
    min-height: var(--tabs-height);
    padding-inline: var(--space-sm);
    display: flex;
    align-items: center;
    color: var(--color-table-head-ink);
    background: linear-gradient(90deg, var(--color-table-head), var(--color-rule-strong));
    font-size: var(--text-sm);
}

.customer-workbench {
    margin-top: var(--space-xs);
    align-items: start;
}

.customer-workbench .status-rail,
.customer-table-panel {
    border-radius: 0;
}

.customer-type-rail {
    padding: 0;
}

.customer-type-heading {
    min-height: 3rem;
    padding-inline: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: var(--rule-thin) solid var(--color-rule);
}

.customer-type-heading button {
    min-height: auto;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font-size: var(--text-base);
}

.customer-type-tree button[style*="--tree-depth"] {
    padding-inline-start: calc(var(--space-sm) + var(--tree-depth) * var(--space-md));
}

.reference-confirm-modal {
    width: min(17rem, calc(100vw - 2rem));
}

#recycle-cleanup-preview { width: min(44rem, calc(100vw - 2rem)); }
#recycle-cleanup-preview .reference-modal-body { max-height: 65vh; overflow: auto; }

.reference-confirm-modal .reference-modal-body {
    min-height: 4.5rem;
    align-content: center;
}

.reference-confirm-modal .reference-modal-body p {
    margin: 0;
}

.reference-modal footer .primary-action {
    min-height: var(--content-control-height);
    padding: var(--space-2xs) var(--space-sm);
    display: inline-flex;
    align-items: center;
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
    text-decoration: none;
}

.customer-types-table {
    min-width: 100%;
}

.customer-type-name {
    padding-inline-start: calc(var(--space-sm) + var(--type-depth) * 1.5rem) !important;
    text-align: left !important;
}

.inactive-row {
    opacity: .55;
}

.customer-type-heading strong {
    font-size: var(--text-sm);
    font-weight: 600;
}

.customer-type-tree {
    padding: var(--space-sm);
    color: var(--color-ink-2);
}

.customer-type-tree .customer-type-folder,
.customer-type-tree .customer-type-leaf {
    width: 100%;
    min-height: 2.25rem;
    padding: 0 var(--space-xs);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-2xs);
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--color-ink-2);
    background: #fff;
    font-style: normal;
    font-weight: 400;
    white-space: nowrap;
}

.customer-type-tree .customer-type-folder.active,
.customer-type-tree .customer-type-leaf.active {
    color: var(--color-ink-2);
    background: #d8d8d8;
}

.customer-type-group > summary {
    display: flex;
    align-items: stretch;
    list-style: none;
}

.customer-type-group > summary::-webkit-details-marker {
    display: none;
}



.customer-type-group > summary > .customer-type-folder {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
}

.customer-type-tree i,
.customer-type-tree b {
    font-style: normal;
    font-weight: 400;
}




.customer-type-children {
    margin-inline-start: .75rem;
    padding-inline-start: .6rem;
    border-inline-start: var(--rule-thin) dotted var(--color-rule-strong);
}

.customer-type-children > * {
    position: relative;
}

.customer-type-children > *::before {
    content: "";
    position: absolute;
    inset: 1.1rem auto auto -.62rem;
    width: .55rem;
    border-top: var(--rule-thin) dotted var(--color-rule-strong);
}

.customer-type-leaves {
    margin-inline-start: 1rem;
}

.customer-type-tree span.customer-type-leaf {
    display: flex;
    align-items: center;
}

.customer-type-leaf > i {
    color: var(--color-ink);
}

.customer-type-leaf > b {
    color: #ff8a00;
}

.customer-type-tree .customer-type-other {
    margin-top: var(--space-2xs);
}

.customer-workbench .status-rail,
.product-workbench .status-rail,
.sales-order-workbench .status-rail {
    min-height: calc(100dvh - 6.25rem);
}

.customer-table-panel,
.product-table-panel,
.sales-order-table-panel {
    min-height: calc(100dvh - 6.25rem);
    display: flex;
    flex-direction: column;
}

.customer-table-panel .table-wrap,
.product-table-panel .table-wrap,
.sales-order-table-stage {
    flex: 1 1 auto;
}

.customer-table-panel > #customer-batch-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.customer-table-panel > #customer-batch-form > .table-wrap {
    min-height: 0;
}

.customer-toolbar {
    min-height: 5rem;
    align-items: stretch;
}

.customer-toolbar .toolbar-searches {
    width: 100%;
}

.customer-toolbar-shortcuts {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-inline-start: auto;
}

.customer-stale-actions {
    display: flex;
    align-items: center;
    margin-inline-end: var(--space-xs);
}

.toolbar-actions,
.toolbar-searches,
.row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.toolbar-actions > a {
    min-height: var(--control-height);
    padding-inline: var(--space-sm);
    display: inline-flex;
    align-items: center;
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-sm);
    color: var(--color-ink-2);
    background: var(--color-surface);
    text-decoration: none;
}

.toolbar-actions > a.primary-action {
    color: var(--color-accent-ink);
    border-color: var(--color-accent-deep);
    background: var(--color-accent-deep);
}

.toolbar-searches input {
    width: 120px;
    margin: 0;
}

.toolbar-searches button,
.quotation-column-config-dialog button {
    min-height: var(--control-height);
    padding-block: var(--space-2xs);
    padding-inline: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-sm);
    color: var(--color-ink-2);
    background: var(--color-surface);
}

.table-toolbar button {
    min-height: var(--content-control-height);
    padding-block: var(--space-2xs);
}

.toolbar-searches button.active {
    color: var(--color-accent-ink);
    border-color: var(--color-accent-deep);
    background: var(--color-accent-deep);
}

.customer-table {
    min-width: 0;
    table-layout: fixed;
}

.customer-table th,
.customer-table td {
    height: 2.5rem;
    padding: var(--space-2xs) var(--space-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid #e7eaed;
    border-bottom-color: #e7eaed;
    text-align: center;
}

.customer-table :is(th, td):nth-child(1) { width: 40px; min-width: 40px; }
.customer-table :is(th, td):nth-child(2) { width: 48px; min-width: 48px; text-align: center; }
.customer-table :is(th, td):nth-child(3) { width: 42px; min-width: 42px; text-align: center; }
.customer-table :is(th, td):last-child { width: 180px; min-width: 180px; text-align: center; }

.customer-table td:last-child {
    overflow: visible;
}

.customer-table input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
}

.customer-table .wrap-cell {
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-progress {
    min-width: 4.5rem;
    padding: var(--space-3xs) var(--space-xs);
    display: inline-block;
    border-radius: var(--radius-sm);
    color: #fff;
    text-align: center;
    white-space: nowrap;
}

.customer-progress-orange { background: #ff7800; }
.customer-progress-cyan { background: #00babd; }
.customer-progress-green { background: #5fb878; }
.customer-progress-blue { background: #1e90ff; }
.customer-progress-red { background: #cc0000; }
.customer-progress-teal { background: #009688; }
.customer-progress-purple { background: #a25d88; }
.customer-progress-neutral { background: var(--color-muted); }

.customer-public-toolbar {
    min-height: 68px;
    padding: 21px 12px 11px;
    justify-content: flex-start;
    gap: 12px;
}

.customer-public-toolbar .public-claim-action {
    width: 85px;
}

.customer-public-toolbar .toolbar-searches > :is(.query-action, .reset-action) {
    width: 60px;
    padding: 0 10px;
    border-radius: 4px;
}

.customer-public-toolbar .toolbar-searches > .public-claim-action {
    width: 85px;
}

.customer-public-table {
    min-width: 126rem;
}

.customer-public-table th {
    height: 36px;
    font-weight: 400;
}


.customer-public-table .public-row-claim {
    min-height: 26px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: #60b879;
    font-size: 12px;
}

/* Customer list: measured from the authenticated reference page. */
.customer-toolbar .toolbar-actions > :is(a, button),
.customer-toolbar .toolbar-searches > :is(a, button, summary),
.customer-toolbar .toolbar-searches > input,
.customer-toolbar .toolbar-searches > select {
    box-sizing: border-box;
    height: 26px;
    min-height: 26px;
    font-size: 12px;
    font-weight: 400;
}

.customer-toolbar .toolbar-actions > :is(a, button) {
    width: 60px;
    justify-content: center;
    padding: 4px;
}

.customer-toolbar .toolbar-actions > .refresh-action {
    width: 32px;
}

.content .customer-toolbar .toolbar-searches > input[type="search"] {
    width: 130px;
    max-width: 130px;
    flex: 0 0 130px;
    padding: 0 0 0 10px;
}

.customer-toolbar .toolbar-searches > input:not([type="search"]) {
    width: 120px;
    padding: 0 0 0 10px;
}

.customer-toolbar .toolbar-searches > select {
    width: 120px;
    padding: 0 6px;
}

.customer-toolbar .toolbar-searches > .query-action {
    width: 60px;
    color: #fff;
    background: #60b879;
}

.customer-toolbar .toolbar-searches > .reset-action {
    width: 60px;
    color: #000;
    background: #e2e2e2;
}

.customer-toolbar .toolbar-more > summary {
    box-sizing: border-box;
    width: 60px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #57a8e8;
}


.content .customer-toolbar .toolbar-actions > .primary-action {
    color: #fff;
    border-color: #009688;
    background: #009688;
}

.customer-toolbar .customer-toolbar-shortcuts .column-settings {
    width: 32px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    border: 0;
    color: #5d9dbd;
    background: transparent;
}

.customer-toolbar .toolbar-searches > .advanced-search-action {
    box-sizing: border-box;
    width: 32px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #333;
    background: #f5f5f5;
}

.customer-toolbar .customer-stale-actions > .stale-action:first-child {
    color: #fff;
    background: #999;
    border: 0;
    border-radius: 4px 0 0 4px;
}

.customer-toolbar .customer-stale-actions > .stale-action {
    box-sizing: border-box;
    width: 44px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #222;
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 0;
    text-decoration: none;
}

.customer-toolbar .customer-stale-actions > .stale-action:last-child {
    color: #fff;
    background: #de4646;
    border: 0;
    border-radius: 0 4px 4px 0;
}

.customer-progress {
    min-width: 0;
    padding: 4px 11px 4px 10px;
    border-radius: 20px 50px 50px 20px;
    font-size: 12px;
    font-weight: 400;
    line-height: 14px;
}

.customer-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    white-space: nowrap;
}

.customer-row-actions a, .customer-row-actions button, .customer-row-actions span {
    font-size: 17px;
    text-decoration: none;
    width: 20px;
    text-align: center;
}
.customer-row-actions button { border: 0; background: none; padding: 0; cursor: pointer; }

.customer-row-actions > :nth-child(1) { color: #5b9dbd; }
.customer-row-actions > :nth-child(2) { color: #ff774c; }
.customer-row-actions > :nth-child(3) { color: #8ec75c; }
.customer-row-actions > a:nth-child(3) { font-weight: 700; }
.customer-row-actions > :nth-child(4) { color: #5dc5fc; }
.customer-row-actions > :nth-child(5) { color: #009688; }

.customer-columns-dialog {
    width: min(760px, calc(100vw - 32px));
}

.customer-column-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 16px;
}

.customer-column-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.customer-column-options input {
    width: auto;
    min-height: auto;
    margin: 0;
}

.product-workbench {
    margin-top: var(--space-xs);
    align-items: start;
}

.product-workbench .status-rail,
.product-table-panel {
    border-radius: 0;
}

.product-toolbar {
    min-height: 5rem;
    align-items: stretch;
}

.product-table {
    min-width: 135rem;
}

.product-table th,
.product-table td {
    height: 3rem;
    padding: var(--space-2xs) var(--space-xs);
}

.product-table input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
}

.product-table .wrap-cell {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-table .wrap-cell span,
.product-table .wrap-cell small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-table .wrap-cell small {
    margin-top: var(--space-2xs);
    color: var(--color-muted);
}

.quotation-workbench {
    margin-top: var(--space-xs);
    align-items: start;
}

.quotation-workbench .status-rail,
.quotation-table-panel {
    border-radius: 0;
}

.quotation-toolbar {
    min-height: 5rem;
    align-items: stretch;
}

.quotation-toolbar-top,
.quotation-toolbar-secondary {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.quotation-toolbar-top {
    justify-content: space-between;
}

.quotation-toolbar .primary-action,
.quotation-toolbar .danger-action,
.quotation-toolbar .info-action,
.quotation-settings {
    min-height: var(--control-height);
    padding-inline: var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.quotation-settings {
    padding-inline: var(--space-xs);
    border: 0;
    color: var(--color-table-head);
    background: transparent;
}

.quotation-toolbar-searches {
    justify-content: flex-start;
}

.customer-toolbar .toolbar-searches > [data-owner-filter],
.quotation-toolbar-searches > [data-owner-filter],
.sales-order-toolbar-searches > [data-owner-filter] {
    box-sizing: border-box;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    flex: 0 0 150px;
    height: 26px;
    min-height: 26px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 400;
}

.quotation-workbench .status-rail h2 {
    margin: 0;
    padding: var(--space-xs);
    font-size: var(--text-md);
    font-weight: 600;
}


.quotation-workbench .status-rail button[data-state="sent"] span>.crm-icon { color: #2d7ff9; }
.quotation-workbench .status-rail button[data-state="negotiating"] span>.crm-icon { color: #ff8700; }
.quotation-workbench .status-rail button[data-state="countered"] span>.crm-icon { color: #00aabd; }
.quotation-workbench .status-rail button[data-state="accepted"] span>.crm-icon { color: #5fb878; }
.quotation-workbench .status-rail button[data-state="converted"] span>.crm-icon { color: #f2c900; }
.quotation-workbench .status-rail button[data-state="rejected"] span>.crm-icon { color: #c51b8a; }
.quotation-workbench .status-rail button[data-state="expired"] span>.crm-icon { color: #cc0000; }
:is(.quotation-workbench, .sales-order-workbench) .status-rail button[data-status-color] span>.crm-icon { color: var(--status-color); }

.quotation-table {
    min-width: 100%;
    table-layout: fixed;
}

.quotation-table th,
.quotation-table td {
    height: 2.5rem;
    padding: var(--space-2xs) var(--space-xs);
}

.quotation-table input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
}

.quotation-table .wrap-cell {
    max-width: 13rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quotation-table th.sortable,
.sales-order-table th.sortable,
.master-data-table th.sortable {
    cursor: pointer;
}




.quotation-table th.sortable:focus-visible,
.sales-order-table th.sortable:focus-visible,
.master-data-table th.sortable:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}

.quotation-folder {
    color: #d8bd52;
    text-decoration: none;
}

.customer-table .quotation-folder { font-size: 17px; }
:is(.customer-table, .quotation-table, .sales-order-table) button.quotation-folder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.customer-folder-unset { opacity: .45; }

.quotation-row-actions {
    display: grid;
    grid-template-columns: repeat(4, 22px);
    gap: 6px;
}

.quotation-row-actions[hidden] {
    display: none;
}

.quotation-row-actions .quotation-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.quotation-row-actions .quotation-pdf {
    grid-column: 1;
    border-radius: 50%;
    background: var(--color-danger);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.quotation-row-actions .quotation-convert-action { grid-column: 2; color: #009688; }
.quotation-row-actions .quotation-convert-action:disabled { color: #75808a; cursor: default; opacity: 1; }
.quotation-row-actions .quotation-view-action { grid-column: 3; color: #5b9dbd; }
.quotation-row-actions .quotation-edit-action { grid-column: 4; color: #5fb878; }
.quotation-row-actions .quotation-reminder-action { grid-column: 5; color: var(--color-accent-deep); }
.quotation-row-actions:has(.quotation-reminder-action) { grid-template-columns: repeat(5, 2.75rem); }
.quotation-row-actions .quotation-reference-upload { grid-column: 6; color: var(--color-accent-deep); }
.quotation-row-actions:has(.quotation-reference-upload) { grid-template-columns: repeat(6, 2.75rem); }
@media (min-width: 60rem) {
    .quotation-row-actions:has(.quotation-reminder-action) { grid-template-columns: repeat(5, 22px); }
    .quotation-row-actions:has(.quotation-reference-upload) { grid-template-columns: repeat(6, 22px); }
}
.quotation-row-actions .quotation-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.sales-order-workbench {
    margin-top: var(--space-xs);
    align-items: start;
}

.sales-order-workbench .status-rail,
.sales-order-table-panel {
    border-radius: 0;
}

.sales-order-toolbar {
    display: flex;
    flex-direction: column;
    min-height: 5rem;
    align-items: stretch;
}

.sales-order-toolbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.sales-order-toolbar-searches {
    justify-content: flex-start;
}

.sales-order-toolbar .toolbar-actions > :is(a, button) {
    box-sizing: border-box;
    width: 60px;
    justify-content: center;
}

.sales-order-toolbar .toolbar-actions > .refresh-action {
    width: 32px;
}

.sales-order-toolbar .sales-order-more-actions > .info-action {
    width: 80px;
}

.sales-order-toolbar .toolbar-more > summary {
    box-sizing: border-box;
    width: 60px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sales-order-toolbar-searches > :is(.query-action, .reset-action) {
    box-sizing: border-box;
    width: 60px;
    height: 26px;
    min-height: 26px;
}

.sales-order-toolbar-searches > .query-action { color: #fff; }
.sales-order-toolbar-searches > .reset-action { color: #222; background: #e2e2e2; }
.content .sales-order-toolbar .primary-action { color: #fff; background: #009688; border-color: #009688; }

.sales-order-table {
    min-width: 180rem;
    table-layout: fixed;
}

.sales-order-table th,
.sales-order-table td {
    height: 2.5rem;
    padding: var(--space-2xs) var(--space-xs);
}

.sales-order-table input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
}

.sales-order-table .wrap-cell {
    max-width: 13rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-payment-dot { display:inline-flex; width:18px; height:18px; color:#9aa3ad; vertical-align:middle; }
.sales-payment-dot .crm-icon[data-lucide="circle"] { fill:currentColor; }
.sales-payment-dot[data-payment-state="partial"] { color: #e4b52a; }
.sales-payment-dot[data-payment-state="paid"] { color: #41a36a; }

.sales-order-row-actions { grid-template-columns: repeat(5, 22px); }
.sales-order-row-actions .sales-proof-upload-action { grid-column: 2; color: #007c75; font-size: 16px; }
.sales-order-row-actions .sales-tracking-action { grid-column: 3; color: #5b9dbd; }
.sales-order-row-actions .sales-outbound-action { grid-column: 4; color: #5b9dbd; }
.sales-order-row-actions .sales-purchasing-action { grid-column: 5; color: #009688; font-size: 16px; }
.sales-tracking-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(720px, 42vw);
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: auto;
    background: #fff;
    box-shadow: -8px 0 24px #0002;
}
.sales-tracking-drawer::backdrop { background: #0006; }
.sales-tracking-drawer > header { height: 42px; padding: 0 12px 0 20px; display: flex; align-items: center; justify-content: space-between; background: #789eae; color: #fff; font-weight: 700; }
.sales-tracking-drawer > header button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 4px; background: none; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.sales-tracking-summary { padding: 24px 20px; border-bottom: 1px solid #e5ebed; }
.sales-tracking-summary h2 { margin: 8px 0 0; font-size: 18px; }
.sales-tracking-list { padding: 16px 20px; }
.sales-tracking-list > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sales-tracking-list > header span { display: inline-flex; align-items: center; gap: 8px; }
.sales-tracking-entry { padding: 14px 0; border-top: 1px solid #e5ebed; }
.sales-tracking-entry > div:first-child { display: flex; justify-content: space-between; color: #59676d; }
.sales-proof-tag { display: inline-block; margin: 8px 0; padding: 3px 8px; border-radius: 3px; background: #fff1bb; color: #7a5800; }
.sales-tracking-content { overflow-wrap: anywhere; line-height: 1.55; }
.sales-tracking-editor-page { padding-bottom: 32px; }
.sales-tracking-editor-page > h1 { margin: 28px 0; text-align: center; font-size: 26px; }
.sales-tracking-editor-page form { padding: 0 24px; }
.sales-tracking-editor-page form > label:first-of-type { display: block; max-width: 360px; }
.sales-tracking-editor-page input[type="date"] { display: block; width: 100%; margin: 8px 0 16px; }
.customer-tracking-meta { display: flex; gap: 16px; margin-bottom: 16px; }
.customer-tracking-meta > label { width: 120px; display: grid; gap: 6px; }
.sales-tracking-editor-page .customer-tracking-meta :is(input, select) { width: 120px; height: 36px; min-height: 36px; margin: 0; padding: 0 4px; font-size: 12px; }
.sales-proof-option { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.sales-tracking-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid #ccd5d9; border-bottom: 0; }
.sales-tracking-toolbar button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; }
.sales-tracking-toolbar select { width: 60px; height: 32px; min-height: 32px; margin: 0; padding: 0 2px; font-size: 11px; }
.sales-tracking-toolbar label { height: 32px; display: inline-flex; align-items: center; gap: 4px; }
.sales-tracking-toolbar input[type="color"] { width: 36px; height: 30px; margin: 0; padding: 1px; }
.sales-tracking-input { min-height: 360px; padding: 16px; border: 1px solid #ccd5d9; line-height: 1.5; overflow-wrap: anywhere; }
.sales-tracking-input:focus { outline: 2px solid #009688; outline-offset: -2px; }
.sales-tracking-editor-page footer { display: flex; justify-content: center; margin-top: 28px; }
.customer-create-embedded { display: block; }
.customer-create-embedded .content { padding: 0; }
.customer-create-embedded .quotation-dialog { min-height: 100dvh; }
.customer-create-embedded .reference-dialog-title a[aria-label="关闭"] { visibility: hidden; }
.customer-create-overlay > iframe { width: 100%; height: 100%; display: block; border: 0; background: #fff; }
.customer-create-overlay > button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; position: absolute; z-index: 1; top: 6px; right: 18px; border: 0; background: transparent; color: #fff; font-size: 24px; line-height: 1; }

/* Keep the quotation and sales-order workbenches close to the reference list density. */
.quotation-workbench,
.sales-order-workbench {
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", Tahoma, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
}

.quotation-workbench .status-rail h2,
.sales-order-workbench .status-rail h2 {
    font-size: 12px;
    font-weight: 400;
}

.quotation-workbench .status-rail button,
.sales-order-workbench .status-rail button,
.quotation-toolbar .result-count,
.sales-order-toolbar .result-count {
    font-size: 12px;
}

.quotation-workbench .table-toolbar :is(button, .button-link, summary),
.sales-order-workbench .table-toolbar :is(button, .button-link, summary) {
    font-family: inherit;
    font-size: 12px;
    line-height: 18px;
}

.quotation-workbench .toolbar-searches > input,
.sales-order-workbench .toolbar-searches > input {
    height: 26px;
    min-height: 26px;
    margin: 0;
    padding: 4px 8px;
    border-radius: 0;
    font-family: inherit;
    font-size: 12px;
    line-height: 18px;
}

.quotation-table th,
.sales-order-table th {
    height: 36px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
}

.quotation-table td,
.sales-order-table td {
    height: 34px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 12px;
    line-height: 20px;
}

.quotation-workbench .table-pagination,
.sales-order-workbench .table-pagination {
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    gap: 4px;
    font-family: inherit;
    font-size: 12px;
    line-height: 20px;
}

.quotation-workbench .table-pagination b,
.sales-order-workbench .table-pagination b {
    min-height: 26px;
    height: 26px;
    font-size: 12px;
}

.quotation-workbench .table-pagination :is(input, select, button),
.sales-order-workbench .table-pagination :is(input, select, button) {
    min-height: 26px;
    height: 26px;
    padding: 2px 8px;
    border-radius: 0;
    font-family: inherit;
    font-size: 12px;
}

.quotation-workbench .table-pagination input,
.sales-order-workbench .table-pagination input {
    width: 36px;
}

.sales-order-toolbar-searches > .advanced-search-action {
    box-sizing: border-box;
    width: 32px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    border: 0;
    color: #168e91;
    background: transparent;
    font-family: inherit;
    font-size: 18px;
}

.sales-order-advanced-search {
    width: min(68rem, calc(100vw - 2rem));
}

.sales-order-advanced-search-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
}

.sales-order-advanced-search-fields label {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 4px;
    font-size: 12px;
}

.sales-order-advanced-search-fields :is(input, select) {
    width: 100%;
    min-width: 0;
    height: 30px;
    min-height: 30px;
    margin: 0;
    padding: 4px 8px;
    border-radius: 0;
    font-family: inherit;
    font-size: 12px;
}

.pending-shipment-workbench {
    margin-top: var(--space-xs);
    border-radius: 0;
}

.pending-shipment-toolbar {
    position: relative;
    min-height: 5rem;
    padding-right: 3rem;
    align-items: stretch;
}

.pending-shipment-searches input {
    width: 120px;
}

.pending-shipment-searches input:nth-of-type(3),
.pending-shipment-searches input:nth-of-type(4) {
    width: 120px;
}

.pending-shipment-searches select {
    width: 8.5rem;
    min-height: var(--control-height);
    margin: 0;
    padding-inline: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-sm);
    color: var(--color-ink-2);
    background: var(--color-surface);
}

.pending-shipment-searches .primary-action {
    color: var(--color-accent-ink);
    border-color: var(--color-accent-deep);
    background: var(--color-accent-deep);
}

.pending-shipment-settings {
    position: absolute;
    top: 50%;
    right: var(--space-md);
    translate: 0 -50%;
    color: var(--color-table-head);
    font-size: var(--text-lg);
}

.pending-shipment-table {
    min-width: 112rem;
}

.pending-shipment-table th,
.pending-shipment-table td {
    height: 2.5rem;
    padding: var(--space-2xs) var(--space-xs);
}

.pending-shipment-table .wrap-cell {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shipping-state {
    color: var(--color-danger);
    font-weight: 600;
}


.shipping-state[data-state="partial"],
.shipped-quantity {
    color: var(--color-accent-deep);
}

.unshipped-quantity {
    color: var(--color-danger);
}

.shipment-action {
    min-height: 1.7rem;
    padding-inline: var(--space-xs);
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
    text-decoration: none;
}

.table-pagination {
    min-height: 3rem;
    padding: var(--space-xs) var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-xs);
    border-top: var(--rule-thin) solid var(--color-rule);
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.table-pagination b {
    min-width: 1.8rem;
    min-height: 1.8rem;
    display: inline-grid;
    place-items: center;
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
    font-weight: 500;
}

.table-pagination > span:first-child,
.table-pagination > b + span {
    min-width: 1.5rem;
    min-height: 1.8rem;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.table-pagination > span[aria-disabled="true"] {
    cursor: default;
    opacity: .35;
}

.table-pagination input,
.table-pagination select,
.table-pagination button {
    width: auto;
    min-height: 1.8rem;
    margin: 0;
    padding: var(--space-2xs) var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: var(--text-sm);
}

.table-pagination input {
    width: 2.5rem;
    text-align: center;
}

.shipment-list-workbench {
    margin-top: var(--space-xs);
    border-radius: 0;
}

.shipment-status-rail {
    min-height: 3.25rem;
    padding-inline: var(--space-sm);
    display: flex;
    align-items: stretch;
    gap: var(--space-lg);
    border-bottom: var(--rule-thin) solid var(--color-rule);
    background: var(--color-surface);
}

.shipment-status-rail button {
    min-height: 3.25rem;
    padding: 0;
    border: 0;
    border-bottom: .15rem solid transparent;
    border-radius: 0;
    color: var(--color-ink-2);
    background: transparent;
    font-size: var(--text-sm);
}

.shipment-status-rail button.active {
    color: var(--color-accent-deep);
    border-bottom-color: var(--color-accent-deep);
}

.shipment-list-toolbar {
    position: relative;
    min-height: 7.25rem;
    padding-right: 3rem;
    align-items: stretch;
}

.shipment-list-toolbar .toolbar-actions button,
.shipment-list-searches button {
    min-height: var(--control-height);
    padding-inline: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-sm);
    color: var(--color-ink-2);
    background: var(--color-surface);
}

.shipment-list-toolbar .toolbar-actions .danger-action {
    color: var(--color-danger);
}

.shipment-list-toolbar button:disabled {
    color: var(--color-muted);
    background: var(--color-paper-2);
    cursor: not-allowed;
    opacity: .65;
}

.shipment-list-searches input {
    width: 120px;
}

.shipment-list-searches .primary-action {
    color: var(--color-accent-ink);
    border-color: var(--color-accent-deep);
    background: var(--color-accent-deep);
}

.shipment-list-table {
    min-width: 0;
    table-layout: fixed;
}

.shipment-list-table .shipment-fixed-column { box-sizing: border-box; width: 40px; min-width: 40px; max-width: 40px; padding-inline: 4px; }
.shipment-list-table .shipment-row-actions { box-sizing: border-box; width: 150px; min-width: 150px; max-width: 150px; padding-inline: 4px; }
.shipment-row-actions .row-actions { flex-direction: column; align-items: stretch; gap: 4px; }
.shipment-row-actions form { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.shipment-row-actions select { flex: 1; width: 0; min-width: 0; height: 24px; min-height: 24px; padding: 2px 4px; }
.shipment-row-actions :is(button, a) { flex-shrink: 0; max-width: 100%; min-height: 24px; padding: 2px 6px; }
.shipment-list-table .status-quick-edit:is(:hover, :focus) { background: transparent; box-shadow: none; transform: none; }

.shipment-list-table th,
.shipment-list-table td {
    height: 2.5rem;
    padding: var(--space-2xs) var(--space-xs);
}

.shipment-list-table input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
}

.shipment-list-table .wrap-cell {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-actions {
    flex-wrap: nowrap;
}

.customer-duplicate-search {
    width: 65%;
    margin: 0 auto;
    padding-top: 10px;
}

.customer-duplicate-search h1 {
    height: 101px;
    margin: 0;
    display: grid;
    place-items: center;
    text-align: center;
    color: #607d8b;
    font-size: 26px;
    font-weight: 700;
}

.customer-duplicate-search form {
    display: block;
}

.fuzzy-switch {
    width: fit-content;
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--text-sm);
    margin: 12px 0 0 10px;
}

.fuzzy-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.fuzzy-switch span {
    width: 2rem;
    height: 1.125rem;
    padding: .125rem;
    display: block;
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: 999px;
    background: var(--color-paper-3);
}

.fuzzy-switch span::before {
    content: "";
    width: .75rem;
    height: .75rem;
    display: block;
    border-radius: 50%;
    background: var(--color-rule-strong);
    transition: transform var(--dur-micro) var(--ease-out);
}

.fuzzy-switch input:checked + span {
    border-color: var(--color-success);
    background: var(--color-success-soft);
}

.fuzzy-switch input:checked + span::before {
    background: var(--color-success);
    transform: translateX(.875rem);
}

.fuzzy-switch input:focus-visible + span {
    outline: var(--rule-focus) solid var(--color-focus);
    outline-offset: var(--space-3xs);
}

.duplicate-fields {
    width: 91.5%;
    margin-top: 24px;
    padding-inline: 6px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px 37px;
}

.duplicate-fields label {
    min-width: 0;
}

.duplicate-fields label > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.duplicate-fields input {
    height: 26px;
    min-height: 26px;
    margin: 0;
    padding: 0 0 0 10px;
    border-color: #e6e6e6;
    font-size: 12px;
}

.duplicate-actions {
    margin-top: 66px;
    display: flex;
    justify-content: center;
    gap: 14px;
}

.duplicate-actions button,
.duplicate-actions a {
    width: 74px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.duplicate-actions .query-action {
    border-color: #60b879;
    background: #60b879;
}

.duplicate-actions a {
    color: var(--color-ink-2);
    background: #e2e2e2;
}

.content .duplicate-actions .reset-action {
    border-color: #e2e2e2;
    color: #000;
    background: #e2e2e2;
}

.content:has(> .customer-duplicate-search) {
    background: #fff;
}

.duplicate-results {
    margin-top: var(--space-xl);
    border: var(--rule-thin) solid var(--color-rule);
}

.customer-detail-title {
    min-height: 44px;
    padding-inline-end: max(3rem, calc((100% - 111rem) / 2 + 1rem));
    justify-content: space-between;
    color: var(--color-ink-2);
    background: var(--color-surface);
    border-block-end: var(--rule-thin) solid var(--color-rule);
}

.customer-detail-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-md);
}

.customer-detail-actions a {
    color: var(--color-ink-2);
    text-decoration: none;
}

.customer-detail-card {
    width: min(111rem, calc(100% - 4rem));
    margin: var(--space-lg) auto;
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    border: var(--rule-thin) solid var(--color-rule-strong);
    background: var(--color-surface);
    box-shadow: 0 var(--space-3xs) var(--space-xs) var(--color-shadow);
}

.customer-detail-card > h1 {
    margin: 0 0 var(--space-lg);
    text-align: center;
    font-size: var(--text-2xl);
}
.customer-detail-identity { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 16px; font-size: 20px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.customer-detail-identity:empty { display: none; }
.customer-detail-card > :is(.customer-detail-identity, .customer-summary-grid, .customer-history-summary, .customer-link-row, .customer-detail-tabs, [data-customer-tab-panel]) {
    width: min(87.5rem, 100%);
    margin-inline: auto;
}

.customer-progress-track {
    margin: 0 0 var(--space-2xl);
    padding: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(7rem, 1fr);
    overflow-x: auto;
    list-style: none;
}

.customer-progress-track li {
    position: relative;
    display: grid;
    justify-items: center;
    gap: var(--space-xs);
    color: var(--color-ink-2);
    font-size: var(--text-sm);
}

.customer-progress-track li::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset-block-start: .625rem;
    inset-inline-start: -50%;
    width: 100%;
    border-block-start: .125rem solid var(--color-rule);
}

.customer-progress-track li:first-child::before {
    display: none;
}

.customer-progress-track li.complete::before {
    border-color: var(--color-success);
}

.customer-progress-track span {
    position: relative;
    z-index: 1;
    width: 1.25rem;
    height: 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--color-muted);
    background: var(--color-rule);
    font-size: var(--text-xs);
}

.customer-progress-track .complete span {
    color: var(--color-accent-ink);
    background: var(--color-success);
}

.customer-progress-track b {
    font-weight: 400;
}

.customer-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2xl);
}

.customer-summary-grid dl {
    margin: 0;
}

.customer-summary-grid dl > div {
    min-height: 2.8rem;
    display: grid;
    grid-template-columns: 7.25rem minmax(0, 1fr);
    align-items: center;
}

.customer-summary-grid dt {
    color: var(--color-ink);
}

.customer-summary-grid dd {
    min-width: 0;
    margin: 0;
    padding: var(--space-xs) var(--space-sm);
    overflow-wrap: anywhere;
    border-block-end: var(--rule-thin) solid var(--color-rule-strong);
    color: var(--color-muted);
}

.customer-notes-row {
    margin-top: var(--space-xs);
    display: grid;
    grid-template-columns: 7.25rem minmax(0, 1fr);
    align-items: center;
}

.customer-notes-row > b {
    font-weight: 400;
}

.customer-notes-row > div {
    min-height: 12.5rem;
    padding: var(--space-sm);
    border: var(--rule-thin) solid var(--color-rule);
    color: var(--color-muted);
}

.customer-link-row {
    padding: var(--space-sm) 0 0 7.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-xl);
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.customer-link-row b {
    color: var(--color-ink-2);
    font-weight: 400;
}

.customer-history-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 2rem;
    margin-top: 1.75rem;
}

.customer-history-summary > section {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.customer-history-summary h2 {
    display: flex;
    align-items: center;
    margin: 0 0 .75rem;
    color: #08753f;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
}

.customer-history-statistics h2 {
    display: flex;
    align-items: center;
    gap: 6px;
}
.customer-history-statistics h2 > .column-config-control { margin-left: auto; font-size: var(--text-sm); }
.customer-history-statistics > .table-wrap { flex: 1; display: flex; min-height: 0; }
.customer-history-statistics > .table-wrap > table { height: 100%; }

.customer-history-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    color: var(--color-accent-deep);
    background: transparent;
}


.reference-modal.customer-history-help-dialog {
    width: max-content;
    max-width: calc(100vw - 32px);
}

.customer-history-help-dialog .reference-modal-body {
    padding: 24px 20px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    white-space: nowrap;
}

.customer-history-help-dialog :is(p, dt, dd) {
    font-size: inherit;
    line-height: inherit;
}

.customer-history-help-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    min-height: 24px;
    padding: 0;
    border: 0;
    color: var(--color-ink-2);
    background: transparent;
}

.customer-history-help-dialog dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 12px 16px;
    align-items: baseline;
    margin: 0;
}

.customer-history-help-dialog dt {
    margin: 0;
    color: var(--color-accent-deep);
}

.customer-history-help-dialog dd {
    margin: 0;
}

.customer-history-summary table {
    min-width: 0;
    border: 1px solid var(--color-rule);
}

.customer-history-summary :is(th, td),
.customer-history-note-text {
    color: var(--color-ink-2);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
}

.customer-history-summary :is(th, td) {
    height: 44px;
    padding: 4px;
    border: 1px solid var(--color-rule);
    text-align: center;
    white-space: nowrap;
    background: var(--color-surface);
}

.customer-history-notes-content {
    position: relative;
    flex: 1;
    min-height: 0;
    border: 1px solid var(--color-rule);
}

.customer-history-note-text {
    position: absolute;
    inset: 0;
    overflow: auto;
    padding: 8px;
    overflow-wrap: anywhere;
}

.customer-detail-tabs {
    margin-top: var(--space-xl);
    display: flex;
    gap: var(--space-lg);
    border-block-end: var(--rule-thin) solid var(--color-rule);
}

.customer-detail-tabs button {
    min-height: 2.5rem;
    padding: 0 var(--space-xs);
    border: 0;
    border-block-end: .125rem solid transparent;
    border-radius: 0;
    color: var(--color-ink);
    background: transparent;
    font-weight: 700;
}

.customer-detail-tabs button[aria-selected="true"] {
    color: var(--color-success);
    border-block-end-color: var(--color-success);
}

/* Customer detail tabs use the plain reference table style, scoped away from
   transaction detail tabs and contact dialog controls. */
.customer-detail-card .customer-detail-tabs { gap: var(--space-lg); overflow-x: auto; }
.customer-detail-card .customer-detail-tabs button { flex: 0 0 auto; padding-inline: var(--space-sm); white-space: nowrap; font-size: 1rem; color: #000; }
.customer-detail-card .customer-detail-tabs button[aria-selected="true"] { color: #25b864; border-color: #25b864; }
.customer-detail-card > [data-customer-tab-panel] { max-width: 104rem; padding-top: 0; }
.customer-tab-toolbar { display: flex; justify-content: flex-end; align-items: center; min-height: 1.5rem; gap: var(--space-sm); margin: 0; position: relative; }
.customer-contact-actions.customer-tab-toolbar { justify-content: flex-start; }
.customer-contact-actions.customer-tab-toolbar { padding-block: 6px; }
.customer-contact-actions.customer-tab-toolbar > .column-config-control { margin-left: auto; }
.customer-contact-actions.customer-tab-toolbar > button { height: 28px; min-height: 28px; padding: 3px 10px; border: 1px solid #d9dfdf; background: #fff; color: #333; }
.customer-contact-actions.customer-tab-toolbar > [data-contact-add] { border-color: #25b864; color: #168246; background: #f3fbf6; }
.customer-contact-actions.customer-tab-toolbar > [data-contact-delete] { color: #b84040; }
.customer-detail-card > [data-customer-tab-panel="contacts"] > .table-wrap > table th { text-align: center; }
.customer-contact-row-actions { width: 84px !important; min-width: 84px !important; white-space: nowrap; }
.customer-contact-row-actions button { width: 28px; height: 28px; min-height: 28px; padding: 4px; border: 0; background: transparent; color: #168246; }
.customer-contact-row-actions button:hover { background: #e9f5ed; }
[data-contact-directory] > .table-wrap > table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-detail-card > [data-customer-tab-panel] > .table-wrap > .customer-related-documents { width: 52rem; max-width: 100%; min-width: 44rem; table-layout: fixed; }
.customer-related-documents :is(th, td):first-child { width: 42px; min-width: 42px; }
.customer-related-documents td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-detail-card > :is([data-customer-tab-panel="quotations"], [data-customer-tab-panel="orders"]) > :is(.customer-tab-toolbar, .table-wrap) { width: 52rem; max-width: 100%; }
.customer-notes-folder { margin-left: 12px; font-size: var(--text-sm); font-weight: 400; color: var(--color-muted); overflow-wrap: anywhere; }
.customer-detail-card > [data-customer-tab-panel] > .table-wrap { border: 1px solid var(--color-rule); }
.customer-detail-card > [data-customer-tab-panel] > .table-wrap > table { border-collapse: collapse; background: var(--color-reference-white); }
.customer-detail-card > [data-customer-tab-panel] > .table-wrap > table :is(th, td) { border: 1px solid #e6e6e6; padding: .5rem; height: 2.5625rem; text-align: center; font-size: .75rem; color: #000; }
.customer-detail-card > [data-customer-tab-panel] > .table-wrap > table th { height: 2.25rem; background: #f2f2f2; color: #000; font-weight: 400; text-align: center; }
.customer-detail-card > [data-customer-tab-panel] > .table-wrap > table tbody tr { background: var(--color-reference-white); }
.customer-detail-card > [data-customer-tab-panel="followups"] > .table-wrap > table { table-layout: fixed; min-width: 52rem; }
.customer-detail-card > [data-customer-tab-panel="followups"] > .table-wrap > table :is(th, td):first-child { width: 42px; min-width: 42px; }

[data-customer-tab-panel] {
    position: relative;
    padding-top: var(--space-lg);
}

[data-customer-tab-panel][hidden] {
    display: none;
}

[data-customer-tab-panel] table {
    width: 100%;
}

[data-customer-tab-panel] td small {
    margin-top: var(--space-2xs);
    display: block;
    color: var(--color-muted);
}

.customer-add-action {
    margin: 0 0 var(--space-xs) auto;
    width: fit-content;
}

.customer-add-action > summary {
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-sm);
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
    cursor: pointer;
    list-style: none;
}

.customer-inline-form {
    width: min(56rem, calc(100vw - 15rem));
    margin-top: var(--space-xs);
    padding: var(--space-sm);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule-strong);
    background: var(--color-surface);
}

.customer-inline-form textarea {
    min-height: 5rem;
}

.customer-inline-form button {
    align-self: end;
}

.customer-inline-form.contact-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 64rem) {
    .customer-detail-card {
        width: calc(100% - 1rem);
        padding: var(--space-lg);
    }

    .customer-summary-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .customer-progress-track {
        overflow-x: auto;
    }

    .customer-progress-track li {
        min-width: 7rem;
    }
}

@media (min-width: 60rem) {
    .product-workbench,
    .quotation-workbench,
    .sales-order-workbench {
        grid-template-columns: 8.75rem minmax(0, 1fr);
        gap: var(--space-xs);
    }

    .customer-workbench {
        grid-template-columns: 12.5rem minmax(0, 1fr);
        gap: var(--space-xs);
    }

    .workbench-grid.customer-workbench {
        grid-template-columns: 12.5rem minmax(0, 1fr);
    }

    .product-toolbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: var(--space-sm);
    }

    .customer-toolbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .sales-order-toolbar-searches {
        justify-content: flex-start;
    }

    .toolbar-searches {
        justify-content: flex-end;
    }

    .quotation-toolbar {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .quotation-table-panel {
        min-height: calc(100dvh - 6.25rem);
        display: flex;
        flex-direction: column;
    }

    .quotation-workbench .status-rail {
        min-height: calc(100dvh - 6.25rem);
    }

    .quotation-table-wrap {
        flex: 1 1 auto;
    }

    .quotation-toolbar-searches {
        justify-content: flex-start;
    }
}

/* Reference-aligned fixed shell */
.app-body {
    grid-template-rows: var(--topbar-height) auto minmax(0, 1fr);
}

.app-shell {
    min-height: 0;
}

.workspace {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: var(--tabs-height) minmax(0, 1fr);
}

.workspace-tabs {
    min-width: 0;
    height: var(--tabs-height);
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: var(--rule-thin) solid var(--color-rule);
    background: #e5e8e9;
    scrollbar-width: thin;
}

.workspace-system-tab,
.workspace-tab {
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    border-right: var(--rule-thin) solid var(--color-rule);
    color: #35474f;
    background: #eef0f1;
    font-size: var(--text-sm);
    text-decoration: none;
}

.workspace-system-tab {
    gap: var(--space-xs);
    padding-inline: var(--space-sm);
}

.workspace-system-tab > span {
    color: #7096a8;
    font-size: var(--text-lg);
    font-weight: 700;
}

.workspace-tab > a {
    padding-inline: var(--space-md) var(--space-xs);
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.workspace-tab > button {
    width: 1.75rem;
    min-height: 0;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #45565d;
    background: transparent;
    font-size: var(--text-base);
}

.workspace-system-tab.active,
.workspace-tab.active {
    border-bottom: 2px solid var(--color-accent-deep);
    background: var(--color-surface);
}

.workspace-tab > button:hover {
    color: var(--color-danger);
    background: #f5f5f5;
}

.content {
    min-height: 0;
    overflow: auto;
    background: var(--color-surface);
}

@media (min-width: 60rem) {
    .app-body:not(.app-embedded) {
        height: 100dvh;
        overflow: hidden;
        grid-template-rows: var(--topbar-height) minmax(0, 1fr);
    }

    .app-shell {
        min-height: calc(100dvh - var(--topbar-height));
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
        transition: grid-template-columns var(--dur-short) var(--ease-out);
    }

    .sidebar {
        min-height: 0;
        padding: 0;
        grid-template-rows: var(--tabs-height) minmax(0, 1fr);
        gap: 0;
        overflow: hidden;
    }

    .sidebar-home,
    .nav-section summary,
    .nav-section a {
        color: var(--color-sidebar-text);
        text-decoration: none;
    }

    .sidebar-home {
        min-height: var(--tabs-height);
        padding: 0 var(--space-xs);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-xs);
        border-bottom: var(--rule-thin) solid var(--color-rule);
        background: var(--color-surface);
        font-size: var(--text-md);
    }

    .sidebar-home > span,
    .nav-section summary > span,
    .nav-section a > span {
        width: 1.25rem;
        height: 1.25rem;
        padding: 0;
        display: grid;
        flex: 0 0 auto;
        place-items: center;
        border: 0;
        border-radius: 0;
        color: var(--color-accent-deep);
        font-size: var(--text-xs);
    }

    .sidebar-home.active,
    .nav-section a.active {
        color: var(--color-accent-deep);
        background: var(--color-sidebar-2);
        box-shadow: inset var(--space-3xs) 0 var(--color-accent);
    }

    .sidebar-nav {
        display: block;
        overflow-y: auto;
    }

    .nav-section {
        border-bottom: var(--rule-thin) solid var(--color-rule);
    }

    .nav-section[open] { background: var(--color-accent-soft); }

    .nav-section summary {
        min-height: 2.75rem;
        padding: 0 var(--space-xs);
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-xs);
        cursor: pointer;
        font-size: var(--text-md);
        list-style: none;
    }

    .nav-section summary::-webkit-details-marker {
        display: none;
    }



    .nav-section > div {
        padding-bottom: 0;
        background: var(--color-paper-3);
    }

    .nav-section[open] > div { background: transparent; }

    .nav-section a {
        min-height: 2.125rem;
        padding: 0 var(--space-xs) 0 calc(var(--space-xl) + var(--space-md));
        display: flex;
        align-items: center;
        gap: var(--space-xs);
        border-radius: 0;
        font-size: var(--text-base);
    }

    .nav-section a b,
    .nav-section summary b {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-footer {
        margin: 0;
    }

}

@media (min-width: 90rem) {
    :root {
        --sidebar-width: 10rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 150ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 150ms !important;
    }
}

.app-body {
    font-size: var(--text-base);
}

.brand-mark {
    width: 1.5rem;
    height: 1.5rem;
}

.page-heading {
    min-height: 2.5rem;
    padding: var(--space-xs);
    gap: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule);
    background: var(--color-surface);
}

.page-heading h1 {
    font-size: var(--text-lg);
    line-height: 1.25;
    letter-spacing: 0;
}

.page-heading p {
    line-height: 1.4;
}

.full-panel,
.form-panel,
.metric-grid {
    margin-top: var(--space-xs);
}

.workbench,
.panel,
.status-rail,
.metric-grid article {
    border-radius: 0;
    box-shadow: none;
}

.table-toolbar {
    min-height: 3rem;
    padding: var(--space-xs);
}

table {
    font-size: var(--text-sm);
}

th,
td {
    height: 2rem;
    padding: var(--space-2xs) var(--space-xs);
}

th {
    color: var(--color-table-head-ink);
    background: var(--color-table-head);
}

.status-rail {
    padding: var(--space-2xs);
}

.metric-grid article,
.dashboard-lists .panel,
.panel {
    padding: var(--space-xs);
}

@media (min-width: 40rem) {
    .app-topbar {
        padding-inline: 20px;
    }

    .content {
        padding-inline: var(--space-sm);
    }

    .content {
        padding-block: var(--space-xs);
    }
}

@media (min-width: 60rem) {
    .sidebar {
        padding: 0;
        gap: 0;
        border-inline-end: var(--rule-thin) solid var(--color-rule);
    }

    .nav-group {
        margin: var(--space-sm) var(--space-xs) var(--space-2xs);
        color: var(--color-muted);
        letter-spacing: 0;
    }

    .sidebar a {
        border-radius: 0;
    }

    .sidebar a > span {
        width: 1.25rem;
        height: 1.25rem;
        border-color: var(--color-rule-strong);
    }

    .sidebar a.active {
        color: var(--color-accent-deep);
        background: var(--color-sidebar-2);
        box-shadow: inset var(--space-3xs) 0 var(--color-accent);
    }

    .sidebar-footer small {
        color: var(--color-muted);
    }

    .content {
        padding: var(--space-xs) var(--space-sm);
    }

    .workbench-grid {
        grid-template-columns: 8.75rem minmax(0, 1fr);
    }
}

@media (min-width: 90rem) {
    :root {
        --sidebar-width: 10rem;
    }

    .content {
        padding: var(--space-xs) var(--space-sm);
    }
}

@media (pointer: coarse) {
    body:not(.app-body) a,
    body:not(.app-body) button,
    body:not(.app-body) summary,
    body:not(.app-body) input,
    body:not(.app-body) textarea,
    body:not(.app-body) select {
        min-height: 2.75rem;
    }
}

/* All business pages keep the reference system's dense right-side workbench. */
.content .reference-admin-toolbar {
    font-size: var(--text-sm);
    font-weight: 400;
}

.content .reference-admin-table th {
    font-size: var(--text-sm);
    font-weight: 500;
}

.content .reference-admin-table td {
    font-size: var(--text-sm);
    font-weight: 400;
}

.master-data-templates .master-data-table,
.master-data-sales-order-statuses .master-data-table,
.master-data-purchase-order-statuses .master-data-table {
    min-width: 70rem;
}

.master-data-service-providers .master-data-table,
.master-data-settlement-accounts .master-data-table {
    min-width: 88rem;
}

.compact-master-toolbar,
.service-provider-toolbar {
    min-height: 3.5rem;
    padding: .7rem .8rem;
    align-items: center;
}

.master-data-service-providers .master-category-rail {
    width: 9.5rem;
    flex-basis: 9.5rem;
}

.master-data-service-providers .master-data-service-stage .master-data-table,
.master-data-sales-order-statuses .master-data-table,
.master-data-purchase-order-statuses .master-data-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
}

.master-data-service-providers .master-data-table th,
.master-data-service-providers .master-data-table td,
.master-data-sales-order-statuses .master-data-table th,
.master-data-sales-order-statuses .master-data-table td,
.master-data-purchase-order-statuses .master-data-table th,
.master-data-purchase-order-statuses .master-data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.master-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xs);
    white-space: nowrap;
}

.master-row-actions button {
    min-height: 1.5rem;
    padding: var(--space-3xs) var(--space-xs);
    border: 0;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.master-data-workbench {
    min-height: calc(100dvh - 11rem);
    display: flex;
    align-items: stretch;
}

.master-data-table-stage {
    flex: 1 1 auto;
}

.master-category-rail {
    width: 12.5rem;
    flex: 0 0 12.5rem;
    border-right: 1px solid var(--color-border);
    background: #fff;
}

.master-data-service-stage {
    min-width: 0;
    flex: 1 1 auto;
}

.master-category-rail > strong,
.master-category-rail > button {
    width: 100%;
    min-height: 2.4rem;
    padding: var(--space-xs) var(--space-sm);
    display: block;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: #fff;
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 400;
    text-align: left;
}

.master-category-rail > strong,
.master-category-rail > button.active {
    background: var(--color-active-soft);
}

.status-color {
    min-width: 4.5rem;
    padding: var(--space-3xs) var(--space-xs);
    display: inline-block;
    border-radius: var(--radius-sm);
    color: var(--color-accent-ink);
    white-space: nowrap;
}

.status-color-orange { background: var(--color-warning); }
.status-color-cyan { background: var(--color-action-info); }
.status-color-blue { background: var(--color-focus); }
.status-color-green { background: var(--color-success); }
.status-color-teal { background: var(--color-accent-deep); }
.status-color-dark { background: #393d49; }
.status-color-purple { background: #631948; }
.status-color-sky { background: #01aaed; }

.future-module-toolbar {
    min-height: 5rem;
    padding: var(--space-sm);
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-sm);
}

.future-module-actions,
.future-module-filters {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.future-module-filters {
    justify-content: flex-end;
}

.future-module-summaries {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-sm);
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.future-module-filters input {
    width: 120px;
    min-height: var(--content-control-height);
    margin: 0;
    padding: var(--space-2xs) var(--space-xs);
}

.future-module-table {
    min-width: 96rem;
}

.future-module-table th,
.future-module-table td {
    height: 2.5rem;
    padding: var(--space-2xs) var(--space-xs);
}

.future-module-table .empty {
    height: 5rem;
    color: var(--color-muted);
    text-align: center;
}

.future-module-table-stage,
.report-reference-table-stage,
.recycle-reference-table-stage,
.user-reference-table-stage {
    flex: 1 1 auto;
}

.report-reference-toolbar,
.recycle-reference-toolbar {
    flex-wrap: wrap;
}

.report-reference-filters,
.report-reference-actions,
.recycle-reference-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.report-reference-filters {
    flex: 1 1 48rem;
}

.report-reference-filters input,
.recycle-reference-filters input {
    width: 120px;
    margin: 0;
}

.report-reference-table,
.recycle-reference-table,
.user-reference-table {
    min-width: max-content;
}

.report-reference-page .report-date-filter,
.report-reference-page .report-selection-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    font-size: var(--text-sm);
}

.report-reference-page .report-selection-status {
    padding: var(--space-xs) var(--space-sm);
}

.report-reference-page .report-reference-filters select {
    width: auto;
    margin: 0;
}

:is(.report-reference-page, .finance-page) .table-pagination > button {
    color: var(--color-ink);
}

:is(.report-reference-page, .finance-page) .table-pagination > [data-page-jump] {
    color: var(--color-accent-ink);
    background: var(--color-accent-deep);
    border-color: var(--color-accent-deep);
}

:is(.report-reference-page, .finance-page) .table-pagination > button:disabled {
    opacity: .45;
    cursor: default;
}

:is(.report-reference-page, .finance-page) :is(button, a, input, select):focus-visible {
    outline: var(--rule-focus) solid var(--color-focus);
    outline-offset: var(--space-3xs);
}

:is(.report-reference-page, .finance-page) .table-pagination [data-filter-total] {
    min-width: 0;
    min-height: 0;
    display: inline;
    color: inherit;
    background: transparent;
}

.reference-notes-toolbar {
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.reference-notes-toolbar button {
    min-height: var(--content-control-height);
    padding-inline: var(--space-sm);
}

.reference-note-list {
    flex: 1 1 auto;
    padding: var(--space-sm);
    border-top: var(--rule-thin) solid var(--color-rule);
    background: #fff;
}

.work-toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
}

.work-toolbar .toolbar-actions,
.work-toolbar .future-module-filters {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.toolbar-more {
    position: relative;
}

.toolbar-more summary {
    list-style: none;
    cursor: pointer;
}

.toolbar-more summary::-webkit-details-marker {
    display: none;
}

.toolbar-more > div {
    position: absolute;
    inset-block-start: calc(100% + var(--space-3xs));
    inset-inline-end: 0;
    z-index: var(--z-dropdown);
    min-width: 8rem;
    padding: var(--space-2xs);
    display: grid;
    border: var(--rule-thin) solid var(--color-rule-strong);
    background: var(--color-surface);
    box-shadow: 0 .25rem .75rem var(--color-shadow);
}

.toolbar-more > div a {
    padding: var(--space-xs);
    color: var(--color-ink);
    text-decoration: none;
    white-space: nowrap;
}

.toolbar-more > div button {
    min-height: auto;
    padding: var(--space-xs);
    border: 0;
    color: var(--color-ink);
    background: transparent;
    text-align: left;
    white-space: nowrap;
}

.toolbar-more > div button:hover {
    background: var(--color-accent-soft);
}

.toolbar-more > div a:hover {
    background: var(--color-accent-soft);
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--content-control-height);
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.task-state {
    display: inline-block;
    padding: var(--space-3xs) var(--space-xs);
    border-radius: var(--radius-lg);
}

.task-state.pending {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.task-state.complete {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.reference-admin-table .row-actions button {
    min-height: auto;
    padding: 0 var(--space-2xs);
    border: 0;
    color: var(--color-accent-deep);
    background: transparent;
}

.reference-modal {
    width: min(32rem, calc(100vw - 2rem));
    padding: 0;
    border: var(--rule-thin) solid var(--color-rule-strong);
    color: var(--color-ink);
    background: var(--color-surface);
    box-shadow: 0 .5rem 2rem rgb(0 0 0 / 20%);
}

.reference-modal::backdrop {
    background: rgb(0 0 0 / 32%);
}

html.crm-columns-loading :is(table[data-column-config-table], table[data-purchase-order-table], table[data-purchase-direct-table], .app-embedded .content table:not(.column-config-table)) {
    visibility: hidden;
}

.column-config-dialog {
    width: min(60.8125rem, calc(100vw - 2rem));
}

.column-config-control .column-settings {
    width: 2rem;
    padding: 0;
    color: var(--color-accent);
    background: transparent;
    font-size: 1.15rem;
}

.column-config-dialog .reference-modal-body {
    max-height: min(28rem, calc(100dvh - 10rem));
    overflow: auto;
}

.column-config-table input[type="number"] {
    width: 6rem;
}

.column-config-table tbody tr:is(:hover, :focus-within) > td,
.quotation-column-option:is(:hover, :focus-within),
.purchase-order-columns-dialog .purchase-order-dialog-body > label:is(:hover, :focus-within) {
    background: #e8f5f3;
}

.quotation-column-config-dialog {
    display: flex;
    width: min(88rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    flex-direction: column;
    overflow: hidden;
}

.customer-column-config-dialog {
    width: calc(100vw - 2rem);
}

.quotation-column-config-dialog:not([open]) {
    display: none;
}

.quotation-column-config-dialog .reference-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: auto;
}

.quotation-column-config-dialog .column-config-table {
    min-width: 68rem;
}

.quotation-column-config-dialog .column-config-table th,
.quotation-column-config-dialog .column-config-table td {
    white-space: nowrap;
}

.quotation-column-config-dialog .column-config-table .quotation-config-switch {
    position: relative;
    display: inline-flex;
    width: 3rem;
    height: 1.25rem;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--color-rule-strong);
    border-radius: 999px;
    color: var(--color-muted);
    background: #f3f4f5;
    font-size: .75rem;
    cursor: pointer;
}

.quotation-column-config-dialog .quotation-config-switch:has(input:checked) {
    border-color: var(--color-accent);
    color: #fff;
    background: var(--color-accent);
}

.quotation-column-config-dialog .quotation-config-switch::after {
    position: absolute;
    top: 50%;
    left: .15rem;
    width: .75rem;
    height: .75rem;
    border-radius: 50%;
    background: #c8cdd1;
    content: "";
    pointer-events: none;
    transform: translateY(-50%);
}

.quotation-column-config-dialog .quotation-config-switch:has(input:checked)::after {
    right: .15rem;
    left: auto;
    background: #fff;
}

.quotation-column-config-dialog .quotation-config-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.quotation-column-config-dialog .quotation-config-switch input:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.quotation-column-config-dialog .quotation-config-switch:has(input:disabled) {
    opacity: .55;
    cursor: not-allowed;
}

.quotation-column-config-dialog .column-config-table .basic-attribute-type {
    color: #dc3545;
    font-weight: 600;
}

.quotation-column-config-dialog .quotation-config-switch span::before {
    content: attr(data-off);
}

.quotation-column-config-dialog .quotation-config-switch:has(input:checked) span::before {
    content: attr(data-on);
}

.quotation-column-config-dialog .column-config-table [data-column-order] {
    margin-inline: .125rem;
}

.quotation-column-config-dialog .column-config-table [data-column-label] {
    width: 12rem;
    background: #e1ffeb;
}

.quotation-column-config-dialog .quotation-config-notice {
    color: var(--color-danger, #dc3545);
}

.product-column-config-dialog {
    width: calc(100vw - 12px);
    height: calc(100dvh - 16px);
    max-height: none;
}

.product-column-config-dialog .reference-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

.product-column-config-dialog .column-config-table {
    width: 100%;
    min-width: 82rem;
}

.product-column-config-dialog .column-config-table th {
    color: #222;
    background: #f1f1f1;
}

.product-column-config-dialog .column-config-table th,
.product-column-config-dialog .column-config-table td {
    height: 2.5rem;
    border-color: #ddd;
    white-space: nowrap;
}

.product-table[data-column-config-table="products"] {
    min-width: 100%;
}

.compact-modal {
    width: min(16rem, calc(100vw - 2rem));
}
#customer-reminder-dialog, #quotation-reminder-dialog { width: min(32rem, calc(100vw - 2rem)); }
.quotation-reminder-context { overflow-wrap: anywhere; }

.wide-bulk-modal {
    width: min(53.125rem, calc(100vw - 2rem));
}

.product-content-modal {
    width: min(26.5625rem, calc(100vw - 2rem));
}

.bulk-mode-options {
    display: flex;
    gap: var(--space-sm);
    margin: 0;
    padding: 0;
    border: 0;
}

.bulk-mode-options label {
    display: flex;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--space-3xs);
}

.board-modal {
    width: min(50vw, calc(100vw - 2rem));
    height: 50dvh;
    max-height: calc(100dvh - 2rem);
}

.order-progress-board-dialog .reference-modal-body { flex: 1; min-height: 0; overflow: auto; }
.order-progress-board-summary { margin: 0 0 12px; font-size: 14px; }
.order-progress-board-dialog table { min-width: 2200px; }
.shipment-packing-table { min-width: 2200px; }
.shipment-packing-table input { width: 110px; }
.shipment-products-dialog table { min-width: 1900px; }

.board-modal .reference-modal-body {
    max-height: calc(50dvh - 5.5rem);
    overflow: auto;
}

.reference-modal header,
.reference-modal footer {
    min-height: 2.75rem;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
}

.reference-modal header {
    justify-content: space-between;
    border-bottom: var(--rule-thin) solid var(--color-rule);
    font-size: var(--text-base);
}

.reference-modal header button {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: var(--text-lg);
}

.reference-modal footer {
    justify-content: flex-end;
    gap: var(--space-xs);
    border-top: var(--rule-thin) solid var(--color-rule);
}

.reference-modal-body {
    padding: var(--space-md);
    display: grid;
    gap: var(--space-sm);
}

.reference-modal-body label {
    display: grid;
    gap: var(--space-2xs);
    font-size: var(--text-sm);
}

.customer-toolbar [data-column-search-control][hidden],
#customer-advanced-search [data-column-search-control][hidden] {
    display: none !important;
}

.reference-modal-body textarea {
    min-height: 8rem;
}

.reference-modal-body .checkbox-field {
    display: flex;
    align-items: center;
}

.system-query-panel {
    padding: .8rem 1rem;
    display: grid;
    grid-template-columns: repeat(6, minmax(8rem, 1fr));
    gap: .65rem;
    border-bottom: var(--rule-thin) solid var(--color-rule);
}

.system-query-panel[hidden] {
    display: none;
}

.system-query-panel > div {
    grid-column: 1 / -1;
    display: flex;
    gap: .5rem;
}

.master-query-panel {
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

.master-query-panel label {
    min-width: 0;
}



.template-field-group {
    border: 1px solid var(--color-rule);
    margin-block: .4rem;
}

.template-field-group summary {
    cursor: pointer;
    padding: .5rem .75rem;
    font-weight: 600;
}

.template-field-group p {
    padding: 0 .75rem .65rem;
    margin: 0;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.document-excel-dialog {
    width: min(76rem, calc(100vw - 3rem));
    max-width: none;
    max-height: 80dvh;
}

.document-excel-dialog .reference-modal-body {
    display: block;
    max-height: calc(80dvh - 3rem);
    overflow: auto;
}

.document-excel-hint { margin: 0 0 1rem; }
.document-excel-table { width: 100%; }
.document-excel-table :is(th, td) { text-align: center; }
.document-excel-table td form { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.document-excel-table td select { width: 9rem; min-height: 2rem; }

.template-dictionary-dialog header {
    color: #34434a;
    background: #f2f4f5;
    font-weight: 400;
}

.template-dictionary-dialog header button[data-close-dialog] { color: #34434a; }
.template-dictionary-dialog .template-dictionary-body {
    display: block;
    padding: 1.25rem 1rem 2rem;
}




@media (min-width: 48rem) {
    .app-body:has(.ai-launch) .role-permission-footer { padding-right: 140px; }
}

.reference-fullscreen-dialog .reference-modal-body:has(.directory-product-choices) > label {
    align-content: start;
}

.finance-page #finance-advanced-filters:not([hidden]) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}
.finance-page #finance-advanced-filters .finance-date-range {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.finance-page #finance-advanced-filters input[type="date"] {
    width: 140px;
    height: 26px;
    min-height: 26px;
    margin: 0;
    padding: 4px 6px;
}
.shipment-list-table .empty {
    text-align: left;
}
.shipment-empty-message {
    position: sticky;
    left: 16px;
    display: inline-block;
    max-width: calc(100vw - var(--sidebar-width) - 64px);
    white-space: normal;
    padding: 12px 0;
}

.template-dictionary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.template-dictionary-column { min-width: 0; }
.template-dictionary-column h2 {
    margin: 0 0 1.5rem;
    padding: .1rem 0 .35rem;
    border-bottom: 1px solid #e5e9ea;
    color: #009688;
    font-size: 1rem;
    font-weight: 700;
}

.template-dictionary-unavailable {
    margin: -.9rem 0 .55rem;
    color: #77828a;
    font-size: .75rem;
}

.template-dictionary-column .template-field-group {
    margin: 0;
    border: 0;
    border-bottom: 1px solid #e8eaeb;
}

.template-dictionary-column .template-field-group summary {
    padding: .7rem .8rem;
    color: #4d5b60;
    background: #f1f1f1;
    font-size: .8rem;
    font-weight: 400;
}

.template-dictionary-column .template-field-group summary::marker { color: #59666b; }
.template-field-items { display: flex; gap: 10px; padding: .6rem .9rem 1rem; }
.template-field-items-column { flex: 1 1 0; min-width: 0; }
.template-field-items code {
    display: block;
    padding: .3rem 0;
    color: #64747b;
    font-family: inherit;
    font-size: .78rem;
    overflow-wrap: anywhere;
}

.template-field-items p { padding: .25rem 0; color: #859096; font-size: .78rem; }
.template-dictionary-note { margin: 1.25rem 0 0; color: #68777d; font-size: .8rem; }

.content .master-data-page .master-query-panel :is(input[type="search"], select) {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 26px;
    min-height: 26px;
}

@media (max-width: 70rem) {
    .system-query-panel {
        grid-template-columns: repeat(3, minmax(8rem, 1fr));
    }
}

.role-permission-modal {
    width: min(38rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
}

.role-permission-modal > form {
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
}

.role-permission-modal .reference-modal-body {
    min-height: 0;
    overflow-y: auto;
}

.role-permission-grid {
    margin: 0;
    padding: var(--space-xs) var(--space-sm) var(--space-sm);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xs) var(--space-md);
    border: var(--rule-thin) solid var(--color-rule-strong);
}

.role-permission-grid legend {
    padding-inline: var(--space-2xs);
    font-size: var(--text-sm);
}

.reference-modal-body .role-permission-grid label {
    min-height: 1.625rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-xs);
    white-space: nowrap;
}

.role-permission-grid input[type="checkbox"] {
    width: .875rem;
    min-height: .875rem;
    margin: 0;
    padding: 0;
    flex: 0 0 .875rem;
}

.password-inspection-action {
    min-height: auto;
    padding: 0;
    border: 0;
    color: var(--color-warning);
    background: transparent;
}

.availability-mark {
    font-size: var(--text-lg);
    font-weight: 700;
}

.availability-mark.active {
    color: var(--color-success);
}

.availability-mark.inactive {
    color: var(--color-muted);
}

.dictionary-alias-page #dictionary-batch-form {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dictionary-alias-toolbar {
    min-height: 52px;
    padding: 14px 12px 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dictionary-alias-toolbar button,
.dictionary-search-actions :where(button, a) {
    width: 60px;
    min-height: 26px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 3px;
    color: #fff;
    background: #009688;
    font-size: 12px;
    line-height: 18px;
    text-decoration: none;
}

.dictionary-result-count {
    min-width: 80px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    color: #5b686e;
    font-size: 12px;
}
.dictionary-result-count b { color: #f08b19; font-weight: 400; }
.dictionary-alias-toolbar .dictionary-refresh-action {
    width: 32px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #fff;
    background: #009688;
    font-size: 16px;
    text-decoration: none;
}

.dictionary-alias-toolbar .danger-action,
.dictionary-search-actions .danger-action {
    background: #de4545;
}

.dictionary-search-panel {
    min-height: 82px;
    padding: 13px 20px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    border-bottom: 1px solid #e4e9eb;
    background: #fff;
}

.dictionary-search-panel[hidden] { display: none; }

.dictionary-search-panel label {
    width: 250px;
    display: grid;
    gap: 6px;
    color: #3f4c52;
    font-size: 12px;
}

.dictionary-customer-source-search-panel label { width: 362px; flex: 0 0 362px; }
.dictionary-customer-source-search-panel input { height: 26px; }
.dictionary-customer-source-search-panel .query-action { background: #60b879; }
.dictionary-customer-source-search-panel .reset-action { color: #263238; background: #e2e2e2; }

.dictionary-search-panel input {
    width: 100%;
    height: 26px;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid #d7dfe2;
    border-radius: 0;
    font-size: 12px;
}

.dictionary-search-actions {
    display: flex;
    gap: 8px;
}

.dictionary-search-actions .query-action { background: #21b34e; }
.dictionary-search-actions .reset-action { background: #607d8b; }

.dictionary-country-search-panel {
    min-height: 140px;
    padding: 24px 30px 12px;
    display: grid;
    grid-template-columns: repeat(4, 390px);
    align-content: start;
    gap: 28px 54px;
}
.dictionary-country-search-panel label { width: 390px; }
.dictionary-country-search-panel .dictionary-search-actions {
    grid-column: 1 / -1;
    justify-content: center;
}

.dictionary-alias-table-wrap { flex: 1; }
.dictionary-alias-table { min-width: 100%; table-layout: fixed; }
.dictionary-alias-table th { height: 36px; padding: 4px 8px; font-size: 12px; font-weight: 400; }
.dictionary-alias-table td { height: 41px; padding: 5px 8px; font-size: 12px; white-space: nowrap; }
.dictionary-alias-table th:nth-child(1), .dictionary-alias-table td:nth-child(1) { width: 60px; }
.dictionary-alias-table th:nth-child(2), .dictionary-alias-table td:nth-child(2) { width: 54px; }
.dictionary-pagination { margin-top: auto; }

.dictionary-fullscreen-dialog,
.reference-fullscreen-dialog {
    position: fixed;
    z-index: var(--z-modal);
    inset: calc(var(--topbar-height) + var(--tabs-height)) 0 0 var(--sidebar-width);
    width: calc(100vw - var(--sidebar-width));
    max-width: none;
    height: calc(100dvh - var(--topbar-height) - var(--tabs-height));
    max-height: none;
    margin: 0;
    border: 0;
    box-shadow: none;
}

@keyframes crm-secondary-page-enter {
    from { opacity: .82; transform: translate3d(100%, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.dictionary-fullscreen-dialog[open],
.reference-fullscreen-dialog[open] {
    animation: crm-secondary-page-enter 300ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .dictionary-fullscreen-dialog[open],
    .reference-fullscreen-dialog[open] {
        animation: none !important;
    }
}

.dictionary-fullscreen-dialog::backdrop,
.reference-fullscreen-dialog::backdrop { background: transparent; }

.dictionary-fullscreen-dialog > form,
.reference-fullscreen-dialog > form {
    min-height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.dictionary-fullscreen-dialog header,
.reference-fullscreen-dialog header {
    min-height: 44px;
    padding: 4px 24px 4px 12px;
    border: 0;
    color: #fff;
    background: linear-gradient(90deg, #5ea0be, #91a2aa);
    font-size: 12px;
    font-weight: 600;
}
.reference-dialog-title > a[aria-label="关闭"],
.customer-detail-actions > a[aria-label^="关闭"],
.dictionary-fullscreen-dialog header button[data-close-dialog],
.reference-fullscreen-dialog header button[data-close-dialog],
.business-page-layer > button {
    width: 40px;
    height: 36px;
    min-height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 36px;
    line-height: 1;
}
.reference-dialog-title > a[aria-label="关闭"],
.dictionary-fullscreen-dialog header button[data-close-dialog],
.reference-fullscreen-dialog header button[data-close-dialog] { color: #fff; }

.reference-fullscreen-dialog .reference-modal-body {
    min-height: 0;
    padding: 44px 24px 28px;
    flex: 0 0 auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: start;
    gap: 18px 28px;
    overflow: auto;
}

.reference-fullscreen-dialog .reference-modal-body :is(input, select) {
    height: 26px;
    min-height: 26px;
    margin-top: 0;
    padding: 4px 8px;
    border-radius: 0;
}

.reference-fullscreen-dialog .reference-modal-body textarea {
    min-height: 100px;
    margin-top: 0;
    padding: 8px;
    border-radius: 0;
}

.reference-fullscreen-dialog .reference-modal-body > :is(label, fieldset):has(textarea),
.reference-fullscreen-dialog .reference-modal-body > .wide {
    grid-column: 1 / -1;
}

.reference-fullscreen-dialog footer {
    min-height: 54px;
    justify-content: center;
    border-top: 1px solid #edf0f1;
}
.dictionary-dialog-body { width: 2044px; max-width: 100%; padding: 20px; display: grid; gap: 18px; }
.dictionary-dialog-body label { display: grid; gap: 7px; color: #3b4b52; font-size: 12px; }
.dictionary-dialog-body input {
    width: 370px;
    height: 26px;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid #cfd8dc;
    border-radius: 0;
    font-size: 12px;
}
.dictionary-dialog-body textarea {
    width: 100%;
    height: 100px;
    min-height: 100px;
    padding: 8px;
    border: 1px solid #cfd8dc;
    border-radius: 0;
    resize: vertical;
    font-size: 12px;
}
.dictionary-dialog-body .dictionary-submit {
    width: 102px;
    min-height: 32px;
    margin: 0 auto;
    border: 0;
    border-radius: 3px;
    color: #fff;
    background: #009688;
    font-size: 14px;
}

.dictionary-progress-table th:nth-child(3), .dictionary-progress-table td:nth-child(3) { width: 30%; }
.dictionary-progress-table th:nth-child(4), .dictionary-progress-table td:nth-child(4) { width: 30%; }
.dictionary-progress-table th:nth-child(5), .dictionary-progress-table td:nth-child(5) { width: 8.5%; }
.dictionary-progress-table th:nth-child(6), .dictionary-progress-table td:nth-child(6) { width: 28%; }

.dictionary-color-chip {
    min-height: 22px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    color: var(--dictionary-color-ink, #fff);
    background: var(--dictionary-color);
    line-height: 18px;
}
.customer-progress[data-dictionary-color] {
    background: var(--dictionary-color);
    color: var(--dictionary-color-ink);
}

.dictionary-progress-dialog-body {
    width: 100%;
    max-width: none;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    padding: 44px 32px 20px;
}
.dictionary-progress-fields {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1248px;
    gap: 24px;
}
.dictionary-progress-fields label { min-width: 0; gap: 0; }
.dictionary-progress-fields input { width: 100%; }
.dictionary-color-field { display: flex; align-items: center; min-width: 0; gap: 8px; }
.dictionary-color-field input[name="color_code"] { flex: 1 1 auto; min-width: 0; width: 0; }
.dictionary-color-field input[type="color"] {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 3px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}
.dictionary-color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.dictionary-color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 2px; }
.dictionary-progress-dialog-body textarea { width: 2004px; max-width: 100%; }
.dictionary-progress-dialog-body .dictionary-submit { margin-top: 32px; }

.dictionary-country-table th:nth-child(3), .dictionary-country-table td:nth-child(3) { width: 20%; }
.dictionary-country-table th:nth-child(4), .dictionary-country-table td:nth-child(4) { width: 20%; }
.dictionary-country-table th:nth-child(5), .dictionary-country-table td:nth-child(5) { width: 10%; }
.dictionary-country-table th:nth-child(6), .dictionary-country-table td:nth-child(6) { width: 10%; }
.dictionary-country-table th:nth-child(7), .dictionary-country-table td:nth-child(7) { width: 20%; }
.dictionary-country-dialog-body { width: 2198px; padding: 36px 20px 20px; }
.dictionary-country-fields {
    display: grid;
    grid-template-columns: repeat(4, 393px);
    gap: 53px;
}
.dictionary-country-fields label { min-width: 0; gap: 7px; }
.dictionary-country-fields input { width: 393px; }
.dictionary-country-dialog-body textarea { width: 2138px; max-width: 100%; }
.dictionary-country-dialog-body .dictionary-submit { margin-top: 34px; }
.dictionary-unit-fields { display: grid; grid-template-columns: 370px 370px; gap: 0 50px; }
.dictionary-unit-dialog-body .dictionary-submit { margin-top: 16px; }

.account-message {
    margin: 0;
    padding: 8px 20px;
    border-bottom: 1px solid var(--color-rule);
    font-size: var(--text-sm);
}

.account-message-success { color: #087f68; background: #edfbf7; }
.password-input { position: relative; display: block; }
.password-input > input { width: 100%; padding-right: 2rem; }
.password-toggle { position: absolute; top: 50%; right: .25rem; display: grid; place-items: center; width: 1.75rem; min-height: 1.5rem; padding: 0; transform: translateY(-50%); border: 0; color: var(--color-muted); background: transparent; cursor: pointer; }



.password-toggle:hover, .password-toggle:focus-visible { color: var(--color-accent-deep); background: transparent; }
.password-toggle, .password-toggle:active { transform: translateY(-50%); transition: none; }
.password-inspection-action:active, button[data-close-dialog]:active, button[data-close-global-info]:active { transform: none; }
.auth-card .auth-field .password-input > input[aria-invalid="true"] { border-color: var(--color-danger); }
.auth-password-error { display: block; margin-top: .375rem; color: var(--color-danger); font-weight: 400; }
.auth-card .password-input:has(input[aria-invalid="true"]) { animation: password-error-shake .24s ease-in-out 2; }
@keyframes password-error-shake { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .auth-card .password-input { animation: none !important; } }
.success-toast {
    position: fixed;
    top: calc(var(--topbar-height) + var(--space-md));
    left: 50%;
    width: max-content;
    max-width: min(28rem, calc(100vw - 2rem));
    z-index: 1000;
    margin: 0 !important;
    padding: var(--space-sm) var(--space-lg);
    transform: translateX(-50%);
    border: var(--rule-thin) solid var(--color-success);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 4px 16px var(--color-shadow);
}
.account-modal { width: min(560px, calc(100vw - 32px)); }
.account-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-password-grid { grid-template-columns: 1fr; }
.account-profile-grid .form-error,
.account-password-grid .form-error { grid-column: 1 / -1; }
.account-avatar-field {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    text-align: center;
}
.account-avatar-heading { color: var(--color-ink-2); font-weight: 600; }
.account-avatar-options-dialog { justify-content: center; align-items: center; gap: .5rem; margin: 0; }
.account-avatar-options-dialog label { width: 3rem; height: 3rem; display: block; }
.account-avatar-options-dialog img { width: 3rem; height: 3rem; }
.account-avatar-preview,
.account-avatar-preview-empty { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--color-rule); border-radius: 50%; object-fit: cover; background: var(--color-paper-2); }
.account-avatar-upload { width: 100%; display: grid; gap: .35rem; text-align: left; }
.account-avatar-upload input { width: 100%; }

.account-center-page { min-height: 100%; background: var(--color-surface); }
.account-onboarding-alert { margin: 1rem 1.5rem 0; }
.account-center-form { display: grid; gap: 1rem; padding: 1.25rem 1.5rem 2rem; max-width: 70rem; }
.account-center-card { padding: 1.25rem; border: 1px solid var(--color-rule); background: var(--color-paper); }
.account-center-card h2 { margin: 0 0 1rem; font-size: 1rem; color: var(--color-ink); }
.account-center-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.account-center-grid label, .account-center-card > label { display: grid; gap: .4rem; color: var(--color-muted); }
.account-center-grid input, .account-center-card > label input { width: 100%; }
.account-avatar-options { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.account-avatar-options label { position: relative; cursor: pointer; }
.account-avatar-options label.is-unavailable { cursor: not-allowed; opacity: .48; }
.account-avatar-options input { position: absolute; opacity: 0; }
.account-avatar-options img { width: 3.5rem; height: 3.5rem; display: block; border-radius: 50%; border: 3px solid transparent; }
.account-avatar-options .avatar-used-badge { position: absolute; right: -.25rem; bottom: -.2rem; padding: .1rem .25rem; border-radius: .25rem; background: #52616b; color: #fff; font-size: .6rem; white-space: nowrap; }
.account-avatar-options input:checked + img { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent-soft); }
.account-avatar-options input:focus-visible + img { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.account-signature-row { display: flex; align-items: center; gap: 1.5rem; }
.account-signature-preview, .account-signature-empty { width: 16rem; height: 5rem; max-width: 100%; display: grid; place-items: center; border: 1px solid var(--color-rule); background: var(--color-paper-2); }
.account-signature-row [hidden] { display: none; }
.account-signature-preview { object-fit: contain; }
.account-signature-empty { color: var(--color-muted); }
.account-signature-row label { display: grid; gap: .4rem; color: var(--color-muted); }
.account-signature-row input { max-width: 22rem; }
.account-center-actions { display: flex; justify-content: center; padding: .5rem; }
.account-center-actions button { min-width: 10rem; }
@media (max-width: 700px) { .account-center-grid { grid-template-columns: 1fr; } .account-center-form { padding-inline: .75rem; } }

.work-page .work-toolbar button {
    min-height: 26px;
    height: 26px;
    padding: 4px;
}

.work-page .reference-admin-table th { height: 36px; padding-block: 4px; font-weight: 400; }
.work-page .reference-admin-table td { white-space: nowrap; }

.task-filter-panel {
    padding: 16px 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(12rem, 1fr)) auto auto auto;
    gap: 16px;
    border-bottom: 1px solid var(--color-rule);
    background: var(--color-surface);
}

.task-filter-panel[hidden] { display: none; }
.task-state-是 { color: #009688; }
.task-state-进行中 { color: #ff9800; }
.task-state-否 { color: #e53935; }

.modal-link-list a {
    padding: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule);
    color: var(--color-ink);
    text-decoration: none;
}

.note-card {
    margin-bottom: var(--space-sm);
    border: var(--rule-thin) solid var(--color-rule);
    background: var(--color-surface);
}

.note-card > header,
.note-card > footer {
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: var(--rule-thin) solid var(--color-rule);
}

.note-card > header span {
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.note-card > p {
    min-height: 4rem;
    margin: 0;
    padding: var(--space-md);
    white-space: normal;
}

.note-card > footer {
    justify-content: flex-end;
    gap: var(--space-xs);
    border-top: var(--rule-thin) solid var(--color-rule);
    border-bottom: 0;
}

.note-card > footer form {
    margin: 0;
}

.sr-only {
    width: 1px;
    height: 1px;
    padding: 0;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.reference-notes-toolbar { padding: 12px 20px; }

.reference-notes-toolbar .note-create-action {
    min-height: 28px;
    height: 28px;
    padding: 4px 12px;
    border: 0;
    border-radius: 2px;
    color: #fff;
    background: #5fb878;
    font-size: 12px;
    font-weight: 400;
}

.reference-notes-page .reference-note-list {
    padding: 0 20px 20px;
    display: grid;
    gap: 15px;
    border-top: 0;
    background: transparent;
}

.reference-notes-page .note-card {
    min-height: 78px;
    margin: 0;
    border: 0;
    border-radius: 6px;
    box-shadow: rgb(0 0 0 / 5%) 0 1px 2px;
}

.reference-notes-page .note-card > header {
    height: 32px;
    padding: 0 14px;
    border-bottom: 0;
    color: #5b9dbd;
    font-size: 12px;
    line-height: 32px;
}

.reference-notes-page .note-card > header > span { display: flex; align-items: center; gap: 8px; color: #5b9dbd; }
.reference-notes-page .note-card > header form { margin: 0; }
.note-lock { margin-inline-end: 4px; color: #5fb878; }
.note-lock-private { color: #ff9800; }

.reference-notes-page .note-card-delete {
    min-height: auto;
    padding: 0;
    border: 0;
    color: #ff5722;
    background: transparent;
    font-size: 13px;
}

.reference-notes-page .note-card-body {
    width: 100%;
    min-height: 46px;
    padding: 8px 14px;
    display: block;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid #ccc;
    border-radius: 0 0 6px 6px;
    color: var(--color-ink);
    background: #fff;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
}

.note-visibility { display: flex; gap: 18px; border: 0; }
.note-visibility label { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.note-editor-dialog { width: min(46.5rem, calc(100vw - 2rem)); }
.note-editor-dialog textarea { min-height: 15rem; }
.note-view-dialog .reference-modal-body p { white-space: pre-wrap; }

.password-info-dialog { width: min(18rem, calc(100vw - 2rem)); }

@media (max-width: 40rem) {
    .role-permission-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.organization-node {
    width: 15rem;
    min-height: 9rem;
    padding: 1.2rem;
    display: grid;
    place-items: center;
    gap: var(--space-xs);
    border: var(--rule-thin) solid var(--color-rule);
    background: #f5fff6;
    text-align: center;
}

.organization-node-sales {
    background: #fffaf0;
}

.organization-node span,
.organization-node small {
    color: var(--color-muted);
}

.organization-link {
    width: 5rem;
    height: var(--rule-thin);
    background: var(--color-rule-strong);
}

.user-reference-table td {
    height: 3.75rem;
}

.user-avatar-image,
.user-avatar-placeholder {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-block;
    border-radius: var(--radius-lg);
    object-fit: cover;
    vertical-align: middle;
}

.user-avatar-placeholder {
    background: var(--color-accent-soft);
}

.password-reveal-value {
    display: inline-block;
    margin-right: .35rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .04em;
}

.password-inspection-note {
    color: var(--color-muted);
    white-space: nowrap;
}

.password-copy-action {
    min-height: 24px;
    padding: 2px 7px;
    border: 1px solid var(--color-border);
    color: var(--color-accent-ink);
    background: var(--color-surface);
    cursor: pointer;
}

.password-copy-action:hover,
.password-copy-action:focus-visible {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

/* Dedicated user editor mirrors the reference system's full-page add flow. */
.reference-user-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem 1.75rem;
    padding: 2.25rem 1.5rem;
}

.reference-user-form > label:not(.user-avatar-upload) {
    display: grid;
    gap: .4rem;
}

.reference-user-form input,
.reference-user-form select,
.reference-user-form textarea {
    width: 100%;
}

.user-avatar-upload {
    grid-column: 1 / -1;
    width: 5rem;
    margin: 0 auto .5rem;
    display: grid;
    justify-items: center;
    gap: .6rem;
    cursor: pointer;
}

.user-avatar-upload > span {
    padding: .45rem .75rem;
    border-radius: .2rem;
    color: #fff;
    background: var(--color-table-head);
    white-space: nowrap;
}

.user-avatar-upload > i {
    width: 4.75rem;
    height: 4.75rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.user-avatar-upload > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.reference-user-form .user-remark {
    grid-column: 1 / -1;
}

.reference-user-form .user-remark textarea {
    min-height: 6rem;
    resize: vertical;
}

.reference-user-form .user-submit {
    display: flex;
    justify-content: center;
}

.reference-user-form .user-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .75rem;
}

.reference-user-form .user-copy-button {
    height: 28px;
    min-height: 28px;
    padding: 4px 12px;
}

.reference-user-form .user-submit button {
    width: auto;
    min-width: 0;
    height: 28px;
    min-height: 28px;
    padding: 4px 12px;
}

/* Organization and role editors follow the reference system's full-page forms. */
.organization-reference-toolbar {
    padding: 1rem 2rem;
}

.organization-tree-name {
    display: inline-block;
    padding-left: calc(var(--organization-depth) * 1.25rem);
    white-space: nowrap;
}

.organization-row-actions {
    white-space: nowrap;
}

.organization-row-actions form {
    display: inline;
}

.organization-row-actions a,
.organization-row-actions button {
    border: 0;
    padding: 0 .25rem;
    color: var(--color-text);
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.reference-organization-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem 2rem;
    padding: 2.5rem 1.5rem;
}

.reference-organization-form > label,
.reference-role-form > label {
    display: grid;
    gap: .45rem;
}

.reference-organization-form input,
.reference-organization-form select,
.reference-organization-form textarea,
.reference-role-form input,
.reference-role-form textarea {
    width: 100%;
}

.product-toolbar .product-search > .product-identifier-autocomplete {
    position: relative;
    flex: 0 0 180px;
    width: 180px;
    min-width: 180px;
}

.product-toolbar .product-identifier-autocomplete > input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: none;
    height: 26px;
    min-height: 26px;
    margin: 0;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 12px;
}

.product-identifier-suggestions {
    position: absolute;
    z-index: 10;
    inset-block-start: calc(100% + 3px);
    inset-inline-start: 0;
    width: max(16rem, 100%);
    max-height: 14rem;
    overflow: auto;
    border: 1px solid var(--color-rule);
    background: var(--color-paper);
    box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
}

.product-identifier-suggestions[hidden] { display: none; }

.product-identifier-suggestion {
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 0 var(--space-sm);
    cursor: pointer;
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.product-identifier-suggestion + .product-identifier-suggestion {
    border-top: 1px solid var(--color-rule);
}

.product-identifier-suggestion:hover,
.product-identifier-suggestion[aria-selected="true"] {
    background: var(--color-paper-2);
}

.product-identifier-suggestion small {
    min-width: 0;
    margin-inline-start: auto;
    overflow: hidden;
    color: var(--color-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-identifier-suggestion > span { flex-shrink: 0; white-space: nowrap; }

.reference-organization-form .organization-remark,
.reference-organization-form .organization-submit {
    grid-column: 1 / -1;
}

.reference-organization-form .organization-remark textarea,
.reference-role-form .role-remark textarea {
    min-height: 6.25rem;
    resize: vertical;
}

.reference-organization-form .organization-submit,
.reference-role-form .role-submit {
    display: flex;
    justify-content: center;
}

.reference-role-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem 2rem;
    padding: 2.5rem 1.5rem;
}

.reference-role-form .role-remark,
.reference-role-form .role-submit {
    grid-column: 1 / -1;
}

.reference-user-form > label:not(.user-avatar-upload) :is(input, select),
.reference-organization-form > label :is(input, select),
.reference-role-form > label input {
    height: 26px;
    min-height: 26px;
    margin-top: 0;
    padding: 4px 8px;
    border-radius: 0;
}

.reference-user-form > label:not(.user-avatar-upload) :is(input, select),
.reference-user-form > label:not(.user-avatar-upload) .password-input {
    max-width: 18rem;
}

.reference-user-form textarea,
.reference-organization-form textarea,
.reference-role-form textarea {
    margin-top: 0;
    padding: 8px;
    border-radius: 0;
}

@media (max-width: 1100px) {
    .reference-user-form,
    .reference-organization-form,
    .reference-role-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .reference-user-form,
    .reference-organization-form,
    .reference-role-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 70rem) {
    .future-module-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .future-module-filters {
        justify-content: flex-start;
    }
}

@media (min-width: 60rem) {
    .customer-public-toolbar {
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .customer-public-toolbar .toolbar-searches {
        justify-content: flex-start;
    }
}

/* Product parity final cascade lock. */
.product-workbench { grid-template-columns: 200px minmax(0, 1fr); gap: 6px; }
.product-type-rail { padding: 10px; gap: 0; }
.product-toolbar { min-height: 92px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 16px; }
.product-toolbar .product-search { justify-content: flex-start; }
.product-toolbar .result-count { min-width: 98px; font-size: 14px; }
.product-table { min-width: 2760px; }
.product-table tr.product-pending-review > td { background: #fff2cc; }
.product-table .pending-product-label { color: #8a5a00; font-size: 11px; font-weight: 600; }
.product-table .pending-product-confirm { min-width: 0; padding: 2px 3px; border: 0; background: transparent; color: #8a5a00; font-size: 11px; cursor: pointer; }
.product-table .pending-product-confirm:hover { text-decoration: underline; }
.product-table th { height: 36px; padding: 0 10px; }
.product-table td { height: 46px; padding: 4px 10px; }
.product-reference-form {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-xl);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px 18px;
}
.product-reference-form > label:not(.product-upload) { gap: 6px; font-size: 13px; line-height: 1.45; font-weight: 400; }
.product-reference-form input:not([type="hidden"]):not([type="file"]),
.product-reference-form select,
.product-reference-form textarea { width: 50%; height: 26px; min-height: 26px; padding: 0 10px; font-size: 13px; line-height: 1.4; }
.product-upload { grid-column: 1 / -1; justify-self: center; width: 84px; min-height: 106px; gap: 6px; }
.product-upload > span { width: 84px; height: 32px; padding: 0; }
.product-upload img,
.product-upload i { width: 84px; height: 84px; }
.product-reference-fields,
.product-additional-fields { grid-column: 1 / -1; }
.product-reference-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
}
.product-reference-row { --entry-columns: 5; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-xs) var(--space-xl); }
.product-reference-form .product-reference-fields label,
.product-reference-form .product-additional-fields label,
.product-reference-form .product-reference-row label { display: grid; min-width: 0; gap: var(--space-xs); font-size: var(--text-sm); line-height: 1.45; font-weight: 400; }
.product-reference-form .product-reference-fields input:not([type="hidden"]),
.product-reference-form .product-reference-fields select,
.product-reference-form .product-additional-fields input:not([type="hidden"]),
.product-reference-form .product-additional-fields select { width: 100%; height: var(--control-height); min-height: var(--control-height); padding: var(--space-2xs) var(--space-xs); font-size: var(--text-sm); }
.product-additional-fields {
    --entry-columns: 5;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-sm) var(--space-xl);
}
.product-additional-fields h2,
.product-reference-form > h2 { grid-column: 1 / -1; margin: 0; font-size: 15px; line-height: 1.45; font-weight: 500; }
.product-detail,
.multi-spec-section { grid-column: 1 / -1; }
.product-reference-form .product-detail textarea { width: 100%; height: auto; min-height: 420px; padding: 12px; font-size: 13px; line-height: 1.5; }
.product-folder { grid-column: span 3; }
.product-submit { grid-column: 1 / -1; padding-top: 22px; }
.product-submit button { width: 102px; height: 32px; min-height: 32px; }
.product-column-options { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px 18px; }
.product-column-options label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.product-column-options input { width: 16px; height: 16px; }

.directory-product-choices {
    grid-column: 1 / -1;
    max-height: 290px;
    margin: 2px 0 0;
    padding: 8px 10px 10px;
    overflow: auto;
    display: block;
    border: 1px solid var(--color-rule);
}

.directory-product-choices legend { padding: 0 4px; color: var(--color-muted); }
.directory-product-choices .table-wrap { max-height: 250px; overflow: auto; }
.directory-product-term-table { min-width: 980px; border-collapse: collapse; }
.directory-product-term-table th, .directory-product-term-table td { padding: 4px 6px; border: 1px solid var(--color-rule); white-space: nowrap; }
.directory-product-term-table th { background: var(--color-table-header); color: #fff; font-weight: 400; }
.directory-product-term-table input:not([type="checkbox"]) { width: 120px; min-width: 90px; height: 25px; }
.directory-product-term-table input[type="checkbox"] { width: 14px; height: 14px; min-height: 14px; }
.directory-relation-panel { margin: 12px 10px; border: 1px solid var(--color-rule); background: #fff; }
.directory-relation-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; color: #fff; background: var(--color-table-header); }
.directory-relation-panel h2 { margin: 0; font-size: 14px; font-weight: 400; }
.directory-relation-panel > .table-wrap { max-height: 360px; }

.shipment-create-panel { margin: 8px 10px; border: 1px solid var(--color-rule); background: #fff; }
.shipment-create-panel > summary { padding: 8px 12px; color: #fff; background: var(--color-table-header); cursor: pointer; }
.shipment-create-form { padding: 12px; display: grid; gap: 12px; }
.shipment-item-grid { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(90px, 1fr)); align-items: center; gap: 6px 12px; }
.shipment-field-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 8px 12px; }
.shipment-field-grid label { display: grid; gap: 4px; }
.shipment-field-grid input { height: 26px; }
.shipment-field-grid .wide-field { grid-column: 1 / -1; }
.shipment-create-form input:not([type="hidden"]),
.shipment-create-form select,
.shipment-create-form textarea { width: 50%; min-width: 0; }
.shipment-create-form .shipment-field-grid { grid-template-columns: repeat(5, minmax(0, calc((100% - 48px) / 10))); column-gap: calc((100% - 48px) / 30 + 4px); }
.shipment-create-form .shipment-field-grid input,
.shipment-create-form .shipment-field-grid select { width: 100%; }
.shipment-detail-records { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.shipment-detail-records > section { min-width: 0; }
.shipment-detail-records h2 { margin-top: 0; }
.shipment-detail-products { min-width: 90rem; }
.shipment-detail-products tr > :first-child,
.shipment-packing-table tr > :first-child { box-sizing: border-box; width: 40px; min-width: 40px; max-width: 40px; padding-inline: 4px; }
.shipment-detail-header { position: relative; }
.shipment-detail-sidebar { position: absolute; top: 12px; bottom: 12px; left: calc((100% - 24px) * .633333 + 24px); width: 160px; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.shipment-detail-documents, .shipment-detail-notes { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; min-height: 0; min-width: 0; }
.shipment-detail-documents h2 { margin: 0; }
.shipment-detail-documents .toolbar-actions { display: grid; align-content: start; overflow: auto; overflow-wrap: anywhere; }
.shipment-detail-header .shipment-detail-notes textarea { box-sizing: border-box; width: 100%; height: 100%; min-height: 0; resize: none; overflow: auto; }
[data-shipment-logistics-rows] { display: grid; gap: 12px; }
[data-shipment-logistics-row] select,
[data-shipment-logistics-row] input { box-sizing: border-box; height: 40px; min-height: 0; }
.shipment-courier-control { display: flex; align-items: center; gap: 6px; }
.shipment-courier-control input { flex: 0 0 100%; }
.shipment-courier-control button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 40px; min-height: 0; padding: 0; flex-shrink: 0; border: 0; background: transparent; color: var(--color-accent-deep); box-shadow: none; cursor: pointer; }
.shipment-courier-control button:hover { background: transparent; box-shadow: none; }
.shipment-courier-control button[hidden] { display: none; }

/* System updater: compact, admin-only release workbench. */
.system-update-page { display: grid; gap: 1rem; }
.system-update-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; }
.system-update-panel { background: #fff; border: 1px solid var(--color-border, #d8dee4); padding: 1rem; }
.system-update-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.system-update-panel h2 { margin: 0 0 .25rem; font-size: 1rem; }
.system-update-panel p { margin: 0; }
.system-update-form { display: grid; gap: .75rem; }
.system-update-form label { display: grid; gap: .35rem; }
.system-update-form input[type="file"], .system-update-form input[type="password"] { width: 100%; }
.system-update-form > button { justify-self: start; }
.system-update-form .form-help { color: var(--color-text-muted, #667085); line-height: 1.6; }
.system-update-preflight dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; }
.system-update-preflight dl div { background: #f7f9fa; padding: .65rem; }
.system-update-preflight dt { color: var(--color-text-muted, #667085); }
.system-update-preflight dd { margin: .25rem 0 0; font-weight: 700; }
.system-update-rollback-form { display: flex; gap: .4rem; align-items: center; }
.system-update-rollback-form input { width: 8rem; }
@media (max-width: 760px) { .system-update-preflight dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .system-update-rollback-form { align-items: stretch; flex-direction: column; } }

/* Role permissions: one source-backed matrix instead of per-role popup checklists. */
.role-permission-page { height: calc(100dvh - var(--topbar-height) - var(--tabs-height) - 1rem); min-height: 30rem; overflow: hidden; }
.role-permission-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--color-rule); }
.role-permission-heading h1 { margin: 0 0 3px; font-size: 16px; }
.role-permission-heading p { margin: 0; color: var(--color-muted); }
.role-permission-form { min-height: 0; display: flex; flex: 1; flex-direction: column; padding-top: 36px; overflow: hidden; }
.role-permission-table-wrap { min-height: 0; flex: 1; overflow: auto; }
.role-permission-table { min-width: 1120px; }
.role-permission-table thead th { position: sticky; top: 0; z-index: 2; }
.role-permission-table thead { position: sticky; top: 0; z-index: 3; background: var(--color-table-head); }
.role-permission-table tbody th { position: static; z-index: auto; }
.role-permission-table > tbody[data-permission-section] > tr > :is(th, td) { background: #fff; }
.role-permission-table > tbody[data-permission-section]:nth-of-type(even) > tr > :is(th, td) { background: #f3f7f8; }
.role-permission-table > tbody[data-permission-section] + tbody > tr:first-child > :is(th, td) { border-top: 2px solid var(--color-rule); }
.role-permission-table th[scope="rowgroup"] { width: 160px; color: var(--color-ink); text-align: left; vertical-align: middle; background: #f8fafb; }
.role-permission-table th[scope="row"] { width: 250px; color: var(--color-ink); text-align: left; font-weight: 500; background: #fff; }
.role-permission-selector { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.role-permission-selector input { width: 14px; height: 14px; min-height: 14px; }
.role-action-options { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; min-height: 28px; }
.role-action-options label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.role-action-options input { width: 14px; height: 14px; min-height: 14px; }
.role-action-options .data-scope-option { color: #d33b32; }
.role-permission-footer { display: flex; justify-content: flex-end; padding: 12px 18px; background: #fff; border-top: 1px solid var(--color-rule); }

.column-config-control { display: inline-flex; }
.column-config-control > dialog { text-align: left; }
.column-config-options { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px 18px; }
.column-config-options label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.column-config-options input { width: 16px; height: 16px; min-height: 16px; }
@media (max-width: 760px) { .column-config-options { grid-template-columns: repeat(2, minmax(130px, 1fr)); } }

/* Keep every reference toolbar compact like the reference system. */
.content :is(
    .toolbar-searches,
    .reference-admin-toolbar,
    .future-module-filters,
    .report-reference-filters,
    .recycle-reference-filters,
    .dictionary-alias-toolbar,
    .dictionary-search-actions,
    .reference-advanced-filters
) > :is(input[type="search"], select) {
    box-sizing: border-box;
    height: 26px;
    min-height: 26px;
    margin: 0;
}

.content .task-filter-panel > :is(input:not([type="hidden"]), select) {
    box-sizing: border-box;
    height: 26px;
    min-height: 26px;
    margin: 0;
}

.content input[type="search"] {
    width: 120px;
    max-width: 120px;
    height: 26px;
    min-height: 26px;
    box-sizing: border-box;
}

.content .reference-admin-toolbar > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.content .result-count {
    flex: 0 0 auto;
    white-space: nowrap;
}

.content .reference-admin-toolbar input[type="search"] {
    width: 120px;
    max-width: 120px;
    height: 26px;
    min-height: 26px;
    flex: 0 0 120px;
    margin: 0;
}

.content .toolbar-searches {
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.content .toolbar-searches > input[type="search"] {
    width: 120px;
    max-width: 120px;
    height: 26px;
    min-height: 26px;
    flex: 0 0 120px;
}

.content .system-query-panel input[type="search"] {
    width: 120px;
    max-width: 120px;
    height: 26px;
    min-height: 26px;
}

.content :is(
    .reference-admin-toolbar,
    .toolbar-actions,
    .toolbar-searches,
    .future-module-actions,
    .future-module-filters,
    .report-reference-filters,
    .recycle-reference-filters,
    .dictionary-alias-toolbar,
    .dictionary-search-actions,
    .duplicate-actions,
    .reference-notes-toolbar,
    .organization-reference-toolbar,
    .report-reference-actions,
    .system-query-panel > div,
    .product-search,
    .task-filter-panel
) > :is(button, a, summary, input[type="button"], input[type="submit"]) {
    box-sizing: border-box;
    height: 26px;
    min-height: 26px;
}

.content :is(
    .reference-admin-toolbar,
    .toolbar-actions,
    .toolbar-searches,
    .quotation-toolbar-secondary,
    .future-module-actions,
    .future-module-filters,
    .report-reference-filters,
    .recycle-reference-filters,
    .dictionary-alias-toolbar,
    .dictionary-search-actions,
    .report-reference-actions,
    .reference-notes-toolbar,
    .task-filter-panel
) > :is(.primary-action, .query-action, .reset-action, .danger-action, .info-action, .more-action) {
    min-width: 60px;
}

.content :is(.toolbar-actions, .reference-admin-toolbar, .future-module-actions, .dictionary-alias-toolbar) > :is(.refresh-action, .dictionary-refresh-action) {
    width: 32px;
    min-width: 32px;
    padding-inline: 0;
}

.content .toolbar-more > summary {
    min-width: 60px;
    height: 26px;
    min-height: 26px;
}

.content :is(
    .column-config-control > .column-settings,
    .customer-type-heading > :is(button, a),
    .product-type-rail h2 > [data-product-type-settings],
    .pending-shipment-settings,
    .pending-purchase-settings,
    .quotation-settings
) {
    box-sizing: border-box;
    width: 32px;
    min-width: 32px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
}

.content .settings-glyph {
    margin-inline-end: 4px;
    font-size: 18px;
    line-height: 1;
}

@media (pointer: coarse) {
    .content :is(
        .column-config-control > .column-settings,
        .customer-type-heading > :is(button, a),
        .product-type-rail h2 > [data-product-type-settings],
        .pending-shipment-settings,
        .quotation-settings
    ) {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .content :is(
        .toolbar-searches,
        .reference-admin-toolbar,
        .future-module-filters,
        .report-reference-filters,
        .recycle-reference-filters,
        .dictionary-alias-toolbar,
        .dictionary-search-actions,
        .reference-advanced-filters
    ) > :is(input[type="search"], select),
    .content .task-filter-panel > :is(input:not([type="hidden"]), select),
    .content .toolbar-more > summary {
        height: auto;
        min-height: 2.75rem;
    }

    .content :is(
        .reference-admin-toolbar,
        .toolbar-actions,
        .toolbar-searches,
        .future-module-actions,
        .future-module-filters,
        .report-reference-filters,
        .recycle-reference-filters,
        .dictionary-alias-toolbar,
        .dictionary-search-actions,
        .duplicate-actions,
        .reference-notes-toolbar,
        .organization-reference-toolbar,
        .report-reference-actions,
        .system-query-panel > div,
        .product-search,
        .task-filter-panel
    ) > :is(button, a, summary, input[type="button"], input[type="submit"]) {
        height: auto;
        min-height: 2.75rem;
    }
}

/* List tables share the customer list's centered grid. */
.content .table-wrap > table :is(th, td) {
    border-right: 1px solid #e7eaed;
    border-bottom-color: #e7eaed;
    text-align: center;
}

.content .table-wrap > table .row-actions {
    justify-content: center;
}

/* Match the reference density and left-aligned filters on the pending purchase list. */
.pending-purchase-toolbar {
    min-height: 3rem;
    gap: var(--space-md);
    justify-content: flex-start;
}

.pending-purchase-toolbar .toolbar-actions {
    flex: 0 0 auto;
}

.pending-purchase-searches {
    min-width: 0;
    max-width: 100%;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.pending-purchase-searches input,
.pending-purchase-searches select {
    width: 7.5rem;
    min-width: 7.5rem;
    flex: 0 0 7.5rem;
}

.pending-purchase-searches button {
    min-width: 3.75rem;
    flex: 0 0 auto;
}

.pending-purchase-toolbar .column-config-control {
    flex: 0 0 auto;
    margin-inline-start: auto;
}

.pending-purchase-toolbar .result-count strong {
    color: #ff7000;
}

.pending-purchase-table {
    min-width: 85rem;
    table-layout: fixed;
}

.pending-purchase-table :is(th, td):first-child { width: 1.7%; }
.pending-purchase-table :is(th, td)[data-column-key="order_no"] { width: 4.5%; }
.pending-purchase-table :is(th, td)[data-column-key="purchase_state"] { width: 4%; }
.pending-purchase-table :is(th, td)[data-column-key="total_quantity"] { width: 4%; }
.pending-purchase-table :is(th, td)[data-column-key="purchased_quantity"] { width: 4.5%; }
.pending-purchase-table :is(th, td)[data-column-key="remaining_quantity"] { width: 4.5%; }
.pending-purchase-table :is(th, td)[data-column-key="order_status"],
.pending-purchase-table :is(th, td)[data-column-key="receipt_status"],
.pending-purchase-table :is(th, td)[data-column-key="order_date"],
.pending-purchase-table :is(th, td)[data-column-key="delivery_date"],
.pending-purchase-table :is(th, td)[data-column-key="created_by"],
.pending-purchase-table :is(th, td):last-child { width: 12.8%; }

.pending-purchase-table th,
.pending-purchase-table td {
    overflow: hidden;
    padding-inline: var(--space-xs);
    text-overflow: ellipsis;
}

.pending-purchase-table th {
    height: 2.125rem;
}

.pending-purchase-table td {
    height: 2.4375rem;
}

.pending-purchase-table th {
    color: var(--color-table-head-ink);
    background: var(--color-table-head);
}

.content .table-wrap > .pending-purchase-table :is(th, td) {
    border-right-color: #e6e6e6;
    border-bottom-color: #e6e6e6;
}

.pending-purchase-table .purchase-state {
    font-weight: 600;
}

.pending-purchase-table .purchase-state[data-state="none"] {
    color: #ff5722;
}


.pending-purchase-table .purchase-state[data-state="partial"] {
    color: #009688;
}


.pending-purchase-table td[data-column-key="purchased_quantity"] {
    color: #009688;
}

.pending-purchase-table td[data-column-key="remaining_quantity"] {
    color: #f44336;
}

.pending-purchase-table .shipment-action {
    min-height: 1.55rem;
    padding-inline: var(--space-xs);
    border-radius: var(--radius-sm);
    background: #009688;
    font-size: var(--text-xs);
}

.pending-purchase-table .shipment-action + .shipment-action {
    margin-inline-start: var(--space-xs);
    background: #5c9dbd;
}

@media (min-width: 40rem) {
    .pending-purchase-toolbar {
        flex-direction: row;
        align-items: center;
    }
}

:is(.product-table, .quotation-table, .sales-order-table, .purchase-order-table, #sample-batch-form .reference-admin-table) :is(th, td):nth-child(1) { width: 40px; min-width: 40px; max-width: 40px; padding-inline: 0; }
:is(.product-table, .quotation-table, .sales-order-table, .purchase-order-table, #sample-batch-form .reference-admin-table) :is(th, td):nth-child(2) { width: 48px; min-width: 48px; max-width: 48px; padding-inline: 0; }
:is(.product-table, .quotation-table, .sales-order-table, .purchase-order-table, #sample-batch-form .reference-admin-table) :is(th, td):nth-child(3) { width: 42px; min-width: 42px; max-width: 42px; padding-inline: 0; }
.sales-order-table :is(th, td):nth-child(4) { width: 36px; min-width: 36px; max-width: 36px; padding-inline: 0; }

.content .role-permission-table th[scope="rowgroup"],
.content .role-permission-table th[scope="row"] {
    text-align: left;
}

/* Keep secondary and tertiary form footer actions the same size. */
.reference-fullscreen-dialog:not(.reference-confirm-modal) footer > :is(button, a),
.dictionary-fullscreen-dialog:not(.reference-confirm-modal) footer > :is(button, a),
.reference-modal:not(.reference-confirm-modal):has(footer > button[data-close-dialog]) footer > :is(button, a) {
    width: 80px;
    min-width: 80px;
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    white-space: nowrap;
}

.intro-mobile-note { display: none; }

@media (max-width: 60rem) {
    .app-topbar {
        padding-inline: max(var(--space-xs), env(safe-area-inset-left)) max(var(--space-xs), env(safe-area-inset-right));
        gap: var(--space-2xs);
    }

    .brand {
        max-width: 55%;
        gap: var(--space-xs);
        font-size: var(--text-base);
    }

    .user-menu { gap: var(--space-3xs); }
    .topbar-action,
    .topbar-icon,
    .link-button { min-width: 2.75rem; min-height: 2.75rem; padding-inline: var(--space-2xs); }
    .topbar-account summary.topbar-user { min-width: 2.75rem; min-height: 2.75rem; padding-inline: var(--space-2xs); }
    .topbar-account-menu { max-width: calc(100vw - 1rem); }

    .workspace,
    .workspace-tabs,
    .app-shell,
    .content,
    .content > *,
    .content :is(.workbench, .workbench-grid, .workbench-panel, .table-panel, .form-panel) {
        min-width: 0;
    }

    .content {
        width: 100%;
        max-width: 100%;
        padding: var(--space-sm);
        padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
        overflow: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .content :is(img, video, iframe) { max-width: 100%; }
    .content :is(.form-grid, .detail-grid, .settings-grid, .account-center-grid, .dictionary-progress-fields, .reference-fullscreen-dialog .reference-modal-body) {
        grid-template-columns: minmax(0, 1fr);
    }

    .content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]), select, textarea),
    .reference-modal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]), select, textarea),
    .auth-card :is(input, select, textarea) {
        max-width: 100%;
        font-size: 16px;
    }

    .content :is(button, .button-link, .primary-action, .query-action, .reset-action, .danger-action, .info-action),
    .mobile-nav summary,
    .mobile-nav a {
        min-height: 2.75rem;
    }

    .mobile-nav nav {
        max-height: min(50dvh, 24rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .workbench-grid,
    .product-workbench,
    .customer-workbench,
    .quotation-workbench,
    .sales-order-workbench {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-workbench { gap: var(--space-xs); }

    .workbench-grid > .status-rail:not(.product-type-rail) {
        min-width: 0;
        min-height: 0;
        display: flex;
        align-items: center;
        gap: var(--space-2xs);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .workbench-grid > .status-rail:not(.product-type-rail) > :is(strong, button) { flex: 0 0 auto; }
    .workbench-grid > .status-rail:not(.product-type-rail) > button { min-height: 2.75rem; }

    .product-table-panel { min-height: 0; }
    .product-type-rail {
        min-height: 0;
        padding: var(--space-xs);
        display: flex;
        align-items: center;
        gap: var(--space-2xs);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .product-type-rail h2,
    .product-type-rail > a,
    .product-type-children > a { flex: 0 0 auto; }
    .product-type-rail h2 { height: auto; }
    .product-type-rail > a,
    .product-type-children > a { min-height: 2.75rem; }
    .product-type-children { margin: 0; display: flex; border: 0; }

    .product-toolbar,
    .product-toolbar .toolbar-actions,
    .product-toolbar .product-search,
    .content :is(.toolbar-actions, .toolbar-searches, .reference-admin-toolbar, .future-module-actions, .future-module-filters, .report-reference-filters, .recycle-reference-filters, .dictionary-alias-toolbar, .dictionary-search-actions, .duplicate-actions, .reference-notes-toolbar, .organization-reference-toolbar, .report-reference-actions, .system-query-panel > div, .task-filter-panel) {
        min-width: 0;
        flex-wrap: wrap;
    }

    .product-toolbar { padding: var(--space-xs); gap: var(--space-xs); }
    .product-toolbar .product-search > input:not([type="hidden"]) { width: auto; min-width: 0; max-width: 100%; height: 2.75rem; min-height: 2.75rem; flex: 1 1 9rem; }
    .product-toolbar .product-search > :is(.query-action, .reset-action, .quick-quote-action, .info-action, .column-settings) { width: auto; min-width: 2.75rem; height: 2.75rem; min-height: 2.75rem; margin-left: 0; }
    .product-more-menu { right: 0; max-width: calc(100vw - 1rem); max-height: 50dvh; overflow-y: auto; }
    .table-pagination { min-width: 0; flex-wrap: wrap; justify-content: flex-start; gap: var(--space-xs); }
    .form-actions,
    .reference-settings-actions,
    .user-form-actions,
    .account-center-actions { flex-wrap: wrap; }

    .product-reference-form {
        width: 100%;
        max-width: 100%;
        padding: var(--space-md) var(--space-sm);
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-sm);
    }

    .product-folder { grid-column: 1 / -1; }
    .product-submit { padding-top: var(--space-sm); }
    .multi-spec-dimensions { grid-template-columns: minmax(0, 1fr); }
    .multi-spec-dimensions label { grid-template-columns: minmax(0, 1fr); }
    .sales-order-lines { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
    .numbering-rule-row { grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: var(--space-xs); }
    .numbering-rule-row label { flex-wrap: wrap; }
    .system-query-panel { grid-template-columns: minmax(0, 1fr); }
    .dictionary-country-search-panel { grid-template-columns: minmax(0, 1fr); padding: var(--space-sm); }
    .dictionary-country-search-panel label,
    .dictionary-country-fields input { width: 100%; max-width: 100%; }
    .dictionary-unit-fields { grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }
    .customer-inline-form,
    .customer-inline-form.contact-form { width: 100%; max-width: 100%; grid-template-columns: minmax(0, 1fr); }
    .task-filter-panel { grid-template-columns: minmax(0, 1fr); padding: var(--space-sm); gap: var(--space-xs); }
    .shipment-status-rail { max-width: 100%; gap: var(--space-sm); overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
    .shipment-status-rail button { flex: 0 0 auto; min-height: 2.75rem; }
    .shipment-list-toolbar { min-height: 0; padding: var(--space-sm); }
    .shipment-item-grid,
    .shipment-field-grid,
    .system-update-grid { grid-template-columns: minmax(0, 1fr); }

    .dictionary-fullscreen-dialog,
    .reference-fullscreen-dialog {
        inset: var(--topbar-height) 0 0;
        width: auto;
        height: auto;
        max-height: none;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .dictionary-fullscreen-dialog .reference-modal-body,
    .reference-fullscreen-dialog .reference-modal-body {
        width: 100%;
        max-width: 100%;
        padding: var(--space-sm);
        flex: 1 1 auto;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dictionary-dialog-body,
    .dictionary-country-dialog-body {
        width: 100%;
        max-width: 100%;
        padding: var(--space-sm);
    }

    .dictionary-country-search-panel { min-height: 0; }
    .dictionary-country-dialog-body textarea,
    .dictionary-progress-dialog-body textarea { width: 100%; max-width: 100%; }

    dialog[open]:not(.reference-fullscreen-dialog):not(.dictionary-fullscreen-dialog) {
        width: min(100%, calc(100vw - 1rem));
        max-width: none;
        max-height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1rem);
        margin: auto;
        overscroll-behavior: contain;
    }

    dialog[open].reference-modal:not(.reference-fullscreen-dialog):not(.dictionary-fullscreen-dialog) {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    dialog[open].reference-modal header button { min-width: 2.75rem; min-height: 2.75rem; }

    dialog[open] .reference-modal-body {
        min-width: 0;
        min-height: 0;
        flex: 1 1 auto;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .board-modal { width: min(100%, calc(100vw - 1rem)); height: auto; max-height: 80dvh; }
    .board-modal .reference-modal-body { max-height: none; }
    .account-modal { width: min(100%, calc(100vw - 1rem)); }
    .reference-modal footer { flex-wrap: wrap; padding: var(--space-xs); }
    .content .reference-admin-table .row-actions button { min-height: 2.75rem; }
    .reference-fullscreen-dialog footer > :is(button, a),
    .dictionary-fullscreen-dialog footer > :is(button, a),
    .reference-modal:not(.reference-confirm-modal):has(footer > button[data-close-dialog]) footer > :is(button, a) {
        min-height: 2.75rem;
    }

    .intro-workflow { width: auto; min-height: 0; margin: 0; padding: var(--space-md); }
    .intro-flow { display: none; }
    .system-introduction { min-width: 0; min-height: 0; overflow: visible; }
    .intro-mobile-note {
        margin: 0;
        padding: var(--space-md);
        display: block;
        border: var(--rule-thin) solid var(--color-rule);
        background: var(--color-surface);
        text-align: center;
    }
}

@media (max-width: 30rem) {
    .auth-screen { padding: var(--space-sm); }
    .auth-card { min-width: min(340px, calc(100vw - 1rem)); max-width: calc(100vw - 1rem); padding: var(--space-xl) var(--space-md); }
    .auth-card h1 { font-size: clamp(.8rem, 4.6vw, 1.2rem); }
}

.quotation-product-picker {
    width: min(80.5vw, 140rem);
    height: min(83dvh, 70rem);
    max-height: calc(100dvh - 2rem);
    padding: 0;
    overflow: hidden;
}

.quotation-product-picker[open] {
    display: flex;
    flex-direction: column;
}

@media (min-width: 90rem) {
    .quotation-product-picker[open] {
        transform: translate(
            calc(var(--sidebar-width) / 2 + var(--space-xs)),
            calc((var(--topbar-height) + var(--tabs-height)) / 2 - var(--space-xs))
        );
    }
}

.quotation-product-picker > header {
    flex: 0 0 auto;
}

.quotation-product-picker-layout {
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    overflow: hidden;
}

.quotation-picker-category-rail {
    width: 12rem;
    flex: 0 0 12rem;
    overflow: auto;
    border-right: var(--rule-thin) solid var(--color-rule);
    background: var(--color-surface);
}

.quotation-picker-category-rail > strong,
.quotation-picker-category-rail > button {
    width: 100%;
    min-height: 2.3rem;
    padding: var(--space-xs) var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    border: 0;
    border-bottom: var(--rule-thin) solid var(--color-rule);
    border-radius: 0;
    color: var(--color-ink);
    background: var(--color-surface);
    font-size: var(--text-sm);
    font-weight: 400;
    text-align: left;
}

.quotation-picker-category-rail > strong {
    min-height: 2.5rem;
    background: var(--color-paper-2);
    font-weight: 600;
}

.quotation-picker-category-rail > button span {
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.quotation-picker-category-rail > button.active {
    background: var(--color-sidebar-2);
}

.quotation-picker-main {
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.quotation-picker-controls {
    flex: 0 0 auto;
    display: grid;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-bottom: var(--rule-thin) solid var(--color-rule);
    background: var(--color-paper-2);
}

.quotation-picker-search-row {
    min-width: 0;
    display: flex;
    align-items: end;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: var(--space-2xs);
}

.quotation-picker-search-row > label {
    min-width: 0;
    flex: 0 0 6.25rem;
    display: block;
    margin: 0;
    font-size: var(--text-sm);
}

.quotation-picker-search-row > .quotation-picker-brand-field {
    flex: 0 0 9.375rem;
}

.quotation-picker-search-row > .quotation-picker-identifier-field {
    position: relative;
    min-width: 0;
    flex: 0 0 9.375rem;
}

.quotation-product-picker .quotation-picker-controls :is(.quotation-picker-brand-field, .quotation-picker-identifier-field) > input {
    max-width: none;
}

.quotation-picker-identifier-field > input {
    display: block;
}

.quotation-picker-identifier-suggestions {
    position: absolute;
    z-index: 5;
    inset-block-start: calc(100% + 3px);
    inset-inline-start: 0;
    width: max(16rem, 100%);
    max-height: 14rem;
    overflow: auto;
    border: 1px solid var(--color-rule);
    background: var(--color-paper);
    box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
}

.quotation-picker-identifier-suggestions[hidden] { display: none; }

.quotation-picker-identifier-suggestion {
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 0 var(--space-sm);
    cursor: pointer;
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.quotation-picker-identifier-suggestion + .quotation-picker-identifier-suggestion {
    border-top: 1px solid var(--color-rule);
}

.quotation-picker-identifier-suggestion:hover,
.quotation-picker-identifier-suggestion[aria-selected="true"] {
    background: var(--color-paper-2);
}

.quotation-picker-identifier-suggestion small {
    min-width: 0;
    margin-inline-start: auto;
    overflow: hidden;
    color: var(--color-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quotation-picker-identifier-suggestion > span { white-space: nowrap; }

.quotation-product-picker .quotation-picker-controls input:not([type="checkbox"]) {
    width: 100%;
    min-width: 0;
    height: 26px;
    min-height: 26px;
    margin: 0;
    padding: 0 var(--space-xs);
    font-size: var(--text-sm);
}

.quotation-product-picker .quotation-picker-controls button {
    height: 26px;
    min-height: 26px;
    margin: 0;
    padding: 0 var(--space-xs);
    white-space: nowrap;
    font-size: var(--text-sm);
}

.quotation-picker-search-row .result-count,
.quotation-picker-selected {
    flex: 0 0 auto;
    align-self: center;
    white-space: nowrap;
    font-size: var(--text-sm);
}

.quotation-picker-selected { flex: 0 0 auto; }

.quotation-picker-list {
    min-width: 0;
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    overflow: auto;
}

.quotation-picker-table th,
.quotation-picker-table td {
    padding: 4px 10px;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
}

.quotation-product-picker .quotation-picker-table th {
    height: 36px;
    padding: 0 10px;
    font-weight: 400;
}

.quotation-product-picker .quotation-picker-table td {
    height: 46px;
}

.quotation-picker-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.quotation-picker-table th button {
    min-width: 0;
    min-height: 1.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    white-space: nowrap;
}

.quotation-picker-table th button span {
    font-size: var(--text-xs);
}

.quotation-product-picker input[type="checkbox"] {
    width: auto;
    min-height: auto;
    height: auto;
}

.reference-modal .quotation-picker-footer {
    min-height: 2.75rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-top: var(--rule-thin) solid var(--color-rule);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.quotation-picker-footer > div,
.quotation-picker-footer > label {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    margin: 0;
}

.quotation-picker-footer > [data-quotation-picker-total] {
    display: flex;
    align-items: center;
}

.quotation-picker-pagination {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.quotation-picker-pagination > button[data-quotation-picker-prev],
.quotation-picker-pagination > button[data-quotation-picker-next] {
    width: 1.5rem;
    min-width: 1.5rem;
    padding: 0;
    border: 0;
    color: var(--color-muted);
    background: transparent;
    font-size: var(--text-lg);
}

.quotation-picker-pagination > strong {
    min-width: 2rem;
    height: 26px;
    min-height: 26px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: var(--color-accent);
    font-weight: 600;
}

.quotation-picker-footer button,
.quotation-picker-footer select,
.quotation-picker-footer input {
    min-height: 26px;
    height: 26px;
    margin: 0;
    padding: 0 var(--space-xs);
    font-size: var(--text-sm);
    line-height: 1;
}

.quotation-picker-footer input {
    width: 2.5rem;
}

.quotation-picker-footer select {
    width: 4rem;
}

@media (max-width: 115rem) {
    .quotation-picker-search-row {
        flex-wrap: wrap;
    }

    .quotation-picker-search-row > label {
        margin-inline-end: 0;
    }
}

.quotation-lines .quotation-line-editor {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
}

.quotation-lines .quotation-line-editor th,
.quotation-lines .quotation-line-editor td {
    height: 46px;
    padding: 4px 10px;
    border: 1px solid var(--color-rule);
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
}

.quotation-lines .quotation-line-editor th {
    height: 36px;
    color: var(--color-table-head-ink);
    background: var(--color-table-head);
    font-weight: 400;
}

.quotation-lines .quotation-line-editor th[data-default-width="80"] {
    height: 48px;
    padding-inline: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15;
}

.shipment-create-form .shipment-packing-table td input:not([type="hidden"]),
.quotation-lines .quotation-line-editor td input:not([type="checkbox"]),
.quotation-lines .quotation-line-editor td select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 28px;
    min-height: 28px;
    margin: 0;
}

.shipment-packing-table tbody td:has(> input:not([type="hidden"])),
.quotation-lines .quotation-line-editor tbody td[data-column-key],
.quotation-lines .quotation-line-editor tbody td[data-quotation-extra-key] {
    padding: 0;
}

.shipment-packing-table tbody td input:not([type="hidden"]),
.quotation-lines .quotation-line-editor tbody td :is(input:not([type="checkbox"]):not([type="hidden"]), select:not([hidden])) {
    height: 44px;
    min-height: 44px;
    border-color: transparent;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    text-align: center;
}

.shipment-packing-table tbody td input:not([type="hidden"]):focus,
.quotation-lines .quotation-line-editor tbody td :is(input:not([type="checkbox"]):not([type="hidden"]), select:not([hidden])):focus {
    border-color: var(--color-accent);
    background-color: var(--color-surface);
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

.quotation-lines .quotation-line-editor tbody td :is(input:not([type="checkbox"]):not([type="hidden"]), select:not([hidden]))[aria-invalid="true"] {
    border-color: var(--color-danger);
    background-color: var(--color-surface);
}

.quotation-lines .quotation-line-editor input[type="checkbox"] {
    width: auto;
    height: auto;
    min-height: 0;
}

.quotation-lines .quotation-line-editor .quotation-product-image {
    margin-inline: auto;
}

.quotation-line-identifier {
    position: relative;
    width: 100%;
    min-width: 0;
}

.quotation-line-identifier > input {
    display: block;
    width: 100%;
    min-width: 0;
}

.quotation-line-identifier-suggestions {
    position: fixed;
    z-index: 1200;
    max-height: 14rem;
    overflow: auto;
    border: 1px solid var(--color-rule);
    background: var(--color-paper);
    box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
}

.quotation-line-identifier-suggestions[hidden] { display: none; }

.quotation-line-editor .line-plus {
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.order-related table thead th {
    color: var(--color-ink);
    background: var(--color-surface);
    font-size: var(--text-sm);
}

.business-page-layer { padding: 0; background: #fff; }
.business-page-layer > iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.business-page-layer > button {
    position: absolute;
    z-index: 1;
    top: 4px;
    right: 24px;
    min-width: 40px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.business-page-layer.has-child-layer > button { visibility: hidden; }
.business-page-layer.customer-detail-layer > button { color: var(--color-ink-2); }
.app-embedded { display: block; }
.app-embedded > .content { min-height: 100dvh; padding: 0; }
.app-embedded .reference-dialog-title > a[aria-label="关闭"],
.app-embedded .customer-detail-actions > a[aria-label^="关闭"] { visibility: hidden; }
.app-embedded .customer-direct-create .reference-dialog-title > a[aria-label="关闭"] { visibility: visible; }
.app-embedded > .business-page-layer,
.app-embedded .dictionary-fullscreen-dialog,
.app-embedded .reference-fullscreen-dialog {
    inset: 0;
    width: 100%;
    height: 100dvh;
}
.product-image-open, .payment-proof-open { display: inline-flex; align-items: center; padding: 0; border: 0; background: transparent; color: #007c75; font: inherit; cursor: zoom-in; }
.payment-proof-open { cursor: pointer; }
.product-image-open:hover, .payment-proof-open:hover { background: transparent; text-decoration: underline; }
.payment-proof-open:focus-visible { outline: var(--rule-focus) solid var(--color-focus); outline-offset: 2px; }

.sales-proof-upload-dialog.reference-modal { width: 42rem; max-width: calc(100vw - 2rem); border-radius: 4px; }
.sales-proof-upload-dialog header { font-size: 15px; font-weight: 400; }
.sales-proof-upload-dialog .reference-modal-body { padding: 20px 24px; gap: 16px; }
.sales-proof-order-number { margin: 0; color: var(--color-muted); font-size: 13px; font-weight: 400; }
.sales-proof-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sales-proof-upload-dialog .sales-proof-upload-slot { display: grid; gap: 8px; font-size: 14px; font-weight: 400; }
.sales-proof-upload-slot [data-proof-remove] { justify-self: start; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; color: var(--color-danger, #c53f3f); background: transparent; border: 1px solid currentColor; }
.sales-proof-upload-slot [data-proof-remove][hidden] { display: none; }
.sales-proof-upload-zone { position: relative; display: grid; place-items: center; height: 164px; overflow: hidden; border: 1px dashed #b7c7ca; border-radius: 3px; background: #f8fafb; cursor: pointer; }
.sales-proof-upload-zone:hover { border-color: var(--color-accent-deep); }
.sales-proof-upload-zone:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.sales-proof-upload-zone input[type="file"] { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sales-proof-upload-zone img { width: 100%; height: 100%; object-fit: contain; }
.sales-proof-upload-empty { display: grid; justify-items: center; gap: 10px; color: #6d878c; font-size: 13px; font-weight: 400; }
.sales-proof-upload-empty[hidden], .sales-proof-upload-zone img[hidden] { display: none; }
.sales-proof-upload-slot small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-muted); font-size: 12px; font-weight: 400; }
.sales-proof-upload-help { color: var(--color-muted); font-size: 12px; font-weight: 400; }
.sales-proof-upload-error { margin: 0; color: #c53f3f; font-size: 13px; font-weight: 400; }
.content .sales-proof-upload-dialog.reference-modal footer button { min-width: 72px; font-size: 13px; font-weight: 400; }
.content .sales-proof-upload-dialog.reference-modal footer .sales-proof-cancel { border: 1px solid var(--color-rule); background: #fff; color: var(--color-ink); }
.product-image-dialog { width: min(900px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--color-rule-strong); padding: 0; background: var(--color-surface); }
.product-image-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.product-image-stage { position: relative; display: grid; place-items: center; max-height: calc(100dvh - 84px); padding: 14px; cursor: pointer; }
.product-image-stage img { display: block; max-width: 100%; max-height: calc(100dvh - 112px); object-fit: contain; }
.product-image-stage [data-gallery-close] { position: absolute; z-index: 1; top: 12px; right: 12px; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 1px solid var(--color-rule); background: transparent; color: var(--color-ink); font-size: 24px; line-height: 1; cursor: pointer; }
.product-image-dialog footer { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; border-top: 1px solid var(--color-rule); }
.product-image-nav { grid-column: 2; display: flex; align-items: center; gap: 10px; }
.product-image-nav button { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--color-ink); font-size: 24px; line-height: 1; cursor: pointer; }
.product-image-nav button:disabled { opacity: .35; cursor: default; }
.product-image-nav button:hover:not(:disabled) { background: var(--color-paper-2); }
.product-image-nav button:active:not(:disabled) { background: var(--color-paper-3); }
.product-image-nav [data-gallery-count] { min-width: 38px; color: var(--color-ink-2); font-size: var(--text-sm); font-variant-numeric: tabular-nums; text-align: center; }
.product-image-dialog [data-gallery-original] { grid-column: 3; justify-self: end; color: var(--color-accent-deep); font-size: var(--text-sm); white-space: nowrap; text-decoration: none; }
.product-image-dialog [data-gallery-original]:hover { text-decoration: underline; }
.product-image-dialog :is(button, a):focus-visible { outline: var(--rule-focus) solid var(--color-focus); outline-offset: 2px; }
@media (max-width: 480px) {
    .product-image-dialog footer { grid-template-columns: 1fr auto; padding: 8px; }
    .product-image-nav { grid-column: 1; justify-self: start; gap: 4px; }
    .product-image-dialog [data-gallery-original] { grid-column: 2; }
}

.product-image-page {
    display: grid;
    gap: 1.5rem;
    width: min(100%, 61rem);
    margin: 0 auto;
    padding: 1.75rem 1.5rem 3rem;
    color: var(--color-ink);
}
.product-image-page :is(h1, h2, p) { margin: 0; }
.product-image-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}
.product-image-heading > div { min-width: 0; }
.product-image-heading p:first-child {
    margin-bottom: .65rem;
    color: var(--color-muted);
    font-size: var(--text-sm);
}
.product-image-heading h1 {
    margin-bottom: .45rem;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.25;
}
.product-image-heading p:last-child { color: var(--color-muted); font-size: var(--text-base); line-height: 1.6; }
.product-image-heading > a { flex: 0 0 auto; color: var(--color-accent-deep); font-size: var(--text-sm); }
.product-image-workspace {
    min-width: 0;
    padding: 1.75rem;
    border: 1px solid var(--color-rule);
    background: var(--color-surface);
    box-shadow: 0 5px 18px var(--color-shadow);
}
.product-image-section-heading h2, .product-image-progress h2 { font-size: var(--text-lg); font-weight: 600; }
.product-image-section-heading p { margin-top: .4rem; color: var(--color-muted); font-size: var(--text-sm); }
.product-image-mode-switch {
    display: flex;
    gap: 1.75rem;
    min-width: 0;
    margin: 1.4rem 0 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--color-rule);
}
.product-image-mode-switch legend, .product-image-mode-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.product-image-mode-switch label {
    margin: 0 0 -1px;
    padding: 0 0 .7rem;
    border-bottom: 2px solid transparent;
    color: var(--color-muted);
    font-size: var(--text-base);
    cursor: pointer;
}
.product-image-mode-switch input:checked + label { border-color: var(--color-accent-deep); color: var(--color-accent-deep); font-weight: 600; }
.product-image-mode-switch input:focus-visible + label { outline: var(--rule-focus) solid var(--color-focus); outline-offset: 3px; }
.product-image-forms { margin-top: 1.5rem; }
.product-image-upload-form { display: grid; justify-items: end; gap: 1rem; }
.product-image-upload-form--zip, .product-image-workspace:has(#product-image-mode-zip:checked) .product-image-upload-form--webp { display: none; }
.product-image-workspace:has(#product-image-mode-zip:checked) .product-image-upload-form--zip { display: grid; }
.product-image-file-zone {
    display: grid;
    justify-items: center;
    gap: .7rem;
    width: 100%;
    padding: 2rem 1rem;
    border: 1px dashed var(--color-rule-strong);
    background: var(--color-paper);
    text-align: center;
}
.product-image-file-zone label { font-size: var(--text-base); font-weight: 600; }
.product-image-file-zone input[type="file"] {
    width: min(100%, 25rem);
    min-width: 0;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: var(--text-sm);
}
.product-image-file-zone input[type="file"]::file-selector-button {
    margin-right: .75rem;
    padding: .4rem .8rem;
    border: 1px solid var(--color-rule-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-ink);
    font: inherit;
    cursor: pointer;
}
.product-image-file-zone p { color: var(--color-muted); font-size: var(--text-sm); }
.product-image-upload-form > button {
    min-height: 2.4rem;
    padding: .45rem 1.2rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--color-accent-deep);
    color: var(--color-accent-ink);
    font-size: var(--text-sm);
    cursor: pointer;
}
.product-image-upload-form > button:hover { background: var(--color-accent-hover); }
.product-image-naming {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
    margin-top: 1.25rem;
    color: var(--color-muted);
    font-size: var(--text-sm);
}
.product-image-naming code, .product-image-guide code {
    overflow-wrap: anywhere;
    color: var(--color-ink-2);
    font-family: var(--font-outlier);
    font-size: inherit;
}
.product-image-guide { margin-top: .8rem; color: var(--color-ink-2); font-size: var(--text-sm); }
.product-image-guide summary { width: fit-content; color: var(--color-accent-deep); cursor: pointer; }
.product-image-guide ol { display: grid; gap: .5rem; margin: .8rem 0 0; padding-left: 1.3rem; line-height: 1.55; }
.product-image-progress {
    display: grid;
    gap: .65rem;
    min-width: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-rule);
}
.product-image-progress-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.product-image-progress-heading output { color: var(--color-accent-deep); font-size: var(--text-sm); font-weight: 600; }
.product-image-progress progress {
    display: block;
    width: 100%;
    max-width: 100%;
    height: .8rem;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: var(--color-paper-2);
    color: var(--color-accent-deep);
}
.product-image-progress progress::-webkit-progress-bar { border-radius: 999px; background: var(--color-paper-2); }
.product-image-progress progress::-webkit-progress-value { border-radius: 999px; background: var(--color-accent-deep); transition: width var(--dur-short) var(--ease-out); }
.product-image-progress progress::-moz-progress-bar { border-radius: 999px; background: var(--color-accent-deep); }
.product-image-progress [data-product-image-upload-status] { min-width: 0; color: var(--color-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.product-image-progress[aria-busy="true"] progress::-webkit-progress-value { background: var(--color-accent); }
.product-image-page [data-product-image-upload-response] { overflow-wrap: anywhere; }
.product-image-page :is(a, summary, button, input):focus-visible { outline: var(--rule-focus) solid var(--color-focus); outline-offset: 2px; }
.product-table[data-column-config-table="products"] td[data-inline-product-field] { cursor: text; }
.product-table[data-column-config-table="products"] td[data-inline-product-field]:hover { background: #eef8f6; }
.product-table[data-column-config-table="products"] td[data-inline-product-field] > input { width: 100%; min-width: 5rem; height: 30px; margin: 0; padding: 3px 5px; font: inherit; }
@media (max-width: 48rem) {
    .product-image-page { padding: 1.25rem .75rem 2rem; }
    .product-image-heading { align-items: start; flex-direction: column; }
    .product-image-heading h1 { font-size: var(--text-xl); }
    .product-image-workspace { padding: 1rem; }
    .product-image-file-zone { padding: 1.5rem .75rem; }
    .product-image-mode-switch { gap: 1rem; }
}

.purchase-row-links { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 12rem; }
.purchase-row-links button { border: 0; padding: 0; background: transparent; color: var(--color-link, #087c83); font: inherit; cursor: pointer; }
.purchase-row-links button:hover { text-decoration: underline; }
.purchase-row-links :is(a, button):focus-visible { outline: 2px solid var(--color-focus, #008f9c); outline-offset: 2px; }
.purchase-payment-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem 1rem; padding-top: 1rem; }
.purchase-payment-form h3 { grid-column: 1 / -1; margin: 0; font-size: 1rem; }
.purchase-payment-form label { display: grid; gap: .25rem; min-width: 0; }
.purchase-payment-form :is(input, select, textarea) { width: 100%; min-width: 0; }
.purchase-payment-form button { justify-self: start; align-self: end; }
.purchase-product-thumb { width: 40px; height: 40px; object-fit: contain; }
.purchase-supplier-details { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem 1rem; margin: 0; }
.purchase-supplier-details dt { font-weight: 600; }
.purchase-supplier-details dd { margin: 0; overflow-wrap: anywhere; }
.purchase-direct-table select { min-width: 22rem; width: 100%; }
.purchase-direct-table input[type="number"] { min-width: 7rem; width: 100%; }
.purchase-direct-page .reference-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.purchase-direct-page .reference-form-grid label { display: grid; gap: .35rem; }
.purchase-direct-table { min-width: max-content; }
.purchase-direct-table th, .purchase-direct-table td { white-space: nowrap; }
.purchase-direct-table td[data-purchase-direct-name] { min-width: 9rem; }
.purchase-direct-table img[data-purchase-direct-image] { width: 2.5rem; height: 2.5rem; object-fit: contain; }

/* Sales-linked purchase entry: keep the reference system's dense grid while
   allowing this CRM's larger product schema to scroll inside the table. */
.content:has(> .purchase-linked-order-page) { padding: 0; }
.purchase-linked-order-page { width: 100%; max-width: none; }
.purchase-order-dialog .purchase-order-form { box-sizing: border-box; display: grid; gap: var(--space-md); width: min(100%, 112rem); min-width: 0; padding: var(--space-lg) var(--space-lg) var(--space-xl); }
.purchase-order-dialog .purchase-order-form > :is(.sales-order-meta-grid, .purchase-order-meta-grid) { display: grid; width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 20rem)); gap: var(--space-md) var(--space-lg); }
.purchase-order-dialog .purchase-order-form label:not([hidden]) { display: grid; gap: var(--space-xs); min-width: 0; }
.purchase-order-dialog .purchase-order-form > :is(.sales-order-meta-grid, .purchase-order-meta-grid, .sales-order-totals-grid, .purchase-order-totals-grid) :is(input, select),
.purchase-order-dialog .purchase-order-form > .sales-order-notes input { box-sizing: border-box; width: 100%; min-width: 0; height: 2.25rem; }
.purchase-order-dialog .purchase-order-form > :is(.sales-order-totals-grid, .purchase-order-totals-grid) { display: grid; width: min(100%, 58rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 18rem)); gap: var(--space-md) var(--space-lg); padding: 0; }
.purchase-order-dialog .purchase-order-form > .sales-order-notes { display: grid; width: min(100%, 64rem); max-width: 100%; gap: var(--space-xs); }
.purchase-order-dialog .purchase-order-form > .sales-order-notes + .sales-order-notes { width: min(100%, 48rem); max-width: 100%; }
.purchase-order-dialog .purchase-order-form > .sales-order-notes textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 6rem; height: 6rem; resize: vertical; }
.purchase-order-dialog .purchase-order-form > .table-wrap { min-width: 0; max-width: 100%; overflow: auto; }
.purchase-order-dialog .purchase-order-form > .sales-order-submit { display: flex; justify-content: flex-start; align-items: center; gap: var(--space-md); padding: var(--space-lg) 0 0; }
.purchase-order-meta-grid { display: grid; width: min(100%, 126rem); grid-template-columns: repeat(5, minmax(0, 24rem)); gap: .85rem 1.5rem; }
.purchase-order-meta-grid label { display: grid; gap: .3rem; min-width: 0; }
.purchase-order-meta-grid label > span,
.purchase-order-totals-grid label > span,
.purchase-linked-order-form .sales-order-notes > span { color: var(--color-ink-2); font-size: var(--text-sm); }
.purchase-order-meta-grid :is(input, select) { width: 100%; min-width: 0; height: 2.35rem; }
.purchase-order-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .35rem .55rem; min-height: 2.1rem; }
.purchase-order-tool { min-height: 1.9rem; padding: .2rem .35rem; border: 0; background: transparent; color: var(--color-ink-2); font: inherit; font-size: var(--text-sm); white-space: nowrap; cursor: pointer; }
.purchase-order-tool:hover { color: var(--color-accent-deep); }
.purchase-order-tool-icon { padding-inline: .45rem; }
.purchase-order-filter { display: flex; min-width: min(22rem, 100%); margin-right: auto; }
.purchase-order-filter[hidden] { display: none; }
.purchase-order-filter input { width: 100%; min-width: 0; height: 2rem; }
.purchase-order-table-wrap { min-width: 0; max-width: 100%; overflow: auto; border: 1px solid var(--color-rule); }
.purchase-order-lines { width: 100%; min-width: 1500px; border-collapse: collapse; table-layout: auto; }
.purchase-order-lines th,
.purchase-order-lines td { height: 2.4rem; padding: .15rem .42rem; border: 1px solid var(--color-rule); text-align: center; white-space: nowrap; font-size: var(--text-sm); }
.purchase-order-lines th { height: 2.65rem; padding: .15rem .42rem; border: 1px solid var(--color-rule); text-align: center; white-space: nowrap; font-size: var(--text-sm); }
.purchase-order-lines thead th { height: 2.75rem; background: var(--color-table-head); color: #fff; font-weight: 600; }
.purchase-order-lines tbody tr:nth-child(even) { background: #f8fbfc; }
.purchase-order-lines tbody tr:hover { background: #edf7fa; }
.purchase-order-lines .purchase-order-check-column { width: 3rem; }
.purchase-order-lines td > input:not([type="checkbox"]) { width: 100%; min-width: 5.7rem; height: 1.8rem; margin: 0; padding: .15rem .4rem; }
.purchase-order-dialog .purchase-order-lines td > input:not([type="checkbox"]) { max-width: 10rem; }
.purchase-order-dialog .purchase-order-lines td > select { width: 100%; max-width: 12rem; min-width: 0; height: 1.8rem; padding: .15rem .4rem; }
.purchase-order-dialog .purchase-order-lines input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; vertical-align: middle; }
.purchase-order-lines td[data-column-key="name_en"],
.purchase-order-lines td:nth-child(7) { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; }
.purchase-order-row-actions { min-width: 5.8rem; }
.purchase-order-row-actions button { min-width: 1.35rem; padding: .08rem; border: 0; background: transparent; color: var(--color-ink-2); font-size: 1rem; line-height: 1; cursor: pointer; }
.purchase-order-row-actions button:hover { color: var(--color-accent-deep); }
.purchase-order-lines tfoot th,
.purchase-order-lines tfoot td { height: 2.5rem; background: #f2f2f2; color: var(--color-ink); font-weight: 600; }
.purchase-order-lines tfoot input { width: 7rem !important; min-width: 7rem !important; text-align: right; }
.purchase-order-lines[data-hidden-columns~="brand"] [data-column-key="brand"],
.purchase-order-lines[data-hidden-columns~="name_en"] [data-column-key="name_en"],
.purchase-order-lines[data-hidden-columns~="supplier_no"] [data-column-key="supplier_no"],
.purchase-order-lines[data-hidden-columns~="supplier_price"] [data-column-key="supplier_price"],
.purchase-order-lines[data-hidden-columns~="supplier_moq"] [data-column-key="supplier_moq"] { display: none; }
.purchase-order-totals-grid { display: grid; width: min(100%, 76rem); grid-template-columns: repeat(3, minmax(0, 23rem)); gap: .9rem 3.2rem; padding-top: .15rem; }
.purchase-order-totals-grid label { display: grid; gap: .3rem; min-width: 0; }
.purchase-order-totals-grid input { width: 100%; min-width: 0; height: 2.2rem; }
.purchase-order-totals-grid label:last-child input { color: #f04444; font-weight: 700; }
.purchase-linked-order-form .sales-order-notes { display: grid; gap: .3rem; min-width: 0; max-width: 84%; }
.purchase-linked-order-form .sales-order-notes textarea { min-height: 5rem; }
.purchase-linked-order-form .sales-order-notes + .sales-order-notes { max-width: 58%; }
.purchase-linked-order-form .sales-order-submit { display: flex; justify-content: center; align-items: center; gap: .8rem; padding: var(--space-lg) 0 .1rem; }
.purchase-order-columns-dialog,
.purchase-order-products-dialog { width: min(34rem, calc(100vw - 2rem)); max-height: min(80vh, 42rem); padding: 1.2rem; border: 1px solid var(--color-rule); background: var(--color-surface); color: var(--color-ink); box-shadow: 0 12px 36px var(--color-shadow); }
.purchase-order-columns-dialog::backdrop,
.purchase-order-products-dialog::backdrop { background: rgb(14 29 37 / 35%); }
.purchase-order-columns-dialog form,
.purchase-order-products-dialog form,
.purchase-order-dialog-body { display: grid; gap: .75rem; }
.purchase-linked-order-form .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.purchase-order-columns-dialog h2,
.purchase-order-products-dialog h2 { margin: 0; font-size: var(--text-lg); }
.purchase-order-columns-dialog p,
.purchase-order-products-dialog p { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.purchase-order-columns-dialog label { display: flex; align-items: center; gap: .55rem; }
.purchase-order-products-list { display: grid; gap: .4rem; max-height: 48vh; overflow: auto; }
.purchase-order-products-list button { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 2fr); gap: .3rem .8rem; padding: .65rem; border: 1px solid var(--color-rule); background: var(--color-paper); text-align: left; cursor: pointer; }
.purchase-order-products-list button:hover { border-color: var(--color-accent-deep); }
.purchase-order-products-list button span:last-child { color: var(--color-muted); }
.purchase-order-dialog-actions { display: flex; justify-content: flex-end; }
.purchase-direct-reference-page { width: 100%; max-width: none; }
.purchase-direct-form { display: grid; gap: .7rem; min-width: 0; }
.purchase-direct-page .purchase-direct-meta-grid { width: min(100%, 104rem); grid-template-columns: repeat(4, minmax(0, 24rem)); gap: .85rem 1.5rem; }
.purchase-direct-meta-grid label { display: grid; gap: .3rem; min-width: 0; }
.purchase-direct-meta-grid label > span { color: var(--color-ink-2); font-size: var(--text-sm); }
.purchase-direct-meta-grid :is(input, select) { width: 100%; min-width: 0; height: 2.35rem; }
.purchase-direct-toolbar { margin-top: .05rem; }
.purchase-direct-filter { display: flex; min-width: min(22rem, 100%); margin-right: auto; }
.purchase-direct-filter[hidden] { display: none; }
.purchase-direct-filter input { width: 100%; min-width: 0; height: 2rem; }
.purchase-direct-table-wrap { min-height: 18rem; }
.purchase-direct-table { min-width: 2800px; border-collapse: collapse; table-layout: auto; }
.purchase-direct-table th,
.purchase-direct-table td { height: 2.4rem; padding: .15rem .4rem; border: 1px solid var(--color-rule); text-align: center; white-space: nowrap; font-size: var(--text-sm); }
.purchase-direct-table thead th { height: 2.75rem; background: var(--color-table-head); color: #fff; font-weight: 600; }
.purchase-direct-table thead th:first-child { width: 2.5rem; }
.purchase-direct-table thead th:first-child button { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.purchase-direct-table thead th:first-child button:hover { color: #d9ffe7; }
.purchase-direct-table tbody tr:nth-child(even) { background: #f8fbfc; }
.purchase-direct-table tbody tr:hover { background: #edf7fa; }
.purchase-direct-table td > input:not([type="checkbox"]),
.purchase-direct-table td > select { width: 100%; min-width: 5.4rem; height: 1.8rem; margin: 0; padding: .15rem .35rem; }
.purchase-direct-table td > select[data-purchase-direct-product] { min-width: 7.5rem; width: 8.25rem; }
.purchase-direct-table .purchase-direct-highlight { background: var(--color-success-soft); }
.purchase-direct-table td[data-purchase-direct-name],
.purchase-direct-table td[data-purchase-direct-name-en] { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.purchase-direct-table img[data-purchase-direct-image] { display: block; width: 2.5rem; height: 2.5rem; margin: auto; object-fit: contain; }
.purchase-direct-table img[data-purchase-direct-image][hidden] { display: none; }
.purchase-direct-table tfoot th,
.purchase-direct-table tfoot td { height: 2.5rem; background: #f2f2f2; font-weight: 600; }
.purchase-direct-table tfoot th { color: var(--color-ink); }
.purchase-direct-table[data-hidden-columns~="brand"] [data-column-key="brand"],
.purchase-direct-table[data-hidden-columns~="name_en"] [data-column-key="name_en"],
.purchase-direct-table[data-hidden-columns~="image"] [data-column-key="image"],
.purchase-direct-table[data-hidden-columns~="supplier_price"] [data-column-key="supplier_price"],
.purchase-direct-table[data-hidden-columns~="packing_unit"] [data-column-key="packing_unit"],
.purchase-direct-table[data-hidden-columns~="units_per_carton"] [data-column-key="units_per_carton"],
.purchase-direct-table[data-hidden-columns~="carton_length_cm"] [data-column-key="carton_length_cm"],
.purchase-direct-table[data-hidden-columns~="carton_width_cm"] [data-column-key="carton_width_cm"],
.purchase-direct-table[data-hidden-columns~="carton_height_cm"] [data-column-key="carton_height_cm"],
.purchase-direct-table[data-hidden-columns~="carton_volume_m3"] [data-column-key="carton_volume_m3"],
.purchase-direct-table[data-hidden-columns~="carton_gross_weight_kg"] [data-column-key="carton_gross_weight_kg"],
.purchase-direct-table[data-hidden-columns~="carton_net_weight_kg"] [data-column-key="carton_net_weight_kg"],
.purchase-direct-table[data-hidden-columns~="carton_count"] [data-column-key="carton_count"],
.purchase-direct-table[data-hidden-columns~="total_net_weight"] [data-column-key="total_net_weight"],
.purchase-direct-table[data-hidden-columns~="total_gross_weight"] [data-column-key="total_gross_weight"] { display: none; }
.purchase-direct-reference-page .reference-dialog-title { background: linear-gradient(90deg, #8eabb5, #9fa0a0); }
.purchase-direct-summary { width: min(100%, 76rem); grid-template-columns: repeat(3, minmax(0, 23rem)); gap: .9rem 3.2rem; margin-top: .2rem; }
.purchase-direct-form > .sales-order-notes { display: grid; gap: .3rem; min-width: 0; max-width: 84%; }
.purchase-direct-form > .sales-order-notes textarea { width: 100%; min-height: 5rem; }
.purchase-direct-form > .sales-order-notes input { width: 100%; }
.purchase-direct-form > .sales-order-notes + .sales-order-notes { max-width: 58%; }
@media (max-width: 62rem) { .purchase-direct-page .purchase-direct-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 62rem) { .purchase-direct-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.25rem; } }
@media (max-width: 38rem) { .purchase-direct-meta-grid, .purchase-direct-summary { grid-template-columns: minmax(0, 1fr); } .purchase-direct-form > .sales-order-notes, .purchase-direct-form > .sales-order-notes + .sales-order-notes { max-width: 100%; } .purchase-direct-toolbar { justify-content: flex-start; } .purchase-direct-filter { flex-basis: 100%; } }
.purchase-linked-order-form:fullscreen,
.purchase-linked-order-form.purchase-order-fullscreen { overflow: auto; padding: 1rem; background: var(--color-surface); }
.purchase-direct-form:fullscreen,
.purchase-direct-form.purchase-order-fullscreen { overflow: auto; padding: 1rem; background: var(--color-surface); }
@media (max-width: 62rem) {
    .purchase-order-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .purchase-order-totals-grid { gap: .9rem 1.25rem; }
    .purchase-order-lines { min-width: 1300px; }
}
@media (max-width: 38rem) {
    .purchase-order-meta-grid,
    .purchase-order-totals-grid { grid-template-columns: minmax(0, 1fr); }
    .purchase-linked-order-form .sales-order-notes,
    .purchase-linked-order-form .sales-order-notes + .sales-order-notes { max-width: 100%; }
    .purchase-order-toolbar { justify-content: flex-start; }
    .purchase-order-filter { flex-basis: 100%; }
}
/* Customer information intake: scoped to this feature. */
.customer-table tr.customer-information-pending>td{background:#fff7d6!important}.customer-table tr.customer-information-pending:hover>td{background:#fff0b5!important}.information-link-help{position:relative}.information-link-help summary{list-style:none;cursor:pointer;text-align:center}.information-link-help summary::-webkit-details-marker{display:none}.information-link-help p{display:none;position:absolute;right:0;top:22px;width:320px;max-width:80vw;padding:12px;background:#fff;color:#314c55;border:1px solid #cbd8dc;box-shadow:0 4px 16px #0002;z-index:200;font-size:13px;line-height:1.7;font-weight:400}.information-link-help[open] p,.information-link-help:hover p{display:block}.information-copy-status{position:fixed;top:70px;right:24px;z-index:10000;padding:12px 20px;background:#fff;color:#006f75;border:1px solid #bad7d9;border-radius:4px;box-shadow:0 4px 12px #0002}.information-copy-fallback{position:fixed;left:-10000px;top:0}.information-customer-links{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}.information-review-table{width:100%;table-layout:fixed}.information-review-table th:first-child{width:18%}.information-review-table td{white-space:normal;overflow-wrap:anywhere}.information-review-table input,.information-review-table select,.information-review-table textarea{width:100%;min-width:0}.information-review-table tr.information-difference>td{background:#fff8df}.information-duplicates{margin:20px 0;padding:16px}.information-duplicates label{display:block;margin:8px 0}.information-duplicates input[type=radio]{width:auto}.information-review-action{font-size:12px;white-space:nowrap}.information-pending-filter{display:flex;gap:4px;align-items:center;white-space:nowrap;font-size:12px}.information-pending-filter input{width:auto}

/* Lucide controls keep existing cell and button dimensions. */
.topbar-icon, .connection-state, .information-link-help>summary { align-items:center; justify-content:center; }
.connection-state { gap:4px; }
.nav-section summary>.crm-icon { position:absolute; inset-inline-end:var(--space-xs); top:50%; transform:translateY(-50%); transition:transform .15s; }
.nav-section[open] summary>.crm-icon { transform:translateY(-50%) rotate(180deg); }
.customer-country-picker>.crm-icon { position:absolute; right:8px; top:50%; transform:translateY(-50%); color:var(--color-muted); }
.customer-type-group>summary .tree-toggle-icon { transform:rotate(-90deg); }
.customer-type-group[open]>summary .tree-toggle-icon { transform:none; }
.customer-tree-folder, .product-type-rail a>.crm-icon[data-lucide="folder"] { color:#b38918; }
th.sortable [data-sort-icon], th.sortable>.sort-indicator { display:inline-flex; margin-left:4px; vertical-align:middle; }
.customer-toolbar .toolbar-chevron { display:inline-flex; }
.information-link-help summary { list-style:none; display:flex; min-width:26px; min-height:26px; cursor:pointer; }
.information-link-help summary::-webkit-details-marker { display:none; }
.customer-history-help, .reference-modal header>button[data-close-dialog], .product-image-gallery [data-gallery-close], .product-image-gallery [data-gallery-prev], .product-image-gallery [data-gallery-next] { display:inline-flex; align-items:center; justify-content:center; }
.state-badge, .shipping-state, .purchase-state { display:inline-flex; align-items:center; gap:4px; }
.crm-icon[data-lucide="settings"] { color:inherit; }
.crm-icon[data-lucide="circle"] { width:12px; height:12px; stroke-width:1.5px; flex:0 0 12px; }
.template-file-name>.crm-icon { margin-right:5px; color:#568184; }
.template-file-excel>.crm-icon { color:#21865b; }

.content :is(button,a):has(>.crm-icon) { align-items:center; gap:4px; }
.workspace-tab>button { min-width:22px; display:inline-flex; align-items:center; justify-content:center; padding:0; }

.content .table-wrap > table.quotation-table td[data-column-key="status"] { text-align:left; }

/* Lists use their workspace or embedded tab's remaining height. */
.contact-preference-field { position: relative; }
.contact-preference-field > input:not([type="checkbox"]) { padding-right: 32px; }
.contact-preference-field > input.contact-preference-choice {
    position: absolute; right: 8px; bottom: 5px;
    width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0;
    accent-color: var(--color-accent-deep); cursor: pointer;
}
.customer-reference-form .contact-preference-field > input:not([type="checkbox"]) { padding-right: var(--space-xs); }
.customer-reference-form .contact-preference-field > input.contact-preference-choice { right: auto; left: calc(min(368px, 100%) + 8px); }
.contact-preference-field > input.contact-preference-choice:disabled { cursor: default; }
.contact-whatsapp-editor { display: block; width: min(368px, 100%); margin: var(--space-sm); font-weight: 400; }
td:has(> .contact-preference-star) { position: relative; }
.contact-preference-star { --crm-icon-size: 9px; position: absolute; top: 2px; right: 2px; color: var(--color-contact-preference-star); line-height: 0; }
.contact-preference-star > svg.crm-icon { fill: currentColor; }
@media (min-width: 60rem) {
    :is(.workspace, .app-embedded) > .content:has(> .workbench-grid, > :is(.reference-admin-page[data-filter-table], .dictionary-alias-page, .organization-reference-page, .export-history-page), > .customer-public-page, > :is(.shipment-list-workbench, .workbench[data-filter-table])) {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    :is(.workspace, .app-embedded) > .content > :is(.workbench-grid, :is(.reference-admin-page[data-filter-table], .dictionary-alias-page, .organization-reference-page, .export-history-page), .customer-public-page, :is(.shipment-list-workbench, .workbench[data-filter-table])) {
        flex: 1;
        min-height: 0;
    }
    :is(.workspace, .app-embedded) > .content > .workbench-grid { grid-template-rows: minmax(0, 1fr); align-items: stretch; }
    :is(.workspace, .app-embedded) > .content > .workbench-grid > .status-rail { min-height: 0; overflow: auto; }
    :is(.workspace, .app-embedded) > .content > .workbench-grid > :not(.status-rail):not(dialog),
    :is(.workspace, .app-embedded) > .content > :is(.shipment-list-workbench, .workbench[data-filter-table]) { display: flex; flex-direction: column; min-height: 0; }
    :is(.workspace, .app-embedded) > .content :is(.workbench-grid, :is(.reference-admin-page[data-filter-table], .dictionary-alias-page, .organization-reference-page, .export-history-page), .customer-public-page, :is(.shipment-list-workbench, .workbench[data-filter-table])) form:has(> .table-wrap):not(dialog form) {
        display: flex; flex-direction: column; flex: 1; min-height: 0;
    }
    :is(.workspace, .app-embedded) > .content :is(.workbench-grid, :is(.reference-admin-page[data-filter-table], .dictionary-alias-page, .organization-reference-page, .export-history-page), .customer-public-page, :is(.shipment-list-workbench, .workbench[data-filter-table])) .table-wrap:not(dialog .table-wrap) {
        flex: 1; min-height: 0; overflow: auto;
    }
    :is(.workspace, .app-embedded) > .content :is(.module-title, .table-toolbar, .reference-admin-toolbar, .table-pagination, .reference-page-strip) { flex-shrink: 0; }
}

.product-reference-form .customer-country-picker { width: 100%; }
.product-reference-form .product-purchase-notes { grid-column: 1 / -1; }
.product-reference-form .product-purchase-notes textarea { width: 100%; min-height: 72px; }

.product-table select[data-country-select][hidden] { display: none; }
.product-table .customer-country-picker { width: 100%; }
.product-table td[data-inline-product-field] textarea { width: 100%; min-height: 60px; }

.product-lead-time-picker .customer-country-options { max-height: none; overflow: visible; }

.pending-quotation-products {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.pending-quotation-products-toolbar {
    min-height: 3.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.pending-quotation-products .toolbar-searches {
    flex: 1 1 32rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.content .pending-quotation-products .toolbar-searches > input[type="search"] {
    flex: 1 1 10rem;
    width: min(100%, 12rem);
    max-width: 12rem;
}

.pending-quotation-products-wrap {
    flex: 1 1 auto;
    min-height: 0;
    border-top: 0;
}

.pending-quotation-products-table {
    width: max-content;
    min-width: 0;
    table-layout: fixed;
    background: var(--color-reference-white);
}

.pending-quotation-products-table th,
.pending-quotation-products-table td {
    height: 2.5rem;
    border-inline-end: var(--rule-thin) solid var(--color-rule);
    text-align: center;
}

.pending-quotation-products-table td:not(.quotation-demand-actions) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-quotation-products-table th {
    top: 0;
    z-index: var(--z-sticky);
    color: var(--color-table-head-ink);
    background: var(--color-table-head);
    font-weight: 400;
}

.pending-quotation-products-table tbody tr.group-white > td { background: var(--color-reference-white); }
.pending-quotation-products-table tbody tr.group-tint > td { background: var(--color-paper-2); }
.pending-quotation-products-table tbody tr[data-table-row]:hover > td { background: var(--color-accent-soft); }

.pending-quotation-products-table td > :is(input, select) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 1.9rem;
    margin: 0;
    padding-inline: var(--space-xs);
    padding-block: 0;
    line-height: normal;
}

.pending-quotation-products-table td > :is(input:not([type="checkbox"]), select[name="lead_time_id"]) {
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

.pending-quotation-products-table td > :is(input:not([type="checkbox"]), select[name="lead_time_id"]):focus-visible {
    background: var(--color-accent-soft);
}

.pending-quotation-products-table td > select[name="lead_time_id"] {
    cursor: pointer;
}

.shipment-packing-table input[type="number"],
.pending-quotation-products-table input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.shipment-packing-table input[type="number"]::-webkit-inner-spin-button,
.shipment-packing-table input[type="number"]::-webkit-outer-spin-button,
.pending-quotation-products-table input[type="number"]::-webkit-inner-spin-button,
.pending-quotation-products-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pending-quotation-products-table td.number-cell { text-align: center; }

.pending-quotation-products-table td.quotation-demand-actions { box-sizing: border-box; }

.quotation-demand-actions form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.quotation-demand-confirm {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--color-warning);
    font-size: var(--text-xs);
}

.quotation-demand-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding-inline: var(--space-xs);
    border-radius: 999px;
    color: var(--color-ink-2);
    background: var(--color-paper-2);
    font-size: var(--text-xs);
}

.quotation-demand-status[data-status="completed"] {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.quotation-demand-status[data-status="needs_confirmation"] {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.pending-quotation-products-table tbody tr.group-pending > td,
.pending-quotation-products-table tbody tr.group-pending:hover > td { background: #fff3cd; }
.pending-quotation-products-table [data-inline-product-field] { cursor: text; }

.pending-quotation-products-table td:has(.customer-country-picker) { overflow: visible; }
.pending-quotation-products-table .customer-country-picker { width: 100%; }
.pending-quotation-products-table .customer-country-picker input {
    box-sizing: border-box; width: 100%; min-width: 0; height: 1.9rem;
    border: 0; border-radius: 0; outline: 0; background: transparent; box-shadow: none;
}
.pending-quotation-products-table .customer-country-picker input:focus-visible { background: var(--color-accent-soft); }

/* The quotation status action fills its cell without a separate hover tile. */
.quotation-table td[data-column-key="status"]:has(.status-quick-edit) { padding: 0; }
.quotation-table .status-quick-edit { display: flex; align-items: center; width: 100%; min-height: 36px; padding: 8px; border-radius: 0; text-align: left; }
.quotation-table .status-quick-edit:hover,
.quotation-table .status-quick-edit:focus { background: transparent; text-decoration: none; }
.reference-images-control { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.reference-images-control [data-reference-thumbnails] { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.reference-images-control [data-reference-thumbnail] { display: inline-flex; align-items: center; gap: 2px; }
.reference-images-control button { background: transparent; border: 0; color: var(--color-primary, #007c79); padding: 2px; min-width: 0; font: inherit; cursor: pointer; }
.reference-images-control button:focus-visible { outline: 2px solid #007c79; outline-offset: 2px; }
.reference-images-control label[data-reference-upload] { position: relative; display: inline-block; margin: 0; padding: 2px; min-width: 0; color: var(--color-primary, #007c79); font: inherit; cursor: pointer; }
.reference-images-control label[data-reference-upload]:focus-within { outline: 2px solid #007c79; outline-offset: 2px; }
.reference-images-control label[data-reference-upload] > input[data-reference-file] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.reference-images-control img { display: block; width: 32px; height: 32px; object-fit: contain; }
.reference-images-control [data-reference-message] { white-space: normal; font-size: 11px; }
.reference-images-control [data-reference-file][hidden] { display: none; }
.pending-quotation-products-table .reference-images-control { justify-content: center; }
.reference-images-control [data-reference-thumbnails]:empty,
.reference-images-control [data-reference-message]:empty { display: none; }
.pending-quotation-products-table td > input:not([type="hidden"]) { cursor: text; }
.pending-quotation-products-table td > input::placeholder { color: var(--color-muted); opacity: 1; }
.reference-image-viewer { max-width: 90vw; max-height: 90vh; padding: 12px; }
.reference-image-viewer header { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 10px; }
.reference-image-viewer img { display: block; max-width: 85vw; max-height: 80vh; object-fit: contain; }
.quotation-reference-table, .order-products .quotation-reference-table { table-layout: fixed; width: 520px; min-width: 0; }
.quotation-reference-table .reference-images-control { justify-content: center; }
.quotation-reference-table th, .quotation-reference-table td { box-sizing: border-box; overflow-wrap: anywhere; }
.quotation-line-editor th[data-quotation-extra-key="reference_images"], .quotation-line-editor td[data-quotation-extra-key="reference_images"] { white-space: normal; overflow: hidden; }
.quotation-table[data-column-config-table="quotations"], .quotation-lines .quotation-line-editor { min-width: 0; }
.finance-page [data-finance-sort] { cursor: pointer; }
.finance-page [data-finance-sort]:focus-visible { outline: 2px solid var(--primary, #007f82); outline-offset: -2px; }
.finance-detail-dialog { width: min(850px, 90vw); }
.finance-detail-dialog .reference-modal-body { max-height: 65vh; overflow: auto; }
.finance-detail-dialog dl { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr); gap: 8px 16px; }
.finance-detail-dialog dt { font-weight: 600; }
.finance-detail-dialog dd { margin: 0; overflow-wrap: anywhere; }

/* Keep the user filters compact on one row. */
.content .user-query-panel:not([hidden]) { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; overflow-x: auto; }
.content .user-query-panel > label { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 4px; margin: 0; white-space: nowrap; }
.content .user-query-panel > div { flex: 0 0 auto; gap: 10px; }
.content .user-query-panel > div > button { display: inline-flex; align-items: center; justify-content: center; text-align: center; }

.sales-progress-facts,.sales-progress-hint{text-align:center;margin:14px 0 24px;color:var(--text-muted,#65727a)}
.sales-progress-facts strong{color:#00796b}.order-progress-track [aria-current="step"] span{font-weight:600}
.order-progress-track[data-sales-progress]{grid-template-columns:repeat(5,minmax(0,1fr))}

/* Shared list search size: twice the original 120px, including page overrides. */
.content .toolbar-searches,
.content .customer-toolbar .toolbar-searches {
    flex-wrap: wrap;
}
.content .toolbar-searches .product-identifier-autocomplete,
.content .quotation-picker-search-row > .quotation-picker-brand-field,
.content .quotation-picker-search-row > .quotation-picker-identifier-field {
    flex: 0 0 240px;
    width: 240px;
}
.content .quotation-picker-search-row {
    flex-wrap: wrap;
}
/* Keep every search input at the same size despite older page-specific rules. */
.content input[type="search"] {
    width: 240px !important;
    max-width: 100% !important;
    flex: 0 0 240px !important;
}
.content .reference-admin-toolbar {
    flex-wrap: wrap;
}

#purchase-receipt-batch { width: min(45rem, calc(100vw - 2rem)); }
#purchase-receipt-batch header { min-height: 54px; padding-inline: 15px; }
#purchase-receipt-batch .reference-modal-body { padding: 15px; min-width: 0; }
#purchase-receipt-batch label { font-size: 14px; }
#purchase-receipt-batch :is(input:not([type=hidden]), select) {
    box-sizing: border-box;
    min-height: 32px;
    height: 32px;
    max-width: min(240px, 100%);
    margin: 0;
    padding: 0 11px;
    font-size: 14px;
}
#purchase-receipt-batch textarea { width: min(320px, 100%); min-height: 0; font-size: 14px; }
#purchase-receipt-batch .table-wrap { min-width: 0; }
#purchase-receipt-batch table { min-width: 30rem; }

/* Existing reminder records fill the shared Lucide bell in customer/quotation lists. */
.crm-icon.has-reminder[data-lucide="bell"] { fill: currentColor; }

/* Text actions share the quotation Edit button's 60 x 26 desktop size.
   Longer labels grow without clipping; form/dialog pairs share equal tracks. */
@media (min-width: 60.001rem) {
    :is(.content, .reference-modal) :is(
        .toolbar-actions, .toolbar-searches, .quotation-toolbar-secondary,
        .reference-admin-toolbar, .future-module-actions, .future-module-filters,
        .report-reference-filters, .recycle-reference-filters, .dictionary-search-actions,
        .duplicate-actions, .reference-notes-toolbar, .organization-reference-toolbar,
        .report-reference-actions, .product-search, .task-filter-panel,
        .form-actions, .sales-order-submit, .quotation-submit, .product-submit,
        .customer-submit, .user-form-actions, .user-submit, .organization-submit,
        .role-submit, .reference-settings-actions, .account-center-actions,
        .purchase-order-dialog-actions, .role-permission-footer, footer:not(.table-pagination)
    ) > :is(button, a.button-link, a.primary-action, a.query-action, a.reset-action, a.info-action, a.danger-action, input[type="submit"], input[type="button"]):not(
        .refresh-action, .dictionary-refresh-action, .column-settings, .quotation-settings,
        [data-page-previous], [data-page-next], [data-page-jump], [aria-label="关闭"]
    ),
    .content .dictionary-submit,
    .content .toolbar-actions > a:not(.refresh-action),
    .content .quotation-toolbar-secondary > a,
    .content .toolbar-more > summary {
        box-sizing: border-box;
        width: 60px;
        min-width: max-content;
        height: 26px;
        min-height: 26px;
        padding: 0 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 12px;
        line-height: 18px;
        text-decoration: none;
        flex-shrink: 0;
    }
    .content :is(.form-actions, .sales-order-submit, .quotation-submit, .product-submit,
        .customer-submit, .user-form-actions, .user-submit, .organization-submit,
        .role-submit, .reference-settings-actions, .purchase-order-dialog-actions),
    .reference-modal footer:not(:has(> :not(button, a, input))) {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(60px, 1fr);
        width: max-content;
        max-width: 100%;
        margin-inline-start: auto;
    }
    .content :is(.sales-order-submit, .quotation-submit, .product-submit,
        .customer-submit, .user-form-actions, .user-submit, .organization-submit, .role-submit) {
        margin-inline-end: auto;
    }
    .content :is(.form-actions, .sales-order-submit, .quotation-submit, .product-submit,
        .customer-submit, .user-form-actions, .user-submit, .organization-submit,
        .role-submit, .reference-settings-actions, .purchase-order-dialog-actions) > :is(button, a, input[type="submit"]),
    .reference-modal footer:not(:has(> :not(button, a, input))) > :is(button, a, input[type="submit"]) {
        width: 100% !important;
        min-width: 60px !important;
    }
}

/* Shared master-data selection column never absorbs unused table width. */
.master-data-table .master-selection-column { box-sizing: border-box; width: 48px; min-width: 48px; max-width: 48px; padding-inline: 4px; }

/* Compact model summaries; native hover titles show one complete model per line. */
.quotation-table .document-model-summary, .sales-order-table .document-model-summary { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Keep shared customer-contact text and its preference star within each document cell. */
:is(.quotation-table,.sales-order-table) td[data-column-key="contact"] { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
:is(.quotation-table,.sales-order-table) .document-contact-summary { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
:is(.quotation-table,.sales-order-table) td:has(> .contact-preference-star) > .document-contact-summary { padding-right:12px; }


/* Payment method account management: business list dialog, scoped controls. */
.payment-accounts-dialog { width:40%; max-width:calc(100vw - 32px); border-radius:4px; font-size:14px; }
.payment-accounts-list-dialog { width:min(960px, calc(100vw - 32px)); }
.payment-accounts-dialog > header, .payment-accounts-dialog > form > header { height:54px; padding:0 15px; box-sizing:border-box; }
.payment-accounts-dialog .reference-modal-body { padding:15px; max-height:65vh; overflow:auto; }
.payment-accounts-dialog .form-grid { gap:18px; }
.payment-accounts-dialog .form-grid label { font-size:14px; }
.payment-accounts-dialog .form-grid :is(input,select) { box-sizing:border-box; width:100%; max-width:min(240px,100%); height:32px; min-height:0; margin:0; font-size:14px; padding:0 11px; }
.payment-accounts-dialog :is(button:not([data-close-dialog]),a.info-action) { min-height:32px; box-sizing:border-box; font-size:14px; }
.payment-accounts-dialog .reference-admin-table { min-width:560px; font-size:14px; }
.reference-modal.payment-accounts-dialog .reference-admin-table :is(th,td) { padding:8px 12px; line-height:23px; font-size:14px; border-color:var(--el-border-color-lighter, #ebeef5); }
.reference-modal.payment-accounts-dialog .reference-admin-table th { background:var(--el-bg-color, #fff); color:var(--el-text-color-secondary, #909399); font-weight:600; }
.reference-modal.payment-accounts-dialog .reference-admin-table td { color:var(--el-text-color-regular, #606266); font-weight:400; }
.reference-modal.payment-accounts-dialog:not(.reference-confirm-modal):has(footer > button[data-close-dialog]) footer > :is(input,select,button,a) { height:32px; min-height:32px; font-size:14px; }
.payment-accounts-dialog .payment-account-toolbar { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:15px; align-items:center; }
.payment-accounts-dialog .payment-account-description { overflow-wrap:anywhere; margin:0 0 18px; }
.payment-accounts-dialog .master-row-actions { flex-wrap:wrap; }
@media(max-width:767px) { .payment-accounts-dialog { width:calc(100vw - 32px); } }
.quotation-meta-grid--document > [data-quotation-meta-key="payment-bank"] { order:5; }

/* Settlement account editor: existing controls, default size. */
.reference-modal.settlement-account-dialog .reference-modal-body label { font-size:14px; }
.reference-modal.settlement-account-dialog .reference-modal-body :is(input,select) { height:32px; min-height:32px; font-size:14px; }
.reference-modal.settlement-account-dialog .reference-modal-body textarea { font-size:14px; }

/* Keep the customer column dialog actions clear of the fixed AI shortcut. */
:is(#column-config-customers-main, #column-config-finance-order-profit-main) > footer { padding-right: 112px; }

/* Keep follow-up previews inside their configured column; full content stays in the dialog. */
table.tracking-preview-table { table-layout: fixed; }
.tracking-preview-table .tracking-preview-cell { min-width: 0; max-width: 0; overflow: hidden; }
.tracking-preview-table .tracking-preview {
    display: block; width: 100%; min-width: 0; max-width: 100%; height: auto; min-height: 0;
    margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
    color: inherit; font: inherit; line-height: inherit; text-align: inherit;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: none;
}
.tracking-preview-table .tracking-preview:hover { color: var(--color-accent-deep); background: transparent; }
.tracking-preview-table .tracking-preview:focus-visible { outline: 2px solid #409eff; outline-offset: -2px; }
.tracking-preview-dialog .tracking-full-content {
    max-height: 60vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
    font-size: 14px; line-height: 1.5; text-align: left;
}
.tracking-preview-dialog footer [role="status"] { font-size: 14px; }
