/* 多账户库存 ERP - 后台样式 */
* { box-sizing: border-box; }
:root {
  --ink: #1d2b3a;
  --muted: #5f6c7b;
  --line: #dbe4ee;
  --bg: #f3f6fa;
  --panel: #ffffff;
  --blue: #0f7bdc;
  --green: #21a67a;
  --red: #d64545;
  --amber: #b6812b;
  --radius: 8px;
  --shadow: 0 12px 32px rgba(18,33,61,.08);
}
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}
a { color: var(--blue); text-decoration: none; }

/* 顶栏 */
.topbar {
  background: var(--ink);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  display: flex; align-items: center; gap: 20px;
  max-width: 1280px; margin: 0 auto; padding: 12px 20px;
}
.brand { color: #fff; font-weight: 800; font-size: 17px; }
.topnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topnav a {
  color: rgba(255,255,255,.72); padding: 8px 12px; border-radius: 7px; font-size: 14px;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,.12); }
.topnav a.active { color: #fff; background: rgba(255,255,255,.18); font-weight: 700; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.userbox .role { background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.userbox .btn { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
.dashboard-entry {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 16px; border: 1px solid #f6c35f;
  border-radius: 8px; background: #f6c35f; color: #3b2a0c;
  font-size: 15px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 5px 14px rgba(246,195,95,.25);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.dashboard-entry:hover {
  border-color: #ffd980; background: #ffd980; color: #3b2a0c;
  transform: translateY(-1px);
}

.container { max-width: 1280px; margin: 0 auto; padding: 26px 20px 60px; }
/* Order pages: wider container */
main:has(.order-entry-grid),
main:has(.product-workspace),
main:has(.order-page-title) {
  max-width: min(1800px, calc(100vw - 40px));
}
h1 { font-size: 24px; margin: 0 0 18px; }
.order-page-title {
  width: min(1800px, calc(100vw - 40px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}
h2 { font-size: 18px; margin: 0 0 12px; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 30px; margin: 8px 0 2px; }
.stat small { color: var(--muted); }

/* 卡片与表格 */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #f6f9fc; font-weight: 700; color: #314156; white-space: nowrap; }
.table-sticky-wrap { overflow: visible; }
.table-sticky thead th {
  position: sticky;
  top: var(--sticky-top, 121px);
  z-index: 20;
  background: #f6f9fc;
  box-shadow: 0 1px 0 var(--line);
}
@media (max-width: 767px) {
  .table-sticky-wrap { overflow-x: auto; }
  .table-sticky thead th { top: 0; }
}
.table tr:hover td { background: #fafcff; }
.table-inner td { background: #fafcff; }
.empty { color: var(--muted); text-align: center; padding: 22px !important; }
.muted { color: var(--muted); font-size: 13px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #eef2f6; color: #314156; }
.tag-ok { background: #e3f6ee; color: #0f7a55; }
.tag-warn { background: #fff4dc; color: #9a6a12; }
.tag-err { background: #fde8e8; color: #b33636; }
.tag-gray { background: #eef0f2; color: #66707a; }
.tag-blue { background: #e3f0fd; color: #0f5ea8; }
.perm-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.perm-check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: 13px; }
.perm-check input { width: 16px; height: 16px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { border-color: var(--blue); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: #0b6ec2; }
.btn-ok { background: var(--green); color: #fff; border-color: var(--green); }
.btn-print { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-danger { background: #d84343; color: #fff; border-color: #d84343; }
.btn-danger:hover { background: #b93636; border-color: #b93636; }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; min-height: 44px; }
.dlg-mask {
  position: fixed; inset: 0; z-index: 2200; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 25, 38, 0.55); padding: 20px;
}
.dlg-mask[hidden] { display: none !important; }
.dlg-box {
  background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 420px; max-width: 100%; padding: 22px 24px;
}
.dlg-box h3 { margin: 0 0 10px; font-size: 18px; }
.dlg-info { color: var(--ink); line-height: 1.5; margin: 0 0 14px; }
.dlg-field { display: block; }
.dlg-field > span { display: block; margin-bottom: 6px; color: #4b5c70; font-size: 13px; font-weight: 700; }
.dlg-field .in { display: block; width: 100%; }
.dlg-note { margin: 10px 0 0; font-size: 12px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.dlg-box-lg { width: 640px; }
.atc-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
.atc-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.atc-row:last-child { border-bottom: 0; }
.atc-row-info { flex: 1; min-width: 0; }
.atc-row-code { font-weight: 700; color: var(--ink); }
.atc-row-name { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atc-row-file { display: flex; align-items: center; gap: 8px; }
.atc-row-file input[type="file"] { max-width: 160px; font-size: 12px; }
.atc-feedback { margin-top: 10px; font-size: 13px; }
.atc-feedback .ok { color: #0f7a55; }
.atc-feedback .err { color: #b33636; }
.daterange { display: inline-block; }
.daterange-btn { min-width: 150px; }
.per-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dr-pop {
  position: fixed; z-index: 2300; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 12px; width: 300px;
}
.dr-pop[hidden] { display: none !important; }
.dr-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dr-nav { border: 0; background: none; font-size: 18px; cursor: pointer; padding: 2px 8px; color: var(--ink); border-radius: 6px; }
.dr-nav:hover { background: #eef4fb; }
.dr-month { font-weight: 700; font-size: 14px; }
.dr-week, .dr-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dr-week span { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.dr-day {
  border: 0; background: none; cursor: pointer; padding: 6px 0; border-radius: 6px; font-size: 13px; color: var(--ink);
}
.dr-day:hover { background: #eef4fb; }
.dr-day.in-range { background: #dbeafe; border-radius: 0; }
.dr-day.start, .dr-day.end { background: var(--blue); color: #fff; font-weight: 700; }
.dr-day.today { box-shadow: inset 0 0 0 1px var(--blue); }
.dr-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dr-label { font-size: 12px; color: var(--muted); }
.btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 套盒包邮报价单 */
.quote-page { max-width: 1440px; }
.quote-toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.quote-toolbar label { min-width: 240px; flex: 1 1 300px; margin: 0; }
.quote-toolbar .btn { flex: 0 0 auto; }
.quote-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(440px, .95fr); gap: 18px; align-items: start; }
.quote-catalog-card, .quote-draft-card { min-width: 0; }
.quote-catalog-table th, .quote-catalog-table td { vertical-align: middle; }
.quote-catalog-table .quote-product-name { min-width: 180px; }
.quote-product-thumb, .quote-draft-thumb { width: 52px; height: 52px; object-fit: contain; display: block; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.quote-image-empty { display: grid; place-items: center; width: 52px; height: 52px; color: var(--muted); background: #f6f9fc; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.quote-draft-product { display: flex; align-items: center; gap: 9px; min-width: 220px; }
.quote-draft-table { min-width: 620px; }
.quote-draft-table td { vertical-align: middle; }
.quote-draft-table .quote-qty { width: 82px; min-height: 32px; padding: 5px 7px; }
.quote-draft-table .quote-remove { color: var(--red); }
.quote-discount-controls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; padding-top: 14px; }
.quote-discount-controls label { margin: 0; min-width: 150px; }
.quote-draft-summary { width: min(100%, 360px); margin: 16px 0 0 auto; border-top: 1px solid var(--line); }
.quote-draft-summary > div { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding-top: 10px; }
.quote-draft-summary > div > span { color: var(--muted); }
.quote-draft-total { border-top: 1px solid var(--line); margin-top: 10px; font-size: 16px; }
.quote-draft-total strong { color: var(--blue); font-size: 25px; }
.quote-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.quote-meta-grid .span-2 { grid-column: span 2; }
.quote-meta-grid .span-3 { grid-column: 1 / -1; }
.quote-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.quote-empty { padding: 28px 12px !important; text-align: center; color: var(--muted); }
.quote-manage-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.quote-manage-note { padding: 12px 14px; background: #fff8e8; border: 1px solid #f0d796; border-radius: 7px; color: #765718; }
.quote-print-sheet { width: 860px; margin: 0 auto; padding: 30px 34px; background: #fff; color: #1d2b3a; }
.quote-print-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #1d2b3a; padding-bottom: 18px; margin-bottom: 18px; }
.quote-print-head h2 { margin: 0; font-size: 25px; }
.quote-print-subtitle { color: #5f6c7b; margin-top: 5px; }
.quote-print-meta { display: grid; grid-template-columns: 105px 1fr; gap: 7px 12px; min-width: 300px; font-size: 13px; }
.quote-print-meta .label { color: #5f6c7b; }
.quote-print-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.quote-print-table th, .quote-print-table td { border: 1px solid #cfd9e4; padding: 8px 9px; text-align: left; vertical-align: middle; }
.quote-print-table th { background: #f1f5f9; }
.quote-print-table .right { text-align: right; white-space: nowrap; }
.quote-print-table .center { text-align: center; }
.quote-print-summary { width: 330px; max-width: 100%; margin: 16px 0 0 auto; border: 1px solid #cfd9e4; page-break-inside: avoid; }
.quote-print-summary > div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 10px; font-size: 13px; }
.quote-print-summary > div + div { border-top: 1px solid #dce4ed; }
.quote-print-summary-total { background: #f1f5f9; font-size: 18px !important; font-weight: 800; }
.quote-print-summary-total strong { color: #0f5ea8; }
.quote-print-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid #cfd9e4; color: #6c7784; font-size: 12px; }
.quote-print-product-image { width: 54px; height: 54px; object-fit: contain; display: block; margin: 0 auto; }
.quote-print-no-image { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto; background: #f6f9fc; color: #8b96a3; font-size: 11px; }
@media print {
  .quote-print-sheet { width: auto; margin: 0; padding: 0; }
}
@media (max-width: 980px) {
  .quote-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .quote-meta-grid { grid-template-columns: 1fr; }
  .quote-meta-grid .span-2, .quote-meta-grid .span-3 { grid-column: auto; }
  .quote-print-sheet { width: 100%; padding: 18px; }
  .quote-print-head { display: block; }
  .quote-print-meta { min-width: 0; margin-top: 14px; }
}

/* 表单 */
label { display: block; font-size: 13px; color: #314156; font-weight: 700; margin: 10px 0 4px; }
.in {
  width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; background: #fff;
}
.in-sm { width: 110px; }
textarea.in { resize: vertical; }
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }

/* 商品库存页工具栏: 搜索框固定宽度, 避免按钮被换行错位 */
.product-toolbar .inline .in { width: 240px; }
.filterbar { gap: 8px; margin-bottom: 10px; }
.filterbar-label {
  flex: 0 0 auto; color: var(--muted); font-size: 13px; font-weight: 700;
  margin-right: 2px;
}
.warehouse-filterbar,
.category-filterbar { padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.category-filterbar { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* 提示 */
.flash { padding: 12px 14px; border-radius: 7px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: #e3f6ee; color: #0f7a55; }
.flash.err { background: #fde8e8; color: #b33636; }

/* 客户跟进工作台: 沿用 ERP 的蓝白后台信息密度 */
.cw-head, .cw-section-head, .cw-detail-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px;
}
.cw-head h2, .cw-section-head h2, .cw-detail-top h2 { margin: 4px 0 5px; }
.cw-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-kicker { color: var(--blue); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 800; margin: 0; }
.cw-stats { grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.cw-stat-link { color: var(--ink); transition: transform .15s ease, border-color .15s ease; }
.cw-stat-link:hover { transform: translateY(-2px); border-color: #a8cbed; }
.cw-stat-link b { color: var(--blue); }
.cw-create { padding: 0; overflow: hidden; }
.cw-create summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 15px 18px; }
.cw-create summary::-webkit-details-marker { display: none; }
.cw-create summary::after { content: "+"; color: var(--blue); font-size: 20px; margin-left: auto; }
.cw-create[open] summary::after { content: "−"; }
.cw-create-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; padding: 0 18px 18px; border-top: 1px solid var(--line); }
.cw-create-form .cw-form-action { align-self: end; padding-bottom: 4px; }
.cw-filter .in { width: auto; min-width: 160px; }
.cw-table td { vertical-align: middle; }
.cw-dashboard { margin-top: 28px; }
.cw-rank-grid, .cw-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cw-rank-card h3, .cw-followup-card h3, .cw-detail-grid .card > h3 { margin-top: 0; }
.cw-rank-row { display: grid; grid-template-columns: 32px minmax(110px, 1fr) minmax(110px, auto) 60px; gap: 8px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cw-rank-row:last-child { border-bottom: 0; }
.cw-rank-row strong { text-align: right; color: var(--blue); }
.cw-rank-no { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #eef4fb; color: #34658d; font-weight: 800; font-size: 12px; }
.cw-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.cw-wide { grid-column: 1 / -1; }
.cw-check { display: flex; align-items: center; gap: 7px; margin: 16px 0; }
.cw-check input { width: 16px; height: 16px; }
.cw-proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cw-proof-item { border: 1px solid var(--line); border-radius: 7px; padding: 12px; background: #fbfdff; }
.cw-proof-item > .muted { float: right; }
.cw-proof-thumbs { display: flex; gap: 6px; margin: 12px 0; min-height: 54px; }
.cw-proof-thumbs img { width: 54px; height: 54px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.cw-proof-form { display: flex; gap: 7px; align-items: center; }
.cw-file { min-width: 0; width: 100%; font-size: 12px; }
.cw-timeline article { border-left: 3px solid #c7dff5; padding: 0 0 14px 14px; margin: 0 0 13px 5px; }
.cw-timeline article p { margin: 6px 0; line-height: 1.6; white-space: normal; }
.cw-timeline article small, .cw-library-item small { color: var(--muted); }
.cw-library-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.cw-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cw-library-item { position: relative; min-height: 160px; }
.cw-library-title { display: flex; gap: 8px; align-items: flex-start; }
.cw-library-title h3 { margin: 0; font-size: 17px; }
.cw-library-item p { line-height: 1.65; white-space: normal; }
.cw-inline-form { margin-top: 12px; }
.cw-is-off { opacity: .6; }

/* 客户运营模块: ERP 蓝白底色上增加轻量游戏化的成长层 */
.cult-hero {
  display: flex; align-items: stretch; justify-content: space-between; gap: 24px;
  min-height: 220px; margin: -4px 0 18px; padding: 28px 32px;
  border: 1px solid #cfe2f5; border-radius: 12px; overflow: hidden;
  background: linear-gradient(115deg, #12395c 0%, #17649b 58%, #19a47f 140%);
  color: #fff; box-shadow: 0 16px 34px rgba(15,77,125,.17);
}
.cult-hero-copy { max-width: 700px; align-self: center; }
.cult-eyebrow { margin: 0 0 7px; color: #1977b8; font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.cult-hero .cult-eyebrow { color: #bde7ff; }
.cult-hero h2 { margin: 0 0 10px; font-size: 32px; letter-spacing: .02em; }
.cult-hero p:not(.cult-eyebrow) { margin: 0; color: rgba(255,255,255,.82); line-height: 1.7; }
.cult-hero-actions { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.cult-hero .btn { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.12); color: #fff; }
.cult-hero .btn-primary { background: #f3ba47; border-color: #f3ba47; color: #17304a; }
.cult-hero-seal {
  width: 180px; min-width: 180px; align-self: center; display: grid; place-content: center; text-align: center;
  aspect-ratio: 1; border: 1px solid rgba(255,255,255,.36); border-radius: 50%;
  background: rgba(8,39,65,.2); box-shadow: inset 0 0 0 8px rgba(255,255,255,.05);
}
.cult-hero-seal span, .cult-hero-seal small { color: rgba(255,255,255,.72); font-size: 12px; }
.cult-hero-seal b { display: block; margin: 7px 0 2px; color: #f8cd65; font-size: 27px; }
.cult-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.cult-metric { padding: 16px 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.cult-metric span, .cult-metric small { display: block; color: var(--muted); font-size: 12px; }
.cult-metric b { display: block; margin: 5px 0 2px; color: #17649b; font-size: 30px; }
.cult-metric b.is-green { color: #128364; }
.cult-metric b.is-gold { color: #a56a09; }
.cult-metric b.is-red { color: #b43a3a; }
.cult-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: stretch; }
.cult-panel { margin-bottom: 16px; padding: 20px; }
.cult-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.cult-panel-head h3 { margin: 0; font-size: 19px; }
.cult-rule, .cult-crown { padding: 4px 9px; border-radius: 999px; background: #eef6fc; color: #25618b; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cult-crown { background: #fff3d4; color: #9a650b; }
.cult-team-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 74px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf2f6; }
.cult-team-row:last-child { border-bottom: 0; }
.cult-row-title, .cult-realm > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cult-row-title span { font-size: 12px; font-weight: 700; }
.cult-row-main small, .cult-member small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.cult-team-row > strong { text-align: right; color: #17649b; font-size: 17px; }
.cult-team-row > strong em, .cult-top-person > b small { display: block; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; }
.cult-progress { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #e8eef4; }
.cult-progress i { display: block; height: 100%; border-radius: inherit; }
.cult-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #edf2f7; color: #54677b; font-weight: 800; font-size: 13px; }
.cult-rank-1 { background: #f7d579; color: #674700; }
.cult-rank-2 { background: #dce5ed; color: #3c5164; }
.cult-rank-3 { background: #efc6a1; color: #75411d; }
.cult-top-person { display: flex; align-items: center; gap: 12px; padding: 14px 0 20px; }
.cult-top-person h4 { margin: 0 0 4px; font-size: 18px; }
.cult-top-person p { margin: 0; color: var(--muted); font-size: 13px; }
.cult-top-person > b { margin-left: auto; text-align: right; color: #a56a09; font-size: 23px; }
.cult-avatar { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #dceefa; color: #17649b; font-size: 22px; font-weight: 800; }
.cult-avatar-sm { width: 36px; height: 36px; font-size: 15px; }
.cult-top-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #edf2f6; border-bottom: 1px solid #edf2f6; padding: 13px 0; }
.cult-top-stats span { color: var(--muted); font-size: 12px; text-align: center; }
.cult-top-stats b { display: block; color: var(--ink); font-size: 17px; margin-top: 3px; }
.cult-motto { margin-top: 16px; padding: 11px 12px; border-left: 3px solid #f0bf50; background: #fff9ea; color: #7b5b21; font-size: 13px; line-height: 1.6; }
.cult-leaderboard { margin-bottom: 0; }
.cult-leader-head, .cult-leader-row { display: grid; grid-template-columns: 50px minmax(175px, 1.2fr) minmax(180px, 1fr) 70px 70px 80px; gap: 12px; align-items: center; }
.cult-leader-head { padding: 8px 0; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.cult-leader-row { min-height: 64px; border-bottom: 1px solid #edf2f6; }
.cult-leader-row:last-child { border-bottom: 0; }
.cult-member { display: flex; align-items: center; gap: 9px; }
.cult-member b { display: block; }
.cult-realm span { color: var(--muted); font-size: 12px; }
.cult-leader-row > strong { color: #17649b; text-align: right; font-size: 17px; }
@media (max-width: 980px) {
  .cw-stats { grid-template-columns: repeat(3, 1fr); }
  .cw-create-form, .cw-proof-grid, .cw-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cult-metrics { grid-template-columns: repeat(2, 1fr); }
  .cult-grid { grid-template-columns: 1fr; }
  .cult-leader-head, .cult-leader-row { grid-template-columns: 42px minmax(160px, 1fr) minmax(160px, 1fr) 58px 58px 70px; }
}
@media (max-width: 767px) {
  .cw-head, .cw-section-head, .cw-detail-top { display: block; }
  .cw-head-actions { margin-top: 12px; }
  .cw-stats, .cw-rank-grid, .cw-detail-grid, .cw-create-form, .cw-form-grid, .cw-proof-grid, .cw-library-grid { grid-template-columns: 1fr; }
  .cw-wide { grid-column: auto; }
  .cw-rank-row { grid-template-columns: 28px 1fr 56px; }
  .cw-rank-row .muted { grid-column: 2; grid-row: 2; }
  .cw-rank-row strong { grid-column: 3; grid-row: 1 / span 2; }
  .cw-filter .in { width: 100%; }
  .cw-proof-form { display: block; }
  .cw-proof-form .btn { margin-top: 7px; }
  .cult-hero { display: block; padding: 24px; }
  .cult-hero-seal { width: 132px; min-width: 132px; margin: 22px auto 0; }
  .cult-hero-seal b { font-size: 21px; }
  .cult-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cult-metric { padding: 13px; }
  .cult-metric b { font-size: 24px; }
  .cult-panel { padding: 15px; }
  .cult-leader-head { display: none; }
  .cult-leader-row { grid-template-columns: 34px minmax(0, 1fr) 58px; gap: 8px; padding: 10px 0; }
  .cult-leader-row > span:nth-of-type(2), .cult-leader-row > span:nth-of-type(3) { display: none; }
  .cult-leader-row > strong { grid-column: 3; grid-row: 1 / span 2; }
  .cult-realm { grid-column: 2; }
}

/* 操作列 */
.act { white-space: nowrap; }
.act .btn { margin-right: 6px; }
.detail-row td { background: #fafcff !important; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pager .disabled { opacity: .5; cursor: not-allowed; }

/* 商品图片 */
.p-img { width: 52px; height: 52px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; }
.p-img-sm { width: 40px; height: 40px; }
.p-img-none { display: grid; place-items: center; color: #aab6c4; font-size: 11px; background: #f6f8fa; }
.p-image-tools { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.p-copy {
  position: relative; flex: 0 0 28px; width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #31506f; cursor: pointer;
}
.p-copy::before,
.p-copy::after {
  content: ""; position: absolute; width: 9px; height: 10px; border: 1.5px solid currentColor; border-radius: 1px;
}
.p-copy::before { top: 7px; left: 8px; }
.p-copy::after { top: 9px; left: 10px; background: #fff; }
.p-copy:hover { border-color: #0f7bdc; background: #f2f8ff; color: #0f7bdc; }
.p-copy:focus-visible { outline: 2px solid #0f7bdc; outline-offset: 2px; }
.p-copy:disabled { cursor: wait; opacity: .65; }

#pCopyStatus {
  position: fixed; z-index: 2100; bottom: 20px; left: 50%; pointer-events: none;
  transform: translate(-50%, 12px); padding: 8px 12px; border-radius: 6px;
  box-shadow: 0 10px 28px rgba(18,33,61,.2); font-size: 13px; font-weight: 600;
  opacity: 0; transition: opacity .16s ease, transform .16s ease;
}
#pCopyStatus.show { transform: translate(-50%, 0); opacity: 1; }
#pCopyStatus.ok { background: #e3f6ee; color: #0f7a55; }
#pCopyStatus.error { background: #fde8e8; color: #b33636; }

/* 悬停大图(动态浮层,悬停才加载) */
.p-thumb { position: relative; display: inline-block; cursor: zoom-in; }
#pZoomLayer {
  position: fixed; z-index: 1000; pointer-events: none; display: none;
  padding: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 16px 48px rgba(18,33,61,.3);
}
#pZoomLayer img { width: 300px; height: 300px; object-fit: contain; display: block; border-radius: 6px; }
#pZoomLayer.show { display: block; animation: pzoom .12s ease-out; }
@keyframes pzoom { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* 点击放大模态 */
#pModal {
  position: fixed; inset: 0; z-index: 2300; display: none;
  place-items: center; background: rgba(10,16,24,.72);
  backdrop-filter: blur(4px); cursor: zoom-out;
}
#pModal.show { display: grid; }
#pModal img {
  max-width: 90vw; max-height: 90vh; object-fit: contain;
  background: #fff; border-radius: 10px; padding: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
#pModal .modal-cap { position: fixed; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-size: 15px; }
#pModal .modal-close {
  position: fixed; top: 18px; right: 24px; width: 44px; height: 44px;
  border: 0; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff;
}
#pModal .modal-close:hover { background: rgba(255,255,255,.32); }

/* 订单编辑弹窗 */
.edit-modal {
  position: fixed; inset: 0; z-index: 2100; display: none;
  place-items: center; overflow: hidden; background: rgba(10,16,24,.6);
  backdrop-filter: blur(3px); padding: 16px;
}
.edit-modal.show { display: grid; }
.edit-modal-card {
  width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 32px); height: min(92vh, 980px); display: flex; flex-direction: column;
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.35); position: relative; z-index: 1;
}
.edit-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid #e2e8f0;
}
.edit-modal-head h3 { margin: 0; font-size: 18px; }
.edit-modal-close {
  border: 0; background: transparent; font-size: 28px; line-height: 1;
  cursor: pointer; color: #64748b; padding: 0 6px;
}
.edit-modal-close:hover { color: #1d2b3a; }
.edit-modal-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px; }
.edit-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.edit-tab {
  border: 1px solid #cbd5e1; background: #fff; padding: 7px 18px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.edit-tab.active { background: #0f7bdc; color: #fff; border-color: #0f7bdc; }
.edit-tab-panel .order-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.edit-tab-panel .order-form-grid label { min-width: 0; }
.edit-tab-panel .span-3 { grid-column: 1 / -1; }
.edit-items-table td { padding: 6px 8px; }
.edit-items-table .in-sm { width: 100%; min-width: 60px; }
.edit-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid #e2e8f0;
}
body.modal-open { overflow: hidden; }

/* 商品库选择弹窗 */
.edit-product-picker {
  position: fixed; inset: 0; z-index: 2200; display: grid;
  place-items: center; background: rgba(10,16,24,.55);
  backdrop-filter: blur(3px); padding: 20px;
}
.edit-product-picker[hidden] { display: none !important; }
.edit-product-picker-card {
  width: min(760px, 100%); max-height: 84vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.edit-product-picker-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.edit-product-picker-body .p-img { width: 40px; height: 40px; object-fit: contain; }

/* 登录页 */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: #f0f4f9;
}
.login-shell {
  display: grid; grid-template-columns: 1.05fr 1fr;
  width: min(920px, 100%);
  border-radius: 20px; overflow: hidden;
  background: #fff; box-shadow: 0 30px 80px rgba(18,33,61,.16);
}
/* 左侧品牌区 */
.login-brand {
  position: relative; display: flex; flex-direction: column;
  padding: 40px 44px; color: #fff; overflow: hidden;
  background: linear-gradient(150deg, #1b2b45 0%, #16466e 55%, #0f7bdc 120%);
}
.login-brand::before {
  content: ""; position: absolute; right: -70px; top: -70px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
}
.login-brand::after {
  content: ""; position: absolute; left: -80px; bottom: -110px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(33,166,122,.28), transparent 70%);
}
.login-brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-logo {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 12px; color: #fff; font-size: 22px; font-weight: 900;
  background: linear-gradient(135deg, #21a67a, #0f7bdc);
  box-shadow: 0 8px 22px rgba(15,123,220,.35);
}
.login-logo-sm { width: 40px; height: 40px; font-size: 19px; }
.login-brand-name { font-size: 15px; font-weight: 700; letter-spacing: .5px; opacity: .92; }
.login-brand-body { position: relative; z-index: 1; margin-top: 46px; }
.login-brand-body h2 { margin: 0 0 12px; font-size: 34px; line-height: 1.25; letter-spacing: 1px; font-weight: 800; }
.login-brand-body p { margin: 0; font-size: 14px; opacity: .78; line-height: 1.7; }
.login-features {
  position: relative; z-index: 1; list-style: none; margin: auto 0 0; padding: 0;
  display: grid; gap: 13px;
}
.login-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; opacity: .92;
}
.login-features svg { width: 17px; height: 17px; color: #6fe3bd; flex: 0 0 auto; }
/* 右侧表单区 */
.login-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 52px;
}
.login-head { text-align: center; margin-bottom: 26px; }
.login-head .login-logo { margin: 0 auto 16px; }
.login-head h3 { margin: 0 0 6px; font-size: 24px; color: #1d2b3a; }
.login-head p { margin: 0; font-size: 14px; color: #5f6c7b; }
.login-error {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; padding: 11px 14px;
  border-radius: 10px; font-size: 13.5px;
  background: #fdeaea; color: #b33636; border: 1px solid #f8d7d7;
}
.login-error svg { width: 17px; height: 17px; flex: 0 0 auto; }
.login-form { display: grid; gap: 16px; }
.login-field label { margin: 0 0 7px; font-size: 13px; font-weight: 700; color: #314156; }
.login-input {
  position: relative; display: flex; align-items: center;
}
.login-input-icon {
  position: absolute; left: 14px; width: 18px; height: 18px;
  color: #9aa8b8; pointer-events: none; transition: color .2s;
}
.login-input input {
  width: 100%; min-height: 48px; padding: 0 14px 0 42px;
  border: 1.5px solid #dbe4ee; border-radius: 10px;
  font: inherit; font-size: 15px; background: #f8fafc;
  color: #1d2b3a; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.login-input input::placeholder { color: #aab6c4; }
.login-input input:focus {
  background: #fff; border-color: #0f7bdc;
  box-shadow: 0 0 0 4px rgba(15,123,220,.12);
}
.login-input input:focus ~ .login-input-icon { color: #0f7bdc; }
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; margin-top: 4px; border: 0; border-radius: 10px;
  font: inherit; font-size: 15px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #0f7bdc, #21a67a);
  box-shadow: 0 10px 24px rgba(15,123,220,.3);
  transition: transform .15s, box-shadow .2s;
}
.login-btn:hover { box-shadow: 0 14px 30px rgba(15,123,220,.4); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }
.login-btn svg { width: 18px; height: 18px; }
.login-foot { margin: 22px 0 0; text-align: center; font-size: 13px; color: #9aa8b8; }

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 40px 28px; }
}

/* Order reporting form */
.order-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}
.paste-card textarea { min-height: 260px; line-height: 1.55; }
.paste-actions,
.product-search,
.order-form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.paste-actions .btn { min-width: 112px; }
.parse-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.5;
}
.parse-feedback[hidden] { display: none; }
.parse-feedback-summary { font-weight: 700; }
.parse-feedback ul { margin: 6px 0 0; padding-left: 20px; }
.parse-feedback.is-success { color: #0f7a55; background: #e3f6ee; border-color: #b8e6d4; }
.parse-feedback.is-warning { color: #9a6a12; background: #fff4dc; border-color: #f0d8a1; }
.parse-feedback.is-error { color: #b33636; background: #fde8e8; border-color: #f1c0c0; }

.order-form-section { margin-top: 18px; }
.order-form-section:first-child { margin-top: 0; }
.order-form-section > h2 { margin-bottom: 8px; }
.order-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 14px;
}
.customer-recipient-section { margin-top: 18px; }
.customer-recipient-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 14px;
}
.customer-recipient-grid .customer-recipient-wide { grid-column: span 2; }
.form-subheading {
  margin: 20px 0 2px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 800;
  color: #1d2b3a;
}
.order-form-grid .span-2 { grid-column: span 2; }
.order-form-grid .span-3 { grid-column: 1 / -1; }
.required-mark { color: var(--red); margin-left: 3px; }
.form-help { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.order-type-control { display: flex; align-items: center; gap: 8px; }
.order-type-control .in { min-width: 0; }
.order-type-control .btn { flex: 0 0 auto; }
.customer-type-control { display: block; }
.customer-type-control .in { min-width: 0; width: 100%; }
.currency-custom-input:not([hidden]) { margin-top: 8px; }

.batch-product-parse { margin-bottom: 18px; }
.batch-product-parse > label { display: block; margin-bottom: 6px; font-weight: 700; }
.batch-product-parse textarea { display: block; width: 100%; min-height: 132px; line-height: 1.55; resize: vertical; }

.product-workspace-section { padding-bottom: 20px; }
.product-workspace-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.product-workspace-heading h2 { margin-bottom: 4px; }
.product-workspace-heading .muted { margin: 0; }
.item-currency-control { display: flex; align-items: center; gap: 8px; }
.item-currency-control label { font-size: 13px; color: #64748b; }
.product-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 1.1fr);
  gap: 20px;
  align-items: start;
}
.product-catalog-panel,
.added-items-panel { min-width: 0; }
.product-catalog-panel {
  padding-right: 20px;
  border-right: 1px solid var(--line);
}
.product-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 29px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.product-panel-heading h3 { margin: 0; font-size: 16px; }
.product-panel-heading .muted { text-align: right; }
.product-catalog-search { margin-top: 12px; }
.product-catalog-search .in { flex-basis: 200px; }
.product-catalog-table-wrap,
.added-items-table-wrap { margin-top: 12px; }
.product-catalog-table { min-width: 540px; }
.product-catalog-table th:nth-child(1) { width: 62px; }
.product-catalog-table th:nth-child(2) { width: 104px; }
.product-catalog-table th:nth-child(4) { width: 76px; }
.product-catalog-table th:nth-child(5) { width: 76px; }
.product-catalog-table .p-img,
.product-catalog-table .product-result-image {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.product-catalog-table .p-img-none { font-size: 10px; }
tbody.product-results { display: table-row-group; }
.product-results:not(tbody) {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.added-items-panel .batch-product-parse { margin: 14px 0 16px; }
.added-items-panel .batch-product-parse textarea { min-height: 104px; }
.added-items-table { min-width: 0; }
.added-items-panel .item-table th:nth-child(2) { width: 20%; }
.added-items-panel .item-table th:nth-child(3) { width: 17%; }
.added-items-panel .item-table th:nth-child(4) { width: 14%; }
.added-items-panel .item-table th:nth-child(5) { width: 7%; }
.added-items-panel .item-table th:nth-child(6) { width: 8%; }
.added-items-panel .item-table th:nth-child(7) { width: 7%; }
.added-items-panel .order-item-product { min-width: 150px; }
.added-items-panel .in-sm { width: 72px; }
/* 售价: [币种][输入框] 连成一体的输入组 */
.price-group { display: inline-flex; align-items: stretch; white-space: nowrap; }
.price-group > * + * { margin-left: -1px; }
.price-group .item-currency-label {
  display: flex; align-items: center; padding: 0 9px; flex-shrink: 0;
  background: #f1f5f9; border: 1px solid var(--line); border-radius: 7px 0 0 7px;
  font-size: 11px; font-weight: 600; color: #64748b;
}
.price-group .item-unit-price-input { width: 78px; border-radius: 0 7px 7px 0; text-align: right; flex-shrink: 0; }
.order-item-price { display: flex; justify-content: flex-end; }
.order-item-qty { white-space: nowrap; }
.order-item-subtotal { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 数量步进器: [−][输入][+] 边框相连的一体化控件 */
.qty-stepper { display: inline-flex; align-items: stretch; white-space: nowrap; }
.qty-stepper > * + * { margin-left: -1px; }
.qty-btn {
  width: 30px; min-width: 30px; min-height: 38px; padding: 0;
  font-size: 16px; line-height: 1; cursor: pointer;
  background: #f6f9fc; border: 1px solid var(--line); color: #314156;
}
.qty-btn:hover { background: #eef3f9; }
.qty-stepper .qty-btn:first-child { border-radius: 7px 0 0 7px; }
.qty-stepper .qty-btn:last-child { border-radius: 0 7px 7px 0; }
.qty-stepper .qty-input { width: 72px; min-width: 72px; border-radius: 0; text-align: center; font-variant-numeric: tabular-nums; flex-shrink: 0; }
/* 收款截图多张上传 */
.receipt-field-label { margin-bottom: 6px; font-weight: 600; }
.receipt-input-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.receipt-input-row .in { flex: 1 1 220px; min-width: 200px; }
.receipt-preview { max-width: 140px; max-height: 120px; border: 1px solid #ccc; border-radius: 6px; object-fit: contain; }
.receipt-remove { flex-shrink: 0; }
.btn-new-product { border-color: #d98b16; color: #9a6a12; background: #fff9ec; }
.btn-new-product:hover { border-color: #b87309; background: #fff4dc; }
.new-products-panel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.new-products-panel .product-panel-heading { align-items: center; }
.new-products-panel .product-panel-heading > div:first-child { display: grid; gap: 2px; }
.new-products-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
}
.new-product-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #f0d8a1;
  border-left: 4px solid #d98b16;
  border-radius: 7px;
  background: #fffdf8;
  overflow: hidden;
}
.new-product-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.new-product-card-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.new-product-card-title { color: #4b5c70; font-size: 14px; font-weight: 800; }
.new-product-pending { flex: 0 0 auto; }
.new-product-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.new-product-field { display: block; min-width: 0; }
.new-product-field-label {
  display: block;
  margin-bottom: 6px;
  color: #52647a;
  font-size: 12px;
  font-weight: 800;
}
.new-product-required { color: var(--red); font-weight: 800; }
.new-product-input { display: block; width: 100%; min-width: 0; }
.new-product-qty .new-product-input { max-width: 132px; }
.new-product-unit-price .new-product-input { max-width: 156px; text-align: right; }
.new-product-image { grid-column: 1 / -1; }
.new-product-image .new-product-input { padding: 4px; font-size: 12px; }
.new-product-image .new-product-input::file-selector-button {
  margin-right: 8px;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: #edf4fb;
  color: #31506f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.new-product-file-name {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.new-product-file-hint { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.new-product-remove { flex: 0 0 auto; margin-left: auto; border-color: #e2b2ad; color: #a4433c; background: #fff; white-space: nowrap; }
.new-product-remove:hover { border-color: #c45e55; background: #fff4f2; }
.new-products-empty {
  padding: 18px;
  border: 1px dashed #ccd9e7;
  border-radius: 6px;
  background: #fafcff;
}
.new-product-flash {
  animation: newProductFlash 1.6s ease-out 2;
}
@keyframes newProductFlash {
  0% { box-shadow: 0 0 0 3px rgba(217, 139, 22, 0.55); background: #fff6e3; }
  100% { box-shadow: 0 0 0 3px transparent; background: transparent; }
}

.order-pricing-panel {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.pricing-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.pricing-panel-heading h3 { margin: 0 0 2px; font-size: 16px; }
.pricing-panel-heading .muted { display: block; }
.pricing-currency {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  white-space: nowrap;
}
.pricing-currency strong { margin-left: 3px; color: var(--ink); }
.pricing-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin-top: 14px;
}
.pricing-controls > label,
.discount-mode-field { min-width: 0; margin: 0; }
.discount-mode-field { grid-column: 1 / -1; padding: 0; border: 0; }
.discount-mode-field legend { margin-bottom: 6px; font-weight: 700; }
.discount-mode-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.discount-mode-control label { position: relative; min-width: 0; margin: 0; cursor: pointer; }
.discount-mode-control label + label { border-left: 1px solid var(--line); }
.discount-mode-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.discount-mode-control span {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 5px 7px;
  color: #52647a;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.discount-mode-control input:checked + span { color: #fff; background: var(--blue); }
.discount-mode-control input:focus-visible + span { outline: 2px solid #8ab6df; outline-offset: -2px; }
.pricing-input-suffix { color: var(--muted); font-size: 12px; font-weight: 500; }
[data-discount-value-field].is-disabled { color: var(--muted); }
[data-discount-value-field].is-disabled .in { background: #f3f6f9; }
.pricing-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}
.pricing-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 5px 0;
}
.pricing-summary span { color: var(--muted); font-size: 12px; }
.pricing-summary strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pricing-summary .pricing-total {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #b9c8d8;
}
.pricing-summary .pricing-total span,
.pricing-summary .pricing-total strong { color: var(--ink); font-size: 15px; font-weight: 800; }

.item-table { table-layout: fixed; }
.item-table th:nth-child(1) { width: auto; }
.item-table th:nth-child(2) { width: 120px; }
.item-table th:nth-child(3) { width: 94px; }
.item-table th:nth-child(4) { width: 104px; }
.item-table th:nth-child(5) { width: 78px; }
.order-item-row.status-unknown td,
.order-item-row.status-ambiguous td { background: #fffdf8; }
.warehouse-group-row td {
  padding: 8px 10px;
  border-top: 2px solid #8ba4bb;
  background: #eef4f8;
  color: #173b5c;
  font-size: 13px;
  font-weight: 800;
}
.order-item-product { min-width: 210px; }
.item-code { color: #31506f; font-size: 12px; font-family: Consolas, "Courier New", monospace; }
.item-name { margin-top: 2px; font-weight: 700; overflow-wrap: anywhere; }
.item-english-name { margin-top: 2px; color: #5f6c7b; font-size: 12px; overflow-wrap: anywhere; }
.item-meta,
.item-issue { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.item-issue { color: #a06a14; }
.item-unresolved { display: flex; gap: 6px; align-items: center; }
.item-new-product { border-color: #d98b16; color: #9a6a12; background: #fff9ec; white-space: nowrap; }
.item-new-product:hover { border-color: #b87309; background: #fff4dc; }
.in-code { min-width: 0; max-width: 180px; }
.order-item-qty .in { max-width: 100%; }
.order-item-stock,
.order-item-status,
.order-item-action { white-space: nowrap; }
.item-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.item-status.is-matched { background: #e3f6ee; color: #0f7a55; }
.item-status.is-unknown { background: #fde8e8; color: #b33636; }
.item-status.is-ambiguous { background: #fff4dc; color: #9a6a12; }
.item-empty { padding: 18px !important; color: var(--muted); text-align: center; }

.product-search .in { flex: 1 1 220px; }
.product-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.product-result:hover { border-color: var(--blue); background: #f6faff; }
.product-result-title { font-weight: 700; overflow-wrap: anywhere; }
.product-result-stock { color: var(--muted); font-size: 12px; white-space: nowrap; }
.order-item-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.order-item-card + .order-item-card { margin-top: 8px; }
.warehouse-group-card-title {
  margin-top: 14px;
  padding: 8px 10px;
  border-left: 3px solid var(--blue);
  background: #eef4f8;
  color: #173b5c;
  font-size: 13px;
  font-weight: 800;
}
.warehouse-group-card-title:first-child { margin-top: 0; }

/* Order management and customer-service fulfillment */
.order-toolbar { justify-content: space-between; }
.order-action-form { display: inline-flex; margin: 0; }
.order-action-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.order-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.order-action-row .btn { margin: 0; }
.order-action-row .order-action-form { gap: 6px; }
.order-manage-page {
  width: calc(100% + 40px);
  max-width: none;
  margin-left: -20px;
  transform: none;
}
.order-manage-page .table-wrap { overflow-x: visible; }
.order-manage-page .order-table { table-layout: fixed; }
.order-manage-page .order-table th:nth-child(1) { width: 10%; }
.order-manage-page .order-table th:nth-child(2) { width: 12%; }
.order-manage-page .order-table th:nth-child(3) { width: 6%; }
.order-manage-page .order-table th:nth-child(4) { width: 9%; }
.order-manage-page .order-table th:nth-child(5) { width: 10%; }
.order-manage-page .order-table th:nth-child(6),
.order-manage-page .order-table th:nth-child(7),
.order-manage-page .order-table th:nth-child(8) { width: 8%; }
.order-manage-page .order-table th:nth-child(9) { width: 7%; }
.order-manage-page .order-table th:nth-child(10) { width: 8%; }
.order-manage-page .order-table th:nth-child(11) { width: 14%; }
.order-manage-page .order-table td { overflow-wrap: anywhere; }
.order-manage-page .order-table .act { white-space: normal; }
.order-manage-page .order-table .order-print-cell { white-space: nowrap; }
.order-list-page {
  width: min(1800px, calc(100vw - 40px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}
.order-list-page .table-wrap { overflow-x: visible; }
.order-list-page .order-table {
  table-layout: fixed;
  width: 100%;
}
.order-list-page .order-table.has-select th.order-select-col { width: 3.5%; }
.order-list-page .order-table.has-select th.order-no-col { width: 11%; }
.order-list-page .order-table.has-select th.order-customer-col { width: 14%; }
.order-list-page .order-table.has-select th.order-product-col { width: 6%; }
.order-list-page .order-table.has-select th.order-transport-col { width: 7%; }
.order-list-page .order-table.has-select th.order-amount-col { width: 8%; }
.order-list-page .order-table.has-select th.order-approval-col { width: 7.5%; }
.order-list-page .order-table.has-select th.order-sales-col { width: 8%; }
.order-list-page .order-table.has-select th.order-time-col { width: 8%; }
.order-list-page .order-table.has-select th.order-print-col { width: 8.5%; }
.order-list-page .order-table.has-select th.order-actions-col { width: 18.5%; }
.order-list-page .order-table.no-select th.order-no-col { width: 12%; }
.order-list-page .order-table.no-select th.order-customer-col { width: 16%; }
.order-list-page .order-table.no-select th.order-product-col { width: 6.5%; }
.order-list-page .order-table.no-select th.order-transport-col { width: 8%; }
.order-list-page .order-table.no-select th.order-amount-col { width: 9%; }
.order-list-page .order-table.no-select th.order-approval-col { width: 8%; }
.order-list-page .order-table.no-select th.order-sales-col { width: 9.5%; }
.order-list-page .order-table.no-select th.order-time-col { width: 9%; }
.order-list-page .order-table.no-select th.order-print-col { width: 8.5%; }
.order-list-page .order-table.no-select th.order-actions-col { width: 13.5%; }
.order-list-page .order-table td { overflow-wrap: anywhere; }
.order-list-page .order-table .act { white-space: normal; }
.order-list-page .order-table .order-print-cell { white-space: nowrap; }
.order-detail { display: block; min-width: 0; margin: 0; }
.order-detail-row > td { padding: 0 10px 12px; background: #fff; }
.order-detail-row:hover > td { background: #fff; }
.order-detail > summary {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 7px; color: var(--ink); cursor: pointer;
  font-size: 13px; font-weight: 600; list-style: none;
}
.order-detail > summary::-webkit-details-marker { display: none; }
.order-detail > summary::before { content: "+"; margin-right: 6px; color: var(--blue); font-size: 16px; line-height: 1; }
.order-detail[open] > summary { margin-bottom: 12px; border-color: var(--blue); background: #f6faff; }
.order-detail[open] > summary::before { content: "-"; }
.order-detail-body { min-width: 0; padding: 2px 0 8px; }
.order-detail-body h3 { margin: 18px 0 9px; font-size: 15px; }
.detail-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px;
  padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #fbfdff;
}
.detail-grid > div { min-width: 0; }
.detail-grid b { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.detail-grid span { display: block; overflow-wrap: anywhere; font-size: 13px; }
.detail-grid .span-all { grid-column: 1 / -1; }
.detail-remark { margin: 12px 0 0; font-size: 13px; white-space: pre-wrap; }
.product-request-box {
  margin-top: 10px; padding: 12px; border: 1px solid #f0d8a1; border-left: 4px solid #d98b16;
  background: #fff9ec;
}
.product-request-box-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.product-request-alert {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  background: #fde8e8; color: #b33636; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.product-request-review-form { align-items: center; gap: 5px; }
.in-review-note { width: 130px; min-height: 28px; padding: 4px 6px; font-size: 12px; }
.fulfillment-editor { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.fulfillment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.fulfillment-grid label { min-width: 0; }
.fulfillment-view { margin-top: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.profit-ok { color: #0f7a55; }
.profit-neg { color: #b33636; }

@media (max-width: 980px) {
  .order-page-title {
    width: auto;
    margin-left: 0;
    transform: none;
  }
  .order-manage-page,
  .order-list-page {
    width: auto;
    margin-left: 0;
    transform: none;
  }
  .order-manage-page .table-wrap,
  .order-list-page .table-wrap { overflow-x: visible; }
  .order-manage-page .order-table,
  .order-list-page .order-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
    font-size: 12px;
  }
  .order-manage-page .order-table th,
  .order-manage-page .order-table td,
  .order-list-page .order-table th,
  .order-list-page .order-table td { padding: 7px 6px; }
  .order-list-page .order-table .btn-sm { padding-left: 7px; padding-right: 7px; font-size: 12px; }
  .order-entry-grid { grid-template-columns: 1fr; }
  .order-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-recipient-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-form-grid .span-3 { grid-column: 1 / -1; }
  .product-workspace { grid-template-columns: 1fr; gap: 18px; }
  .product-catalog-panel { padding: 0 0 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fulfillment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .order-manage-page .table-wrap,
  .order-list-page .table-wrap { overflow-x: auto; }
  .order-manage-page .order-table,
  .order-list-page .order-table { table-layout: auto; min-width: 1060px; }
}
@media (max-width: 640px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .topbar { position: static; }
  .topbar-inner { gap: 8px; padding: 10px 14px; }
  .brand { font-size: 15px; }
  .topnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .topnav a { flex: 0 0 auto; padding: 6px 9px; white-space: nowrap; font-size: 13px; }
  .userbox { gap: 6px; font-size: 12px; }
  .userbox .role { padding: 3px 7px; }
  .userbox .btn { min-height: 28px; padding: 0 8px; font-size: 12px; }
  .dashboard-entry { min-height: 32px; padding: 0 10px; font-size: 13px; }
  .order-form-grid { grid-template-columns: 1fr; }
  .customer-recipient-grid { grid-template-columns: 1fr; }
  .customer-recipient-grid .customer-recipient-wide,
  .customer-recipient-grid .span-2,
  .customer-recipient-grid .span-3 { grid-column: 1 / -1; }
  .order-form-grid .span-2,
  .order-form-grid .span-3 { grid-column: auto; }
  .item-table { min-width: 680px; }
  .added-items-panel .item-table { min-width: 0; }
  .order-item-card { grid-template-columns: 1fr 88px; }
  .order-item-card .item-status,
  .order-item-card .order-item-stock,
  .order-item-card .item-remove { justify-self: start; }
  .new-products-panel .product-panel-heading { align-items: flex-start; flex-wrap: wrap; }
  .new-products-panel .product-panel-heading .muted { text-align: left; }
  .new-product-card { padding: 12px; }
  .new-product-card-header { align-items: flex-start; flex-wrap: wrap; }
  .new-product-card-heading { flex-wrap: wrap; }
  .new-product-fields { grid-template-columns: minmax(0, 1fr); }
  .new-product-image { grid-column: auto; }
  .new-product-qty .new-product-input,
  .new-product-unit-price .new-product-input { max-width: none; }
  .pricing-panel-heading { flex-wrap: wrap; }
  .pricing-controls { grid-template-columns: minmax(0, 1fr); }
  .discount-mode-field { grid-column: auto; }
  .pricing-summary { grid-template-columns: minmax(0, 1fr); }
  .pricing-summary .pricing-total { grid-column: auto; }
  .order-toolbar { align-items: stretch; }
  .order-toolbar .inline { width: 100%; }
  .order-toolbar .in { width: 100% !important; }
  .filterbar { align-items: flex-start; }
  .filterbar .btn { flex: 0 0 auto; }
  .category-filterbar > .muted { width: 100%; margin-left: 0 !important; }
  .detail-grid,
  .fulfillment-grid,
  .fulfillment-view { grid-template-columns: 1fr; }
  .order-detail-body { min-width: 0; }
}
