* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #111827; background: #f4f5f7; }
button, input, textarea, select { font: inherit; }
.loading { min-height: 100vh; display: grid; place-items: center; color: #64748b; }
.admin-login-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; background: #f4f5f7; }
.admin-login-panel { width: min(420px, 100%); border: 1px solid #d9dde3; border-radius: 8px; padding: 32px; background: #fff; box-shadow: 0 18px 50px rgba(17, 24, 39, .08); }
.admin-login-panel h1 { margin: 5px 0 8px; font-size: 28px; }
.admin-login-panel > p { color: #64748b; line-height: 1.6; }
.admin-login-kicker { margin: 0; color: #e83b4a !important; font-size: 12px; font-weight: 700; }
.admin-login-error { margin: 12px 0 0; padding: 9px 10px; border-radius: 6px; background: #fff1f2; color: #9f1239 !important; font-size: 13px; }
.admin-login-footer { width: min(420px, 100%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; color: #94a3b8; font-size: 12px; line-height: 1.4; }
.admin-login-footer a { display: inline-flex; align-items: center; gap: 5px; color: #94a3b8; text-decoration: none; }
.admin-login-footer a:hover { color: #64748b; }
.admin-beian-icon { width: 14px; height: 14px; display: inline-block; border-radius: 50%; background: linear-gradient(180deg, #9aa4b2 0%, #64748b 100%); position: relative; flex: 0 0 auto; }
.admin-beian-icon::after { content: ""; position: absolute; left: 4px; top: 3px; width: 6px; height: 7px; border: 1px solid rgba(255,255,255,.9); border-top-width: 2px; border-radius: 0 0 4px 4px; }
.admin-wechat-login { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; margin: 18px 0; padding: 14px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fafafa; }
.admin-login-qr { width: 132px; height: 132px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; color: #94a3b8; font-size: 13px; }
.admin-login-qr img { width: 100%; height: 100%; object-fit: contain; }
.admin-wechat-login-copy { display: grid; gap: 8px; }
.admin-wechat-login-copy strong { font-size: 16px; }
.admin-wechat-login-copy p { margin: 0; color: #64748b; font-size: 13px; line-height: 1.5; }
.admin-login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: #94a3b8; font-size: 12px; font-weight: 700; }
.admin-login-divider::before, .admin-login-divider::after { content: ""; height: 1px; flex: 1; background: #e5e7eb; }
.admin-logout { width: 100%; margin-top: 24px; padding: 9px 12px; border: 1px solid #374151; border-radius: 8px; background: transparent; color: #9ca3af; cursor: pointer; }
.admin-logout:hover { border-color: #9ca3af; color: #fff; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #111827; color: #fff; padding: 24px; }
.sidebar h1 { font-size: 20px; margin: 0 0 24px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar button { text-align: left; color: #d1d5db; background: transparent; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.sidebar button.active { background: #fff; color: #111827; }
.panel { padding: 24px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; color: #64748b; font-size: 13px; }
h2 { margin: 0; font-size: 24px; }
h3 { margin: 0 0 12px; font-size: 16px; }
.title-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.freight-settings { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.freight-chip { display: inline-flex; align-items: baseline; gap: 4px; border: 1px solid #e5e7eb; border-radius: 999px; background: #fff; color: #475569; padding: 5px 9px; font-size: 12px; white-space: nowrap; }
.freight-chip strong { color: #111827; border-bottom: 1px dashed #94a3b8; cursor: text; }
.inline-edit { width: 96px; border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.notice { margin: 0; background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; padding: 10px 12px; border-radius: 8px; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.metric { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; display: grid; gap: 8px; }
.metric span { color: #64748b; font-size: 13px; }
.metric strong { font-size: 28px; }
.overview-dashboard { display: grid; gap: 14px; }
.dashboard-hero { display: flex; justify-content: space-between; gap: 18px; align-items: stretch; background: linear-gradient(135deg, #fff 0%, #fff7fb 100%); }
.dashboard-hero h3 { font-size: 22px; margin-bottom: 6px; }
.dashboard-hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(118px, 1fr)); gap: 10px; min-width: min(520px, 100%); }
.dashboard-hero-metrics article,
.dashboard-todo-card { border: 1px solid #f1dbe4; border-radius: 8px; background: rgba(255, 255, 255, .78); padding: 12px; display: grid; gap: 5px; }
.dashboard-hero-metrics span,
.dashboard-todo-card span,
.dashboard-list-row small { color: #64748b; font-size: 12px; }
.dashboard-hero-metrics strong,
.dashboard-todo-card strong { font-size: 26px; line-height: 1; }
.dashboard-todos { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.dashboard-section-title { grid-column: 1 / -1; margin: 0; }
.dashboard-todo-card.hot { border-color: #fecdd3; background: #fff1f5; }
.dashboard-todo-card small { color: #94a3b8; font-size: 11px; line-height: 1.45; }
.dashboard-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 14px; align-items: start; }
.dashboard-trend-bars,
.dashboard-funnel,
.dashboard-list { display: grid; gap: 9px; }
.dashboard-trend-row,
.dashboard-funnel-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 52px; gap: 10px; align-items: center; font-size: 13px; }
.dashboard-trend-row div,
.dashboard-funnel-row div { height: 10px; border-radius: 999px; overflow: hidden; background: #f1f5f9; }
.dashboard-trend-row i,
.dashboard-funnel-row i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #111827, #e83b4a); }
.dashboard-trend-row span,
.dashboard-funnel-row span { color: #475569; }
.dashboard-trend-row strong,
.dashboard-funnel-row strong { text-align: right; font-size: 13px; }
.dashboard-list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid #e5e7eb; }
.dashboard-list-row:last-child { border-bottom: 0; }
.dashboard-list-row span { min-width: 0; display: grid; gap: 3px; }
.dashboard-list-row strong { overflow-wrap: anywhere; }
.dashboard-list-row b,
.dashboard-list-row em { border-radius: 999px; padding: 4px 8px; background: #f8fafc; color: #475569; font-size: 12px; font-style: normal; white-space: nowrap; }
.dashboard-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.workspace { display: grid; gap: 14px; }
.two-col { grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); align-items: start; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.weighing-layout { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.25fr); gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; }
.maintenance-stack { display: grid; gap: 14px; }
.section { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.section-head h3 { margin: 0; }
.collapse-head { cursor: pointer; border-radius: 8px; padding: 4px; margin: -4px -4px 8px; }
.collapse-head:hover { background: #f8fafc; }
.inquiry-tools { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
label { display: block; color: #475569; font-size: 12px; margin: 12px 0 6px; }
input, textarea, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; background: #fff; color: #111827; }
textarea { min-height: 72px; resize: vertical; }
.category-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { border: 1px solid #e5e7eb; border-radius: 999px; padding: 5px 9px; color: #475569; background: #f8fafc; font-size: 12px; }
.draggable-pill { cursor: grab; user-select: none; }
.draggable-pill.dragging { opacity: .5; border-color: #111827; color: #111827; }
.brand-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.brand-pill { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.brand-logo-preview { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; }
.logo-hint { opacity: .6; font-size: 11px; }
.album-meta-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .42fr); gap: 10px; }
.album-meta-row label { margin-top: 12px; }
.secondary { border: 1px solid #cbd5e1; background: #fff; color: #111827; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.secondary.active { background: #111827; color: #fff; border-color: #111827; }
.secondary.tiny { border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.secondary:disabled { opacity: .45; cursor: not-allowed; }
.hint { color: #64748b; display: block; margin-top: 6px; font-size: 12px; }
.upload-box { position: relative; border: 1px dashed #94a3b8; border-radius: 8px; padding: 18px; display: grid; place-items: center; gap: 4px; text-align: center; background: #f8fafc; cursor: pointer; }
.upload-box input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.upload-box strong { color: #111827; }
.upload-box small { color: #64748b; }
.thumb-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 10px; }
.thumb-card { margin: 0; min-width: 0; position: relative; }
.thumb-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; display: block; background: #f1f5f9; }
.thumb-card figcaption { color: #64748b; font-size: 11px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-delete { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border: 0; border-radius: 999px; background: rgba(17, 24, 39, .78); color: #fff; cursor: pointer; display: grid; place-items: center; line-height: 1; font-size: 16px; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.checkline input { width: auto; }
.sku-options { display: grid; gap: 8px; margin-top: 10px; }
.sku-option { width: 100%; text-align: left; border: 1px solid #e5e7eb; background: #fafafa; border-radius: 8px; padding: 10px; cursor: pointer; display: grid; gap: 4px; color: #111827; }
.sku-option.active { border-color: #111827; background: #f8fafc; }
.sku-option small { color: #64748b; overflow-wrap: anywhere; }
.allocation-row { justify-content: flex-start; }
.allocation-row.disabled { opacity: .48; }
.allocation-check { margin: 0; min-width: 52px; color: #111827; }
.allocation-check span { color: #64748b; }
.weighing-current { min-height: 360px; }
.primary { border: 0; background: #111827; color: #fff; border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.full { width: 100%; margin-top: 14px; }
.formula-box { border: 1px dashed #94a3b8; border-radius: 8px; background: #f8fafc; padding: 10px; margin-top: 12px; display: grid; gap: 4px; }
.formula-box span, .formula-box small { color: #64748b; font-size: 12px; }
.formula-box strong { color: #111827; overflow-wrap: anywhere; }
.list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; margin-bottom: 8px; background: #fafafa; }
.list-row div { min-width: 0; display: grid; gap: 4px; }
.list-row strong, .list-row small { overflow-wrap: anywhere; }
.list-row small { color: #64748b; }
.list-row.selected { border-color: #111827; background: #f8fafc; }
.quote-row { display: grid; align-items: stretch; }
.list-row .quote-summary-layout { display: flex; gap: 10px; align-items: center; width: 100%; cursor: pointer; }
.list-row .quote-summary-content { width: 100%; min-width: 0; display: block; }
.quote-summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.quote-summary > span:first-child { min-width: 0; display: grid; gap: 4px; }
.sku-image-button { border: 0; background: transparent; padding: 0; cursor: zoom-in; flex: 0 0 auto; }
.sku-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; display: block; background: #f1f5f9; }
.quote-editor { display: grid; gap: 8px; border-top: 1px solid #e5e7eb; margin-top: 8px; padding-top: 8px; }
.quote-core-fields { display: grid; grid-template-columns: 1.1fr 76px repeat(2, minmax(82px, 1fr)); gap: 8px; align-items: end; }
.quote-core-fields.compact { grid-template-columns: minmax(0, 1fr); }
.quote-core-fields label { margin-top: 0; }
.quote-estimated-row { display: grid; grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: end; padding: 8px; border: 1px dashed #d6d3d1; border-radius: 8px; background: #fffaf5; }
.quote-estimated-row label { margin-top: 0; }
.quote-estimated-row small { color: #8a8178; line-height: 1.45; }
.quote-estimated-button { align-self: end; white-space: nowrap; }
.money-input { display: flex; align-items: center; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; overflow: hidden; }
.money-input input { border: 0; border-radius: 0; min-width: 0; width: 100%; }
.quote-customer-note { display: flex; flex-wrap: wrap; gap: 0; align-items: baseline; padding: 8px 10px; border-radius: 8px; background: #eef2f7; color: #475569; font-size: 14px; line-height: 1.5; }
.quote-customer-note span { color: #64748b; font-size: 13px; font-weight: 600; }
.quote-customer-note strong { color: #111827; font-size: 14px; font-weight: 600; }
.quote-spec-moq-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; }
.quote-spec-moq-fields label { margin-top: 0; }
.quote-spec-placeholder { min-height: 1px; }
.quote-save-button { justify-self: end; width: min(100%, 220px); }
.split-title-button { margin-left: 6px; vertical-align: middle; }
.split-inline-actions { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; vertical-align: middle; }
.split-inline-actions .tiny { min-width: 24px; padding: 2px 7px; line-height: 1.2; }
.draft-sku-label { display: inline-flex; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: #f1ece7; color: #8a8178; font-size: 11px; font-weight: 500; vertical-align: middle; }
.quote-formula-preview { margin: 0; color: #64748b; font-size: 12px; }
.inline-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.row-cover { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; flex: 0 0 auto; background: #f1f5f9; }
.request-block { border-top: 1px solid #e5e7eb; padding-top: 12px; margin-top: 12px; }
.request-block.payment-selected { border-radius: 8px; box-shadow: inset 0 0 0 1px #111827; background: #f8fafc; padding: 12px; }
.request-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; cursor: pointer; border-radius: 8px; padding: 4px; margin-inline: -4px; }
.request-head:hover { background: #f8fafc; }
.request-head small { color: #64748b; display: block; margin-top: 3px; }
.request-actions { display: flex; gap: 8px; align-items: center; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 12px; padding: 4px 8px; white-space: nowrap; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.filter-pill { border: 1px solid #e5e7eb; border-radius: 999px; background: #fff; color: #475569; font-size: 12px; padding: 6px 10px; cursor: pointer; }
.filter-pill.active { background: #111827; border-color: #111827; color: #fff; }
.shipping-filter-pills { margin-top: 8px; }
.ship-card { align-items: flex-start; }
.ship-card-meta { color: #64748b; }
.status-badge.pending-quote { background: #fff7ed; color: #9a3412; }
.status-badge.partial-quoted { background: #fefce8; color: #854d0e; }
.status-badge.quoted { background: #eff6ff; color: #1d4ed8; }
.status-badge.customer-confirmed { background: #ecfdf5; color: #047857; }
.status-badge.payment-confirmed { background: #f3f4f6; color: #374151; }
.status-badge.unknown { background: #f8fafc; color: #475569; }
.badge.danger { background: #fef2f2; color: #991b1b; }
.badge.success { background: #ecfdf5; color: #047857; }
.badge.warning { background: #fff7ed; color: #9a3412; }
.album-reference-quote { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.album-reference-quote > strong { font-size: 14px; color: #111827; }
.album-published-main { min-width: 0; flex: 1; }
.list-row .album-published-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.album-published-actions > strong { color: #111827; font-size: 14px; }
.receipt-meta { margin: 3px 0 0; color: #64748b; font-size: 12px; }
.receipt-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.receipt-summary article { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; background: #f8fafc; display: grid; gap: 4px; }
.receipt-summary span { color: #64748b; font-size: 12px; }
.receipt-summary strong { font-size: 16px; overflow-wrap: anywhere; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.receipt-table th, .receipt-table td { text-align: left; border-bottom: 1px solid #e5e7eb; padding: 8px; vertical-align: top; }
.receipt-table th { color: #475569; background: #f8fafc; font-weight: 600; }
.inventory-table strong, .inventory-table small { display: block; overflow-wrap: anywhere; }
.inventory-table small { color: #64748b; margin-top: 3px; }
.inventory-summary-row { cursor: pointer; }
.inventory-summary-row:hover { background: #f8fafc; }
.inventory-detail-box { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; }
.inventory-detail-box h3 { margin-bottom: 8px; }
.history-row { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; margin-bottom: 8px; background: #fff; }
.history-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; cursor: pointer; }
.history-head small { display: block; color: #64748b; margin-top: 3px; }
.detail-list { display: grid; gap: 8px; margin: 12px 0; }
.detail-list p { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; margin: 0; }
.detail-list span { color: #64748b; font-size: 12px; }
.detail-list strong { font-size: 13px; overflow-wrap: anywhere; }
.template-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; background: #fafafa; margin-top: 10px; }
.template-card h3 small { color: #64748b; font-weight: 500; margin-left: 6px; }
.template-weight-summary span { border-bottom: 1px dashed #94a3b8; cursor: text; }
.template-weight-summary .inline-edit { margin: 0 4px; width: 72px; }
.template-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.template-fields label { margin-top: 0; }
.template-fields .span-2 { grid-column: span 2; }
.print-actions { margin-top: 12px; }
.ship-actions { margin-top: 12px; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 12px; background: #f8fafc; }
.official-logistics-panel { display: grid; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid #dbe4ee; border-radius: 8px; background: #f8fafc; }
.official-logistics-panel .section-head { margin-bottom: 0; }
.logistics-config-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.logistics-config-summary span { padding: 5px 8px; border: 1px solid #fecaca; border-radius: 999px; color: #991b1b; background: #fff7f7; font-size: 12px; }
.logistics-config-summary span.ready { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }
.logistics-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.logistics-actions button { flex: 1 1 150px; }
.logistics-error { margin: 0; padding: 9px 10px; border-left: 3px solid #dc2626; color: #991b1b; background: #fff1f2; font-size: 12px; }
.express-label-frame { width: 100%; min-height: 540px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
.manual-waybill-panel > button { margin-bottom: 8px; }
.ship-actions label { margin-top: 0; }
.thermal-slip { width: min(320px, 100%); margin: 14px auto 0; border: 1px solid #111827; border-radius: 6px; padding: 12px; background: #fff; color: #111827; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.thermal-slip-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; border-bottom: 1px dashed #111827; padding-bottom: 8px; margin-bottom: 8px; }
.thermal-slip-head strong { font-size: 16px; }
.thermal-slip-line { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding: 4px 0; border-bottom: 1px dashed #e5e7eb; }
.thermal-slip-line span,
.thermal-slip-items > span { color: #475569; }
.thermal-slip-line strong { font-weight: 600; overflow-wrap: anywhere; }
.thermal-slip-items { padding-top: 8px; }
.thermal-slip-items ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.payment-panel { position: sticky; top: 16px; }
.payment-summary { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 10px; align-items: center; margin-bottom: 14px; }
.payment-summary small { color: #64748b; }
.payment-line { display: grid; gap: 10px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; margin-bottom: 8px; background: #fafafa; }
.payment-line.muted { opacity: .68; }
.payment-line small { color: #64748b; display: block; margin-top: 3px; }
.payment-line-main { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.payment-finalize-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; }
.payment-finalize-grid label { margin-top: 0; }
.payment-price { display: grid; justify-items: end; gap: 5px; white-space: nowrap; }
.sku-preview { grid-column: 1 / -1; margin: 0; color: #111827; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
.payment-moq-note { margin: 0 0 10px; border: 1px solid #fed7aa; border-radius: 8px; background: #fff7ed; color: #9a3412; padding: 9px 10px; font-size: 13px; line-height: 1.5; }
.payment-moq-note strong { color: #7c2d12; }
.payment-methods { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid #e5e7eb; margin-top: 12px; padding-top: 12px; }
.payment-methods > span { color: #64748b; margin-right: 2px; }
.payment-methods label { display: inline-flex; align-items: center; gap: 5px; margin: 0; border: 1px solid #dbe3ee; border-radius: 999px; padding: 6px 10px; background: #fff; color: #334155; font-size: 13px; cursor: pointer; }
.payment-methods input { width: auto; margin: 0; accent-color: #111827; }
.payment-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid #e5e7eb; margin-top: 12px; padding-top: 12px; }
.payment-total span { color: #64748b; }
.payment-total strong { font-size: 24px; }
.payment-discount { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; }
.payment-discount span { color: #e83b4a; }
.payment-discount strong { color: #e83b4a; font-size: 20px; }
.empty { color: #64748b; margin: 0; }
.image-preview-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15, 23, 42, .72); display: grid; place-items: center; padding: 24px; }
.image-preview { width: min(720px, 100%); max-height: calc(100vh - 48px); margin: 0; background: #fff; border-radius: 8px; padding: 12px; position: relative; display: grid; gap: 10px; }
.image-preview img { width: 100%; max-height: calc(100vh - 150px); object-fit: contain; display: block; border-radius: 6px; background: #f8fafc; }
.image-preview figcaption { display: grid; gap: 4px; color: #111827; }
.image-preview figcaption small { color: #64748b; }
.image-preview-close { position: absolute; top: 12px; right: 12px; border: 0; border-radius: 999px; padding: 6px 10px; background: rgba(17, 24, 39, .86); color: #fff; cursor: pointer; }
.moq-workspace { grid-template-columns: minmax(360px, 1fr) minmax(520px, 1.35fr); align-items: start; }
.moq-pool-row { cursor: pointer; }
.moq-pool-row.completed { background: #f8fafc; }
.moq-search { margin: 10px 0 12px; }
.completed-pools { margin-top: 18px; padding-top: 12px; border-top: 1px solid #e5e7eb; }
.moq-detail-panel { position: sticky; top: 16px; }
.moq-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.moq-actions .secondary:active { background: #111827; color: #fff; border-color: #111827; }
.moq-replenish-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 12px; margin-bottom: 14px; background: #f8fafc; }
.moq-replenish-form .full { grid-column: 1 / -1; }
.secondary.danger { background: #fff; color: #991b1b; border-color: #dc2626; }
.secondary.danger:active,
.secondary.danger.active { background: #dc2626; color: #fff; border-color: #dc2626; }
hr { border: 0; border-top: 1px solid #e5e7eb; margin: 18px 0; }

.settings-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.settings-table th,
.settings-table td { text-align: left; border-bottom: 1px solid #e5e7eb; padding: 10px 8px; vertical-align: middle; }
.settings-table th { color: #475569; background: #f8fafc; font-weight: 600; }
.settings-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
.settings-table .masked-value { color: #94a3b8; letter-spacing: 2px; }
.settings-table .inline-edit { width: 240px; }
.settings-table .secondary.tiny + .secondary.tiny { margin-left: 4px; }
.settings-card { margin-top: 14px; padding: 14px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f8fafc; }
.settings-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.settings-card h4 { margin: 0; font-size: 15px; color: #111827; }
.setting-label { font-weight: 600; color: #111827; margin-bottom: 4px; }
.secret-status { display: inline-flex; align-items: center; min-width: 52px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.secret-status--configured { color: #166534; background: #dcfce7; }
.secret-status--missing { color: #9f1239; background: #ffe4e6; }
.advanced-toggle { margin-top: 10px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar nav { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .two-col, .grid, .weighing-layout, .moq-workspace, .receipt-summary, .dashboard-main, .dashboard-source-grid, .dashboard-hero-metrics { grid-template-columns: 1fr; }
  .dashboard-hero { flex-direction: column; }
  .album-meta-row { grid-template-columns: 1fr; }
  .inquiry-tools { grid-template-columns: 1fr; }
  .quote-core-fields,
  .quote-estimated-row,
  .quote-spec-moq-fields { grid-template-columns: 1fr; }
  .request-head, .request-actions, .payment-line-main { align-items: flex-start; flex-direction: column; }
  .payment-finalize-grid { grid-template-columns: 1fr; }
  .payment-panel { position: static; }
  .moq-detail-panel { position: static; }
  .moq-actions, .moq-replenish-form { grid-template-columns: 1fr; }
  .template-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-list p { grid-template-columns: 1fr; }
  .inline-fields { grid-template-columns: 1fr; }
  .topbar, .title-row, .history-head { align-items: flex-start; flex-direction: column; }
  .receipt-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ───────── Brand page ───────── */

.brand-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.brand-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-toolbar-right {
  color: #64748b;
  font-size: 13px;
}
.brand-search-input {
  width: 220px;
}
.brand-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
}
.brand-toggle-label input {
  width: auto;
}
.brand-create-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.brand-create-row input {
  flex: 1;
  max-width: 320px;
}
.brand-create-row .primary {
  margin-top: 0;
  white-space: nowrap;
}
.brand-table-wrap {
  overflow-x: auto;
}
.brand-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.brand-table th {
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  padding: 10px 8px;
  color: #64748b;
  font-weight: 600;
  background: #f8fafc;
}
.brand-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  vertical-align: middle;
}
.brand-row.inactive {
  opacity: .55;
}
.brand-row.dragging {
  opacity: .4;
  background: #f1f5f9;
}
.drag-handle {
  cursor: grab;
  color: #94a3b8;
  font-size: 16px;
  user-select: none;
  width: 24px;
}
.logo-cell {
  width: 48px;
}
.brand-logo-thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  display: block;
}
.logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px dashed #94a3b8;
  border-radius: 4px;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
}
.logo-placeholder:hover {
  border-color: #111827;
  color: #111827;
}
.inline-edit-input {
  width: 200px;
}
.status-badge.active {
  color: #047857;
}
.status-badge.inactive {
  color: #94a3b8;
}
.action-cell {
  white-space: nowrap;
}
.action-btn {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  margin-right: 4px;
}
.action-btn:hover {
  border-color: #111827;
  color: #111827;
}
.action-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.save-btn {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.cancel-btn {
  border-color: #94a3b8;
}
.toggle-btn {
  color: #991b1b;
  border-color: #fecaca;
}
.empty-cell {
  text-align: center;
  color: #94a3b8;
  padding: 32px 8px;
}

@page { size: 100mm 150mm; margin: 0; }
@page thermal-slip { size: 80mm auto; margin: 0; }
@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  .thermal-slip,
  .thermal-slip * { visibility: visible; }
  .thermal-slip { page: thermal-slip; position: absolute; left: 0; top: 0; width: 80mm; margin: 0; border: 0; border-radius: 0; padding: 3mm; box-shadow: none; }
}

/* ───────── Brand logo automation ───────── */

.maintenance-create-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.maintenance-create-row .primary { white-space: nowrap; }
.brand-maintenance-head { align-items: flex-start; }
.brand-logo-file-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.brand-management-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.brand-management-item { min-width: 0; min-height: 146px; display: grid; grid-template-rows: 56px auto 32px; gap: 8px; justify-items: center; align-items: center; padding: 11px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fafafa; text-align: center; }
.brand-management-item:hover { border-color: #cbd5e1; background: #fff; }
.admin-brand-logo-circle { width: 56px; height: 56px; display: grid; place-items: center; overflow: hidden; border: 1px solid #eceff3; border-radius: 50%; background: #fff; }
.admin-brand-logo-circle img { display: block; width: auto; height: auto; max-width: 90%; max-height: 52%; object-fit: contain; }
.admin-brand-logo-fallback { display: -webkit-box; max-width: 48px; max-height: 24px; overflow: hidden; padding: 0 3px; color: #475569; font-size: 10px; font-weight: 700; line-height: 1.2; text-align: center; word-break: break-word; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.brand-management-copy { min-width: 0; width: 100%; display: grid; justify-items: center; gap: 3px; }
.brand-management-copy strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.brand-management-copy small { color: #64748b; font-size: 11px; }
.brand-logo-action { width: 100%; padding-block: 6px; font-size: 12px; }
.brand-logo-action.missing { border-color: #fecdd3; color: #be123c; background: #fff1f2; }
.brand-logo-modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 28px; background: rgba(15, 23, 42, .42); }
.brand-logo-modal { width: min(880px, 100%); max-height: calc(100vh - 56px); overflow: auto; border: 1px solid #d9dde3; border-radius: 8px; background: #fff; box-shadow: 0 24px 80px rgba(15, 23, 42, .18); }
.brand-logo-modal-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 18px 20px 15px; border-bottom: 1px solid #e5e7eb; }
.brand-logo-modal-head h3 { margin: 0; }
.brand-logo-modal-head p { margin: 5px 0 0; color: #64748b; font-size: 12px; }
.brand-logo-modal-close { padding: 6px 9px; font-size: 12px; }
.brand-logo-compare { display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); gap: 14px; align-items: center; padding: 20px; }
.brand-logo-preview-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #64748b; font-size: 12px; }
.brand-logo-preview-label strong { color: #111827; }
.brand-logo-preview-stage { min-height: 290px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 8px; background-color: #f8fafc; background-image: linear-gradient(45deg, #eef1f5 25%, transparent 25%), linear-gradient(-45deg, #eef1f5 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eef1f5 75%), linear-gradient(-45deg, transparent 75%, #eef1f5 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; }
.brand-logo-preview-stage > img { width: min(82%, 300px); max-height: 250px; object-fit: contain; background: #fff; }
.brand-logo-result-circle { width: 230px; height: 230px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e4e7eb; border-radius: 50%; background: #fff; box-shadow: 0 8px 28px rgba(17, 24, 39, .06); }
.brand-logo-result-circle img { display: block; width: auto; height: auto; max-width: 90%; max-height: 52%; object-fit: contain; }
.brand-logo-result-circle small { color: #94a3b8; font-size: 12px; }
.brand-logo-process-copy { display: grid; justify-items: center; gap: 7px; color: #64748b; font-size: 11px; text-align: center; }
.brand-logo-process-copy strong { color: #111827; font-size: 12px; }
.brand-logo-result-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 17px; }
.brand-logo-result-meta span { padding: 5px 8px; border-radius: 999px; color: #475569; background: #f1f5f9; font-size: 11px; }
.brand-logo-error { margin: 0 20px 17px; padding: 9px 10px; border-radius: 8px; color: #9f1239; background: #fff1f2; font-size: 12px; }
.brand-logo-modal-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid #e5e7eb; background: #fafafa; }
.brand-logo-modal-foot small { color: #64748b; }
.brand-logo-modal-foot > div { display: flex; gap: 8px; }

@media (max-width: 1180px) {
  .brand-management-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .maintenance-create-row { grid-template-columns: 1fr; }
  .brand-management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-logo-compare { grid-template-columns: 1fr; }
  .brand-logo-preview-stage { min-height: 240px; }
  .brand-logo-process-copy { grid-template-columns: 1fr auto 1fr; align-items: center; }
  .brand-logo-modal-foot { align-items: flex-start; flex-direction: column; }
}

.home-page-editor { display: grid; gap: 18px; }
.home-page-editor button,
.home-page-editor input,
.home-page-editor textarea { min-height: 44px; }
.home-page-editor-header { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.home-page-editor-header h2 { margin: 4px 0 8px; }
.home-page-editor-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 22px; align-items: start; }
.home-page-editor-form { min-width: 0; display: grid; gap: 16px; }
.home-page-image-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.home-page-image-slot { min-width: 0; padding: 10px; border: 1px solid #e9e3dc; border-radius: 14px; display: grid; gap: 8px; background: #fff; }
.home-page-image-slot > img,
.home-page-image-slot > span { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: #f4f0eb; display: grid; place-items: center; }
.home-page-image-slot input[type="file"] { width: 100%; min-height: auto; }
.home-page-slot-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.home-page-slot-actions button { min-height: 36px; flex: 1; }
.home-page-field,
.home-page-guide-editor { display: grid; gap: 8px; }
.home-page-guide-editor { padding: 14px; border: 1px solid #e9e3dc; border-radius: 14px; background: #fff; }
.home-page-guide-editor label { display: grid; gap: 6px; }
.home-page-editor-actions { display: flex; justify-content: flex-end; gap: 10px; }
.home-page-history { display: grid; gap: 8px; }
.home-page-history article { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee8e1; }
.home-page-preview { position: sticky; top: 16px; display: grid; gap: 10px; }
.home-page-preview .home-first-screen,
.home-page-preview .home-guide-screen { position: relative; min-height: 430px; overflow: hidden; border: 1px solid #e9e3dc; border-radius: 18px; background: #fff; }
.home-page-preview .home-golden-logo { position: absolute; width: 42%; left: 38.2%; top: 34%; transform: translate(-50%, -50%); }
.home-page-preview .home-nine-grid { position: absolute; left: 12px; right: 12px; bottom: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.home-page-preview .home-nine-grid span { aspect-ratio: 1; background: #f4f0eb center/cover no-repeat; }
.home-page-preview .home-guide-card { padding: 24px 18px; display: grid; gap: 12px; }
.home-page-preview .home-guide-card h4 { margin: 0; font-size: 22px; }
.home-page-preview .home-guide-card p { margin: 4px 0 0; color: #6f7379; }

@media (max-width: 980px) {
  .home-page-editor-layout { grid-template-columns: 1fr; }
  .home-page-preview { position: static; }
}

@media (max-width: 560px) {
  .home-page-editor-header,
  .home-page-history article { align-items: stretch; flex-direction: column; }
  .home-page-image-grid { gap: 6px; }
  .home-page-image-slot { padding: 6px; }
}

/* ───────── Product AI editor ───────── */

.album-list-actions { display: grid; gap: 8px; justify-items: end; }
.product-editor-backdrop { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .46); }
.product-editor { width: min(680px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 20px; border: 1px solid #d9dde3; border-radius: 10px; background: #fff; box-shadow: 0 24px 80px rgba(15, 23, 42, .2); }
.product-editor-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.product-editor-head h3 { margin: 2px 0 0; }
.product-editor-head small { color: #64748b; }
.product-ai-status { color: #64748b; font-size: 12px; }
.product-ai-status.is-running { color: #0369a1; }
.product-ai-status.is-completed { color: #166534; }
.product-ai-status.is-failed,
.product-ai-status.is-duplicate { color: #be123c; }
.product-editor-name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 18px; }
.product-editor-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-switch { min-width: 112px; white-space: nowrap; }
.product-editor-warning { margin: 10px 0 0; color: #be123c; font-size: 12px; }
.product-tag-editor { margin-top: 18px; }
.product-tag-editor h4 { margin: 0 0 8px; font-size: 13px; }
.product-tag-list { min-height: 28px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.plain-tag { padding: 2px 0; border: 0; color: #475569; background: transparent; font-size: 13px; }
.plain-tag:hover { color: #be123c; background: transparent; }
.manual-tag-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.product-editor-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 22px; padding-top: 16px; border-top: 1px solid #e5e7eb; }

@media (max-width: 720px) {
  .product-editor-head { grid-template-columns: 1fr auto; }
  .product-editor-head .product-ai-status { grid-row: 2; }
  .product-editor-name-row,
  .manual-tag-row { grid-template-columns: 1fr; }
  .album-list-actions { justify-items: start; }
}
