*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #797979;
    background: #f9fafb;
}

body.login-page {
    background: linear-gradient(135deg, #eef7fb 0%, #f9fafb 45%, #eaf2ff 100%);
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.layout {
    display: flex;
    height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: #FFFFFF;
    color: #797979;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

.paste-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #99a6ab;
}

.preview-delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #e0544a;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    display: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.preview-delete-btn:hover {
    background: #c9443a;
}

.inline-fields-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eef0f4;
    flex-shrink: 0;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 800;
    color: #24739f;
    letter-spacing: 3px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-nav ul ul {
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    margin: 2px 12px;
    color: #797979;
    font-size: 14px;
    border-radius: 10px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.nav-item:hover {
    background: #f0f9ff;
    color: #24739f;
}

.nav-item.active {
    background: #ebf9ff;
    color: #24739f;
    font-weight: 600;
}

.bom-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tag-bom-草稿 {
    background: #fef3c7;
    color: #b7791f;
}

.tag-bom-量产 {
    background: #dcfce7;
    color: #15803d;
}

.tag-bom-作废 {
    background: #fee2e2;
    color: #b91c1c;
}

.bom-page-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    min-height: 0;
}

.bom-header-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.bom-header-main h2 {
    font-size: 24px;
    color: #4b5563;
}

.bom-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bom-summary-card {
    padding: 18px 20px;
    border: 1px solid #e8edf3;
    border-radius: 18px;
    background: #fbfdff;
}

.bom-summary-grid {
    display: grid;
    grid-template-columns: 120px 1.2fr 110px 110px 110px 1.6fr;
    gap: 12px;
    align-items: end;
}

.bom-summary-card {
    padding: 12px 16px;
}

.bom-summary-card .form-group {
    margin-bottom: 0;
}

.bom-summary-card .form-group label {
    white-space: nowrap;
}

.bom-summary-remark-field {
    min-width: 220px;
}

.bom-empty-state {
    display: block;
}

.bom-empty-card {
    border: 1px dashed #cfe3f5;
    border-radius: 18px;
    padding: 48px 24px;
    text-align: center;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.bom-empty-card h3 {
    color: #4b5563;
    margin-bottom: 10px;
}

.bom-empty-card p {
    color: #9ca3af;
}

.bom-empty-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.bom-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.bom-panel {
    border: 1px solid #e8edf3;
    border-radius: 18px;
    background: #fff;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.bom-panel-head {
    padding: 16px 18px;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.bom-panel-head h3 {
    color: #4b5563;
    font-size: 16px;
}

.bom-tree-toolbar,
.bom-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bom-zoom-btn {
    min-width: 54px;
}

.bom-tree-body {
    padding: 16px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    cursor: grab;
    user-select: none;
}

.bom-tree-body.is-panning {
    cursor: grabbing;
}

.bom-tree-canvas {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    width: max-content;
    transform-origin: top left;
    will-change: transform;
}

.bom-tree-root-wrap {
    display: flex;
    justify-content: center;
}

.bom-tree-children {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    padding-top: 18px;
    flex-wrap: nowrap;
}

.bom-tree-branch {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    flex: 0 0 auto;
}

.bom-tree-connector {
    position: absolute;
    top: -18px;
    left: 50%;
    width: 0;
    height: 18px;
    border-left: 2px solid #d7e4f1;
    transform: translateX(-50%);
}

.bom-tree-empty-inline {
    margin-top: 8px;
}

.bom-material-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #dfe9f4;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 6px 18px rgba(36, 115, 159, 0.06);
    cursor: pointer;
}

.bom-tree-branch > .bom-tree-children::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 60px);
    min-width: 40px;
    border-top: 2px solid #d7e4f1;
}

.bom-material-card.root {
    cursor: default;
    border-color: #b9d8f0;
    background: linear-gradient(180deg, #fafdff 0%, #eef7ff 100%);
}

.bom-material-card.selected {
    border-color: #76b6e5;
    box-shadow: 0 0 0 3px rgba(118, 182, 229, 0.18), 0 12px 28px rgba(36, 115, 159, 0.12);
}

.bom-material-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bom-material-card-row.row-2 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bom-material-name {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.bom-material-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e9f5ff;
    color: #24739f;
    font-size: 12px;
    font-weight: 600;
}

.bom-material-card-badge.raw {
    background: #fff6db;
    color: #b7791f;
}

.bom-material-card-badge.semi-finished {
    background: #e8f2ff;
    color: #2563eb;
}

.bom-material-card-badge.finished {
    background: #dcfce7;
    color: #15803d;
}

.bom-material-card-badge.process {
    background: #fde7f3;
    color: #be185d;
}

.bom-material-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-mini {
    border: 1px solid #d6e2ee;
    background: #fff;
    color: #607286;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.btn-mini.danger {
    color: #b91c1c;
    border-color: #fecaca;
}

.bom-material-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #607286;
    font-size: 12px;
}

.bom-meta-code,
.bom-meta-qty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f3f7fb;
}

.bom-meta-qty-value {
    color: #4b5563;
    font-weight: 600;
}

.bom-meta-qty-unit {
    color: #607286;
}

.bom-meta-code.primary {
    background: #eef6ff;
    color: #24739f;
    font-weight: 600;
}

.bom-field {
    min-width: 0;
}

.bom-field.compact {
    padding: 0;
    border: none;
    background: transparent;
}

.bom-material-card-foot {
    color: #8a99a8;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bom-spec-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bom-spec-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef6ff;
    color: #24739f;
    font-size: 11px;
    font-weight: 600;
}

.bom-spec-chip.is-empty {
    background: #f3f4f6;
    color: #9ca3af;
}

.bom-node-spec-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bom-node-spec-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    align-items: center;
}

.bom-node-spec-name {
    color: #607286;
    font-size: 13px;
}

.bom-table-wrap {
    overflow: auto;
    padding: 0;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.bom-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 0;
    font-size: 12px;
    table-layout: fixed;
}

.bom-table th,
.bom-table td {
    text-align: center;
    vertical-align: middle;
    border: 1px solid #d0d8e4;
    padding: 2px 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    box-sizing: border-box;
}

.bom-table thead th {
    background: #eef2f7;
    color: #3d4a5c;
    font-weight: 600;
    font-size: 11px;
    padding: 4px 3px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 2px solid #c5cedb;
}

.bom-table tbody tr:hover td {
    background: #f7f9fc;
}

.bom-table tbody tr.selected td {
    background: #edf5fe;
}

.bom-table td.cell-num {
    font-variant-numeric: tabular-nums;
}

.bom-table .cell-empty {
    text-align: center;
    padding: 32px;
    color: #9ca3af;
}

.bom-excel-input {
    width: 100%;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    padding: 1px 2px;
    background: transparent;
    text-align: center;
    font-size: 12px;
    color: #4b5563;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
}

.bom-excel-input:hover {
    border-color: #b8c4d4;
    background: #fff;
}

.bom-excel-input:focus {
    border-color: #24739f;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(36,115,159,0.12);
}

.bom-cell-specs {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bom-table th:first-child,
.bom-table td:first-child,
.bom-table th:last-child,
.bom-table td:last-child,
.bom-table thead th:first-child,
.bom-table thead th:last-child {
    position: static;
    background: none;
    z-index: auto;
}

.bom-table tbody tr:hover td:first-child,
.bom-table tbody tr:hover td:last-child {
    background: none;
}

.col-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
}

.col-resize-handle:hover,
.col-resize-handle:active {
    background: rgba(36, 115, 159, 0.25);
}

body.col-resizing {
    user-select: none;
    cursor: col-resize;
}

body.col-resizing .bom-table th,
body.col-resizing .bom-table td {
    user-select: none;
}

.bom-picker-modal-card {
    max-width: 900px;
}

.bom-picker-search-bar {
    margin-bottom: 14px;
}

.bom-picker-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.bom-picker-toolbar .compact {
    margin-bottom: 0;
    flex: 1;
}

.bom-picker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow: auto;
}

.bom-picker-item {
    width: 100%;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    background: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.bom-picker-item:hover {
    border-color: #8ec5ef;
    background: #f8fbff;
}

.bom-picker-item-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    color: #4b5563;
}

.bom-picker-item-main span {
    color: #9ca3af;
    font-size: 12px;
}

.bom-picker-item-side {
    color: #24739f;
    font-weight: 600;
}

.bom-match-spec-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.archive-list-wrap {
    border: 1px solid #eef0f4;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.archive-list {
    display: grid;
    grid-template-columns: 104px minmax(0, 1.35fr) 84px 84px 88px minmax(0, 1.1fr) 136px 92px;
    align-items: center;
}

.archive-list-head {
    background: #f9fafb;
    border-bottom: 1px solid #eef0f4;
}

.archive-list-row {
    border-bottom: 1px solid #f2f4f7;
}

.archive-list-row:last-child {
    border-bottom: none;
}

.archive-list-cell {
    min-width: 0;
    padding: 9px 8px;
    text-align: center;
    color: #797979;
    font-size: 13px;
}

.archive-list-head .archive-list-cell {
    font-size: 12px;
    font-weight: 600;
    color: #a0a4ab;
    white-space: nowrap;
}

.archive-list-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-list-actions {
    display: flex;
    justify-content: center;
}

.archive-list-actions .btn-detail {
    min-width: 70px;
    padding: 0 8px;
}

.archive-list-empty {
    padding: 32px 12px;
    text-align: center;
    color: #9ca3af;
}

.contract-list-wrap {
    border: 1px solid #eef0f4;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.contract-list {
    display: grid;
    grid-template-columns: 104px minmax(0, 1.25fr) 88px 82px 82px minmax(0, 1.2fr) 88px 76px 116px 96px 106px;
    align-items: center;
}

.contract-list-head {
    background: #f9fafb;
    border-bottom: 1px solid #eef0f4;
}

.contract-list-row {
    border-bottom: 1px solid #f2f4f7;
}

.contract-list-row:last-child {
    border-bottom: none;
}

.contract-list-cell {
    min-width: 0;
    padding: 9px 8px;
    text-align: center;
    color: #797979;
    font-size: 13px;
}

.contract-list-head .contract-list-cell {
    font-size: 12px;
    font-weight: 600;
    color: #a0a4ab;
    white-space: nowrap;
}

.contract-list-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contract-list-num {
    font-variant-numeric: tabular-nums;
}

.contract-list-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.contract-list-actions .btn-detail,
.contract-list-actions .btn-more {
    min-width: 44px;
    padding: 0 6px;
}

.contract-list-empty {
    padding: 32px 12px;
    text-align: center;
    color: #9ca3af;
}

.contract-detail-tabbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f4;
}

.contract-detail-tab {
    border: 1px solid #d9e2ec;
    background: #f8fafc;
    color: #6b7280;
    border-radius: 999px;
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.contract-detail-tab.active {
    background: #24739f;
    border-color: #24739f;
    color: #fff;
}

.contract-detail-panel {
    display: none;
}

.contract-detail-panel.active {
    display: block;
}

.contract-review-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 12px;
}

.contract-review-card {
    width: 100%;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid transparent;
}

.contract-review-card-draft {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.contract-review-card-title {
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.contract-review-card-meta {
    color: #9ca3af;
    font-size: 12px;
}

.contract-review-card-pass {
    background: #edf9f1;
    border-color: #b7e4c7;
}

.contract-review-card-reject {
    background: #fef2f2;
    border-color: #fecaca;
}

.contract-review-card-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    color: #4b5563;
    font-size: 13px;
}

.contract-review-card-row + .contract-review-card-row {
    margin-top: 8px;
}

.contract-review-card-row span {
    color: #6b7280;
}

.contract-review-card-row strong {
    color: #374151;
    font-weight: 600;
    word-break: break-all;
}

.contract-review-empty {
    width: 100%;
    text-align: center;
    color: #9ca3af;
    padding: 24px 12px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #fff;
}

.prep-page-card {
    padding-bottom: 20px;
}

.prep-list-wrap {
    border: 1px solid #eef0f4;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.prep-list {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 180px 120px 130px 150px;
    align-items: stretch;
}

.prep-list-head {
    background: #f9fafb;
    border-bottom: 1px solid #eef0f4;
}

.prep-list-row {
    border-bottom: 1px solid #f2f4f7;
}

.prep-row-group:last-child .prep-list-row {
    border-bottom: none;
}

.prep-list-cell {
    min-width: 0;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #797979;
    font-size: 13px;
}

.prep-list-head .prep-list-cell {
    color: #a0a4ab;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.prep-list-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prep-list-actions {
    gap: 8px;
}

.prep-inner-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    background: #fbfdff;
}

.prep-inner-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.prep-inner-table th,
.prep-inner-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #eef2f7;
    text-align: center;
    color: #5b6472;
    font-size: 12px;
    white-space: nowrap;
}

.prep-inner-table th {
    color: #8b95a3;
    font-weight: 600;
    background: #f8fafc;
}

.prep-inner-table tbody tr:last-child td {
    border-bottom: none;
}

.prep-merged-cell {
    vertical-align: middle;
    text-align: center;
    font-weight: 600;
    color: #4b5563 !important;
    background: #fcfdff;
}

.prep-num {
    font-variant-numeric: tabular-nums;
}

.prep-stock-ok {
    color: #15803d !important;
    font-weight: 600;
}

.prep-stock-low {
    color: #dc2626 !important;
    font-weight: 600;
}

.prep-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.prep-status-ok {
    background: #e8f7ee;
    color: #15803d;
}

.prep-status-low {
    background: #feeceb;
    color: #dc2626;
}

.prep-bom-expand {
    border-bottom: 1px solid #f2f4f7;
    background: #ffffff;
    padding: 14px 16px 16px;
}

.prep-bom-title,
.prep-detail-title {
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.prep-detail-expand {
    border-bottom: 1px solid #f2f4f7;
    background: #ffffff;
    padding: 14px 16px 16px;
}

.prep-ship-qty-input {
    min-width: 90px;
    text-align: center;
}

.prep-bom-period-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f4;
}

.prep-bom-period-tab {
    border: 1px solid #d9e2ec;
    background: #f8fafc;
    color: #6b7280;
    border-radius: 999px;
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.prep-bom-period-tab.active {
    background: #24739f;
    border-color: #24739f;
    color: #fff;
}

.prep-bom-period-panel {
    display: none;
}

.prep-bom-period-panel.active {
    display: block;
}

.prep-bom-group + .prep-bom-group {
    margin-top: 16px;
}

.prep-bom-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e7edf4;
    border-radius: 12px 12px 0 0;
    background: #f8fbfe;
    color: #5b6472;
    font-size: 12px;
}

.prep-bom-group-head strong {
    display: block;
    color: #374151;
    font-size: 13px;
}

.prep-bom-group-head span {
    color: #8b95a3;
}

.prep-bom-empty {
    padding: 28px 12px;
    text-align: center;
    color: #9ca3af;
    border: 1px dashed #d7dee7;
    border-radius: 12px;
}

.prep-list-empty {
    padding: 36px 12px;
    text-align: center;
    color: #9ca3af;
}

.sd-status-tabbar {
    width: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid #e8edf3;
    border-radius: 16px;
    padding: 8px 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.sd-status-tabbar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 34px;
}

.sd-status-tab {
    position: relative;
    border: 1px solid transparent;
    background: transparent;
    color: #6b7280;
    border-radius: 999px;
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.22s ease;
}

.sd-status-tab:hover {
    background: rgba(36, 115, 159, 0.07);
    color: #24739f;
}

.sd-status-tab.active {
    background: linear-gradient(135deg, #24739f 0%, #2f8fbd 100%);
    color: #fff;
    border-color: rgba(36, 115, 159, 0.2);
    box-shadow: 0 8px 18px rgba(36, 115, 159, 0.22);
}

.sd-status-tab.active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 5px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
}

.wms-top-tabs {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid #e7edf5;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
    margin-bottom: 12px;
    box-sizing: border-box;
}

.wms-top-tab {
    text-decoration: none;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    padding: 10px 16px;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
}

.wms-top-tab:hover {
    color: #24739f;
    background: rgba(36, 115, 159, 0.07);
}

.wms-top-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #24739f 0%, #2f8fbd 100%);
    box-shadow: 0 8px 18px rgba(36, 115, 159, 0.2);
}

.wms-page-card {
    padding-top: 18px;
}

.wms-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    min-height: 0;
    flex: 1;
}

.wms-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #edf1f6;
    border-radius: 18px;
    background: linear-gradient(180deg, #fcfdff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    overflow: hidden;
}

.wms-column-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #edf1f6;
}

.wms-column-head h3 {
    font-size: 16px;
    font-weight: 700;
    color: #2f3a4a;
    margin: 0 0 4px;
}

.wms-column-head p {
    margin: 0;
    font-size: 12px;
    color: #98a2b3;
}

.wms-card-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    min-height: 0;
}

.wms-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e8edf3;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.wms-card-warehouse,
.wms-card-area {
    cursor: pointer;
}

.wms-card:hover {
    border-color: rgba(36, 115, 159, 0.24);
    box-shadow: 0 10px 22px rgba(36, 115, 159, 0.08);
    transform: translateY(-1px);
}

.wms-card.selected {
    border-color: #24739f;
    background: linear-gradient(180deg, rgba(36, 115, 159, 0.08) 0%, rgba(255, 255, 255, 0.96) 100%);
    box-shadow: 0 12px 24px rgba(36, 115, 159, 0.12);
}

.wms-card-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wms-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wms-card-meta {
    font-size: 12px;
    color: #8a94a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wms-card-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wms-stat-chip {
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef5fb;
    color: #24739f;
    font-size: 12px;
    font-weight: 700;
}

.wms-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.wms-card-actions .btn-detail,
.wms-card-actions .btn-light {
    min-width: 52px;
    height: 28px;
    padding: 0 10px;
}

.wms-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wms-status-dot.is-free {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.wms-status-dot.is-busy {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.wms-empty {
    min-height: 120px;
    border: 1px dashed #dbe4ee;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #9aa4b2;
    font-size: 13px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.68);
}

.wms-empty.inside {
    min-height: 160px;
}

.wms-multi-select {
    min-height: 112px;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.wms-goods-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
}

.wms-goods-item {
    border: 1px solid #e8edf3;
    border-radius: 14px;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.wms-goods-item span {
    display: block;
    font-size: 12px;
    color: #98a2b3;
    margin-bottom: 4px;
}

.wms-goods-item strong {
    display: block;
    font-size: 13px;
    color: #334155;
    font-weight: 600;
    word-break: break-all;
}

.wms-placeholder-card {
    padding-top: 22px;
}

.wms-task-page {
    gap: 0;
}

.wms-task-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.wms-task-inner-tabs {
    margin: 0 0 12px;
}

.wms-task-tab {
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #e7edf5;
    background: #f8fbff;
    color: #7b8794;
    font-size: 13px;
    font-weight: 600;
}

.wms-task-tab.active {
    background: linear-gradient(135deg, #24739f 0%, #2f8fbd 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(36, 115, 159, 0.18);
}

.wms-task-tab:disabled {
    opacity: 0.7;
}

.wms-task-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.wms-task-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #2f3a4a;
}

.wms-task-head p {
    margin: 0;
    font-size: 12px;
    color: #98a2b3;
}

.wms-task-list-wrap {
    border: 1px solid #edf1f6;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #fcfdff 0%, #f8fbff 100%);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.wms-task-list-wrap-outbound {
    overflow-x: auto;
}

.wms-task-list-wrap-outbound .wms-task-list-body {
    overflow-x: visible;
}

.wms-task-list {
    display: grid;
    grid-template-columns: 132px 78px 150px 140px 152px minmax(180px, 1fr) 92px 132px 96px;
    align-items: stretch;
    gap: 10px;
}

.wms-task-list > div {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wms-task-list-outbound {
    grid-template-columns: 132px 92px 144px 160px 92px 122px minmax(220px, 1.2fr) 152px minmax(160px, 1fr) 96px 152px 124px;
    min-width: 1760px;
}

.wms-task-list-head {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #edf1f6;
    font-size: 12px;
    color: #9aa4b2;
    font-weight: 700;
}

.wms-task-list-body {
    overflow: auto;
    min-height: 0;
}

.wms-task-list-row {
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f6;
    background: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    color: #5b6472;
}

.wms-task-list-row:hover {
    background: rgba(36, 115, 159, 0.04);
}

.wms-task-row-group {
    border-bottom: 1px solid #eef2f6;
}

.wms-task-row-group:last-child {
    border-bottom: none;
}

.wms-task-list-row {
    border-bottom: none;
}

.wms-task-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: visible;
}

.wms-task-expand {
    margin: 0 16px 14px;
    padding: 12px;
    border: 1px solid #e5edf5;
    border-radius: 14px;
    background: #f8fbff;
}

.wms-task-expand-title {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #526071;
}

.wms-task-expand-table-wrap {
    overflow: auto;
}

.wms-task-expand-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.wms-task-expand-table th,
.wms-task-expand-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e8eef5;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
    color: #5b6472;
}

.wms-task-expand-table th {
    background: #f2f7fd;
    color: #8b98a8;
    font-weight: 700;
}

.wms-task-expand-table tr:last-child td {
    border-bottom: none;
}

.wms-inbound-execute-table .bom-excel-input {
    min-width: 110px;
}

.wms-inline-head-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wms-storage-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.wms-storage-picker-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #526071;
}

.wms-storage-picker-list {
    min-height: 320px;
    max-height: 420px;
    overflow: auto;
    border: 1px solid #e5edf5;
    border-radius: 14px;
    background: #fbfdff;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wms-storage-picker-item {
    border: 1px solid #e5edf5;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    color: #526071;
    cursor: pointer;
    font-family: inherit;
}

.wms-storage-picker-item.active {
    border-color: #24739f;
    background: #eef8fb;
    color: #24739f;
}

.wms-task-detail-wrap {
    border: 1px solid #edf1f6;
    border-radius: 14px;
    overflow: auto;
}

.wms-task-detail-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    table-layout: fixed;
}

.wms-task-detail-table th,
.wms-task-detail-table td {
    text-align: center;
    vertical-align: middle;
    padding: 8px;
    border-bottom: 1px solid #eef2f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wms-task-detail-table th {
    background: #f8fafc;
    font-size: 12px;
    color: #9aa4b2;
    font-weight: 700;
}

.wms-task-detail-table tr:last-child td {
    border-bottom: none;
}

.wms-task-detail-table .readonly-picker-row .btn-light {
    min-width: 52px;
}

.wms-task-detail-table-outbound-create {
    min-width: 1240px;
}

.wms-task-qty-editor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 144px;
}

.wms-task-qty-editor input {
    width: 84px;
    min-width: 84px;
    text-align: right;
}

.wms-task-qty-stock {
    color: #8b98a8;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wms-task-action-stack {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.wms-inline-note {
    padding: 2px 0;
    color: #526071;
    font-size: 13px;
    line-height: 1.6;
}

.wms-inventory-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.wms-inventory-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #2f3a4a;
}

.wms-inventory-head p {
    margin: 0;
    font-size: 12px;
    color: #98a2b3;
}

.wms-inventory-wrap {
    border: 1px solid #edf1f6;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #fcfdff 0%, #f8fbff 100%);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.wms-inventory-grid {
    display: grid;
    grid-template-columns: 64px 146px 76px minmax(220px, 1.4fr) 90px 96px 76px 150px minmax(120px, 1fr);
    align-items: center;
    gap: 10px;
}

.wms-inventory-grid-head {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #edf1f6;
    font-size: 12px;
    color: #9aa4b2;
    font-weight: 700;
}

.wms-inventory-body {
    overflow: auto;
    min-height: 0;
}

.wms-inventory-row {
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f6;
    background: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    color: #5b6472;
}

.wms-inventory-row:hover {
    background: rgba(36, 115, 159, 0.04);
}

.wms-inventory-row:last-child {
    border-bottom: none;
}

.wms-inventory-thumb {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.wms-inventory-thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #9aa4b2;
    background: #f8fafc;
}

.wms-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wms-num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

@media (max-width: 1380px) {
    .wms-board {
        grid-template-columns: 1fr;
    }

    .wms-inventory-wrap {
        overflow-x: auto;
    }

    .wms-inventory-grid {
        min-width: 1080px;
    }

    .wms-task-list-wrap {
        overflow-x: auto;
    }

    .wms-task-list {
        min-width: 1220px;
    }

    .wms-task-list-outbound {
        min-width: 1760px;
    }
}

@media (max-width: 1280px) {
    .archive-list-wrap {
        overflow-x: auto;
    }

    .archive-list {
        min-width: 860px;
    }

    .contract-list-wrap {
        overflow-x: auto;
    }

    .contract-list {
        min-width: 1030px;
    }
}

@media (max-width: 1280px) {
    .bom-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bom-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .bom-header-bar {
        flex-direction: column;
    }

    .bom-header-actions {
        justify-content: flex-start;
    }

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

    .bom-tree-node {
        flex-direction: column;
        align-items: flex-start;
    }

    .bom-material-card,
    .bom-material-card.root {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .bom-material-card-row,
    .bom-material-card-row.row-2,
    .bom-material-card-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .bom-node-spec-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .bom-tree-children {
        justify-content: flex-start;
        padding-top: 14px;
    }
}

.nav-parent {
    cursor: pointer;
    justify-content: space-between;
}

.nav-parent .arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
    color: #c0c4cc;
}

.nav-parent.expanded .arrow {
    transform: rotate(90deg);
}

.subnav {
    max-height: 0;
    transition: max-height 0.3s ease;
    background: #f9fafb;
    border-radius: 10px;
    margin: 0 12px;
}

.subnav.show {
    max-height: 500px;
}

.subnav .nav-item {
    padding-left: 34px;
    font-size: 13px;
    margin: 1px 0;
}

.sidebar.collapsed .sidebar-nav .nav-item span,
.sidebar.collapsed .sidebar-nav .nav-parent .arrow {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-item {
    justify-content: center;
    padding: 10px;
    margin: 2px 8px;
}

.sidebar.collapsed .subnav {
    display: none;
}

/* ===== Main ===== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ===== Header ===== */
.header {
    height: 60px;
    min-height: 60px;
    background: #FFFFFF;
    border-bottom: 1px solid #eef0f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #c0c4cc;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.sidebar-toggle:hover {
    background: #f0f9ff;
    color: #24739f;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: #797979;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-btn {
    position: relative;
    cursor: pointer;
    color: #c0c4cc;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 8px;
}

.notification-btn:hover {
    color: #797979;
    background: #f0f9ff;
}

.badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #FF9C4E;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.avatar {
    cursor: pointer;
    color: #c0c4cc;
    display: flex;
    align-items: center;
    border-radius: 50%;
    overflow: hidden;
}

.avatar:hover {
    color: #797979;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 12px;
}

.user-menu-trigger:hover {
    background: #f0f9ff;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.user-name {
    color: #797979;
    font-weight: 600;
}

.user-role {
    color: #b0b4ba;
    font-size: 12px;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
    min-width: 160px;
    padding: 8px;
    display: none;
    z-index: 30;
}

.user-menu.open .user-menu-dropdown {
    display: block;
}

.user-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #797979;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}

.user-menu-item:hover {
    background: #f0f9ff;
    color: #24739f;
}

.user-menu-item.danger:hover {
    background: #fff1f0;
    color: #d14343;
}

.modal-card-compact {
    max-width: 560px;
}

.modal-card-wide {
    width: 1600px;
    max-width: calc(100vw - 32px);
}

.modal-card-spec-basic {
    width: 560px;
    max-width: calc(100vw - 32px);
}

/* ===== Content ===== */
.content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.welcome-card {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    padding: 48px 64px;
    box-shadow: 0 2px 12px rgba(36,115,159,0.12);
}

.welcome-card h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #797979;
}

.welcome-card p {
    color: #a0a4ab;
    font-size: 15px;
}

.section-title {
    color: #797979;
    font-size: 18px;
    margin-bottom: 6px;
}

.section-desc {
    color: #a0a4ab;
    font-size: 13px;
}

.hr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-panel {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(232, 236, 240, 0.9);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(36, 115, 159, 0.12);
    padding: 36px;
}

.login-brand {
    margin-bottom: 28px;
}

.login-brand h1 {
    color: #24739f;
    font-size: 34px;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.login-brand p {
    color: #a0a4ab;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-field label {
    color: #797979;
    font-weight: 600;
}

.login-field input {
    width: 100%;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    background: #f8fafc;
    color: #797979;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input:focus {
    border-color: #24739f;
    box-shadow: 0 0 0 3px rgba(36, 115, 159, 0.12);
}

.login-error {
    color: #d14343;
    background: #fff1f0;
    border: 1px solid #ffd1cc;
    border-radius: 10px;
    padding: 10px 12px;
}

.login-submit {
    border: none;
    border-radius: 12px;
    background: #24739f;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
}

.login-submit:hover {
    background: #1d5e82;
}

/* ===== Scrollbar ===== */
.sidebar-nav::-webkit-scrollbar,
.content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #e0e2e6;
    border-radius: 3px;
}

.content::-webkit-scrollbar-thumb {
    background: #e0e2e6;
    border-radius: 3px;
}

/* ===== CRM Customer Page ===== */
.page-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px 0;
    box-shadow: 0 2px 12px rgba(36,115,159,0.08);
}

.search-form {
    flex-shrink: 0;
    margin-bottom: 14px;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 0 0 0 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    width: 360px;
    height: 36px;
}

.search-bar:focus-within {
    border-color: #24739f;
    box-shadow: 0 0 0 3px rgba(36,115,159,0.12);
}

.search-icon {
    color: #c0c4cc;
    flex-shrink: 0;
    display: flex;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 13px;
    color: #797979;
    outline: none;
    height: 100%;
}

.search-bar input::placeholder {
    color: #b0b4ba;
}

.btn-search {
    background: #24739f;
    color: #FFFFFF;
    border: none;
    border-radius: 7px;
    padding: 0 18px;
    height: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
    margin-right: 3px;
}

.btn-search:hover {
    background: #1d5e82;
}

.btn-search:active {
    transform: scale(0.97);
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-item label {
    font-size: 13px;
    color: #a0a4ab;
    white-space: nowrap;
}

/* ===== Custom Select (animated dropdown) ===== */
.custom-select {
    position: relative;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 13px;
    color: #797979;
    cursor: pointer;
    min-width: 100px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select-trigger:hover {
    border-color: #cdd0d6;
}

.custom-select.open .custom-select-trigger {
    border-color: #24739f;
    box-shadow: 0 0 0 3px rgba(36,115,159,0.12);
}

.custom-select-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-trigger .arrow {
    color: #c0c4cc;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.custom-select.open .custom-select-trigger .arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 140px;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
}

.custom-select.open .custom-select-dropdown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.custom-select-option {
    padding: 8px 12px;
    font-size: 13px;
    color: #797979;
    cursor: pointer;
    transition: background 0.12s;
}

.custom-select-option:hover {
    background: #f0f9ff;
    color: #24739f;
}

.custom-select-option.selected {
    background: #ebf9ff;
    color: #24739f;
    font-weight: 500;
}

/* ===== Native Select (for pagination, etc.) ===== */
.select-wrap {
    position: relative;
}

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 6px 30px 6px 10px;
    font-size: 13px;
    color: #797979;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 100px;
}

.select-wrap select:hover {
    border-color: #cdd0d6;
}

.select-wrap select:focus {
    border-color: #24739f;
    box-shadow: 0 0 0 3px rgba(36,115,159,0.12);
    outline: none;
}

.select-wrap::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #c0c4cc;
    pointer-events: none;
}

.btn-reset {
    font-size: 13px;
    color: #24739f;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

.btn-reset:hover {
    background: #ebf9ff;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 12px;
}

#tableSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.btn-add {
    background: #24739f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.3px;
}

.btn-add:hover {
    background: #1d5e82;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 12px 0;
}

.table-count {
    font-size: 13px;
    color: #a0a4ab;
}

.table-wrap {
    flex: 1;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid #eef0f4;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 3200px;
}

.data-table thead {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table thead::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: #eef0f4;
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #a0a4ab;
    white-space: nowrap;
    border-bottom: 1px solid #eef0f4;
    letter-spacing: 0.3px;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f2f4f7;
    color: #797979;
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background 0.12s;
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Sticky Columns ===== */
.data-table th:first-child,
.data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
}

.data-table th:last-child,
.data-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff;
}

.data-table thead th:first-child,
.data-table thead th:last-child {
    background: #f9fafb;
    z-index: 5;
}

.data-table tbody tr:hover td:first-child,
.data-table tbody tr:hover td:last-child {
    background: #f8fbff;
}

.checkbox-cell {
    text-align: center;
    width: 40px;
    min-width: 40px;
}

.checkbox-cell input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #24739f;
}

.actions-cell {
    text-align: center;
    min-width: 140px;
}

.user-table-wrap {
    overflow-x: hidden;
}

.user-table {
    min-width: 0;
}

.user-table th:first-child,
.user-table td:first-child,
.user-table th:last-child,
.user-table td:last-child {
    position: static;
    background: inherit;
}

.user-table .actions-cell {
    width: 110px;
    min-width: 110px;
    padding-left: 8px;
    padding-right: 8px;
}

.user-table .btn-detail,
.user-table .btn-more {
    padding: 0 4px;
}

.mdm-card {
    padding: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, #ffffff 18%, #ffffff 100%);
}

.mdm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(241, 250, 247, 0.7), rgba(237, 247, 255, 0.65));
    border-bottom: 1px solid #eef4f5;
}

.mdm-accent-mint .mdm-topbar {
    background: linear-gradient(135deg, #f0fbf7, #eef8ff);
}

.mdm-accent-sky .mdm-topbar {
    background: linear-gradient(135deg, #eef8ff, #f4fbff);
}

.mdm-accent-leaf .mdm-topbar {
    background: linear-gradient(135deg, #f3fbf4, #eef9f5);
}

.mdm-accent-pearl .mdm-topbar {
    background: linear-gradient(135deg, #f7fbff, #f5f8fd);
}

.mdm-accent-rose .mdm-topbar {
    background: linear-gradient(135deg, #fff5f7, #fef5f8);
}

.mdm-topbar-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mdm-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #24739f;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.mdm-topbar h2 {
    color: #5f6f72;
    font-size: 18px;
    line-height: 1.2;
    white-space: nowrap;
}

.mdm-topbar p {
    color: #8b989d;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdm-topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.mdm-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mdm-search-bar {
    background: linear-gradient(180deg, #ffffff, #f8fbfd);
    border-color: #e7eef1;
    width: 360px;
    box-shadow: 0 6px 18px rgba(149, 191, 200, 0.08);
}

.mdm-add-btn {
    background: linear-gradient(135deg, #5bc9af, #3faec8);
    box-shadow: 0 10px 22px rgba(86, 195, 180, 0.18);
}

.mdm-add-btn:hover {
    background: linear-gradient(135deg, #49ba9e, #359db6);
}

.shared-spec-layout {
    display: grid;
    grid-template-columns: 480px 300px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 28px 28px;
    min-height: 0;
    flex: 1;
}

.shared-spec-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid #ebf0f3;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #fcfdff);
    box-shadow: 0 10px 30px rgba(115, 145, 165, 0.08);
    overflow: hidden;
}

.shared-spec-column-wide {
    min-width: 0;
}

.shared-spec-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid #eef3f5;
}

.shared-spec-column-head h3 {
    color: #5f6f72;
    font-size: 15px;
    margin-bottom: 4px;
}

.shared-spec-column-head p {
    color: #99a6ab;
    font-size: 12px;
    line-height: 1.5;
}

.shared-spec-column-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.shared-spec-scope-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef8fb;
    color: #24739f;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.shared-spec-list,
.shared-spec-values,
.shared-spec-materials {
    padding: 16px;
    overflow: auto;
    min-height: 0;
}

.shared-spec-values {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.shared-spec-attr-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e8eff2;
    border-radius: 14px;
    background: #fff;
    cursor: default;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.shared-spec-attr-card.active {
    border-color: #8fd0c1;
    box-shadow: 0 4px 12px rgba(90, 187, 167, 0.12);
}

.shared-spec-attr-card.dragging {
    opacity: 0.4;
}

.shared-spec-attr-drag {
    cursor: grab;
    color: #bcc8cc;
    font-size: 16px;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
}

.shared-spec-attr-label {
    flex: 1;
    color: #5f6f72;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-width: 0;
}

.shared-spec-attr-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.text-btn {
    border: none;
    background: transparent;
    color: #5e7d88;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
}

.text-btn:hover {
    background: #f5fafc;
}

.text-btn-danger {
    color: #d66f63;
}

.shared-spec-materials {
    flex: 1;
}

.shared-spec-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.shared-spec-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e8eff2;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.shared-spec-list-name {
    color: #5f6f72;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shared-spec-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #dbe6ea;
    border-radius: 8px;
    background: #f8fcfd;
    color: #5e7d88;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.shared-spec-more-btn:hover {
    background: #eef8fb;
}

.shared-spec-action-menu {
    min-width: 92px;
    padding: 6px;
    border: 1px solid #e7edf0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(28, 54, 74, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 999999;
}

.shared-spec-action-item {
    border: none;
    background: transparent;
    color: #5f6f72;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
}

.shared-spec-action-item:hover {
    background: #f5fafc;
}

.shared-spec-action-item-danger {
    color: #d66f63;
}

.shared-spec-list-item .shared-spec-scope-badge {
    flex-shrink: 0;
}

.shared-spec-list-item:hover,
.shared-spec-list-item.active {
    border-color: #8fd0c1;
    box-shadow: 0 12px 24px rgba(90, 187, 167, 0.14);
    transform: translateY(-1px);
}

.shared-spec-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f5f8fb;
    color: #6f7d82;
    font-family: "SF Mono", "Consolas", monospace;
    font-size: 12px;
}

.shared-spec-values {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
}

.shared-spec-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 18px 0;
}

.shared-spec-filter-chip {
    border: 1px solid #dde9ee;
    background: #f8fcfd;
    color: #6f858c;
    border-radius: 999px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    min-width: 64px;
    text-align: center;
    white-space: nowrap;
}

.shared-spec-filter-chip.active {
    border-color: #86cbbb;
    background: linear-gradient(135deg, #edf9f4, #edf7fe);
    color: #24739f;
}

#specAttributePendingList {
    min-height: 56px;
}

.shared-spec-materials {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
    overflow: auto;
    min-height: 0;
    align-content: start;
}

.shared-spec-material-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e8eff2;
    border-radius: 14px;
    background: #fff;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
}

.shared-spec-material-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.shared-spec-material-main strong {
    color: #5f6f72;
    line-height: 1.5;
}

.modal-card-shared-spec {
    width: 1260px;
    max-width: calc(100vw - 32px);
}

.spec-basic-grid {
    grid-template-columns: 1fr !important;
}

.shared-spec-editor-box {
    border: 1px solid #e7edf0;
    border-radius: 14px;
    background: #fbfdfe;
    padding: 14px;
}

.shared-spec-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 12px;
}

.shared-spec-material-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.shared-spec-picker-item {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 1px solid #e8eff2;
    border-radius: 14px;
    background: #fff;
    padding: 10px 12px;
}

.shared-spec-picker-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #24739f;
}

.mdm-table-wrap {
    margin: 10px 28px 28px;
    border: 1px solid #edf2f5;
    box-shadow: 0 18px 40px rgba(112, 151, 167, 0.08);
}

.mdm-form-body {
    padding-left: 48px;
    padding-right: 48px;
}

.sku-image-upload-box {
    width: 124px;
    height: 124px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f2f6f8, #e8eef0);
    border: 1px solid #d5dee1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    outline: none;
    margin: 0 auto;
}

.sku-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sku-image-placeholder-btn {
    border: 1px solid #c0d1d6;
    background: #fff;
    color: #4d6d76;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.sku-image-placeholder-btn:hover {
    background: #f0f5f7;
    border-color: #a0b6bc;
}

.sku-image-preview {
    width: 124px;
    height: 124px;
    position: relative;
    display: none;
}

.sku-image-preview img {
    width: 124px;
    height: 124px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    border-radius: 18px;
}

.mdm-table {
    min-width: 800px;
}

.mdm-table th,
.mdm-table td {
    text-align: center;
    vertical-align: middle;
    padding: 8px 10px;
}

.mdm-table th:first-child,
.mdm-table td:first-child {
    width: 105px;
    min-width: 105px;
}

.mdm-table th:nth-child(2),
.mdm-table td:nth-child(2) {
    width: 64px;
    min-width: 64px;
}

.mdm-table th:nth-child(3),
.mdm-table td:nth-child(3) {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdm-table th:nth-child(4),
.mdm-table td:nth-child(4),
.mdm-table th:nth-child(5),
.mdm-table td:nth-child(5),
.mdm-table th:nth-child(6),
.mdm-table td:nth-child(6),
.mdm-table th:nth-child(7),
.mdm-table td:nth-child(7),
.mdm-table th:nth-child(8),
.mdm-table td:nth-child(8) {
    width: 66px;
    min-width: 66px;
}

.mdm-table th:nth-child(9),
.mdm-table td:nth-child(9) {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdm-table .actions-cell {
    width: 120px;
    min-width: 120px;
}

.material-thumb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(180deg, #f7fbfc, #eef7f6);
    padding: 0;
    cursor: pointer;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e3eff0;
}

.material-preview-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.material-thumb-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, #f7fbfc, #eef7f6);
    border: 1px solid #e3eff0;
}

.material-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.material-thumb-preview {
    width: 124px;
    height: 124px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fbfc, #eff7f6);
    border: 1px solid #e3eff0;
}

.material-thumb-large {
    width: 124px;
    height: 124px;
}

.modal-card-image {
    width: 760px;
    max-width: calc(100vw - 32px);
    position: relative;
    z-index: 3002;
}

.image-preview-body {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 78vh;
    overflow: auto;
}

.image-preview-content {
    max-width: 100%;
    max-height: 68vh;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.mdm-type-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1fbf8;
    color: #45a486;
    font-size: 12px;
    font-weight: 600;
}

.mdm-form-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 24px;
    border-bottom: 1px solid #e8edf0;
}

.mdm-form-tab {
    border: none;
    background: transparent;
    color: #7a8a8f;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    margin-bottom: -1px;
    transition: color 0.15s;
}

.mdm-form-tab:hover {
    color: #4d6d76;
}

.mdm-form-tab.active {
    color: #24739f;
}

.mdm-form-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #24739f;
    border-radius: 2px 2px 0 0;
}

.mdm-form-pane {
    display: none;
}

.mdm-form-pane.active {
    display: block;
}

.mdm-form-body .form-grid {
    gap: 16px 28px;
}

.mdm-form-body .form-grid.two-column-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mdm-form-body .form-section {
    margin-bottom: 20px;
}

.mdm-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.mdm-section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mdm-subsection-title {
    margin-bottom: 6px;
}

.mdm-subsection-desc {
    color: #99a6ab;
    font-size: 12px;
    line-height: 1.6;
}

.btn-light {
    border: 1px solid #dbe9ec;
    background: #f8fcfd;
    color: #4c8d95;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-light:hover {
    background: #eef8fb;
}

.btn-link-danger {
    border: none;
    background: transparent;
    color: #d66f63;
    cursor: pointer;
    padding: 0;
}

.spec-group-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
}

.spec-name-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 64px;
    padding: 6px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #edf9f4, #edf7fe);
    border: 1px solid #cce4df;
    color: #24739f;
    font-size: 13px;
    font-weight: 600;
    box-sizing: border-box;
}

.spec-name-tag-remove {
    border: none;
    background: transparent;
    color: #6fa8a3;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}

.spec-name-tag-remove:hover {
    color: #d66f63;
}

.spec-value-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spec-value-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 64px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef8fb;
    color: #438699;
    font-size: 12px;
    font-weight: 600;
}

.spec-value-editor {
    display: flex;
    gap: 10px;
}

.spec-group-form input,
.spec-value-editor input,
.sku-draft-table input,
.sku-draft-table select {
    width: 100%;
    border: 1px solid #e2e8eb;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: #6f7d82;
}

.spec-value-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spec-value-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 64px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef8fb;
    color: #438699;
    font-size: 12px;
    font-weight: 600;
}

.spec-value-chip button {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.sku-draft-wrap {
    border: 1px solid #eaf0f2;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    overflow-x: auto;
}

.sku-draft-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
}

.sku-draft-table th,
.sku-draft-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef3f4;
    text-align: center;
    vertical-align: middle;
}

.sku-draft-table th {
    background: #f8fbfc;
    color: #93a0a6;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.sku-draft-table tr:last-child td {
    border-bottom: none;
}

.sku-draft-code {
    font-size: 12px;
}

.draft-empty {
    border: 1px dashed #d6e3e7;
    border-radius: 16px;
    padding: 20px;
    color: #99a6ab;
    background: #fbfdfe;
    text-align: center;
}

.tag-启用 {
    background: #edf9f2;
    color: #31a96e;
}

.tag-停用 {
    background: #fff3f0;
    color: #dd6b54;
}

.btn-detail {
    background: none;
    border: none;
    padding: 0 6px;
    font-size: 13px;
    color: #32b278;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
}

.btn-detail:hover {
    opacity: 0.6;
}

.action-dropdown {
    position: relative;
    display: inline-block;
}

.btn-more {
    background: none;
    border: none;
    padding: 0 6px;
    font-size: 13px;
    color: #32b278;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
}

.btn-more:hover {
    opacity: 0.6;
}

.action-menu {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
    min-width: 110px;
    overflow: hidden;
}

.action-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.action-menu-item {
    padding: 8px 16px;
    font-size: 13px;
    color: #797979;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
    text-align: left;
}

.action-menu-item:hover {
    background: #f0f9ff;
    color: #24739f;
}

.action-menu-item.disabled {
    color: #c0c4cc;
    cursor: not-allowed;
}

.action-menu-item.disabled:hover {
    background: #fff;
    color: #c0c4cc;
}

.cell-main {
    font-weight: 500;
    color: #5a5a5a;
    text-align: center;
}

.cell-ellipsis {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.cell-num {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.sku-count-btn {
    border: none;
    background: #eef8fb;
    color: #24739f;
    min-width: 34px;
    height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    cursor: pointer;
    font-weight: 600;
}

.sku-count-btn:hover {
    background: #dff2f7;
}

.modal-card-sku {
    width: 1600px;
}

.modal-card-shared-spec-picker {
    width: 1120px;
    max-width: calc(100vw - 32px);
}

.shared-spec-picker-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 18px;
}

.shared-spec-picker-panel {
    border: 1px solid #ebf0f3;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    min-height: 420px;
    overflow: hidden;
}

.shared-spec-picker-title {
    padding: 16px 18px;
    border-bottom: 1px solid #eef3f5;
    color: #5f6f72;
    font-size: 14px;
    font-weight: 700;
}

.shared-spec-picker-list,
.shared-spec-picker-preview {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    height: calc(100% - 52px);
}

.shared-spec-picker-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e6edf0;
    border-radius: 14px;
    background: #fff;
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.shared-spec-picker-list-item:hover {
    border-color: #c8dbdf;
}

.shared-spec-picker-list-item.selected {
    border-color: #8fd0c1;
    box-shadow: 0 2px 8px rgba(90, 187, 167, 0.12);
}

.shared-spec-picker-list-item.active {
    border-color: #8fd0c1;
    box-shadow: 0 2px 8px rgba(90, 187, 167, 0.12);
}

.shared-spec-picker-list-item .shared-spec-picker-code {
    flex-shrink: 0;
}

.shared-spec-picker-list-item strong {
    flex: 1;
    min-width: 0;
    color: #4d6d76;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shared-spec-picker-select-btn {
    flex-shrink: 0;
    border: 1px solid #86cbbb;
    background: transparent;
    color: #24739f;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.shared-spec-picker-select-btn:hover {
    background: #edf9f4;
}

.shared-spec-picker-select-btn.selected {
    background: #24739f;
    color: #fff;
    border-color: #24739f;
}

.shared-spec-picker-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f5f8fb;
    color: #6f7d82;
    font-family: "SF Mono", "Consolas", monospace;
    font-size: 12px;
}

.shared-spec-picker-preview-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}

.cell-empty {
    text-align: center;
    padding: 48px 0 !important;
    color: #c0c4cc;
    font-size: 14px;
}

.code-tag {
    font-family: "SF Mono", "Consolas", monospace;
    font-size: 12px;
    background: #f2f4f7;
    padding: 2px 8px;
    border-radius: 5px;
    color: #797979;
}

.credit-code {
    font-family: "SF Mono", "Consolas", monospace;
    font-size: 12px;
    color: #a0a4ab;
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag-潜在 {
    background: #FFF0E0;
    color: #CC7A30;
}

.tag-意向 {
    background: #E8F9FF;
    color: #3FA8D0;
}

.tag-成交 {
    background: #E6FFED;
    color: #4CAF7A;
}

.tag-无效 {
    background: #f2f4f7;
    color: #a0a4ab;
}

.level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.level-A {
    background: #E6FFED;
    color: #4CAF7A;
}

.level-B {
    background: #E8F9FF;
    color: #3FA8D0;
}

.level-C {
    background: #FFF0E0;
    color: #CC7A30;
}

.level-D {
    background: #EDE8FF;
    color: #8B7AC0;
}

/* ===== Pagination ===== */
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-size {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-size label {
    font-size: 13px;
    color: #a0a4ab;
}

.page-size .select-wrap select {
    min-width: 70px;
    padding: 5px 28px 5px 10px;
}

.page-info {
    font-size: 13px;
    color: #a0a4ab;
    white-space: nowrap;
}

.page-btn {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 6px 16px;
    font-size: 13px;
    color: #797979;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
    border-color: #24739f;
    color: #24739f;
    background: #f8fbff;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-overlay.show {
    display: flex;
}

#imagePreviewModal {
    z-index: 3000;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    width: min(900px, calc(100vw - 32px));
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    animation: modalIn 0.2s ease;
}

.modal-card.modal-card-wide {
    width: 1600px !important;
    max-width: calc(100vw - 32px) !important;
}

.modal-card.modal-card-sku {
    width: 1600px !important;
    max-width: calc(100vw - 32px) !important;
}

.modal-card.modal-card-shared-spec {
    width: 1260px !important;
    max-width: calc(100vw - 32px) !important;
}

.modal-card.modal-card-spec-basic,
.modal-card.modal-card-spec-attribute {
    width: 560px !important;
    max-width: calc(100vw - 32px) !important;
}

.modal-card.modal-card-shared-spec-picker {
    width: 1120px !important;
    max-width: calc(100vw - 32px) !important;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eef0f4;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #797979;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #c0c4cc;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}

.modal-close:hover {
    color: #797979;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 0;
}

.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #24739f;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef0f4;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px 20px;
}

.form-grid.two-column-grid {
    grid-template-columns: 1fr 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    color: #797979;
    font-weight: 500;
}

.form-group.required label::after {
    content: ' *';
    color: #ef4444;
}

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #797979;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #24739f;
    box-shadow: 0 0 0 3px rgba(36,115,159,0.10);
}

.input-readonly {
    background: #f0f2f5 !important;
    color: #999 !important;
    cursor: not-allowed;
}

.readonly-picker-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.contract-customer-picker-wrap {
    max-height: 420px;
}

.contract-customer-picker-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.contract-customer-picker-table thead {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 2;
}

.contract-customer-picker-table th,
.contract-customer-picker-table td {
    text-align: center;
    vertical-align: middle;
    padding: 7px 8px;
    border-bottom: 1px solid #eef0f4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contract-customer-picker-table th {
    font-size: 12px;
    font-weight: 600;
    color: #a0a4ab;
}

.contract-customer-picker-table td {
    color: #797979;
}

.contract-customer-picker-table tbody tr:last-child td {
    border-bottom: none;
}

.contract-customer-picker-table th:nth-child(1),
.contract-customer-picker-table td:nth-child(1) {
    width: 108px;
    min-width: 108px;
}

.contract-customer-picker-table th:nth-child(2),
.contract-customer-picker-table td:nth-child(2) {
    width: 190px;
}

.contract-customer-picker-table th:nth-child(3),
.contract-customer-picker-table td:nth-child(3) {
    width: 166px;
}

.contract-customer-picker-table th:nth-child(4),
.contract-customer-picker-table td:nth-child(4) {
    width: 86px;
    min-width: 86px;
}

.contract-customer-picker-table th:nth-child(5),
.contract-customer-picker-table td:nth-child(5) {
    width: 116px;
    min-width: 116px;
}

.contract-customer-picker-table th:nth-child(6),
.contract-customer-picker-table td:nth-child(6) {
    width: 82px;
    min-width: 82px;
}

.contract-customer-picker-table .actions-cell {
    min-width: 82px;
}

.contract-customer-picker-table .btn-detail {
    min-width: 58px;
    padding: 0 8px;
}

.contract-goods-wrap {
    max-height: 360px;
}

.contract-goods-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.contract-goods-table th,
.contract-goods-table td {
    text-align: center;
    vertical-align: middle;
    padding: 7px 8px;
    border-bottom: 1px solid #eef0f4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contract-goods-table th {
    font-size: 12px;
    font-weight: 600;
    color: #a0a4ab;
}

.contract-goods-table th:nth-child(1),
.contract-goods-table td:nth-child(1) { width: 108px; }
.contract-goods-table th:nth-child(2),
.contract-goods-table td:nth-child(2) { width: 170px; }
.contract-goods-table th:nth-child(3),
.contract-goods-table td:nth-child(3) { width: 82px; }
.contract-goods-table th:nth-child(4),
.contract-goods-table td:nth-child(4) { width: 170px; }
.contract-goods-table th:nth-child(5),
.contract-goods-table td:nth-child(5) { width: 88px; }
.contract-goods-table th:nth-child(6),
.contract-goods-table td:nth-child(6) { width: 84px; }
.contract-goods-table th:nth-child(7),
.contract-goods-table td:nth-child(7) { width: 72px; }
.contract-goods-table th:nth-child(8),
.contract-goods-table td:nth-child(8) { width: 120px; }
.contract-goods-table th:nth-child(9),
.contract-goods-table td:nth-child(9) { width: 78px; }

.contract-delivery-schedule {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delivery-periods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delivery-period-card {
    border: 1px solid #eef0f4;
    border-radius: 12px;
    padding: 14px;
    background: #fbfdff;
}

.delivery-period-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.delivery-period-title {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
}

.contract-spec-group {
    grid-column: 1 / -1;
    border: 1px solid #e7edf3;
    border-radius: 12px;
    background: #fbfdff;
    padding: 14px 16px;
}

.contract-spec-group + .contract-spec-group {
    margin-top: 4px;
}

.contract-spec-group-title {
    margin-bottom: 12px;
    color: #526071;
    font-size: 13px;
    font-weight: 700;
}

.contract-spec-group-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 20px;
}

.contract-delivery-table-wrap {
    max-height: 260px;
}

.contract-delivery-table th:nth-child(1),
.contract-delivery-table td:nth-child(1) { width: 108px; }
.contract-delivery-table th:nth-child(2),
.contract-delivery-table td:nth-child(2) { width: 180px; }
.contract-delivery-table th:nth-child(3),
.contract-delivery-table td:nth-child(3) { width: 180px; }
.contract-delivery-table th:nth-child(4),
.contract-delivery-table td:nth-child(4) { width: 96px; }
.contract-delivery-table th:nth-child(5),
.contract-delivery-table td:nth-child(5) { width: 96px; }

.contract-goods-picker-table th:nth-child(1),
.contract-goods-picker-table td:nth-child(1) { width: 108px; }
.contract-goods-picker-table th:nth-child(2),
.contract-goods-picker-table td:nth-child(2) { width: 220px; }
.contract-goods-picker-table th:nth-child(3),
.contract-goods-picker-table td:nth-child(3) { width: 88px; }
.contract-goods-picker-table th:nth-child(4),
.contract-goods-picker-table td:nth-child(4) { width: 88px; }
.contract-goods-picker-table th:nth-child(5),
.contract-goods-picker-table td:nth-child(5) { width: 72px; }
.contract-goods-picker-table th:nth-child(6),
.contract-goods-picker-table td:nth-child(6) { width: 82px; }

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.region-row {
    display: flex;
    gap: 8px;
}

.region-row select,
.region-row input {
    flex: 1;
    min-width: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    padding: 16px 0 20px;
}

.btn-cancel {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 8px 28px;
    font-size: 13px;
    color: #797979;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-cancel:hover {
    border-color: #cdd0d6;
}

.btn-submit {
    background: #24739f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 28px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-submit:hover {
    background: #1d5e82;
}

.fms-status-bar {
    margin: 12px 0 16px;
}

.fms-list-wrap {
    border: 1px solid #eef0f4;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.fms-list {
    display: grid;
    grid-template-columns: 130px minmax(0, 1.3fr) 110px 112px 126px minmax(0, 1.2fr) 150px 92px 88px 96px;
    align-items: center;
}

.fms-list-head {
    background: #f9fafb;
    border-bottom: 1px solid #eef0f4;
}

.fms-list-row {
    border-bottom: 1px solid #f2f4f7;
}

.fms-list-row:last-child {
    border-bottom: none;
}

.fms-list-cell {
    min-width: 0;
    padding: 9px 8px;
    text-align: center;
    color: #797979;
    font-size: 13px;
}

.fms-list-head .fms-list-cell {
    font-size: 12px;
    font-weight: 600;
    color: #a0a4ab;
    white-space: nowrap;
}

.fms-list-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fms-list-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.fms-list-empty {
    padding: 32px 12px;
    text-align: center;
    color: #9ca3af;
}

.fms-status-进行中 {
    background: #e8f9ff;
    color: #3fa8d0;
}

.fms-status-全部到账 {
    background: #e6ffed;
    color: #4caf7a;
}

.fms-status-合同作废 {
    background: #f2f4f7;
    color: #a0a4ab;
}

.fms-modal-block + .fms-modal-block {
    margin-top: 18px;
}

.fms-modal-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.fms-modal-block-head h4,
.fms-arrival-record-title {
    color: #4b5563;
    font-size: 14px;
    font-weight: 600;
}

.fms-modal-block-actions {
    display: flex;
    gap: 8px;
}

.fms-modal-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    background: #fbfdff;
}

.fms-modal-table {
    min-width: 1320px;
}

.fms-arrival-record-wrap {
    margin-top: 12px;
}

.fms-arrival-record-title {
    margin-bottom: 10px;
}

.fms-modal-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.fms-modal-attachment-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eef8fb;
    color: #24739f;
    font-size: 11px;
}

.fms-modal-muted {
    color: #a0a4ab;
}

@media (max-width: 900px) {
    .fms-list-wrap {
        overflow-x: auto;
    }

    .fms-list {
        min-width: 1180px;
    }

    .shared-spec-layout {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .shared-spec-column-head,
    .shared-spec-column-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .shared-spec-editor-row {
        grid-template-columns: 1fr;
    }

    .shared-spec-material-picker,
    .shared-spec-materials {
        grid-template-columns: 1fr;
    }

    .modal-card {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }

    .form-grid,
    .form-grid.two-column-grid {
        grid-template-columns: 1fr;
    }

    .mdm-form-body .form-grid.two-column-grid,
    .shared-spec-picker-layout,
    .spec-group-form-readonly {
        grid-template-columns: 1fr;
    }

    .mdm-topbar,
    .mdm-topbar-main,
    .mdm-topbar-actions,
    .mdm-search-form,
    .mdm-section-head,
    .spec-group-form,
    .spec-value-editor {
        flex-direction: column;
        align-items: stretch;
    }

    .mdm-topbar p,
    .mdm-topbar h2 {
        white-space: normal;
    }

    .mdm-search-bar {
        width: 100%;
    }

    .mdm-table-wrap {
        margin: 0 16px 16px;
    }

    .mdm-form-tabs {
        padding: 8px 16px 0;
        flex-wrap: wrap;
    }

    .mdm-form-body {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a2d3b;
    color: #fff;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 99999;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
