:root {
    --bg: #f8fafc;
    --bg-deep: #e2e8f0;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.1);
    --line-strong: rgba(15, 23, 42, 0.18);
    --teal: #0f766e;
    --teal-deep: #115e59;
    --warning: #a16207;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --success: #15803d;
    --success-soft: #dcfce7;
    --warn-soft: #fef3c7;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05);
    --surface-soft: #f8fafc;
    --border: rgba(15, 23, 42, 0.12);
    --text: #0f172a;
    --primary: #0f766e;
    --accent: #0f766e;
    --accent-soft: rgba(15, 118, 110, 0.12);
    --radius-lg: 8px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --font-body: "Segoe UI", "Noto Sans Thai", Arial, sans-serif;
    --font-display: "Segoe UI", "Noto Sans Thai", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
}

body.warehouse-detail-open,
body.product-detail-open,
body.commercial-master-drawer-open,
body.product-form-drawer-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.atmosphere {
    display: none;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: none;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lead {
    margin: 0;
    max-width: 40rem;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.login-screen {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 3rem;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 420px);
    gap: 2rem;
    align-items: center;
}

.login-story h1,
.topbar h1,
.section-heading h2,
.panel-head h3,
.modal-head h3 {
    margin: 0;
    font-family: var(--font-display);
    line-height: 1.1;
}

.login-story h1 {
    max-width: 11ch;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
}

.story-grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.story-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--line);
}

.story-kicker {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--teal);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-card {
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.brand-lockup,
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-mark {
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: var(--teal);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    box-shadow: none;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.stack-form label,
.form-grid label {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.94rem;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: block;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--ink);
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    max-width: 1rem;
    padding: 0;
    margin: 0.08rem 0 0;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 0.2rem;
    border: 1px solid var(--line-strong);
    background: #fff;
    accent-color: var(--teal);
    -webkit-appearance: auto;
    appearance: auto;
    vertical-align: middle;
    cursor: pointer;
    box-shadow: none;
}

input[type="checkbox"]:focus {
    outline: none;
    border-color: rgba(15, 107, 109, 0.7);
    box-shadow: 0 0 0 4px rgba(15, 107, 109, 0.12);
}

input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.54;
}

select {
    padding-right: 2.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(15, 107, 109, 0.55);
    box-shadow: 0 0 0 4px rgba(15, 107, 109, 0.12);
}

.button {
    min-height: 2.8rem;
    padding: 0.8rem 1.1rem;
    border: 0;
    border-radius: var(--radius-sm);
    transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--teal);
    color: #fff;
}

.button-secondary {
    background: rgba(15, 23, 42, 0.06);
    color: var(--ink);
}

.button-ghost {
    background: rgba(30, 47, 66, 0.06);
    color: var(--ink);
}

.inline-feedback {
    margin: 0;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 700;
}

.stack-form + .inline-feedback {
    margin-top: 0.85rem;
}

.inline-feedback.is-success {
    background: var(--success-soft);
    color: var(--success);
}

.inline-feedback.is-info {
    background: rgba(30, 47, 66, 0.08);
    color: var(--ink);
}

.report-policy-warning,
.report-policy-ready {
    display: grid;
    gap: 4px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #f0c36b;
    border-left: 4px solid var(--warning);
    background: #fff9e8;
    color: #713f12;
}

.report-policy-ready {
    border-color: #9bd7bc;
    border-left-color: var(--success);
    background: #effaf4;
    color: #166534;
}

.login-footnote {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.8rem;
}

.build-summary {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.status-pill,
.meta-chip,
.status-badge,
.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.status-neutral,
.meta-chip {
    background: rgba(30, 47, 66, 0.08);
    color: var(--ink);
}

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

.status-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

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

.status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.compact-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 32rem;
}

.mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.24rem 0.42rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.74rem;
    line-height: 1.3;
}

.mini-chip > strong {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-chip .status-pill {
    padding: 0.14rem 0.32rem;
    font-size: 0.68rem;
}

.status-badge {
    background: rgba(15, 107, 109, 0.1);
    color: var(--teal);
}

.status-badge.danger {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.status-badge.warning {
    background: rgba(217, 119, 6, 0.14);
    color: #92400e;
}

.status-badge[data-status="DRAFT"] {
    background: rgba(30, 47, 66, 0.08);
    color: var(--ink);
}

.status-badge[data-status="CONFIRMED"] {
    background: rgba(15, 107, 109, 0.12);
    color: var(--teal);
}

.status-badge[data-status="PARTIALLY_RECEIVED"] {
    background: var(--warn-soft);
    color: var(--warning);
}

.status-badge[data-status="RECEIVED"],
.role-pill[data-role="admin"] {
    background: var(--success-soft);
    color: var(--success);
}

.status-badge[data-status="CLOSED"] {
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink);
}

.status-badge[data-status="CANCELED"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.role-pill[data-role="manager"] {
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink);
}

.role-pill[data-role="viewer"] {
    background: rgba(30, 47, 66, 0.08);
    color: var(--ink);
}

.app-shell {
    position: relative;
    z-index: 1;
    padding: clamp(0.85rem, 2vw, 1.4rem);
}

.topbar {
    margin-bottom: 0.75rem;
    padding: 0.52rem 0.72rem;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(30, 47, 66, 0.06);
}

.topbar::before {
    display: none;
}

.topbar h1 {
    font-size: 1rem;
    max-width: 16ch;
    line-height: 1.1;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-meta,
.status-group,
.status-strip,
.user-cluster,
.action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topbar-brand {
    align-items: center;
    align-self: center;
    min-width: 0;
    max-width: 16rem;
    padding: 0;
    position: relative;
    z-index: 1;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.topbar-brand .brand-mark {
    flex-shrink: 0;
    margin-top: 0;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    box-shadow: none;
}

.topbar-brand > div {
    min-width: 0;
    display: grid;
    gap: 0.28rem;
    align-content: center;
}

.topbar .eyebrow {
    color: var(--muted);
    opacity: 0.95;
}

.topbar-meta {
    min-width: 0;
    width: auto;
    max-width: none;
    align-self: center;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0;
    justify-items: end;
    border-radius: 0;
    position: relative;
    z-index: 1;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.status-group {
    width: auto;
    display: flex;
    align-items: center;
    justify-items: end;
    gap: 0.45rem;
    align-content: center;
    margin-inline: 0;
}

.status-strip {
    width: auto;
    justify-content: flex-end;
    gap: 0.42rem;
}

.status-group .build-summary {
    display: none;
}

.topbar .build-summary {
    font-size: 0.94rem;
    color: #596a79;
}

.topbar .status-pill,
.topbar .meta-chip {
    min-height: 1.9rem;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--line);
    box-shadow: none;
    white-space: nowrap;
    font-size: 0.73rem;
}

.topbar .meta-chip {
    background: #f8fafc;
    color: #314255;
}

.topbar button.status-pill,
.topbar button.meta-chip {
    cursor: pointer;
}

.topbar .status-pill.status-neutral {
    background: rgba(30, 47, 66, 0.08);
    color: var(--ink);
}

.topbar .status-pill.status-online {
    background: var(--success-soft);
    color: var(--success);
}

.topbar .status-pill.status-warning {
    background: var(--warn-soft);
    color: var(--warning);
}

.topbar .status-pill.status-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.workflow-notification-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(3px);
}

.workflow-notification-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 1200;
    width: min(430px, 100vw);
    height: 100dvh;
    overflow: auto;
    background: #ffffff;
    border-left: 1px solid #d8dee6;
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.14);
    padding: 18px;
}

.workflow-notification-header,
.workflow-notification-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.workflow-notification-header {
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.workflow-notification-header h2 {
    margin: 2px 0 0;
    font-size: 1.15rem;
}

.workflow-notification-toolbar {
    min-height: 48px;
}

.workflow-notification-list {
    display: grid;
    gap: 0;
    border-top: 1px solid #e2e8f0;
}

.workflow-notification-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid #e2e8f0;
}

.workflow-notification-item.is-read {
    opacity: 0.68;
}

.workflow-notification-marker {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: #64748b;
}

.workflow-notification-item[data-severity="SUCCESS"] .workflow-notification-marker { background: #15803d; }
.workflow-notification-item[data-severity="WARNING"] .workflow-notification-marker { background: #ca8a04; }
.workflow-notification-item[data-severity="DANGER"] .workflow-notification-marker { background: #dc2626; }

.workflow-notification-content {
    min-width: 0;
}

.workflow-notification-content strong,
.workflow-notification-content p {
    overflow-wrap: anywhere;
}

.workflow-notification-content p {
    margin: 5px 0 8px;
    color: #475569;
    line-height: 1.45;
}

.workflow-notification-meta,
.workflow-notification-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow-notification-meta {
    color: #64748b;
    font-size: 0.78rem;
}

.workflow-notification-actions {
    margin-top: 10px;
}

.workflow-notification-empty {
    padding: 36px 12px;
    text-align: center;
    color: #64748b;
}

@media (max-width: 640px) {
    .workflow-notification-drawer {
        width: 100vw;
        padding: 14px;
    }
}

/* Admin user access register */
body.admin-user-detail-open {
    overflow: hidden;
}

.admin-users-register {
    order: -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
}

.admin-users-register > * {
    min-width: 0;
    max-width: 100%;
}

.admin-user-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.admin-user-kpi {
    min-width: 0;
    min-height: 4.4rem;
    display: grid;
    align-content: center;
    gap: 0.2rem;
    border: 0;
    border-right: 1px solid var(--line);
    padding: 0.7rem 0.8rem;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.admin-user-kpi:last-child {
    border-right: 0;
}

.admin-user-kpi:hover,
.admin-user-kpi:focus-visible {
    background: #f3f8f8;
}

.admin-user-kpi span {
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-user-kpi strong {
    font-size: 1.3rem;
    line-height: 1.1;
}

.admin-user-filter-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 0.65rem;
}

.admin-user-search-field {
    grid-column: span 2;
}

.admin-user-filter-panel label {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.admin-user-filter-panel label > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-user-filter-panel input,
.admin-user-filter-panel select {
    min-width: 0;
    width: 100%;
}

.admin-users-table-wrap {
    overflow: auto;
}

.admin-users-table {
    min-width: 960px;
    table-layout: fixed;
}

.admin-users-table th:nth-child(1) { width: 19%; }
.admin-users-table th:nth-child(2) { width: 17%; }
.admin-users-table th:nth-child(3) { width: 25%; }
.admin-users-table th:nth-child(4) { width: 12%; }
.admin-users-table th:nth-child(5) { width: 15%; }
.admin-users-table th:nth-child(6) { width: 12%; }

.admin-user-identity {
    max-width: 100%;
    display: grid;
    gap: 0.15rem;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.admin-user-identity:hover strong,
.admin-user-identity:focus-visible strong {
    color: var(--accent);
    text-decoration: underline;
}

.admin-user-identity strong,
.admin-user-identity span,
.admin-user-secondary {
    overflow-wrap: anywhere;
}

.admin-user-identity span,
.admin-user-secondary {
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-user-badges,
.admin-user-scope-list,
.admin-user-detail-chip-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.admin-user-permission-groups {
    display: grid;
    gap: 14px;
}

.admin-user-permission-groups > div {
    display: grid;
    gap: 8px;
}

.admin-user-permission-groups > div > strong {
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-user-detail-chip-list .meta-chip.is-write {
    border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
    background: color-mix(in srgb, var(--brand) 8%, white);
    color: var(--brand-deep);
}

.admin-user-scope-chip,
.admin-permission-level {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 4px;
    padding: 0.28rem 0.48rem;
    background: #eef3f4;
    color: #29414a;
    font-size: 0.76rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.admin-permission-level[data-level="ADMIN"],
.admin-permission-level[data-level="APPROVER"] {
    background: #fff1d6;
    color: #7a4b00;
}

.admin-user-scope-more {
    border: 0;
    padding: 0.2rem;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
}

.admin-user-scope-empty {
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 700;
}

.admin-user-status-stack {
    display: grid;
    justify-items: start;
    gap: 0.3rem;
}

.admin-user-status-stack small {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.admin-user-row-actions {
    align-items: center;
    flex-wrap: nowrap;
}

.admin-users-card-list {
    display: none;
}

.admin-user-detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1270;
    background: rgba(13, 26, 33, 0.38);
    backdrop-filter: blur(5px);
}

.admin-user-detail-drawer {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 1280;
    width: min(680px, calc(100vw - 1.5rem));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(20, 35, 44, 0.25);
}

.admin-user-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.1rem;
}

.admin-user-detail-header h3 {
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
}

.admin-user-detail-close {
    flex: 0 0 auto;
}

.admin-user-detail-content {
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.1rem 1.25rem;
}

.admin-user-detail-loading {
    padding: 2.5rem 1rem;
    color: var(--muted);
    text-align: center;
}

.admin-user-detail-section {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.admin-user-detail-section:first-child {
    padding-top: 0;
}

.admin-user-detail-section h4 {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
}

.admin-user-detail-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.admin-user-detail-summary > div {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
    border-left: 3px solid #d7e6e6;
    padding: 0.4rem 0.65rem;
}

.admin-user-detail-summary small,
.admin-user-detail-summary span {
    color: var(--muted);
    font-size: 0.76rem;
}

.admin-user-detail-summary strong,
.admin-user-detail-summary span {
    overflow-wrap: anywhere;
}

.admin-user-warning-list,
.admin-user-history {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-user-warning {
    border-left: 4px solid var(--warning);
    padding: 0.65rem 0.75rem;
    background: var(--warn-soft);
    font-size: 0.84rem;
}

.admin-user-warning[data-severity="HIGH"],
.admin-user-warning[data-severity="CRITICAL"] {
    border-left-color: var(--danger);
    background: var(--danger-soft);
}

.admin-user-safe-message {
    margin: 0;
    color: var(--success);
    font-weight: 700;
}

.admin-user-history li {
    display: grid;
    gap: 0.2rem;
    border-left: 3px solid #d7e6e6;
    padding: 0.25rem 0 0.55rem 0.75rem;
}

.admin-user-history span,
.admin-user-history small {
    color: var(--muted);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.admin-user-delete-note {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.admin-user-detail-actions {
    position: sticky;
    bottom: -1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1rem -1.1rem -1.25rem;
    border-top: 1px solid var(--line);
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
}

.button-danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

@media (max-width: 1320px) {
    .admin-user-filter-panel {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .admin-user-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Keep descriptive labels available to assistive technology without taking layout space. */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 760px) {
    .admin-user-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        border: 0;
        gap: 0.5rem;
    }

    .admin-user-kpi {
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
    }

    .admin-user-kpi:last-child {
        grid-column: 1 / -1;
        border-right: 1px solid var(--line);
    }

    .admin-user-filter-panel {
        grid-template-columns: 1fr;
    }

    .admin-user-search-field {
        grid-column: auto;
    }

    .admin-users-table-wrap {
        display: none;
    }

    .admin-users-card-list {
        display: grid;
        gap: 0.65rem;
    }

    .admin-user-card {
        display: grid;
        gap: 0.75rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        padding: 0.85rem;
        background: #fff;
    }

    .admin-user-card-head {
        display: flex;
        justify-content: space-between;
        align-items: start;
        gap: 0.75rem;
    }

    .admin-user-card-identity {
        min-width: 0;
    }

    .admin-user-card-identity .admin-user-identity {
        width: 100%;
    }

    .admin-user-card-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        margin: 0;
    }

    .admin-user-card-grid dt {
        color: var(--muted);
        font-size: 0.72rem;
    }

    .admin-user-card-grid dd {
        margin: 0.2rem 0 0;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .admin-user-card .admin-user-row-actions {
        justify-content: flex-end;
    }

    .admin-user-detail-drawer {
        inset: 0;
        width: 100vw;
        border: 0;
        border-radius: 0;
    }

    .admin-user-detail-summary {
        grid-template-columns: 1fr;
    }
}

/* Admin document-numbering register */
body.document-numbering-drawer-open {
    overflow: hidden;
}

body.document-numbering-drawer-open .toast-stack {
    top: auto;
    right: auto;
    bottom: 1rem;
    left: 1rem;
}

.document-numbering-register {
    display: grid;
    gap: 0.85rem;
}

.document-numbering-filters {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(180px, 1fr));
    align-items: end;
    gap: 0.65rem;
}

.document-numbering-filters label {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.document-numbering-filters label > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.document-numbering-filters input,
.document-numbering-filters select {
    width: 100%;
    min-width: 0;
}

.document-numbering-result-count {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.document-numbering-pagination {
    border-top: 1px solid var(--line);
    padding-top: 0.85rem;
}

.document-numbering-pagination .pagination-size {
    display: none;
}

.document-numbering-table table {
    min-width: 820px;
    table-layout: fixed;
}

.document-numbering-table th:nth-child(1) { width: 27%; }
.document-numbering-table th:nth-child(2) { width: 28%; }
.document-numbering-table th:nth-child(3) { width: 18%; }
.document-numbering-table th:nth-child(4) { width: 13%; }
.document-numbering-table th:nth-child(5) { width: 14%; }

.document-numbering-table th {
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
    background: #f8fafc;
    white-space: nowrap;
}

.document-numbering-table td {
    height: 4.6rem;
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
    vertical-align: middle;
}

.document-numbering-table tbody tr {
    transition: background-color 140ms ease;
}

.document-numbering-table tbody tr:hover {
    background: #f7fbfb;
}

.document-numbering-document-cell,
.document-numbering-preview-cell {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.document-numbering-document-cell strong {
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.document-numbering-document-cell span {
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    padding: 0.16rem 0.45rem;
    background: #edf3f4;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.document-numbering-preview-cell code {
    width: fit-content;
    border-radius: 4px;
    padding: 0.24rem 0.42rem;
    background: #f1f7f7;
    color: var(--teal);
    font-size: 0.84rem;
}

.document-numbering-period {
    display: inline-block;
    max-width: 100%;
    color: var(--ink);
    font-size: 0.82rem;
    line-height: 1.4;
}

.document-numbering-action-cell {
    text-align: right;
}

.document-numbering-action-cell .button {
    min-height: 2.2rem;
    padding: 0.46rem 0.72rem;
}

.document-numbering-table td small,
.document-numbering-card-list small {
    color: var(--muted);
    font-size: 0.74rem;
}

.document-numbering-table code,
.document-numbering-card-list code,
.document-numbering-live-preview strong {
    max-width: 100%;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.document-numbering-card-list {
    display: none;
}

.document-numbering-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1290;
    background: rgba(13, 26, 33, 0.38);
    backdrop-filter: blur(5px);
}

.document-numbering-drawer {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 1300;
    width: min(760px, calc(100vw - 1.5rem));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(20, 35, 44, 0.25);
}

.document-numbering-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.1rem;
}

.document-numbering-drawer-header h3 {
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
}

.document-numbering-drawer-content {
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.1rem 1.25rem;
}

.document-numbering-live-preview {
    display: grid;
    gap: 0.25rem;
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1rem;
    background: #f3f8f8;
}

.document-numbering-live-preview span,
.document-numbering-live-preview small,
.document-numbering-next-control span,
.document-numbering-next-control small {
    color: var(--muted);
    font-size: 0.76rem;
}

.document-numbering-live-preview strong {
    font-size: 1.18rem;
}

.document-numbering-editor-section,
.document-numbering-history,
.document-numbering-adjustment {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.document-numbering-editor-section h4,
.document-numbering-history h4,
.document-numbering-adjustment h4 {
    margin: 0 0 0.75rem;
}

.document-numbering-toggle-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.document-numbering-check {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    background: #fff;
}

.document-numbering-check input {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

.document-numbering-check span {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.document-numbering-check small {
    color: var(--muted);
    font-weight: 400;
    line-height: 1.45;
}

.document-numbering-advanced {
    border-bottom: 1px solid var(--line);
    padding: 0.9rem 0;
}

.document-numbering-advanced summary {
    color: var(--accent);
    cursor: pointer;
    font-weight: 800;
}

.document-numbering-advanced label {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.document-numbering-next-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 1rem 0;
}

.document-numbering-next-control > div {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.document-numbering-next-control strong {
    font-size: 1.25rem;
}

.document-numbering-history ol {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.document-numbering-history li {
    display: grid;
    grid-template-columns: minmax(100px, auto) minmax(130px, auto) minmax(0, 1fr);
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.document-numbering-history li strong {
    color: var(--ink);
}

.document-numbering-adjustment {
    margin-top: 1rem;
    border: 1px solid #e5b94d;
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: #fffaf0;
}

.document-numbering-adjustment .document-numbering-check {
    margin-top: 0.75rem;
}

.document-numbering-risk-note {
    color: #7a4b00;
    font-size: 0.78rem;
}

.document-numbering-drawer-actions {
    position: sticky;
    bottom: -1.25rem;
    z-index: 1;
    margin: 0 -1.1rem -1.25rem;
    border-top: 1px solid var(--line);
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
}

@media (max-width: 900px) {
    .document-numbering-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-numbering-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    body.document-numbering-drawer-open .toast-stack {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        width: auto;
    }

    .document-numbering-filters {
        grid-template-columns: 1fr;
    }

    .document-numbering-search {
        grid-column: auto;
    }

    .document-numbering-table {
        display: none;
    }

    .document-numbering-card-list {
        display: grid;
        gap: 0.65rem;
    }

    .document-numbering-card-list article {
        display: grid;
        gap: 0.65rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        padding: 0.85rem;
        background: #fff;
    }

    .document-numbering-card-list article > header {
        display: flex;
        justify-content: space-between;
        align-items: start;
        gap: 0.65rem;
    }

    .document-numbering-card-list article > header > div {
        display: grid;
        gap: 0.16rem;
    }

    .document-numbering-card-preview {
        display: grid;
        gap: 0.2rem;
        border-left: 3px solid var(--accent);
        padding: 0.65rem 0.72rem;
        background: #f4f8f8;
    }

    .document-numbering-card-preview > span,
    .document-numbering-card-period > span {
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 700;
    }

    .document-numbering-card-period {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.65rem;
    }

    .document-numbering-card-period strong {
        text-align: right;
        font-size: 0.82rem;
    }

    .document-numbering-card-list .button {
        width: 100%;
    }

    .document-numbering-drawer {
        inset: 0;
        width: 100vw;
        border: 0;
        border-radius: 0;
    }

    .document-numbering-toggle-list,
    .document-numbering-adjustment-grid {
        grid-template-columns: 1fr;
    }

    .document-numbering-next-control {
        align-items: stretch;
        flex-direction: column;
    }

    .document-numbering-history li {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}

.user-cluster {
    width: auto;
    gap: 0.45rem;
    align-items: center;
    justify-content: flex-end;
    align-content: center;
    margin-inline: 0;
    padding-top: 0;
}

.user-cluster .button {
    min-width: 0;
    min-height: 1.95rem;
    padding: 0.34rem 0.65rem;
    font-size: 0.78rem;
}

.user-cluster .language-toggle {
    min-width: 2.65rem;
    font-weight: 800;
}

.topbar .button-ghost {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.topbar .button-secondary {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(185, 28, 28, 0.14);
    box-shadow: none;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    min-height: 1.95rem;
    max-width: 18rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--line);
    box-shadow: none;
    overflow: hidden;
    white-space: nowrap;
}

.user-badge strong {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badge > .meta-chip,
.user-badge > .role-pill {
    display: none;
}

.system-build-panel {
    align-content: start;
}

.system-build-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.workspace {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.sidebar {
    padding: 1rem;
    border-radius: var(--radius-lg);
    display: grid;
    align-content: start;
    gap: 1.2rem;
    position: sticky;
    top: 1rem;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
}

.nav-stack {
    display: grid;
    min-width: 0;
    gap: 0.85rem;
}

.nav-group {
    min-width: 0;
}

.nav-group + .nav-group {
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.35rem;
    padding: 0.2rem 0.65rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}

.nav-group-title svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
}

.nav-group-items {
    display: grid;
    gap: 0.15rem;
}

.nav-group .nav-button {
    min-height: 2.75rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.nav-group .nav-button.is-active {
    color: var(--teal-deep);
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--teal);
}

.nav-group .nav-button:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: -2px;
}

.nav-button {
    display: block;
    width: 100%;
    min-height: 2.85rem;
    padding: 0.95rem 1rem;
    border: 0;
    border-radius: var(--radius-sm);
    text-align: left;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.nav-button:hover,
.nav-button.is-active {
    background: rgba(15, 107, 109, 0.08);
    color: var(--teal);
}

.sidebar-note {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: var(--muted);
    line-height: 1.6;
}

.content {
    min-width: 0;
}

.content-section {
    animation: rise-in 240ms ease;
}

.section-heading {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.section-heading h2 {
    font-size: clamp(1.55rem, 2.4vw, 2.2rem);
}

.section-subtitle {
    margin: 0.28rem 0 0;
    max-width: 52rem;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.product-section-heading {
    align-items: end;
}

.product-section-heading h2 {
    font-size: clamp(1.85rem, 2.6vw, 2.55rem);
    line-height: 1.05;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.stat-card {
    padding: 0.72rem 0.82rem;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    margin-bottom: 0.24rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.stat-card strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.48rem;
    line-height: 1.14;
}

.stat-card .helper-text {
    display: block;
    margin-top: 0.22rem;
}

.warehouse-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.warehouse-page-heading {
    margin-bottom: 0.65rem;
}

.warehouse-page-heading h2 {
    margin-bottom: 0.2rem;
}

.warehouse-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.78rem;
}

.warehouse-updated-copy {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
}

.warehouse-workspace-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.warehouse-workspace-tab {
    flex: 0 0 auto;
    min-height: 2.6rem;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.warehouse-workspace-tab:is(:hover, :focus-visible),
.warehouse-workspace-tab.is-active {
    border-bottom-color: var(--accent);
    color: var(--accent-strong);
    outline: none;
}

.warehouse-workspace-panel[hidden] {
    display: none;
}

.warehouse-directory-head,
.warehouse-location-workbench-head {
    align-items: flex-end;
}

.warehouse-directory-actions {
    display: flex;
    gap: 0.45rem;
    align-items: flex-end;
}

.warehouse-search-field {
    min-width: min(28rem, 45vw);
}

.warehouse-directory-row {
    cursor: pointer;
}

.warehouse-directory-row:is(:hover, :focus-visible) {
    background: rgba(15, 107, 109, 0.05);
    outline: 2px solid transparent;
}

.warehouse-ready-qty {
    color: #166534;
    font-size: 1.18rem;
}

.warehouse-stock-triad {
    display: grid;
    grid-template-columns: repeat(3, minmax(3.9rem, 1fr));
    gap: 0.3rem;
    min-width: 13rem;
}

.warehouse-stock-triad > span {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.68rem;
}

.warehouse-stock-triad strong {
    color: var(--ink);
    font-size: 0.88rem;
}

.warehouse-stock-triad .is-risk strong {
    color: var(--danger);
}

.warehouse-mobile-cards {
    display: none;
}

.warehouse-location-workbench,
.warehouse-structure-list-panel {
    padding: 0.9rem;
}

.warehouse-location-toolbar {
    display: grid;
    grid-template-columns: minmax(16rem, 2fr) repeat(4, minmax(9rem, 1fr));
    gap: 0.65rem;
    align-items: end;
    margin: 0.65rem 0;
}

.warehouse-location-filter-summary {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.65rem;
}

.warehouse-location-filter-summary .filter-summary-chips {
    flex: 1 1 auto;
}

.warehouse-location-tree,
.warehouse-structure-list {
    display: grid;
    gap: 0.65rem;
}

.warehouse-location-group {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.warehouse-location-group-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--line);
    background: #f8fafb;
}

.warehouse-location-group-head > div,
.warehouse-location-card {
    min-width: 0;
}

.warehouse-location-group-head small,
.warehouse-mobile-card-head small {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
}

.warehouse-location-card-list {
    display: grid;
}

.warehouse-location-pagination {
    margin-top: 0;
    padding: 0.7rem 0.8rem;
    border-top: 1px solid var(--line);
    background: #f8fafb;
}

.warehouse-location-card {
    display: grid;
    grid-template-columns: minmax(6rem, 0.7fr) minmax(10rem, 1fr) minmax(14rem, 2fr) auto;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
}

.warehouse-location-card:last-child {
    border-bottom: 0;
}

.warehouse-location-card:not(:disabled) {
    cursor: pointer;
}

.warehouse-location-card:not(:disabled):is(:hover, :focus-visible) {
    background: rgba(15, 107, 109, 0.05);
    outline: none;
}

.warehouse-location-code,
.warehouse-location-name {
    font-weight: 800;
}

.warehouse-location-path {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.78rem;
}

.warehouse-structure-layout {
    display: grid;
    grid-template-columns: minmax(18rem, 0.75fr) minmax(26rem, 1.4fr);
    gap: 0.75rem;
    align-items: start;
}

.warehouse-structure-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}

.warehouse-structure-row:last-child {
    border-bottom: 0;
}

.warehouse-structure-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.warehouse-structure-copy small {
    color: var(--muted);
}

.warehouse-structure-warning {
    color: #9a6700;
    font-size: 0.72rem;
    line-height: 1.35;
}

.warehouse-all-tasks-link {
    display: flex;
    justify-content: flex-end;
}

.storage-location-drawer {
    width: min(48rem, calc(100vw - 2rem));
}

.storage-location-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.storage-location-form-grid .form-field-wide {
    grid-column: 1 / -1;
}

.storage-location-checks {
    display: grid;
    gap: 0.45rem;
}

.warehouse-detail-actions {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 0.45rem;
    padding-top: 0.15rem;
}

.warehouse-kpi-card {
    display: grid;
    gap: 0.18rem;
    min-height: 5.8rem;
    padding: 0.72rem 0.82rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.warehouse-kpi-card[data-tone="online"] {
    border-left-color: var(--success);
}

.warehouse-kpi-card[data-tone="warning"] {
    border-left-color: var(--warning);
}

.warehouse-kpi-card[data-tone="danger"] {
    border-left-color: var(--danger);
}

.warehouse-kpi-card span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.warehouse-kpi-card strong {
    font-size: 1.45rem;
    line-height: 1.1;
}

.warehouse-kpi-card small {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.warehouse-operation-panel {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 0.8rem;
    padding: 0.78rem 0.86rem;
}

.warehouse-operation-panel[hidden] {
    display: none;
}

.warehouse-operation-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
}

.warehouse-operation-head h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}

.warehouse-operation-head .helper-text {
    max-width: 28rem;
    margin: 0;
    text-align: right;
}

.warehouse-operation-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.45rem;
}

.warehouse-operation-button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.5rem;
    align-items: center;
    min-height: 3.55rem;
    padding: 0.52rem 0.58rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    transition: border-color 140ms ease, background 140ms ease;
}

.warehouse-operation-button:hover,
.warehouse-operation-button:focus-visible {
    border-color: rgba(15, 107, 109, 0.38);
    background: rgba(15, 107, 109, 0.06);
    outline: none;
}

.warehouse-operation-code {
    display: inline-flex;
    min-width: 2.15rem;
    height: 2.15rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #edf2f2;
    color: var(--accent-strong);
    font-size: 0.7rem;
    font-weight: 900;
}

.warehouse-operation-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.warehouse-operation-copy strong {
    overflow: hidden;
    font-size: 0.88rem;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.warehouse-operation-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.warehouse-task-queue-panel {
    display: grid;
    gap: 0.72rem;
    margin-bottom: 0.8rem;
    padding: 0.78rem 0.86rem;
}

.warehouse-task-queue-panel[hidden] {
    display: none;
}

.warehouse-task-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
}

.warehouse-task-head h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}

.warehouse-task-head .helper-text {
    margin: 0.16rem 0 0;
}

.warehouse-task-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.45rem;
}

.warehouse-material-prep-section {
    display: grid;
    gap: 0.55rem;
    padding: 0.7rem 0 0.85rem;
    border-bottom: 1px solid var(--line);
}

.warehouse-material-prep-section .panel-head {
    margin: 0;
}

.warehouse-material-prep-table table {
    min-width: 980px;
    table-layout: fixed;
}

.warehouse-material-prep-table th:nth-child(1),
.warehouse-material-prep-table td:nth-child(1) {
    width: 12%;
}

.warehouse-material-prep-table th:nth-child(2),
.warehouse-material-prep-table td:nth-child(2) {
    width: 22%;
}

.warehouse-material-prep-table th:nth-child(8),
.warehouse-material-prep-table td:nth-child(8) {
    width: 16%;
}

.raw-material-readiness-panel {
    display: grid;
    gap: 0.8rem;
}

.raw-material-readiness-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.raw-material-readiness-details {
    border-top: 1px solid var(--line);
}

.raw-material-readiness-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.7rem;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.raw-material-readiness-details summary::-webkit-details-marker {
    display: none;
}

.raw-material-readiness-details[open] summary span:last-child {
    transform: rotate(45deg);
}

.warehouse-task-summary-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.warehouse-task-summary-card {
    min-width: 0;
    padding: 0.5rem 0.58rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfc;
}

.warehouse-task-summary-card span {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.warehouse-task-summary-card strong {
    display: block;
    margin-top: 0.12rem;
    font-size: 1.05rem;
    line-height: 1.1;
}

.warehouse-task-table {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.warehouse-task-table table {
    min-width: 920px;
}

.warehouse-queue-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.warehouse-queue-metric {
    position: relative;
    min-width: 0;
    padding: 0.72rem 0.78rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
}

.warehouse-queue-metric span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.warehouse-queue-metric strong {
    display: block;
    margin-top: 0.18rem;
    font-size: 1.35rem;
    line-height: 1.05;
}

.warehouse-queue-metric em {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.22rem;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.warehouse-queue-shortcuts-panel {
    padding: 0.78rem 0.86rem;
}

.warehouse-queue-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.45rem;
}

.warehouse-queue-shortcut {
    min-height: 2.7rem;
    padding: 0.52rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfc;
    color: var(--ink);
    font-weight: 850;
    text-align: center;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease;
}

.warehouse-queue-shortcut:hover,
.warehouse-queue-shortcut:focus-visible {
    border-color: rgba(15, 107, 109, 0.38);
    background: rgba(15, 107, 109, 0.06);
    outline: none;
}

.warehouse-queue-full-panel {
    margin-bottom: 0;
}

.warehouse-manager-dashboard {
    display: grid;
    gap: 0.85rem;
    padding: 0.9rem;
}

.warehouse-manager-dashboard .panel-head {
    align-items: flex-start;
    gap: 0.75rem;
}

.warehouse-manager-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.warehouse-manager-metric {
    min-width: 0;
    padding: 0.7rem 0.78rem;
    border: 1px solid var(--line);
    border-left: 0.22rem solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
}

.warehouse-manager-metric.is-danger {
    border-left-color: var(--danger);
}

.warehouse-manager-metric.is-warning {
    border-left-color: var(--warning);
}

.warehouse-manager-metric.is-neutral {
    border-left-color: var(--line-strong);
}

.warehouse-manager-metric span,
.warehouse-manager-table th {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
}

.warehouse-manager-metric strong {
    display: block;
    margin-top: 0.14rem;
    font-size: 1.34rem;
    line-height: 1.05;
}

.warehouse-manager-metric small {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.25;
}

.warehouse-manager-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
    gap: 0.75rem;
}

.warehouse-manager-split h4 {
    margin: 0 0 0.45rem;
    font-size: 0.98rem;
}

.warehouse-manager-table {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.warehouse-manager-table table {
    min-width: 760px;
}

.warehouse-manager-table-compact table {
    min-width: 560px;
}

.warehouse-manager-table td,
.warehouse-manager-table th {
    padding: 0.52rem 0.62rem;
    vertical-align: top;
}

.warehouse-table-wrap table {
    min-width: 920px;
    table-layout: fixed;
}

.warehouse-table-wrap th:nth-child(1) {
    width: 24%;
}

.warehouse-table-wrap th:nth-child(2) {
    width: 11%;
}

.warehouse-table-wrap th:nth-child(3) {
    width: 27%;
}

.warehouse-table-wrap th:nth-child(4),
.warehouse-table-wrap th:nth-child(5),
.warehouse-table-wrap th:nth-child(6) {
    width: 12.666%;
}

.warehouse-health-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.warehouse-availability-stack {
    display: grid;
    gap: 0.22rem;
    width: 100%;
    min-width: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.warehouse-availability-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.25rem;
    min-width: 0;
}

.warehouse-availability-row strong {
    color: var(--ink);
    flex: 0 0 auto;
}

.warehouse-availability-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.stock-split-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(5.2rem, 1fr));
    gap: 0.32rem;
    min-width: min(18rem, 100%);
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.18;
}

.stock-split-stack.is-compact {
    grid-template-columns: repeat(3, minmax(4.3rem, 1fr));
    min-width: 14rem;
    max-width: 18rem;
}

.stock-split-row {
    display: grid;
    gap: 0.06rem;
    min-width: 0;
    padding: 0.32rem 0.42rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.stock-split-row strong {
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 850;
}

.stock-split-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.stock-split-row.is-good {
    border-color: rgba(22, 163, 74, 0.24);
    background: rgba(22, 163, 74, 0.07);
}

.stock-split-row.is-primary {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding: 0.42rem 0.52rem;
    border-left: 3px solid var(--success);
}

.stock-split-row.is-primary strong {
    grid-column: 2;
    grid-row: 1;
    color: #157347;
    font-size: 1.06rem;
}

.stock-split-row.is-primary span {
    grid-column: 1;
    grid-row: 1;
    color: #166534;
    font-weight: 800;
}

.stock-split-row.is-risk {
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(220, 38, 38, 0.07);
}

.warehouse-detail-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(3px) saturate(0.92);
    -webkit-backdrop-filter: blur(3px) saturate(0.92);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease-out;
}

.warehouse-detail-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.warehouse-detail-drawer {
    position: fixed;
    z-index: 72;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: min(58rem, calc(100vw - 2rem));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.12);
}

.warehouse-detail-drawer.is-open {
    animation: productDrawerIn 160ms ease-out;
}

.warehouse-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.75rem 0 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.warehouse-detail-tab-button {
    min-height: 2.25rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.warehouse-detail-tab-button:hover,
.warehouse-detail-tab-button:focus-visible {
    border-color: rgba(15, 107, 109, 0.28);
    color: var(--accent);
    outline: none;
}

.warehouse-detail-tab-button.is-active {
    border-color: rgba(15, 107, 109, 0.28);
    background: rgba(15, 107, 109, 0.12);
    color: var(--accent);
}

.warehouse-detail-content {
    min-width: 0;
}

.warehouse-overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(18rem, 0.92fr);
    gap: 1rem;
    align-items: start;
}

.warehouse-overview-panel {
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    display: grid;
    gap: 0.85rem;
}

.warehouse-overview-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--line);
}

.warehouse-overview-panel-head h4 {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.25;
}

.warehouse-overview-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: 0.55rem;
}

.warehouse-overview-tile {
    min-width: 0;
    min-height: 4.6rem;
    padding: 0.65rem 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfc;
}

.warehouse-overview-tile span,
.warehouse-overview-list span,
.warehouse-overview-block-title,
.warehouse-overview-status-row > div > span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.25;
}

.warehouse-overview-tile-value {
    margin-top: 0.22rem;
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 850;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.warehouse-overview-tile.is-code .warehouse-overview-tile-value {
    font-size: 1rem;
    letter-spacing: 0;
}

.warehouse-overview-block {
    min-width: 0;
    padding: 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfc;
}

.warehouse-overview-block-title {
    margin-bottom: 0.5rem;
}

.warehouse-overview-stock-split {
    display: grid;
    gap: 0.38rem;
}

.warehouse-overview-stock-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.52rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.warehouse-overview-stock-row strong {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: right;
}

.warehouse-overview-stock-row span {
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.warehouse-overview-stock-row.is-good {
    border-color: rgba(22, 163, 74, 0.24);
    background: rgba(22, 163, 74, 0.06);
}

.warehouse-overview-stock-row.is-warning {
    border-color: rgba(202, 138, 4, 0.24);
    background: rgba(202, 138, 4, 0.06);
}

.warehouse-overview-stock-row.is-risk {
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(220, 38, 38, 0.06);
}

.warehouse-overview-status-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.warehouse-overview-status-row > div {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.45rem;
    padding: 0.64rem 0.68rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfc;
}

.warehouse-overview-list {
    display: grid;
    gap: 0.45rem;
}

.warehouse-overview-list > div {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(6.5rem, auto);
    gap: 0.75rem;
    align-items: center;
    padding: 0.58rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfc;
}

.warehouse-overview-list strong {
    min-width: 0;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.22;
    text-align: right;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .warehouse-overview-layout,
    .warehouse-overview-status-row {
        grid-template-columns: 1fr;
    }

    .warehouse-overview-list > div {
        grid-template-columns: 1fr;
        gap: 0.18rem;
    }

    .warehouse-overview-list strong {
        text-align: left;
    }
}

.warehouse-detail-content .product-detail-grid {
    grid-template-columns: 1fr;
}

.warehouse-detail-content .product-detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
    gap: 0.65rem;
    margin-bottom: 0;
}

.warehouse-detail-content .detail-key {
    min-width: 0;
    min-height: 5.15rem;
    padding: 0.72rem 0.78rem;
    border-radius: var(--radius-sm);
}

.warehouse-detail-content .detail-key > span,
.warehouse-detail-content .detail-key-value {
    line-height: 1.28;
}

.warehouse-detail-content .detail-key-value {
    overflow-wrap: anywhere;
}

.warehouse-detail-content .detail-key.warehouse-detail-key-wide {
    grid-column: 1 / -1;
    min-height: auto;
}

.warehouse-detail-content .detail-key.warehouse-detail-key-stack {
    grid-column: span 2;
    min-height: 4.35rem;
}

.warehouse-detail-drawer .stock-split-stack,
.warehouse-detail-content .stock-split-stack {
    min-width: 0;
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr;
    gap: 0.28rem;
}

.warehouse-detail-drawer .stock-split-row,
.warehouse-detail-content .stock-split-row {
    display: grid;
    grid-template-columns: minmax(2.2rem, max-content) minmax(0, 1fr);
    align-items: center;
    min-height: 0;
    gap: 0.4rem;
    padding: 0.34rem 0.48rem;
}

.warehouse-detail-drawer .stock-split-row strong,
.warehouse-detail-content .stock-split-row strong {
    font-size: 0.92rem;
    line-height: 1.1;
}

.warehouse-detail-drawer .stock-split-row span,
.warehouse-detail-content .stock-split-row span {
    line-height: 1.2;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .warehouse-detail-content .detail-key.warehouse-detail-key-stack,
    .warehouse-detail-content .detail-key.warehouse-detail-key-wide {
        grid-column: 1 / -1;
    }
}

.warehouse-detail-table table {
    min-width: 760px;
}

.sales-pick-list-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(3px) saturate(0.92);
    -webkit-backdrop-filter: blur(3px) saturate(0.92);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease-out;
}

.sales-pick-list-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sales-pick-list-drawer {
    position: fixed;
    z-index: 72;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: min(54rem, calc(100vw - 2rem));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    background: var(--surface-strong);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.12);
}

.sales-pick-list-drawer.is-open {
    animation: productDrawerIn 160ms ease-out;
}

.sales-pick-list-content {
    display: grid;
    gap: 0.85rem;
}

.sales-pick-list-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.55rem;
}

.sales-pick-list-summary .detail-key {
    min-height: 4.25rem;
}

.pick-list-line {
    display: grid;
    gap: 0.62rem;
    padding: 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
}

.pick-list-line-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
}

.pick-list-line-head h4 {
    margin: 0;
    font-size: 0.98rem;
}

.pick-list-line-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.pick-list-lot-table table {
    min-width: 760px;
}

.sales-pick-list-actions {
    position: sticky;
    bottom: 0;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), var(--surface-strong));
}

.dashboard-zone {
    min-width: 0;
    margin-bottom: 0.8rem;
    display: grid;
    gap: 0.72rem;
}

.dashboard-zone-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0.12rem;
}

.dashboard-zone-head h3 {
    font-size: 1rem;
    line-height: 1.18;
}

.dashboard-zone > .board-grid,
.dashboard-zone > .dashboard-operations-grid,
.dashboard-zone > .dashboard-command-grid,
.dashboard-zone > .dashboard-intelligence-grid,
.dashboard-zone > .dashboard-pipeline-panel {
    margin-bottom: 0;
}

.dashboard-zone > *,
.dashboard-zone-top-grid > *,
.dashboard-summary-grid > * {
    min-width: 0;
}

.dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0;
}

.dashboard-kpi-empty {
    grid-column: 1 / -1;
    padding: 0.8rem 0.9rem;
    color: var(--muted);
    background: #ffffff;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
}

.dashboard-kpi-details {
    margin-top: 0.6rem;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.dashboard-kpi-details[hidden] {
    display: none;
}

.dashboard-kpi-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.68rem 0.82rem;
    cursor: pointer;
    list-style-position: inside;
}

.dashboard-kpi-details > summary > span:first-child {
    min-width: 0;
}

.dashboard-kpi-details > summary strong,
.dashboard-kpi-details > summary small {
    display: block;
}

.dashboard-kpi-details > summary strong {
    font-size: 0.88rem;
}

.dashboard-kpi-details > summary small {
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.dashboard-kpi-details-meta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.dashboard-kpi-details-toggle {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 800;
}

.dashboard-kpi-details-toggle::before {
    content: "+";
}

.dashboard-kpi-details[open] .dashboard-kpi-details-toggle::before {
    content: "-";
}

.dashboard-kpi-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0 0.72rem 0.72rem;
}

.dashboard-kpi-detail-item {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.62rem 0.7rem;
    color: inherit;
    font: inherit;
    text-align: left;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.dashboard-kpi-detail-item:hover,
.dashboard-kpi-detail-item:focus-visible {
    border-color: rgba(20, 115, 112, 0.38);
    background: var(--accent-soft);
}

.dashboard-kpi-detail-item[data-zero-value="true"] {
    color: var(--muted);
}

.dashboard-kpi-detail-copy {
    min-width: 0;
}

.dashboard-kpi-detail-copy strong,
.dashboard-kpi-detail-copy small {
    display: block;
    overflow-wrap: anywhere;
}

.dashboard-kpi-detail-copy strong {
    font-size: 0.84rem;
}

.dashboard-kpi-detail-copy small {
    margin-top: 0.1rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.dashboard-kpi-detail-value {
    flex: 0 0 auto;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.dashboard-work-center-panel {
    min-width: 0;
    margin-bottom: 0;
    padding: 0.82rem 0.9rem 0.9rem;
}

.dashboard-work-center-head {
    align-items: center;
    margin-bottom: 0.72rem;
}

.dashboard-work-center-head .helper-text {
    margin-top: 0.2rem;
}

.dashboard-work-center-head .status-pill {
    flex: 0 0 auto;
    white-space: nowrap;
}

.dashboard-work-center-table-wrap {
    max-height: min(32rem, 62vh);
    border-radius: var(--radius-sm);
}

.dashboard-work-center-table {
    min-width: 980px;
    table-layout: fixed;
}

.dashboard-work-center-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.62rem 0.7rem;
    background: #f7f9f9;
    letter-spacing: 0;
}

.dashboard-work-center-table td {
    padding: 0.64rem 0.7rem;
    vertical-align: middle;
}

.dashboard-work-center-table th:nth-child(1) {
    width: 7.25rem;
}

.dashboard-work-center-table th:nth-child(2) {
    width: 34%;
}

.dashboard-work-center-table th:nth-child(3) {
    width: 9.5rem;
}

.dashboard-work-center-table th:nth-child(4) {
    width: 10rem;
}

.dashboard-work-center-table th:nth-child(5) {
    width: 6rem;
}

.dashboard-work-center-table th:nth-child(6) {
    width: 9rem;
}

.dashboard-work-center-table th:nth-child(7) {
    width: 7rem;
}

.dashboard-work-center-table tr[data-tone="danger"] td:first-child {
    border-left: 4px solid var(--danger);
}

.dashboard-work-center-table tr[data-tone="warning"] td:first-child {
    border-left: 4px solid var(--warning);
}

.dashboard-work-center-table tr[data-overdue="true"] {
    background: rgba(185, 28, 28, 0.035);
}

.dashboard-work-center-item {
    min-width: 0;
    display: grid;
    gap: 0.14rem;
}

.dashboard-work-center-item strong,
.dashboard-work-center-item small,
.dashboard-work-center-item > span:not(.dashboard-work-center-source) {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-work-center-item strong {
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.24;
}

.dashboard-work-center-item small,
.dashboard-work-center-item > span:not(.dashboard-work-center-source) {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.3;
}

.dashboard-work-center-source {
    width: fit-content;
    color: var(--accent-strong);
    font-size: 0.68rem;
    font-weight: 800;
}

.dashboard-work-center-due[data-overdue="true"] {
    color: var(--danger);
    font-weight: 800;
}

.dashboard-work-center-count {
    font-weight: 850;
    text-align: right;
}

.dashboard-work-center-table td[data-cell-role="actions"] .tiny-button {
    width: 100%;
}

.dashboard-zone-top-grid {
    display: grid;
    grid-template-columns: minmax(24rem, 1.08fr) minmax(0, 0.92fr);
    gap: 0.72rem;
    align-items: start;
}

.dashboard-zone-top-grid .stat-grid {
    margin-bottom: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-zone-top-grid .dashboard-today-panel {
    min-height: 100%;
    margin-bottom: 0;
}

.dashboard-zone-top-grid .dashboard-today-grid {
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.dashboard-freshness-inline {
    min-width: 0;
    min-height: 1.75rem;
    margin-top: 0.32rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.45rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.dashboard-freshness-label {
    font-weight: 800;
}

.dashboard-freshness-inline[data-tone="online"] .dashboard-freshness-label {
    color: var(--success-strong, #166534);
}

.dashboard-freshness-inline[data-tone="warning"] .dashboard-freshness-label,
.dashboard-freshness-inline[data-tone="warning"] .dashboard-freshness-helper {
    color: #92400e;
}

.dashboard-freshness-inline[data-tone="danger"] .dashboard-freshness-label,
.dashboard-freshness-inline[data-tone="danger"] .dashboard-freshness-helper {
    color: #b91c1c;
}

.dashboard-freshness-time {
    white-space: nowrap;
}

.dashboard-freshness-helper {
    min-width: 0;
    max-width: 34rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.dashboard-auto-refresh-toggle {
    min-height: 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.48rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f7f9f9;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-auto-refresh-toggle[data-enabled="true"] {
    border-color: #a7d7cf;
    background: #edf8f5;
    color: #0f766e;
}

.dashboard-auto-refresh-toggle input {
    width: 0.9rem;
    height: 0.9rem;
    margin: 0;
    accent-color: var(--primary);
}

.dashboard-auto-refresh-toggle:focus-within {
    outline: 2px solid rgba(15, 118, 110, 0.22);
    outline-offset: 1px;
}

.dashboard-freshness-inline .tiny-button {
    min-height: 1.75rem;
    padding: 0.22rem 0.48rem;
    font-size: 0.74rem;
}

.dashboard-filter-panel {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
}

.dashboard-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0;
}

.dashboard-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-filter-body {
    margin-top: 0.85rem;
}

.dashboard-filter-grid {
    display: grid;
    grid-template-columns: minmax(12rem, 1.25fr) repeat(6, minmax(8.5rem, 1fr));
    gap: 0.55rem;
    align-items: end;
}

.dashboard-filter-summary {
    margin-top: 0.55rem;
    margin-bottom: 0;
}

.dashboard-today-panel {
    margin-bottom: 0.75rem;
    padding: 0.85rem 0.95rem;
}

.dashboard-today-panel .panel-head {
    align-items: center;
    margin-bottom: 0.68rem;
}

.dashboard-today-panel .panel-head > div {
    padding-right: 0.4rem;
}

.dashboard-today-panel .status-pill {
    flex: 0 0 auto;
    margin-top: 0.05rem;
    white-space: nowrap;
}

.dashboard-today-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
}

.dashboard-today-card {
    min-width: 0;
    min-height: 5.8rem;
    padding: 0.58rem 0.64rem;
    display: grid;
    align-content: start;
    gap: 0.24rem;
    border: 1px solid var(--line);
    border-left: 4px solid rgba(15, 23, 42, 0.18);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    text-align: left;
    appearance: none;
    cursor: pointer;
}

.dashboard-today-card:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 107, 109, 0.26);
    background: #ffffff;
}

.dashboard-today-card:focus-visible {
    outline: 3px solid rgba(20, 115, 112, 0.28);
    outline-offset: 3px;
}

.dashboard-today-card[data-tone="danger"] {
    border-left-color: var(--danger);
}

.dashboard-today-card[data-tone="warning"] {
    border-left-color: var(--warning);
}

.dashboard-today-card[data-tone="online"] {
    border-left-color: var(--success);
}

.dashboard-today-card strong {
    font-family: var(--font-display);
    font-size: 1.42rem;
    line-height: 1.05;
}

.dashboard-today-card > span:not(.dashboard-item-kicker) {
    min-width: 0;
    color: var(--ink);
    font-weight: 900;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.dashboard-today-card small {
    min-width: 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.dashboard-create-menu {
    position: relative;
    flex: 0 0 auto;
}

.dashboard-create-menu-panel {
    position: absolute;
    z-index: 46;
    top: calc(100% + 0.42rem);
    right: 0;
    width: min(18rem, calc(100vw - 2rem));
    padding: 0.4rem;
    display: grid;
    gap: 0.18rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
}

.dashboard-create-menu-panel[hidden] {
    display: none;
}

.dashboard-create-menu-panel button {
    min-height: 2.45rem;
    padding: 0.56rem 0.68rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.dashboard-create-menu-panel button:hover,
.dashboard-create-menu-panel button:focus-visible {
    background: var(--accent-soft);
    color: var(--accent-strong);
    outline: none;
}

body.dashboard-drilldown-open {
    overflow: hidden;
}

.dashboard-drilldown-backdrop {
    position: fixed;
    z-index: 80;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(4px) saturate(0.9);
    -webkit-backdrop-filter: blur(4px) saturate(0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease-out;
}

.dashboard-drilldown-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.dashboard-drilldown-drawer {
    position: fixed;
    z-index: 82;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: min(68rem, calc(100vw - 2rem));
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    box-shadow: 0 28px 72px rgba(15, 23, 42, 0.24), 0 10px 28px rgba(15, 23, 42, 0.14);
}

.dashboard-drilldown-drawer.is-open {
    animation: productDrawerIn 160ms ease-out;
}

.dashboard-drilldown-drawer[hidden],
.dashboard-drilldown-backdrop[hidden] {
    display: none;
}

.dashboard-drilldown-head {
    margin: 0;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.dashboard-drilldown-head > div:first-child {
    min-width: 0;
    padding-right: 0.5rem;
}

.dashboard-drilldown-content {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 0.9rem 1.1rem 1.1rem;
    scrollbar-gutter: stable;
}

.dashboard-drilldown-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-drilldown-table {
    max-height: none;
    overflow: auto;
    margin-top: 0.1rem;
}

.dashboard-drilldown-table td {
    font-size: 0.9rem;
}

.dashboard-drilldown-table td:nth-child(1),
.dashboard-drilldown-table td:nth-child(2) {
    font-weight: 750;
}

.dashboard-kpi-card {
    min-height: 5.7rem;
    display: grid;
    align-content: start;
    width: 100%;
    font: inherit;
    color: inherit;
    text-align: left;
    appearance: none;
    cursor: pointer;
    border-left: 4px solid rgba(15, 23, 42, 0.18);
}

.dashboard-kpi-card:hover {
    transform: translateY(-1px);
    border-color: rgba(20, 115, 112, 0.32);
}

.dashboard-kpi-card:focus-visible {
    outline: 3px solid rgba(20, 115, 112, 0.28);
    outline-offset: 3px;
}

.dashboard-kpi-card strong {
    font-size: 1.18rem;
    line-height: 1.16;
    overflow-wrap: anywhere;
}

.dashboard-kpi-card[data-tone="online"] {
    border-left-color: var(--success);
}

.dashboard-kpi-card[data-tone="warning"] {
    border-left-color: var(--warning);
}

.dashboard-kpi-card[data-tone="danger"] {
    border-left-color: var(--danger);
}

.dashboard-operations-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.72rem;
    margin-bottom: 0.75rem;
    align-items: start;
}

.dashboard-domain-tabs {
    display: flex;
    align-items: end;
    gap: 0.2rem;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
}

.dashboard-domain-tab {
    flex: 0 0 auto;
    min-height: 2.55rem;
    padding: 0.55rem 0.9rem 0.48rem;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.dashboard-domain-tab:hover {
    color: var(--ink);
    background: #f8fafc;
}

.dashboard-domain-tab[aria-selected="true"] {
    color: var(--accent-strong);
    border-bottom-color: var(--accent);
    background: var(--accent-soft);
}

.dashboard-domain-tab:focus-visible {
    outline: 2px solid rgba(13, 120, 116, 0.34);
    outline-offset: -3px;
}

.dashboard-domain-panels,
.dashboard-domain-panel {
    min-width: 0;
}

.dashboard-domain-panel {
    display: grid;
    gap: 0.65rem;
}

.dashboard-domain-panel[hidden] {
    display: none;
}

.dashboard-stock-control-panel {
    grid-column: 1 / -1;
    min-width: 0;
}

#dashboard-stock-control {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.dashboard-stock-control-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    align-items: center;
    margin-bottom: 0.62rem;
}

.dashboard-stock-control-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.42rem;
    margin-bottom: 0.7rem;
}

.dashboard-stock-control-tab {
    min-width: 0;
    min-height: 3.65rem;
    padding: 0.5rem 0.62rem;
    border: 1px solid var(--line);
    border-left: 4px solid rgba(15, 23, 42, 0.2);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.dashboard-stock-control-tab[data-tone="danger"] {
    border-left-color: var(--danger);
}

.dashboard-stock-control-tab[data-tone="warning"] {
    border-left-color: var(--warning);
}

.dashboard-stock-control-tab[data-tone="clear"] {
    border-left-color: var(--success);
}

.dashboard-stock-control-tab[aria-pressed="true"] {
    border-color: rgba(13, 120, 116, 0.55);
    border-left-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(13, 120, 116, 0.08);
}

.dashboard-stock-control-tab span,
.dashboard-stock-control-tab strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-stock-control-tab span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.2;
}

.dashboard-stock-control-tab strong {
    margin-top: 0.18rem;
    font-size: 1.08rem;
    line-height: 1.15;
}

.dashboard-stock-control-section-head {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: end;
    margin-bottom: 0.42rem;
}

.dashboard-stock-control-section-head h4 {
    margin: 0 0 0.12rem;
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.2;
}

.dashboard-stock-control-section-head .helper-text {
    margin: 0;
}

.dashboard-stock-control-table table {
    min-width: 760px;
}

.dashboard-stock-control-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.dashboard-stock-control-table td,
.dashboard-stock-control-table th {
    padding: 0.5rem 0.58rem;
    vertical-align: top;
}

.dashboard-metric-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.dashboard-metric-item {
    min-width: 0;
    min-height: 5.25rem;
    padding: 0.58rem 0.66rem;
    border: 1px solid var(--line);
    border-left: 4px solid rgba(15, 23, 42, 0.18);
    border-radius: var(--radius-sm);
    background: #ffffff;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.48rem;
    align-items: start;
}

.dashboard-metric-item[data-tone="danger"] {
    border-left-color: var(--danger);
}

.dashboard-metric-item[data-tone="warning"] {
    border-left-color: var(--warning);
}

.dashboard-metric-item[data-tone="online"] {
    border-left-color: var(--success);
}

.dashboard-metric-copy {
    min-width: 0;
    display: grid;
    gap: 0.14rem;
}

.dashboard-metric-copy span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.dashboard-metric-copy strong {
    min-width: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.02rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.dashboard-metric-copy small {
    min-width: 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.dashboard-owner-inventory-panel {
    grid-column: 1 / -1;
}

.owner-inventory-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    align-items: center;
    margin-bottom: 0.62rem;
}

.owner-inventory-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.46rem;
    margin-bottom: 0.78rem;
}

.owner-inventory-metric {
    min-width: 0;
    min-height: 4.4rem;
    padding: 0.54rem 0.62rem;
    border: 1px solid var(--line);
    border-left: 4px solid rgba(15, 23, 42, 0.18);
    border-radius: var(--radius-sm);
    background: #fff;
}

.owner-inventory-metric[data-severity="CRITICAL"] {
    border-left-color: var(--danger);
}

.owner-inventory-metric[data-severity="WARNING"] {
    border-left-color: var(--warning);
}

.owner-inventory-metric[data-severity="OK"] {
    border-left-color: var(--success);
}

.owner-inventory-metric span,
.owner-inventory-metric small {
    display: block;
    min-width: 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.owner-inventory-metric span {
    font-weight: 850;
}

.owner-inventory-metric strong {
    display: block;
    margin: 0.12rem 0;
    color: var(--ink);
    font-size: 1.02rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.owner-inventory-split {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 0.7rem;
}

.owner-inventory-split h4 {
    margin: 0 0 0.42rem;
    color: var(--ink);
    font-size: 0.88rem;
    line-height: 1.2;
}

.owner-inventory-table table {
    min-width: 720px;
}

.owner-inventory-table td,
.owner-inventory-table th {
    padding: 0.52rem 0.58rem;
    vertical-align: top;
}

.owner-inventory-alert-detail {
    display: block;
    margin-top: 0.22rem;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.subsection-title {
    margin: 0.95rem 0 0.45rem;
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.22;
}

.dashboard-pipeline-panel {
    margin-bottom: 0;
}

.dashboard-tracking-details {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.dashboard-tracking-details[hidden] {
    display: none;
}

.dashboard-tracking-summary {
    min-height: 3.8rem;
    padding: 0.72rem 0.88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
}

.dashboard-tracking-summary::-webkit-details-marker {
    display: none;
}

.dashboard-tracking-summary > span:first-child {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.dashboard-tracking-summary strong {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1.2;
}

.dashboard-tracking-summary-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
}

.dashboard-tracking-chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 140ms ease-out;
}

.dashboard-tracking-details[open] .dashboard-tracking-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.dashboard-tracking-details[open] .dashboard-tracking-summary {
    border-bottom: 1px solid var(--line);
}

.dashboard-tracking-content {
    min-width: 0;
    padding: 0.72rem;
    display: grid;
    gap: 0.72rem;
}

.dashboard-pipeline-grid {
    display: grid;
    gap: 0.55rem;
}

.dashboard-pipeline-lane {
    display: grid;
    grid-template-columns: minmax(12rem, 0.32fr) minmax(0, 1fr);
    gap: 0.65rem;
    align-items: stretch;
    padding: 0.58rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.dashboard-pipeline-head {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 0.28rem;
}

.dashboard-pipeline-head strong {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.98rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.dashboard-pipeline-head .meta-chip {
    justify-self: start;
}

.dashboard-pipeline-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
}

.dashboard-pipeline-step {
    min-width: 0;
    min-height: 4.35rem;
    padding: 0.48rem 0.55rem;
    display: grid;
    align-content: start;
    gap: 0.18rem;
    border: 1px solid var(--line);
    border-left: 4px solid rgba(15, 23, 42, 0.18);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--ink);
    text-align: left;
}

.dashboard-pipeline-step:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 107, 109, 0.26);
    background: #ffffff;
}

.dashboard-pipeline-step span,
.dashboard-pipeline-step small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-pipeline-step span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.dashboard-pipeline-step strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.08;
}

.dashboard-pipeline-step small {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.22;
}

.dashboard-pipeline-step[data-tone="warning"] {
    border-left-color: var(--warning);
}

.dashboard-pipeline-step[data-tone="danger"] {
    border-left-color: var(--danger);
}

.dashboard-pipeline-step[data-tone="online"] {
    border-left-color: var(--success);
}

.dashboard-command-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 0.72rem;
    margin-bottom: 0;
    align-items: start;
}

.dashboard-intelligence-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.96fr) minmax(0, 0.86fr);
    gap: 0.72rem;
    margin-bottom: 0;
    align-items: start;
}

.dashboard-command-panel {
    min-height: 100%;
}

.dashboard-list-item,
.dashboard-timeline-item,
.dashboard-audit-item,
.dashboard-role-item {
    border-left: 4px solid rgba(15, 23, 42, 0.18);
}

.dashboard-audit-panel {
    max-height: 15.4rem;
    display: flex;
    flex-direction: column;
}

.dashboard-audit-panel .panel-head {
    margin-bottom: 0.52rem;
}

.dashboard-audit-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.42rem;
    flex-wrap: wrap;
}

.compact-select {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.compact-select select {
    width: auto;
    min-width: 10.5rem;
    min-height: 0;
    padding: 0.48rem 0.78rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

.dashboard-audit-list {
    min-height: 0;
    max-height: min(11.8rem, 30vh);
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-gutter: stable;
}

.dashboard-audit-list::-webkit-scrollbar {
    width: 0.45rem;
}

.dashboard-audit-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(30, 47, 66, 0.22);
}

.dashboard-audit-item {
    display: grid;
    padding: 0.48rem 0.64rem;
    gap: 0.15rem;
}

.dashboard-audit-table {
    display: grid;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #ffffff;
}

.dashboard-audit-row {
    display: grid;
    grid-template-columns: minmax(5.8rem, 1.12fr) minmax(3.85rem, 0.42fr) minmax(4.3rem, 0.58fr) minmax(5.8rem, 0.98fr);
    gap: 0.45rem;
    align-items: center;
    min-width: 0;
    padding: 0.42rem 0.55rem;
    border-left: 3px solid rgba(15, 23, 42, 0.16);
    border-bottom: 1px solid var(--line);
    font-size: 0.78rem;
}

.dashboard-audit-row:last-child {
    border-bottom: 0;
}

.dashboard-audit-row-head {
    border-left-color: transparent;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-audit-row[data-tone="danger"] {
    border-left-color: var(--danger);
}

.dashboard-audit-row[data-tone="warning"] {
    border-left-color: var(--warning);
}

.dashboard-audit-row[data-tone="online"] {
    border-left-color: var(--success);
}

.dashboard-audit-row > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-audit-type {
    display: grid;
    gap: 0.04rem;
}

.dashboard-audit-type strong,
.dashboard-audit-type small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-audit-type small,
.dashboard-audit-time,
.dashboard-audit-user {
    color: var(--muted);
}

.dashboard-audit-document {
    font-weight: 700;
}

.dashboard-audit-compact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
}

.dashboard-audit-sentence {
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-audit-compact-row .meta-chip {
    flex: 0 0 auto;
    padding: 0.28rem 0.52rem;
    font-size: 0.72rem;
}

.dashboard-audit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-audit-head strong {
    min-width: 0;
    font-size: 0.96rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.dashboard-audit-head .meta-chip {
    flex: 0 0 auto;
    padding: 0.34rem 0.58rem;
    font-size: 0.78rem;
}

.dashboard-audit-meta {
    display: flex;
    gap: 0.25rem 0.65rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.dashboard-audit-detail {
    min-width: 0;
    max-width: 14rem;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-list-item[data-tone="danger"],
.dashboard-timeline-item[data-tone="danger"],
.dashboard-audit-item[data-tone="danger"] {
    border-left-color: var(--danger);
}

.dashboard-list-item[data-tone="warning"],
.dashboard-timeline-item[data-tone="warning"] {
    border-left-color: var(--warning);
}

.dashboard-list-item[data-tone="online"],
.dashboard-audit-item[data-tone="online"] {
    border-left-color: var(--success);
}

.dashboard-list-actions {
    display: grid;
    gap: 0.3rem;
    justify-items: end;
    align-content: center;
    flex: 0 0 auto;
}

.dashboard-list-metric {
    min-width: 2rem;
    min-height: 1.72rem;
    padding: 0.12rem 0.42rem;
    border-radius: var(--radius-sm);
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    font-family: var(--font-display);
    font-size: 0.98rem;
    color: var(--ink);
}

.dashboard-item-meta {
    margin-top: 0.22rem;
    display: flex;
    gap: 0.22rem;
    flex-wrap: wrap;
}

.dashboard-item-meta-chip {
    max-width: 100%;
    padding: 0.2rem 0.38rem;
    border-radius: 999px;
    background: rgba(30, 47, 66, 0.07);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.dashboard-priority-chip[data-priority="high"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.dashboard-priority-chip[data-priority="medium"] {
    background: var(--warn-soft);
    color: var(--warning);
}

.dashboard-priority-chip[data-priority="normal"] {
    background: var(--success-soft);
    color: var(--success);
}

.dashboard-timeline-item {
    display: grid;
    grid-template-columns: minmax(5.75rem, 0.28fr) minmax(0, 1fr) auto;
    align-items: center;
}

.dashboard-timeline-date {
    display: grid;
    gap: 0.12rem;
}

.dashboard-timeline-date strong {
    font-size: 0.95rem;
}

.dashboard-timeline-date span,
.dashboard-item-kicker {
    color: var(--muted);
    font-size: 0.8rem;
}

.dashboard-item-kicker {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.dashboard-role-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-role-item .tiny-button,
.dashboard-timeline-item .tiny-button {
    justify-self: end;
}

.board-grid,
.split-layout,
.purchase-grid,
.section-stack {
    display: grid;
    gap: 0.72rem;
}

.admin-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.9rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
}

.admin-tab-button {
    flex: 0 0 auto;
    min-height: 2.65rem;
    padding: 0.55rem 0.85rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.admin-tab-button:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.admin-tab-button.is-active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.admin-tab-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.admin-tab-panel {
    min-width: 0;
}

.admin-tab-panel[hidden] {
    display: none;
}

.segmented-control {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.segmented-control button {
    min-height: 2.25rem;
    padding: 0.35rem 0.8rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.segmented-control button.active {
    background: var(--accent);
    color: #fff;
}

.mobile-scan-match-grid {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
}

.mobile-scan-match {
    display: grid;
    gap: 0.35rem;
    width: 100%;
    padding: 0.85rem;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
}

.mobile-scan-match:hover,
.mobile-scan-match:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: none;
}

.mobile-scan-video {
    width: 100%;
    min-height: 220px;
    max-height: 52vh;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #111827;
}

.admin-panel-grid > .admin-wide-panel,
.admin-panel-grid > #admin-company-owner-master-root,
.admin-panel-grid > #admin-business-settings-root,
.admin-panel-grid > #admin-document-numbering-root,
.admin-panel-grid > #admin-approval-threshold-root,
.admin-panel-grid > #admin-system-build-panel {
    grid-column: 1 / -1;
}

.organization-master-section {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.organization-master-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.organization-master-layout {
    display: grid;
    grid-template-columns: minmax(18rem, 0.8fr) minmax(0, 1.4fr);
    gap: 0.85rem;
    align-items: start;
}

.organization-master-form {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

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

.organization-master-table td {
    vertical-align: top;
}

.organization-master-name {
    display: grid;
    gap: 0.15rem;
}

.system-settings-workbench {
    gap: 0;
}

.system-settings-section {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.system-settings-company {
    margin-top: 0.9rem;
}

.system-settings-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.system-settings-section-head > div:first-child {
    min-width: 0;
}

.system-settings-company-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.55rem;
}

.system-settings-identity-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border-block: 1px solid var(--border);
}

.system-settings-identity-grid > div {
    min-width: 0;
    padding: 0.75rem 0.9rem;
    border-right: 1px solid var(--border);
}

.system-settings-identity-grid > div:last-child {
    border-right: 0;
}

.system-settings-identity-grid dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.system-settings-identity-grid dd {
    margin: 0.2rem 0 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.system-settings-inline-message {
    padding: 0.75rem 0.9rem;
    border-radius: 6px;
    font-size: 0.88rem;
}

.system-settings-inline-message.warning {
    background: var(--warning-soft);
    color: var(--warning-text, #7a4b00);
}

.system-settings-inline-message.info {
    background: rgba(30, 47, 66, 0.08);
    color: var(--ink);
}

.system-settings-primary-fields {
    grid-template-columns: minmax(16rem, 30rem);
}

.system-settings-primary-fields label small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
}

.system-settings-disclosure {
    border-top: 1px solid var(--border);
}

.system-settings-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    cursor: pointer;
    list-style: none;
}

.system-settings-disclosure > summary::-webkit-details-marker {
    display: none;
}

.system-settings-disclosure > summary::after {
    content: "+";
    display: grid;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 800;
}

.system-settings-disclosure[open] > summary::after {
    content: "−";
}

.system-settings-disclosure > summary span {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.system-settings-disclosure > summary small {
    color: var(--muted);
    font-weight: 400;
    line-height: 1.45;
}

.system-settings-disclosure-body {
    padding: 0.15rem 0 0.85rem;
}

.system-settings-accounting-note {
    margin-bottom: 0.9rem;
}

.system-settings-guidance {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
}

.system-settings-guidance strong {
    color: var(--text);
}

@media (max-width: 800px) {
    .system-settings-section-head,
    .system-settings-company-actions,
    .system-settings-guidance {
        align-items: stretch;
        flex-direction: column;
    }

    .system-settings-company-actions .button {
        width: 100%;
    }

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

    .system-settings-identity-grid > div:nth-child(2) {
        border-right: 0;
    }

    .system-settings-identity-grid > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }

    .system-settings-primary-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .system-settings-identity-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .system-settings-identity-grid > div,
    .system-settings-identity-grid > div:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .system-settings-identity-grid > div:last-child {
        border-bottom: 0;
    }
}

.organization-master-name small {
    color: var(--muted);
}

.admin-data-migration-panel {
    padding: 0.95rem;
}

.advanced-tool-disclosure {
    display: block;
}

.advanced-tool-disclosure > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 0.75rem;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.advanced-tool-disclosure > summary::-webkit-details-marker {
    display: none;
}

.advanced-tool-disclosure > summary::after {
    content: "+";
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--accent);
    font-weight: 800;
}

.advanced-tool-disclosure[open] > summary {
    margin-bottom: 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.advanced-tool-disclosure[open] > summary::after {
    content: "-";
}

.advanced-tool-disclosure > summary .eyebrow,
.advanced-tool-disclosure > summary .helper-text {
    grid-column: 1;
}

.advanced-tool-disclosure > summary strong {
    grid-column: 1;
    font-size: 1.05rem;
}

.inventory-usage-history-body {
    display: grid;
    gap: 0.8rem;
}

.inventory-usage-history-toolbar {
    margin: 0;
    min-height: 2rem;
}

.inventory-usage-history-table-wrap table {
    min-width: 1020px;
}

.usage-history-month-details > summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

.usage-history-month-details > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(5.5rem, 1fr));
    gap: 0.35rem;
    margin-top: 0.45rem;
    min-width: 13rem;
}

.usage-history-month-details span {
    display: grid;
    gap: 0.1rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-soft);
}

.usage-history-month-details small {
    color: var(--muted);
}

.document-numbering-table {
    overflow-x: auto;
}

.document-numbering-table table {
    min-width: 980px;
}

.document-numbering-table input,
.document-numbering-table select {
    min-width: 5.5rem;
}

.document-numbering-table input[data-field="format_template"] {
    min-width: 13rem;
}

.numbering-preview {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

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

.split-layout {
    grid-template-columns: 340px minmax(0, 1fr);
}

#section-customers .customer-directory-layout-readonly {
    grid-template-columns: minmax(0, 1fr);
}

#section-customers .customer-directory-panel-readonly {
    width: 100%;
}

#section-customers .customer-directory-layout-readonly .customer-actions-column {
    display: none;
}

#section-suppliers .supplier-directory-layout-readonly {
    grid-template-columns: minmax(0, 1fr);
}

#section-suppliers .supplier-directory-panel-readonly {
    width: 100%;
}

.supplier-directory-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.supplier-directory-summary > div {
    display: grid;
    min-width: 0;
    gap: 0.2rem;
    padding: 0.75rem 0.85rem;
    border-right: 1px solid var(--border);
}

.supplier-directory-summary > div:last-child {
    border-right: 0;
}

.supplier-directory-summary span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.supplier-directory-summary strong {
    font-size: 1.25rem;
}

#section-suppliers .table-toolbar {
    align-items: end;
}

#section-suppliers .search-field {
    flex: 1 1 24rem;
}

#section-suppliers .supplier-status-filter {
    flex: 0 1 13rem;
    min-width: 11rem;
}

.supplier-directory-table {
    min-width: 1060px;
}

.supplier-planning-column {
    display: none;
}

#section-suppliers .supplier-directory-layout-readonly .supplier-purchasing-column,
#section-suppliers .supplier-directory-layout-readonly .supplier-actions-column {
    display: none;
}

#section-suppliers .supplier-directory-layout-readonly .supplier-planning-column {
    display: table-cell;
}

#section-suppliers .supplier-directory-layout-readonly .supplier-directory-table {
    min-width: 760px;
}

@media (max-width: 760px) {
    .supplier-directory-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .supplier-directory-summary > div:nth-child(2) {
        border-right: 0;
    }

    .supplier-directory-summary > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }

    #section-suppliers .table-toolbar,
    #section-suppliers .toolbar-actions,
    #section-suppliers .search-field,
    #section-suppliers .supplier-status-filter {
        width: 100%;
        min-width: 0;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table {
        display: block;
        width: 100%;
        min-width: 0;
        background: transparent;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table tbody {
        display: grid;
        gap: 0.65rem;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem 0.85rem;
        padding: 0.8rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table td {
        display: grid;
        min-width: 0;
        gap: 0.25rem;
        padding: 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 700;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table td:nth-child(2),
    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table td:nth-child(3) {
        grid-column: 1 / -1;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table .supplier-purchasing-column,
    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table .supplier-actions-column {
        display: none;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table td[colspan] {
        grid-column: 1 / -1;
    }

    #section-suppliers .supplier-directory-layout-readonly .supplier-directory-table .empty-state {
        grid-column: 1 / -1;
    }
}

#section-sales-orders .sales-orders-layout-readonly {
    grid-template-columns: minmax(0, 1fr);
}

#section-sales-orders .sales-orders-register-panel-readonly {
    grid-column: 1 / -1;
    width: 100%;
}

.warehouse-admin-stack {
    display: grid;
    gap: 0.72rem;
    align-content: start;
    min-width: 0;
}

.trace-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1rem;
    align-items: start;
}

.trace-search-form .form-grid {
    grid-template-columns: minmax(14rem, 1.1fr) minmax(9rem, 0.7fr) minmax(7rem, 0.45fr);
}

.trace-list {
    max-height: 34rem;
    overflow: auto;
    padding-right: 0.15rem;
}

.trace-node-card,
.trace-link-card {
    align-items: start;
}

.trace-node-card.is-root {
    border-color: rgba(16, 112, 112, 0.32);
    box-shadow: inset 3px 0 0 var(--primary);
}

.trace-link-arrow {
    color: var(--primary);
    font-weight: 800;
}

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

.product-page-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    max-width: 100%;
    margin: 0 0 0.75rem;
    padding: 0.24rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.product-page-tab {
    min-height: 2.34rem;
    padding: 0.46rem 0.78rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
}

.product-page-tab:hover,
.product-page-tab:focus-visible {
    background: rgba(15, 107, 109, 0.08);
    color: var(--primary);
}

.product-page-tab.is-active {
    background: rgba(15, 107, 109, 0.12);
    color: var(--primary);
}

.products-view-panel[hidden] {
    display: none;
}

.product-settings-view {
    display: grid;
    gap: 0.85rem;
}

.product-settings-intro {
    padding: 0.78rem 0.88rem;
    border-radius: var(--radius-md);
}

.product-settings-intro h3 {
    margin: 0;
}

.purchase-grid {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    align-items: start;
}

.purchase-grid .detail-panel {
    grid-column: 1 / -1;
}

#section-purchase-orders .document-workbench-readonly {
    grid-template-columns: minmax(0, 1fr);
}

#section-purchase-orders .document-workbench-readonly > .document-register-panel {
    grid-column: 1 / -1;
}

#section-purchase-orders .document-detail-panel[hidden] {
    display: none;
}

.purchase-orders-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 -0.8rem 0.8rem;
    border-block: 1px solid var(--line);
}

.purchase-orders-overview-item {
    min-width: 0;
    padding: 0.65rem 0.8rem;
    border-right: 1px solid var(--line);
    display: grid;
    gap: 0.18rem;
}

.purchase-orders-overview-item:last-child {
    border-right: 0;
}

.purchase-orders-overview-item span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.purchase-orders-overview-item strong {
    color: var(--ink);
    font-size: 1.18rem;
}

.purchase-orders-overview-item[data-tone="danger"] {
    box-shadow: inset 0 3px 0 var(--danger);
}

.purchase-orders-overview-item[data-tone="warning"] {
    box-shadow: inset 0 3px 0 var(--warning);
}

#section-purchase-orders .purchase-orders-toolbar {
    display: grid;
    grid-template-columns: minmax(18rem, 2fr) minmax(10rem, 0.9fr) minmax(10rem, 0.85fr) minmax(10rem, 0.85fr) auto;
    gap: 0.65rem;
    align-items: end;
}

#section-purchase-orders .purchase-orders-toolbar .search-field {
    width: 100%;
}

#section-purchase-orders .purchase-orders-toolbar .toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

#section-purchase-orders .document-workbench-readonly .document-register-table table {
    width: 100%;
    table-layout: auto;
}

@media (max-width: 1280px) {
    #section-purchase-orders .purchase-orders-toolbar {
        grid-template-columns: minmax(0, 2fr) minmax(10rem, 1fr);
    }

    #section-purchase-orders .purchase-orders-toolbar .toolbar-actions {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 760px) {
    .purchase-orders-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .purchase-orders-overview-item:nth-child(2n) {
        border-right: 0;
    }

    .purchase-orders-overview-item:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    #section-purchase-orders .purchase-orders-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    #section-purchase-orders .purchase-orders-toolbar .toolbar-actions {
        grid-column: auto;
        justify-self: stretch;
    }

    #section-purchase-orders .purchase-orders-toolbar .toolbar-actions .button {
        flex: 1 1 0;
    }
}

.document-workbench .document-register-panel,
.document-workbench .document-detail-panel,
.document-workbench .document-queue-panel,
.approval-workbench .approval-register-panel,
.approval-workbench .approval-detail-panel {
    min-width: 0;
}

.document-workbench .detail-panel-body,
.approval-detail-body {
    display: grid;
    gap: 1rem;
}

.purchase-grid.approval-workbench {
    grid-template-columns: minmax(0, 1fr);
}

.approval-workbench > .approval-register-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.approval-workspace-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid #d7dfe3;
    margin-bottom: 1rem;
}

.approval-workspace-tabs button {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: #506272;
    background: transparent;
}

.approval-workspace-tabs button[aria-selected="true"] {
    color: #087b76;
    border-bottom-color: #087b76;
    background: #eff8f7;
}

.approval-workspace-tabs button span {
    min-width: 1.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #e9edef;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.approval-register-table th:nth-child(2) { width: 34%; }
.approval-register-table td { vertical-align: top; }
.approval-register-table td small, .approval-register-subject {
    display: block;
    margin-top: 0.3rem;
    overflow-wrap: anywhere;
}
.approval-register-table td small { color: #637385; }
.approval-register-filters { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(130px, 1fr) auto; align-items: end; gap: 0.75rem; margin-bottom: 1rem; }
.approval-register-filters label { min-width: 0; display: grid; gap: 0.35rem; }
.approval-register-filters input, .approval-register-filters select { width: 100%; min-width: 0; }
.approval-register-filters label > span { color: #637385; font-size: 0.85rem; }
.approval-register-panel [data-table-pagination="approvalRequests"] { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; }
.approval-register-panel [data-table-pagination="approvalRequests"] > span { margin-right: auto; }
.approval-extra { border-bottom: 1px solid #e0e5e8; padding: 1rem 0; }
.approval-extra > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; list-style: none; cursor: pointer; font-weight: 600; }
.approval-extra > summary::-webkit-details-marker { display: none; }
.approval-extra > summary::after { content: "+"; display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid #d7dfe3; border-radius: 4px; color: #087b76; }
.approval-extra[open] > summary { margin-bottom: 1rem; }
.approval-extra[open] > summary::after { content: "-"; }
.approval-rule-roles { grid-column: 1 / -1; }
.approval-source-return { margin-bottom: 1rem; max-width: 100%; overflow-wrap: anywhere; }
.approval-document-link {
    border: 0;
    padding: 0;
    color: #087b76;
    background: transparent;
    text-align: left;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.approval-document-link:hover { text-decoration: underline; }

.approval-workspace-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    margin: 0;
    width: min(960px, calc(100% - 32px));
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    border: 0;
    border-left: 1px solid #d7dfe3;
    border-radius: 0;
    color: #18262f;
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.approval-workspace-drawer::backdrop { background: rgb(24 38 47 / 30%); }
.approval-workspace-drawer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
body.approval-drawer-open { overflow: hidden; }
.approval-drawer-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #d7dfe3;
}
.approval-drawer-header h3 { margin: 0; font-size: 1.125rem; overflow-wrap: anywhere; }
.approval-drawer-close { flex: 0 0 auto; white-space: nowrap; }
.approval-workspace-drawer .approval-detail-body { display: block; padding: 0 1.25rem; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.approval-detail-body > section { padding: 1.1rem 0; border-bottom: 1px solid #e0e5e8; }
.approval-detail-body h4 { margin: 0 0 0.75rem; font-size: 1rem; }
.approval-subject-heading { display: flex; justify-content: space-between; align-items: start; gap: 0.75rem; }
.approval-subject-heading .status-badge { flex-shrink: 0; }
.approval-request-reason { margin: 0 0 1rem; color: #506272; overflow-wrap: anywhere; }
.approval-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1rem; }
.approval-facts > div { min-width: 0; }
.approval-facts dt { font-size: 0.8rem; color: #637385; margin-bottom: 0.3rem; }
.approval-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.approval-source-items td { vertical-align: top; }
.approval-source-items td span { display: block; margin-top: 0.25rem; overflow-wrap: anywhere; }
.approval-source-items td:first-child { width: 52%; }
.approval-owner-section p { margin: 0.35rem 0; overflow-wrap: anywhere; }
.approval-own-notice { color: #806000; }
.approval-rule-section { color: #506272; }
.approval-load-error { padding: 0.75rem; background: #fff0f0; color: #aa2931; }
.approval-drawer-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: flex-end; padding: 0.85rem 1.25rem; border-top: 1px solid #d7dfe3; background: #fff; }
.approval-drawer-actions:empty { display: none; }
.approval-drawer-actions button { min-height: 44px; }
.approval-drawer-actions button:disabled,
.approval-register-panel [data-table-pagination="approvalRequests"] button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .approval-register-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .approval-register-filters label:first-child { grid-column: 1 / -1; }
    .approval-drawer-actions { padding: 0.75rem 0.85rem; gap: 0.5rem; }
    .approval-drawer-actions button { flex: 1 1 auto; overflow-wrap: anywhere; }
    .approval-workspace-drawer { width: 100%; }
    .approval-workspace-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .approval-workspace-tabs button { flex-direction: column; gap: 0.3rem; padding: 0.6rem 0.3rem; font-size: 0.8rem; }
    .approval-drawer-header { padding: 0.85rem; }
    .approval-workspace-drawer .approval-detail-body { padding: 0 0.85rem; }
    .approval-facts { gap: 0.8rem; }
    .approval-source-items table { min-width: 0; table-layout: fixed; }
    .approval-source-items th, .approval-source-items td { padding: 0.55rem; overflow-wrap: anywhere; }
}

.approval-context-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.approval-context-card {
    min-width: 0;
    padding: 0.58rem 0.68rem;
    border: 1px solid var(--line);
    border-left: 4px solid rgba(15, 107, 109, 0.38);
    border-radius: var(--radius-sm);
    background: #ffffff;
    display: grid;
    gap: 0.22rem;
}

.approval-context-card-wide {
    grid-column: 1 / -1;
}

.approval-context-card span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.approval-context-card strong {
    min-width: 0;
    color: var(--ink);
    font-size: 0.86rem;
    line-height: 1.32;
    overflow-wrap: anywhere;
}

.approval-context-card strong .status-pill {
    white-space: normal;
    line-height: 1.25;
}

.approval-audit-panel {
    padding: 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.approval-history-list {
    display: grid;
    gap: 0.42rem;
}

.approval-history-row {
    display: grid;
    grid-template-columns: minmax(6.5rem, 0.8fr) minmax(6rem, 0.75fr) minmax(7rem, 0.75fr) minmax(0, 1.45fr);
    gap: 0.5rem;
    align-items: start;
    padding: 0.52rem 0;
    border-top: 1px solid var(--line);
}

.approval-history-row:first-child {
    border-top: 0;
}

.approval-history-row strong,
.approval-history-row small,
.approval-history-row p {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.approval-history-row strong {
    color: var(--ink);
    font-size: 0.78rem;
}

.approval-history-row small,
.approval-history-row p {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.28;
}

.document-workbench .document-register-table,
.approval-workbench .approval-register-table {
    scroll-padding-inline: 1rem;
}

.board-panel,
.table-panel,
.form-panel,
.detail-panel {
    min-width: 0;
    padding: 0.8rem;
    border-radius: var(--radius-lg);
}

.split-layout > *,
.purchase-grid > *,
.board-grid > *,
.dashboard-operations-grid > *,
.dashboard-command-grid > *,
.dashboard-intelligence-grid > *,
.admin-panel-grid > * {
    min-width: 0;
}

.panel-head,
.subsection-head,
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.72rem;
    margin-bottom: 0.65rem;
}

.panel-head > div,
.subsection-head > div,
.section-heading > div,
.table-toolbar > *,
.detail-grid > * {
    min-width: 0;
}

.subsection-head {
    margin-top: 0.5rem;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.quick-card {
    min-height: 3rem;
    padding: 0.52rem 0.64rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    text-align: left;
    display: grid;
    align-content: center;
    gap: 0.1rem;
    box-shadow: none;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.quick-card:hover,
.quick-card:focus-visible {
    background: rgba(15, 107, 109, 0.08);
    border-color: rgba(15, 107, 109, 0.28);
    outline: none;
}

.quick-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0;
    font-size: 0.72rem;
    font-weight: 700;
}

.quick-card strong {
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.25;
}

.list-block {
    display: grid;
    gap: 0.45rem;
}

.list-item {
    padding: 0.58rem 0.68rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.45);
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
    align-items: center;
}

.list-item strong,
.detail-key > strong,
.detail-key-value {
    display: block;
}

.list-item span,
.detail-key > span,
.helper-text {
    color: var(--muted);
    font-size: 0.8rem;
}

.detail-key-value {
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.detail-key-value.detail-key-code {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
}

.detail-key-value .warehouse-availability-stack,
.detail-key-value .warehouse-health-stack {
    font-weight: 500;
}

.list-item.list-item-compact {
    align-items: start;
}

.list-item-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.list-item-copy strong,
.list-item-copy span {
    overflow-wrap: anywhere;
}

.delivery-queue-item {
    align-items: start;
}

.delivery-queue-meta {
    display: flex;
    gap: 0.32rem;
    flex-wrap: wrap;
    margin-top: 0.22rem;
}

.delivery-queue-actions {
    display: grid;
    gap: 0.32rem;
    justify-items: end;
}

.table-toolbar {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.9rem;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
}

.search-field {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.92rem;
    flex: 1 1 180px;
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.8rem;
    margin: 0 0 1rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.5);
}

.filter-grid label {
    min-width: 0;
}

.inventory-costing-health-filters {
    grid-template-columns: minmax(20rem, 2fr) minmax(12rem, 1fr) minmax(10rem, 1fr) auto;
    align-items: end;
    margin-top: 1rem;
}

.inventory-costing-health-query input,
.inventory-costing-health-filters select,
.inventory-costing-health-clear {
    min-height: 2.75rem;
}

.inventory-costing-health-result-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: -0.25rem 0 0.7rem;
}

.inventory-costing-health-result-bar .helper-text {
    margin: 0;
}

.inventory-costing-health-pagination .pagination-size {
    display: none;
}

@media (max-width: 760px) {
    .inventory-costing-health-filters {
        grid-template-columns: 1fr;
    }

    .inventory-costing-health-clear {
        width: 100%;
    }

    .inventory-costing-health-result-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}

.product-filter-grid select {
    min-height: 2.65rem;
}

.product-sales-filter-grid {
    grid-template-columns: repeat(3, minmax(12rem, 1fr));
    max-width: 68rem;
}

.product-sales-filter-grid select {
    min-height: 2.65rem;
}

.product-main-toolbar {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) auto auto;
    gap: 0.65rem;
    align-items: end;
    margin-bottom: 0.75rem;
    padding: 0.72rem 0.78rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.product-main-toolbar .search-field {
    flex: initial;
}

.product-main-toolbar .search-field input {
    min-height: 2.75rem;
}

.product-toolbar-filter-actions,
.product-toolbar-primary-actions {
    align-items: end;
    justify-content: flex-end;
    gap: 0.5rem;
}

.product-more-menu {
    position: relative;
}

.product-more-summary {
    min-height: 2.72rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.product-more-summary::-webkit-details-marker {
    display: none;
}

.product-more-summary::marker {
    content: "";
}

.product-more-menu-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 30;
    display: grid;
    gap: 0.4rem;
    min-width: 12rem;
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.product-more-menu-panel .button {
    width: 100%;
    justify-content: flex-start;
}

.product-more-menu:not([open]) .product-more-menu-panel {
    display: none;
}

.product-filter-primary {
    grid-template-columns: repeat(3, minmax(10.5rem, 1fr));
}

.product-filter-advanced {
    margin-top: -0.35rem;
}

.product-panel-actions {
    justify-content: flex-end;
}

.product-saved-views {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: -0.35rem 0 1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.52);
}

.product-saved-views > span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.product-saved-views .tiny-button.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}

.product-saved-view-status {
    margin-left: auto;
    padding: 0.32rem 0.62rem;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 999px;
    background: rgba(240, 253, 250, 0.86);
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.product-saved-view-status[hidden] {
    display: none;
}

.products-fg-header-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.products-fg-header-meta .tiny-button {
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
    font-size: 1rem;
}

.products-fg-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
}

.products-fg-summary-item {
    min-width: 0;
    min-height: 4.4rem;
    padding: 0.68rem 0.82rem;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.products-fg-summary-item:last-child {
    border-right: 0;
}

.products-fg-summary-item:hover,
.products-fg-summary-item:focus-visible,
.products-fg-summary-item.is-active {
    background: #f1f5f4;
}

.products-fg-summary-item span,
.products-fg-summary-item strong {
    display: block;
}

.products-fg-summary-item span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.products-fg-summary-item strong {
    margin-top: 0.18rem;
    font-size: 1.45rem;
    line-height: 1.1;
}

.products-fg-summary-item.is-ready strong {
    color: #067647;
}

.products-fg-summary-item.is-pending strong {
    color: #7a4d00;
}

.products-fg-summary-item.is-warning strong {
    color: #a15c07;
}

.products-fg-summary-item.is-danger strong {
    color: #b42318;
}

.filter-count-badge {
    min-width: 1.35rem;
    margin-left: 0.35rem;
    padding: 0.08rem 0.35rem;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 0.72rem;
    text-align: center;
}

.product-active-filter-chips,
.product-advanced-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.42rem;
    margin: -0.25rem 0 0.75rem;
}

.product-advanced-quick > span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.product-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2rem;
    padding: 0.28rem 0.58rem;
    border: 1px solid rgba(15, 107, 109, 0.25);
    border-radius: 999px;
    background: #eef8f7;
    color: #0f5f61;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

#section-products.fg-warehouse-product-catalog .product-section-heading {
    align-items: center;
    margin-bottom: 0.55rem;
}

#section-products.fg-warehouse-product-catalog .product-section-heading h2 {
    font-size: 1.8rem;
}

#section-products.fg-warehouse-product-catalog .table-panel > .panel-head:first-child {
    display: none;
}

#section-products.fg-warehouse-product-catalog .product-main-toolbar {
    grid-template-columns: minmax(14rem, 1fr) minmax(12rem, 17rem) max-content max-content;
}

#section-products.fg-warehouse-product-catalog .product-toolbar-primary-actions {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    flex-wrap: nowrap;
}

#section-products.fg-warehouse-product-catalog .product-toolbar-primary-actions .button,
#section-products.fg-warehouse-product-catalog .fg-product-row .status-pill {
    white-space: nowrap;
}

.products-fg-company-filter {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

#section-products.fg-warehouse-product-catalog .product-filter-primary {
    display: none;
}

#section-products.fg-warehouse-product-catalog.product-filters-expanded .product-filter-primary {
    display: grid;
}

.fg-product-row {
    cursor: pointer;
}

.fg-product-row:hover td,
.fg-product-row:focus-visible td {
    background: #f7faf9;
}

.fg-ready-cell strong,
.fg-ready-cell span {
    display: block;
}

.fg-ready-cell strong {
    color: #067647;
    font-size: 1.28rem;
    line-height: 1.05;
}

.fg-ready-cell span {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.fg-stock-secondary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.32rem;
    min-width: 15rem;
}

.fg-stock-secondary span {
    display: grid;
    gap: 0.08rem;
    color: var(--muted);
    font-size: 0.7rem;
}

.fg-stock-secondary strong {
    color: var(--ink);
    font-size: 0.88rem;
}

.fg-stock-secondary .is-risk strong {
    color: #b42318;
}

.fg-row-open-cell {
    width: 4.5rem;
    text-align: right;
}

.fg-product-open-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: var(--radius-md);
    background: rgba(15, 118, 110, 0.06);
    color: var(--teal);
    vertical-align: middle;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.fg-product-open-button svg {
    flex: none;
    pointer-events: none;
}

.fg-product-row:hover .fg-product-open-button {
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.3);
}

.fg-product-row .fg-product-open-button:is(:hover, :active) {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.fg-product-open-button:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

.fg-product-row:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: -2px;
}

@media (pointer: coarse) {
    .fg-product-open-button {
        width: 2.75rem;
        height: 2.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fg-product-open-button {
        transition: none;
    }
}

.product-detail-modal.fg-warehouse-detail-modal {
    left: auto;
    right: 1rem;
    width: min(48rem, calc(100vw - 2rem));
}

.fg-warehouse-detail-modal .product-detail-panel {
    grid-template-rows: auto minmax(0, 1fr);
}

.fg-product-detail-body {
    display: grid;
    align-content: start;
    gap: 1rem;
    overflow: auto;
}

.fg-status-card {
    --status-ink: #0f766e;
    --status-tint: #eff8f6;
    --status-border: #c8e3dc;
    padding: 1.1rem;
    border: 1px solid var(--status-border);
    border-radius: 12px;
    background: linear-gradient(120deg, var(--status-tint), var(--surface) 72%);
}

.fg-status-card--amber {
    --status-ink: #855508;
    --status-tint: #fffaed;
    --status-border: #eadcba;
}

.fg-status-card--red {
    --status-ink: #b3423b;
    --status-tint: #fff4f2;
    --status-border: #edcfca;
}

.fg-status-card--neutral {
    --status-ink: #526176;
    --status-tint: #f3f5f8;
    --status-border: #d8dfe8;
}

.fg-status-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.fg-status-card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    color: var(--status-ink);
    background: var(--surface);
    border: 1px solid var(--status-border);
    border-radius: 12px;
}

.fg-status-card h4 {
    margin: 0.05rem 0 0.3rem;
    color: var(--status-ink);
    font-size: 1.05rem;
    line-height: 1.5;
}

.fg-status-card p {
    margin: 0;
    color: #526176;
    font-size: 0.88rem;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.fg-status-card-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 1rem;
}

.fg-status-card-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.fg-status-card-option > strong,
.fg-status-card-next > strong {
    color: var(--ink);
    font-size: 0.85rem;
    line-height: 1.6;
}

.fg-status-card-option p {
    flex: 1;
    margin-bottom: 0.35rem;
}

.fg-status-card-option .button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.7rem;
    white-space: normal;
    text-align: start;
    font-size: 0.82rem;
}

.fg-status-card-next {
    margin-top: 0.85rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--status-border);
}

.fg-status-card-next p { margin-top: 0.2rem; }

.fg-status-card-details {
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--status-border);
}

.fg-status-card-details summary {
    width: fit-content;
    max-width: 100%;
    padding: 0.3rem 0;
    color: var(--status-ink);
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1.6;
}

.fg-status-card-details summary:hover { text-decoration: underline; }
.fg-status-card-details[open] summary { margin-bottom: 0.5rem; }
.fg-status-card :is(summary, button):focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

@media (max-width: 520px) {
    .fg-status-card { padding: 0.85rem; }
    .fg-status-card-options { grid-template-columns: minmax(0, 1fr); }
    .fg-status-card-option .button { width: 100%; }
}

.fg-detail-stock-hero {
    padding: 1rem;
    border-left: 4px solid #067647;
    background: #edf9f2;
}

.fg-detail-stock-hero span,
.fg-detail-stock-hero strong,
.fg-detail-stock-hero small {
    display: block;
}

.fg-detail-stock-hero strong {
    margin: 0.2rem 0;
    color: #067647;
    font-size: 2rem;
}

.fg-detail-stock-hero small,
.fg-detail-stock-hero span {
    color: var(--muted);
}

.fg-detail-stock-secondary,
.fg-detail-information-grid,
.fg-detail-production-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

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

.fg-detail-production-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.fg-detail-production-status span,
.fg-detail-production-status strong {
    display: block;
}

.fg-detail-production-status span {
    color: var(--muted);
    font-size: 0.78rem;
}

.fg-detail-production-status strong {
    margin-top: 0.18rem;
}

.fg-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 1600px) and (min-width: 761px) {
    #section-products.fg-warehouse-product-catalog .product-main-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #section-products.fg-warehouse-product-catalog .product-toolbar-filter-actions,
    #section-products.fg-warehouse-product-catalog .product-toolbar-primary-actions {
        justify-content: start;
    }

    #section-products.fg-warehouse-product-catalog .product-toolbar-primary-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #section-products.fg-warehouse-product-catalog .product-toolbar-primary-actions .button {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.product-mobile-card-location,
.product-mobile-open-hint {
    color: var(--muted);
    font-size: 0.78rem;
}

.product-mobile-card-location {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.product-mobile-open-hint {
    justify-self: end;
    font-weight: 800;
}

.table-wrap {
    min-width: 0;
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
}

.table-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.72);
    position: sticky;
    top: 0;
}

tfoot th,
tfoot td {
    background: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.column-sort {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.column-sort::after {
    content: "↕";
    opacity: 0.35;
    font-size: 0.9rem;
}

.column-sort.is-active {
    color: var(--ink);
}

.column-sort.is-active::after {
    opacity: 1;
}

.column-sort[data-sort-dir="asc"]::after {
    content: "↑";
}

.column-sort[data-sort-dir="desc"]::after {
    content: "↓";
}

.filter-summary {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.filter-summary-text {
    color: var(--muted);
    font-size: 0.92rem;
}

.filter-summary-chips {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.status-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.compact-subheading {
    margin: 0.9rem 0 0.45rem;
    font-size: 0.92rem;
    color: var(--text);
}

.column-sort::after {
    content: "\2195";
}

.column-sort[data-sort-dir="asc"]::after {
    content: "\2191";
}

.column-sort[data-sort-dir="desc"]::after {
    content: "\2193";
}

.table-pagination {
    margin-top: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.bom-readiness-panel .form-grid {
    margin-bottom: 0.9rem;
}

.bom-readiness-panel .stat-grid {
    margin: 0.9rem 0;
}

.bom-readiness-panel td small {
    display: block;
    margin-top: 0.2rem;
}

.bom-readiness-detail-cell {
    padding: 1rem !important;
    background: var(--surface-soft);
}

.bom-readiness-attention {
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(161, 98, 7, 0.22);
    border-left: 3px solid var(--warning);
    border-radius: var(--radius-sm);
    background: var(--warn-soft);
    color: var(--ink);
}

.bom-readiness-attention ul {
    margin: 0.4rem 0 0;
    padding-left: 1.2rem;
}

.bom-readiness-attention li + li {
    margin-top: 0.2rem;
}

.pagination-summary {
    color: var(--muted);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.pagination-size {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.pagination-size select {
    width: auto;
    min-width: 4.75rem;
    padding: 0.55rem 0.85rem;
}

.pagination-button {
    min-height: 0;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.75);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
}

.pagination-button.is-current {
    border-color: transparent;
    background: var(--teal);
    color: white;
}

.pagination-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

tbody tr:hover {
    background: rgba(15, 107, 109, 0.04);
}

.table-text-clip {
    display: inline-block;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
}

.row-active {
    background: rgba(15, 107, 109, 0.08);
}

.action-strip {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.row-action-menu {
    position: relative;
    display: inline-block;
}

.row-action-menu summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.row-action-menu summary::-webkit-details-marker {
    display: none;
}

.row-action-menu-list {
    position: absolute;
    z-index: 20;
    right: 0;
    min-width: 10rem;
    display: grid;
    gap: 0.45rem;
    margin-top: 0.45rem;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.row-action-menu-list.row-action-menu-floating {
    position: fixed;
    z-index: 1600;
    right: auto;
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.row-action-menu-list .tiny-button {
    width: 100%;
    text-align: left;
}

.tiny-button {
    min-height: 0;
    padding: 0.34rem 0.62rem;
    border-radius: var(--radius-sm);
    border: 0;
    background: rgba(30, 47, 66, 0.08);
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 700;
}

.tiny-button.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.tiny-button.accent {
    background: rgba(15, 107, 109, 0.12);
    color: var(--teal);
}

.tiny-button.warn {
    background: var(--warn-soft);
    color: var(--warning);
}

.inline-check,
.checkbox-label {
    width: fit-content;
    max-width: 100%;
    display: flex !important;
    align-items: center;
    justify-self: start;
    align-self: start;
    gap: 0.55rem;
    min-height: 2.1rem;
    padding: 0.35rem 0.15rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.inline-check span,
.checkbox-label span {
    min-width: 0;
    line-height: 1.35;
}

.product-experimental-control > span {
    display: grid;
    gap: 2px;
}

.product-experimental-control small {
    color: var(--muted);
    font-weight: 400;
}

.inline-check:has(input:disabled),
.checkbox-label:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.72;
}

td > input[type="checkbox"] {
    width: 1rem;
    min-width: 1rem;
    max-width: 1rem;
    display: inline-block;
    margin-inline: auto;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-span-2 {
    grid-column: 1 / -1;
}

.product-form-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.52);
}

.product-tab-button {
    min-height: 2.35rem;
    border: 0;
    border-radius: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.product-tab-button:hover {
    transform: translateY(-1px);
    background: rgba(30, 47, 66, 0.06);
    color: var(--ink);
}

.product-tab-button.is-active {
    background: var(--teal);
    color: #fff;
}

.product-tab-panel {
    display: grid;
    gap: 1rem;
}

.product-tab-panel[hidden] {
    display: none;
}

.product-readonly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-form-backdrop {
    position: fixed;
    z-index: 80;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(3px) saturate(0.92);
    -webkit-backdrop-filter: blur(3px) saturate(0.92);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease-out;
}

.product-form-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.product-form-drawer {
    position: fixed;
    z-index: 82;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: min(34rem, calc(100vw - 2rem));
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    background: var(--surface-strong);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.12);
}

.product-form-drawer.is-open {
    animation: productDrawerIn 160ms ease-out;
}

.product-form-drawer.is-fg-draft-workbench {
    width: min(48rem, calc(100vw - 2rem));
}

.product-fg-draft-intro {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding: 0.8rem;
    border: 1px solid #b9ddd7;
    border-radius: var(--radius-sm);
    background: #f3fbf9;
}

.product-fg-draft-type {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.product-fg-draft-rules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.product-fg-draft-rules span {
    padding-left: 1rem;
    position: relative;
    color: var(--ink-muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.product-fg-draft-rules span::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 800;
}

.product-planning-proposal-intro {
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f7fbfa;
}

.planning-proposal-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.planning-proposal-summary > div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.planning-proposal-summary strong {
    color: var(--ink);
    font-size: 0.86rem;
}

.planning-proposal-summary div span {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.4;
}

.planning-proposal-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.planning-proposal-progress li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    color: var(--ink-muted);
    font-size: 0.72rem;
}

.planning-proposal-progress li strong {
    display: grid;
    place-items: center;
    flex: 0 0 1.45rem;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: #dff3ef;
    color: #11675f;
    font-size: 0.72rem;
}

.product-creation-context {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.7rem;
    border-left: 3px solid var(--accent);
    background: var(--surface-muted, #f3f4f6);
    color: var(--ink-muted);
    font-size: 0.82rem;
}

.product-similar-source {
    display: block;
    border: 1px solid var(--line, #d9dee5);
    border-radius: 6px;
    background: #f7f9fa;
}

.product-similar-source > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    list-style: none;
}

.product-similar-source > summary::-webkit-details-marker {
    display: none;
}

.product-similar-source > summary::after {
    content: "+";
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
}

.product-similar-source[open] > summary::after {
    content: "-";
}

.product-similar-source > summary span {
    display: grid;
    gap: 0.15rem;
}

.product-similar-source > summary small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 400;
}

.product-similar-body {
    display: grid;
    gap: 10px;
    padding: 0.75rem;
    border-top: 1px solid var(--line);
}

.product-similar-source .helper-text {
    margin: 0;
}

.product-similar-scope {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    color: var(--text-muted, #5f6b7a);
    font-size: 0.78rem;
    line-height: 1.45;
}

.product-similar-scope-item {
    display: block;
    padding-left: 16px;
    position: relative;
}

.product-similar-scope-item::before {
    color: #67727f;
    content: "-";
    left: 2px;
    position: absolute;
}

.product-similar-scope-item.is-included::before {
    color: #17645c;
    content: "\2713";
    font-weight: 700;
}

.product-similar-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.product-similar-controls label {
    min-width: 0;
}

.product-similar-summary {
    color: #17645c;
    padding-left: 18px;
    position: relative;
}

.product-similar-summary::before {
    content: "\2713";
    font-weight: 700;
    left: 2px;
    position: absolute;
}

.product-draft-validation {
    padding: 10px 12px;
    border-left: 3px solid #d6a023;
    background: #fff9e9;
    color: #5f4b13;
}

.product-draft-validation.has-error {
    border-left-color: #c53b3b;
    background: #fff1f1;
    color: #7a2020;
}

.product-draft-validation ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

.product-save-draft {
    margin-top: 0;
    color: var(--text-muted, #5f6b7a);
}

@media (max-width: 700px) {
    .product-similar-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-similar-controls .button {
        width: 100%;
    }

    .product-fg-draft-type,
    .product-form-footer {
        align-items: stretch;
    }

    .product-fg-draft-type,
    .product-form-footer,
    .product-form-footer-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .product-fg-draft-rules,
    .product-fg-advanced-summary,
    .product-master-form.is-fg-draft-create .form-grid {
        grid-template-columns: 1fr;
    }

    .product-form-footer-actions .button {
        width: 100%;
    }
}

.product-creation-context[hidden] {
    display: none;
}

.product-creation-context strong {
    color: var(--ink);
}

.product-creation-kind-step {
    display: grid;
    gap: 0.7rem;
    margin: 0 0 0.9rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.product-creation-kind-step[hidden],
.product-proposal-source-step[hidden],
.product-master-form[hidden] {
    display: none;
}

.product-creation-kind-step h4,
.product-creation-kind-step .helper-text,
.product-creation-kind-step .eyebrow {
    margin: 0;
}

.product-creation-kind-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.product-creation-kind {
    min-width: 0;
    min-height: 5.25rem;
    padding: 0.62rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--ink);
    display: grid;
    gap: 0.28rem;
    align-content: start;
    text-align: left;
    cursor: pointer;
}

.product-creation-kind:hover {
    border-color: var(--accent);
    background: var(--surface-muted);
}

.product-creation-kind.is-selected {
    border-color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
    background: var(--surface-muted);
}

.product-creation-kind strong {
    font-size: 0.82rem;
    line-height: 1.25;
}

.product-creation-kind span {
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.product-form-drawer.is-planning-proposal-workbench .product-creation-kind-step {
    padding: 0.7rem;
    background: #f8fafb;
}

.product-form-drawer.is-planning-proposal-workbench .product-creation-kind-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-form-drawer.is-planning-proposal-workbench [data-product-creation-kind="FINISHED_GOOD"] {
    order: 1;
}

.product-form-drawer.is-planning-proposal-workbench [data-product-creation-kind="RAW_MATERIAL"] {
    order: 2;
}

.product-form-drawer.is-planning-proposal-workbench [data-product-creation-kind="PACKAGING"] {
    order: 3;
}

.product-form-drawer.is-planning-proposal-workbench .product-creation-kind {
    min-height: 4rem;
    opacity: 1;
}

.product-form-drawer.is-planning-proposal-workbench.is-product-type-locked .product-creation-kind-options {
    grid-template-columns: minmax(0, 1fr);
}

.product-form-drawer.is-planning-proposal-workbench.is-product-type-locked .product-creation-kind {
    cursor: default;
}

.product-proposal-source-step {
    display: grid;
    gap: 0.65rem;
    margin: 0 0 0.9rem;
    padding: 0.75rem;
    border: 1px solid #b9d9d4;
    border-radius: var(--radius-sm);
    background: #f4fbfa;
}

.product-proposal-source-step h4,
.product-proposal-source-step .helper-text,
.product-proposal-source-step .eyebrow,
.product-proposal-source-step label {
    margin: 0;
}

.product-proposal-source-step label {
    display: grid;
    gap: 0.35rem;
}

.product-proposal-source-step #product-proposal-source-results {
    min-height: 1.2em;
}

.packaging-material-request-empty,
.product-mobile-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.packaging-material-request-empty {
    justify-content: space-between;
}

.product-form-drawer.is-planning-proposal-workbench .product-creation-context,
.product-form-drawer.is-planning-proposal-workbench #product-similar-source {
    display: none !important;
}

.product-form-drawer.is-planning-proposal-workbench .product-master-form {
    gap: 0.7rem;
}

.product-creation-advanced {
    display: none;
}

.product-master-form.is-essential-create .product-creation-advanced {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.product-creation-advanced summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    list-style: none;
}

.product-creation-advanced summary::-webkit-details-marker {
    display: none;
}

.product-creation-advanced summary::after {
    content: "+";
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
}

.product-creation-advanced[open] summary::after {
    content: "-";
}

.product-creation-advanced summary span {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.product-creation-advanced summary strong,
.product-creation-advanced summary small {
    overflow-wrap: anywhere;
}

.product-creation-advanced summary small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.35;
}

.product-creation-advanced > .helper-text {
    margin: 0;
    padding: 0.6rem 0.8rem 0.7rem;
    border-top: 1px solid var(--line);
}

.product-fg-advanced-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0 0.8rem 0.75rem;
}

.product-fg-advanced-summary span {
    padding-left: 1rem;
    position: relative;
    color: var(--muted);
    font-size: 0.74rem;
}

.product-fg-advanced-summary span::before {
    content: "\2022";
    position: absolute;
    left: 0.25rem;
    color: var(--teal);
}

.product-master-form.is-essential-create [data-product-creation-internal-field],
.product-master-form.is-essential-create .product-creation-advanced:not([open]) ~ .product-form-tabs,
.product-master-form.is-essential-create .product-creation-advanced:not([open]) ~ #product-tab-basic [data-product-advanced-field],
.product-master-form.is-essential-create .product-creation-advanced:not([open]) ~ .product-tab-panel:not(#product-tab-basic) {
    display: none !important;
}

.product-master-form.is-essential-create .product-creation-advanced:not([open]) ~ #product-tab-basic {
    display: grid !important;
}

.product-master-form.is-fg-draft-create .product-form-tabs,
.product-master-form.is-fg-draft-create #product-tab-sales,
.product-master-form.is-fg-draft-create #product-tab-costing,
.product-master-form.is-fg-draft-create #product-save-draft-row,
.product-master-form.is-fg-draft-create #product-tab-basic [data-product-advanced-field] {
    display: none !important;
}

.product-master-form.is-planning-proposal-create #product-creation-advanced {
    display: none !important;
}

.product-master-form.is-essential-create.is-planning-proposal-create .product-creation-advanced:not([open]) ~ #product-tab-basic [data-product-proposal-reason-field],
.product-master-form.is-planning-proposal-create #product-tab-basic [data-product-proposal-reason-field] {
    display: grid !important;
    grid-column: 1 / -1;
    gap: 0.3rem;
}

.product-master-form.is-fg-draft-create #product-tab-basic,
.product-master-form.is-fg-draft-create #product-owner-company-field {
    display: grid !important;
}

.product-master-form.is-fg-draft-create #product-default-warehouse-field {
    grid-column: 1 / -1;
}

.product-master-form.is-fg-draft-create #product-draft-validation {
    order: 5;
}

.product-master-form.is-fg-draft-create #product-tab-basic {
    order: 10;
}

.product-master-form.is-fg-draft-create #product-similar-source {
    order: 20;
}

.product-master-form.is-fg-draft-create #product-creation-advanced {
    order: 21;
}

.product-master-form.is-fg-draft-create #product-tab-inventory {
    order: 22;
}

.product-master-form.is-fg-draft-create #product-tab-purchasing {
    order: 23;
}

.product-master-form.is-fg-draft-create #product-tab-documents {
    order: 24;
}

.product-master-form.is-fg-draft-create .product-form-footer {
    order: 30;
}

.product-master-form.is-fg-draft-create #product-creation-advanced[open] ~ #product-tab-basic [data-product-fg-advanced-allowed],
.product-master-form.is-fg-draft-create #product-creation-advanced[open] ~ [data-product-fg-advanced-panel] {
    display: grid !important;
}

.product-master-form.is-fg-draft-create #product-creation-advanced[open] ~ [data-product-fg-advanced-panel]:not([data-product-fg-advanced-allowed]) > :not([data-product-fg-advanced-allowed]) {
    display: none !important;
}

.fg-field-feedback {
    display: block;
    min-height: 0;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    line-height: 1.35;
}

.fg-field-feedback.is-error {
    color: var(--danger, #b42318);
}

.fg-field-feedback.is-warning {
    color: #8a5b00;
}

.product-form-footer {
    position: sticky;
    z-index: 4;
    bottom: -0.8rem;
    align-items: center;
    justify-content: flex-end;
    margin: 0 -0.8rem -0.8rem;
    padding: 0.75rem 0.8rem;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.06);
}

.product-fg-footer-status {
    display: grid;
    gap: 0.1rem;
    margin-right: auto;
    color: var(--muted);
    font-size: 0.72rem;
}

.product-fg-footer-status strong {
    color: var(--ink);
    font-size: 0.78rem;
}

.product-form-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 700px) {
    .planning-proposal-summary,
    .planning-proposal-progress {
        display: grid;
        grid-template-columns: 1fr;
    }

    .product-form-drawer.is-planning-proposal-workbench .product-creation-kind-options {
        grid-template-columns: 1fr;
    }

    .product-form-drawer.is-planning-proposal-workbench .product-creation-kind {
        min-height: 0;
    }

    .product-master-form.is-fg-draft-create .product-form-footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.55rem 0.7rem;
    }

    .product-master-form.is-fg-draft-create .product-fg-footer-status {
        display: flex;
        align-items: baseline;
        gap: 0.35rem;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
    }

    .product-master-form.is-fg-draft-create .product-fg-footer-status span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-master-form.is-fg-draft-create .product-form-footer-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .product-master-form.is-fg-draft-create .product-form-footer-actions .button {
        width: 100%;
        min-height: 2.45rem;
        padding: 0.55rem 0.65rem;
    }

    .product-master-form.is-fg-draft-create #product-submit {
        grid-column: 1 / -1;
    }
}

.product-creation-field {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.product-creation-field > label {
    min-width: 0;
}

.product-creation-field > .tiny-button {
    justify-self: start;
}

.product-creation-next {
    display: grid;
    gap: 0.9rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--success, #15803d);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.product-creation-next[hidden] {
    display: none;
}

.product-creation-next-head {
    display: grid;
    gap: 0.3rem;
}

.product-creation-next-head .eyebrow,
.product-creation-next-head h4,
.product-creation-next-head .helper-text,
.product-creation-next-note {
    margin: 0;
}

.product-creation-next-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.product-creation-next-actions .button {
    min-width: 0;
    min-height: 2.65rem;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
}

.product-creation-next-actions .button[disabled] {
    opacity: 0.52;
    cursor: not-allowed;
}

.product-creation-next-note {
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
    .product-creation-next-actions {
        grid-template-columns: 1fr;
    }
}

@keyframes productDrawerIn {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-quick-view {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    max-width: 15rem;
    align-items: center;
}

.product-quick-view .status-pill {
    min-height: 1.55rem;
    padding: 0.22rem 0.48rem;
    font-size: 0.7rem;
    line-height: 1.1;
}

.product-quick-overflow {
    border: 1px dashed rgba(30, 47, 66, 0.22);
    cursor: help;
}

.products-mobile-list {
    display: none;
}

.product-mobile-card {
    display: grid;
    gap: 0.68rem;
    padding: 0.78rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.product-mobile-card.is-active {
    border-color: rgba(15, 107, 109, 0.36);
    box-shadow: inset 3px 0 0 var(--primary);
}

.product-mobile-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: start;
}

.product-mobile-card h4 {
    margin: 0.16rem 0 0;
    font-size: 0.98rem;
    line-height: 1.25;
}

.product-mobile-card-head small,
.table-cell-subtext {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.product-mobile-sku {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.product-mobile-card-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.product-mobile-card-meta div {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
    padding: 0.55rem 0.62rem;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.product-mobile-card-meta div.is-primary {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    border-left: 3px solid var(--success);
    background: rgba(22, 163, 74, 0.07);
}

.product-mobile-card-meta div.is-primary strong {
    color: #157347;
    font-size: 1.08rem;
}

.detail-key.is-sales-primary {
    grid-column: span 2;
    border-left: 4px solid var(--success);
    background: rgba(22, 163, 74, 0.07);
}

.detail-key.is-sales-primary > strong {
    color: #157347;
    font-size: 1.18rem;
}

.product-mobile-card-meta span,
.product-mobile-card-review span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.product-mobile-card-meta strong,
.product-mobile-card-review strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-mobile-card-review {
    display: grid;
    gap: 0.14rem;
    padding: 0.54rem 0.62rem;
    border-left: 3px solid var(--warning);
    border-radius: var(--radius-sm);
    background: rgba(183, 121, 31, 0.08);
}

.product-mobile-view-button {
    width: 100%;
    min-height: 2.5rem;
}

.product-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.co-sale-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.co-sale-product-actions .tiny-button {
    white-space: nowrap;
}

.co-sale-product-actions.is-mobile {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
}

.co-sale-product-actions.is-mobile .button {
    width: 100%;
    min-height: 2.5rem;
}

.product-detail-panel {
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 1rem;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
}

.product-detail-backdrop {
    position: fixed;
    z-index: 80;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(4px) saturate(0.9);
    -webkit-backdrop-filter: blur(4px) saturate(0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease-out;
}

.product-detail-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.product-detail-modal {
    position: fixed;
    z-index: 82;
    top: 1rem;
    right: max(1rem, calc((100vw - 104rem) / 2));
    bottom: 1rem;
    left: max(1rem, calc((100vw - 104rem) / 2));
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    box-shadow: 0 28px 72px rgba(15, 23, 42, 0.24), 0 10px 28px rgba(15, 23, 42, 0.14);
}

.product-detail-modal.is-open {
    animation: productDrawerIn 160ms ease-out;
}

.product-detail-modal.co-sale-availability-modal {
    left: auto;
    right: 1rem;
    width: min(44rem, calc(100vw - 2rem));
}

.product-detail-modal[hidden],
.product-detail-backdrop[hidden] {
    display: none;
}

.product-lock-notice {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: -0.25rem 0 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(161, 98, 7, 0.25);
    border-radius: var(--radius-md);
    background: var(--warn-soft);
    color: var(--ink);
    font-size: 0.9rem;
}

.product-lock-notice[hidden] {
    display: none;
}

.product-category-panel {
    margin-top: 1rem;
    padding: 1.1rem;
    border-radius: var(--radius-lg);
}

.product-category-create-disclosure {
    display: block;
    border-bottom: 1px solid var(--line);
}

.product-category-create-disclosure > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.15rem 0 0.9rem;
    cursor: pointer;
    list-style: none;
}

.product-category-create-disclosure > summary::-webkit-details-marker {
    display: none;
}

.product-category-create-disclosure > summary > span {
    display: grid;
    min-width: 0;
    gap: 0.2rem;
}

.product-category-create-disclosure > summary .eyebrow {
    margin: 0;
}

.product-category-create-disclosure > summary strong {
    color: var(--ink);
    font-size: 1.08rem;
}

.product-category-create-disclosure > summary small {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.product-category-create-disclosure > summary::after {
    content: "+";
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 800;
}

.product-category-create-disclosure[open] > summary::after {
    content: "-";
}

.product-category-create-disclosure[open] > summary {
    border-bottom: 1px solid var(--line);
}

.product-category-create-body {
    padding-top: 0.25rem;
}

.product-category-form {
    margin-bottom: 1rem;
}

.product-category-form-section {
    padding: 0.9rem 0 1rem;
    border-bottom: 1px solid var(--line);
}

.product-category-section-head {
    margin-bottom: 0.75rem;
}

.product-category-section-head h4,
.product-category-section-head p {
    margin: 0;
}

.product-category-section-head h4 {
    font-size: 1rem;
}

.product-category-section-head p {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.product-category-form .field-help {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.product-category-advanced {
    padding: 0.1rem 0;
    border-bottom: 1px solid var(--line);
}

.product-category-advanced > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.7rem;
    padding: 0.7rem 0;
    cursor: pointer;
    list-style: none;
}

.product-category-advanced > summary::-webkit-details-marker {
    display: none;
}

.product-category-advanced > summary > span:first-child {
    display: grid;
    gap: 0.15rem;
}

.product-category-advanced > summary small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.product-category-advanced > summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 1.8rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 800;
}

.product-category-advanced[open] > summary::after {
    content: "−";
}

.product-category-advanced > summary .status-pill {
    margin-left: auto;
}

.product-category-advanced-body {
    padding: 0 0 0.9rem;
}

.product-category-advanced-body > .helper-text {
    margin: 0 0 0.75rem;
}

@media (max-width: 560px) {
    .product-category-advanced > summary {
        align-items: flex-start;
    }

    .product-category-advanced > summary .status-pill {
        display: none;
    }
}

.product-category-table-head {
    margin-top: 1.1rem;
}

.product-category-directory-tools {
    display: grid;
    grid-template-columns: minmax(16rem, 0.8fr) minmax(24rem, 1.2fr);
    gap: 0.8rem;
    align-items: end;
    margin-bottom: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.product-category-directory-search input {
    min-height: 2.65rem;
}

.product-category-letter-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.product-category-letter-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.product-category-letter-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-height: 2.15rem;
    padding: 0.35rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
}

.product-category-letter-filter strong {
    min-width: 1.35rem;
    padding: 0.08rem 0.3rem;
    border-radius: 999px;
    background: #edf2f1;
    color: var(--muted);
    font-size: 0.7rem;
    text-align: center;
}

.product-category-letter-filter:hover,
.product-category-letter-filter:focus-visible,
.product-category-letter-filter.is-active {
    border-color: rgba(15, 107, 109, 0.34);
    background: #e9f6f5;
    color: var(--accent);
}

.product-category-letter-filter.is-active strong {
    background: var(--accent);
    color: #ffffff;
}

.product-category-directory-summary {
    margin: 0 0 0.55rem;
}

.product-category-pagination .pagination-size {
    display: none;
}

@media (max-width: 820px) {
    .product-category-directory-tools {
        grid-template-columns: 1fr;
    }
}

.product-commercial-panel {
    margin-top: 1rem;
    padding: 1.1rem;
    border-radius: var(--radius-lg);
}

.commercial-master-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.commercial-tab-button {
    min-height: 2.3rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.commercial-tab-button.is-active {
    border-color: rgba(15, 107, 109, 0.3);
    background: rgba(15, 107, 109, 0.12);
    color: var(--accent);
}

.packaging-bom-workspace-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.packaging-bom-workspace-tabs .commercial-tab-button {
    min-height: 2.15rem;
    border-radius: var(--radius-sm);
}

.commercial-focus-bar {
    display: grid;
    grid-template-columns: minmax(15rem, 0.35fr) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.commercial-product-picker {
    position: relative;
    min-width: 0;
    display: grid;
    gap: 0.35rem;
}

.commercial-product-picker > span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.commercial-product-picker-button {
    width: 100%;
    min-height: 3.65rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.3rem 0.75rem;
    align-items: center;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    text-align: left;
}

.commercial-product-picker-button::after {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    grid-row: 1 / span 2;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-0.15rem);
    opacity: 0.72;
}

.commercial-product-picker-button[aria-expanded="true"]::after {
    transform: rotate(225deg) translateY(-0.05rem);
}

.commercial-product-picker-button strong,
.commercial-product-picker-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commercial-product-picker-button strong {
    font-size: 0.92rem;
}

.commercial-product-picker-button span {
    color: var(--muted);
    font-size: 0.78rem;
}

.commercial-product-picker-menu {
    position: absolute;
    z-index: 55;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    display: grid;
    gap: 0.55rem;
    padding: 0.65rem;
    border: 1px solid rgba(15, 107, 109, 0.22);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.commercial-product-picker-menu[hidden] {
    display: none;
}

.commercial-product-picker-search {
    display: grid;
    gap: 0.3rem;
}

.commercial-product-picker-options {
    max-height: min(18rem, 44vh);
    overflow: auto;
    display: grid;
    gap: 0.3rem;
    padding-right: 0.1rem;
}

.commercial-product-picker-option {
    width: 100%;
    min-height: 3.75rem;
    display: grid;
    align-content: center;
    gap: 0.22rem;
    padding: 0.62rem 0.7rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.commercial-product-picker-option:hover,
.commercial-product-picker-option:focus-visible {
    border-color: rgba(15, 107, 109, 0.18);
    background: rgba(15, 107, 109, 0.07);
}

.commercial-product-picker-option.is-selected {
    border-color: rgba(15, 107, 109, 0.3);
    background: rgba(15, 107, 109, 0.12);
}

.commercial-product-picker-option strong,
.commercial-product-picker-option span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.commercial-product-picker-option strong {
    font-size: 0.86rem;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
}

.commercial-product-picker-option span {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.28;
    white-space: nowrap;
}

.bom-material-picker {
    align-self: start;
}

.bom-material-picker-menu {
    z-index: 80;
}

.bom-material-picker-result-label {
    min-height: 1.1rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.commercial-focus-summary,
.commercial-product-focus-card {
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.58);
}

.commercial-product-focus-card:empty {
    display: none;
}

.commercial-focus-title {
    display: grid;
    gap: 0.15rem;
}

.commercial-focus-title span {
    color: var(--muted);
    font-size: 0.86rem;
}

.commercial-focus-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.commercial-focus-metrics span {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(30, 47, 66, 0.08);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.commercial-master-workspace {
    min-width: 0;
}

.commercial-master-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.commercial-master-block {
    min-width: 0;
    display: grid;
    gap: 0.9rem;
    padding-top: 0.35rem;
}

.commercial-master-block[hidden] {
    display: none;
}

.price-list-section-head {
    align-items: flex-end;
}

.price-list-section-head .helper-text {
    max-width: 52rem;
    margin: 0.25rem 0 0;
}

.price-list-workflow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.price-list-workflow > div {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.price-list-workflow-step {
    display: inline-grid;
    flex: 0 0 1.8rem;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
}

.price-list-workflow strong,
.price-list-workflow small {
    display: block;
}

.price-list-workflow strong {
    color: var(--ink);
    font-size: 0.88rem;
}

.price-list-workflow small {
    margin-top: 0.1rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.price-list-workflow-arrow {
    color: var(--muted);
    font-weight: 800;
}

.commercial-guided-empty {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    padding: 1.35rem 0.85rem;
    text-align: center;
}

.commercial-guided-empty span {
    max-width: 38rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.commercial-filter-row {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(11rem, 0.35fr);
    gap: 0.75rem;
    align-items: end;
}

.commercial-filter-row.commercial-filter-row-wide {
    grid-template-columns: minmax(14rem, 1.4fr) repeat(3, minmax(10rem, 0.65fr));
}

.bom-list-focus-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--teal);
    border-radius: var(--radius-md);
    background: var(--surface-subtle, #f7faf9);
}

.bom-list-focus-context[hidden] {
    display: none;
}

.bom-list-focus-context > div {
    min-width: 0;
}

.bom-list-focus-context span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.bom-list-focus-context strong {
    display: block;
    margin-top: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tiny-button.is-current,
.tiny-button.is-current:disabled {
    border-color: rgba(15, 118, 110, 0.32);
    background: rgba(15, 118, 110, 0.1);
    color: var(--teal);
    cursor: default;
    opacity: 1;
}

.commercial-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.65rem;
}

.commercial-summary-card {
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.6);
}

.commercial-summary-card span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.commercial-summary-card strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--ink);
    font-size: 1.15rem;
}

.commercial-master-inline-form,
.commercial-availability-result {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    padding: 0.85rem;
}

.commercial-master-inline-form .panel-head,
.commercial-availability-result .panel-head {
    margin-bottom: 0.7rem;
}

.commercial-availability-result .table-wrap {
    margin-top: 0.7rem;
}

.section-grid.two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 0.75rem;
    margin: 0.9rem 0;
}

.compact-panel {
    padding: 0.9rem;
}

.compact-panel .panel-head {
    margin-bottom: 0.65rem;
}

.summary-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.64);
    margin-top: 0.65rem;
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.65rem 0;
}

.compact-grid > div {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.55rem;
    background: rgba(255, 255, 255, 0.7);
}

.compact-grid small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
}

.compact-grid strong {
    display: block;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.compact-table table th,
.compact-table table td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

@media (max-width: 980px) {
    .section-grid.two-columns,
    .compact-grid {
        grid-template-columns: 1fr;
    }
}

.commercial-master-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(3px) saturate(0.92);
    -webkit-backdrop-filter: blur(3px) saturate(0.92);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease-out;
}

.commercial-master-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.commercial-master-form-drawer {
    position: fixed;
    z-index: 72;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: min(34rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.12);
}

.commercial-master-form-drawer[hidden] {
    display: none;
}

.commercial-master-form-drawer.is-open {
    display: grid;
    align-content: start;
    grid-auto-rows: max-content;
    animation: productDrawerIn 180ms ease both;
}

.commercial-master-form-drawer.bom-builder-drawer {
    width: min(64rem, calc(100vw - 2rem));
    gap: 0;
    padding: 0 1.15rem 1.15rem;
}

.bom-builder-head {
    position: sticky;
    z-index: 2;
    top: 0;
    margin-inline: -1.15rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-strong);
}

.bom-builder-head .helper-text {
    max-width: 48rem;
    margin-top: 0.25rem;
}

.bom-builder-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}

.bom-builder-steps > span {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.bom-builder-steps strong {
    display: inline-grid;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
}

.bom-builder-steps .is-current {
    color: var(--teal-deep);
}

.bom-builder-steps .is-current strong {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--teal-deep);
}

.bom-builder-steps .is-complete {
    color: var(--success);
}

.bom-builder-steps .is-complete strong {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
}

@media (max-width: 720px) {
    #section-warehouses .warehouse-page-heading h2 {
        font-size: 1.8rem;
        line-height: 1.15;
    }

    .commercial-master-form-drawer.bom-builder-drawer {
        inset: 0;
        width: auto;
        max-height: none;
        padding-inline: 1rem;
        border-radius: 0;
    }

    .commercial-master-form-drawer.bom-builder-drawer.is-open {
        animation: none;
    }

    .bom-builder-head {
        margin-inline: -1rem;
        padding-inline: 1rem;
    }

    .bom-builder-section-head,
    .bom-builder-line {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .bom-builder-section-head {
        flex-direction: column;
    }

    .bom-builder-selection {
        align-self: flex-start;
    }

    .bom-material-picker-menu {
        position: static;
        margin-top: 0.2rem;
        box-shadow: none;
    }

    .packaging-bom-workspace-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .packaging-bom-workspace-tabs .commercial-tab-button {
        width: 100%;
    }

    .bom-builder-head-actions,
    .bom-quick-create-head,
    .bom-quick-create-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .bom-builder-head-actions {
        align-self: stretch;
    }

    .bom-builder-head-actions .tiny-button,
    .bom-quick-create-footer .button {
        width: 100%;
    }

    .bom-quick-create-grid {
        grid-template-columns: 1fr;
    }
}

.bom-builder-section {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.bom-builder-section:last-child {
    border-bottom: 0;
}

.bom-builder-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.bom-builder-section-head h4 {
    margin: 0.1rem 0 0;
    font-size: 1rem;
}

.bom-builder-selection {
    flex: 0 0 auto;
}

.bom-builder-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

.bom-builder-current-formula {
    display: grid;
    min-width: min(22rem, 100%);
    gap: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.bom-builder-current-formula select {
    min-height: 2.35rem;
    color: var(--ink);
    font-size: 0.86rem;
}

.bom-builder-form > .bom-material-picker {
    width: 100%;
}

.bom-quick-create {
    display: grid;
    gap: 0.7rem;
    padding: 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.bom-quick-create[hidden] {
    display: none;
}

.bom-quick-create-head,
.bom-quick-create-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bom-quick-create-head h5 {
    margin: 0.1rem 0 0;
    font-size: 0.95rem;
}

.bom-quick-create-grid {
    grid-template-columns: minmax(10rem, 0.75fr) minmax(14rem, 1.5fr) minmax(9rem, 0.65fr);
}

.bom-quick-create-footer .button {
    flex: 0 0 auto;
    width: auto;
}

@media (max-width: 720px) {
    .bom-builder-head-actions,
    .bom-quick-create-head,
    .bom-quick-create-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .bom-builder-head-actions {
        align-self: stretch;
    }

    .bom-builder-head-actions .tiny-button,
    .bom-quick-create-footer .button {
        width: 100%;
    }

    .bom-builder-current-formula {
        min-width: 0;
        width: 100%;
    }

    .bom-quick-create-grid {
        grid-template-columns: 1fr;
    }
}

.bom-builder-form {
    gap: 0.7rem;
}

.bom-builder-form[hidden] {
    display: none;
}

.bom-builder-locked-message {
    padding: 0.75rem 0.85rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 0.84rem;
}

.bom-builder-locked-message[hidden] {
    display: none;
}

.bom-builder-human-summary {
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--ink);
}

.bom-builder-human-summary:empty {
    display: none;
}

.bom-builder-human-summary strong {
    overflow-wrap: anywhere;
}

.bom-builder-human-summary span {
    color: var(--muted);
    font-size: 0.82rem;
}

.bom-builder-advanced {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.bom-builder-advanced > summary {
    padding: 0.75rem 0.85rem;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
}

.bom-builder-advanced[open] > summary {
    border-bottom: 1px solid var(--line);
}

.bom-builder-advanced-body {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
}

.bom-builder-next-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.bom-builder-next-actions:empty {
    display: none;
}

.bom-builder-next-actions .helper-text {
    margin-right: auto;
}

.raw-material-quantity-grid > label[hidden],
#raw-material-bom-batch-qty-field[hidden] {
    display: none;
}

.bom-builder-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
}

.bom-builder-feedback:not([hidden]) {
    position: static;
    width: auto;
}

.bom-builder-lines {
    display: grid;
    gap: 0;
    max-height: 16rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.bom-builder-lines-head,
.bom-builder-line {
    padding: 0.7rem 0.8rem;
}

.bom-builder-lines-head {
    position: sticky;
    z-index: 1;
    top: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.82rem;
}

.bom-builder-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.bom-builder-line:last-child {
    border-bottom: 0;
}

.bom-builder-line > div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.bom-builder-line strong,
.bom-builder-line span {
    overflow-wrap: anywhere;
}

.bom-builder-line > div > span {
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 720px) {
    .bom-builder-next-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .bom-builder-next-actions .helper-text {
        margin-right: 0;
    }

    .bom-builder-next-actions .button,
    .bom-builder-next-actions .tiny-button {
        width: 100%;
    }
}

.commercial-drawer-feedback:not([hidden]) {
    position: fixed;
    z-index: 73;
    right: 2rem;
    bottom: 1.5rem;
    width: min(31rem, calc(100vw - 4rem));
}

.compact-master-form {
    gap: 0.75rem;
}

.compact-master-form .field-help {
    display: block;
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .price-list-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .price-list-section-head .product-panel-actions,
    .price-list-section-head .button {
        width: 100%;
    }

    .price-list-section-head .product-panel-actions {
        display: grid;
        gap: 0.5rem;
    }

    .price-list-workflow {
        align-items: stretch;
        flex-direction: column;
        gap: 0.55rem;
    }

    .price-list-workflow-arrow {
        display: none;
    }
}

.compact-master-form .form-actions {
    margin-top: 0.1rem;
    align-items: flex-start;
    align-self: start;
    width: auto;
}

.commercial-master-form-drawer .form-actions .button {
    flex: 0 0 auto;
    width: auto;
    min-height: 2.8rem;
    padding-block: 0.8rem;
}

.compact-master-table {
    max-height: 280px;
    overflow: auto;
}

.compact-master-table table {
    min-width: 560px;
}

.raw-material-bom-table-wrap,
.raw-material-bom-component-table-wrap {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
}

.uom-master-table-wrap {
    max-height: none;
    overflow: visible;
}

.uom-conversion-table-wrap {
    max-height: none;
    overflow: visible;
}

.commercial-paginated-table-wrap {
    max-height: none;
    overflow: visible;
}

.raw-material-bom-pagination .pagination-size,
.raw-material-bom-component-pagination .pagination-size,
.uom-master-pagination .pagination-size,
.uom-conversion-pagination .pagination-size,
.commercial-fixed-pagination .pagination-size {
    display: none;
}

.bom-compare-panel {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.bom-compare-panel:empty {
    display: none;
}

.bom-revision-disclosure {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.bom-compare-expanded-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.bom-compare-expanded-summary > .helper-text {
    margin: 0;
}

.bom-compare-head {
    align-items: flex-start;
    border-top: 1px solid var(--line);
    padding-top: 0.85rem;
}

.bom-compare-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 0.75rem;
    align-items: start;
}

.bom-compare-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.7);
    padding: 0.8rem;
}

.bom-compare-card h4 {
    margin: 0 0 0.65rem;
    color: var(--ink);
    font-size: 0.98rem;
}

@media (max-width: 700px) {
    .bom-compare-expanded-summary {
        display: grid;
    }
}

.bom-compare-table {
    max-height: 320px;
    overflow: auto;
}

.bom-compare-table table {
    min-width: 680px;
}

.bom-compare-table th,
.bom-compare-table td {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    vertical-align: top;
}

.bom-change-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.bom-change-panel {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.bom-change-panel .compact-master-table table {
    min-width: 820px;
}

.bom-change-disclosure-content {
    display: grid;
    min-width: 0;
    gap: 0.85rem;
}

.import-row-reference {
    display: block;
    margin-top: 3px;
    color: var(--muted-text, #667085);
    font-size: 0.78rem;
    line-height: 1.35;
}

button[data-action="commit-packaging-bom-import"]:disabled,
button[data-action="commit-raw-material-bom-import"]:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.bom-audit-value {
    display: inline-block;
    max-width: 17rem;
    overflow-wrap: anywhere;
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.35rem;
    line-height: 1.35;
}

.bom-audit-value.before {
    background: rgba(245, 158, 11, 0.12);
}

.bom-audit-value.after {
    background: rgba(16, 185, 129, 0.12);
}

@media (max-width: 1180px) {
    .bom-compare-grid {
        grid-template-columns: 1fr;
    }
}

.product-detail-head {
    position: relative;
    align-items: flex-start;
    min-width: 0;
    margin-bottom: 0.75rem;
    padding-right: 4.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.product-detail-head h3 {
    overflow-wrap: anywhere;
}

.product-detail-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.55rem;
}

.product-detail-head-actions .status-group {
    justify-content: flex-end;
}

.product-detail-close {
    position: absolute;
    top: 0;
    right: 0;
    flex: 0 0 auto;
}

.label-print-body {
    margin: 0;
    padding: 18px;
    color: #111827;
    background: #f8fafc;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.label-print-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    border-bottom: 1px solid #d9dee7;
    padding-bottom: 10px;
}

.label-print-head h1 {
    margin: 0;
    font-size: 18px;
}

.label-print-head p {
    margin: 3px 0 0;
    color: #526179;
    font-size: 12px;
}

.label-sheet {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.label-card {
    min-height: 92mm;
    padding: 12px;
    border: 1px solid #111827;
    border-radius: 6px;
    background: #ffffff;
    break-inside: avoid;
    display: grid;
    gap: 8px;
}

.label-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #d9dee7;
    padding-bottom: 8px;
}

.label-card-head p,
.label-system-code span {
    margin: 0;
    color: #526179;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.label-card-head h2 {
    margin: 2px 0 0;
    font-size: 19px;
    line-height: 1.12;
    word-break: break-word;
}

.label-card-head strong {
    max-width: 42%;
    text-align: right;
    font-size: 14px;
    word-break: break-word;
}

.label-product-name {
    min-height: 36px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
}

.label-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
    margin: 0;
}

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

.label-fields dt {
    color: #526179;
    font-size: 10px;
    font-weight: 700;
}

.label-fields dd {
    margin: 1px 0 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.label-code-visual {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    min-height: 54px;
    padding: 6px;
    border: 1px solid #d9dee7;
    background: repeating-linear-gradient(90deg, #fff, #fff 5px, #f3f4f6 5px, #f3f4f6 7px);
    overflow: hidden;
}

.label-bar {
    display: block;
    flex: 0 0 auto;
    background: #111827;
}

.label-bar-w-1 { width: 1px; }
.label-bar-w-2 { width: 2px; }
.label-bar-w-3 { width: 3px; }
.label-bar-w-4 { width: 4px; }
.label-bar-h-1 { height: 28px; }
.label-bar-h-2 { height: 31px; }
.label-bar-h-3 { height: 34px; }
.label-bar-h-4 { height: 37px; }
.label-bar-h-5 { height: 40px; }
.label-bar-h-6 { height: 43px; }

.label-system-code {
    display: grid;
    gap: 3px;
    padding-top: 4px;
    border-top: 1px solid #d9dee7;
}

.label-system-code code {
    font-size: 10px;
    line-height: 1.25;
    word-break: break-all;
}

@media print {
    .label-print-body {
        background: #ffffff;
        padding: 0;
    }

    .label-print-head {
        display: none;
    }

    .label-sheet {
        gap: 6mm;
    }

    .label-card {
        box-shadow: none;
    }
}

.product-detail-summary {
    margin-bottom: 1rem;
}

.product-overview-modal .product-detail-panel {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.product-overview-modal .product-detail-tab-panel {
    overflow: visible;
    scrollbar-gutter: auto;
}

.product-overview-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
}

.product-overview-identity { min-width: 0; }
.product-overview-identity h3 { margin: 0.4rem 0; font-size: 1.125rem; line-height: 1.5; }
.product-overview-sku, .product-overview-customer { margin: 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.product-overview-sku { color: var(--muted); }
.product-overview-sku strong { color: var(--ink); margin-left: 0.4rem; }
.product-overview-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; color: var(--muted); font-size: 0.875rem; }
.product-overview-meta > span { overflow-wrap: anywhere; }
.product-overview-meta > span + span { border-left: 1px solid var(--line); padding-left: 0.75rem; }
.product-overview-customer { margin-top: 0.4rem; }
.product-overview-product-status { margin-top: 0.6rem; justify-content: flex-start; font-size: 0.8rem; }
.product-overview-head .product-detail-head-actions { max-width: 19rem; }
.product-overview h4 { margin: 0; font-size: 1rem; }
.product-overview section { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.product-overview-basic { padding-top: 1rem; }
.product-overview-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.product-overview-section-head p { margin: 0.25rem 0 0; font-size: 0.8rem; color: var(--muted); }
.product-overview-stock-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0.85rem 0 0; background: var(--surface); }
.product-overview-stock-values > div { min-width: 0; padding: 0.85rem 1rem; border-left: 1px solid var(--line); }
.product-overview-stock-values > div:first-child { border-left: 3px solid var(--accent); }
.product-overview-stock-values .is-primary { background: rgba(15, 118, 110, 0.07); }
.product-overview-stock-values dt { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.product-overview-stock-values dd { margin: 0.35rem 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; overflow-wrap: anywhere; }
.product-overview-stock-values strong { min-width: 0; font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.product-overview-stock-values dd span { font-size: 0.875rem; }
.product-overview-stock-values .is-primary strong { color: var(--accent); }
.product-overview-stock-values .is-warning strong { color: #a16207; }
.product-overview-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; margin: 0.5rem 0 0; }
.product-overview-fields > div { min-width: 0; display: grid; grid-template-columns: minmax(7rem, 0.65fr) minmax(0, 1fr); align-items: baseline; gap: 0.5rem 1rem; padding: 0.65rem 0; }
.product-overview-fields dt { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.product-overview-fields dd { margin: 0; font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.product-overview-disclosure { border-bottom: 1px solid var(--line); padding: 0.8rem 0; }
.product-overview-disclosure > summary { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; min-height: 2.25rem; cursor: pointer; list-style: none; font-weight: 600; }
.product-overview-disclosure > summary::-webkit-details-marker { display: none; }
.product-overview-disclosure > summary::after { content: "+"; display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 2rem; border: 1px solid var(--line); border-radius: 4px; color: var(--accent); }
.product-overview-disclosure[open] > summary::after { content: "-"; }
.product-overview-disclosure > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.product-overview-disclosure .product-detail-table { margin-top: 0.75rem; }
.product-overview-file-count { font-size: 0.8rem; font-weight: 400; margin-left: 0.5rem; color: var(--muted); }
.product-overview-no-files { padding: 1rem 0; font-size: 0.875rem; }
.product-overview-no-files span { color: var(--muted); }
.product-overview-file-feedback { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 0; font-size: 0.875rem; }

.product-detail-workspace { min-width: 0; }
.product-planning-modes { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding-bottom: 0.75rem; }
.product-planning-modes .tab-button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; padding: 0.75rem; font: inherit; font-size: 0.875rem; cursor: pointer; }
.product-planning-modes .tab-button.is-active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(15, 118, 110, 0.06); }
.product-planning-modes .tab-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.product-planning-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; padding-top: 1rem; font-size: 0.875rem; color: var(--muted); }
.product-planning-pagination button:disabled { opacity: 0.5; cursor: default; }
.product-detail-workspace h4 { margin: 0; font-size: 1rem; line-height: 1.5; }
.product-detail-workspace h5 { font-size: 0.9rem; }
.product-detail-workspace .product-detail-section,
.product-detail-workspace .product-detail-bom-card { min-width: 0; padding: 1rem 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.product-detail-workspace > :first-child { padding-top: 0; }
.product-detail-workspace .product-detail-section > .product-detail-table { margin-top: 0.75rem; }
.product-detail-section-meta { font-size: 0.8rem; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.product-detail-workspace .product-detail-empty { margin-top: 0.6rem; padding: 0.75rem 0; min-height: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 0.875rem; }
.product-detail-workspace .product-detail-table { min-width: 0; max-width: 100%; }
.product-detail-workspace .product-detail-table table { width: 100%; min-width: 40rem; table-layout: fixed; }
.product-detail-workspace .product-detail-table th,
.product-detail-workspace .product-detail-table td { max-width: none; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; vertical-align: top; font-variant-numeric: tabular-nums; }
.product-detail-workspace .product-detail-table th { font-size: 0.8rem; }
.product-detail-workspace .product-detail-table td { font-size: 0.875rem; line-height: 1.5; }
.product-detail-workspace .product-detail-table td:first-child { font-weight: 600; }
.product-detail-workspace .product-detail-bom-component-cell { min-width: 0; }
.product-detail-workspace .product-detail-table th,
.product-detail-workspace table[data-mobile-stack="true"] td::before { letter-spacing: 0; }
.product-detail-changes { margin: 0.5rem 0 0; }
.product-detail-changes > div { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.product-detail-changes dt { font-weight: 600; margin-bottom: 0.4rem; }
.product-detail-changes dd { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.35rem 0.65rem; margin: 0; font-weight: 400; }
.product-detail-changes dd > :nth-child(odd) { color: var(--muted); font-size: 0.8rem; }
.product-detail-changes dd > * { min-width: 0; overflow-wrap: anywhere; }
[data-product-detail-view="audit"] th:last-child { width: 46%; }
.product-detail-workspace .product-detail-table .product-overview-disclosure { padding: 0; border: 0; }
.product-detail-workspace .product-detail-table .product-detail-table table { min-width: 0; }
.product-detail-workspace .product-detail-table .product-detail-table { border: 0; }
.product-detail-workspace .product-detail-packaging-formula-bar { padding: 0.75rem 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.product-detail-workspace .product-detail-packaging-item-details { font-size: 0.8rem; }
.product-detail-workspace .product-detail-packaging-item-details > summary { width: auto; color: var(--muted); }
.product-detail-workspace .product-detail-packaging-item-details dl > div { background: transparent; border-bottom: 1px solid var(--line); }
.product-detail-workspace .product-detail-packaging-item-details > summary::before { display: none; }
.product-detail-workspace .product-detail-packaging-item-details > summary::after { width: 1.75rem; height: 1.75rem; flex-basis: 1.75rem; }
.product-detail-workspace .product-detail-bom-head { align-items: center; }
.product-detail-workspace .product-detail-bom-head button { flex-shrink: 0; }

@media (max-width: 760px) {
    .product-detail-workspace .product-detail-bom-head { flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; }
    .product-detail-workspace .product-detail-table { overflow-x: auto; }
    .product-detail-workspace .product-detail-table th,
    .product-detail-workspace .product-detail-table td { padding: 0.65rem; }
    [data-product-detail-view="audit"] .product-detail-table table[data-mobile-stack="true"] td:last-child { grid-template-columns: minmax(0, 1fr); }
    [data-product-detail-view="audit"] .product-detail-table table[data-mobile-stack="true"] td:last-child::before { display: none; }
}

@media (max-width: 1050px) {
    .product-overview-head { grid-template-columns: minmax(0, 1fr); }
    .product-overview-head .product-detail-head-actions { max-width: none; justify-content: flex-start; }
}

@media (max-width: 760px) {
    .product-overview-fields { grid-template-columns: minmax(0, 1fr); }
    .product-overview-stock-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-overview-stock-values > div { padding: 0.75rem; }
    .product-overview-stock-values > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .product-overview-stock-values > div:nth-child(3) { border-left: 0; }
    .product-overview-head { padding-right: 0; }
    .product-overview-sku { padding-right: 4rem; min-height: 2.5rem; }
}

.product-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.product-detail-tab-button {
    min-height: 2.25rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.product-detail-tab-button.is-active {
    border-color: rgba(15, 107, 109, 0.28);
    background: rgba(15, 107, 109, 0.12);
    color: var(--accent);
}

.product-detail-tab-panel {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1rem 0.25rem 0 0;
    scrollbar-gutter: stable;
}

@media (max-width: 760px) {
    .product-detail-modal {
        inset: 0;
        border: 0;
        border-radius: 0;
    }

    .product-detail-modal.co-sale-availability-modal {
        inset: 0;
        width: auto;
    }

    .product-detail-panel {
        padding: 0.75rem;
    }

    .product-detail-head {
        gap: 0.55rem;
    }

    .product-detail-head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .product-detail-head-actions .status-group {
        justify-content: flex-start;
    }

    .product-detail-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.65rem;
        scrollbar-width: thin;
    }

    .product-detail-tab-button {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-detail-modal.is-open {
        animation: none;
    }

    .product-detail-backdrop {
        transition: none;
    }
}

.product-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.product-detail-grid section {
    min-width: 0;
    display: grid;
    gap: 0.65rem;
}

.product-detail-grid h4 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1rem;
}

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

.product-detail-bom-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 0.9rem;
}

.product-detail-bom-head {
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.product-detail-bom-head h4 {
    margin: 0.1rem 0;
}

.product-detail-bom-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0.75rem;
}

.product-detail-bom-card .product-detail-table + .product-detail-table {
    margin-top: 0.75rem;
}

.product-detail-bom-component-cell {
    min-width: 280px;
    max-width: 440px;
}

.product-detail-bom-component-name,
.product-detail-bom-note {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.45;
}

.product-detail-bom-component-name {
    display: block;
    color: var(--ink);
}

.product-detail-bom-component-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.75rem;
    align-items: baseline;
    white-space: normal;
}

.product-detail-bom-component-meta-label {
    color: var(--muted);
}

.product-detail-bom-component-code {
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.product-detail-packaging-card {
    gap: 0;
}

.product-detail-packaging-formula-bar {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.product-detail-packaging-formula-bar label,
.product-detail-packaging-calculator label {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.product-detail-packaging-formula-bar label > span,
.product-detail-packaging-calculator label > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.product-detail-packaging-formula-bar select,
.product-detail-packaging-calculator input,
.product-detail-packaging-calculator select {
    width: 100%;
    min-height: 2.5rem;
}

.product-detail-packaging-formula-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    align-items: center;
    min-height: 2.5rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.product-detail-packaging-formula-meta strong {
    color: var(--ink);
}

.product-detail-packaging-viewbar {
    display: flex;
    gap: 0.75rem;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.75rem 0;
}

.product-detail-packaging-viewbar .segmented-control button.is-active {
    background: var(--accent);
    color: #fff;
}

.product-detail-packaging-calculator {
    display: grid;
    grid-template-columns: minmax(150px, 210px) minmax(150px, 220px) auto;
    gap: 0.5rem;
    align-items: end;
}

.product-detail-packaging-result-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-block: 1px solid var(--line);
    background: var(--surface-soft);
}

.product-detail-packaging-result-summary > div {
    display: flex;
    gap: 0.35rem;
    align-items: baseline;
    padding-right: 0.75rem;
    border-right: 1px solid var(--line);
}

.product-detail-packaging-result-summary span:not(.status-pill) {
    color: var(--muted);
    font-size: 0.78rem;
}

.product-detail-packaging-check-hint {
    margin: 0.5rem 0 0;
}

.product-detail-packaging-stale-message,
.product-detail-packaging-owner-note {
    margin: 0.5rem 0 0;
}

.product-detail-packaging-card.is-stale .product-detail-packaging-result-summary,
.product-detail-packaging-card.is-stale .product-detail-packaging-list {
    opacity: 0.48;
}

.product-detail-packaging-list-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 0.75rem;
    padding: 0.85rem 0 0.55rem;
}

.product-detail-packaging-list-head h5,
.product-detail-packaging-list-head p {
    margin: 0;
}

.product-detail-packaging-list-head h5 {
    color: var(--ink);
    font-size: 0.95rem;
}

.product-detail-packaging-list-head p {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.product-detail-packaging-list {
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.product-detail-packaging-item + .product-detail-packaging-item {
    border-top: 1px solid var(--line);
}

.product-detail-packaging-item-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.9rem;
    align-items: center;
    min-height: 4.25rem;
    padding: 0.7rem 0.8rem;
}

.product-detail-packaging-category {
    flex: 0 0 88px;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    border-right: 3px solid var(--accent);
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
}

.product-detail-packaging-product {
    flex: 1 1 300px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
    min-width: 180px;
}

.product-detail-packaging-product > strong {
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.product-detail-packaging-metric {
    flex: 0 1 132px;
    display: grid;
    gap: 0.1rem;
    min-width: 104px;
}

.product-detail-packaging-metric > span,
.product-detail-packaging-metric > small {
    color: var(--muted);
    font-size: 0.72rem;
}

.product-detail-packaging-metric > strong {
    color: var(--ink);
    font-size: 0.9rem;
}

.product-detail-packaging-metric.is-human-rate {
    flex: 0 1 320px;
    min-width: 240px;
}

.product-detail-packaging-metric.is-human-rate > strong {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.product-detail-packaging-metric.is-short > strong {
    color: var(--danger);
}

.product-detail-packaging-metric.is-primary {
    padding: 0.35rem 0.5rem;
    border-left: 3px solid var(--accent);
    background: var(--surface-soft);
}

.product-detail-packaging-metric.is-primary > strong {
    color: var(--accent-strong);
}

.product-detail-packaging-item-details {
    margin: 0 0.8rem 0.65rem 6.45rem;
    border-top: 1px dashed var(--line);
}

.product-detail-packaging-item-details summary {
    width: max-content;
    padding: 0.45rem 0;
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.product-detail-packaging-item-details dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 0.5rem;
    margin: 0 0 0.6rem;
}

.product-detail-packaging-item-details dl > div {
    min-width: 0;
    padding: 0.5rem;
    background: var(--surface-soft);
}

.product-detail-packaging-item-details dt,
.product-detail-packaging-item-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.product-detail-packaging-item-details dt {
    color: var(--muted);
    font-size: 0.7rem;
}

.product-detail-packaging-item-details dd {
    margin-top: 0.15rem;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 700;
}

.product-detail-packaging-item-details .product-detail-packaging-review {
    grid-column: 1 / -1;
    border-left: 3px solid var(--warning);
}

.product-detail-wide {
    grid-column: 1 / -1;
}

.co-sale-production-panel,
.co-sale-demand-panel {
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.co-sale-readonly-note {
    margin: 0 0 0.9rem;
    padding: 0.65rem 0.8rem;
    border-left: 3px solid var(--accent);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.co-sale-product-info {
    margin-bottom: 0.9rem;
}

.co-sale-product-info .panel-head {
    margin-bottom: 0.55rem;
}

.product-detail-modal.co-sale-availability-modal .co-sale-product-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-detail-modal.co-sale-availability-modal .product-detail-summary,
.product-detail-modal.co-sale-availability-modal .co-sale-production-summary,
.product-detail-modal.co-sale-availability-modal .co-sale-demand-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-detail-modal.co-sale-availability-modal .co-sale-demand-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.co-sale-product-info-grid .detail-key:nth-child(2) {
    grid-column: span 1;
}

.sales-order-product-cell {
    display: grid;
    gap: 0.35rem;
    min-width: 10rem;
}

.sales-order-product-cell > span {
    color: var(--muted);
    font-size: 0.78rem;
}

.sales-order-product-cell .tiny-button {
    width: fit-content;
}

.co-sale-production-summary,
.co-sale-demand-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0.75rem;
}

.co-sale-production-cell {
    display: grid;
    gap: 0.15rem;
    min-width: 7rem;
}

.co-sale-production-cell strong {
    color: var(--ink);
}

.co-sale-production-cell small {
    color: var(--muted);
    font-size: 0.72rem;
}

.co-sale-demand-form {
    display: grid;
    grid-template-columns: minmax(250px, 1.5fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
    gap: 0.65rem;
    align-items: end;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.co-sale-demand-form label {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.co-sale-demand-order-search {
    grid-column: 1 / -1;
}

.co-sale-demand-form label.is-disabled {
    opacity: 0.6;
}

.co-sale-demand-form .compact-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
}

.co-sale-demand-form .compact-action-row .button {
    width: auto;
    white-space: nowrap;
}

.co-sale-demand-form label > span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.co-sale-demand-form input,
.co-sale-demand-form select,
.co-sale-demand-form button {
    width: 100%;
    min-height: 2.65rem;
}

.co-sale-demand-source-note {
    margin: 0.45rem 0 0;
}

.co-sale-demand-result {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--danger);
    border-radius: 6px;
    background: var(--surface);
}

.co-sale-demand-result.is-good {
    border-left-color: var(--success);
}

.co-sale-demand-result.is-warning {
    border-left-color: var(--warning);
}

.co-sale-demand-result-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.co-sale-demand-action {
    margin: 0.35rem 0 0;
    line-height: 1.5;
}

.co-sale-demand-next-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

@media (max-width: 640px) {
    .co-sale-demand-next-action .button {
        width: 100%;
    }
}

@media (max-width: 980px) {
    .co-sale-production-summary,
    .co-sale-demand-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .co-sale-demand-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .product-detail-modal.co-sale-availability-modal .co-sale-product-info-grid,
    .product-detail-modal.co-sale-availability-modal .product-detail-summary,
    .product-detail-modal.co-sale-availability-modal .co-sale-production-summary,
    .product-detail-modal.co-sale-availability-modal .co-sale-demand-metrics,
    .product-detail-modal.co-sale-availability-modal .co-sale-demand-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .co-sale-demand-form .compact-action-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .co-sale-demand-form .compact-action-row .button {
        width: 100%;
    }
}

.product-detail-table {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.product-detail-table table {
    min-width: 520px;
}

.product-detail-empty {
    min-height: auto;
    padding: 1rem;
}

.audit-change-list {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.audit-change-row {
    display: grid;
    grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
    gap: 0.45rem;
    align-items: start;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.audit-change-row strong {
    color: var(--ink);
}

.po-items-list {
    display: grid;
    gap: 0.9rem;
}

.po-line {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
    transition: border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.po-line.is-added {
    animation: line-action-added 780ms ease;
}

.po-line.is-removing {
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    border-color: rgba(185, 28, 28, 0.38);
}

.po-line-grid {
    display: grid;
    grid-template-columns: minmax(120px, 1.35fr) minmax(72px, 0.7fr) minmax(104px, 0.88fr) minmax(88px, 0.85fr) auto;
    gap: 0.85rem;
    align-items: end;
}

.stock-count-line-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.25fr) minmax(92px, 0.72fr) minmax(120px, 0.88fr) minmax(190px, 1fr) auto;
    gap: 0.85rem;
    align-items: end;
}

.goods-issue-line-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

.goods-issue-document-stack {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.pr-create-section {
    padding: 1rem;
    border-block: 1px solid #dce2e6;
    background: #fff;
    scroll-margin-top: 1rem;
}

.pr-register-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(170px, 240px) auto;
    gap: 12px;
    align-items: end;
}

.pr-register-feedback { min-height: 28px; padding-block: 4px; }
.pr-auto-number { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 8px; }
.pr-fold { border-block: 1px solid #dce2e6; padding-block: 10px; min-width: 0; }
.pr-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; font-weight: 600; min-height: 32px; }
.pr-fold > summary::-webkit-details-marker { display: none; }
.pr-fold > summary::after { content: "+"; flex: 0 0 24px; text-align: center; color: #0f766e; }
.pr-fold[open] > summary::after { content: "\2212"; }
.pr-fold > input { margin-top: 8px; width: 100%; }
.pr-register-products { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.pr-document-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; margin: 0 0 16px; list-style: none; border-block: 1px solid #dce2e6; }
.pr-document-progress li { display: flex; align-items: flex-start; gap: 10px; padding: 14px 8px; min-width: 0; color: #64748b; border-bottom: 3px solid transparent; }
.pr-document-progress li > div { min-width: 0; overflow-wrap: anywhere; }
.pr-document-progress .is-current { color: #0f766e; background: #eef8f6; border-bottom-color: #0f766e; }
.pr-document-progress .is-complete { color: #166534; }
.pr-stage-number { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; }
.pr-document-progress .tiny-button { margin-top: 8px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 700px) {
    .pr-document-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #purchase-requisition-form .form-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #purchase-requisition-form .form-actions button { min-width: 0; white-space: normal; }
}
.pr-product-results { font-size: 12px; color: #52657c; min-height: 18px; }
.pr-product-pages { display: flex; gap: 8px; }
.pr-product-pages button { width: 32px; height: 28px; }
.pr-selected-product { font-size: 13px; overflow-wrap: anywhere; white-space: normal; }
#purchase-requisition-create-panel .po-line-grid { grid-template-columns: minmax(240px, 2fr) minmax(130px, 1fr) minmax(140px, 1fr) 48px; align-items: start; }
#purchase-requisition-create-panel .po-line-field-product { display: grid; gap: 6px; min-width: 0; }
#purchase-requisition-create-panel input, #purchase-requisition-create-panel select { min-width: 0; max-width: 100%; }

@media (max-width: 900px) {
    .pr-register-filters { grid-template-columns: minmax(0, 1fr) minmax(160px, 1fr); }
    .pr-register-filters > label:first-child { grid-column: 1 / -1; }
    #purchase-requisition-create-panel .po-line-grid { grid-template-columns: minmax(0, 1fr) 48px; }
    #purchase-requisition-create-panel .po-line-field { grid-column: 1 / -1; }
}

.purchase-requisition-document-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    background: var(--surface);
}

.purchase-requisition-workspace-section {
    min-width: 0;
    padding: 1rem;
    border-top: 1px solid var(--line);
    scroll-margin-top: 1rem;
}

.purchase-requisition-workspace-section h3 {
    font-size: 1.05rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.purchase-requisition-workspace-section h3:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

.pr-detail-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.pr-detail-heading-actions > [data-action="back-to-requisition-register"] {
    min-width: 0;
    white-space: normal;
}

.pr-detail-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 6px;
    font-size: 20px;
    color: var(--teal);
}

.purchase-requisition-workspace-section table {
    min-width: 0;
    table-layout: fixed;
}

.purchase-requisition-workspace-section :is(th, td, .tiny-button, strong) {
    overflow-wrap: anywhere;
    white-space: normal;
    letter-spacing: 0;
}

.purchase-requisition-workspace-section .detail-grid {
    padding-block: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.purchase-requisition-workspace-section .detail-key {
    padding: 0.5rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.purchase-requisition-workspace-section .detail-actions {
    margin-block: 1rem;
}

.purchase-requisition-workspace-section .detail-table th:first-child {
    width: 30%;
}

.purchase-requisition-note {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .purchase-requisition-workspace-section .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem 1rem;
    }
}

@media (max-width: 700px) {
    .purchase-requisition-note {
        grid-column: 1 / -1;
    }

    .purchase-requisition-workspace-section .detail-table.table-wrap-mobile-friendly td:not([colspan]):not([data-cell-role="actions"]) {
        grid-template-columns: minmax(5rem, 32%) minmax(0, 1fr);
    }
}

.goods-issue-register-panel,
.goods-issue-selected-detail-panel {
    min-width: 0;
    width: 100%;
}

.goods-issue-register-panel .panel-head .helper-text {
    max-width: 64rem;
    margin: 0.25rem 0 0;
}

.goods-issue-register-table-wrap table {
    min-width: 980px;
}

.goods-issue-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.goods-issue-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    min-height: 84px;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--ink);
    text-align: left;
}

.goods-issue-step:hover,
.goods-issue-step.is-active {
    border-color: rgba(15, 118, 110, 0.45);
    background: var(--accent-soft);
}

.goods-issue-step.is-complete .goods-issue-step-index {
    background: var(--success);
    color: #fff;
}

.goods-issue-step-index {
    display: inline-grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.goods-issue-step strong {
    display: block;
    font-size: 0.9rem;
    line-height: 1.25;
}

.goods-issue-step small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.goods-issue-wizard-body,
.goods-issue-step-pane,
.goods-issue-review-stack {
    display: grid;
    gap: 1rem;
}

.goods-issue-review-grid,
.goods-issue-review-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.goods-issue-wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
}

.goods-issue-wizard-actions [data-goods-issue-submit] {
    margin-left: auto;
}

.confirm-panel {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.confirm-panel p {
    margin: 0;
    color: var(--muted);
}

.journal-line-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1fr) minmax(140px, 0.9fr) minmax(96px, 0.7fr) minmax(96px, 0.7fr) auto;
    gap: 0.85rem;
    align-items: end;
}

.po-receive-lines {
    display: grid;
    gap: 1rem;
}

.po-receive-line {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
}

.po-receive-putaway-summary,
.putaway-advice {
    margin: 0;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.putaway-advice {
    display: grid;
    gap: 0.2rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.putaway-advice strong {
    color: var(--text);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.po-receive-line-grid {
    display: grid;
    grid-template-columns: minmax(92px, 0.65fr) repeat(3, minmax(135px, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.line-summary {
    min-height: 3.3rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
    background: #ffffff;
    color: var(--muted);
    display: grid;
    align-content: center;
    font-size: 0.88rem;
    line-height: 1.45;
}

.text-danger {
    color: var(--danger);
}

.po-line-field {
    min-width: 0;
}

.po-line-field span {
    white-space: nowrap;
}

.po-line-field input,
.po-line-field select {
    min-width: 0;
}

.po-line-field-product select,
#po-supplier-select,
#so-customer-select,
#so-warehouse-select {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.po-line-field-qty input,
.po-line-field-price input,
.stock-count-line-grid input[name="counted_qty"],
.stock-count-line-grid input[name="unit_cost"],
.journal-line-grid input[name="debit"],
.journal-line-grid input[name="credit"] {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.po-line-field-qty input {
    min-width: 72px;
}

.po-line-field-price input {
    min-width: 104px;
}

.po-line-remove {
    align-self: end;
    white-space: nowrap;
}

.goods-issue-line-hint {
    grid-column: 1 / -1;
    margin: -0.25rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.line-action-feedback {
    margin-top: -0.2rem;
    border: 1px solid rgba(30, 47, 66, 0.08);
    font-weight: 650;
}

@keyframes line-action-added {
    0% {
        border-color: rgba(12, 115, 112, 0.45);
        box-shadow: 0 0 0 4px rgba(12, 115, 112, 0.12);
        transform: translateY(-2px);
    }

    100% {
        border-color: var(--line);
        box-shadow: none;
        transform: translateY(0);
    }
}

.detail-panel-body {
    display: grid;
    gap: 1rem;
}

.split-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.detail-key {
    padding: 0.95rem;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--line);
}

.report-check-item strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.detail-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.exception-report-block {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.exception-report-block h4 {
    margin: 0;
    font-size: 1rem;
}

.stock-accuracy-report {
    display: grid;
    gap: 0.85rem;
    overflow: hidden;
}

.stock-accuracy-report > .panel-head,
.stock-accuracy-report .stat-grid {
    margin-bottom: 0;
}

.stock-accuracy-summary-grid {
    gap: 0.55rem;
}

.stock-accuracy-summary-grid .detail-key {
    min-height: 4.2rem;
    padding: 0.68rem 0.78rem;
}

.stock-accuracy-summary-grid .detail-key strong {
    font-size: 1.12rem;
}

.stock-accuracy-diagnostics,
.stock-accuracy-section {
    min-width: 0;
    display: grid;
    gap: 0.55rem;
}

.stock-accuracy-diagnostics {
    padding: 0.72rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stock-accuracy-section-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
}

.stock-accuracy-section-head h4,
.stock-accuracy-section-head p {
    margin: 0;
}

.stock-accuracy-section-head h4 {
    font-size: 1rem;
    line-height: 1.25;
}

.stock-accuracy-section-head .helper-text {
    margin-top: 0.18rem;
    max-width: 62rem;
}

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

.stock-accuracy-report-sections {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

.stock-accuracy-section + .stock-accuracy-section {
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}

.stock-accuracy-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-gutter: stable;
}

.stock-accuracy-table table {
    table-layout: fixed;
}

.stock-accuracy-table th,
.stock-accuracy-table td {
    padding: 0.68rem 0.72rem;
    overflow-wrap: anywhere;
}

.stock-accuracy-table small {
    display: block;
    margin-top: 0.16rem;
    line-height: 1.35;
}

.stock-accuracy-warehouse-table table {
    min-width: 58rem;
}

.stock-accuracy-warehouse-table {
    max-height: min(24rem, 48vh);
    overflow: auto;
}

.stock-accuracy-warehouse-table th:first-child {
    width: 12rem;
}

.stock-accuracy-warehouse-table th:not(:first-child) {
    width: 6.5rem;
}

.stock-accuracy-exception-table table {
    min-width: 67rem;
}

.stock-accuracy-exception-table {
    max-height: min(42rem, 68vh);
    overflow: auto;
}

.stock-accuracy-exception-table th:nth-child(1) {
    width: 7.5rem;
}

.stock-accuracy-exception-table th:nth-child(2) {
    width: 22rem;
}

.stock-accuracy-exception-table th:nth-child(3) {
    width: 11rem;
}

.stock-accuracy-exception-table th:nth-child(4) {
    width: 14rem;
}

.stock-accuracy-exception-table th:nth-child(5) {
    width: 6rem;
}

.stock-accuracy-exception-table th:nth-child(6) {
    width: 10rem;
}

.stock-accuracy-position-cell {
    display: grid;
    gap: 0.12rem;
}

.stock-accuracy-position-cell small {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 0.35rem;
    color: var(--ink-soft);
}

.stock-accuracy-position-cell small span {
    color: var(--muted);
}

.stock-accuracy-row-detail {
    color: var(--ink-soft);
}

.stock-accuracy-recommendation {
    margin-top: 0.4rem;
    padding: 0.4rem 0.48rem;
    border-left: 3px solid var(--warning);
    background: var(--warning-soft);
    color: var(--ink-soft);
}

.stock-accuracy-recommendation span {
    display: block;
    margin-bottom: 0.08rem;
    color: var(--ink);
    font-weight: 800;
}

.stock-accuracy-table .numeric-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    white-space: nowrap;
}

.quality-recall-report-stack {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

.quality-compliance-panel {
    min-width: 0;
    display: grid;
    gap: 0.8rem;
    overflow: hidden;
}

.quality-compliance-panel > .panel-head,
.quality-compliance-panel > .detail-grid {
    margin-bottom: 0;
}

.quality-compliance-groups {
    min-width: 0;
    border-top: 1px solid var(--line);
}

.quality-compliance-group {
    min-width: 0;
    border-bottom: 1px solid var(--line);
}

.quality-compliance-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.78rem 0.2rem;
    cursor: pointer;
    list-style: none;
}

.quality-compliance-group > summary::-webkit-details-marker {
    display: none;
}

.quality-compliance-group > summary > span:first-child {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.quality-compliance-group > summary strong {
    font-size: 0.95rem;
}

.quality-compliance-group > summary small {
    color: var(--muted);
    line-height: 1.35;
}

.quality-compliance-group > summary::after {
    content: "+";
    order: 3;
    width: 1.4rem;
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
}

.quality-compliance-group[open] > summary::after {
    content: "−";
}

.quality-compliance-group-body {
    min-width: 0;
    display: grid;
    gap: 0.45rem;
    padding: 0 0 0.8rem;
}

.quality-compliance-row-count {
    margin: 0;
}

.quality-compliance-table-wrap {
    width: 100%;
    max-width: 100%;
    max-height: min(38rem, 66vh);
    overflow: auto;
    scrollbar-gutter: stable;
}

.quality-compliance-table {
    min-width: 62rem;
    table-layout: fixed;
}

.quality-compliance-table th,
.quality-compliance-table td {
    padding: 0.68rem 0.72rem;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.quality-compliance-table th:nth-child(1) {
    width: 7rem;
}

.quality-compliance-table th:nth-child(2) {
    width: 15rem;
}

.quality-compliance-table th:nth-child(3) {
    width: 8rem;
}

.quality-compliance-table th:nth-child(4) {
    width: 19rem;
}

.quality-compliance-table th:nth-child(5) {
    width: 18rem;
}

.quality-compliance-reference {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr);
    gap: 0.35rem;
    margin-top: 0.28rem;
    color: var(--ink-soft);
    line-height: 1.35;
}

.quality-compliance-reference span {
    color: var(--muted);
}

.quality-compliance-check-grid {
    display: grid;
    grid-template-columns: minmax(7rem, 1.4fr) repeat(2, minmax(5rem, 0.8fr));
    gap: 0.45rem;
}

.quality-compliance-check-grid > span {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.18rem;
}

.quality-compliance-check-grid small,
.quality-compliance-check-grid em {
    color: var(--muted);
    font-size: 0.76rem;
    font-style: normal;
    line-height: 1.3;
}

.quality-compliance-check-grid .status-pill {
    width: max-content;
    max-width: 100%;
}

.quality-compliance-issues {
    display: grid;
    gap: 0.3rem;
    color: var(--ink-soft);
    line-height: 1.35;
}

.quality-compliance-issues > span::before,
.quality-compliance-issues details > span::before {
    content: "•";
    margin-right: 0.35rem;
    color: var(--danger);
}

.quality-compliance-issues .quality-compliance-clear::before {
    color: var(--success);
}

.quality-compliance-issues details {
    margin-top: 0.1rem;
}

.quality-compliance-issues details summary {
    width: max-content;
    color: var(--accent-deep);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 750;
}

.quality-compliance-issues details > span {
    display: block;
    margin-top: 0.28rem;
}

.inventory-lot-snapshot-panel {
    min-width: 0;
    display: grid;
    gap: 0.8rem;
    overflow: hidden;
}

.inventory-lot-snapshot-panel > .panel-head,
.inventory-lot-snapshot-panel > .detail-grid {
    margin-bottom: 0;
}

.inventory-lot-snapshot-panel .panel-head > div {
    min-width: 0;
}

.inventory-lot-snapshot-panel .panel-head .helper-text {
    max-width: 72rem;
    margin-top: 0.22rem;
}

.inventory-lot-snapshot-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-lot-snapshot-summary .detail-key {
    min-height: 4.2rem;
}

.inventory-lot-snapshot-groups {
    min-width: 0;
    border-top: 1px solid var(--line);
}

.inventory-lot-snapshot-group {
    min-width: 0;
    border-bottom: 1px solid var(--line);
}

.inventory-lot-snapshot-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.78rem 0.2rem;
    cursor: pointer;
    list-style: none;
}

.inventory-lot-snapshot-group > summary::-webkit-details-marker {
    display: none;
}

.inventory-lot-snapshot-group > summary > span:first-child {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.inventory-lot-snapshot-group > summary strong {
    font-size: 0.95rem;
}

.inventory-lot-snapshot-group > summary small {
    color: var(--muted);
    line-height: 1.35;
}

.inventory-lot-snapshot-group > summary::after {
    content: "+";
    order: 3;
    width: 1.4rem;
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
}

.inventory-lot-snapshot-group[open] > summary::after {
    content: "-";
}

.inventory-lot-snapshot-group-body {
    min-width: 0;
    display: grid;
    gap: 0.45rem;
    padding: 0 0 0.8rem;
}

.inventory-lot-snapshot-row-count {
    margin: 0;
}

.inventory-lot-snapshot-table-wrap {
    width: 100%;
    max-width: 100%;
    max-height: min(38rem, 66vh);
    overflow: auto;
    scrollbar-gutter: stable;
}

.inventory-lot-snapshot-table {
    min-width: 72rem;
    table-layout: fixed;
}

.inventory-lot-snapshot-table th,
.inventory-lot-snapshot-table td {
    padding: 0.68rem 0.72rem;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.inventory-lot-snapshot-table th:nth-child(1) {
    width: 15rem;
}

.inventory-lot-snapshot-table th:nth-child(2) {
    width: 11rem;
}

.inventory-lot-snapshot-table th:nth-child(3) {
    width: 9rem;
}

.inventory-lot-snapshot-table th:nth-child(4) {
    width: 13rem;
}

.inventory-lot-snapshot-table th:nth-child(5) {
    width: 12rem;
}

.inventory-lot-snapshot-table th:nth-child(6) {
    width: 16rem;
}

.inventory-lot-identity,
.inventory-lot-position,
.inventory-lot-unit,
.inventory-lot-source {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.22rem;
    line-height: 1.35;
}

.inventory-lot-identity > strong,
.inventory-lot-position > strong,
.inventory-lot-source > strong {
    color: var(--ink);
}

.inventory-lot-identity > span,
.inventory-lot-position > span,
.inventory-lot-source > span,
.inventory-lot-unit > span {
    color: var(--ink-soft);
}

.inventory-lot-identity > small,
.inventory-lot-source > small {
    color: var(--muted);
}

.inventory-lot-position .status-pill,
.inventory-lot-unit .status-pill {
    width: max-content;
    max-width: 100%;
    margin-top: 0.18rem;
}

.inventory-lot-quantity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
}

.inventory-lot-quantity-grid > span {
    min-width: 0;
    display: grid;
    gap: 0.08rem;
    padding: 0.38rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.inventory-lot-quantity-grid > span.available {
    border-color: color-mix(in srgb, var(--success) 32%, var(--line));
    background: color-mix(in srgb, var(--success-soft) 70%, white);
}

.inventory-lot-quantity-grid small {
    color: var(--muted);
    line-height: 1.2;
}

.inventory-lot-quantity-grid strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.inventory-lot-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.inventory-lot-dates > span {
    min-width: 0;
    display: grid;
    gap: 0.08rem;
}

.inventory-lot-dates small {
    color: var(--muted);
}

.inventory-lot-trace-details {
    margin-top: 0.5rem;
}

.inventory-lot-trace-details > summary {
    width: max-content;
    max-width: 100%;
    color: var(--accent-deep);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 750;
}

.inventory-lot-trace-details > div {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.42rem;
    padding: 0.5rem;
    border-left: 2px solid var(--line-strong);
    color: var(--ink-soft);
    font-size: 0.78rem;
    line-height: 1.35;
}

.inventory-lot-trace-details > div span {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .inventory-lot-snapshot-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .inventory-lot-snapshot-summary {
        grid-template-columns: 1fr;
    }

    .inventory-lot-snapshot-group > summary {
        align-items: flex-start;
    }
}

.inventory-balance-split-panel {
    min-width: 0;
    display: grid;
    gap: 0.8rem;
    overflow: hidden;
}

.inventory-balance-split-panel > .panel-head,
.inventory-balance-split-panel > .detail-grid {
    margin-bottom: 0;
}

.inventory-balance-split-panel .panel-head > div {
    min-width: 0;
}

.inventory-balance-split-panel .panel-head .helper-text {
    max-width: 72rem;
    margin-top: 0.22rem;
}

.inventory-balance-split-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-balance-split-summary .detail-key {
    min-height: 4.2rem;
}

.inventory-balance-split-groups {
    min-width: 0;
    border-top: 1px solid var(--line);
}

.inventory-balance-split-group {
    min-width: 0;
    border-bottom: 1px solid var(--line);
}

.inventory-balance-split-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.78rem 0.2rem;
    cursor: pointer;
    list-style: none;
}

.inventory-balance-split-group > summary::-webkit-details-marker {
    display: none;
}

.inventory-balance-split-group > summary > span:first-child {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.inventory-balance-split-group > summary strong {
    font-size: 0.95rem;
}

.inventory-balance-split-group > summary small {
    color: var(--muted);
    line-height: 1.35;
}

.inventory-balance-split-group > summary::after {
    content: "+";
    order: 3;
    width: 1.4rem;
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
}

.inventory-balance-split-group[open] > summary::after {
    content: "-";
}

.inventory-balance-split-group-body {
    min-width: 0;
    display: grid;
    gap: 0.45rem;
    padding: 0 0 0.8rem;
}

.inventory-balance-split-row-count {
    margin: 0;
}

.inventory-balance-split-table-wrap {
    width: 100%;
    max-width: 100%;
    max-height: min(38rem, 66vh);
    overflow: auto;
    scrollbar-gutter: stable;
}

.inventory-balance-split-table {
    min-width: 68rem;
    table-layout: fixed;
}

.inventory-balance-split-table th,
.inventory-balance-split-table td {
    padding: 0.68rem 0.72rem;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.inventory-balance-split-table th:nth-child(1) {
    width: 15rem;
}

.inventory-balance-split-table th:nth-child(2) {
    width: 13rem;
}

.inventory-balance-split-table th:nth-child(3) {
    width: 10rem;
}

.inventory-balance-split-table th:nth-child(4),
.inventory-balance-split-table th:nth-child(5) {
    width: 15rem;
}

.inventory-balance-identity,
.inventory-balance-position,
.inventory-balance-status,
.inventory-balance-availability {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.22rem;
    line-height: 1.35;
}

.inventory-balance-identity > span,
.inventory-balance-position > span,
.inventory-balance-status > small,
.inventory-balance-availability small,
.inventory-balance-availability p {
    color: var(--muted);
}

.inventory-balance-identity > small,
.inventory-balance-position > small {
    color: var(--ink-soft);
}

.inventory-balance-status .status-pill,
.inventory-balance-availability .status-pill {
    width: max-content;
    max-width: 100%;
}

.inventory-balance-quantity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
}

.inventory-balance-quantity-grid > span,
.inventory-balance-availability > span:not(.status-pill) {
    min-width: 0;
    display: grid;
    gap: 0.08rem;
    padding: 0.38rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.inventory-balance-quantity-grid > span.sellable {
    border-color: color-mix(in srgb, var(--success) 32%, var(--line));
    background: color-mix(in srgb, var(--success-soft) 70%, white);
}

.inventory-balance-quantity-grid small,
.inventory-balance-availability small {
    line-height: 1.2;
}

.inventory-balance-quantity-grid strong,
.inventory-balance-availability strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.inventory-balance-availability p {
    margin: 0.18rem 0 0;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .inventory-balance-split-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .inventory-balance-split-summary {
        grid-template-columns: 1fr;
    }

    .inventory-balance-split-group > summary {
        align-items: flex-start;
    }
}

.detail-table {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
}

.modal {
    width: min(96vw, 520px);
    max-width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
}

.modal.modal-wide {
    width: min(96vw, 980px);
}

.modal::backdrop {
    background: rgba(21, 27, 33, 0.45);
    backdrop-filter: none;
}

.modal-body {
    padding: 1.4rem;
    max-height: calc(100dvh - 1rem);
    overflow: auto;
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.modal-highlight {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: #f8fafc;
    border: 1px solid var(--line);
}

.modal-highlight span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    display: grid;
    gap: 0.7rem;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    color: #fff;
    box-shadow: var(--shadow);
    animation: toast-in 220ms ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--teal);
}

.toast.is-leaving {
    pointer-events: none;
    animation: toast-out 400ms ease forwards;
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

.empty-state {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1180px) {
    .login-screen,
    .workspace,
    .split-layout,
    .trace-grid,
    .admin-panel-grid {
        grid-template-columns: 1fr;
    }

    .organization-master-layout {
        grid-template-columns: 1fr;
    }

    .trace-search-form .form-grid {
        grid-template-columns: 1fr;
    }

    .workspace {
        gap: 0.95rem;
    }

    .sidebar {
        min-width: 0;
        position: static;
        max-height: none;
        overflow: visible;
        padding: 0.85rem;
    }

    .nav-stack {
        display: flex;
        align-items: flex-start;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        padding-bottom: 0.2rem;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .nav-group {
        display: grid;
        align-content: start;
        flex: 0 0 auto;
        width: max-content;
    }

    .nav-group + .nav-group {
        padding-top: 0;
        padding-left: 0.85rem;
        border-top: 0;
        border-left: 1px solid var(--line);
    }

    .nav-group-title {
        white-space: nowrap;
        padding-top: 0;
    }

    .nav-group-items {
        display: flex;
        gap: 0.25rem;
    }

    .nav-group .nav-button {
        width: auto;
        flex: 0 0 auto;
    }

    .nav-group .nav-button.is-active {
        box-shadow: inset 0 -3px 0 var(--teal);
    }

    .nav-button {
        white-space: nowrap;
        text-align: center;
        scroll-snap-align: start;
    }

    .story-grid,
    .stat-grid,
    .board-grid,
    .dashboard-today-grid,
    .dashboard-zone-top-grid,
    .dashboard-operations-grid,
    .dashboard-command-grid,
    .dashboard-intelligence-grid,
    .dashboard-filter-grid,
    .quick-grid,
    .commercial-master-grid,
    .product-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .product-detail-bom-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-pipeline-lane {
        grid-template-columns: 1fr;
    }

    .dashboard-pipeline-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .owner-inventory-metric-grid,
    .owner-inventory-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar::before {
        display: none;
    }

    .topbar-brand {
        max-width: none;
    }

    .topbar-meta {
        width: 100%;
        max-width: none;
        justify-self: stretch;
        justify-content: space-between;
        justify-items: start;
    }

    .status-group,
    .status-strip,
    .user-cluster {
        justify-content: flex-start;
        justify-items: start;
    }
}

@media (max-width: 1420px) {
    .purchase-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .dashboard-stock-control-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .owner-inventory-metric-grid,
    .owner-inventory-split {
        grid-template-columns: 1fr;
    }

    .warehouse-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-operation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-task-head {
        display: grid;
    }

    .warehouse-task-summary-grid,
    .warehouse-task-summary-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .raw-material-readiness-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-queue-metric-grid,
    .warehouse-queue-shortcut-grid,
    .warehouse-manager-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-manager-split {
        grid-template-columns: 1fr;
    }

    .commercial-master-grid {
        grid-template-columns: 1fr;
    }

    .commercial-focus-bar,
    .commercial-filter-row,
    .commercial-filter-row.commercial-filter-row-wide {
        grid-template-columns: 1fr;
    }

    .bom-list-focus-context {
        align-items: stretch;
        flex-direction: column;
    }

    .bom-list-focus-context .button {
        width: 100%;
    }

    .product-filter-primary {
        grid-template-columns: 1fr;
    }

    .product-sales-filter-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .product-section-heading {
        align-items: start;
    }

    .product-main-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .product-toolbar-filter-actions,
    .product-toolbar-primary-actions {
        justify-content: stretch;
    }

    .product-toolbar-filter-actions .button,
    .product-toolbar-primary-actions .button,
    .product-more-menu {
        flex: 1 1 10rem;
    }

    .product-more-summary {
        justify-content: center;
        width: 100%;
    }

    .product-more-menu-panel {
        position: static;
        margin-top: 0.45rem;
        min-width: 0;
        box-shadow: none;
    }

    .dashboard-filter-head {
        align-items: stretch;
        display: grid;
    }

    .dashboard-filter-actions {
        justify-content: stretch;
    }

    .dashboard-filter-actions .tiny-button {
        flex: 1 1 8rem;
    }

    .dashboard-zone-head {
        align-items: start;
        display: grid;
    }

    .dashboard-zone-top-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-zone-top-grid .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-freshness-inline {
        width: 100%;
    }

    .dashboard-freshness-helper:not([hidden]) {
        flex: 1 1 100%;
        max-width: 100%;
        white-space: normal;
    }

    .dashboard-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-workbench > .document-register-panel {
        order: 1;
    }

    .document-workbench > .document-detail-panel {
        order: 2;
    }

    .document-workbench > .document-queue-panel {
        order: 3;
    }

    .document-workbench > .document-create-panel {
        order: 4;
    }

    .approval-workbench > .approval-register-panel {
        order: 1;
    }

    .approval-workbench > .approval-detail-panel {
        order: 2;
    }

    #section-purchase-invoices .section-stack > .split-layout,
    #section-sales-invoices .section-stack > .split-layout,
    #section-purchase-returns .section-stack > .split-layout,
    #section-sales-returns .section-stack > .split-layout {
        order: 2;
    }

    #section-purchase-invoices .section-stack > .form-panel,
    #section-sales-invoices .section-stack > .form-panel,
    #section-purchase-returns .section-stack > .form-panel,
    #section-sales-returns .section-stack > .form-panel {
        order: 3;
    }

    #section-purchase-invoices .split-layout > .detail-panel,
    #section-sales-invoices .split-layout > .detail-panel,
    #section-purchase-returns .split-layout > .detail-panel,
    #section-sales-returns .split-layout > .detail-panel {
        order: 1;
    }

    #section-purchase-invoices .split-layout > .table-panel,
    #section-sales-invoices .split-layout > .table-panel,
    #section-purchase-returns .split-layout > .table-panel,
    #section-sales-returns .split-layout > .table-panel {
        order: 2;
    }
}

@media (max-width: 560px) {
    .warehouse-kpi-grid {
        grid-template-columns: 1fr;
    }

    .warehouse-operation-head {
        align-items: stretch;
        flex-direction: column;
    }

    .warehouse-operation-head .helper-text {
        max-width: none;
        text-align: left;
    }

    .warehouse-operation-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .dashboard-domain-tab {
        flex: 1 0 5.25rem;
        min-width: 5.25rem;
        padding-inline: 0.55rem;
        text-align: center;
    }

    .dashboard-stock-control-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-stock-control-section-head {
        display: grid;
        align-items: start;
    }

    .warehouse-detail-drawer,
    .sales-pick-list-drawer,
    .dashboard-drilldown-drawer {
        inset: 0;
        width: 100vw;
        border-radius: 0;
    }

    .dashboard-create-menu {
        width: 100%;
    }

    .dashboard-create-menu > .button {
        width: 100%;
    }

    .dashboard-create-menu-panel {
        left: 0;
        right: auto;
        width: 100%;
    }

    .login-screen,
    .app-shell {
        padding: 1rem;
    }

    .login-screen {
        min-height: auto;
        align-items: start;
    }

    .login-story h1 {
        max-width: 14ch;
    }

    .story-grid,
    .stat-grid,
    .board-grid,
    .dashboard-operations-grid,
    .dashboard-metric-list,
    .dashboard-command-grid,
    .dashboard-intelligence-grid,
    .quick-grid,
    .product-detail-grid,
    .form-grid,
    .split-form-grid,
    .detail-grid,
    .goods-issue-stepper,
    .goods-issue-review-grid,
    .goods-issue-review-totals,
    .po-line-grid,
    .goods-issue-line-grid,
    .po-receive-line-grid,
    .stock-count-line-grid,
    .journal-line-grid {
        grid-template-columns: 1fr;
    }

    .detail-key.is-sales-primary {
        grid-column: 1;
    }

    .topbar {
        padding: 0.55rem;
        border-radius: var(--radius-sm);
    }

    .topbar h1 {
        max-width: none;
        font-size: 1rem;
    }

    .topbar-brand {
        align-items: center;
        padding: 0;
    }

    .topbar-meta {
        display: grid;
        gap: 0.5rem;
        padding: 0;
    }

    .topbar .status-pill,
    .topbar .meta-chip,
    .user-badge {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .user-cluster .button {
        min-width: 0;
    }

    .product-form-drawer {
        inset: 0;
        width: auto;
        border-radius: 0;
    }

    .product-form-drawer.is-open {
        animation: none;
    }

    .product-creation-kind-options {
        grid-template-columns: 1fr;
    }

    .product-creation-kind {
        min-height: 0;
    }

    .commercial-master-form-drawer {
        inset: 0;
        width: auto;
        max-height: none;
        border-radius: 0;
    }

    .commercial-drawer-feedback:not([hidden]) {
        right: 1rem;
        bottom: 1rem;
        width: calc(100vw - 2rem);
    }

    .section-heading,
    .panel-head,
    .subsection-head,
    .table-toolbar,
    .table-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-actions,
    .form-actions,
    .detail-actions,
    .pagination-controls,
    .pagination-pages,
    .pagination-size {
        width: 100%;
    }

    .toolbar-actions .button,
    .form-actions .button,
    .detail-actions .button,
    .pagination-controls .pagination-button {
        flex: 1 1 auto;
    }

    .table-wrap {
        border-radius: var(--radius-md);
    }

    .table-wrap.table-wrap-mobile-friendly {
        max-height: none;
        overflow: visible;
        border-color: transparent;
        background: transparent;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] {
        min-width: 0;
        display: block;
        background: transparent;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] tbody {
        display: grid;
        gap: 0.85rem;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] tr {
        display: grid;
        gap: 0.6rem;
        padding: 0.9rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.86);
        box-shadow: var(--shadow-soft);
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] tr.row-active {
        background: rgba(15, 107, 109, 0.09);
        border-color: rgba(15, 107, 109, 0.28);
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] td {
        display: grid;
        grid-template-columns: minmax(6.75rem, 42%) minmax(0, 1fr);
        gap: 0.8rem;
        padding: 0;
        border: 0;
        align-items: start;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] td[colspan] {
        display: block;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] td[colspan]::before {
        content: none;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] td[data-cell-role="actions"] {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding-top: 0.55rem;
        border-top: 1px solid rgba(30, 47, 66, 0.09);
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] td[data-cell-role="actions"]::before {
        content: attr(data-label);
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] .action-strip {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
        width: 100%;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] .product-row-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
        width: 100%;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] .row-action-menu {
        width: 100%;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] .row-action-menu summary {
        width: 100%;
        text-align: center;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] .row-action-menu-list {
        position: static;
        width: 100%;
        box-shadow: none;
    }

    .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] .table-text-clip {
        max-width: none;
        white-space: normal;
    }

    .document-workbench .detail-actions,
    .document-workbench .delivery-queue-actions,
    .approval-detail-body .action-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
        width: 100%;
        justify-items: stretch;
    }

    .document-workbench .detail-actions .button,
    .document-workbench .delivery-queue-actions .tiny-button,
    .approval-detail-body .action-strip .tiny-button {
        width: 100%;
        min-height: 2.75rem;
    }

    .approval-context-panel {
        grid-template-columns: 1fr;
    }

    .approval-history-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .document-workbench .delivery-queue-actions {
        align-self: stretch;
    }

    .document-workbench .delivery-queue-item {
        padding: 1rem;
    }

    .document-workbench .detail-table.table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] td,
    .approval-workbench .table-wrap.table-wrap-mobile-friendly table[data-mobile-stack="true"] td {
        grid-template-columns: minmax(6rem, 40%) minmax(0, 1fr);
    }

    .dashboard-work-center-head {
        display: grid;
        align-items: start;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-kpi-secondary {
        grid-template-columns: 1fr;
    }

    .dashboard-work-center-head .status-pill {
        width: fit-content;
        white-space: normal;
    }

    .dashboard-work-center-table-wrap {
        max-height: none;
    }

    .dashboard-work-center-table tr[data-tone="danger"] td:first-child,
    .dashboard-work-center-table tr[data-tone="warning"] td:first-child {
        border-left: 0;
    }

    .dashboard-work-center-count {
        text-align: left;
    }

    #section-purchase-invoices .detail-actions,
    #section-sales-invoices .detail-actions,
    #section-purchase-returns .detail-actions,
    #section-sales-returns .detail-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    #section-purchase-invoices .detail-actions .button,
    #section-sales-invoices .detail-actions .button,
    #section-purchase-returns .detail-actions .button,
    #section-sales-returns .detail-actions .button {
        width: 100%;
        min-height: 2.75rem;
    }
}

@media (max-width: 900px) {
    .warehouse-structure-layout {
        grid-template-columns: 1fr;
    }

    .warehouse-location-card {
        grid-template-columns: minmax(5.5rem, 0.7fr) minmax(0, 1fr);
    }

    .warehouse-location-path,
    .warehouse-location-card .warehouse-health-stack {
        grid-column: 1 / -1;
    }

    .warehouse-location-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .warehouse-page-meta,
    .warehouse-directory-actions,
    .warehouse-location-workbench-head {
        align-items: stretch;
        flex-direction: column;
    }

    .warehouse-search-field {
        min-width: 0;
        width: 100%;
    }

    .warehouse-location-toolbar {
        grid-template-columns: 1fr;
    }

    .warehouse-location-filter-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .warehouse-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-kpi-card {
        min-width: 0;
        min-height: 5.2rem;
        padding: 0.65rem;
    }

    .warehouse-operation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-directory-panel .warehouse-table-wrap {
        display: none;
    }

    .warehouse-mobile-cards {
        display: grid;
        gap: 0.6rem;
        padding: 0.65rem;
    }

    .warehouse-mobile-card {
        display: grid;
        gap: 0.55rem;
        width: 100%;
        min-width: 0;
        padding: 0.75rem;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: var(--surface);
        color: var(--ink);
        text-align: left;
    }

    .warehouse-mobile-card:is(:hover, :focus-visible) {
        border-color: rgba(15, 107, 109, 0.4);
        outline: none;
    }

    .warehouse-mobile-card-head {
        display: flex;
        justify-content: space-between;
        gap: 0.55rem;
        align-items: flex-start;
        min-width: 0;
    }

    .warehouse-mobile-card-head > span:first-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .warehouse-mobile-ready {
        display: flex;
        justify-content: space-between;
        gap: 0.5rem;
        align-items: baseline;
        padding: 0.55rem 0.65rem;
        border-left: 3px solid var(--success);
        background: rgba(22, 101, 52, 0.07);
    }

    .warehouse-mobile-ready strong {
        color: #166534;
        font-size: 1.35rem;
    }

    .warehouse-mobile-split {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
        min-width: 0;
    }

    .warehouse-mobile-split > span {
        display: grid;
        gap: 0.12rem;
        min-width: 0;
        padding: 0.45rem;
        overflow-wrap: anywhere;
        border: 1px solid var(--line);
        color: var(--muted);
        font-size: 0.68rem;
    }

    .warehouse-mobile-split strong {
        color: var(--ink);
        font-size: 0.9rem;
    }

    .warehouse-mobile-meta {
        color: var(--muted);
        font-size: 0.72rem;
    }

    .warehouse-structure-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .warehouse-structure-row .action-strip {
        grid-column: 1 / -1;
    }

    .storage-location-form-grid {
        grid-template-columns: 1fr;
    }

    .storage-location-form-grid .form-field-wide {
        grid-column: auto;
    }
}

@media (max-width: 440px) {
    .warehouse-kpi-grid,
    .warehouse-operation-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .warehouse-manager-metric-grid {
        grid-template-columns: 1fr;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .login-screen {
        padding: 0.85rem;
        gap: 1rem;
    }

    .login-card,
    .board-panel,
    .table-panel,
    .form-panel,
    .detail-panel,
    .modal-body {
        padding: 0.75rem;
        border-radius: var(--radius-md);
    }

    .brand-mark,
    .topbar-brand .brand-mark {
        width: 2.9rem;
        height: 2.9rem;
        border-radius: var(--radius-md);
    }

    .topbar-brand {
        gap: 0.75rem;
    }

    .topbar-meta,
    .status-group,
    .user-cluster {
        gap: 0.55rem;
    }

    .product-section-heading h2 {
        font-size: clamp(1.45rem, 7vw, 1.85rem);
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .section-subtitle {
        font-size: 0.88rem;
    }

    .product-page-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .product-page-tab {
        width: 100%;
    }

    .product-main-toolbar {
        padding: 0.68rem;
        gap: 0.55rem;
    }

    .product-main-toolbar .search-field input {
        min-height: 2.75rem;
    }

    .product-toolbar-filter-actions,
    .product-toolbar-primary-actions {
        display: grid;
        width: 100%;
    }

    .product-toolbar-filter-actions {
        grid-template-columns: 1fr;
    }

    #products-clear-filters {
        display: none;
    }

    #section-products.co-sale-product-availability #products-clear-filters {
        display: inline-flex;
    }

    .product-toolbar-primary-actions {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .product-toolbar-primary-actions .button,
    .product-toolbar-filter-actions .button,
    .product-more-menu {
        width: 100%;
    }

    #section-products .product-filter-primary {
        display: none;
    }

    #section-products.product-filters-expanded .product-filter-primary {
        display: grid;
    }

    #section-products .product-table-wrap {
        display: none;
    }

    #section-products .products-mobile-list {
        display: grid;
        gap: 0.62rem;
        margin-bottom: 0.85rem;
    }

    #section-products .product-saved-views {
        gap: 0.34rem;
        padding: 0.56rem 0.64rem;
    }

    #section-products .product-saved-views .tiny-button {
        padding: 0.32rem 0.5rem;
        font-size: 0.74rem;
    }

    #section-products .product-quick-view {
        justify-content: flex-end;
        max-width: 8rem;
    }

    .action-row,
    .action-strip {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(8.25rem, 1fr));
        align-items: stretch;
    }

    .status-strip,
    .user-cluster {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .dashboard-metric-item {
        grid-template-columns: 1fr;
    }

    .dashboard-pipeline-steps {
        grid-template-columns: 1fr;
    }

    .dashboard-audit-controls,
    .compact-select,
    .compact-select select {
        width: 100%;
    }

    .dashboard-audit-controls {
        justify-content: stretch;
    }

    .dashboard-audit-controls .tiny-button {
        width: 100%;
    }

    .dashboard-audit-row {
        grid-template-columns: minmax(0, 1.2fr) minmax(4rem, 0.45fr);
    }

    .dashboard-audit-row-head {
        display: none;
    }

    .dashboard-audit-user,
    .dashboard-audit-document {
        font-size: 0.76rem;
    }

    .dashboard-drilldown-actions,
    .dashboard-drilldown-actions .tiny-button {
        width: 100%;
    }

    .dashboard-metric-item .tiny-button {
        justify-self: start;
    }

    .topbar .status-pill,
    .topbar .meta-chip {
        white-space: normal;
    }

    .user-cluster .button,
    .user-badge {
        flex: 0 1 auto;
    }

    .status-pill,
    .meta-chip,
    .role-pill,
    .button,
    .tiny-button,
    .user-badge {
        justify-content: center;
        text-align: center;
    }

    .sidebar-note {
        display: none;
    }

    .stat-card strong {
        font-size: 1.35rem;
    }

    .dashboard-kpi-card strong {
        font-size: 1.12rem;
    }

    .dashboard-today-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-today-card strong {
        font-size: 1.3rem;
    }

    .list-item {
        display: grid;
        align-items: start;
    }

    .dashboard-list-actions {
        grid-template-columns: auto minmax(4.5rem, max-content);
        justify-content: space-between;
        justify-items: stretch;
        width: 100%;
    }

    .dashboard-timeline-item {
        grid-template-columns: 1fr;
    }

    .dashboard-role-item .tiny-button,
    .dashboard-timeline-item .tiny-button {
        justify-self: stretch;
    }

    .delivery-queue-actions {
        justify-items: stretch;
    }

    .pagination-size select {
        flex: 1;
    }

    .toast-stack {
        inset: auto 0.75rem 0.75rem;
    }

    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .document-workbench .detail-actions,
    .document-workbench .delivery-queue-actions,
    .approval-detail-body .action-strip {
        grid-template-columns: 1fr;
    }

    .document-workbench .detail-panel-body,
    .approval-detail-body {
        gap: 0.85rem;
    }

    .document-workbench .delivery-queue-item {
        gap: 0.75rem;
    }

    #section-purchase-invoices .detail-actions,
    #section-sales-invoices .detail-actions,
    #section-purchase-returns .detail-actions,
    #section-sales-returns .detail-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1180px) {
    .stock-accuracy-summary-grid,
    .stock-accuracy-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .stock-accuracy-summary-grid,
    .stock-accuracy-metric-grid {
        grid-template-columns: 1fr;
    }

    .stock-accuracy-section-head {
        display: grid;
    }
}

.production-order-control-panel {
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent);
}

.production-order-control-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.7rem;
}

.production-order-control-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.production-order-scope-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.15fr) minmax(320px, 1fr);
    gap: 0.75rem;
    align-items: end;
}

.production-order-scope-grid label {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.production-order-scope-grid select,
.production-order-scope-grid input {
    width: 100%;
    min-height: 44px;
}

.production-order-tools-menu {
    position: relative;
}

.production-order-tools-menu > summary {
    min-height: 36px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface, #fff);
    color: var(--text);
    cursor: pointer;
    list-style: none;
    font-size: 0.84rem;
    font-weight: 700;
}

.production-order-tools-menu > summary::-webkit-details-marker {
    display: none;
}

.production-order-tools-menu > summary::after {
    content: " +";
    color: var(--muted);
}

.production-order-tools-menu[open] > summary::after {
    content: " -";
}

.production-order-tools-popover {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 190px;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface, #fff);
    box-shadow: 0 8px 20px rgb(15 23 42 / 12%);
}

.production-order-tools-popover button {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.production-order-tools-popover button:hover,
.production-order-tools-popover button:focus-visible {
    background: var(--surface-subtle, #f8fafb);
}

.production-order-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.production-order-status-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 34px;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface, #fff);
    color: var(--muted);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.production-order-status-tabs button strong {
    min-width: 1.35rem;
    padding: 0.08rem 0.32rem;
    border-radius: 4px;
    background: var(--surface-subtle, #f1f5f7);
    color: var(--text);
    text-align: center;
    font-size: 0.76rem;
}

.production-order-status-tabs button.is-active {
    border-color: var(--accent);
    background: #eef7f4;
    color: var(--accent-strong, var(--accent));
    font-weight: 700;
}

.production-order-status-tabs button[hidden] {
    display: none;
}

.production-order-work-summary {
    min-height: 1.25rem;
    margin-top: 0.7rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.production-next-step {
    display: grid;
    gap: 0.3rem;
    min-width: 180px;
    max-width: 280px;
}

.production-next-step .status-pill {
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
}

.production-next-step small {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.production-orders-page-mount,
.production-orders-workspace {
    display: grid;
    gap: 1rem;
}

.production-orders-workspace .commercial-master-inline-form,
.production-orders-workspace .commercial-summary-grid,
.production-orders-workspace .table-wrap {
    margin-top: 0;
}

.production-orders-workspace .production-order-compact-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    min-height: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-subtle, #f8fafb);
}

.production-order-compact-summary > div {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border-right: 1px solid var(--line);
}

.production-order-compact-summary > div:last-child {
    border-right: 0;
}

.production-order-compact-summary strong {
    font-size: 0.95rem;
}

.production-order-compact-summary span {
    color: var(--muted);
    font-size: 0.76rem;
}

.production-order-list-table th:nth-child(1) { width: 16%; }
.production-order-list-table th:nth-child(2) { width: 25%; }
.production-order-list-table th:nth-child(3) { width: 12%; }
.production-order-list-table th:nth-child(4) { width: 12%; }
.production-order-list-table th:nth-child(5) { width: 19%; }
.production-order-list-table th:nth-child(6) { width: 16%; }

.production-order-list-table {
    min-width: 880px;
}

.production-order-list-table td {
    vertical-align: middle;
}

.production-order-list-table .product-row-actions {
    flex-wrap: wrap;
    gap: 0.3rem;
}

.production-order-mobile-cards {
    display: none;
}

.production-order-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.production-order-pagination > div {
    display: flex;
    gap: 0.45rem;
}

.production-order-register {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface, #fff);
}

.production-order-register > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    list-style: none;
}

.production-order-register > summary::-webkit-details-marker {
    display: none;
}

.production-order-register > summary > span {
    display: grid;
    gap: 0.1rem;
}

.production-order-register > summary small {
    color: var(--muted);
}

.production-order-register > summary::after {
    content: "+";
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 700;
}

.production-order-register[open] > summary::after {
    content: "-";
}

.production-order-register[open] > summary {
    border-bottom: 1px solid var(--line);
}

.production-order-register-body {
    display: grid;
    gap: 0.8rem;
    padding: 0.85rem;
}

.production-order-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    scroll-margin-top: 1rem;
}

.production-workbench-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface, #fff);
}

.production-workbench-head h3,
.production-workbench-section-head h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.production-workbench-head .helper-text,
.production-workbench-section-head p {
    margin: 0.25rem 0 0;
}

.production-workbench-selected-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle, #f8fafb);
}

.production-workbench-selected-summary > div {
    display: grid;
    align-content: start;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.75rem 0.9rem;
    border-right: 1px solid var(--line);
}

.production-workbench-selected-summary > div:last-of-type {
    border-right: 0;
}

.production-workbench-selected-summary span:first-child {
    color: var(--muted);
    font-size: 0.78rem;
}

.production-workbench-selected-summary strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    line-height: 1.4;
}

.production-workbench-selected-summary .production-workbench-reference small {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.production-workbench-selected-summary .production-workbench-next-action {
    background: #eef7f4;
    border-left: 3px solid var(--primary, #157a72);
}

.production-workbench-command-bar {
    position: sticky;
    top: 0.75rem;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface, #fff);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.production-workbench-command-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.production-workbench-command-copy > span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.production-workbench-command-copy > strong {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.production-workbench-command-copy small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.production-workbench-command-actions,
.warehouse-production-queue-head-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.warehouse-production-queue-panel {
    display: grid;
    gap: 0.7rem;
    padding: 0.9rem;
}

.warehouse-production-queue-table table {
    min-width: 760px;
}

.warehouse-production-queue-table td {
    vertical-align: middle;
}

.production-workbench-context-details {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    background: var(--surface, #fff);
}

.production-workbench-context-details > summary {
    padding: 0.6rem 0.9rem;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
}

.production-workbench-context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
}

.production-workbench-context-grid > div {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.65rem 0.9rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.production-workbench-context-grid span {
    color: var(--muted);
    font-size: 0.75rem;
}

.production-workbench-context-grid strong {
    overflow-wrap: anywhere;
    font-size: 0.84rem;
}

.production-workbench-next-action .status-pill {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
}

.production-workbench-next-action small {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.production-workbench-autofill-banner {
    display: grid;
    grid-template-columns: minmax(11rem, max-content) minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem 0.8rem;
    padding: 0.65rem 0.8rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle, #f8fafb);
    font-size: 0.82rem;
}

.production-workbench-autofill-banner.is-ready {
    border-left: 3px solid var(--success, #16805b);
}

.production-workbench-autofill-banner.is-warning {
    border-left: 3px solid var(--warning, #b7791f);
}

.production-workbench-autofill-banner .status-pill {
    grid-column: 1 / -1;
    justify-self: start;
}

.production-workbench-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
}

.production-workbench-snapshot-section {
    min-width: 0;
    padding: 0.75rem 0.85rem;
}

.production-workbench-snapshot-section + .production-workbench-snapshot-section {
    border-left: 1px solid var(--line);
}

.production-workbench-snapshot-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    padding-bottom: 0.55rem;
}

.production-workbench-snapshot-head > div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.production-workbench-snapshot-head small,
.production-workbench-snapshot-row span {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.production-workbench-snapshot-lines {
    display: grid;
}

.production-workbench-snapshot-row {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.5rem 0;
    border-top: 1px solid var(--line);
}

.production-workbench-snapshot-row strong {
    overflow-wrap: anywhere;
    font-size: 0.82rem;
}

#production-workbench-existing-raw-reservation:empty {
    display: none;
}

.production-workbench-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface, #fff);
}

.production-workbench-steps button {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    min-height: 58px;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.production-step-number {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--line-strong, #cbd5dc);
    border-radius: 50%;
    background: var(--surface, #fff);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.production-step-copy {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.production-step-copy strong {
    overflow-wrap: anywhere;
    font-size: 0.8rem;
    line-height: 1.3;
}

.production-step-copy small {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.25;
}

.production-workbench-steps button:last-child {
    border-right: 0;
}

.production-workbench-steps button:hover,
.production-workbench-steps button:focus-visible {
    background: var(--surface-subtle, #f8fafb);
    color: var(--text);
}

.production-workbench-steps button.is-active {
    border-bottom-color: var(--accent);
    color: var(--accent-strong, var(--accent));
    background: var(--surface-subtle, #f8fafb);
}

.production-workbench-steps button.is-complete .production-step-number {
    border-color: #83c5a6;
    background: #eaf7f0;
    color: #146c4b;
}

.production-workbench-steps button.is-current .production-step-number {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.production-workbench-steps button.is-current .production-step-copy strong {
    color: var(--accent-strong, var(--accent));
}

.production-workbench-steps button.is-cancelled .production-step-number {
    border-color: #dc7777;
    background: #fff0f0;
    color: #a52f2f;
}

.production-order-row {
    cursor: pointer;
}

.production-order-row:hover td {
    background: var(--surface-subtle, #f8fafb);
}

.production-order-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.production-workbench-empty {
    display: grid;
    place-items: center;
    gap: 0.35rem;
    min-height: 180px;
    padding: 1.5rem;
    text-align: center;
    color: var(--muted);
}

.production-workbench-empty strong {
    color: var(--text);
}

.production-workbench-empty p {
    max-width: 620px;
    margin: 0;
}

.production-workbench-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1rem 1.1rem 1.2rem;
    background: var(--surface, #fff);
}

/* Wide material tables scroll inside the workbench instead of sizing its grid. */
.production-workbench-panel > * {
    min-width: 0;
}

.production-workbench-section-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--line);
}

.production-workbench-group {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface, #fff);
}

.production-workbench-group > summary {
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    font-weight: 700;
}

.production-workbench-group[open] > summary {
    border-bottom: 1px solid var(--line);
}

.production-workbench-group-body {
    display: grid;
    gap: 0.85rem;
    padding: 0.85rem;
}

.production-workbench-supporting-details {
    border-top: 1px solid var(--line);
    background: var(--surface, #fff);
}

.production-workbench-supporting-details > summary {
    display: grid;
    gap: 0.12rem;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
}

.production-workbench-supporting-details > summary strong {
    font-size: 0.84rem;
}

.production-workbench-supporting-details > summary small {
    color: var(--muted);
    font-size: 0.75rem;
}

.production-workbench-supporting-details[open] > summary {
    border-bottom: 1px solid var(--line);
}

.production-workbench-document-groups {
    display: grid;
}

.production-workbench-document-group {
    display: grid;
    gap: 0.85rem;
    padding: 0.85rem;
    scroll-margin-top: 1rem;
}

.production-workbench-document-group + .production-workbench-document-group {
    border-top: 1px solid var(--line);
}

.production-workbench-document-heading h5 {
    margin: 0;
    font-size: 0.9rem;
}

.production-workbench-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.production-workbench-overview-grid article {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-subtle, #f8fafb);
}

.production-workbench-overview-grid span,
.production-workbench-overview-grid small {
    color: var(--muted);
}

.production-workbench-overview-grid strong {
    overflow-wrap: anywhere;
    font-size: 0.92rem;
}

.production-stock-position,
.production-closed-history {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
}

.production-stock-position-table-wrap,
.production-history-table-wrap {
    margin-top: 0.75rem;
    max-height: 430px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface, #fff);
}

.production-stock-position-table,
.production-history-table {
    min-width: 1080px;
}

.production-stock-position-table th,
.production-stock-position-table td,
.production-history-table th,
.production-history-table td {
    padding: 0.55rem 0.65rem;
    vertical-align: top;
}

.production-material-requirement-summary {
    margin-top: 0.75rem;
}

.production-material-pr-action {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.production-material-pr-action small {
    flex-basis: 100%;
    max-width: 28rem;
    color: var(--danger, #b42318);
    text-align: right;
}

.production-material-linked-pr {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-subtle, #f8fafb);
}

.production-material-linked-pr span:first-child {
    color: var(--muted);
    font-size: 0.75rem;
}

.production-material-procurement-status {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--teal, #0f766e);
    border-radius: 6px;
    background: var(--surface-subtle, #f8fafb);
}

.production-material-procurement-status > div:first-child,
.production-material-procurement-documents {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    min-width: 0;
}

.production-material-procurement-status span,
.production-material-procurement-status small {
    color: var(--muted);
}

.production-material-procurement-document {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.purchase-requisition-source-panel {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.8rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--teal, #0f766e);
    border-radius: 6px;
    background: rgba(15, 118, 110, 0.04);
}

.production-request-material-requirements {
    display: grid;
    gap: 0.35rem;
    padding: 0.65rem;
    border-left: 3px solid var(--teal, #0f766e);
    background: rgba(15, 118, 110, 0.05);
}

.production-request-material-requirements > span,
.production-request-material-requirements small {
    color: var(--muted);
    font-size: 0.75rem;
}

.production-request-material-requirements ul {
    display: grid;
    gap: 0.3rem;
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.75rem;
}

.production-request-material-requirements-error {
    border-left-color: var(--danger, #b42318);
    background: rgba(180, 35, 24, 0.06);
}

.production-request-material-requirements-error strong,
.production-request-material-requirements-error small {
    color: var(--danger, #b42318);
}

.production-material-qty-pair {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) auto;
    gap: 0.45rem;
    align-items: baseline;
    min-width: 0;
}

.production-material-qty-pair + .production-material-qty-pair {
    margin-top: 0.22rem;
    padding-top: 0.22rem;
    border-top: 1px solid var(--line);
}

.production-material-qty-pair span {
    color: var(--muted);
    font-size: 0.72rem;
}

.production-material-shortage td {
    background: #fffafa;
}

.production-receipt-autofill {
    display: grid;
    grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.8fr);
    gap: 0.85rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--success, #16805b);
    border-radius: 6px;
    background: #f7fbf9;
}

.production-receipt-autofill.is-complete {
    border-left-color: var(--accent);
    background: var(--surface-subtle, #f8fafb);
}

.production-receipt-autofill p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.production-receipt-autofill dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.75rem;
    margin: 0;
}

.production-receipt-autofill dl > div {
    min-width: 0;
}

.production-receipt-autofill dt {
    color: var(--muted);
    font-size: 0.72rem;
}

.production-receipt-autofill dd {
    margin: 0.12rem 0 0;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
    font-weight: 700;
}

.production-order-workbench .production-workbench-bound-field {
    display: none;
}

.production-workbench-fixed-cost-details {
    margin-top: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.production-workbench-fixed-cost-details > div {
    padding: 0.8rem;
}

.production-close-auto-status {
    padding: 0.6rem 0.75rem;
    border-left: 3px solid var(--accent);
    background: var(--surface-subtle, #f8fafb);
    color: var(--muted);
    font-size: 0.8rem;
}

.production-close-auto-status.is-loading {
    border-left-color: var(--warning, #b7791f);
}

.production-close-auto-status.is-error {
    border-left-color: var(--danger, #b33a3a);
    color: var(--danger, #b33a3a);
}

.production-closed-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--line);
}

.production-closed-summary > div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    background: var(--surface, #fff);
}

.production-closed-summary span,
.production-history-audit-list span,
.production-history-audit-list small {
    color: var(--muted);
    font-size: 0.8rem;
}

.production-closed-summary strong {
    overflow-wrap: anywhere;
}

.production-history-audit {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
}

.production-history-audit summary {
    cursor: pointer;
    font-weight: 700;
}

.production-history-audit-list {
    display: grid;
    margin-top: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.production-history-audit-list > div {
    display: grid;
    grid-template-columns: minmax(160px, 0.7fr) minmax(180px, 0.7fr) minmax(260px, 1.6fr);
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    background: var(--surface, #fff);
}

.production-history-audit-list > div + div {
    border-top: 1px solid var(--line);
}

.production-order-workbench .commercial-master-inline-form,
.production-order-workbench .surface-subsection {
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: none;
    background: var(--surface, #fff);
}

.production-order-workbench .commercial-summary-grid {
    margin: 0;
}

.production-order-workbench .production-workbench-bound-select {
    pointer-events: none;
    color: var(--text);
    background-color: var(--surface-subtle, #f8fafb);
}

.production-order-workbench .production-workbench-bound-input {
    color: var(--text);
    background-color: var(--surface-subtle, #f8fafb);
}

.production-order-workbench .table-wrap {
    max-height: 360px;
    overflow: auto;
}

.production-order-workbench [data-packaging-bom-workspace-panel="operations"] {
    display: grid;
    gap: 0.85rem;
}

@media (max-width: 1100px) {
    .production-order-scope-grid,
    .production-workbench-selected-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-workbench-selected-summary > div:nth-child(2n) {
        border-right: 0;
    }

    .production-workbench-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .production-history-audit-list > div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

@media (max-width: 720px) {
    .production-order-list-table-wrap {
        display: none;
    }

    .production-order-mobile-cards {
        display: grid;
        gap: 0.65rem;
    }

    .production-order-mobile-card {
        display: grid;
        gap: 0.7rem;
        min-width: 0;
        padding: 0.8rem;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: var(--surface, #fff);
        cursor: pointer;
    }

    .production-order-mobile-card:hover,
    .production-order-mobile-card:focus-visible,
    .production-order-mobile-card.row-active {
        border-color: var(--accent);
        outline: none;
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
    }

    .production-order-mobile-card-head,
    .production-order-mobile-product,
    .production-order-mobile-facts span {
        display: grid;
        gap: 0.15rem;
        min-width: 0;
    }

    .production-order-mobile-card-head {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 0.6rem;
    }

    .production-order-mobile-card-head small,
    .production-order-mobile-product span,
    .production-order-mobile-facts span {
        color: var(--muted);
        font-size: 0.76rem;
    }

    .production-order-mobile-product strong,
    .production-order-mobile-product span {
        overflow-wrap: anywhere;
    }

    .production-order-mobile-facts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .production-order-mobile-facts span {
        padding: 0.55rem;
        background: var(--surface-subtle, #f8fafb);
    }

    .production-order-mobile-facts strong {
        color: var(--text);
        font-size: 0.82rem;
    }

    .production-order-mobile-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .production-order-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .production-order-pagination > div {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-order-pagination .button {
        width: 100%;
    }

    .production-workbench-head,
    .production-workbench-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .production-material-pr-action {
        justify-content: flex-start;
    }

    .production-material-pr-action small {
        max-width: none;
        text-align: left;
    }

    .production-material-procurement-status {
        align-items: stretch;
        flex-direction: column;
    }

    .production-workbench-command-bar {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .production-workbench-command-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .production-workbench-command-actions .button {
        width: 100%;
    }

    .production-workbench-steps {
        display: flex;
        overflow-x: auto;
    }

    .production-workbench-steps button {
        flex: 0 0 168px;
    }

    .production-workbench-panel {
        padding: 0.8rem;
    }

    .production-workbench-autofill-banner,
    .production-workbench-snapshot-grid,
    .production-workbench-context-grid,
    .production-receipt-autofill,
    .production-receipt-autofill dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .production-order-status-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
    }

    .production-order-status-tabs button {
        flex: 0 0 auto;
    }

    .production-workbench-snapshot-section + .production-workbench-snapshot-section {
        border-top: 1px solid var(--line);
        border-left: 0;
    }
}

@media (max-width: 430px) {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    .app-shell {
        width: 100%;
        max-width: 100%;
        padding: 0.7rem;
    }

    .topbar,
    .sidebar,
    .surface {
        border-radius: var(--radius-lg);
    }

    .login-story h1,
    .section-heading h2 {
        font-size: clamp(1.7rem, 10vw, 2.2rem);
    }

    .dashboard-list-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-details > summary {
        align-items: flex-start;
    }

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

    .production-workbench-selected-summary,
    .production-workbench-overview-grid {
        grid-template-columns: 1fr;
    }

    .production-workbench-selected-summary > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .production-workbench-selected-summary > div:last-of-type {
        border-bottom: 0;
    }

    .production-order-control-head {
        align-items: stretch;
    }

    .production-order-control-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .quick-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-card strong {
        font-size: 1.08rem;
    }

    .lead,
    .helper-text,
    .build-summary {
        line-height: 1.55;
    }

}

.bom-shortage-procurement-panel {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    background: var(--surface-subtle, #f8fafb);
}

.bom-shortage-procurement-actions,
.bom-shortage-created-documents {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.compact-qty-input {
    width: 7rem;
    min-width: 5.5rem;
    height: 2.25rem;
    padding: 0.35rem 0.5rem;
}

.issue-line-editor {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-subtle, #f8fafb);
}

.issue-line-editor-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: start;
}

.issue-line-editor-head h4 {
    margin: 0.1rem 0 0;
    font-size: 0.98rem;
}

.issue-line-table-wrap {
    margin: 0;
}

.issue-line-table th,
.issue-line-table td {
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
}

.issue-line-qty-input {
    width: 6.5rem;
    min-width: 5.5rem;
    height: 2.25rem;
    padding: 0.35rem 0.5rem;
}

.production-readiness-panel {
    margin-top: 0.9rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.production-readiness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.production-readiness-check {
    min-height: 5.75rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    background: var(--surface);
}

.production-readiness-check.pass {
    border-left-color: var(--success);
}

.production-readiness-check.warn {
    border-left-color: var(--warning);
}

.production-readiness-check.blocked {
    border-left-color: var(--danger);
}

.production-readiness-check-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.production-readiness-issues {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(197, 48, 48, 0.28);
    border-radius: 8px;
    background: rgba(197, 48, 48, 0.06);
}

.production-readiness-issues ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

@media (hover: none) {
    .button:hover {
        transform: none;
    }
}
.material-owner-assignment-list {
    display: grid;
    gap: 8px;
}

.material-owner-assignment-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1fr) minmax(220px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.material-owner-product {
    overflow-wrap: anywhere;
}

.material-context-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.material-context-field > span {
    color: var(--muted);
    font-size: 0.78rem;
}

.material-context-field select:disabled {
    color: var(--text);
    background: var(--surface-muted, #f3f4f6);
    opacity: 1;
}

.mo-material-context {
    margin-top: 8px;
    max-width: 520px;
}

.mo-material-context > summary {
    color: var(--primary, #0f766e);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.mo-material-context-list {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.mo-material-context-row {
    display: grid;
    gap: 2px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
    font-size: 0.78rem;
}

.mo-material-context-row span {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.material-owner-assignment-row:last-child {
    border-bottom: 0;
}

@media (max-width: 720px) {
    .material-owner-assignment-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
.detail-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.detail-summary-grid > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.detail-summary-grid span,
.audit-meta-row {
    color: var(--muted);
    font-size: 0.82rem;
}

.detail-summary-grid strong {
    overflow-wrap: anywhere;
}

.audit-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

#section-stock-adjustments .compact-panel-head {
    margin-top: 4px;
    margin-bottom: 0;
}

#section-stock-adjustments .compact-panel-head h4 {
    margin: 0;
}

#section-stock-adjustments tbody tr.is-selected td {
    background: var(--surface-soft);
}

#inventory-control-document-lines .table-wrap {
    max-height: 320px;
}

@media (max-width: 800px) {
    .product-detail-packaging-formula-bar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .product-detail-packaging-formula-bar > .status-pill {
        justify-self: start;
    }

    .product-detail-packaging-viewbar,
    .product-detail-packaging-calculator {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .product-detail-packaging-viewbar .segmented-control {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .product-detail-packaging-result-summary {
        align-items: stretch;
    }

    .product-detail-packaging-result-summary > div {
        flex: 1 1 130px;
    }

    .product-detail-packaging-item-main {
        align-items: stretch;
    }

    .product-detail-packaging-category {
        flex-basis: 72px;
    }

    .product-detail-packaging-product {
        flex-basis: calc(100% - 90px);
    }

    .product-detail-packaging-metric {
        flex: 1 1 104px;
        padding: 0.35rem 0;
    }

    .product-detail-packaging-metric.is-human-rate {
        flex-basis: 220px;
        min-width: min(220px, 100%);
    }

    .product-detail-packaging-item-main > .status-pill {
        align-self: center;
    }

    .product-detail-packaging-item-details {
        margin-left: 0.8rem;
    }

    .product-detail-packaging-item-details dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .product-detail-packaging-category,
    .product-detail-packaging-product {
        flex-basis: 100%;
    }

    .product-detail-packaging-category {
        min-height: 2.2rem;
        border-right: 0;
        border-bottom: 3px solid var(--accent);
    }

    .product-detail-packaging-item-details dl {
        grid-template-columns: 1fr;
    }
}

.production-planning-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface, #fff);
}

.production-planning-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    cursor: pointer;
    list-style: none;
}

.production-planning-panel > summary::-webkit-details-marker {
    display: none;
}

.production-planning-panel > summary > span {
    display: grid;
    gap: 0.12rem;
}

.production-planning-panel > summary small,
.production-planning-section-head p {
    color: var(--muted);
}

.production-planning-panel > summary::after {
    content: "+";
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 700;
}

.production-planning-panel[open] > summary {
    border-bottom: 1px solid var(--line);
}

.production-planning-panel[open] > summary::after {
    content: "-";
}

.production-planning-body {
    display: grid;
    min-width: 0;
    gap: 1rem;
    padding: 0.9rem;
}

.production-planning-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.production-planning-settings > form {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-subtle, #f8fafb);
}

.production-planning-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.production-planning-section-head h4,
.production-planning-section-head p {
    margin: 0;
}

.production-planning-section-head p {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

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

.production-planning-summary {
    margin-bottom: 0.8rem;
}

.production-planning-summary > div {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.production-planning-summary span {
    color: var(--muted);
    font-size: 0.8rem;
}

.production-planning-panel .checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.production-planning-panel .checkbox-row input {
    flex: 0 0 auto;
    width: 1rem;
    margin-top: 0.2rem;
}

.production-planning-warnings {
    margin-bottom: 0.8rem;
    padding: 0.7rem 0.8rem;
    border-left: 3px solid var(--warning, #b7791f);
    background: var(--surface-subtle, #f8fafb);
}

.production-planning-warnings ul {
    margin: 0.35rem 0 0;
    padding-left: 1.2rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

#production-planning-result {
    min-width: 0;
}

#production-planning-result table {
    min-width: 980px;
}

#production-planning-result td {
    vertical-align: top;
}

@media (max-width: 800px) {
    #production-planning-result table {
        min-width: 0;
        width: 100%;
    }

    #production-planning-result tbody tr > td {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.3rem;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    #production-planning-result td > .tiny-button,
    #production-planning-result td > .status-pill {
        justify-self: start;
        max-width: 100%;
        white-space: normal;
    }
}

@media (max-width: 980px) {
    .production-planning-settings,
    .production-planning-form-grid {
        grid-template-columns: 1fr;
    }

    .production-planning-section-head {
        align-items: stretch;
        flex-direction: column;
    }
}
.production-request-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.production-request-workbench {
    margin-bottom: 14px;
}

.production-request-workbench-head,
.production-request-workbench-toolbar {
    align-items: end;
}

.production-request-workbench-head .helper-text {
    margin: 3px 0 0;
}

.production-request-workbench-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.production-request-workbench-toolbar label {
    width: min(420px, 100%);
}

.production-request-workbench-table-wrap {
    max-height: none;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.production-request-workbench-pagination {
    margin-bottom: 0;
}

.production-request-workbench-table-wrap table {
    min-width: 1060px;
}

.production-request-workbench-table-wrap thead {
    position: sticky;
    z-index: 1;
    top: 0;
    background: var(--surface, #fff);
}

.production-request-workbench-table-wrap td {
    vertical-align: top;
}

.production-request-workbench-table-wrap td > small {
    display: block;
    margin-top: 4px;
}

@media (min-width: 981px) {
    .production-request-workbench-table-wrap th:nth-child(1),
    .production-request-workbench-table-wrap th:nth-child(2) { width: 15%; }
    .production-request-workbench-table-wrap th:nth-child(3) { width: 24%; }
    .production-request-workbench-table-wrap th:nth-child(4) { width: 10%; }
    .production-request-workbench-table-wrap th:nth-child(5) { width: 11%; }
    .production-request-workbench-table-wrap th:nth-child(6) { width: 13%; }
    .production-request-workbench-table-wrap th:nth-child(7) { width: 12%; }
}

.production-request-workbench-table-wrap tr.is-returned td:first-child {
    box-shadow: inset 3px 0 0 #dc2626;
}

.production-request-workbench-table-wrap tr.is-due td:first-child {
    box-shadow: inset 3px 0 0 #d97706;
}

.production-request-workbench-products {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.production-request-workbench-products strong,
.production-request-autofill-line strong {
    white-space: normal;
    overflow-wrap: anywhere;
}

.production-request-workbench-products span,
.production-request-next-work small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
}

.production-request-next-work {
    min-width: 0;
}

.production-request-workbench-action {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
}

.production-request-drawer-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(3px);
    cursor: default;
}

#production-request-create-panel.production-request-drawer {
    position: fixed;
    z-index: 91;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: min(44rem, calc(100vw - 2rem));
    height: auto;
    max-height: none;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 18px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: var(--surface-strong);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.12);
}

#production-request-create-panel.production-request-drawer > * {
    min-width: 0;
    max-width: 100%;
}

.production-request-drawer-close {
    display: none;
    flex: 0 0 auto;
}

#production-request-create-panel.production-request-drawer .production-request-drawer-close {
    display: inline-flex;
}

.production-request-autofill-summary {
    display: grid;
    gap: 10px;
    margin: 12px 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    background: var(--surface-soft, #f8fafc);
}

.production-request-autofill-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.production-request-autofill-summary-grid div,
.production-request-autofill-line {
    min-width: 0;
}

.production-request-autofill-summary span,
.production-request-autofill-summary small {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.production-request-autofill-summary strong {
    display: block;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.production-request-autofill-lines {
    display: grid;
    gap: 7px;
    border-top: 1px solid var(--border);
    padding-top: 9px;
}

.production-request-autofill-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.production-request-autofill-summary .production-request-receipt-trace {
    margin-top: 3px;
    color: #166534;
    line-height: 1.45;
}

.production-request-validation-summary {
    margin: 10px 0;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fffbeb;
    color: #78350f;
}

.production-request-validation-summary.is-error {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.production-request-validation-summary strong,
.production-request-validation-summary ul {
    display: block;
    margin: 0;
}

.production-request-validation-summary ul {
    margin-top: 6px;
    padding-left: 20px;
}

.production-request-issue-link {
    border: 0;
    padding: 2px 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.production-request-issue-link:hover,
.production-request-issue-link:focus-visible {
    color: var(--teal-deep);
}

.production-request-detail-fields {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 12px 12px;
}

.production-request-detail-fields > summary {
    margin: 0 -12px 12px;
    padding: 11px 12px;
    cursor: pointer;
    color: var(--teal-deep);
    font-weight: 700;
}

.production-request-detail-fields:not([open]) {
    padding-bottom: 0;
}

.production-request-detail-fields:not([open]) > summary {
    margin-bottom: 0;
}

body.production-request-drawer-open {
    overflow: hidden;
}

.production-request-queue-summary {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.production-request-queue-item {
    min-height: 64px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 10px;
    background: var(--surface, #fff);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.production-request-queue-item strong,
.production-request-queue-item span {
    display: block;
}

.production-request-queue-item strong {
    font-size: 1.05rem;
}

.production-request-queue-item span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.production-request-queue-item.is-active {
    border-color: var(--teal-600, #0f766e);
    box-shadow: inset 3px 0 0 var(--teal-600, #0f766e);
}

.production-request-planning-workbench {
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 6px;
}

#production-request-planning-workbench.production-request-planning-drawer {
    position: fixed;
    z-index: 91;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: min(72rem, calc(100vw - 2rem));
    max-width: none;
    max-height: none;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 18px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: var(--surface-strong);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.12);
}

#production-request-planning-workbench.production-request-planning-drawer .production-request-planning-workbench-head {
    position: sticky;
    z-index: 3;
    top: -18px;
    margin: -18px -18px 0;
    padding: 18px;
    background: var(--surface-strong);
}

.production-request-planning-nav {
    position: sticky;
    z-index: 2;
    top: 67px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 0 -18px;
    border-bottom: 1px solid var(--border);
    padding: 9px 18px;
    background: var(--surface-strong);
}

.production-request-planning-nav .button {
    flex: 0 0 auto;
}

.production-request-planning-nav .button.is-active {
    border-color: var(--teal-700, #0f766e);
    background: #e8f5f3;
    color: #075f59;
    font-weight: 700;
}

.production-request-planning-focus {
    border-radius: 6px;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.32);
}

.production-request-planning-status-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    border-left: 4px solid var(--teal-600, #0f766e);
    padding: 10px 12px;
    background: var(--surface-soft, #f8fafc);
}

.production-request-planning-status-strip strong,
.production-request-planning-status-strip span {
    display: block;
}

.production-request-planning-status-strip span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.78rem;
}

.production-request-planning-document-button {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.production-request-planning-approval-state {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #d8c477;
    border-radius: 6px;
    background: #fffbea;
    color: #574711;
}

.production-request-planning-approval-state span {
    color: #6e5b18;
    font-size: 0.875rem;
}

#production-request-planning-workbench .production-request-planning-primary-action {
    position: sticky;
    z-index: 2;
    bottom: -18px;
    margin: 16px -18px -18px;
    border-top: 1px solid var(--border);
    padding: 12px 18px 18px;
    background: var(--surface-strong);
    box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.06);
}

#production-request-planning-workbench .production-request-planning-primary-action .button:disabled {
    border-color: #cbd5e1;
    background: #e5e7eb;
    color: #64748b;
    cursor: not-allowed;
    opacity: 1;
}

@media (max-width: 760px) {
    #production-request-planning-workbench.production-request-planning-drawer {
        inset: 0;
        width: 100%;
        border: 0;
        border-radius: 0;
        padding: 14px;
    }

    #production-request-planning-workbench.production-request-planning-drawer .production-request-planning-workbench-head {
        top: -14px;
        margin: -14px -14px 0;
        padding: 14px;
    }

    .production-request-planning-nav {
        top: 61px;
        margin-inline: -14px;
        padding-inline: 14px;
    }

    #production-request-planning-workbench .production-request-planning-primary-action {
        bottom: -14px;
        margin: 14px -14px -14px;
        padding: 12px 14px 14px;
    }
}

.production-request-planning-workbench-head {
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.production-request-planning-workbench-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.production-request-planning-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--border);
}

.production-request-planning-summary > div {
    min-width: 0;
    padding: 10px 12px;
    background: var(--surface, #fff);
}

.production-request-planning-summary span,
.production-request-planning-summary strong,
.production-request-planning-section-head span,
.production-request-planning-defaults span,
.production-request-planning-defaults strong,
.production-request-planning-primary-action small {
    display: block;
}

.production-request-planning-summary span,
.production-request-planning-section-head span,
.production-request-planning-defaults span,
.production-request-planning-primary-action small,
.production-request-planning-document span,
.production-request-planning-document small {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.4;
}

.production-request-planning-summary strong {
    margin-top: 3px;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
}

.production-request-planning-exceptions {
    margin-top: 12px;
    border-left: 3px solid #d97706;
    padding: 9px 12px;
    background: #fff7ed;
}

.production-request-planning-exceptions.is-blocking {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.production-request-planning-exceptions h4,
.production-request-planning-exceptions summary {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.production-request-planning-exceptions ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

.form-grid.production-request-planning-dates-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.planning-today-heading, .planning-today-toolbar, .planning-today-pages {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.planning-today-heading { justify-content: space-between; margin-bottom: 16px; }
.planning-today-heading h2 { font-size: 24px; margin: 0; }
.workday-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fg-daily-actions { margin: 10px 0; }
.workday-buttons[hidden], .fg-daily-actions [hidden] { display: none; }
.planning-fg-lookup { box-sizing: border-box; width: min(600px, calc(100vw - 24px)); max-height: 84vh; max-height: 84dvh; overflow: auto; border: 1px solid #d2e3df; border-radius: 14px; padding: clamp(14px, 3vw, 24px); color: var(--text, #143a35); }
.planning-fg-lookup::backdrop { background: rgba(18, 43, 46, .46); }
.planning-fg-lookup header, .planning-fg-lookup form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.planning-fg-lookup header { justify-content: space-between; margin-bottom: 16px; }
.planning-fg-lookup h2, .planning-fg-lookup article p { margin: 0; }
.planning-fg-lookup form { align-items: end; }
.planning-fg-lookup label { flex: 1 1 190px; min-width: 0; }
.planning-fg-lookup input { width: 100%; min-width: 0; }
.planning-fg-lookup article { padding: 12px 0; border-top: 1px solid #d2e3df; overflow-wrap: anywhere; }
.planning-fg-lookup article small { display: block; margin: 3px 0 6px; }
.planning-fg-lookup button, .fg-daily-actions button { min-height: 44px; }
@media (max-width: 700px) { #production-planning-today [data-pt-stock] { min-height: 44px; } }
.planning-today-toolbar { margin: 16px 0; align-items: end; }
.planning-today-toolbar label { flex: 1; min-width: min(280px, 100%); }
.planning-today-pages { justify-content: flex-end; margin-top: 16px; }
.planning-today-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; overflow-wrap: anywhere; }
.planning-today-cell small { display: block; color: var(--muted-text, #64748b); }
#production-planning-today { min-width: 0; }
#production-planning-today table { table-layout: fixed; width: 100%; }
#production-planning-today th:nth-child(1) { width: 24%; }
#production-planning-today th:nth-child(2) { width: 36%; }
#production-planning-today th:nth-child(3) { width: 17%; }
#production-planning-today button, #planning-resolutions button { white-space: normal; }
#planning-resolutions:empty { display: none; }
#planning-resolutions > button { margin-top: 8px; }
.planning-source-return { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #dce2e7; }
.planning-formula-recovery { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dce2e7; }
.planning-formula-recovery > strong { overflow-wrap: anywhere; }
.planning-formula-recovery > div { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) {
    #production-planning-today table { table-layout: auto; }
    #production-planning-today .request-follow-up-tabs { gap: 4px; }
    #production-planning-today .request-follow-up-tabs button { flex: 1; padding-inline: 4px; }
}

@media (max-width: 700px) {
    .form-grid.production-request-planning-dates-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

.production-request-planning-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.production-request-planning-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.production-request-planning-section-head > div {
    min-width: 0;
}

.production-request-planning-section-head h4,
.production-request-planning-links h4 {
    margin: 0;
    font-size: 0.94rem;
}

.production-request-planning-workbench td strong,
.production-request-planning-workbench td small {
    display: block;
}

.production-request-planning-workbench td small {
    margin-top: 2px;
    color: var(--muted);
}

.production-request-planning-workbench tr.is-shortage td:last-child strong {
    color: #b42318;
}

.production-request-planning-ready {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    border-left: 4px solid #16a34a;
    padding: 11px 14px;
    background: #f0fdf4;
}

.production-request-planning-not-ready {
    min-height: 58px;
    border-left: 4px solid #dc2626;
    padding: 11px 14px;
    background: #fef2f2;
}

.production-request-planning-not-ready strong,
.production-request-planning-not-ready span {
    display: block;
}

.production-request-planning-not-ready strong {
    color: #991b1b;
}

.production-request-planning-not-ready span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.78rem;
}

.production-request-planning-ready strong,
.production-request-planning-ready span,
.production-request-planning-exception-summary strong,
.production-request-planning-exception-summary span,
.production-request-planning-purchase-action small,
.production-request-planning-purchase-hint {
    display: block;
}

.production-request-planning-ready strong {
    color: #166534;
    font-size: 1rem;
}

.production-request-planning-ready span,
.production-request-planning-exception-summary span,
.production-request-planning-purchase-action small,
.production-request-planning-purchase-hint {
    color: var(--muted);
    font-size: 0.78rem;
}

.production-request-planning-exception-summary {
    margin-bottom: 8px;
    border-left: 4px solid #d97706;
    padding: 9px 12px;
    background: #fff7ed;
}

.production-request-planning-purchase-action {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.production-request-planning-purchase-hint {
    max-width: 380px;
    text-align: right;
}

.production-request-planning-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.production-request-planning-links section > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.production-request-planning-document {
    display: grid;
    gap: 1px;
    border-left: 3px solid var(--teal-600, #0f766e);
    padding: 4px 8px;
}

.production-request-planning-defaults {
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--surface-soft, #f6f8f8);
}

.production-request-planning-primary-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 16px -16px -16px;
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: var(--surface, #fff);
}

.production-request-planning-queue-lines {
    display: grid;
    gap: 5px;
}

.production-request-planning-queue-lines > div,
.production-request-planning-queue-lines strong,
.production-request-planning-queue-lines span {
    display: block;
}

.production-request-planning-queue-lines span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.74rem;
}

.production-request-report-panel {
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 6px;
}

.production-request-report-panel > summary {
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}

.production-request-report-panel > summary::-webkit-details-marker {
    display: none;
}

.production-request-report-panel > summary::before {
    content: "+";
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.production-request-report-panel[open] > summary {
    border-bottom: 1px solid var(--border);
}

.production-request-report-panel[open] > summary::before {
    content: "-";
}

.production-request-report-panel > summary span,
.production-request-report-panel > summary small {
    display: block;
}

.production-request-report-panel > summary small {
    margin-top: 2px;
    color: var(--muted);
    font-weight: 400;
}

.production-request-report-content {
    display: grid;
    min-width: 0;
    max-width: 100%;
    gap: 10px;
    margin-top: 0;
    padding: 12px 14px 14px;
}

.production-request-report-meta {
    color: var(--muted);
    font-size: 0.75rem;
    text-align: right;
}

.production-request-report-metrics {
    display: grid;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow-x: auto;
}

.production-request-report-metrics > div {
    display: grid;
    min-width: 120px;
    gap: 3px;
    border-right: 1px solid var(--border);
    padding: 9px 10px;
}

.production-request-report-metrics > div:last-child {
    border-right: 0;
}

.production-request-report-metrics span,
.production-request-report-quantity {
    color: var(--muted);
    font-size: 0.75rem;
}

.production-request-report-metrics strong {
    font-size: 1rem;
}

.production-request-report-quantity,
.production-request-report-content h4 {
    margin: 0;
}

.production-request-report-table-wrap {
    min-width: 0;
    max-width: 100%;
    max-height: 420px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.production-request-report-table-wrap table {
    min-width: 980px;
}

.production-request-report-table-wrap thead {
    position: sticky;
    z-index: 1;
    top: 0;
    background: var(--surface, #fff);
}

.production-request-report-table-wrap td {
    vertical-align: top;
}

.production-request-report-table-wrap td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.production-request-report-table-wrap tr.is-overdue td:first-child {
    box-shadow: inset 3px 0 0 #dc2626;
}

.production-request-return-reasons ul {
    display: grid;
    gap: 0;
    margin: 6px 0 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    list-style: none;
}

.production-request-return-reasons li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding: 7px 9px;
}

.production-request-return-reasons li:last-child {
    border-bottom: 0;
}

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

.production-request-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px);
    gap: 10px;
    margin-bottom: 12px;
}

.production-request-line-editor {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.production-request-line-editor-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.production-request-line-editor-head h4 {
    margin: 0;
}

.production-request-product-search {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

.production-request-product-search[hidden] {
    display: none;
}

.production-request-planning-formula-note {
    display: block;
    margin: 0 0 7px;
    color: var(--muted);
}

.production-request-lines-table-wrap td {
    min-width: 120px;
    vertical-align: top;
}

.production-request-lines-table-wrap td:first-child {
    min-width: 260px;
}

.production-request-lines-table-wrap td:nth-child(5),
.production-request-lines-table-wrap td:nth-child(6) {
    min-width: 220px;
}

.production-request-lines-table-wrap td select,
.production-request-lines-table-wrap td input,
.production-request-lines-table-wrap td textarea {
    width: 100%;
    margin: 0 0 5px;
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap table {
    display: block;
    min-width: 0;
    background: transparent;
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap tbody {
    display: grid;
    gap: 10px;
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 0;
    border: 0;
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:first-child,
#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:nth-child(5),
#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:nth-child(6),
#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:last-child {
    grid-column: 1 / -1;
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:last-child {
    justify-items: end;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

#production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:last-child::before {
    content: none;
}

.production-request-product-progress {
    display: grid;
    gap: 2px;
    min-width: 250px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

.production-request-product-progress:last-child {
    border-bottom: 0;
}

.production-request-product-progress span,
.production-request-product-progress small {
    color: var(--muted);
    font-size: 0.76rem;
}

.production-request-requirements,
.production-request-workflow-history {
    margin-top: 4px;
    max-width: 360px;
}

.production-request-requirements summary,
.production-request-workflow-history summary {
    width: fit-content;
    cursor: pointer;
    color: var(--teal-deep);
    font-size: 0.78rem;
    font-weight: 700;
}

.production-request-requirements dl,
.production-request-workflow-history ol {
    margin: 6px 0 0;
    padding: 8px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.production-request-requirements dl {
    display: grid;
    gap: 6px;
}

.production-request-requirements dl > div {
    display: grid;
    grid-template-columns: minmax(100px, 0.75fr) minmax(140px, 1.25fr);
    gap: 8px;
}

.production-request-requirements dt,
.production-request-requirements dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.production-request-requirements dt {
    color: var(--muted);
    font-size: 0.75rem;
}

.production-request-workflow-history ol {
    display: grid;
    gap: 8px;
    list-style-position: inside;
}

.production-request-workflow-history li span,
.production-request-workflow-history li p,
.production-request-latest-reason {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.production-request-workflow-history li p {
    color: var(--ink);
}

.production-request-audit-load {
    display: block;
    margin-top: 5px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--color-link, #0f6f78);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
}

.production-request-audit-trail {
    width: min(520px, 70vw);
    margin-top: 6px;
}

.production-request-audit-trail > summary {
    cursor: pointer;
    color: var(--teal-deep);
    font-size: 0.76rem;
    font-weight: 700;
}

.production-request-audit-mos {
    margin: 6px 0;
    color: var(--muted);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.production-request-audit-trail ol {
    display: grid;
    max-height: 360px;
    gap: 8px;
    margin: 6px 0 0;
    padding: 8px;
    overflow-y: auto;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    list-style: none;
}

.production-request-audit-trail li {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.production-request-audit-trail li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.production-request-audit-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.production-request-audit-head span,
.production-request-audit-trail li > small,
.production-request-audit-trail li > p {
    color: var(--muted);
    font-size: 0.72rem;
}

.production-request-audit-trail li > p {
    margin: 4px 0;
    color: var(--ink);
}

.production-request-audit-trail dl {
    display: grid;
    gap: 5px;
    margin: 6px 0;
}

.production-request-audit-trail dl > div {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(180px, 1.3fr);
    gap: 8px;
}

.production-request-audit-trail dt,
.production-request-audit-trail dd {
    margin: 0;
    font-size: 0.72rem;
    overflow-wrap: anywhere;
}

.production-request-audit-trail dt {
    color: var(--muted);
}

.production-request-audit-trail dd span {
    display: block;
}

.production-request-mo-link-control {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 6px;
    margin-top: 5px;
}

.production-request-readiness-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
}

.production-request-readiness {
    display: grid;
    gap: 8px;
    min-width: min(520px, 72vw);
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.production-request-readiness-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.production-request-readiness-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.production-request-readiness-grid > div {
    display: grid;
    align-content: start;
    gap: 2px;
    border-left: 3px solid var(--border-strong, #cbd5e1);
    padding-left: 8px;
}

.production-request-readiness-grid span,
.production-request-readiness-grid small {
    color: var(--muted);
    font-size: 0.72rem;
}

.production-request-readiness-grid strong {
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.production-request-readiness-issues summary,
.production-request-existing-mo summary {
    width: fit-content;
    cursor: pointer;
    color: var(--teal-deep);
    font-size: 0.76rem;
    font-weight: 700;
}

.production-request-readiness-issues ul {
    display: grid;
    gap: 3px;
    margin: 5px 0 0;
    padding-left: 18px;
    color: #92400e;
    font-size: 0.75rem;
}

.production-request-mo-create {
    display: grid;
    grid-template-columns: minmax(120px, 0.65fr) minmax(170px, 1fr) minmax(170px, 1fr) auto;
    align-items: end;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.production-request-mo-create label {
    display: grid;
    gap: 3px;
}

.production-request-mo-create label span {
    color: var(--muted);
    font-size: 0.72rem;
}

.production-request-mo-create input,
.production-request-mo-create select {
    width: 100%;
    min-height: 34px;
}

.production-request-existing-mo {
    margin-top: 6px;
}

.production-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 150px;
}

.production-request-due-flag {
    display: block;
    width: fit-content;
    margin-top: 4px;
    border-radius: 4px;
    padding: 2px 5px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.72rem;
}

.production-request-register-panel td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.production-request-attachments-inline {
    display: grid;
    justify-items: start;
    gap: 2px;
    margin-top: 4px;
}

.production-request-attachments-inline .text-button {
    max-width: 220px;
    border: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    color: var(--color-link, #0f6f78);
    cursor: pointer;
    font-size: 0.75rem;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-request-attachments-inline .text-button:hover,
.production-request-attachments-inline .text-button:focus-visible {
    text-decoration: underline;
}

@media (max-width: 1100px) {
    .production-request-queue-summary {
        grid-template-columns: repeat(7, minmax(132px, 1fr));
    }

    .production-request-planning-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .production-request-planning-summary > div:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .production-request-planning-summary,
    .production-request-planning-links {
        grid-template-columns: 1fr;
    }

    .production-request-planning-summary > div:last-child {
        grid-column: auto;
    }

    .production-request-planning-section-head,
    .production-request-planning-primary-action {
        align-items: stretch;
        flex-direction: column;
    }

    .production-request-planning-purchase-action {
        align-items: stretch;
        text-align: left;
    }

    .production-request-planning-purchase-action .button {
        width: 100%;
    }

    .production-request-planning-purchase-hint {
        max-width: none;
        text-align: left;
    }

    .production-request-planning-primary-action .button {
        width: 100%;
    }

    #production-request-create-panel.production-request-drawer {
        inset: 0;
        width: auto;
        border: 0;
        border-radius: 0;
        padding: 14px;
    }

    .production-request-autofill-summary-grid,
    .production-request-autofill-line {
        grid-template-columns: 1fr;
    }

    .production-request-workbench-toolbar {
        justify-content: stretch;
    }

    .production-request-workbench-toolbar label {
        width: 100%;
    }

    .production-request-form-grid,
    .production-request-filters {
        grid-template-columns: 1fr;
    }

    .production-request-line-editor-head {
        align-items: stretch;
        flex-direction: column;
    }

    .production-request-product-search {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    #production-request-create-panel.production-request-drawer .production-request-lines-table-wrap tr {
        grid-template-columns: minmax(0, 1fr);
    }

    #production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:first-child,
    #production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:nth-child(5),
    #production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:nth-child(6),
    #production-request-create-panel.production-request-drawer .production-request-lines-table-wrap td:last-child {
        grid-column: 1;
    }

    .production-request-mo-link-control,
    .production-request-readiness-grid,
    .production-request-mo-create {
        grid-template-columns: 1fr;
    }

    .production-request-readiness {
        min-width: 0;
        width: 100%;
    }

    .production-request-report-metrics {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(140px, 1fr);
    }

    .production-request-report-table-wrap table {
        min-width: 0;
        width: 100%;
    }

    .production-request-audit-trail {
        width: 100%;
    }

    .production-request-audit-head,
    .production-request-audit-trail dl > div {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}
/* Admin approval-rule workbench */
body.approval-threshold-drawer-open {
    overflow: hidden;
}

body.approval-threshold-drawer-open .toast-stack {
    top: auto;
    right: auto;
    bottom: 1rem;
    left: 1rem;
}

.approval-threshold-workbench {
    display: grid;
    gap: 0.9rem;
}

.approval-threshold-workbench-header {
    align-items: flex-start;
}

.approval-threshold-workbench-header .helper-text {
    max-width: 760px;
    margin: 0.25rem 0 0;
}

.approval-rule-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.approval-rule-kpis > div {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
    padding: 0.8rem 0.9rem;
    background: #fff;
}

.approval-rule-kpis > div + div {
    border-left: 1px solid var(--line);
}

.approval-rule-kpis span,
.approval-rule-result-count {
    color: var(--muted);
    font-size: 0.78rem;
}

.approval-rule-kpis strong {
    font-size: 1.2rem;
}

.approval-rule-filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(170px, 1fr)) auto;
    align-items: end;
    gap: 0.65rem;
}

.approval-rule-filter-bar label {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.approval-rule-filter-bar label > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.approval-rule-filter-bar input,
.approval-rule-filter-bar select {
    width: 100%;
    min-width: 0;
}

.approval-rule-result-count {
    margin: 0;
}

.approval-rule-table table {
    min-width: 1080px;
    table-layout: fixed;
}

.approval-rule-table th:nth-child(1) { width: 21%; }
.approval-rule-table th:nth-child(2) { width: 24%; }
.approval-rule-table th:nth-child(3) { width: 16%; }
.approval-rule-table th:nth-child(4) { width: 20%; }
.approval-rule-table th:nth-child(5) { width: 8%; }
.approval-rule-table th:nth-child(6) { width: 11%; }

.approval-rule-table th {
    background: #f8fafc;
    white-space: normal;
}

.approval-rule-table td {
    vertical-align: middle;
}

.approval-rule-document-cell,
.approval-rule-scope-cell,
.approval-rule-approver-cell {
    min-width: 0;
    display: grid;
    gap: 0.22rem;
}

.approval-rule-document-cell strong,
.approval-rule-scope-cell strong,
.approval-rule-approver-cell strong,
.approval-rule-condition-cell {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.approval-rule-document-cell span,
.approval-rule-document-cell small,
.approval-rule-scope-cell small,
.approval-rule-approver-cell small {
    color: var(--muted);
    font-size: 0.74rem;
}

.approval-rule-condition-cell {
    color: var(--ink);
    font-size: 0.82rem;
}

.approval-rule-action-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.approval-rule-action-cell .button {
    min-height: 2.15rem;
    padding: 0.42rem 0.65rem;
}

.approval-rule-card-list {
    display: none;
}

.approval-rule-tools {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}

.approval-rule-tools > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: #f5faf9;
}

.approval-rule-tools[open] > summary {
    border-bottom: 1px solid var(--line);
}

.approval-rule-tools-summary-copy {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.approval-rule-tools-summary-copy strong {
    color: var(--accent);
    font-size: 0.92rem;
}

.approval-rule-tools-summary-copy small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.45;
}

.approval-rule-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.approval-tool-section,
.approval-rule-audit {
    min-width: 0;
}

.approval-rule-simulator {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.approval-simulator-header {
    align-items: flex-start;
}

.approval-simulator-header .helper-text {
    max-width: 720px;
    margin-top: 0.2rem;
}

.approval-simulator-form {
    gap: 0.85rem;
}

.approval-simulator-step {
    display: grid;
    gap: 0.7rem;
    border-left: 3px solid #7bbab2;
    padding-left: 0.85rem;
}

.approval-simulator-step-head {
    display: grid;
    gap: 0.16rem;
}

.approval-simulator-step-head strong {
    font-size: 0.88rem;
}

.approval-simulator-step-head small,
.approval-simulator-scope summary small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.45;
}

.approval-simulator-document-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.approval-simulator-condition-fields,
.approval-simulator-scope-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.approval-simulator-scope,
.approval-rule-admin-checks,
.approval-rule-audit {
    border-top: 1px solid var(--line);
}

.approval-simulator-scope > summary,
.approval-rule-admin-checks > summary,
.approval-rule-audit > summary {
    cursor: pointer;
    padding: 0.8rem 0;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
}

.approval-simulator-scope > summary {
    display: grid;
    gap: 0.15rem;
}

.approval-simulator-scope-fields {
    padding: 0.1rem 0 0.85rem;
}

.approval-simulator-actions {
    justify-content: flex-start;
}

.approval-simulator-result {
    margin-top: 0.25rem;
}

.approval-rule-admin-checks,
.approval-rule-audit {
    margin: 0 1rem;
}

.approval-rule-admin-checks > .approval-tool-section,
.approval-rule-audit > section {
    padding: 0 0 1rem;
}

.approval-threshold-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1310;
    background: rgba(13, 26, 33, 0.38);
    backdrop-filter: blur(5px);
}

.approval-threshold-drawer {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 1320;
    width: min(820px, calc(100vw - 1.5rem));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(20, 35, 44, 0.25);
}

.approval-threshold-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.1rem;
}

.approval-threshold-drawer-header h3 {
    margin: 0.15rem 0 0;
}

.approval-threshold-drawer-header .helper-text {
    max-width: 580px;
    margin: 0.25rem 0 0;
}

.approval-threshold-drawer-content {
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.1rem 1.25rem;
}

.approval-rule-review {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1rem;
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1rem;
    background: #f3f8f8;
}

.approval-rule-review > .eyebrow,
.approval-rule-review > h4,
.approval-rule-review > p {
    grid-column: 1 / -1;
    margin: 0;
}

.approval-rule-review > p {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.approval-rule-review > div {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.approval-rule-review > div span {
    color: var(--muted);
    font-size: 0.72rem;
}

.approval-rule-review > div strong {
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.approval-threshold-editor-form {
    gap: 0;
}

.approval-editor-section {
    display: grid;
    gap: 0.8rem;
    border-bottom: 1px solid var(--line);
    padding: 1.05rem 0;
}

.approval-editor-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.approval-editor-section-heading > span {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
}

.approval-editor-section-heading h4,
.approval-editor-section-heading p {
    margin: 0;
}

.approval-editor-section-heading p {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.approval-editor-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.approval-editor-primary-grid label:last-child {
    grid-column: 1 / -1;
}

.approval-condition-list {
    display: grid;
    gap: 0.55rem;
}

.approval-condition-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 0.65rem;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.approval-condition-row legend {
    padding: 0 0.35rem;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.approval-condition-row label {
    min-width: 0;
}

.approval-role-fieldset {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.approval-role-fieldset legend {
    padding: 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 800;
}

.approval-role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.approval-role-option {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.55rem 0.65rem;
    background: #fff;
}

.approval-role-option input {
    flex: 0 0 auto;
}

.approval-role-option span {
    min-width: 0;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.approval-dual-check {
    max-width: 420px;
}

.approval-advanced-scope {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.approval-advanced-scope summary {
    color: var(--accent);
    cursor: pointer;
    font-weight: 800;
}

.approval-advanced-scope .form-grid {
    margin-top: 0.8rem;
}

.approval-threshold-drawer-actions {
    position: sticky;
    bottom: -1.25rem;
    z-index: 1;
    justify-content: flex-end;
    margin: 0 -1.1rem -1.25rem;
    border-top: 1px solid var(--line);
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
}

@media (max-width: 1000px) {
    .approval-rule-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .approval-rule-search {
        grid-column: 1 / -1;
    }

    .approval-rule-tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body.approval-threshold-drawer-open .toast-stack {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        width: auto;
    }

    .approval-threshold-workbench-header,
    .approval-threshold-workbench-header .action-strip {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .approval-rule-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .approval-rule-kpis > div + div {
        border-left: 0;
    }

    .approval-rule-kpis > div:nth-child(even) {
        border-left: 1px solid var(--line);
    }

    .approval-rule-kpis > div:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

    .approval-rule-filter-bar {
        grid-template-columns: 1fr;
    }

    .approval-rule-tools > summary,
    .approval-simulator-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .approval-rule-tools > summary .status-badge {
        white-space: normal;
    }

    .approval-simulator-document-fields,
    .approval-simulator-condition-fields,
    .approval-simulator-scope-fields {
        grid-template-columns: 1fr;
    }

    .approval-simulator-actions .button {
        width: 100%;
    }

    .approval-rule-search {
        grid-column: auto;
    }

    .approval-rule-table {
        display: none;
    }

    .approval-rule-card-list {
        display: grid;
        gap: 0.65rem;
    }

    .approval-rule-card {
        display: grid;
        gap: 0.65rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        padding: 0.8rem;
        background: #fff;
    }

    .approval-rule-card header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.7rem;
    }

    .approval-rule-card header > div,
    .approval-rule-card > div {
        min-width: 0;
        display: grid;
        gap: 0.18rem;
    }

    .approval-rule-card small,
    .approval-rule-card > div > span {
        color: var(--muted);
        font-size: 0.72rem;
    }

    .approval-rule-card strong {
        font-size: 0.82rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .approval-threshold-drawer {
        inset: 0;
        width: 100vw;
        border: 0;
        border-radius: 0;
    }

    .approval-threshold-drawer-header,
    .approval-threshold-drawer-content {
        padding-right: 0.85rem;
        padding-left: 0.85rem;
    }

    .approval-threshold-drawer-header .helper-text {
        display: none;
    }

    .approval-rule-review,
    .approval-role-options,
    .approval-editor-primary-grid {
        grid-template-columns: 1fr;
    }

    .approval-condition-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .approval-condition-row legend {
        grid-column: 1 / -1;
    }

    .approval-threshold-drawer-actions {
        bottom: -1.25rem;
        margin-right: -0.85rem;
        margin-left: -0.85rem;
        padding-right: 0.85rem;
        padding-left: 0.85rem;
    }

    .approval-threshold-drawer-actions .button {
        flex: 1 1 auto;
    }
}

@media (max-width: 760px) {
    .products-fg-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-fg-summary-item:nth-child(2n) {
        border-right: 0;
    }

    .products-fg-summary-item:nth-child(-n + 4) {
        border-bottom: 1px solid var(--line);
    }

    .products-fg-summary-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        border-right: 0;
    }

    #section-products.fg-warehouse-product-catalog .product-main-toolbar {
        grid-template-columns: 1fr;
    }

    .products-fg-company-filter,
    #section-products.fg-warehouse-product-catalog .product-toolbar-filter-actions,
    #section-products.fg-warehouse-product-catalog .product-toolbar-primary-actions {
        width: 100%;
    }

    #section-products.fg-warehouse-product-catalog .product-toolbar-filter-actions,
    #section-products.fg-warehouse-product-catalog .product-toolbar-primary-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #section-products.fg-warehouse-product-catalog .product-toolbar-primary-actions .button {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .product-detail-modal.fg-warehouse-detail-modal {
        inset: 0;
        width: 100vw;
        border: 0;
        border-radius: 0;
    }

    .fg-detail-stock-secondary,
    .fg-detail-information-grid,
    .fg-detail-production-status {
        grid-template-columns: 1fr;
    }

    .fg-detail-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .fg-detail-actions .button {
        width: 100%;
    }
}
.product-approval-actions {
    display: grid;
    gap: 8px;
    min-width: min(280px, 100%);
}

.product-approval-category {
    display: grid;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--muted-color, #64748b);
}

.product-approval-category select {
    width: 100%;
    min-height: 36px;
}

.product-approval-actions .button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-ownership-review {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle, #f8fafc);
    font-size: 0.78rem;
}

.product-ownership-review summary {
    cursor: pointer;
    color: var(--ink);
    font-weight: 700;
}

.product-ownership-review[open] {
    display: grid;
    gap: 8px;
}

.product-ownership-review-row {
    display: grid;
    gap: 2px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.product-ownership-review-row span,
.product-ownership-review > span {
    color: var(--muted-color, #64748b);
}
/* FG warehouse balances and movement history */
#section-activity {
    min-width: 0;
}

#erp-activity-root {
    gap: 0.85rem;
}

.activity-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.activity-heading-copy {
    min-width: 0;
}

.activity-heading-copy h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    letter-spacing: 0;
}

.activity-heading-copy p {
    max-width: 52rem;
    margin: 0.3rem 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.activity-freshness {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.82rem;
}

.activity-refresh-button {
    min-height: 2.15rem;
    padding: 0.4rem 0.7rem;
}

.activity-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
}

.activity-kpi {
    min-width: 0;
    min-height: 5.2rem;
    padding: 0.8rem 0.95rem;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.activity-kpi:last-child {
    border-right: 0;
}

.activity-kpi:hover,
.activity-kpi:focus-visible {
    background: #f7faf9;
    outline: 2px solid rgba(15, 107, 109, 0.18);
    outline-offset: -2px;
}

.activity-kpi span,
.activity-kpi strong {
    display: block;
}

.activity-kpi span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.activity-kpi strong {
    margin-top: 0.28rem;
    font-size: 1.35rem;
    line-height: 1.15;
}

.activity-kpi[data-tone="positive"] strong {
    color: #157347;
}

.activity-kpi[data-tone="warning"] strong {
    color: #9a6700;
}

.activity-kpi[data-tone="danger"] strong {
    color: #b42318;
}

.activity-kpi[data-tone="info"] strong {
    color: #0f6b6d;
}

.activity-load-warning {
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(154, 103, 0, 0.24);
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.08);
    color: #7a5100;
    font-size: 0.8rem;
    font-weight: 700;
}

.activity-tabs {
    display: flex;
    gap: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.activity-tab {
    min-height: 2.65rem;
    padding: 0.55rem 0.15rem;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.activity-tab:hover,
.activity-tab:focus-visible,
.activity-tab.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    outline: none;
}

.activity-toolbar {
    padding: 0.8rem;
}

.activity-toolbar-primary {
    display: grid;
    grid-template-columns: minmax(15rem, 1.7fr) minmax(10rem, 0.8fr) minmax(10rem, 0.8fr) auto auto;
    gap: 0.6rem;
    align-items: end;
}

.activity-toolbar-primary label,
.activity-advanced-filters label {
    min-width: 0;
}

.activity-toolbar-primary input,
.activity-toolbar-primary select,
.activity-advanced-filters input,
.activity-advanced-filters select {
    width: 100%;
    min-width: 0;
}

.activity-advanced-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(10rem, 1fr));
    gap: 0.65rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
}

.activity-advanced-filters[hidden] {
    display: none;
}

.activity-advanced-filters label > span:not(.sr-only) {
    display: block;
    margin-bottom: 0.32rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.activity-checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: end;
    min-height: 2.65rem;
}

.activity-checkbox-field input {
    width: 1rem;
    flex: 0 0 auto;
}

.activity-checkbox-field span {
    margin: 0 !important;
    color: var(--ink) !important;
}

.activity-test-note {
    margin: 0.55rem 0 0;
    color: var(--muted);
    font-size: 0.75rem;
}

.activity-table-panel {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.activity-quick-views {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.activity-quick-views > span {
    margin-right: 0.2rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.activity-quick-view {
    flex: 0 0 auto;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.activity-quick-view:hover,
.activity-quick-view:focus-visible,
.activity-quick-view.is-active {
    border-color: rgba(15, 107, 109, 0.35);
    background: rgba(15, 107, 109, 0.08);
    color: var(--accent);
    outline: none;
}

.activity-desktop-table {
    border: 0;
    border-radius: 0;
}

.activity-desktop-table td {
    vertical-align: middle;
}

.activity-desktop-table td strong,
.activity-desktop-table td span {
    display: block;
}

.activity-desktop-table td strong + span {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.activity-row {
    cursor: pointer;
}

.activity-row:hover,
.activity-row:focus-visible {
    background: #f7faf9;
    outline: none;
}

.activity-ready-cell {
    color: #157347;
    font-size: 1.05rem;
    font-weight: 900;
}

.activity-signed-qty {
    color: #157347;
    font-weight: 900;
    white-space: nowrap;
}

.activity-signed-qty.is-negative,
.activity-card-primary.is-negative {
    color: #b42318;
}

.activity-status {
    display: inline-flex !important;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    min-height: 1.65rem;
    padding: 0.25rem 0.48rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f6f7f8;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}

.activity-status.is-positive {
    border-color: rgba(21, 115, 71, 0.2);
    background: rgba(21, 115, 71, 0.08);
    color: #157347;
}

.activity-status.is-warning {
    border-color: rgba(154, 103, 0, 0.22);
    background: rgba(245, 158, 11, 0.09);
    color: #8a5b00;
}

.activity-status.is-negative {
    border-color: rgba(180, 35, 24, 0.2);
    background: rgba(180, 35, 24, 0.08);
    color: #b42318;
}

.activity-status.is-info {
    border-color: rgba(15, 107, 109, 0.22);
    background: rgba(15, 107, 109, 0.08);
    color: #0f6b6d;
}

.activity-table-panel > .table-pagination {
    padding: 0.7rem 0.8rem;
    border-top: 1px solid var(--line);
}

.activity-mobile-list {
    display: none;
}

.activity-drawer-backdrop {
    position: fixed;
    z-index: 82;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(2px);
}

.activity-detail-drawer {
    position: fixed;
    z-index: 84;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: min(46rem, calc(100vw - 2rem));
    padding: 1rem;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.12);
    animation: productDrawerIn 160ms ease-out;
}

.activity-detail-content {
    display: grid;
    gap: 1rem;
}

.activity-detail-identity {
    display: grid;
    gap: 0.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.activity-detail-identity strong {
    font-size: 1rem;
}

.activity-detail-identity span,
.activity-detail-identity small {
    color: var(--muted);
}

.activity-detail-section {
    min-width: 0;
}

.activity-detail-section h4 {
    margin: 0 0 0.6rem;
    font-size: 0.92rem;
}

.activity-detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.activity-detail-metrics.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.activity-detail-metric {
    min-width: 0;
    padding: 0.62rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfc;
}

.activity-detail-metric span,
.activity-detail-metric strong {
    display: block;
}

.activity-detail-metric span {
    color: var(--muted);
    font-size: 0.72rem;
}

.activity-detail-metric strong {
    margin-top: 0.2rem;
    font-size: 1rem;
}

.activity-detail-metric.is-positive strong {
    color: #157347;
}

.activity-detail-metric.is-warning strong {
    color: #8a5b00;
}

.activity-detail-metric.is-negative strong {
    color: #b42318;
}

.activity-detail-definition {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0.7rem 0 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.activity-detail-definition > div {
    min-width: 0;
    padding: 0.6rem;
    border-bottom: 1px solid var(--line);
}

.activity-detail-definition > div:nth-child(odd) {
    border-right: 1px solid var(--line);
}

.activity-detail-definition > div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.activity-detail-definition dt {
    color: var(--muted);
    font-size: 0.72rem;
}

.activity-detail-definition dd {
    margin: 0.18rem 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.activity-audit-list,
.activity-detail-list {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.activity-audit-item,
.activity-detail-list > div {
    display: grid;
    gap: 0.2rem;
    padding: 0.62rem;
    border-bottom: 1px solid var(--line);
}

.activity-audit-item:last-child,
.activity-detail-list > div:last-child {
    border-bottom: 0;
}

.activity-audit-item span,
.activity-audit-item small,
.activity-detail-list span,
.activity-detail-list small {
    color: var(--muted);
    font-size: 0.74rem;
}

@media (max-width: 1080px) {
    .activity-toolbar-primary {
        grid-template-columns: minmax(15rem, 1fr) repeat(2, minmax(9rem, 0.65fr));
    }

    .activity-toolbar-primary > .button {
        width: fit-content;
    }

    .activity-advanced-filters {
        grid-template-columns: repeat(3, minmax(10rem, 1fr));
    }
}

@media (max-width: 760px) {
    .activity-header {
        display: grid;
    }

    .activity-freshness {
        justify-content: space-between;
    }

    .activity-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-kpi:nth-child(2) {
        border-right: 0;
    }

    .activity-kpi:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .activity-toolbar-primary,
    .activity-advanced-filters {
        grid-template-columns: 1fr;
    }

    .activity-toolbar-primary > .button {
        width: 100%;
    }

    .activity-desktop-table {
        display: none;
    }

    .activity-mobile-list {
        display: grid;
    }

    .activity-mobile-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.45rem 0.75rem;
        width: 100%;
        padding: 0.75rem;
        border: 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        background: #fff;
        color: var(--ink);
        text-align: left;
    }

    .activity-mobile-card:hover,
    .activity-mobile-card:focus-visible {
        background: #f7faf9;
        outline: none;
    }

    .activity-mobile-card > span:first-child {
        display: grid;
        gap: 0.15rem;
        min-width: 0;
    }

    .activity-mobile-card > span:first-child:not(.activity-status) {
        overflow-wrap: anywhere;
    }

    .activity-mobile-card small {
        min-width: 0;
        color: var(--muted);
        overflow-wrap: anywhere;
    }

    .activity-card-primary {
        align-self: center;
        color: #157347;
        text-align: right;
        white-space: nowrap;
    }

    .activity-mobile-card .activity-status {
        justify-self: end;
    }

    .activity-detail-drawer {
        top: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        width: calc(100vw - 1rem);
        padding: 0.8rem;
    }

    .activity-detail-metrics,
    .activity-detail-definition {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 430px) {
    .activity-kpi strong {
        font-size: 1.12rem;
    }

    .activity-detail-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .activity-detail-definition {
        grid-template-columns: 1fr;
    }

    .activity-detail-definition > div,
    .activity-detail-definition > div:nth-child(odd),
    .activity-detail-definition > div:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .activity-detail-definition > div:last-child {
        border-bottom: 0;
    }
}
.mi-drawer {
    position: fixed;
    inset: 12px 12px 12px auto;
    margin: 0;
    padding: 0;
    width: min(900px, calc(100vw - 24px));
    height: calc(100dvh - 24px);
    max-height: none;
    max-width: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    letter-spacing: 0;
}
.mi-drawer[open] { display: flex; flex-direction: column; }
.mi-drawer::backdrop { background: rgba(20, 30, 35, 0.38); }
.mi-header, .mi-footer { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 16px 20px; }
.mi-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.mi-header h3 { margin: 0; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.mi-header > button { flex: 0 0 auto; }
.mi-footer { justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.mi-body { flex: 1 1 auto; min-height: 0; padding: 20px; overflow: auto; }
.mi-drawer label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mi-drawer label[hidden] { display: none; }
.mi-file-field > div { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.mi-file-field span { overflow-wrap: anywhere; }
.mi-drawer input:not([type="checkbox"]), .mi-drawer select, .mi-drawer textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.mi-search-bar { display: grid; grid-template-columns: minmax(0, 1fr) 225px auto; align-items: end; gap: 12px; }
.mi-search-meta, .mi-pager, .mi-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.mi-search-meta { color: var(--muted); font-size: 13px; }
.mi-request { display: grid; gap: 16px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 16px; }
.mi-request[hidden] { display: none; }
.mi-drawer .mi-check { flex-direction: row; align-items: center; gap: 8px; margin: 12px 0; }
.mi-check input { width: 18px; height: 18px; flex: 0 0 18px; }
.mi-table { overflow-x: auto; margin: 12px 0; }
.mi-table table { width: 100%; table-layout: fixed; }
.mi-table th:first-child { width: 50%; }
.mi-table td, .mi-table th { overflow-wrap: anywhere; white-space: normal; padding: 12px 8px; }
.mi-table td small { display: block; color: var(--muted); }
.mi-drawer .button { white-space: normal; overflow-wrap: anywhere; }
.mi-link { padding: 0; border: 0; background: none; color: var(--teal); cursor: pointer; font-weight: 700; text-align: left; }
.mi-spec, .mi-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.mi-note { border-left: 3px solid #107b73; padding: 12px; background: #f0f8f7; }
.mi-feedback { padding: 12px; background: #fff3e3; color: #704c17; overflow-wrap: anywhere; }
.mi-origin { font-size: 13px; color: var(--muted); }
.mi-history { margin-top: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.mi-history summary { display: flex; justify-content: space-between; cursor: pointer; }
.mi-history[open] summary span { transform: rotate(45deg); }
@media (max-width: 600px) {
    .mi-drawer { inset: 6px; width: calc(100vw - 12px); height: calc(100dvh - 12px); }
    .mi-header, .mi-footer, .mi-body { padding: 12px; }
    .mi-search-bar { grid-template-columns: minmax(0, 1fr) auto; }
    .mi-search-bar > label:first-child { grid-column: 1 / -1; }
    .mi-table table { min-width: 480px; }
    .mi-footer .button { min-height: 40px; padding: 8px 12px; }
}
/* Customer amendments and planning commitments share one compact document section. */
.request-follow-up-tabs { display: flex; gap: 16px; border-bottom: 1px solid #dce2e7; margin-bottom: 16px; }
.request-follow-up-tabs button { border: 0; border-bottom: 3px solid transparent; background: none; padding: 12px 8px; color: #5e7084; font: inherit; cursor: pointer; }
.request-follow-up-tabs button[aria-selected="true"] { color: #0f766e; border-bottom-color: #0f766e; font-weight: 700; }
.request-follow-up-panel { background: #fff; padding: 16px 0; min-width: 0; }
.request-follow-up-panel h3 { font-size: 18px; margin: 0; }
.request-follow-up-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 12px; margin: 16px 0; }
.request-follow-up-filters label { display: grid; gap: 6px; min-width: 0; }
.request-follow-up-count { color: #5e7084; font-size: 13px; margin: 12px 0; min-height: 20px; }
.request-follow-up-table table { width: 100%; table-layout: fixed; }
.request-follow-up-table th:nth-child(1) { width: 19%; }
.request-follow-up-table th:nth-child(2) { width: 26%; }
.request-follow-up-table th:nth-child(3) { width: 15%; }
.request-follow-up-table th:nth-child(4) { width: 12%; }
.request-follow-up-table th:nth-child(5) { width: 10%; }
.request-follow-up-table td { vertical-align: top; overflow-wrap: anywhere; white-space: normal; }
.request-follow-up-cell { min-width: 0; }
.request-follow-up-cell > span, .request-follow-up-table small { display: block; margin-top: 4px; }
.request-follow-up-table small { color: #5e7084; }
.request-follow-up-table .field-error { color: #b42318; }
.request-follow-up-table button { margin-top: 10px; white-space: normal; }
.request-follow-up-product + .request-follow-up-product { margin-top: 10px; }
.request-follow-up-reason { white-space: pre-wrap; }
@media (max-width: 760px) {
    .request-follow-up-filters { grid-template-columns: minmax(0, 1fr); }
    .request-follow-up-table table, .request-follow-up-table tbody { display: block; min-width: 0; }
    .request-follow-up-table thead { display: none; }
    .request-follow-up-table tr { display: block; padding: 12px 0; border-bottom: 1px solid #dce2e7; }
    .request-follow-up-table td { display: block; width: auto; border: 0; }
    .request-follow-up-table td[data-label]::before { content: attr(data-label); display: block; color: #5e7084; font-size: 12px; margin-bottom: 4px; }
}
.rc-workspace { border-top: 1px solid #dce2e7; padding: 16px 0; min-width: 0; }
.planning-source-products { padding: 12px 0; border-bottom: 1px solid var(--line); }
#production-request-planning-workbench .production-request-planning-nav { top: var(--planning-nav-top, 67px); }
.planning-source-products h4 { margin: 0 0 8px; font-size: 14px; }
.planning-source-product { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; }
.planning-source-product strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.planning-source-product span { flex: 0 1 32%; text-align: right; overflow-wrap: anywhere; }
.planning-handoff-product { margin: 8px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); }
.planning-handoff-fields { display: grid; gap: 10px; margin: 8px 0 16px; }
.planning-handoff-fields > div { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 8px 16px; }
.planning-handoff-fields dt { color: var(--muted); font-size: 13px; }
.planning-handoff-fields dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.planning-handoff-attachments { margin: 12px 0 20px; }
.planning-handoff-attachments h5 { margin: 0 0 8px; }
.planning-handoff-attachments > div { display: flex; flex-wrap: wrap; gap: 8px; }
.planning-handoff-attachments button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
@media (max-width: 600px) {
    .planning-handoff-fields > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
#planning-source.production-request-planning-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#planning-source.production-request-planning-summary > div:last-child { grid-column: auto; }
.planning-decision-section { min-width: 0; border-top: 1px solid var(--line); padding: 12px 0; }
.planning-decision-section > summary, .planning-document-detail > summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; min-height: 36px; }
.planning-decision-section > summary::-webkit-details-marker, .planning-document-detail > summary::-webkit-details-marker { display: none; }
.planning-decision-section > summary::after, .planning-document-detail > summary::after { content: "+"; display: grid; place-items: center; flex: 0 0 30px; height: 30px; margin-left: auto; border: 1px solid var(--line); border-radius: 4px; color: #087b76; }
.planning-decision-section[open] > summary::after, .planning-document-detail[open] > summary::after { content: "-"; }
.planning-decision-section > section { border: 0; padding: 10px 0 0; margin: 0; }
.production-request-planning-links:has(.planning-decision-section) { display: block; }
.production-request-planning-links .planning-decision-section > section > div { display: block; width: 100%; }
.planning-document-detail { border-bottom: 1px solid var(--line); padding: 10px 0; min-width: 0; }
.planning-document-detail > summary > span { font-size: 13px; color: var(--muted); }
.planning-detail-body { padding: 8px 0; min-width: 0; }
.planning-detail-body p { margin: 8px 0 12px; font-size: 13px; }
.planning-tracking-metrics, .planning-production-phases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px 0; gap: 12px; list-style: none; margin: 0; border-block: 1px solid var(--line); }
.planning-tracking-metrics > div, .planning-production-phases > li { min-width: 0; border-left: 2px solid #dce2e7; padding-left: 10px; }
.planning-tracking-metrics span, .planning-production-phases span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.planning-tracking-metrics strong { font-size: 15px; overflow-wrap: anywhere; }
.planning-production-phases .is-done { border-color: #0f766e; }
.planning-production-phases strong { font-size: 13px; }
.planning-procurement-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 12px; }
.planning-detail-body td, .planning-procurement-status > *, .planning-decision-section summary { overflow-wrap: anywhere; }
.planning-detail-body td small { display: block; color: var(--muted); }
.planning-action-outcome { display: grid; gap: 5px; border-left: 3px solid #0f766e; padding: 12px; margin: 12px 0; background: #eff8f6; overflow-wrap: anywhere; }
.planning-action-outcome.is-error { border-color: #b42318; background: #fff4f3; }
.planning-action-outcome span { font-size: 13px; }
.planning-reference-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 12px 0; }
.planning-reference-fields span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 5px; }
@media (max-width: 600px) {
    #planning-source.production-request-planning-summary { grid-template-columns: minmax(0, 1fr); }
    .planning-source-product { display: grid; gap: 4px; }
    .planning-source-product span { text-align: left; }
    .planning-tracking-metrics, .planning-production-phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .planning-procurement-status { grid-template-columns: minmax(0, 1fr); }
    .planning-reference-fields { grid-template-columns: minmax(0, 1fr); }
}
.rc-heading, .rc-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rc-actions { justify-content: flex-start; margin-top: 12px; }
.rc-heading h4, .rc-current h4 { margin: 0; }
.rc-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.rc-dates dt { color: #5e7084; font-size: 13px; }
.rc-dates dd { margin: 4px 0; font-weight: 600; }
.rc-late, .rc-blockers { color: #9b3d13; }
.rc-details { border-top: 1px solid #dce2e7; padding: 12px 0; }
.rc-details > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; gap: 12px; list-style: none; }
.rc-details > summary::-webkit-details-marker { display: none; }
.rc-plus { width: 30px; height: 30px; border: 1px solid #dce2e7; border-radius: 4px; display: grid; place-items: center; color: #087b76; flex: 0 0 30px; }
.rc-plus::after { content: "+"; }
.rc-details[open] > summary .rc-plus::after { content: "-"; }
.rc-details > form { margin-top: 14px; }
.rc-workspace label { display: grid; gap: 6px; min-width: 0; }
.rc-workspace textarea { width: 100%; box-sizing: border-box; }
.rc-line { border: 0; border-top: 1px solid #dce2e7; padding: 14px 0; min-width: 0; margin: 12px 0; }
.rc-line legend { font-weight: 600; padding-right: 8px; overflow-wrap: anywhere; max-width: 100%; }
.rc-line-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rc-status { color: #087b76; font-weight: 600; }
.rc-history { padding: 14px 0; border-bottom: 1px solid #dce2e7; }
.rc-history > small { display: block; margin-top: 4px; color: #5e7084; }
.rc-diff { table-layout: fixed; width: 100%; }
.rc-diff td, .rc-diff th, .rc-current p, .rc-history p { overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 600px) {
    .rc-dates, .rc-line-fields { grid-template-columns: minmax(0, 1fr); }
    .rc-workspace .button { white-space: normal; }
}

/* ERP record attachments and central document permission tools. */
erp-record-documents, erp-document-admin, .erp-record-documents { display: block; min-width: 0; }
.erp-record-documents > [role="tablist"] { margin-bottom: 16px; border-bottom: 1px solid var(--border, #d9e2eb); padding-bottom: 10px; }
.erp-record-documents [role="tab"][aria-selected="true"] { color: #fff; background: #0f766e; border-color: #0f766e; }
.erp-record-documents [role="tabpanel"] { min-width: 0; }
.erp-record-documents .detail-actions, erp-document-admin .detail-actions { flex-wrap: wrap; gap: 8px; align-items: end; }
.erp-record-documents td, erp-document-admin td { overflow-wrap: anywhere; }
.erp-record-documents td .button, erp-document-admin td .button { margin: 3px; }
.erp-record-documents label, erp-document-admin label { display: grid; gap: 6px; margin: 8px 0; }
erp-document-admin .document-grants { display: grid; gap: 12px; margin-top: 20px; }
erp-document-admin .document-grants label { display: flex; align-items: center; gap: 10px; }
.erp-record-documents [hidden], erp-document-admin [hidden] { display: none !important; }
@media (max-width: 640px) {
    .record-file-panel table, erp-document-admin table { min-width: 0; width: 100%; table-layout: fixed; }
    .record-file-panel th:first-child, erp-document-admin th:first-child { width: 55%; }
    .record-file-panel td, erp-document-admin td { white-space: normal; padding: 8px; }
    .record-file-panel td .button, erp-document-admin td .button { white-space: normal; padding: 8px; }
}

.erp-install-dialog{max-width:520px;width:calc(100% - 32px);max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #cbd5e1;border-radius:16px;padding:28px;color:#0f172a;background:#fff;box-shadow:0 20px 60px #0f172a33}.erp-install-dialog::backdrop{background:#0f172a66}.erp-install-dialog p{line-height:1.7;margin:16px 0}.erp-install-dialog .detail-actions{justify-content:flex-end;gap:12px}
/* Machine planning follows the ERP's teal, slate and white workspace palette. */
.mp-panel{margin:16px 0;border:1px solid #cbdfe2;border-radius:14px;background:#fff;overflow:hidden;color:#142238}
.mp-panel>summary{list-style:none;display:flex;align-items:center;gap:14px;padding:20px 24px;cursor:pointer;background:linear-gradient(115deg,#eaf6f4,#f9fcfc)}
.mp-panel>summary::-webkit-details-marker{display:none}.mp-panel>summary:after{content:'+';margin-left:auto;font-size:24px;color:#0f766e}.mp-panel[open]>summary:after{content:'−'}
.mp-panel>summary strong{display:block;font-size:18px}.mp-panel>summary small{display:block;color:#62758a;margin-top:5px;font-weight:400}.mp-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:#d5eeea;color:#0f766e;font-size:25px}
.mp-body{padding:22px}.mp-panel button,.mp-panel input,.mp-panel select{font:inherit}.mp-panel button{cursor:pointer}.mp-panel button:disabled{cursor:default;opacity:.55}.mp-panel label{display:flex;flex-direction:column;gap:7px;font-size:13px;color:#435971}.mp-panel input:not([type=checkbox]),.mp-panel select{min-width:0;max-width:100%;width:100%;min-height:42px;border:1px solid #cad7e2;border-radius:8px;padding:9px 11px;color:#142238;background:#fff;box-sizing:border-box}.mp-panel input[type=checkbox]{accent-color:#0f766e;width:17px;height:17px;flex:0 0 auto}
.mp-panel input:focus,.mp-panel select:focus,.mp-panel button:focus-visible,.mp-panel summary:focus-visible{outline:2px solid #0f766e;outline-offset:3px}.mp-toolbar{display:flex;align-items:end;justify-content:space-between;gap:16px}.mp-toolbar>label{min-width:240px;max-width:60%}.mp-tabs{display:flex;gap:4px;border-bottom:1px solid #dce5ec;margin:20px 0 24px;overflow-x:auto}.mp-tabs button{flex-shrink:0;background:transparent;border:0;border-bottom:3px solid transparent;padding:13px 18px;color:#60738b}.mp-tabs button[aria-current=page]{color:#0f766e;border-color:#0f766e;background:#edf7f5;font-weight:650}
.mp-section-head,.mp-route-card header,.mp-editor>header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}.mp-section-head p{max-width:780px;color:#62758a;font-size:13px;margin:0;line-height:1.7}.mp-section-head>div:last-child{display:flex;gap:8px;flex-wrap:wrap}.mp-section-head>div:first-child{display:block}.mp-route-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,390px),1fr));gap:18px}.mp-route-card{border:1px solid #dbe5ed;border-radius:12px;padding:20px;min-width:0}.mp-panel h4{margin:0 0 6px;font-size:16px}.mp-route-card p{font-size:13px;color:#62758a;margin:6px 0}.mp-route-card small,.mp-slot small{display:block;font-size:12px;color:#60738b}.mp-state{display:inline-block;background:#edf6f2;border-radius:6px;padding:4px 8px;font-size:12px;color:#247b64;margin-top:12px}.mp-flow{display:flex;gap:8px;flex-wrap:wrap}.mp-flow>div{border-left:3px solid #1c9186;background:#f1f8f7;border-radius:6px;padding:10px;flex:1 1 150px}.mp-flow small{margin-top:4px}.mp-machine{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid #e4ebf0;padding:13px 0}.mp-machine strong{font-size:13px}.mp-machine small{display:block;color:#62758a;margin-top:4px;overflow-wrap:anywhere}
.mp-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.mp-panel fieldset{border:1px solid #e0e8ee;border-radius:9px;padding:13px;margin:16px 0}.mp-panel legend{font-size:13px;color:#435971;padding:0 6px}.mp-checks{display:flex;gap:12px 20px;flex-wrap:wrap}.mp-panel .mp-checks label,.mp-panel .mp-active{flex-direction:row;align-items:center}.mp-panel .mp-active{margin:20px 0}.mp-help{font-size:13px;color:#60738b;line-height:1.7}.mp-empty{text-align:center;border:1px dashed #cbdde2;border-radius:12px;padding:34px 20px;margin:15px 0;color:#62758a;background:#f9fbfc;font-size:14px}.mp-editor{border:1px solid #cbdfe2;border-radius:12px;padding:22px;background:#fcfefe}.mp-editor-fields{border:0!important;padding:0!important;margin:0!important;min-width:0}.mp-editor footer{display:flex;justify-content:flex-end;gap:10px;margin-top:24px;border-top:1px solid #e0e8ee;padding-top:18px}.mp-search{display:flex;gap:10px;max-width:650px;margin:16px 0}.mp-search button{white-space:nowrap}.mp-step{background:#fff;border:1px solid #d8e4e9;border-radius:12px;padding:20px;margin:18px 0}.mp-step>header{display:flex;align-items:end;gap:14px}.mp-step>header>label{flex:1}.mp-step-number{display:grid;place-items:center;background:#0f766e;color:white;width:32px;height:32px;border-radius:50%;flex:0 0 auto;margin-bottom:5px}.mp-choice{border:1px solid #e3ebef;background:#f8fbfc;padding:14px;border-radius:10px;margin:12px 0}.mp-choice-title{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:#0f766e;margin-bottom:12px}.mp-choice-fields{display:grid;grid-template-columns:2fr 1.2fr 1fr 1fr 1fr;gap:12px}.mp-run{display:flex;align-items:end;gap:14px;flex-wrap:wrap}.mp-run>label{max-width:260px}.mp-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:22px 0}.mp-metrics>div{background:#f3f9f8;border:1px solid #d7e9e6;border-radius:10px;padding:16px}.mp-metrics strong{display:block;color:#0f766e;font-size:25px}.mp-metrics span{font-size:12px;color:#5d7388}.mp-schedule-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px}.mp-lane{background:#f7fafb;border:1px solid #e0e7ed;border-radius:12px;padding:16px;min-width:0}.mp-slot{border:1px solid #cce4df;border-left:4px solid #199485;background:#fff;border-radius:8px;padding:12px;margin-top:12px;font-size:13px}.mp-slot>div{display:flex;justify-content:space-between;gap:10px}.mp-slot>div>span{color:#987024;font-size:11px}.mp-slot p{color:#62758a;margin:5px 0}.mp-slot time{display:block;font-size:12px;margin:8px 0}.mp-late{border-left-color:#d88734}.mp-notice{border:1px solid #ead6b4;background:#fffbf2;color:#77521f;padding:16px;border-radius:10px;font-size:13px;margin:18px 0}.mp-error{border:1px solid #ecc8c8;background:#fff5f5;color:#9f3838;padding:14px;border-radius:8px}.mp-blocks{margin-top:28px;padding-top:22px;border-top:1px solid #e0e7ed}.mp-panel .button{min-height:40px;border-radius:8px;font-size:13px;padding:9px 14px}.mp-panel .button-primary{background:#0f766e;color:#fff;border:1px solid #0f766e}.mp-panel .button-secondary{background:#fff;color:#28516a;border:1px solid #bdd6db}
@media(max-width:1000px){.mp-choice-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.mp-choice-fields>label:first-child{grid-column:span 2}}
@media(max-width:600px){.mp-body{padding:14px}.mp-panel>summary{padding:16px}.mp-panel>summary small{font-size:12px}.mp-toolbar{align-items:end}.mp-toolbar>label{min-width:0;max-width:70%}.mp-section-head,.mp-route-card header{align-items:flex-start;flex-direction:column}.mp-form-grid,.mp-choice-fields{grid-template-columns:1fr}.mp-choice-fields>label:first-child{grid-column:auto}.mp-metrics{gap:6px}.mp-metrics>div{padding:10px}.mp-metrics strong{font-size:20px}.mp-metrics span{font-size:11px}.mp-step,.mp-editor{padding:12px}.mp-step>header{flex-wrap:wrap}.mp-step>header>label{min-width:140px}.mp-step>header>button{margin-left:auto}.mp-search{flex-direction:column}.mp-machine{align-items:flex-start;flex-direction:column}.mp-tabs button{padding:12px}.mp-run>label{max-width:none;flex:1 1 140px}.mp-run>button{width:100%}}
/* Delivery estimates share the ERP form, surface and status tokens. */
@media (max-width: 600px) {
    /* Keep the plant name readable beside longer translated action labels. */
    .mp-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mp-toolbar > label { grid-column: 1 / -1; min-width: 0; max-width: none; width: 100%; }
    .mp-toolbar > .button { width: 100%; white-space: normal; }
}
.dp-panel { margin: 16px 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); min-width: 0; }
.dp-panel > header { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.dp-panel h4 { margin: 0 0 5px; font-size: 16px; line-height: 1.5; }
.dp-panel header p, .dp-panel small { color: var(--muted); margin: 0; font-size: 13px; line-height: 1.6; }
.dp-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: var(--radius-md); color: var(--accent); background: var(--accent-soft); }
.dp-icon svg { width: 22px; height: 22px; }
.dp-panel fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.dp-panel label { display: grid; gap: 7px; margin: 12px 0; min-width: 0; font-size: 13px; font-weight: 600; }
.dp-panel input, .dp-panel textarea { width: 100%; box-sizing: border-box; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-weight: 400; line-height: 1.5; }
.dp-panel textarea { resize: vertical; min-height: 80px; }
.dp-panel :is(input,textarea,button,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dp-panel .button { min-height: 40px; padding: 9px 14px; font-size: 13px; white-space: normal; }
.dp-panel :disabled { cursor: default; opacity: .6; }
.dp-inputs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; }
.dp-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.dp-dates > div { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.dp-dates strong { color: var(--accent); font-size: 20px; overflow-wrap: anywhere; }
.dp-dates .dp-late { border-color: var(--warning); background: var(--warn-soft); }
.dp-note, .dp-feedback { padding: 12px 14px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.dp-note { background: var(--warn-soft); color: var(--warning); border-left: 3px solid var(--warning); }
.dp-feedback-info { background: var(--accent-soft); color: var(--teal-deep); border-left: 3px solid var(--accent); }
.dp-feedback-success { background: var(--success-soft); color: var(--success); border-left: 3px solid var(--success); }
.dp-feedback-error { background: var(--danger-soft); color: var(--danger); border-left: 3px solid var(--danger); }
.dp-feedback .button { display: block; margin-top: 8px; }
.dp-panel .rc-details { border-color: var(--line); margin-top: 16px; }
.dp-panel .rc-details > summary { font-size: 13px; font-weight: 600; }
.dp-reasons { padding-left: 18px; font-size: 13px; line-height: 1.7; }
.dp-reasons li { margin: 12px 0; }
.dp-reasons strong { overflow-wrap: anywhere; }
.dp-reasons span, .dp-reasons time { display: block; color: var(--muted); overflow-wrap: anywhere; }
.dp-reply { white-space: pre-wrap; overflow-wrap: anywhere; }
.cp-workspace { color: var(--ink); }
.cp-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.cp-workspace h4 { margin: 6px 0 12px; font-size: 16px; }
.cp-workspace h5 { margin: 0 0 10px; font-size: 14px; }
.cp-workspace label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.cp-workspace input:not([type=checkbox]), .cp-workspace select, .cp-workspace textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); color: var(--ink); font: inherit; }
.cp-current, .cp-heading { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.cp-current { border-left: 4px solid var(--accent); }
.cp-section { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; margin: 16px 0; background: var(--surface); }
.cp-section > summary, .cp-pool summary { padding: 4px 0 12px; font-size: 14px; font-weight: 650; cursor: pointer; }
.cp-calendar-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 12px; padding: 14px 0; align-items: end; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.cp-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 0; }
.cp-check input { flex: 0 0 auto; }
.cp-pool { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); margin: 12px 0; }
.cp-actions { margin-top: 16px; display: grid; gap: 12px; }
.cp-actions > div, .cp-pager { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-warning { padding: 16px; border-left: 4px solid var(--warning); background: var(--warn-soft); margin: 16px 0; border-radius: var(--radius-md); }
.cp-issues { margin: 8px 0; padding-left: 20px; }
.cp-issues li { margin: 8px 0; overflow-wrap: anywhere; }
.cp-workspace small { display: block; color: var(--muted); line-height: 1.6; }
.cp-tag { padding: 3px 8px; border: 1px solid var(--warning); border-radius: 20px; font-size: 12px; }
.cp-plan-list article { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cp-orders { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.cp-workspace :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media(max-width:600px) { .cp-calendar-row { grid-template-columns: minmax(0,1fr); } .cp-current, .cp-heading { align-items: flex-start; flex-direction: column; } .cp-workspace input:not([type=checkbox]), .cp-workspace select, .cp-workspace textarea { font-size: 16px; } .cp-section, .cp-pool { padding: 12px; } }
.dp-panel .rc-history { font-size: 13px; line-height: 1.7; border-color: var(--line); }
.dp-panel .rc-history:last-child { border-bottom: 0; padding-bottom: 0; }
.dp-badge { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: var(--radius-sm); color: var(--warning); background: var(--warn-soft); font-size: 12px; }
@media (max-width:600px) { .dp-panel { padding: 14px; } .dp-inputs, .dp-dates { grid-template-columns: 1fr; } .dp-panel .rc-actions { flex-wrap: wrap; } .dp-panel input, .dp-panel textarea { font-size: 16px; } }
.pf-feedback-grid { display:grid; grid-template-columns:minmax(0, 1.15fr) minmax(300px, 1fr); gap:16px; align-items:start; }
.pf-feedback-grid .cp-section { min-width:0; margin-top:0; }
.pf-feedback-grid td small, .pf-option td small, .pf-history small { display:block; margin-top:5px; color:var(--text-muted, #64748b); }
.pf-feedback-grid td .button { text-align:left; white-space:normal; }
.pf-feedback-grid .pf-selected { background:var(--accent-soft, #e7f3f2); }
.pf-feedback-grid form > label { display:grid; gap:8px; margin:16px 0; }
.pf-feedback-grid .mp-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.pf-option { margin-top:20px; }
.pf-option h4 { margin:0 0 6px; }
.pf-option .cp-table { min-width:900px; }
.pf-option details p { min-width:180px; }
.pf-counts { display:flex; gap:12px; flex-wrap:wrap; color:var(--text-muted, #64748b); font-size:.85rem; }
.pf-history { border-bottom:1px solid var(--border, #dce4ee); padding:12px 0; }
@media(max-width:1000px) { .pf-feedback-grid { grid-template-columns:1fr; } }
@media(max-width:600px) { .pf-feedback-grid .mp-form-grid { grid-template-columns:1fr; } .pf-option .cp-heading { display:block; } }
/* FG daily work: one focused workbench, with the ERP's existing teal controls. */
.fg-workspace-dialog { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #d5e2e9; border-radius: 16px; color: #122036; background: #fff; box-shadow: 0 24px 80px #162e4540; }
.fg-workspace-dialog::backdrop { background: #12203680; }
.fg-workspace-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid #d5e2e9; background: #f6fafa; position: sticky; top: 0; z-index: 2; }
.fg-workspace-dialog h2, .fg-workspace-dialog h3 { margin: 4px 0 12px; }
.fg-workspace-body { padding: 24px; }
.fg-workspace-body > * + * { margin-top: 16px; }
.fg-workspace-body label { display: grid; gap: 8px; font-size: 14px; min-width: 0; }
.fg-workspace-body input, .fg-workspace-body select, .fg-workspace-body textarea { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px; border: 1px solid #ccd8e3; border-radius: 8px; background: #fff; color: inherit; font: inherit; }
.fg-workspace-body .inline-check { display: flex; align-items: center; gap: 10px; }
.fg-workspace-body input[type=checkbox] { width: 18px; min-height: 18px; }
.fg-workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fg-workspace-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0 0 24px; }
.fg-workspace-steps li { padding: 10px; border-radius: 8px; background: #f3f6f8; font-size: 13px; color: #65758a; }
.fg-workspace-steps li > span { display: block; font-weight: 700; margin-bottom: 4px; }
.fg-workspace-steps .is-active { color: #086c68; background: #e2f2ef; box-shadow: inset 0 -3px #0f7974; }
.fg-workspace-steps .is-done { color: #146550; }
.fg-workspace-search { display: flex; align-items: end; gap: 10px; }
.fg-workspace-search label { flex: 1; }
.fg-workspace-selected, .fg-workspace-notice { background: #eaf6f4; border: 1px solid #bfded9; border-radius: 10px; padding: 14px 16px; }
.fg-workspace-selected { display: grid; gap: 8px; }
.fg-workspace-notice p { margin: 8px 0 0; }
.fg-picker-results { max-height: 220px; overflow-y: auto; border: 1px solid #d5e2e9; border-radius: 8px; }
.fg-picker-row { display: flex; align-items: center; gap: 16px; padding: 12px; background: white; color: inherit; border: 0; border-bottom: 1px solid #edf1f4; width: 100%; text-align: left; cursor: pointer; }
.fg-picker-row:hover { background: #eaf6f4; }
.fg-picker-row span { flex: 1; }
.fg-workspace-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid #e2e9ee; }
.fg-workspace-feedback { color: #9d2323; background: #fff1ef; padding: 14px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fg-workspace-table { max-width: 100%; overflow-x: auto; }
.fg-workspace-table table { width: 100%; border-collapse: collapse; min-width: 600px; }
.fg-workspace-table td, .fg-workspace-table th { padding: 12px; border-bottom: 1px solid #e2e9ee; text-align: left; }
.fg-workspace-table th { background: #f6f9fb; }
.fg-queue-list { display: grid; gap: 12px; }
.fg-queue-list article, .fg-receipt-review { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border: 1px solid #d5e2e9; border-radius: 10px; }
.fg-queue-list article p, .fg-receipt-review p { margin: 6px 0; }
.fg-quantity-strip { display: flex; gap: 12px; }
.fg-quantity-strip span { flex: 1; padding: 12px; background: #f1f7f7; border-radius: 8px; font-size: 13px; }
.fg-quantity-strip strong { display: block; font-size: 20px; margin-top: 4px; }
.fg-workspace-entry { display: inline-flex; flex-wrap: wrap; grid-column: 1 / -1; min-width: 0; gap: 8px; }
.fg-mobile-tools { padding: 10px 0; }
.fg-mobile-tools > summary { color: var(--accent, #0f7974); cursor: pointer; font-weight: 600; }
.fg-mobile-tools > div { display: grid; gap: 12px; padding-top: 14px; }
.fg-task-menu { position: relative; }
.fg-task-menu > div { position: absolute; right: 0; top: calc(100% + 8px); display: grid; gap: 8px; padding: 12px; min-width: 220px; background: white; border: 1px solid #d5e2e9; border-radius: 10px; box-shadow: 0 12px 32px #162e4520; z-index: 10; }
#fg-summary-disclosure { margin: 14px 0; border: 1px solid #e0e8ed; border-radius: 10px; padding: 10px 14px; }
#fg-summary-disclosure > summary { color: #526d7a; cursor: pointer; font-size: 14px; }
#fg-summary-disclosure .products-fg-summary { margin: 12px 0 0; }
#product-form label:has(#product-low-stock-threshold), #product-form label:has(#product-max-stock), #product-form label:has(#product-reorder-point), #product-form label:has(#product-reorder-qty), #product-form label:has(#product-safety-stock) { display: none !important; }
@media (max-width: 700px) {
  .fg-workspace-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 12px; }
  .fg-workspace-dialog > header, .fg-workspace-body { padding: 16px; }
  .fg-workspace-grid { grid-template-columns: 1fr; }
  .fg-workspace-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .fg-workspace-steps li { font-size: 11px; padding: 6px 4px; overflow-wrap: anywhere; }
  .fg-picker-row, .fg-queue-list article, .fg-receipt-review { flex-wrap: wrap; }
  .fg-workspace-search { flex-wrap: wrap; }
  .fg-workspace-search label { flex-basis: 70%; }
  .fg-mobile-tools .fg-workspace-entry { width: 100%; }
  .fg-mobile-tools .fg-task-menu { width: 100%; }
  .fg-mobile-tools .fg-task-menu > div { position: static; min-width: 0; box-shadow: none; margin-top: 8px; }
  .fg-mobile-tools .fg-scan-action { display: none; }
  #section-products .product-main-toolbar { display: flex; flex-direction: column; align-items: stretch; }
  #section-products .product-main-toolbar > .search-field { order: -3; width: 100%; }
  #section-products .product-main-toolbar .product-toolbar-primary-actions { order: -2; display: flex; flex-wrap: wrap; gap: 8px; }
  #section-products .product-section-heading .section-subtitle, #section-products.fg-warehouse-product-catalog .table-panel > .panel-head { display: none; }
  #section-products .product-section-heading { margin-bottom: 12px; }
  #section-products .product-toolbar-filter-actions { display: flex; }
  .fg-warehouse-product-catalog .product-mobile-card-review { display: none; }
  .fg-workspace-actions > .button { flex: 1 1 auto; }
}

.fg-workspace-body textarea { resize: vertical; }
.fg-workspace-body p, .fg-workspace-body li, .fg-queue-list article > div { overflow-wrap: anywhere; min-width: 0; }
.fg-queue-list article > button { flex-shrink: 0; max-width: 100%; }

/* SPKG entrance: shared ERP authentication, independent presentation. */
.login-screen.login-premium {
    min-height: 100svh; padding: 0; gap: 0; align-items: stretch;
    grid-template-columns: minmax(0, 1.2fr) minmax(420px, .8fr);
    width: 100%; min-width: 0; background: #faf9f5; color: #123a36;
}
.login-premium .login-brand-panel {
    position: relative; display: flex; flex-direction: column; isolation: isolate;
    padding: 40px clamp(32px, 5vw, 96px) 48px;
    background: #0a3029 url("assets/login/forest-wall.png") center / cover no-repeat;
    color: #fafaf3; overflow: hidden;
}
.login-premium .login-brand-panel::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(0, 27, 24, .08) 40%, rgba(0, 24, 21, .55));
}
.login-premium .login-wordmark { display: grid; gap: 5px; margin-left: 5%; }
.login-premium .login-wordmark strong { font-size: clamp(20px, 2vw, 30px); letter-spacing: .035em; line-height: 1.2; font-weight: 650; }
.login-premium .login-wordmark span { font-size: 10px; letter-spacing: .48em; color: #d7e2d8; }
.login-premium .login-brand-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(30px, 4vh, 50px); padding-top: 35px; }
/* One original logo and one soft shadow at every breakpoint. */
.login-premium .login-emblem {
    position: relative; width: min(84%, 490px, 52svh); aspect-ratio: 1; flex-shrink: 0;
    border-radius: 50%; background: transparent; transform: none;
    box-shadow: 0 12px 28px #00171066;
}
.login-premium .login-emblem img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }
.login-premium .login-emblem::after { content: none; }
.login-premium .login-brand-copy { text-align: center; text-shadow: 0 2px 10px #001a1470; }
.login-premium .login-brand-copy h1 { margin: 0 0 12px; font-size: clamp(28px, 3vw, 46px); font-weight: 600; line-height: 1.35; letter-spacing: -.025em; color: #fbfcf6; }
.login-premium .login-brand-copy p { margin: 0; color: #b6cebd; font-size: clamp(14px, 1.4vw, 19px); line-height: 1.7; }
.login-premium .login-form-panel { min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 32px clamp(30px, 4.5vw, 84px) 24px; background: radial-gradient(ellipse at 50% 40%, #fffefa, #f8f7f3); }
.login-premium .login-language { align-self: flex-end; display: flex; align-items: center; gap: 16px; color: #71807c; margin-bottom: 38px; }
.login-premium .login-language button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 7px 1px; font: inherit; color: #71807c; cursor: pointer; min-width: 32px; min-height: 40px; }
.login-premium .login-language button[aria-pressed="true"] { color: #164e45; border-bottom-color: #164e45; font-weight: 650; }
.login-premium .login-card { min-width: 0; width: 100%; max-width: 440px; margin: auto 0; padding: 12px 0 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.login-premium .login-kicker { font-size: 11px; letter-spacing: .32em; font-weight: 650; color: #235e53; margin: 0 0 18px; }
.login-premium .login-heading h2 { overflow-wrap: anywhere; margin: 0 0 14px; color: #0c302c; font-size: clamp(28px, 2.9vw, 43px); line-height: 1.3; letter-spacing: -.035em; font-weight: 650; }
.login-premium .login-subtitle { margin: 0 0 40px; font-size: 17px; color: #65716e; line-height: 1.65; }
.login-premium .stack-form { gap: 22px; }
.login-premium .stack-form label { font-size: 15px; color: #1f3d37; font-weight: 600; gap: 9px; }
.login-premium .stack-form input { min-height: 54px; border: 1px solid #b5c5bd; border-radius: 7px; background: #ffffffd9; color: #173b32; box-shadow: 0 1px 2px #193b2b04; font-size: 16px; font-weight: 400; }
.login-premium .stack-form input:focus { border-color: #28665a; outline: 3px solid #28665a20; outline-offset: 1px; }
.login-premium .login-password-field { display: grid; gap: 9px; }
.login-premium .login-password-input { position: relative; }
.login-premium .login-password-input input { padding-right: 54px; }
.login-premium .login-password-toggle { position: absolute; right: 4px; top: 5px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; color: #596c63; background: transparent; cursor: pointer; }
.login-premium .login-password-toggle:hover { background: #eaf0eb; }
.login-premium .login-eye-slash { display: none; }
.login-premium .login-password-toggle[aria-pressed="true"] .login-eye-slash { display: block; }
.login-premium .button-primary { width: 100%; min-height: 54px; margin-top: 5px; background: linear-gradient(105deg, #174f43, #0c4941); border: 1px solid #134b40; border-radius: 7px; color: #fffdf5; font-size: 16px; font-weight: 600; box-shadow: 0 4px 9px #123e3212; }
.login-premium .button-primary:hover:not(:disabled) { background: #1c6152; }
.login-premium .button-primary:disabled { opacity: .5; cursor: wait; }
.login-premium button:focus-visible, .login-premium summary:focus-visible { outline: 3px solid #3b8975; outline-offset: 4px; }
.login-premium .login-help { text-align: center; color: #31584d; margin-top: 23px; }
.login-premium .login-help summary { display: inline-block; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-size: 14px; padding: 8px; }
.login-premium .login-help summary::-webkit-details-marker { display: none; }
.login-premium .login-help p { font-size: 14px; line-height: 1.8; margin: 10px 0 0; padding: 14px; border-radius: 6px; background: #eaf0e8; }
.login-premium .login-footer { margin-top: 35px; padding-top: 24px; border-top: 1px solid #dce2d8; display: grid; gap: 7px; text-align: center; }
.login-premium .login-footer strong { font-size: 11px; font-weight: 500; letter-spacing: .36em; color: #3f5046; }
.login-premium .login-footer span { font-size: 12px; color: #7b8982; }
.login-premium .login-diagnostics { margin-top: 20px; color: #63786f; font-size: 11px; }
.login-premium .login-diagnostics summary { cursor: pointer; text-align: center; padding: 8px; }
.login-premium .login-footnote { text-align: left; overflow-wrap: anywhere; margin-top: 12px; }
.login-premium .inline-feedback { margin-top: 18px; padding: 12px; border-radius: 6px; background: #fff0ec; color: #8a2c22; font-size: 14px; line-height: 1.7; }
@media (min-width: 901px) and (max-height: 760px) {
    .login-premium .login-brand-panel { padding-top: 28px; padding-bottom: 28px; }
    .login-premium .login-brand-content { gap: 24px; padding-top: 24px; }
    .login-premium .login-language { margin-bottom: 15px; }
    .login-premium .login-form-panel { padding-top: 18px; padding-bottom: 15px; }
    .login-premium .login-subtitle { margin-bottom: 24px; }
    .login-premium .stack-form { gap: 17px; }
    .login-premium .login-footer { margin-top: 22px; padding-top: 18px; }
    .login-premium .login-diagnostics { margin-top: 10px; }
}
@media (max-width: 900px) {
    .login-screen.login-premium { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100svh; }
    .login-premium .login-brand-panel { display: grid; grid-template-columns: minmax(0, 1fr) 88px; grid-template-rows: auto auto; align-items: center; gap: 16px 20px; padding: 26px 30px; }
    .login-premium .login-wordmark { grid-column: 1; grid-row: 1; min-width: 0; margin: 0; }
    .login-premium .login-wordmark strong { font-size: 23px; }
    .login-premium .login-brand-content { display: contents; }
    /* A single soft shadow keeps the small emblem crisp at mobile pixel densities. */
    .login-premium .login-emblem { grid-column: 2; grid-row: 1 / 3; width: 88px; height: 88px; margin: 0; align-self: center; transform: none; box-shadow: 0 5px 14px #00171066; }
    .login-premium .login-brand-copy { grid-column: 1; grid-row: 2; min-width: 0; text-align: left; max-width: none; overflow-wrap: anywhere; }
    .login-premium .login-brand-copy h1 { font-size: 22px; margin-bottom: 7px; }
    .login-premium .login-brand-copy p { font-size: 12px; max-width: 330px; }
    .login-premium .login-form-panel { padding: 18px 32px 24px; }
    .login-premium .login-language { margin-bottom: 8px; gap: 13px; }
    .login-premium .login-card { padding-top: 4px; }
    .login-premium .login-subtitle { margin-bottom: 26px; font-size: 15px; }
    .login-premium .login-heading h2 { font-size: 30px; }
    .login-premium .login-kicker { font-size: 10px; margin-bottom: 13px; }
    .login-premium .login-footer { margin-top: 25px; padding-top: 20px; }
}
@media (max-width: 480px) {
    .login-premium .login-brand-panel { grid-template-columns: minmax(0, 1fr) 72px; gap: 14px 16px; padding: 22px 24px; }
    .login-premium .login-wordmark strong { font-size: 20px; }
    .login-premium .login-wordmark span { font-size: 8px; }
    .login-premium .login-brand-copy h1 { font-size: 19px; margin-bottom: 0; }
    .login-premium .login-brand-copy p { display: none; }
    .login-premium .login-emblem { width: 72px; height: 72px; }
    .login-premium .login-form-panel { padding: 14px 24px 22px; }
    .login-premium .stack-form { gap: 18px; }
    .login-premium .login-help { margin-top: 15px; }
}

@font-face {
    font-family: "SPKG Login Thai";
    src: url("assets/login/NotoSansThai.ttf") format("truetype");
    font-weight: 100 900; font-style: normal; font-display: swap;
}
.login-screen.login-premium { font-family: "SPKG Login Thai", "Segoe UI", sans-serif; }
.login-premium input, .login-premium button { font-family: inherit; }


/* FG reference guide: scoped to the manual and its entry links. */
#fg-guide-root { color: var(--text, #102033); min-width: 0; width: 100%; container: fg-guide / inline-size; overflow-wrap: anywhere; }
.fg-guide-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border: 1px solid #c8dfdd; border-radius: 12px; background: #eef7f5; }
.fg-guide-hero h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.35; margin: 6px 0; color: #0c4543; }
.fg-guide-hero p { max-width: 85ch; margin: 0 0 8px; line-height: 1.7; }
#fg-guide-root summary { cursor: pointer; color: #16605b; font-weight: 600; line-height: 1.6; }
#fg-guide-root details p { margin: 12px 0 0; line-height: 1.85; }
.fg-guide-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 20px; align-items: start; }
.fg-guide-toc { display: grid; gap: 5px; padding: 9px; border: 1px solid #dbe4e8; border-radius: 12px; background: #fff; }
.fg-guide-toc button { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 13px 12px; border: 0; border-radius: 8px; background: transparent; color: #4f6577; font: inherit; cursor: pointer; line-height: 1.6; }
.fg-guide-toc button:hover { background: #f3f7f8; }
.fg-guide-toc button[aria-current] { color: #096b67; background: #e7f3f1; font-weight: 600; }
.fg-guide-toc small { display: block; margin-top: 3px; font-weight: 400; font-size: .76rem; color: #6a7d89; }
.fg-guide-lesson { min-width: 0; padding: 24px; border: 1px solid #dbe4e8; border-radius: 12px; background: #fff; }
.fg-guide-lesson h3 { font-size: 1.4rem; margin: 7px 0 23px; line-height: 1.5; }
.fg-guide-lesson h4 { font-size: .98rem; margin: 0 0 8px; }
.fg-guide-lesson p { line-height: 1.85; }
.fg-guide-context { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 27px; padding-bottom: 21px; border-bottom: 1px solid #e1e9ed; }
.fg-guide-context p { color: #5a7082; font-size: .9rem; margin: 0; }
.fg-guide-steps { list-style: none; counter-reset: fg-lesson; padding: 0; margin: 17px 0 25px; }
.fg-guide-steps li { counter-increment: fg-lesson; position: relative; padding: 0 0 22px 43px; line-height: 1.9; }
.fg-guide-steps li::before { content: counter(fg-lesson); position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #eaf4f2; color: #0b716b; font-size: .85rem; font-weight: 700; }
.fg-guide-result { border-left: 3px solid #16897f; padding: 16px 19px; background: #eff8f5; border-radius: 0 8px 8px 0; margin: 20px 0; }
.fg-guide-result p, .fg-guide-handoff p { margin: 0; }
.fg-guide-handoff { margin: 21px 0; }
.fg-guide-handoff p { color: #596f81; font-size: .91rem; }
.fg-guide-figure { margin: 0 0 25px; border: 1px solid #dbe4e8; border-radius: 9px; overflow: hidden; }
.fg-guide-figure img { width: 100%; height: auto; display: block; }
.fg-guide-figure figcaption { padding: 10px 13px; color: #627489; font-size: .78rem; line-height: 1.6; background: #f7fafb; }
.fg-guide-figure a { color: #08736e; }
.fg-guide-footer, .fg-guide-footer > div { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.fg-guide-page-help { flex: 0 0 auto; text-decoration: none; }
.fg-workspace-header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
#fg-guide-root button:focus-visible, #fg-guide-root a:focus-visible, #fg-guide-root summary:focus-visible, #fg-guide-root select:focus-visible { outline: 3px solid #16897f; outline-offset: 3px; }
@container fg-guide (max-width: 900px) {
    .fg-guide-layout { grid-template-columns: minmax(0, 1fr); }
    .fg-guide-toc { display: none; }
}
@media (max-width: 560px) {
    .fg-guide-hero { align-items: flex-start; gap: 18px; flex-direction: column; }
    .fg-guide-toc { grid-template-columns: 1fr; }
    .fg-guide-toc button { padding: 9px; }
    .fg-guide-context { grid-template-columns: 1fr; }
    .fg-guide-lesson h3 { font-size: 1.2rem; }
    .fg-guide-footer > div { width: 100%; }
    .fg-guide-footer .button { flex: 1; }
    .fg-guide-steps li { padding-left: 36px; }
    .fg-workspace-header-actions { flex-direction: column; align-items: stretch; }
    .fg-workspace-header-actions .button { font-size: .78rem; padding: 7px 9px; }
}

.fg-guide-mobile-picker { display: none; gap: 8px; color: #16605b; font-size: .9rem; font-weight: 600; min-width: 0; }
.fg-guide-mobile-picker select { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; padding: 12px; border: 1px solid #c8dfdd; border-radius: 8px; background: #fff; color: #163b43; font: inherit; font-size: 1rem; }
@container fg-guide (max-width: 900px) {
    .fg-guide-mobile-picker { display: grid; }
}

#fg-guide-lesson-title:focus { outline: 2px solid #a2d5ce; outline-offset: 6px; border-radius: 3px; }
.fg-workspace-header-actions a { text-decoration: none; }
.fg-workspace-header-actions a:focus-visible { outline: 2px solid #16897f; outline-offset: 3px; }

/* Reference navigation: routes stay prominent, without lesson/progress controls. */
.fg-guide-hero { margin-bottom: 20px; }
.fg-guide-hero p:last-child { margin-bottom: 0; }
.fg-guide-toc-label { margin: 9px 12px; color: #697c8a; font-size: .79rem; }
.fg-guide-description { margin: -10px 0 25px; color: #5a7082; }
.fg-guide-map { margin-bottom: 28px; }
.fg-guide-map > p { margin: 0 0 15px; font-size: .88rem; color: #627789; }
.fg-guide-map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fg-guide-map-card { display: grid; gap: 9px; min-width: 0; padding: 17px; text-align: left; border: 1px solid #d6e5e5; border-radius: 10px; background: #fbfdfd; color: #204a4a; cursor: pointer; font: inherit; }
.fg-guide-map-card:hover { background: #eef7f5; border-color: #98c6c2; }
.fg-guide-map-card strong { display: flex; justify-content: space-between; gap: 10px; font-size: .93rem; line-height: 1.65; }
.fg-guide-map-card > span { font-size: .79rem; line-height: 1.8; color: #667d8b; }
.fg-guide-location { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 18px; padding: 20px; background: #eef7f5; border: 1px solid #c8dfdd; border-radius: 10px; }
.fg-guide-location > div { min-width: 0; flex: 1 1 260px; }
.fg-guide-location .button { white-space: normal; }
.fg-guide-path { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 0; margin: 0; list-style: none; font-size: .93rem; line-height: 1.8; }
.fg-guide-path li:not(:last-child)::after { content: "→"; margin-left: 10px; color: #708c8b; }
.fg-guide-path li:last-child { font-weight: 600; color: #096b67; }
.fg-guide-location .fg-guide-location-note, .fg-guide-location [role="alert"] { flex-basis: 100%; margin: 0; font-size: .83rem; color: #526d7b; }
.fg-guide-location-tip { margin: 13px 0 22px; font-size: .85rem; color: #627789; }
.fg-guide-context { margin-top: 27px; }
.fg-guide-screenshot { border: 1px solid #dbe4e8; border-radius: 10px; padding: 16px; margin: 24px 0; }
.fg-guide-screenshot .fg-guide-figure { margin: 16px 0 0; }
.fg-guide-footer { border-top: 1px solid #e1e9ed; padding-top: 20px; margin-top: 25px; }
@container fg-guide (max-width: 600px) {
    .fg-guide-hero, .fg-guide-lesson { padding: 18px; }
    .fg-guide-layout { gap: 16px; }
    .fg-guide-context, .fg-guide-map-grid { grid-template-columns: minmax(0, 1fr); }
    .fg-guide-location { padding: 16px; }
    .fg-guide-location .button { width: 100%; }
}

.fg-guide-page-help-row { display: flex; justify-content: flex-end; margin-bottom: 14px; }

/* Planning reference: group everyday tasks, then progressively disclose detail. */
.planning-guide .fg-guide-hero { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.planning-guide .fg-guide-hero > div { min-width:0; }
.planning-guide .fg-guide-hero > button { flex-shrink:0; white-space:normal; }
.pg-toc-group { border-top:1px solid #e1e9ed; padding-top:13px; margin-top:9px; display:grid; }
.pg-toc-group h3 { margin:4px 12px 8px; font-size:.78rem; color:#617786; }
.pg-map { margin-top:26px; }
.pg-task-group { margin-bottom:28px; }
.pg-task-group > p { font-size:.86rem; color:#617786; margin:0 0 12px; }
.planning-guide .fg-guide-map-card small { font-size:.77rem; color:#08736e; }
.pg-quick { padding:22px 0 0; }
.pg-quick dl { margin:0; display:grid; gap:0; }
.pg-quick dl > div { display:grid; grid-template-columns:140px minmax(0,1fr); gap:14px; padding:15px 0; border-bottom:1px solid #edf1f3; line-height:1.85; }
.pg-quick dt { color:#0b716b; font-weight:600; font-size:.88rem; }
.pg-quick dd { margin:0; font-size:.92rem; }
.pg-disclosure { border:1px solid #dbe4e8; border-radius:10px; margin:20px 0; padding:16px; min-width:0; }
.pg-disclosure > summary { cursor:pointer; color:#204a4a; font-weight:600; line-height:1.7; }
.pg-disclosure > div { margin-top:18px; }
.pg-disclosure .fg-guide-context { margin-top:0; }
.pg-disclosure .fg-guide-figure { margin:0; }
.pg-disclosure p { font-size:.9rem; }
.pg-disclosure .pg-disclosure:last-child { margin-bottom:0; }
.planning-guide .pg-bom-guide { margin-top:26px; min-width:0; }
.planning-guide .pg-bom-guide > h4 { margin-bottom:8px; color:#204a4a; }
.planning-guide .pg-bom-guide p { line-height:1.85; }
.planning-guide .pg-bom-fields { margin:0; }
.planning-guide .pg-bom-fields > div { display:grid; grid-template-columns:minmax(130px, .8fr) minmax(0,2fr); gap:12px 20px; padding:16px 0; border-bottom:1px solid #e5ecef; line-height:1.85; }
.planning-guide .pg-bom-fields dt { font-weight:600; color:#0b716b; font-size:.9rem; overflow-wrap:anywhere; }
.planning-guide .pg-bom-fields dd { margin:0; min-width:0; font-size:.9rem; overflow-wrap:anywhere; }
.planning-guide .pg-bom-examples { display:grid; gap:12px; margin-top:18px; }
.planning-guide .pg-bom-examples aside { padding:16px; border:1px solid #cce2df; border-radius:8px; background:#f2f9f7; min-width:0; }
.planning-guide .pg-bom-examples h5 { margin:0 0 8px; font-size:.9rem; color:#204a4a; }
.planning-guide .pg-bom-examples p { margin:0; }
.planning-guide .pg-bom-note { padding:12px 16px; border-left:3px solid #c7a15d; background:#fffcf5; border-radius:0 6px 6px 0; overflow-wrap:anywhere; }
.planning-guide .pg-bom-guide summary:focus-visible { outline:3px solid #16897f; outline-offset:4px; border-radius:3px; }
.planning-guide .pg-bom-actions { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
.planning-guide .pg-bom-link { display:inline-flex; align-items:center; gap:8px; min-height:40px; max-width:100%; padding:8px 10px; border:1px solid #bddbd6; border-radius:7px; background:#eff8f6; color:#0b716b; font:inherit; text-align:left; white-space:normal; overflow-wrap:anywhere; cursor:pointer; }
.planning-guide .pg-bom-link:hover { background:#dfeeea; border-color:#16897f; }
.planning-guide .pg-bom-link:disabled { cursor:not-allowed; opacity:.55; }
.pp-guide-notice { padding:8px 16px; margin:0; border-bottom:1px solid #bddbd6; background:#eff8f6; color:#0b716b; font-size:13px; line-height:1.7; }
.pp-guide-notice:empty { display:none; }
.pp-dialog .pp-guide-highlight { outline:3px solid #16897f; outline-offset:3px; border-radius:5px; scroll-margin:12px; }
.pp-head [data-pp="chooseProduct"] { margin-top:8px; padding:6px 10px; font-size:13px; }
.pg-comparisons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.pg-comparisons article { background:#f6faf9; border:1px solid #dfebe8; border-radius:8px; padding:16px; }
.pg-comparisons p { color:#536b78; }
.pg-return { margin-bottom:14px; white-space:normal; }
.pg-picker { width:min(640px,calc(100vw - 24px)); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); box-sizing:border-box; padding:24px; border:1px solid #c8dfdd; border-radius:14px; color:#153941; background:#fff; overflow:auto; }
.pg-picker::backdrop { background:rgba(15,35,45,.45); }
.pg-picker header,.pg-picker footer { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.pg-picker h3 { margin:0; font-size:1.15rem; }
.pg-picker p,.pg-picker label { font-size:.87rem; line-height:1.7; }
.pg-picker form { display:flex; gap:10px; align-items:flex-end; }
.pg-picker label { display:grid; gap:6px; flex:1; min-width:0; }
.pg-picker input { width:100%; min-width:0; font:inherit; padding:10px; border:1px solid #c8d8de; border-radius:7px; }
.pg-picker [data-pg-results] { display:grid; gap:8px; margin:16px 0; }
.pg-picker [data-pg-id] { text-align:left; border:1px solid #d6e5e5; padding:13px; border-radius:8px; color:#204a4a; background:#f8fcfb; font:inherit; cursor:pointer; overflow-wrap:anywhere; display:grid; gap:5px; min-height:44px; }
.pg-picker [data-pg-id]:hover { background:#e7f3f1; border-color:#16897f; }
.pg-picker [data-pg-id] span { font-size:.82rem; color:#617786; }
.pg-picker button:focus-visible,.pg-picker input:focus-visible { outline:3px solid #16897f; outline-offset:2px; }
@container fg-guide (max-width:700px) {
    .planning-guide .fg-guide-hero { align-items:flex-start; flex-direction:column; }
    .pg-quick dl > div,.pg-comparisons { grid-template-columns:minmax(0,1fr); }
    .pg-quick dl > div { gap:4px; }
    .pg-disclosure { padding:13px; }
    .planning-guide .pg-bom-fields > div { grid-template-columns:minmax(0,1fr); gap:4px; }
}
@media (max-width:480px) {
    .pg-picker { padding:16px; }
    .pg-picker form { align-items:stretch; flex-direction:column; }
}
/* Product preparation: one workspace, shared ERP surfaces and responsive tables. */
.pp-dialog { width: min(1440px, calc(100vw - 32px)); max-width: none; height: min(940px, calc(100dvh - 32px)); max-height: none; padding: 0; border: 1px solid #c9dfe1; border-radius: 18px; color: #142234; background: #f6f9fa; box-shadow: 0 24px 80px #16353640; }
.pp-dialog::backdrop { background: #132b3866; }
.pp-shell { height: 100%; display: flex; flex-direction: column; margin: 0; min-height: 0; }
.pp-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 28px; background: white; border-bottom: 1px solid #dbe7e9; }
.pp-head h2 { margin: 4px 0; font-size: 24px; }
.pp-head small { color: #087c79; letter-spacing: .05em; }
.pp-head p { margin: 4px 0 0; color: #65778d; overflow-wrap: anywhere; }
.pp-message { padding: 8px 28px; color: #0d6e67; background: #edf8f4; font-size: 14px; }
.pp-message:empty { display: none; }
.pp-message.is-error { color: #9b341f; background: #fff0e9; }
.pp-body { overflow: auto; min-height: 0; flex: 1; padding: 24px 28px; overscroll-behavior: contain; }
.pp-content, .pp-card fieldset, .pp-factory fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pp-top { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 24px; align-items: center; }
.pp-top p, .pp-overview p { color: #60758a; margin: 8px 0; }
.pp-dialog label { display: grid; gap: 6px; min-width: 0; font-size: 14px; }
.pp-dialog input:not([type=checkbox]), .pp-dialog select { width: 100%; max-width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid #c5d7df; border-radius: 7px; background: white; color: inherit; font: inherit; }
.pp-dialog input:focus-visible, .pp-dialog select:focus-visible, .pp-dialog button:focus-visible, .pp-dialog summary:focus-visible { outline: 3px solid #53aaa7; outline-offset: 2px; }
.pp-dialog .button { min-height: 40px; white-space: normal; }
.pp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.pp-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pp-overview { background: #edf7f5; border: 1px solid #c8e2dc; border-radius: 12px; padding: 20px; margin: 18px 0; }
.pp-overview h3 { margin: 0; }
.pp-overview > label { max-width: 240px; margin: 12px 0; }
.pp-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.pp-status { display: grid; gap: 8px; text-align: left; padding: 16px; border: 1px solid #e3cfaa; background: #fffaf1; border-radius: 10px; color: #775522; cursor: pointer; font: inherit; }
.pp-status.is-ready { background: white; border-color: #b6d9cf; color: #0c6860; }
.pp-status span { font-size: 13px; line-height: 1.5; }
.pp-card { margin-top: 20px; border: 1px solid #d5e2e8; border-radius: 12px; background: white; padding: 22px; scroll-margin-top: 12px; }
.pp-card > header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pp-card h3 { margin: 0; }
.pp-number { display: grid; place-items: center; width: 36px; height: 36px; background: #e8f5f2; border-radius: 10px; color: #087873; font-weight: 700; }
.pp-formula-select { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.pp-formula-select label { flex: 1 1 280px; }
.pp-formula-select > label { min-width: 0; }
.pp-formula-select .button { min-height: 44px; }
.pp-formula-hint { margin: 10px 0 16px; padding: 10px 12px; border-left: 3px solid #0e7870; border-radius: 6px; background: #eff8f6; color: #255e59; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.pp-formula-hint.is-locked { border-left-color: #b58634; background: #fff9ed; color: #72541f; }
.pp-note { background: #f4f7fa; border-radius: 8px; padding: 12px; color: #627286; }
.pp-search { display: flex; gap: 8px; margin: 14px 0 10px; }
.pp-search input { flex: 1; }
.pp-results { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow: auto; }
.pp-results:empty { display: none; }
.pp-results button { text-align: left; justify-content: flex-start; }
.pp-product-browser { margin-top: 22px; }
.pp-product-browser h3 { margin: 0 0 6px; font-size: 18px; }
.pp-product-browser header p, .pp-browse-scope, .pp-browse-count { color: #60758a; font-size: 14px; margin: 6px 0 12px; }
.pp-product-browser .pp-search { flex-wrap: wrap; }
.pp-product-browser .pp-search input { flex: 1 1 220px; }
.pp-product-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pp-product-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 16px; border: 1px solid #d4e3e7; border-radius: 10px; background: white; text-align: left; color: #142234; font: inherit; cursor: pointer; }
.pp-product-option:hover { border-color: #65aaa3; background: #f0f8f6; }
.pp-product-text { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.pp-product-text small { color: #61778b; font-size: 12px; }
.pp-product-text strong { font-size: 14px; line-height: 1.6; font-weight: 600; }
.pp-product-select { display: flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 13px; color: #087873; }
.pp-browse-more { display: flex; justify-content: center; padding: 18px 0 4px; }
.pp-material-browser { margin: 18px 0; padding: 14px; border: 1px solid #d5e6e3; border-radius: 10px; background: #f6faf9; }
.pp-material-browser h4 { margin: 0 0 6px; color: #146f68; }
.pp-material-browser > p, .pp-material-browser > small { color: #60758a; font-size: 13px; }
.pp-material-browser .pp-search { flex-wrap: wrap; }
.pp-material-browser .pp-search input { flex: 1 1 200px; }
.pp-material-results { display: flex; flex-direction: column; gap: 6px; max-height: 250px; overflow: auto; padding: 4px; }
.pp-material-option { display: flex; justify-content: space-between; align-items: center; gap: 14px; width: 100%; padding: 12px; border: 1px solid #d4e3e7; border-radius: 8px; background: white; text-align: left; color: #142234; font: inherit; cursor: pointer; }
.pp-material-option:hover:not(:disabled) { border-color: #65aaa3; background: #eef8f5; }
.pp-dialog .pp-material-option:disabled { opacity: 1; color: #627286; background: #edf3f1; }
.pp-material-error { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 8px; background: #fff2e9; color: #8e4927; }
@media (max-width: 760px) {
 .pp-product-list { grid-template-columns: minmax(0, 1fr); }
 .pp-product-option { padding: 12px; gap: 10px; }
 .pp-product-select { max-width: 70px; }
}
.pp-table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid #e0e8ed; border-radius: 8px; }
.pp-table-wrap table { width: 100%; min-width: 560px; border-collapse: collapse; }
.pp-table-wrap th { text-align: left; color: #5a7186; background: #f6f9fb; font-size: 13px; padding: 10px; }
.pp-table-wrap td { padding: 10px; border-top: 1px solid #e5edf0; }
.pp-table-wrap td:first-child { width: 44%; overflow-wrap: anywhere; }
.pp-table-wrap td:nth-child(2) { width: 20%; }
.pp-dialog details { margin: 14px 0; border-top: 1px solid #e2eaee; padding-top: 12px; }
.pp-dialog summary { cursor: pointer; color: #166c69; font-weight: 600; }
.pp-copy { border: 1px solid #d6e3e8; background: white; padding: 16px; border-radius: 10px; }
.pp-copy-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 14px; margin: 10px 0; }
.pp-step { border: 1px solid #d9e4e9; border-radius: 10px; padding: 16px; margin: 16px 0; }
.pp-step-head { display: flex; align-items: center; gap: 12px; }
.pp-step-head label { flex: 1; }
.pp-machine { padding: 14px; margin: 12px 0; background: #f7fafb; border-radius: 8px; }
.pp-dialog .pp-check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; }
.pp-check input, .pp-checks input { accent-color: #087e79; margin-top: 3px; }
.pp-checks { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.pp-checks label { display: flex; align-items: center; gap: 5px; }
.pp-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid #dbe6eb; background: white; }
.pp-footer > span { color: #61778b; font-size: 13px; }
.pp-footer > div { display: flex; flex-wrap: wrap; gap: 8px; }
.planning-preparation-flow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; color: #1a726c; font-weight: 600; }
.planning-preparation-flow span { padding: 8px 12px; background: #edf7f5; border-radius: 8px; }
@media (max-width: 760px) {
 .pp-dialog { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
 .pp-head { padding: 14px 16px; }.pp-head h2 { font-size: 20px; }
 .pp-body { padding: 14px; }.pp-message { padding: 8px 14px; }
 .pp-top, .pp-status-grid, .pp-grid, .pp-grid-three, .pp-copy-row { grid-template-columns: minmax(0, 1fr); }
 .pp-card { padding: 14px; }.pp-overview { padding: 14px; }
 .pp-step { padding: 10px; }.pp-step-head { flex-wrap: wrap; }.pp-step-head label { flex-basis: 75%; }
 .pp-footer { padding: 10px 14px; }.pp-footer > div { width: 100%; }.pp-footer .button { flex: 1 1 45%; font-size: 12px; min-height: 40px; padding: 8px; }
 .pp-head .button { flex-shrink: 0; }
}
.pp-dialog button:disabled { opacity: .48; cursor: not-allowed; }
.pp-dialog fieldset:disabled input, .pp-dialog fieldset:disabled select { background: #f5f7f9; color: #5d6f80; }
/* Leave room to edit when a phone is horizontal or its keyboard reduces the viewport. */
@media (max-width: 1000px) and (max-height: 500px) {
    .pp-dialog { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .pp-head { padding: 8px 14px; gap: 10px; }
    .pp-head h2 { font-size: 20px; }
    .pp-head p { font-size: 13px; margin: 0; }
    .pp-footer { padding: 8px 14px; gap: 6px; }
    .pp-footer > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
    .pp-footer .button { min-width: 0; min-height: 40px; padding: 6px 8px; font-size: 12px; }
}
@media (min-width: 601px) and (max-width: 1000px) and (max-height: 500px) {
    .pp-footer > div { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Planning daily work: contextual actions and compact, readable summaries. */
.pg-current,.pg-work-context,.planning-material-prerequisite {padding:16px;border:1px solid #bededb;border-radius:12px;background:#eef8f6;margin:12px 0;}
.pg-current {display:flex;align-items:center;justify-content:space-between;gap:16px;}
.pg-current>div {display:grid;gap:5px;min-width:0;overflow-wrap:anywhere;}
.pg-current>button {flex-shrink:0;}
.pg-work-context {display:grid;gap:10px;overflow-wrap:anywhere;}
.pg-work-context>div {display:flex;flex-wrap:wrap;gap:8px;}
.pg-next-help {padding:16px;border-radius:10px;background:#f6f9fa;margin:18px 0;}
.pg-reference {box-sizing:border-box;width:min(820px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);padding:24px;border:1px solid #c4dcd9;border-radius:16px;color:var(--text,#102a35);background:#fff;overflow:auto;}
.pg-reference::backdrop {background:rgba(13,40,44,.48);}
.pg-reference header {display:flex;justify-content:space-between;gap:16px;align-items:center;}
.pg-reference nav {display:flex;flex-wrap:wrap;gap:8px;margin:18px 0;}
.pg-reference [aria-current="page"] {background:#e4f2ef;border-color:#0c7972;color:#075d57;}
.pg-reference-summary {display:grid;grid-template-columns:130px minmax(0,1fr);gap:12px;}
.pg-reference-summary dt {font-weight:700;color:#176961;}.pg-reference-summary dd {margin:0;}
.pg-reference .fg-guide-steps {padding-left:24px;}.pg-reference .fg-guide-steps li {margin:12px 0;}
.planning-review-checks {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0;}
.planning-review-checks>button {display:grid;gap:8px;text-align:start;padding:14px;border:1px solid #d5e4e5;border-radius:10px;background:#f8fbfb;color:#164b50;font:inherit;cursor:pointer;}
.planning-review-checks>button span {font-size:.9em;color:#536d77;}
.planning-material-cards {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0;}
.planning-material-card {display:grid;align-content:start;gap:8px;padding:18px;background:#fff;border:1px solid #d5e4e5;border-radius:12px;min-width:0;overflow-wrap:anywhere;}
.planning-material-card h5,.planning-material-card p {margin:0;}.planning-material-card h5 {font-size:1rem;}
.planning-material-card small {color:#5b6f7c;}.planning-material-gap {color:#985d09;}
.planning-material-card button {justify-self:start;white-space:normal;}
.planning-material-numbers>summary,.dp-settings>summary {padding:12px 0;cursor:pointer;color:#096d67;font-weight:600;}
.dp-result-summary {padding:18px;border:1px solid #c2ded7;background:#edf8f3;border-radius:12px;margin:16px 0;}
.dp-result-summary.is-late,.dp-result-summary.is-unknown {background:#fffaef;border-color:#ead4a9;}
.dp-result-summary p {margin:8px 0 0;}.dp-reasons .button {justify-self:start;white-space:normal;}
.pg-reference .button:focus-visible,.planning-review-checks>button:focus-visible {outline:3px solid #16948a;outline-offset:3px;}
@media(max-width:720px){.pg-work-context{padding:12px;gap:8px;font-size:.9rem;}.pg-work-context>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}.pg-work-context .button{padding:9px;font-size:.85rem;}.pg-work-context~.planning-preparation-flow{display:none;}}
@media(max-width:720px){.planning-review-checks,.planning-material-cards{grid-template-columns:minmax(0,1fr);}.pg-current{align-items:stretch;flex-direction:column;}.pg-reference{padding:16px;}.pg-reference header{align-items:flex-start;flex-direction:column;}.pg-reference-summary{grid-template-columns:minmax(0,1fr);gap:6px;}.pg-reference-summary dd{margin-bottom:12px;}.pg-reference .button,.pg-work-context .button{white-space:normal;max-width:100%;}}

/* Optional Planning intake follows the existing teal workspace. */
.external-intake-entry { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:0 0 16px; }
.external-intake-entry details { max-width:650px; padding:10px 14px; border:1px solid #cce1df; border-radius:10px; background:#fff; }
.external-intake-dialog { box-sizing:border-box; width:min(1060px,calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); padding:0; border:1px solid #cce1df; border-radius:16px; color:#102e35; background:#fff; box-shadow:0 24px 80px #102e3533; }
.external-intake-dialog::backdrop { background:#183e4566; }
.external-intake-dialog form { display:flex; flex-direction:column; max-height:calc(100dvh - 36px); }
.external-intake-dialog header { display:flex; align-items:flex-start; gap:16px; padding:20px 24px; border-bottom:1px solid #d6e5e7; }
.external-intake-dialog header>div { flex:1; min-width:0; }
.external-intake-dialog h2 { font-size:1.35rem; margin:4px 0 8px; }
.external-intake-dialog h3 { font-size:1.05rem; margin:0 0 12px; }
.external-intake-dialog p { margin:6px 0; overflow-wrap:anywhere; }
.external-intake-body { overflow:auto; min-height:0; padding:20px 24px; background:#f7fafb; }
.external-intake-body>section, .external-intake-body>label { display:block; margin:20px 0; }
.external-intake-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.external-intake-company { display:grid; gap:6px; min-width:0; }
.external-intake-company-select { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.external-intake-company-select select { flex:1 1 200px; }
.external-intake-body .external-intake-company-panel { padding:18px; border:1px solid #b8dcd7; border-radius:12px; background:#eef8f6; }
.external-intake-body .external-intake-company-panel[hidden] { display:none; }
.external-intake-company-panel>p { margin:8px 0 16px; }
.external-intake-company-actions { display:flex; gap:8px; flex-wrap:wrap; }
.external-intake-dialog label { display:grid; gap:6px; min-width:0; }
.external-intake-dialog input:not([type=checkbox]), .external-intake-dialog select, .external-intake-dialog textarea { width:100%; min-width:0; max-width:100%; box-sizing:border-box; padding:10px 12px; font:inherit; border:1px solid #bdd3d7; border-radius:7px; background:white; }
.external-intake-dialog [data-ei-customer] { position:relative; }
.external-intake-dialog [data-ei-customer-menu] { position:absolute; z-index:2; inset-inline:0; top:100%; overflow:auto; box-sizing:border-box; box-shadow:0 6px 16px #103b331c; margin-top:4px; padding:4px; border:1px solid #bdd3d7; border-radius:8px; background:#fff; }
.external-intake-dialog [data-ei-customer-menu].ei-above { top:auto; bottom:100%; margin:0 0 4px; }
#ei-customer-list { max-height:min(15rem,32dvh); overflow-y:auto; overscroll-behavior:contain; }
#ei-customer-list [role=option] { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:2px 12px; min-height:44px; padding:6px 10px; box-sizing:border-box; border-radius:5px; cursor:pointer; overflow-wrap:anywhere; }
#ei-customer-list [role=option]:hover, #ei-customer-list [aria-selected=true] { background:#e4f2ef; color:#075c56; }
#ei-customer-list small, [data-ei-customer-status] { color:#4a656d; }
.external-intake-dialog [data-ei-customer-status] { margin:4px 10px; font-size:.9rem; }
.external-intake-search { display:flex; align-items:flex-end; gap:8px; margin:12px 0; }
.external-intake-search label { flex:1; }
.external-intake-catalog { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-height:300px; overflow:auto; }
.external-intake-catalog>div { display:flex; gap:10px; align-items:center; padding:12px; background:#fff; border:1px solid #d6e5e7; border-radius:8px; }
.external-intake-catalog span { flex:1; min-width:0; overflow-wrap:anywhere; }
.external-intake-catalog small { display:block; color:#607987; margin-top:4px; }
.external-intake-pages { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:8px; }
.external-intake-line { border:1px solid #cce1df; border-radius:10px; background:#fff; padding:16px; margin:12px 0; }
.external-intake-line-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:12px; overflow-wrap:anywhere; }
.external-intake-line details { border-top:1px solid #d6e5e7; padding-top:10px; margin-top:12px; }
.external-intake-line summary { cursor:pointer; margin-bottom:10px; }
.external-intake-dialog footer { padding:14px 24px; border-top:1px solid #d6e5e7; background:#fff; }
.external-intake-dialog footer>div { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.external-intake-dialog footer [role=status]:not(:empty) { margin-bottom:12px; }
.external-intake-duplicates { padding:16px; border:1px solid #e6c786; border-radius:10px; background:#fffaf1; }
.external-intake-dialog .external-intake-check { display:flex; align-items:flex-start; gap:10px; margin-top:12px; }
.external-intake-dialog .external-intake-check input { width:20px; height:20px; }
.planning-external-source { background:#eaf6f3; border:1px solid #cce1df; padding:12px 16px; border-radius:10px; margin:12px 0; }
@media(max-width:640px) {
 .external-intake-dialog { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:12px; }
 .external-intake-dialog form { max-height:calc(100dvh - 20px); }
 .external-intake-dialog header, .external-intake-body, .external-intake-dialog footer { padding:14px; }
 .external-intake-dialog header p { font-size:.85rem; }
 .external-intake-grid,.external-intake-catalog { grid-template-columns:minmax(0,1fr); }
 .external-intake-dialog footer>div { display:grid; grid-template-columns:1fr; }
 .external-intake-line-title { flex-wrap:wrap; }
}

/* Source specification review: nullable units/quantities stay visibly pending. */
.spec-review-dialog { width: min(1120px, calc(100vw - 32px)); max-width: none; height: min(900px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #c6dedd; border-radius: 16px; color: var(--text, #16373d); background: #fff; }
.spec-review-dialog::backdrop { background: rgba(15,46,52,.44); }
.spec-review-shell { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.spec-review-shell > header { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #dce8e9; }
.spec-review-shell > header h2 { margin: 4px 0; font-size: 1.35rem; }
.spec-review-body { padding: 20px 24px; overflow: auto; min-height: 0; overflow-wrap: anywhere; }
.spec-review-boundary { border-left: 3px solid #117b76; background: #eef8f6; padding: 14px 16px; border-radius: 8px; }
.spec-review-tabs, .spec-review-pages, .spec-review-search > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spec-review-search { margin: 20px 0 10px; }.spec-review-search label { display: block; margin-bottom: 6px; }.spec-review-search input { flex: 1; min-width: 160px; }
.spec-review-list { display: grid; gap: 10px; }.spec-review-item { width: 100%; padding: 16px; border: 1px solid #d5e3e6; border-radius: 10px; background: #fff; color: inherit; font: inherit; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.spec-review-item:hover { background: #f1f8f7; border-color: #78b6af; }.spec-review-item:focus-visible { outline: 3px solid #17877c; outline-offset: 2px; }.spec-review-item > span:first-child { display: grid; gap: 5px; min-width: 0; }.spec-review-item small { color: #617588; }.spec-review-status { display: inline-block; padding: 5px 10px; border-radius: 20px; background: #fff3cf; color: #805000; font-size: .85rem; white-space: nowrap; }
.spec-review-pages { justify-content: space-between; margin-top: 20px; }.spec-review-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0; }.spec-review-heading h3 { margin: 0; }
.spec-review-issues { background: #fffbf2; border: 1px solid #ecd8ac; padding: 16px 20px; border-radius: 12px; margin: 20px 0; }.spec-review-issues h3 { margin-top: 0; }.spec-review-issues li { margin: 8px 0; line-height: 1.6; }
.spec-review-variant { margin: 24px 0; }.spec-review-components { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.spec-review-components article { border: 1px solid #d5e3e6; border-radius: 10px; padding: 16px; }.spec-review-components p { margin: 8px 0; }
.spec-review-body details { padding: 10px 0; }.spec-review-body summary { cursor: pointer; color: #0e726d; }.spec-review-source { display: grid; grid-template-columns: minmax(120px, .35fr) 1fr; gap: 8px 16px; }.spec-review-source dd { margin: 0; white-space: pre-wrap; }.spec-review-source dt { color: #617588; }.spec-review-note { margin-top: 24px; border-top: 1px solid #dce8e9; padding-top: 20px; }.spec-review-note label { font-weight: 600; }.spec-review-note textarea { display: block; width: 100%; margin: 12px 0; }
@media (max-width: 600px) { .spec-review-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); border-radius: 10px; }.spec-review-shell > header, .spec-review-body { padding: 14px; }.spec-review-components { grid-template-columns: 1fr; }.spec-review-item, .spec-review-heading { align-items: flex-start; flex-direction: column; }.spec-review-source { grid-template-columns: 1fr; }.spec-review-source dt { margin-top: 8px; }.spec-review-tabs .button { flex: 1 1 100%; }.spec-review-shell > header p { font-size: .8rem; } }

/* Imported specification review: show conflicting evidence without choosing it. */
.spec-review-comparison { margin: 20px 0; padding: 16px; border: 1px solid #d4e4e7; border-radius: 10px; background: #f8fbfb; }
.spec-review-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.spec-review-compare-grid > *, .spec-review-difference { min-width: 0; overflow-wrap: anywhere; }
.spec-review-compare-grid small { display: block; color: #526879; margin-bottom: 5px; }
.spec-review-difference + .spec-review-difference { border-top: 1px solid #d4e4e7; padding-top: 12px; }
.spec-review-material-warning { margin: 12px 0; padding: 12px; border-left: 3px solid #b47715; border-radius: 6px; background: #fff9ec; }
.spec-review-material-warning ul { padding-inline-start: 20px; }
@media (max-width: 600px) { .spec-review-compare-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } }
/* Imported specifications: scoped navigation and focused resolution forms. */
.spec-review-actions {display:grid;gap:10px;margin:20px 0;}
.spec-review-task {display:flex;align-items:center;gap:14px;width:100%;padding:16px;text-align:start;border:1px solid #cce1e0;border-radius:12px;background:#f5faf9;color:#145d5b;font:inherit;cursor:pointer;}
.spec-review-task>span:first-child {display:grid;place-items:center;min-width:30px;height:30px;border-radius:9px;background:#e0efec;}
.spec-review-task>strong {flex:1;}
.spec-review-task:hover,.spec-review-task:focus-visible {background:#e7f3f0;outline:2px solid #13837b;outline-offset:2px;}

/* Imported BOM work area: resume, work type, search and results stay distinct. */
.spec-review-workspace { display: grid; gap: 22px; margin-top: 16px; min-width: 0; }
.spec-review-resume { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #d6e5e4; border-radius: 10px; background: #f5f9f9; }
.spec-review-resume > div { display: grid; gap: 4px; min-width: 0; }
.spec-review-resume > div > span { color: #617588; font-size: .85rem; }
.spec-review-resume .button { margin: 0; flex: 0 1 auto; min-height: 44px; white-space: normal; }
.spec-review-choices h3 { margin: 0 0 10px; font-size: 1rem; }
.spec-review-workspace .spec-review-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.spec-review-tab { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: center; gap: 8px 12px; padding: 16px; min-width: 0; border: 1px solid #d0dfe2; border-radius: 10px; background: #fff; color: #183d43; text-align: start; font: inherit; cursor: pointer; }
.spec-review-tab-title { font-weight: 650; line-height: 1.5; }
.spec-review-tab small { grid-column: 1 / -1; color: #617588; line-height: 1.6; font-size: .85rem; }
.spec-review-count { display: inline-flex; justify-content: center; min-width: 3.3em; padding: 3px 9px; border-radius: 7px; background: #eef3f5; color: #40566c; font-weight: 650; font-variant-numeric: tabular-nums; }
.spec-review-tab[aria-pressed="true"] { border-color: #147e76; background: #edf8f5; box-shadow: inset 3px 0 #147e76; }
.spec-review-tab[aria-pressed="true"] .spec-review-count { background: #137a73; color: #fff; }
.spec-review-tab:hover { border-color: #147e76; }
.spec-review-tab:focus-visible { outline: 3px solid #17877c; outline-offset: 3px; }
.spec-review-workspace .spec-review-search { margin: 0; padding: 16px; border: 1px solid #dce8e9; border-radius: 10px; background: #f8fbfb; }
.spec-review-workspace .spec-review-search input { min-width: 120px; width: 100%; flex: 1 1 280px; }
.spec-review-workspace .spec-review-search .button { margin: 0; min-height: 44px; }
.spec-review-results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.spec-review-results-heading h3 { margin: 0; font-size: 1rem; }
.spec-review-results-heading > span { color: #617588; white-space: nowrap; font-variant-numeric: tabular-nums; }
#spec-list-help { margin: 6px 0 14px; color: #617588; font-size: .85rem; }
.spec-review-item-action { display: grid; justify-items: end; gap: 9px; flex: 0 0 auto; }
.spec-review-item-action > span:last-child { color: #0e726d; font-size: .9rem; }
@media (max-width: 600px) {
    .spec-review-workspace { gap: 18px; }
    .spec-review-resume { flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; }
    .spec-review-resume > div { display: none; }
    .spec-review-resume .button { width: 100%; }
    .spec-review-workspace .spec-review-tabs { grid-template-columns: minmax(0, 1fr); }
    .spec-review-tab { padding: 14px; }
    .spec-review-tab small { display: none; }
    .spec-review-workspace .spec-review-search { padding: 12px; }
    .spec-review-workspace .spec-review-search .button { flex: 1 1 auto; }
    .spec-review-results-heading { flex-wrap: wrap; gap: 4px 12px; }
    .spec-review-item-action { width: 100%; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
}
.spec-workflow-dialog {width:min(1160px,calc(100vw - 32px));max-width:100%;height:min(900px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);padding:0;border:1px solid #cce1e0;border-radius:18px;color:#123336;background:#fff;}
.spec-workflow-dialog::backdrop {background:rgb(19 51 54 / 38%);}
.sw-shell {height:100%;display:flex;flex-direction:column;min-height:0;}
.sw-shell>header,.sw-shell>footer {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;border-bottom:1px solid #dce8e7;flex-shrink:0;}
.sw-shell h2 {font-size:1.25rem;margin:8px 0;overflow-wrap:anywhere;}
.sw-shell>footer {border-bottom:0;border-top:1px solid #dce8e7;}
.sw-shell>footer>div,.sw-actions {display:flex;flex-wrap:wrap;align-items:center;gap:10px;}
.sw-shell .button {white-space:normal;overflow-wrap:anywhere;min-height:42px;}
.sw-body {padding:20px 24px;overflow:auto;min-height:0;overflow-wrap:anywhere;}
.sw-progress {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px;}
.sw-steps {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:24px;}
.sw-steps button {display:grid;gap:8px;padding:14px;text-align:start;border:1px solid #d5e5e3;border-radius:12px;background:#fafcfb;color:inherit;font:inherit;cursor:pointer;}
.sw-steps button[aria-current=step] {border-color:#16857c;background:#eaf5f2;box-shadow:inset 0 0 0 1px #16857c;}
.sw-steps small {font-size:.8rem;color:#5c7272;}
.sw-editor {border:0;padding:0;min-width:0;margin:0;}
.sw-editor h3 {margin:0 0 18px;}
.sw-field {display:grid;gap:8px;margin:12px 0;min-width:0;}
.sw-field input,.sw-field select,.sw-field textarea {width:100%;min-width:0;max-width:100%;padding:12px;border:1px solid #c3d8d6;border-radius:8px;background:white;color:inherit;font:inherit;}
.sw-field textarea {resize:vertical;}
.sw-field :focus-visible {outline:2px solid #16857c;outline-offset:2px;}
.sw-selection,.sw-existing {padding:16px;border:1px solid #d9e5e4;border-radius:12px;margin:12px 0;background:#fbfdfc;}
.sw-selection>strong {display:block;overflow-wrap:anywhere;}
.sw-selection small {color:#637a79;}
.sw-selection-heading h4 {margin:0 0 6px;font-size:1rem;}
.sw-selection-heading>p {margin:0 0 14px;color:#526c69;font-size:.9rem;}
.sw-item-comparison {display:grid;gap:12px;min-width:0;}
.sw-selection-product .sw-item-comparison {grid-template-columns:repeat(2,minmax(0,1fr));}
.sw-source-item,.sw-chosen-item,.sw-catalog-source {min-width:0;padding:14px;border:1px solid #dce6e3;border-radius:10px;background:#f6f9f8;}
.sw-chosen-item {background:#eef7f4;border-color:#bfdad2;}
.sw-item-comparison h5,.sw-catalog-source h5 {font-size:.9rem;margin:0 0 12px;color:#315e57;}
.sw-item-code {display:block;overflow-wrap:anywhere;}
.sw-item-name,.sw-selected-name {display:block;margin:8px 0;white-space:normal;overflow-wrap:anywhere;line-height:1.6;}
.sw-pack-size {display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:12px 0 0;padding-top:10px;border-top:1px solid #d6e3df;}
.sw-pack-size>span,.sw-count-unit {font-size:.85rem;color:#4b6862;}
.sw-pack-size>strong {font-size:1rem;color:#173f37;}
.sw-count-unit {margin:10px 0 14px;}.sw-count-unit>strong {color:#173f37;}
.sw-empty-choice {color:#526c69;line-height:1.6;}
.sw-match-help {margin-top:12px;padding:12px 14px;background:#fffaf0;border-left:3px solid #c5963d;border-radius:6px;line-height:1.6;font-size:.85rem;}
.sw-match-help>strong,.sw-match-help>span {display:block;}.sw-match-help>span {margin-top:4px;}
.sw-match-help p {margin:6px 0 0;}.sw-unit-explanation {font-weight:600;}
.sw-catalog-source {margin:12px 0;}
@media(max-width:600px) { .sw-selection-product .sw-item-comparison {grid-template-columns:minmax(0,1fr);}.sw-selection {padding:12px;}.sw-source-item,.sw-chosen-item {padding:12px;} }
.sw-materials {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
.sw-materials>article {min-width:0;border:1px solid #d9e5e4;border-radius:12px;padding:16px;}
.sw-materials .sw-selection {border:0;padding:0;margin:0;}
.sw-search {display:flex;align-items:end;gap:10px;}
.sw-search>label {flex:1;}
.sw-catalog-list article {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid #e3ebea;}
.sw-catalog-list article>div {min-width:0;}
.sw-warning {background:#fff9ed;border:1px solid #ead8af;border-radius:10px;padding:14px;}
.sw-json {white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;}
/* Task queues and a single imported-BOM workspace. */
.spec-review-queue { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-review-queue button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; border: 1px solid #cededc; border-radius: 8px; color: #284f53; background: white; font: inherit; cursor: pointer; }
.spec-review-queue button[aria-pressed="true"] { color: #075b54; background: #e7f4ef; border-color: #167e73; }
.spec-review-queue button:focus-visible { outline: 3px solid #17877c; outline-offset: 2px; }
.spec-review-queue strong { font-variant-numeric: tabular-nums; }
.spec-review-status[data-progress="READY_TO_SUBMIT"],.spec-review-status[data-progress="COMPLETE"] { background: #dcf3e8; color: #176b4d; }
.spec-review-status[data-progress="SUBMITTED"] { background: #e7effb; color: #2c4d79; }
.spec-review-status[data-progress="NOT_STARTED"] { background: #edf1f4; color: #516170; }
.sw-work-area { display: grid; grid-template-columns: minmax(0,1fr) 280px; align-items: start; gap: 20px; }
.sw-main,.sw-source { min-width: 0; }
.sw-source { position: sticky; top: 0; max-height: max(220px, calc(100dvh - 280px)); overflow: auto; padding: 16px; border: 1px solid #d9e5e2; border-radius: 10px; background: #f5faf8; font-size: .9rem; }
.sw-source summary { cursor: pointer; color: #14685f; font-weight: 600; }
.sw-source > .button { margin: 0 0 12px; }
.sw-source p { margin: 8px 0; }.sw-source details+details { margin-top: 14px; }
.sw-source-material { padding: 12px 0; border-top: 1px solid #dce7e3; }
.sw-source small { color: #607877; }.sw-source dd { margin: 0 0 10px; white-space: pre-wrap; }
.sw-source dt { color: #607877; }.sw-source dl { max-height: 380px; overflow: auto; }
.sw-entry-rows { display: grid; gap: 10px; }
.sw-entry-row { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 18px; padding: 16px; border: 1px solid #d5e3df; border-radius: 10px; }
.sw-entry-row>div { min-width: 0; }.sw-entry-row h4 { margin: 0 0 10px; }
.sw-entry-row .sw-selection { padding: 0; border: 0; background: transparent; margin: 0; }
.sw-row-status { font-size: .85rem; color: #5c706b; }
.sw-basis { padding: 14px; margin-bottom: 18px; background: #eef7f4; border: 1px solid #d0e3dc; border-radius: 10px; }
.sw-basis>p { margin-top: 0; }.sw-basis>small { color: #486b63; }
.sw-table table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.sw-table th,.sw-table td { padding: 10px; text-align: start; vertical-align: top; border-bottom: 1px solid #d9e5df; overflow-wrap: anywhere; }
.sw-table th:first-child { width: 52%; }.sw-table th { color: #496b65; background: #f4f9f7; }
.sw-formula-review { border: 1px solid #d4e4df; border-radius: 10px; padding: 14px; margin-bottom: 18px; }
.sw-formula-review h4 { margin-top: 0; }.sw-formula-review details,.sw-advanced { margin-top: 14px; }
.sw-formula-review summary,.sw-advanced summary { color: #176c62; cursor: pointer; }
.sw-success { border-left: 3px solid #16865f; background: #ecf8f1; padding: 12px; }
#sw-message { white-space: pre-line; }
@media(max-width:1000px) { .sw-work-area { grid-template-columns: minmax(0,1fr); }.sw-source { order: 2; position: static; max-height: none; overflow: visible; } }
@media(max-width:600px) { .sw-entry-row { grid-template-columns: minmax(0,1fr); gap: 8px; padding: 12px; }.sw-table th,.sw-table td { padding: 8px 5px; }.spec-review-queue button { flex: 1 1 42%; justify-content: space-between; }.sw-source { padding: 12px; }.sw-shell>footer [data-sw="saveNext"] { grid-column: 1 / -1; } }
@media(max-width:700px) {
 .spec-workflow-dialog {width:calc(100vw - 12px);height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);border-radius:12px;}
 .sw-shell>header,.sw-shell>footer,.sw-body {padding:14px;}
 .sw-shell>header {align-items:flex-start;}
 .sw-shell>header>div {min-width:0;}
 .sw-shell>header>.button {max-width:125px;flex-shrink:0;}
 .sw-shell>footer {display:block;}
 .sw-shell>footer>div {margin-top:10px;}
 .sw-shell>footer>div {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
 .sw-shell>footer small {font-size:12px;}
 .sw-shell>footer .button {padding:10px;font-size:13px;}
 .sw-shell h2 {font-size:1rem;}
 .sw-steps {grid-template-columns:repeat(2,minmax(0,1fr));}
 .sw-steps button {grid-template-columns:18px minmax(0,1fr);padding:10px;gap:6px;font-size:13px;}
 .sw-steps small {grid-column:1 / -1;font-size:11px;}
 .sw-materials {grid-template-columns:minmax(0,1fr);}
 .sw-search {flex-wrap:wrap;}
}

/* Production data lives beside the normal product list; no separate import queue. */
.production-data-workspace{min-width:0;background:#fff;border:1px solid #d8e6e5;border-radius:12px;padding:24px;color:var(--text,#16373d)}
.pdw-heading,.pdw-card,.pdw-pages{display:flex;justify-content:space-between;align-items:flex-start;gap:18px}
.pdw-heading-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.pdw-heading-actions:empty{display:none}
.pdw-heading-actions .button{min-height:40px;white-space:normal}
@media(max-width:700px){.pdw-heading-actions .button{min-height:44px}}
.pdw-heading h2{margin:0 0 8px}.pdw-heading p{margin:0;color:var(--text-muted,#526d72)}
.pdw-switch,.pdw-queues{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}
.pdw-switch [aria-pressed=true],.pdw-queues [aria-pressed=true]{background:#0f766e;color:#fff;border-color:#0f766e}
.pdw-boundary{border-left:3px solid #0f766e;padding:14px 16px;background:#eef8f6;border-radius:8px}
.pdw-search label{display:block;margin-bottom:8px}.pdw-search>div{display:flex;gap:8px}.pdw-search input{flex:1;min-width:0;width:100%;padding:12px;border:1px solid #c4d7d7;border-radius:8px}
.pdw-card{border:1px solid #d8e6e5;border-radius:10px;padding:18px;margin:12px 0}.pdw-card>div:first-child{flex:1;min-width:0;overflow-wrap:anywhere}.pdw-card h3{margin:10px 0}.pdw-card p{margin:8px 0}
.pdw-actions{display:flex;flex-direction:column;gap:8px;max-width:270px}.pdw-card button{white-space:normal}.pdw-missing{font-size:.92rem;color:#725214;line-height:1.7}.pdw-pages{align-items:center;margin-top:20px}
.production-data-workspace [data-pdw-status]{min-height:1.5em;color:#8a4329}.production-data-workspace button:focus-visible{outline:3px solid #37aaa0;outline-offset:2px}
@media(max-width:700px){.production-data-workspace{padding:14px}.pdw-heading,.pdw-card{flex-direction:column}.pdw-actions{max-width:none;width:100%}.pdw-search>div{flex-wrap:wrap}.pdw-search input{flex-basis:100%}.pdw-switch button{flex:1 1 180px}.pdw-pages{gap:6px;font-size:.85rem}.product-page-tabs{flex-wrap:wrap}}

.pdw-fix{border:0;background:transparent;color:#0f766e;text-align:left;padding:4px 0;font:inherit;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.pdw-fix:hover{color:#084e48}

/* Compact planning workspace: keep exact names, scoped away from FG / Co-Sale. */
.production-data-workspace{padding:18px}
.pdw-heading h2{margin-bottom:4px}.pdw-heading p{font-size:.9rem}
.pdw-switch,.pdw-queues{gap:8px;margin:12px 0}
.pdw-search label{margin-bottom:4px;font-size:.9rem}
.pdw-search input{padding:9px 12px}
.pdw-tools{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:10px 0 8px}
.pdw-tools small{color:var(--text-muted,#526d72)}
.pdw-tools [aria-pressed=true]{border-color:#0f766e;background:#e4f2ef;color:#075e58}
.pdw-more>summary,.pdw-details>summary,.planning-product-extra>summary{cursor:pointer;color:#176b66;padding:4px 0;font-size:.86rem}
.pdw-more .pdw-boundary{margin:10px 0;padding:10px;font-size:.88rem}
.production-data-workspace [data-pdw-status]:empty{display:none}
.pdw-card{padding:12px 14px;margin:8px 0;gap:14px}
.pdw-card h3{margin:0 0 4px;font-size:1rem;line-height:1.5;font-weight:650;white-space:normal;overflow-wrap:anywhere}
.pdw-card p{margin:5px 0}.pdw-pack{font-weight:400;color:#526d72}
.pdw-code{display:inline-block;white-space:nowrap;font-variant-numeric:tabular-nums;color:#445e63;font-size:.88rem;max-width:100%;overflow-x:auto;vertical-align:middle}
.pdw-identity{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pdw-identity .spec-review-status{font-size:.78rem;padding:3px 9px}
.pdw-actions{flex:0 0 auto;max-width:190px;gap:6px}
.pdw-actions .button{padding:8px 12px;min-height:36px}
.pdw-actions [aria-pressed=true]{color:#075e58;background:#e4f2ef;border-color:#81bab3}
.pdw-readiness{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 16px;margin:8px 0 4px}
.pdw-readiness>div{min-width:0}.pdw-readiness dt{font-size:.75rem;color:#60777b;font-weight:400}
.pdw-readiness dd{margin:2px 0 0;font-size:.84rem;overflow-wrap:anywhere}
.pdw-missing{font-size:.85rem;line-height:1.45}.pdw-fix{padding:2px 0}
.pdw-details ul{margin:4px 0;padding-left:20px}.pdw-details .button{margin:4px 6px 4px 0}
.pdw-count{font-size:.85rem;color:#60777b;margin:8px 0}
#section-products.planning-compact-catalog:not(.product-filters-expanded) .product-filter-primary,
#section-products.planning-compact-catalog:not(.product-filters-expanded) #products-saved-views{display:none}
#section-products.planning-compact-catalog .product-table-wrap table{table-layout:fixed;width:100%;min-width:0}
#section-products.planning-compact-catalog .product-table-wrap :is(th,td):is(:nth-child(3),:nth-child(4),:nth-child(7),:nth-child(8)){display:none}
#section-products.planning-compact-catalog .product-table-wrap :is(th,td):nth-child(1){width:16%;white-space:nowrap;word-break:normal;overflow-wrap:normal}
#section-products.planning-compact-catalog .product-table-wrap :is(th,td):nth-child(2){width:40%;white-space:normal;overflow-wrap:anywhere}
#section-products.planning-compact-catalog .product-table-wrap :is(th,td):nth-child(5){width:19%}
#section-products.planning-compact-catalog .product-table-wrap :is(th,td):nth-child(6){width:13%}
#section-products.planning-compact-catalog .product-table-wrap :is(th,td):nth-child(9){width:12%}
.planning-product-name{display:block;line-height:1.5}.planning-product-extra{font-size:.85rem}.planning-product-extra p{margin:5px 0;overflow-wrap:anywhere}
@media(max-width:1100px){.pdw-readiness{grid-template-columns:repeat(2,minmax(0,1fr))}.pdw-readiness>div:last-child{grid-column:1/-1}}
@media(max-width:700px){.production-data-workspace{padding:12px}.pdw-card{padding:12px}.pdw-actions{flex-direction:row;max-width:none;width:100%;flex-wrap:wrap}.pdw-actions .button{flex:1}.pdw-readiness{grid-template-columns:1fr}.pdw-readiness>div{display:grid;grid-template-columns:minmax(100px,40%) minmax(0,1fr);gap:8px}.pdw-readiness dd{margin:0}.pdw-switch{gap:6px}.pdw-switch button{flex-basis:100%;min-height:36px}.pdw-queues .button{flex:1 1 40%;padding:8px}.pdw-search>div{gap:6px}.pdw-heading,.pdw-card{gap:10px}.pdw-tools small{flex-basis:100%}}

#section-products.planning-compact-catalog .planning-product-sku{display:block;max-width:100%;overflow-x:auto;white-space:nowrap}

/* Keep stock quantities inside their column and show secondary totals on demand. */
#section-products.planning-compact-catalog .product-table-wrap .stock-split-stack{min-width:0;width:100%;grid-template-columns:minmax(0,1fr)}
#section-products.planning-compact-catalog .product-table-wrap .stock-split-row{min-width:0;white-space:normal;overflow-wrap:anywhere}
#section-products.planning-compact-catalog .product-table-wrap .stock-split-row.is-primary{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:7px 9px}
#section-products.planning-compact-catalog .product-table-wrap .stock-split-row.is-primary strong{order:0}
#section-products.planning-compact-catalog .product-table-wrap .stock-split-row.is-primary span{order:1}
.planning-stock-extra{grid-column:1/-1;min-width:0}.planning-stock-extra summary{font-size:.78rem;cursor:pointer;color:#176b66;padding:4px 0}.planning-stock-extra .stock-split-row{margin:4px 0}
#section-products.planning-compact-catalog .product-table-wrap .column-sort{white-space:normal;overflow-wrap:normal;word-break:normal}
#section-products.planning-compact-catalog .product-table-wrap .row-action-menu>summary{white-space:normal;word-break:normal;overflow-wrap:normal}
.pdw-heading h2{font-size:1.2rem}.pdw-heading p{display:none}
.pdw-switch .button,.pdw-queues .button{min-height:36px;padding:8px 12px}
.pdw-tools{display:inline-flex;margin:8px 0}.pdw-tools .button{min-height:32px;padding:6px 10px}
.pdw-more:not([open]){display:inline-block;margin-left:16px}.pdw-more[open]{display:block;margin:4px 0}
@media(max-width:700px){.pdw-tools small{display:none}.pdw-more:not([open]){margin-left:8px}.pdw-readiness{gap:5px}}

/* Product identity and one-product formula workspace. */
.pdw-product-meta { display:flex; flex-wrap:wrap; gap:4px 18px; margin:8px 0; color:var(--text-muted,#526b74); font-size:.85rem; line-height:1.55; }
.pdw-product-meta > span { max-width:100%; overflow-wrap:anywhere; }
.pdw-product-meta > span:last-child { flex-basis:100%; }
.pdw-product-home { min-width:0; }
.pdw-product-home > section { margin:20px 0; padding:18px; border:1px solid #d6e4e7; border-radius:10px; background:#fff; }
.pdw-product-home h2,.pdw-product-home h3 { white-space:normal; overflow-wrap:anywhere; }
.pdw-product-home .pdw-heading { align-items:flex-start; }
.pdw-product-home .pdw-heading > div { min-width:0; }
.pdw-product-home .pdw-heading > div:last-child { display:flex; flex-wrap:wrap; gap:8px; }
.pdw-product-home .pdw-request,.pdw-product-home .pdw-formula { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 0; border-bottom:1px solid #e5edef; }
.pdw-product-home .pdw-formula > div,.pdw-product-home .pdw-request > span { min-width:0; overflow-wrap:anywhere; }
.pdw-product-home .pdw-formula p { margin:4px 0; }
.pdw-empty { display:flex; flex-wrap:wrap; gap:10px; padding:12px 0; }
.pdw-empty p { width:100%; }
.pp-product-text .pdw-product-meta { display:flex; white-space:normal; overflow:visible; text-overflow:clip; }
.pp-product-text .pdw-product-meta span { white-space:normal; }
.pp-product-text .pdw-product-meta strong { display:inline; font-size:inherit; }
.pp-product-text > strong { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
.sw-catalog-list article > div { min-width:0; overflow-wrap:anywhere; }
@media(max-width:640px) {
 .pdw-product-home > section { padding:12px; }
 .pdw-product-home .pdw-request,.pdw-product-home .pdw-formula { align-items:stretch; flex-direction:column; gap:8px; }
 .pdw-product-home .pdw-heading { flex-direction:column; }
 .pdw-product-meta { flex-direction:column; gap:4px; }
}
/* BOM task summaries: one next action, exact identity and details on demand. */
.pdw-bom-card { display:block; padding:14px 16px; }
.pdw-bom-summary { display:flex; align-items:flex-start; gap:16px; }
.pdw-bom-summary .pdw-card-main { min-width:0; flex:1; }
.pdw-bom-card h3 { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 10px; }
.pdw-title-link,.pdw-title-text { display:block; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pdw-title-link { background:none; border:0; padding:0; font:inherit; color:inherit; text-align:left; cursor:pointer; }
.pdw-card .pdw-title-link { white-space:nowrap; }
.pdw-title-link:hover { color:#0f766e; text-decoration:underline; text-underline-offset:3px; }
.pdw-size { font-weight:500; font-size:.8rem; color:#526b74; white-space:nowrap; }
.pdw-compact-meta { display:flex; flex-wrap:wrap; gap:4px 14px; font-size:.8rem; line-height:1.5; color:#526b74; }
.pdw-compact-meta>span { max-width:100%; overflow-wrap:anywhere; }
.pdw-bom-state { display:flex; align-items:center; flex-wrap:wrap; gap:5px 10px; margin-top:7px; font-size:.82rem; line-height:1.5; }
.pdw-bom-state .spec-review-status { font-size:.78rem; padding:3px 8px; }
.pdw-next-summary { font-size:.82rem; line-height:1.6; color:#596d70; }
.pdw-bom-actions { flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; gap:6px; max-width:210px; }
.pdw-bom-actions [data-pdw=pin] { width:36px; height:36px; min-height:36px; padding:0; font-size:1.1rem; background:transparent; border:1px solid transparent; }
.pdw-bom-actions [data-pdw=pin][aria-pressed=true] { color:#0f766e; background:#e7f3f1; }
.pdw-primary .button { background:#0f766e; color:white; border-color:#0f766e; min-height:40px; padding:9px 14px; }
.pdw-primary .button:hover { background:#0b615b; }
.pdw-bom-card .pdw-details { margin-top:6px; }
.pdw-bom-card .pdw-details>summary { width:fit-content; min-height:30px; display:list-item; }
.pdw-bom-card .pdw-details[open] { border-top:1px solid #e0ebea; padding-top:8px; margin-top:10px; }
.pdw-full-name,.pdw-source-note { font-size:.85rem; overflow-wrap:anywhere; }
.pdw-stock-note { font-size:.8rem; color:#60777b; }
.pdw-toolbar { display:flex; align-items:baseline; flex-wrap:wrap; column-gap:16px; margin:4px 0; }
.pdw-toolbar .pdw-tools { margin:0; gap:6px; }
.pdw-toolbar .pdw-more:not([open]),.pdw-toolbar .pdw-more[open] { margin:0; }
.pdw-toolbar .pdw-more[open] { flex-basis:100%; }
.pdw-toolbar .pdw-tools [data-pdw=clear],.pdw-toolbar .pdw-tools [data-pdw=refresh] { background:transparent; color:#526b74; font-size:.82rem; }
#products-boms-view>.pdw-heading { display:none; }
#products-boms-view>.pdw-switch { margin-top:0; }
@media(max-width:700px) {
 .pdw-bom-card { padding:12px; }
 .pdw-bom-summary { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; position:relative; }
 .pdw-bom-summary .pdw-card-main { padding-right:36px; }
 .pdw-title-link,.pdw-title-text { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
 .pdw-card .pdw-title-link { white-space:normal; }
 .pdw-bom-actions { max-width:none; width:100%; }
 .pdw-bom-actions [data-pdw=pin] { position:absolute; top:0; right:0; }
 .pdw-primary,.pdw-primary .button { width:100%; }
 .pdw-toolbar { gap:4px 10px; }
 #products-boms-view>.pdw-switch .button { flex:1 1 120px; }
}

@media(max-width:700px){#products-boms-view>.pdw-search input{flex-basis:0}#products-boms-view>.pdw-search>div{flex-wrap:nowrap}}
/* A shared three-step presentation for native and source-backed formulas. */
.spec-workflow-dialog .sw-steps,.bom-three-steps { grid-template-columns: repeat(3,minmax(0,1fr)); }
.bom-quantity-basis { padding:16px 18px; margin:12px 0 18px; background:#eaf6f3; border:1px solid #bdddd4; border-left:4px solid #127a70; border-radius:10px; }
.bom-quantity-basis>strong { display:block; font-size:1.25rem; line-height:1.5; color:#124e46; }
.bom-quantity-basis p { margin:6px 0; }.bom-quantity-basis small { color:#496d66; }
.bom-confirm { display:flex!important; align-items:flex-start; gap:12px; padding:16px; margin:18px 0; border:1px solid #bad8d1; border-radius:10px; background:#f3faf7; line-height:1.6; }
.bom-confirm input { flex:0 0 auto; width:20px!important; height:20px; margin:3px 0!important; }
.sw-main { container-type:inline-size; }
.sw-work-area:has(.sw-source>details:not([open])) { grid-template-columns:minmax(0,1fr); }
.sw-work-area:has(.sw-source>details:not([open]))>.sw-source { position:static; }
.sw-basis-options { margin-bottom:16px; padding:10px 0; }
.sw-entry-row.bom-material-row { grid-template-columns:minmax(75px,.65fr) minmax(150px,1.8fr) minmax(110px,1fr) minmax(95px,.8fr) minmax(100px,1fr); gap:12px; align-items:start; padding:14px; }
.bom-material-choice>strong,.bom-material-choice>small { display:block; overflow-wrap:anywhere; }
.bom-material-choice>strong { line-height:1.5; }.bom-material-choice>small { color:#59746e; margin:4px 0; }
.bom-material-choice .button { padding:6px 10px; min-height:36px; margin:4px 4px 0 0; font-size:.85rem; }
.bom-material-row .sw-field { margin:0; }.bom-material-row .sw-field>span { font-size:.82rem; }
.bom-material-row .sw-row-status { margin:0; font-size:.85rem; line-height:1.5; }
.bom-row-details,.bom-row-warning { grid-column:1/-1; margin:0; }
.bom-row-details summary { color:#436e65; font-size:.85rem; cursor:pointer; }
.bom-row-details .sw-item-comparison { margin-top:12px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.bom-calculation { margin:16px 0; }.bom-calculation p { font-size:.9rem; }
.bom-production-shortcut { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid #d5e2df; padding:16px 0; margin-top:18px; color:#486b64; }
.pp-material-picker { border:1px solid #d7e6e1; border-radius:8px; padding:12px; margin:12px 0; }
.pp-material-picker>summary { cursor:pointer; color:#126f66; font-weight:600; }
.pp-material-picker .pp-material-browser { margin-top:12px; }
.bom-material-table table { width:100%; table-layout:fixed; min-width:0; }
.bom-material-table th:nth-child(1) { width:13%; }.bom-material-table th:nth-child(2) { width:32%; }.bom-material-table th:nth-child(3) { width:20%; }.bom-material-table th:nth-child(4) { width:16%; }.bom-material-table th:nth-child(5) { width:19%; }
.bom-material-table td { vertical-align:top; overflow-wrap:anywhere; }.bom-material-table td>small { display:block; color:#59746e; }
.bom-material-table td input,.bom-material-table td select { width:100%; min-width:0; }
.bom-material-table details { font-size:.85rem; }.bom-material-table .button { font-size:.82rem; padding:5px 8px; min-height:32px; margin-top:6px; }
.bom-row-basis { display:block; font-size:.8rem; margin-bottom:6px; line-height:1.5; }
@container(max-width:700px) {
 .sw-entry-row.bom-material-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .bom-material-type,.bom-material-choice,.bom-material-row .sw-row-status { grid-column:1/-1; }
 .bom-row-details .sw-item-comparison { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:600px) {
 .spec-workflow-dialog .sw-steps,.bom-three-steps { gap:5px; }
 .spec-workflow-dialog .sw-steps button,.bom-three-steps button { padding:9px 6px; font-size:.85rem; }
 .spec-workflow-dialog .sw-steps small { display:none; }
 .bom-quantity-basis { padding:12px; }.bom-quantity-basis>strong { font-size:1.08rem; }
 .bom-material-table thead { display:none; }
 .bom-material-table table,.bom-material-table tbody { display:block; }
 .bom-material-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:10px 0; padding:12px; border:1px solid #d5e2df; border-radius:10px; }
 .bom-material-table td { display:block; padding:0; border:0; min-width:0; }
 .bom-material-table td:nth-child(1),.bom-material-table td:nth-child(2),.bom-material-table td:nth-child(5) { grid-column:1/-1; }
 .bom-material-table td:before { content:attr(data-label); display:block; font-size:.8rem; color:#5b746f; margin-bottom:4px; }
 .bom-material-table td:nth-child(1):before,.bom-material-table td:nth-child(2):before { display:none; }
}

/* BOM team work: statuses stay legible without expanding every material. */
[data-bom-autosave] { overflow-wrap:anywhere; color:#24776d; }
[data-bom-autosave][data-state="error"], [data-bom-autosave][data-state="conflict"] { color:#925510; }
.bom-request-state { display:grid; gap:4px; font-size:.82rem; line-height:1.5; color:#4a6661; margin-top:8px; overflow-wrap:anywhere; }
.bom-request-state p { margin:0; }
.bom-work-conflict { border:1px solid #d6b26f; border-radius:10px; padding:16px; background:#fffaf1; margin:12px 0; overflow-wrap:anywhere; }
.bom-work-conflict button { margin:4px; }

/* Focused material registry matching; BOM editing retains its existing layout. */
.sw-registry {width:min(1040px,calc(100vw - 32px));}
.sw-registry .sw-shell>header {align-items:flex-start;}
.sw-registry .sw-shell>header>div {min-width:0;}
.sw-registry h3 {font-size:1.05rem;margin:0 0 12px;}
.sw-registry #sw-message:empty {display:none;}
.sw-registry-state {display:grid;gap:7px;padding:14px 16px;border-radius:10px;background:#edf7f4;border-left:3px solid #128075;margin-bottom:16px;}
.sw-registry-state>small {color:#55726c;line-height:1.6;}
.sw-registry-request {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border:1px solid #e6d8b8;border-radius:12px;background:#fffaf0;margin-bottom:20px;}
.sw-registry-request>div {display:grid;gap:6px;min-width:0;}
.sw-registry-request small {color:#6d6557;}
.sw-registry-request p {margin:0;white-space:pre-wrap;}
.sw-registry-request>.button {flex-shrink:0;max-width:45%;}
.sw-registry-search {margin-top:16px;}
.sw-registry-search .sw-field {margin:0;}
.sw-registry-search-tools {margin:10px 0 16px;}
.sw-registry-search-tools .button {padding:8px 12px;font-size:.86rem;}
.sw-registry-results {border:1px solid #d7e7e3;border-radius:12px;padding:0 16px;min-height:80px;}
.sw-registry-results>article {display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 0;border-bottom:1px solid #e3ece9;}
.sw-registry-results>article:last-child {border-bottom:0;}
.sw-registry-results>article>div {min-width:0;display:grid;gap:6px;}
.sw-registry-results>article>.button {flex-shrink:0;}
.sw-registry-item-state {font-size:.82rem;color:#527067;}
.sw-registry-empty {padding:20px 0;}
.sw-registry-empty p {margin:8px 0 0;color:#62746f;}
.sw-registry-add {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:14px 0;color:#55726c;font-size:.9rem;}
.sw-registry-selection {border:1px solid #cfe4df;background:#f9fcfb;border-radius:12px;padding:18px;}
.sw-registry-section-title {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;}
.sw-registry-section-title h3 {margin:0;}
.sw-registry-name {display:block;font-size:1.1rem;margin:8px 0;}
.sw-registry .pdw-product-meta {display:flex;flex-wrap:wrap;gap:6px 20px;margin:8px 0;line-height:1.6;}
.sw-registry-checks {border-top:1px solid #dae7e2;margin-top:16px;padding-top:12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;}
.sw-registry-checks h4 {grid-column:1/-1;margin:0 0 4px;}
.sw-registry-checks label {display:flex;align-items:flex-start;gap:10px;min-height:44px;cursor:pointer;line-height:1.5;}
.sw-registry-checks input {width:20px;height:20px;flex-shrink:0;accent-color:#117c71;margin-top:2px;}
.sw-registry-evidence {margin-top:20px;border-top:1px solid #e0e9e7;padding:14px 0 0;}
.sw-registry-evidence summary {cursor:pointer;color:#286d63;min-height:32px;font-weight:600;}
.sw-registry .sw-success {padding:12px;border-radius:8px;background:#e9f6ee;}
@media(max-width:600px){
 .sw-registry {width:calc(100vw - 12px);max-height:calc(100dvh - 12px);height:calc(100dvh - 12px);}
 .sw-registry-request {align-items:stretch;flex-direction:column;gap:12px;padding:14px;}
 .sw-registry-request>.button {max-width:none;width:100%;}
 .sw-registry-results {padding:0 12px;}
 .sw-registry-results>article {align-items:stretch;flex-direction:column;gap:10px;}
 .sw-registry-results>article>.button {width:100%;}
 .sw-registry-checks {grid-template-columns:minmax(0,1fr);}
 .sw-registry .pdw-product-meta {display:grid;grid-template-columns:minmax(0,1fr);}
 .sw-registry-selection {padding:14px;}
 .sw-registry-section-title {align-items:flex-start;}
 .sw-registry .sw-shell>footer>div {display:flex;flex-wrap:wrap;}
 .sw-registry .sw-shell>footer [data-sw="confirmRegistry"] {flex:1 1 100%;}
 .sw-registry-search .sw-search>label {flex-basis:100%;}
 .sw-registry-search .sw-search>.button {width:100%;}
}

/* Task groups sit above their permitted settings sections. */
.settings-groups, .settings-formula-actions, .settings-product-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
}
.settings-groups { margin-block: .8rem; }
.settings-groups [aria-pressed="true"] { background: var(--accent); color: white; }
#settings-formula-home { display: grid; gap: .7rem; margin-block-end: 1rem; min-width: 0; }
#settings-formula-home h3, #settings-formula-home p { margin: 0; }
#settings-formula-home [data-selected]:not(:empty) { display: grid; gap: .75rem; }
.settings-product-heading { justify-content: space-between; }
.settings-product-heading > div { min-width: 0; overflow-wrap: anywhere; }
.settings-product-heading small, .settings-product-option small { display: block; color: var(--muted); }
#settings-formula-home [data-results]:not(:empty) { max-height: 18rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .35rem; }
.settings-product-option { display: block; width: 100%; min-height: 44px; text-align: start; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: .45rem .65rem; overflow-wrap: anywhere; }
.settings-product-option:hover, .settings-product-option:focus-visible { background: var(--surface); }
#settings-formula-availability, #settings-formula-register { margin-top: .65rem; min-width: 0; }
@media (max-width: 650px) {
    .settings-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .settings-groups button, #settings-formula-home button { min-height: 44px; white-space: normal; }
}

/* Planning request workspace: one navigation, intact forms across tabs. */
#production-request-planning-workbench.production-request-planning-drawer { width: min(88rem, calc(100vw - 2rem)); }
#production-request-planning-workbench .production-request-planning-workbench-head .eyebrow { display: none; }
.planning-workspace-simple { min-width: 0; }
.planning-workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 8px; }
.planning-request-status { border-radius: 20px; background: #e9f5f2; color: #145e59; padding: 6px 12px; font-weight: 600; }
.planning-workspace-simple .production-request-planning-summary { margin: 0 0 14px; grid-template-columns: repeat(3,minmax(0,1fr)); border: 0; background: #f4f8f8; border-radius: 10px; }
.planning-workspace-tabs { position: static; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 0 0 16px; padding: 0 0 12px; overflow: visible; }
.planning-workspace-tabs button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; min-width: 0; min-height: 64px; padding: 10px 12px; border: 1px solid #d2e2e2; border-radius: 9px; background: #f8fafb; color: #435d66; font: inherit; cursor: pointer; text-align: start; overflow-wrap: anywhere; }
.planning-workspace-tabs button[aria-selected=true] { background: #e6f4f1; border-color: #12817b; color: #075f59; box-shadow: inset 0 -3px #12817b; }
.planning-workspace-tabs small { font-size: 12px; line-height: 1.5; }
.planning-workspace-tabs button:focus-visible, .planning-workspace-panel:focus-visible { outline: 3px solid #16948a; outline-offset: 2px; }
.planning-workspace-panel { min-width: 0; }
.planning-workspace-panel[hidden] { display: none !important; }
.planning-workspace-simple .planning-source-products { padding: 0; border: 0; }
.planning-workspace-simple .planning-handoff-product { padding: 12px 14px; margin-bottom: 10px; border: 1px solid #d7e4e5; border-radius: 10px; }
.planning-workspace-simple .planning-source-product { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 16px; }
.planning-workspace-simple .planning-source-product strong { display: block; line-height: 1.6; }
.planning-workspace-simple .planning-source-product small { display: block; color: var(--muted); padding-top: 3px; overflow-wrap: anywhere; }
.planning-workspace-simple .planning-source-product b { font-size: 1.1rem; color: #0d625d; white-space: nowrap; }
.planning-workspace-simple .planning-formula-state { display: inline-block; font-size: 12px; margin-top: 6px; color: #536d77; }
.planning-workspace-simple .planning-customer-requirements { border-top: 1px solid #e2ecec; margin: 10px 0 0; padding-top: 8px; }
.planning-workspace-simple .planning-customer-note { background: #fff8e7; border-left: 3px solid #d79b29; padding: 12px; border-radius: 6px; margin-bottom: 12px; }
.planning-customer-note p { margin: 6px 0 0; white-space: pre-wrap; }
.planning-handoff-origin { margin: 14px 0; }
.planning-handoff-origin summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: #42636c; }
.planning-workspace-simple .planning-formula-recovery { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border: 1px solid #e3d2aa; border-radius: 8px; margin: 8px 0; }
.planning-formula-recovery small { display: block; margin-top: 4px; color: #7d5b17; }
.planning-workspace-simple .planning-formula-recovery > div { min-width: 0; }
.planning-workspace-simple .planning-formula-recovery button { min-height: 44px; }
.planning-workspace-simple .production-request-planning-section { margin-top: 0; }
.planning-workspace-simple #planning-resolutions:empty { display: none; }
.planning-workspace-simple .production-request-planning-primary-action { gap: 14px; }
.planning-workspace-simple .production-request-planning-primary-action > div { min-width: 0; flex: 1; }
.planning-workspace-simple .production-request-planning-primary-action small { max-width: 65ch; }
.planning-workspace-simple .production-request-planning-primary-action button { min-height: 46px; }
@media (max-height:500px) and (min-width:761px) {
 #production-request-planning-workbench.production-request-planning-drawer .production-request-planning-workbench-head { padding-block: 8px; }
 .planning-workspace-heading { padding-block: 5px; }
 .planning-workspace-simple .production-request-planning-summary { margin-bottom: 6px; }
 .planning-workspace-simple .production-request-planning-summary > div { padding-block: 5px; }
 .planning-workspace-tabs { margin-bottom: 8px; padding-bottom: 6px; }
 .planning-workspace-tabs button { min-height: 44px; padding-block: 7px; }
 .planning-workspace-tabs small { display: none; }
 #production-request-planning-workbench .production-request-planning-primary-action { padding-block: 8px; }
}
@media (max-width:760px) {
 #production-request-planning-workbench.production-request-planning-drawer { width: 100%; }
 .planning-workspace-simple #planning-source.production-request-planning-summary { grid-template-columns: minmax(0,1fr) minmax(0,1fr); font-size: 13px; }
 .planning-workspace-simple .production-request-planning-summary > div:first-child { grid-column: 1 / -1; }
 .planning-workspace-tabs { gap: 5px; }
 .planning-workspace-tabs button { padding: 9px 6px; font-size: 12px; min-height: 82px; }
 .planning-workspace-tabs small { font-size: 11px; }
 .planning-workspace-simple .planning-source-product { grid-template-columns: minmax(0,1fr); gap: 4px; }
 .planning-workspace-simple .planning-source-product strong { -webkit-line-clamp: unset; }
 .planning-workspace-simple .planning-formula-recovery { flex-direction: column; align-items: stretch; }
 .planning-workspace-simple .production-request-planning-primary-action { flex-direction: column; align-items: stretch; gap: 8px; padding-bottom: max(14px,env(safe-area-inset-bottom)); }
 .planning-workspace-simple .production-request-planning-primary-action > div { display: none; }
 .planning-workspace-simple .production-request-planning-primary-action button { width: 100%; white-space: normal; }
 #production-request-planning-workbench .production-request-planning-workbench-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
 #production-request-planning-workbench .production-request-planning-workbench-head h3 { font-size: 14px; overflow-wrap: anywhere; }
 #production-request-planning-workbench .production-request-planning-workbench-actions button { min-height: 44px; padding: 8px 10px; }
}

/* Center content-sized Planning requests; keep long requests within the viewport. */
#production-request-planning-workbench.production-request-planning-drawer {
    inset: 0;
    margin: auto;
    height: fit-content;
    min-height: 0;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
}
#production-request-planning-workbench .planning-workspace-simple .production-request-planning-primary-action {
    margin-top: 12px;
    padding-block: 8px 10px;
    gap: 12px;
}
.planning-workspace-simple .production-request-planning-primary-action small {
    font-size: 14px;
    line-height: 1.5;
}
.planning-workspace-simple .production-request-planning-primary-action button {
    min-height: 44px;
    flex-shrink: 0;
}
@media (max-width:760px) {
    #production-request-planning-workbench.production-request-planning-drawer {
        max-height: 100vh;
        max-height: 100dvh;
    }
    #production-request-planning-workbench .planning-workspace-simple .production-request-planning-primary-action {
        padding-bottom: max(10px,env(safe-area-inset-bottom));
    }
}
/* Virtual packaging sets: compact, keyboard/touch friendly, scroll only the editor body. */
.pp-set-choice { background:#eef7f6; border:1px solid #cbe3e1; border-radius:12px; padding:16px; margin:0 0 16px; }
.pp-set-choice p { margin:8px 0 12px; }
.pp-packaging-entry { border:0; padding:0; margin:0; min-width:0; }
.pp-packaging-entry .pp-set-choice { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:12px 16px; }
.pp-packaging-entry .pp-set-choice p { flex:1 1 280px; margin:0; font-size:.9rem; }
.pp-packaging-entry .pp-set-choice .button { margin:0; }
.pset-library { max-width:860px; }
.pset-library .pp-body { padding:20px; }
.pset-library-search { display:grid; gap:8px; font-weight:600; }
.pset-library input { width:100%; min-width:0; min-height:46px; }
.pset-library .pset-list small { display:block; color:var(--muted); margin-top:4px; }
.pset-library .pp-head, .pset-dialog .pp-head > div { min-width:0; overflow-wrap:anywhere; }
@media(max-width:600px) { .pp-packaging-entry .pp-set-choice .button { width:100%; } .pset-library .pp-head { flex-wrap:wrap; gap:8px; } }
.pp-set-choice .button { margin:0 8px 8px 0; min-height:44px; }
.pset-dialog { max-width:1080px; }
.pset-dialog .pp-content { min-width:0; }
.pset-dialog input,.pset-dialog select { width:100%; min-width:0; min-height:44px; }
.pset-dialog .button { min-height:44px; white-space:normal; }
.pset-dialog .pp-search { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.pset-dialog .pp-search label { width:100%; }
.pset-dialog .pp-search input { flex:1 1 240px; }
.pset-list { display:grid; gap:8px; margin:12px 0; }
.pset-list .button { text-align:left; overflow-wrap:anywhere; padding:12px; }
.pset-components { padding-left:24px; }
.pset-components li { margin:12px 0; overflow-wrap:anywhere; }
.pset-count { display:block; margin-top:20px; font-weight:700; }
.pset-count input { display:block; margin-top:8px; max-width:260px; }
.pset-dialog td { vertical-align:top; }
.pset-dialog td small { display:block; margin:4px 0; }
.pset-dialog td:first-child { min-width:200px; }
.pset-dialog fieldset { min-width:0; border:0; margin:0; padding:0; }
@media(max-width:600px) { .pset-dialog .pp-head { gap:12px; flex-wrap:wrap; } .pset-dialog td:first-child { min-width:0; } .pset-dialog .pp-footer > div { width:100%; } .pset-dialog .pp-footer button { flex:1; } }
.pset-dialog .bom-material-table th:nth-child(1) { width:32%; }
.pset-dialog .bom-material-table th:nth-child(2) { width:20%; }
.pset-dialog .bom-material-table th:nth-child(3) { width:20%; }
.pset-dialog .bom-material-table th:nth-child(4) { width:16%; }
.pset-dialog .bom-material-table th:nth-child(5) { width:12%; }
@media(max-width:600px) {
 .pset-dialog .bom-material-table td:nth-child(2):before { display:block; }
 .pset-dialog .bom-material-table td:nth-child(2) input { max-width:none; }
 .pset-dialog .bom-material-table td:nth-child(1),
 .pset-dialog .bom-material-table td:nth-child(2) { width:100%; }
}

/* Packaging parts: roles follow the source specification, not finished goods. */
.pset-role-buttons { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.pset-role-buttons .button[aria-pressed="true"] { background:var(--primary,#0f766e); color:#fff; border-color:var(--primary,#0f766e); box-shadow:inset 0 -3px 0 rgba(0,0,0,.15); }
.pset-picker-hint,.pset-picker-context { font-size:14px; line-height:1.6; }
.pset-picker-context { background:#eef8f7; border-left:3px solid #0f766e; padding:10px 12px; }
.pset-picker-context span,.pset-dialog .pset-list small,.pset-components small { display:block; color:var(--muted); margin-top:4px; }
.pset-dialog .pset-list .button { display:grid; gap:4px; }
.pset-dialog .pset-list .button > span { color:#0f766e; font-size:13px; }
@media(max-width:600px){ .pset-role-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } .pset-role-buttons .button { min-width:0; padding:8px; } }

/* Company-owned set library: start from sets, then edit individual components. */
.pset-list-toolbar { display:flex; justify-content:flex-end; margin-bottom:16px; }
.pset-list-toolbar [data-ps="new"], .pset-dialog [data-ps="save"], .pset-dialog [data-ps="use"] { background:#0f766e; color:#fff; border-color:#0f766e; }
.pset-list-card { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:16px; border:1px solid var(--line); border-radius:10px; }
.pset-list-card > div:first-child { flex:1; min-width:0; overflow-wrap:anywhere; }
.pset-card-actions { display:flex; gap:8px; flex-wrap:wrap; }
.pset-dialog [data-ps="deleteSet"], .pset-dialog [data-ps="discardDraft"] { color:#a52828; border-color:#ebcece; }
.pset-drafts > .pset-card-actions { max-width:100%; }
.pset-drafts .button { white-space:normal; overflow-wrap:anywhere; }
.pset-drafts { display:flex; gap:8px; flex-wrap:wrap; padding:14px; background:#eef8f7; border-radius:10px; }
.pset-drafts > strong { flex-basis:100%; }
.pset-company { display:block; margin-bottom:16px; }
.pset-dialog .pp-search > label { flex:1 1 220px; width:auto; }
.pset-dialog .pp-search { align-items:end; }
.pset-dialog .pset-empty-part { background:#f7faf9; }
.pset-dialog .pset-empty-part td { vertical-align:middle; padding:12px; }
.pset-dialog .pset-empty-part .button { color:#0f766e; }
.pset-dialog .bom-material-table { margin:16px 0; }
.pset-version { margin:12px 0; color:var(--muted); }
@media(max-width:600px) {
 .pset-list-card { flex-direction:column; align-items:stretch; padding:12px; }
 .pset-card-actions .button { flex:1; justify-content:center; }
 .pset-dialog .pset-empty-part td:nth-child(2):before { display:none; }
 .pset-dialog .pset-empty-part td { padding:8px 12px; }
 .pset-list-toolbar .button { width:100%; }
}

.pset-dialog .bom-quantity-basis { padding:12px 14px; margin:12px 0 16px; font-size:14px; line-height:1.6; }
.pset-dialog .bom-quantity-basis strong { display:block; margin-bottom:4px; }
.pset-dialog .bom-quantity-basis br { display:none; }

@media(max-width:600px) {
 .pset-dialog .bom-material-table .pset-empty-part { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 10px; }
 .pset-dialog .bom-material-table .pset-empty-part td { width:auto; padding:0; }
 .pset-dialog .bom-material-table .pset-empty-part .button { margin:0; }
}
