:root { --bg:#eef3f9; --nav:#dbe7f7; --nav-strong:#c6daf4; --panel:#ffffff; --surface:#f5f8fc; --text:#0f172a; --muted:#64748b; --pri:#2563eb; --pri-soft:#dbeafe; --line:#dbe2ea; --shadow:0 18px 38px rgba(15,23,42,.08); }
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: "Microsoft YaHei", system-ui, sans-serif; background: linear-gradient(180deg, #f7faff, #eaf1fb); color: var(--text); }
.page { width: 100%; min-height: 100vh; padding: 14px; }
.panel { background: var(--panel); border-radius: 14px; padding: 18px; border: 1px solid rgba(148,163,184,.24); box-shadow: var(--shadow); }
.login-panel { min-height: calc(100vh - 28px); display: grid; align-items: center; grid-template-columns: 1.1fr .9fr; gap: 24px; }
.login-shell { position: relative; overflow: hidden; padding: 28px; background: radial-gradient(circle at top left, #f8fbff, #eef4ff 38%, #ffffff 100%); }
.login-shell::before { content: ""; position: absolute; inset: -120px auto auto -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(37,99,235,.08); filter: blur(8px); }
.login-shell::after { content: ""; position: absolute; right: -90px; bottom: -110px; width: 300px; height: 300px; border-radius: 50%; background: rgba(59,130,246,.08); filter: blur(10px); }
.login-brand-panel, .login-form-panel { position: relative; z-index: 1; }
.login-brand-panel { display: grid; gap: 18px; align-content: center; padding-right: 12px; }
.login-lead { max-width: 560px; font-size: 16px; line-height: 1.7; }
.login-feature-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.login-feature-card { min-height: 146px; padding: 18px 16px; border: 1px solid rgba(37,99,235,.12); border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,251,255,.96)); box-shadow: 0 14px 28px rgba(37,99,235,.06); }
.login-feature-title { margin-bottom: 10px; color: #1d4ed8; font-size: 15px; font-weight: 800; }
.login-feature-card p { color: #475569; line-height: 1.7; }
.login-form-panel { display: grid; gap: 14px; justify-items: stretch; }
.login-form-head h2 { margin-bottom: 6px; }
.login-form-card { max-width: none; padding: 22px; border: 1px solid rgba(148,163,184,.2); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 24px 44px rgba(15,23,42,.08); }
.login-form-card input { min-height: 44px; }
.login-form-card .primary { min-height: 44px; }
.login-account-box { display: grid; gap: 8px; padding: 14px 16px; border: 1px dashed rgba(37,99,235,.2); border-radius: 14px; background: #f8fbff; }
.login-account-title { color: #1e40af; font-size: 13px; font-weight: 800; }
.login-account-row { display: flex; justify-content: space-between; gap: 12px; color: #475569; font-size: 13px; }
.login-account-row span:last-child { color: #1d4ed8; font-weight: 700; }
.eyebrow { color: var(--pri); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { margin-bottom: 10px; }
.muted, .helper { color: var(--muted); }
.error { color: #b91c1c; min-height: 22px; }
.hidden, .app.hidden { display: none; }

.app { min-height: calc(100vh - 28px); display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; align-items: start; }
.nav-shell { min-height: calc(100vh - 28px); display: grid; grid-template-rows: auto 1fr; gap: 18px; background: linear-gradient(180deg, var(--nav), var(--nav-strong)); }
.nav-title { margin-bottom: 0; }
.nav-list { display: grid; gap: 10px; align-content: start; }
.nav-group { display: grid; gap: 8px; }
.nav-item { width: 100%; border: 1px solid rgba(37,99,235,.12); border-radius: 12px; padding: 14px 16px; text-align: left; background: rgba(255,255,255,.7); color: #1e3a8a; font: inherit; font-weight: 700; cursor: pointer; transition: .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.92); transform: translateX(2px); }
.nav-item.active { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; box-shadow: 0 10px 24px rgba(37,99,235,.22); }
.nav-sublist { display: grid; gap: 6px; max-height: 0; overflow: hidden; padding: 0 8px; opacity: 0; transition: max-height .28s ease, opacity .22s ease, padding .22s ease; }
.nav-group.active .nav-sublist { max-height: 320px; opacity: 1; padding: 2px 8px 4px 12px; }
.nav-subitem { width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.78); color: #334155; border: 1px solid rgba(148,163,184,.18); font-size: 13px; font-weight: 600; }
.nav-subitem:hover { background: #fff; color: #1d4ed8; }

.workspace { display: grid; gap: 14px; align-content: start; }
.topbar { display: flex; justify-content: space-between; align-items: center; }
.compact-page-header { padding: 6px 12px; background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; border-color: rgba(37,99,235,.24); min-height: 0; }
.compact-page-header .eyebrow { color: #bfdbfe; font-size: 12px; line-height: 1.1; margin-bottom: 2px; }
.compact-page-header h2 { margin-bottom: 0; font-size: 22px; line-height: 1.15; }
.compact-page-header .badge { background: rgba(255,255,255,.18); color: #fff; }
.compact-page-header .ghost, .compact-page-header .badge { padding: 7px 10px; font-size: inherit; line-height: 1; }
.compact-page-header .ghost { background: rgba(255,255,255,.16); color: #fff; }
.home-sub { margin-top: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge { padding: 8px 12px; border-radius: 999px; background: var(--pri-soft); color: #1d4ed8; font-weight: 700; }
a { text-decoration: none; }
button { border: 0; border-radius: 12px; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; }
button.is-busy { opacity: .72; filter: saturate(.85); cursor: wait; }
button:disabled { opacity: .6; cursor: not-allowed; }
.primary { background: var(--pri); color: #fff; }
.ghost { background: #eff6ff; color: #1d4ed8; }
.danger { background: #fee2e2; color: #b91c1c; }
.link-button { display: inline-flex; align-items: center; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-card { background: linear-gradient(180deg, #fff, #f8fbff); }
.card-metric { font-size: 32px; font-weight: 700; margin-top: 8px; }

.home-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.module-card { position: relative; min-height: 180px; display: grid; gap: 12px; align-content: start; background: linear-gradient(180deg, #ffffff, #f8fbff); cursor: pointer; transition: .18s ease; }
.module-card:hover { transform: translateY(-2px); box-shadow: 0 20px 34px rgba(37,99,235,.12); }
.module-card.active { border-color: rgba(37,99,235,.36); box-shadow: 0 22px 34px rgba(37,99,235,.14); }
.nav-group.hidden, .module-card.hidden { display: none; }
.module-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--pri-soft); color: #1d4ed8; font-weight: 800; }
.module-meta { color: #1e40af; font-size: 13px; font-weight: 600; }

.module-preview { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: linear-gradient(90deg, #eff6ff, #ffffff 55%); }
.module-actions { display: flex; gap: 10px; align-items: center; }
.submodule-block { margin-top: 16px; display: grid; gap: 10px; }
.submodule-title { color: #1e3a8a; font-size: 13px; font-weight: 700; }
.submodule-list { display: flex; gap: 10px; flex-wrap: wrap; }
.submodule-chip { background: #f8fbff; color: #1d4ed8; border: 1px solid rgba(37,99,235,.14); }

.data-page { display: grid; gap: 16px; }
.data-page.hidden { display: none; }
.data-page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table th { background: #f8fbff; color: #1e3a8a; font-size: 13px; }
.data-table td { color: #334155; font-size: 13px; }
.electronics-table { min-width: 860px; table-layout: auto; }
.electronics-table th, .electronics-table td { white-space: normal; vertical-align: top; }
.order-table tbody tr:hover td { background: #eaf2ff; }
.order-table tbody tr.highlight-order-row td { background: #dbeafe; box-shadow: inset 0 0 0 1px rgba(37,99,235,.18); }
.detail-table { table-layout: fixed; min-width: 1480px; }
.detail-table th, .detail-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.detail-table tbody tr:hover td { background: #eaf2ff; }
.detail-table tbody tr.shipped-detail-row td { background: #f0fdf4; }
.detail-table tbody tr.shipped-detail-row:hover td { background: #dcfce7; }
.detail-table th:nth-child(1), .detail-table td:nth-child(1) { width: 170px; }
.detail-table th:nth-child(2), .detail-table td:nth-child(2) { width: 160px; }
.detail-table th:nth-child(3), .detail-table td:nth-child(3) { width: 160px; }
.detail-table th:nth-child(4), .detail-table td:nth-child(4) { width: 160px; }
.detail-table th:nth-child(5), .detail-table td:nth-child(5) { width: 140px; }
.detail-table th:nth-child(6), .detail-table td:nth-child(6) { width: 160px; }
.detail-table th:nth-child(7), .detail-table td:nth-child(7) { width: 220px; }
.detail-table th:nth-child(8), .detail-table td:nth-child(8) { width: 90px; }
.detail-table th:nth-child(9), .detail-table td:nth-child(9) { width: 180px; }
.shipping-table { min-width: 2500px; }
.shipping-table th:nth-child(1), .shipping-table td:nth-child(1) { width: 124px; }
.shipping-table th:nth-child(2), .shipping-table td:nth-child(2) { width: 140px; }
.shipping-table th:nth-child(3), .shipping-table td:nth-child(3) { width: 124px; }
.shipping-table th:nth-child(4), .shipping-table td:nth-child(4) { width: 180px; }
.shipping-table th:nth-child(5), .shipping-table td:nth-child(5) { width: 160px; }
.shipping-table th:nth-child(6), .shipping-table td:nth-child(6) { width: 220px; }
.shipping-table th:nth-child(7), .shipping-table td:nth-child(7) { width: 220px; }
.shipping-table th:nth-child(8), .shipping-table td:nth-child(8) { width: 120px; }
.shipping-table th:nth-child(9), .shipping-table td:nth-child(9) { width: 140px; }
.shipping-table th:nth-child(10), .shipping-table td:nth-child(10) { width: 130px; }
.shipping-table th:nth-child(11), .shipping-table td:nth-child(11) { width: 140px; }
.shipping-table th:nth-child(12), .shipping-table td:nth-child(12) { width: 120px; }
.shipping-table th:nth-child(13), .shipping-table td:nth-child(13) { width: 220px; }
.shipping-table th:nth-child(14), .shipping-table td:nth-child(14) { width: 220px; }
.shipping-table th:nth-child(15), .shipping-table td:nth-child(15) { width: 96px; }
.shipping-table th:nth-child(16), .shipping-table td:nth-child(16) { width: 110px; }
.shipping-table th:nth-child(17), .shipping-table td:nth-child(17) { width: 110px; }
.shipping-table th:nth-child(18), .shipping-table td:nth-child(18) { width: 110px; }
.product-base-table { table-layout: fixed; min-width: 1180px; }
.product-base-table th:nth-child(1), .product-base-table td:nth-child(1) { width: 140px; }
.product-base-table th:nth-child(2), .product-base-table td:nth-child(2) { width: 130px; }
.product-base-table th:nth-child(3), .product-base-table td:nth-child(3) { width: 150px; }
.product-base-table th:nth-child(4), .product-base-table td:nth-child(4) { width: 130px; }
.product-base-table th:nth-child(5), .product-base-table td:nth-child(5) { width: 120px; }
.product-base-table th:nth-child(6), .product-base-table td:nth-child(6) { width: 120px; }
.product-base-table th:nth-child(7), .product-base-table td:nth-child(7) { width: 120px; }
.product-base-table th:nth-child(8), .product-base-table td:nth-child(8) { width: 210px; }
.product-base-table th:nth-child(9), .product-base-table td:nth-child(9) { width: 100px; }
.base-params-cell { max-width: 180px; width: 180px; }
.params-cell { min-width: 180px; }
.full-text-cell { line-height: 1.6; word-break: break-word; }
.related-file-cell { max-width: 180px; width: 180px; }
.compact-detail-cell { max-width: 180px; width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.truncate-file-text { display: inline-block; max-width: 128px; overflow: hidden; text-overflow: clip; vertical-align: bottom; white-space: nowrap; }
.truncate-text { display: inline-block; max-width: 132px; overflow: hidden; text-overflow: clip; vertical-align: bottom; white-space: nowrap; }
.ellipsis-button { padding: 0 4px; border-radius: 6px; background: transparent; color: #1d4ed8; font-weight: 800; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.small-button { padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.small-button:disabled { cursor: not-allowed; opacity: .55; }
.status-link-button { background: #ecfdf5; color: #047857; border: 1px solid rgba(16,185,129,.28); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.status-link-button:hover { background: #d1fae5; color: #065f46; }
.table-image-cell { display: inline-flex; cursor: zoom-in; }
.table-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.image-preview-popup { position: fixed; z-index: 1000; max-width: min(720px, calc(100vw - 36px)); max-height: min(620px, calc(100vh - 36px)); padding: 10px; border-radius: 16px; background: rgba(255,255,255,.96); border: 1px solid rgba(148,163,184,.36); box-shadow: 0 28px 72px rgba(15,23,42,.28); pointer-events: none; }
.image-preview-popup.hidden { display: none; }
.image-preview-popup img { display: block; max-width: min(700px, calc(100vw - 56px)); max-height: min(600px, calc(100vh - 56px)); object-fit: contain; border-radius: 10px; }
.text-preview-popup { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 24px; background: rgba(15,23,42,.24); }
.text-preview-popup.hidden { display: none; }
.text-preview-box { width: min(720px, calc(100vw - 48px)); max-height: min(620px, calc(100vh - 48px)); overflow: auto; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid rgba(148,163,184,.36); box-shadow: 0 28px 72px rgba(15,23,42,.28); }
.text-preview-close { float: right; padding: 7px 10px; border-radius: 9px; background: #eff6ff; color: #1d4ed8; font-size: 12px; }
.text-preview-title { margin-bottom: 12px; color: #1e3a8a; font-weight: 800; }
.text-preview-content { color: #334155; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: #f8fbff; }
.standalone-page { display: grid; gap: 14px; }
.record-panel { display: grid; gap: 16px; }
.record-panel.hidden { display: none; }
.field-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-card { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbff; color: #334155; font-weight: 700; }
.field-card span { color: #1d4ed8; font-size: 12px; }
.empty-table-cell { padding: 28px !important; text-align: center !important; color: var(--muted) !important; }
.record-form { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.product-base-form { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.material-master-form { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 8px; }
.order-form { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 10px; }
.sample-order-shipping-card-grid { gap: 6px 8px; padding: 4px 0; }
#sampleShippingCard { background: #f8fafc; border: 1px solid #dbe2ea; }
.detail-form { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.shipping-form-layout { grid-auto-flow: row dense; }
.order-form label { gap: 4px; }
.order-form input, .order-form select, .order-form textarea { padding: 8px 10px; }
.order-form textarea { min-height: 72px; }
.record-form label { min-width: 0; }
.record-form textarea { resize: vertical; min-height: 92px; }
.material-master-form label { gap: 3px; }
.material-master-form input, .material-master-form select, .material-master-form textarea { padding: 7px 9px; }
.material-short-field { grid-column: span 1; }
.material-image-field { grid-column: 6; grid-row: 1 / span 3; align-content: start; }
.material-image-field .image-preview { min-height: 210px; }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }
.textarea-field-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-select-row { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; }
.material-cascade-row select { min-width: 0; }
.image-field-row { display: grid; gap: 28px; grid-template-columns: 220px 220px minmax(0, 1fr); align-items: start; padding-top: 10px; min-height: 250px; }
.sample-order-media-row { gap: 18px; grid-template-columns: repeat(6, minmax(0, 1fr)); min-height: 0; }
.sample-order-media-field { grid-column: span 1; align-content: start; }
.sample-order-file-archive { grid-column: 4 / span 3; align-content: start; }
.sample-shipping-history { display: grid; gap: 10px; margin-bottom: 14px; }
.sample-shipping-history-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbff; cursor: pointer; }
.sample-shipping-history-item.active { border-color: #2563eb; background: linear-gradient(180deg, #dbeafe, #eff6ff); box-shadow: 0 10px 24px rgba(37,99,235,.14); transform: translateY(-1px); }
.sample-shipping-history-item strong { color: #1e40af; }
.sample-shipping-history-item .muted { display: block; margin-top: 4px; }
.material-item-row.active td { background: linear-gradient(180deg, #dbeafe, #eff6ff); }
.sample-shipping-status-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.sample-shipping-status-badge.empty { background: #e5e7eb; color: #4b5563; }
.sample-shipping-status-badge.filled { background: #dcfce7; color: #166534; }
.sample-shipping-status-badge.waiting { background: #dbeafe; color: #1d4ed8; }
.sample-shipping-status-badge.running { background: #fef3c7; color: #b45309; }
.sample-shipping-status-badge.finished { background: #dcfce7; color: #166534; }
.sample-shipping-summary { display: grid; gap: 4px; margin-top: 6px; font-size: 12px; }
.sample-shipping-summary.is-empty { padding: 10px 12px; border: 1px solid #dbe2ea; border-radius: 12px; background: #f8fafc; }
.sample-shipping-summary.is-filled { padding: 10px 12px; border: 1px solid rgba(16,185,129,.18); border-radius: 12px; background: linear-gradient(180deg, #f0fdf4, #eff6ff); }
.sample-shipping-summary-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sample-shipping-summary-label { font-weight: 800; }
.sample-shipping-summary-date .sample-shipping-summary-label { color: #1d4ed8; }
.sample-shipping-summary-no .sample-shipping-summary-label { color: #0f766e; }
.sample-shipping-summary-count .sample-shipping-summary-label { color: #b45309; }
.sample-shipping-summary-value { color: #334155; }
.product-base-params { grid-column: 6; grid-row: 1 / span 3; align-self: stretch; }
.product-base-form .product-base-params textarea { min-height: 232px; }
.product-base-media-row { display: grid; gap: 18px; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; }
.product-media-field { grid-column: span 1; align-content: start; }
.product-description-field { grid-column: span 3; }
.product-file-archive { grid-column: 4 / span 3; align-content: start; }
.product-file-archive-compact { grid-column: 4 / span 2; }
.product-file-archive .multi-file-preview { max-height: 230px; overflow: auto; }
.detail-lower-layout { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.detail-left-stack { display: grid; gap: 12px; align-content: start; }
.detail-related-files { align-self: stretch; }
.detail-related-files .multi-file-preview { max-height: 430px; overflow: auto; align-content: start; }
.shipping-lower-layout { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 18px; }
.shipping-remark-field textarea { min-height: 182px; }
.shipping-system-field { position: relative; padding: 10px 12px 12px; border: 1px solid rgba(37,99,235,.14); border-radius: 12px; background: linear-gradient(180deg, #f8fbff, #eff6ff); }
.shipping-system-field input { background: #f1f5f9; color: #334155; font-weight: 700; }
.shipping-date-field::after { display: none; }
.shipping-no-field { box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.field-helper { color: #2563eb; font-size: 12px; line-height: 1.4; }
.file-input { display: block; width: 100%; margin-top: 4px; }
.multi-file-picker { position: relative; display: grid; gap: 6px; padding: 12px; border: 1px dashed #93c5fd; border-radius: 12px; background: #f8fbff; }
.multi-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.multi-file-button { display: inline-flex; width: max-content; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 10px; background: #2563eb; color: #fff; font-weight: 800; }
.multi-file-help { color: #64748b; font-size: 12px; line-height: 1.5; }
.multi-file-preview { display: grid; gap: 6px; margin-top: 6px; min-height: 18px; color: var(--muted); font-size: 12px; word-break: break-all; }
.multi-file-item { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.multi-file-index { flex: 0 0 auto; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 800; }
.multi-file-count { color: #1d4ed8; font-weight: 800; }
.image-field-row label { align-content: start; }
.image-preview { display: block; margin-top: 8px; min-height: 18px; color: var(--muted); font-size: 12px; word-break: break-all; }
.form-image-thumb { display: block; width: 96px; height: 96px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.form-actions { display: flex; column-gap: 10px; row-gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding-top: 2px; }
.form-title-inline { flex: 1 1 100%; color: #1e3a8a; font-weight: 800; margin-right: 0; }
.form-actions .small-button, .form-actions .ghost, .form-actions .primary { padding-top: 8px; padding-bottom: 8px; }
.form-message { min-height: 20px; color: #0f766e; font-size: 12px; white-space: nowrap; }
.status-toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1300; min-width: min(420px, calc(100vw - 48px)); max-width: min(560px, calc(100vw - 48px)); padding: 16px 20px; border-radius: 14px; background: #ecfdf5; color: #047857; border: 1px solid rgba(16,185,129,.28); box-shadow: 0 22px 56px rgba(15,23,42,.24); font-weight: 800; text-align: center; }
.status-toast.error { background: #fef2f2; color: #b91c1c; border-color: rgba(239,68,68,.28); }
.read-only-form { opacity: .96; }
.read-only-form input:not([type="hidden"]), .read-only-form select, .read-only-form textarea { background: #f1f5f9; color: #64748b; border-color: #dbe2ea; }
input[readonly]:not([type="hidden"]) { background: #f1f5f9; color: #64748b; border-color: #dbe2ea; }
.prefill-locked-field input:not([type="hidden"]), .prefill-locked-field textarea, .prefill-locked-field .select-trigger { background: #f1f5f9; color: #64748b; border-color: #dbe2ea; }
.prefill-locked-field { position: relative; }
.permission-group { display: grid; gap: 8px; margin-bottom: 14px; }
.permission-group-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.permission-group-header { width: 100%; text-align: left; background: #eff6ff; color: #1d4ed8; }
.permission-group-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.permission-group-body.hidden { display: none; }
.file-actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-download { color: #1d4ed8; font-weight: 700; }
.file-name { color: #64748b; font-size: 12px; }
.missing-asset { color: #b91c1c; font-size: 12px; font-weight: 700; word-break: break-word; }
.select-menu { position: relative; }
.select-menu::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #64748b; font-size: 12px; pointer-events: none; }
.select-trigger { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 34px 10px 12px; background: #fff; color: var(--text); text-align: left; font-weight: 400; }
.select-trigger:disabled { background: #fff; color: var(--text); border-color: var(--line); cursor: not-allowed; opacity: 1; }
.code-input-wrap { position: relative; display: block; width: 100%; }
.code-input-wrap input { width: 100%; padding-right: 62px; }
.code-input-wrap .inline-select-btn { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); padding: 5px 12px; border: none; border-radius: 8px; background: #2563eb; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.4; cursor: pointer; }
.code-input-wrap .inline-select-btn:hover { background: #1d4ed8; }
.select-dropdown { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(148,163,184,.36); border-radius: 14px; background: #fff; box-shadow: 0 18px 38px rgba(15,23,42,.14); }
.select-dropdown.hidden { display: none; }
.select-options { display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.select-option-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
#sampleCustomerDropdown { grid-template-columns: minmax(120px, 38%) minmax(160px, 1fr); align-items: start; min-width: min(560px, calc(100vw - 48px)); }
#sampleCustomerDropdown .select-options { max-height: 260px; }
#sampleCustomerRegionOptions { padding-right: 8px; border-right: 1px solid var(--line); }
.select-option { width: 100%; padding: 9px 10px; border-radius: 10px; background: #f8fbff; color: #334155; text-align: left; font-weight: 600; }
.select-option:hover { background: #eff6ff; color: #1d4ed8; }
.select-option.active { background: #dbeafe; color: #1d4ed8; border: 1px solid rgba(37,99,235,.18); }
.select-delete { padding: 8px 9px; border-radius: 9px; background: #fee2e2; color: #b91c1c; font-size: 12px; }
.select-delete:disabled { cursor: not-allowed; opacity: .45; background: #f1f5f9; color: #94a3b8; }
.select-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.native-picker { display: grid; gap: 8px; }
.native-picker input[type="search"], .native-picker select { width: 100%; }
.request-material-box { width: min(1080px, calc(100vw - 48px)); }
.request-material-search-row { margin-bottom: 12px; }
.request-material-columns { display: grid; gap: 14px; grid-template-columns: 220px 220px minmax(0, 1fr); align-items: start; }
.request-material-options { max-height: 360px; }

.form { display: grid; gap: 10px; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
.form.single { max-width: 420px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; background: #fff; }
input[readonly]:not([type="hidden"]), textarea[readonly] { background: #f1f5f9; color: #64748b; border-color: #dbe2ea; cursor: not-allowed; }
input[readonly]:not([type="hidden"]):focus, textarea[readonly]:focus { outline: none; box-shadow: 0 0 0 2px rgba(148,163,184,.16); }

@media (max-width: 1400px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .nav-shell { min-height: auto; }
  .nav-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-preview, .topbar, .login-panel, .data-page-head { grid-template-columns: 1fr; flex-direction: column; align-items: flex-start; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-base-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-master-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .textarea-field-row { grid-template-columns: 1fr; }
  .inline-select-row { grid-template-columns: 1fr; }
  .image-field-row { grid-template-columns: 1fr; }
  .product-base-params { grid-column: auto; grid-row: auto; }
  .product-base-form .product-base-params textarea { min-height: 120px; }
  .product-base-media-row { grid-template-columns: 1fr; }
  .product-description-field { grid-column: auto; }
  .product-file-archive { grid-column: auto; }
  .material-image-field { grid-column: auto; grid-row: auto; }
  .request-material-columns { grid-template-columns: 1fr; }
  .detail-lower-layout { grid-template-columns: 1fr; }
  .shipping-lower-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .page { padding: 10px; }
  .cards, .home-grid, .nav-list, .form { grid-template-columns: 1fr; }
  .module-preview { align-items: flex-start; }
  .field-grid { grid-template-columns: 1fr; }
  .record-form { grid-template-columns: 1fr; }
  .product-base-form { grid-template-columns: 1fr; }
  .material-master-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
