/* ============================================================
   GSP 出运管理 · 视觉系统
   深海墨蓝 + 纸张灰绿 + 航道琥珀，衬线标题 + 无衬线正文
   ============================================================ */

:root {
  --ink: #102932;
  --ink-deep: #0a1d24;
  --ink-2: #1b3c47;
  --ink-3: #2a4d57;
  --sea: #0f6f68;
  --sea-dark: #0a5953;
  --sea-soft: #e2f0ed;
  --amber: #d89a2b;
  --amber-soft: #fbf1da;
  --rust: #b04a35;
  --rust-soft: #f8e9e4;
  --green: #2f7d5d;
  --green-soft: #e6f2ea;
  --blue: #2b6f8f;
  --blue-soft: #e7f0f5;
  --slate: #64777c;
  --slate-soft: #edf0ee;
  --paper: #f2f4f0;
  --paper-2: #e9ede7;
  --surface: #ffffff;
  --line: #dce2dc;
  --line-strong: #c3ccc5;
  --text: #17272d;
  --muted: #5f7378;
  --muted-2: #88999c;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  --shadow: 0 20px 60px rgba(10, 29, 36, 0.16);
  --shadow-sm: 0 4px 16px rgba(10, 29, 36, 0.08);
  --radius: 3px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(216, 154, 43, 0.3); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- boot ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--paper);
  transition: opacity 0.35s ease;
}
.boot.done { opacity: 0; pointer-events: none; }
.boot-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #f4e7c8;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.08em;
  border-top: 3px solid var(--amber);
}
.boot-text { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 14px;
  height: 38px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.01em;
  background: transparent;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(16, 41, 50, 0.05); color: var(--text); }
.btn-danger { background: transparent; color: var(--rust); border-color: rgba(176, 74, 53, 0.4); }
.btn-danger:hover { background: var(--rust); color: #fff; border-color: var(--rust); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; height: 44px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
}
.btn-icon:hover { border-color: var(--ink); }
.btn-icon svg { width: 16px; height: 16px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.field-label em { font-style: normal; color: var(--rust); margin-left: 2px; }
input[type="text"], input[type="password"], input[type="date"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 10px;
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { height: auto; min-height: 84px; padding: 9px 10px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(15, 111, 104, 0.12);
}
input::placeholder, textarea::placeholder { color: #a8b4b3; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.form-error {
  margin: 0;
  padding: 9px 11px;
  background: var(--rust-soft);
  color: var(--rust);
  border-left: 2px solid var(--rust);
  font-size: 12.5px;
}
.form-hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; background: var(--paper); }
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px 56px 36px;
  color: #e9f0ed;
  background:
    radial-gradient(1100px 520px at 80% 10%, rgba(43, 111, 143, 0.22), transparent 60%),
    linear-gradient(155deg, #0b2029 0%, #113440 52%, #0b262e 100%);
  overflow: hidden;
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 75%);
  pointer-events: none;
}
.brand-row { position: relative; display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #f5e8ca;
}
.brand-sub { font-size: 13px; letter-spacing: 0.12em; color: rgba(233, 240, 237, 0.7); }
.login-copy { position: relative; margin-top: clamp(64px, 12vh, 140px); max-width: 560px; }
.login-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; color: rgba(216, 154, 43, 0.85); }
.login-copy h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 4.6vw, 66px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.02em;
  margin-top: 20px;
  color: #f7f4ea;
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.login-lede {
  margin-top: 22px;
  max-width: 420px;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(226, 236, 233, 0.68);
  animation: rise 0.9s 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.route-map { position: relative; margin-top: auto; padding-top: 44px; width: 100%; max-width: 640px; }
.route-map svg { width: 100%; height: auto; overflow: visible; }
.route-base { stroke: rgba(255, 255, 255, 0.13); stroke-width: 2; }
.route-line {
  stroke: var(--amber);
  stroke-width: 1.6;
  stroke-dasharray: 5 7;
  animation: route-draw 2.2s 0.4s ease-out both;
}
.route-dots circle { fill: #0f2b35; stroke: var(--amber); stroke-width: 1.6; }
.route-labels text { fill: rgba(233, 240, 237, 0.6); font-size: 11px; font-family: var(--sans); letter-spacing: 0.05em; }
.login-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  color: rgba(226, 236, 233, 0.5);
  letter-spacing: 0.05em;
}
.login-foot-rule { width: 26px; height: 1px; background: rgba(216, 154, 43, 0.6); }
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px clamp(28px, 6vw, 96px);
  background: var(--paper);
}
.login-form { width: 100%; max-width: 372px; margin: 0 auto; }
.login-form-head { margin-bottom: 30px; }
.login-form-kicker { display: inline-block; font-size: 11px; letter-spacing: 0.16em; color: var(--sea); padding-bottom: 10px; border-bottom: 1px solid var(--amber); }
.login-form-head h2 { font-family: var(--serif); font-size: 32px; font-weight: 500; margin-top: 20px; letter-spacing: 0.02em; }
.login-form-head p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.login-form .field { margin-bottom: 16px; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 54px; }
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  padding: 4px 8px;
}
.password-toggle:hover { color: var(--ink); }
.login-form .btn-block { margin-top: 8px; }
.login-hint { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.8; }
.login-hint .muted { color: var(--muted-2); }
.login-legal { margin-top: 60px; text-align: center; font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.04em; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  width: 244px;
  flex: 0 0 244px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: linear-gradient(180deg, #112b35 0%, #0c222b 100%);
  color: #dce7e4;
  z-index: 40;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(216, 154, 43, 0.4), rgba(255, 255, 255, 0.06) 30%);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 24px; }
.brand-mark-sm { width: 38px; height: 38px; font-size: 13px; flex: 0 0 38px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--serif); font-size: 17px; font-weight: 500; letter-spacing: 0.12em; color: #f3efe4; }
.brand-text small { font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em; color: rgba(220, 231, 228, 0.4); margin-top: 4px; }
.nav { display: flex; flex-direction: column; }
.nav-group { padding: 20px 12px 7px; font-size: 10px; letter-spacing: 0.16em; color: rgba(220, 231, 228, 0.34); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  color: rgba(220, 231, 228, 0.72);
  font-size: 13.5px;
  border-radius: 0 3px 3px 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.07); color: #fff; border-left-color: var(--amber); }
.nav-item.active svg { color: var(--amber); opacity: 1; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.sidebar-note { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: rgba(220, 231, 228, 0.4); letter-spacing: 0.05em; padding-bottom: 13px; }
.sidebar-note .dot { width: 6px; height: 6px; border-radius: 50%; background: #5cb88e; box-shadow: 0 0 0 3px rgba(92, 184, 142, 0.12); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 9px;
  border-radius: 3px;
  transition: background 0.15s ease;
}
.user-chip:hover { background: rgba(255, 255, 255, 0.06); }
.avatar {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #1e4a56;
  color: #f0e6ce;
  font-family: var(--serif);
  font-size: 14px;
}
.user-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; flex: 1; }
.user-chip-text strong { font-size: 12.5px; font-weight: 550; color: #eef3f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { font-size: 10.5px; color: rgba(220, 231, 228, 0.45); margin-top: 2px; }
.user-chip-gear { width: 15px; height: 15px; stroke: rgba(220, 231, 228, 0.4); fill: none; stroke-width: 1.5; }
.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 9px;
  border: 0;
  background: transparent;
  color: rgba(220, 231, 228, 0.45);
  font-size: 11.5px;
  border-radius: 3px;
}
.logout-btn:hover { background: rgba(255, 255, 255, 0.05); color: #e8c8be; }
.logout-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-scrim { display: none; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 62px;
  flex: 0 0 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
  background: rgba(242, 244, 240, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); min-width: 0; }
.breadcrumb i { font-style: normal; color: var(--line-strong); }
.breadcrumb strong { color: var(--text); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.today-label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.03em; white-space: nowrap; }
.menu-toggle { display: none; width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); place-items: center; }
.menu-toggle svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 1.8; }
.view { flex: 1; padding: 26px 30px 64px; max-width: 1520px; width: 100%; margin: 0 auto; animation: view-in 0.35s ease both; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.page-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; color: var(--sea); }
.page-head h1 { font-family: var(--serif); font-size: clamp(26px, 3vw, 34px); font-weight: 500; letter-spacing: 0.01em; line-height: 1.2; margin-top: 8px; }
.page-sub { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---------- manifest strip ---------- */
.manifest {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.manifest-cell { padding: 18px 20px 16px; border-right: 1px solid var(--line); min-width: 0; }
.manifest-cell:last-child { border-right: 0; }
.manifest-cell.ink { background: var(--ink); color: #f4f1e6; border-right: 1px solid rgba(255, 255, 255, 0.1); }
.manifest-label { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.manifest-cell.ink .manifest-label { color: rgba(244, 241, 230, 0.55); }
.manifest-value { display: flex; align-items: baseline; column-gap: 8px; font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); font-weight: 500; line-height: 1.05; margin-top: 10px; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.manifest-unit { font-size: 11.5px; color: var(--muted); font-family: var(--sans); font-weight: 400; letter-spacing: 0; }
.manifest-cell.ink .manifest-unit { color: rgba(244, 241, 230, 0.55); }
.manifest-note { font-size: 11px; color: var(--muted-2); margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manifest-cell.ink .manifest-note { color: rgba(244, 241, 230, 0.45); }

/* ---------- panels / dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: baseline; gap: 10px; font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: 0.02em; }
.panel-title small { font-family: var(--sans); font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.04em; }
.panel-link { font-size: 11.5px; color: var(--sea); white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.panel-body { padding: 18px 20px; }
.panel-foot { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }

.trend-wrap { padding: 14px 8px 6px; }
.trend-svg { width: 100%; height: auto; display: block; }
.chart-grid line { stroke: #e7ebe6; stroke-width: 1; }
.chart-bar { fill: var(--ink); transition: fill 0.15s ease; }
.chart-bar:hover { fill: var(--sea); }
.chart-bar-value { fill: var(--ink); font-size: 10px; font-family: var(--mono); }
.chart-label { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.chart-note { fill: var(--muted-2); font-size: 9.5px; font-family: var(--sans); }
.chart-empty { fill: var(--muted-2); font-size: 10px; }

.pipeline { padding: 24px 20px 20px; }
.pipeline-track { position: relative; display: flex; justify-content: space-between; gap: 8px; }
.pipeline-track::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 9px;
  border-top: 1px dashed var(--line-strong);
}
.pipe-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; flex: 1; min-width: 0; text-align: center; }
.pipe-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line-strong); display: grid; place-items: center; z-index: 1; }
.pipe-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.pipe-step[data-tone="amber"] .pipe-dot { border-color: var(--amber); }
.pipe-step[data-tone="amber"] .pipe-dot::after { background: var(--amber); }
.pipe-step[data-tone="teal"] .pipe-dot { border-color: var(--sea); }
.pipe-step[data-tone="teal"] .pipe-dot::after { background: var(--sea); }
.pipe-step[data-tone="blue"] .pipe-dot { border-color: var(--blue); }
.pipe-step[data-tone="blue"] .pipe-dot::after { background: var(--blue); }
.pipe-step[data-tone="green"] .pipe-dot { border-color: var(--green); }
.pipe-step[data-tone="green"] .pipe-dot::after { background: var(--green); }
.pipe-count { font-family: var(--serif); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.pipe-label { font-size: 11.5px; color: var(--muted); }
.pipe-extra { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #edf0eb;
  min-width: 0;
  transition: background 0.12s ease;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: #f8f9f5; }
.mini-thumb {
  width: 38px; height: 38px; flex: 0 0 38px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.mini-thumb.blank { display: grid; place-items: center; font-family: var(--serif); font-size: 14px; color: var(--muted-2); }
.mini-main { flex: 1; min-width: 0; }
.mini-title { display: block; font-size: 12.8px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.mini-date { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.empty-mini { padding: 26px 20px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* ---------- status / chips ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  border-radius: 2px;
  white-space: nowrap;
  background: var(--slate-soft);
  color: #4e6166;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill[data-tone="amber"] { background: var(--amber-soft); color: #966716; }
.status-pill[data-tone="teal"] { background: var(--sea-soft); color: var(--sea-dark); }
.status-pill[data-tone="blue"] { background: var(--blue-soft); color: var(--blue); }
.status-pill[data-tone="rust"] { background: var(--rust-soft); color: var(--rust); }
.status-pill[data-tone="green"] { background: var(--green-soft); color: var(--green); }
.channel-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10.5px;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fbfcfa;
  white-space: nowrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 2px;
  color: var(--muted);
}
.chip b { color: var(--text); font-weight: 600; }

/* ---------- records toolbar ---------- */
.records-toolbar { background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; margin-bottom: 12px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.search-box { position: relative; flex: 1 1 260px; min-width: 180px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--muted-2); fill: none; stroke-width: 1.7; }
.search-box input { padding-left: 34px; }
.filter-row select { width: auto; min-width: 112px; }
.filter-row input[type="date"] { width: 138px; }
.filter-label { font-size: 11px; color: var(--muted-2); margin-right: 2px; }
.filter-spacer { flex: 1; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.filter-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; font-size: 11.5px; color: var(--muted); }
.filter-summary .chip b { font-family: var(--mono); }
.export-menu { position: relative; }
.export-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 148px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  z-index: 50;
  padding: 4px;
}
.export-pop button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font-size: 12.5px;
  border-radius: 2px;
}
.export-pop button:hover { background: var(--paper); }

/* ---------- table ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 1040px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 11px 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #f0f3ee;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid #e9ede8; vertical-align: top; font-size: 12.5px; }
.data-table tbody tr { transition: background 0.12s ease; cursor: pointer; }
.data-table tbody tr:hover { background: #f8f9f5; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-date { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.cell-date small { display: block; font-family: var(--sans); font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.cell-po { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.prod-cell { display: flex; gap: 10px; align-items: flex-start; min-width: 200px; }
.prod-thumb { width: 40px; height: 40px; flex: 0 0 40px; object-fit: cover; border: 1px solid var(--line); background: var(--paper-2); }
.prod-thumb.blank { display: grid; place-items: center; color: var(--muted-2); font-family: var(--serif); font-size: 14px; }
.prod-name { font-size: 13px; font-weight: 550; line-height: 1.45; color: var(--text); }
.prod-info { font-size: 10.5px; color: var(--muted); margin-top: 2px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-stack { display: flex; flex-direction: column; gap: 4px; }
.cell-stack .sub { font-size: 10.5px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: -0.01em; }
.truncate { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-route { max-width: 210px; }
.cell-route p { font-size: 11.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.row-arrow { color: var(--line-strong); display: inline-flex; padding-top: 2px; }
.data-table tr:hover .row-arrow { color: var(--sea); }
.row-arrow svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.page-btns { display: flex; gap: 5px; align-items: center; }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 2px; font-size: 11.5px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--ink); color: var(--text); }
.page-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.empty-state { padding: 64px 24px; text-align: center; }
.empty-state .empty-route { width: 120px; height: 48px; margin: 0 auto 14px; }
.empty-state .empty-route path { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 5; fill: none; }
.empty-state .empty-route circle { fill: var(--paper); stroke: var(--line-strong); }
.empty-state h3 { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.empty-state p { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.skeleton-row { height: 54px; background: linear-gradient(90deg, #f0f2ee 25%, #f7f8f5 50%, #f0f2ee 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-bottom: 1px solid #e9ede8; }

/* ---------- drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(7, 20, 26, 0.48); z-index: 90; opacity: 0; transition: opacity 0.25s ease; }
.overlay.open { opacity: 1; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(660px, 100vw);
  z-index: 91;
  background: var(--paper);
  box-shadow: -20px 0 60px rgba(10, 29, 36, 0.24);
  transform: translateX(102%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { background: var(--ink); color: #f3f0e5; padding: 20px 24px 18px; position: relative; flex: 0 0 auto; }
.drawer-kicker { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; color: rgba(243, 240, 229, 0.45); }
.drawer-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.3; margin-top: 7px; padding-right: 36px; }
.drawer-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.drawer-meta .mono { color: rgba(243, 240, 229, 0.55); font-size: 10.5px; }
.drawer-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  display: grid; place-items: center;
  border-radius: 2px;
}
.drawer-close:hover { background: rgba(255, 255, 255, 0.1); }
.drawer-close svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.drawer-actions { display: flex; gap: 8px; margin-top: 14px; }
.drawer-actions .btn { height: 31px; font-size: 11.5px; }
.drawer-actions .btn-secondary { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); color: #eef3ef; }
.drawer-actions .btn-secondary:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); }
.drawer-actions .btn-danger { border-color: rgba(216, 104, 80, 0.55); color: #f0b6a8; }
.drawer-actions .btn-danger:hover { background: var(--rust); color: #fff; }
.drawer-body { overflow-y: auto; padding: 20px 24px 48px; flex: 1; }
.drawer-section { margin-bottom: 24px; }
.drawer-section:last-child { margin-bottom: 0; }
.section-head { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 13px; }
.section-head::before { content: ""; width: 3px; height: 11px; background: var(--amber); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 20px; }
.detail-item { min-width: 0; }
.detail-item.wide { grid-column: 1 / -1; }
.detail-label { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.03em; }
.detail-value { font-size: 13px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.detail-value.mono { font-size: 11.5px; }
.pre { white-space: pre-wrap; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery-item { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); padding: 0; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.no-image { border: 1px dashed var(--line-strong); padding: 22px; text-align: center; font-size: 11.5px; color: var(--muted-2); }
.stepper { display: flex; gap: 0; }
.step { flex: 1; min-width: 0; position: relative; padding-top: 22px; text-align: center; }
.step::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; border-top: 1px dashed var(--line-strong); }
.step:first-child::before { display: none; }
.step-dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line-strong); z-index: 1; }
.step-label { font-size: 10.5px; color: var(--muted-2); }
.step.done .step-dot { background: var(--sea); border-color: var(--sea); }
.step.done::before { border-color: var(--sea); }
.step.current .step-dot { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 4px rgba(216, 154, 43, 0.16); }
.step.current .step-label { color: var(--text); font-weight: 600; }
.step.alert .step-dot { background: var(--rust); border-color: var(--rust); }
.step.alert .step-label { color: var(--rust); }
.drawer-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--amber-soft); border-left: 2px solid var(--amber); font-size: 11.5px; color: #7b5a16; line-height: 1.6; }
.drawer-log { font-size: 11px; color: var(--muted); line-height: 1.9; }
.drawer-log span { font-family: var(--mono); color: var(--muted-2); margin-right: 8px; }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 110; background: rgba(7, 20, 26, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity 0.2s ease; }
.modal-overlay.open { opacity: 1; }
.modal {
  background: var(--paper);
  width: min(840px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(14px);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal.sm { width: min(460px, 100%); }
.modal.md { width: min(620px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 15px; background: var(--surface); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.modal-title { font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.3; }
.modal-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.modal-close { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 2px; }
.modal-close:hover { background: var(--paper); color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 22px; background: var(--surface); border-top: 1px solid var(--line); flex: 0 0 auto; }
.modal-foot .danger-note { margin-right: auto; font-size: 11.5px; color: var(--muted); align-self: center; }

/* ---------- record form ---------- */
.form-section { margin-bottom: 22px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-2); margin-bottom: 12px; }
.form-section-title::before { content: ""; width: 3px; height: 12px; background: var(--amber); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 15px; }
.field-full { grid-column: 1 / -1; }
.form-grid .field { gap: 5px; }
.form-foot-hint { font-size: 11px; color: var(--muted-2); margin-right: auto; align-self: center; }

/* image uploader */
.image-uploader { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.image-tile { position: relative; aspect-ratio: 1; border: 1px solid var(--line); background: var(--paper-2); overflow: hidden; }
.image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-tile .remove {
  position: absolute; top: 4px; right: 4px;
  width: 21px; height: 21px; border: 0; border-radius: 50%;
  background: rgba(10, 29, 36, 0.72); color: #fff; font-size: 12px; line-height: 1;
  display: grid; place-items: center;
}
.image-tile .remove:hover { background: var(--rust); }
.image-tile.pending::after { content: "待保存"; position: absolute; left: 4px; bottom: 4px; font-size: 9px; background: rgba(10, 29, 36, 0.7); color: #fff; padding: 1px 5px; }
.upload-tile {
  aspect-ratio: 1;
  border: 1.5px dashed var(--line-strong);
  background: #fbfcfa;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--muted); font-size: 10.5px;
}
.upload-tile:hover { border-color: var(--sea); color: var(--sea); background: var(--sea-soft); }
.upload-tile svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.upload-hint { font-size: 10.5px; color: var(--muted-2); margin-top: 7px; }

/* ---------- import ---------- */
.import-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dropzone {
  background: var(--surface);
  border: 1.5px dashed var(--line-strong);
  padding: 46px 24px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.dragover, .dropzone:hover { border-color: var(--sea); background: #fbfdfb; }
.dropzone-icon { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper); }
.dropzone-icon svg { width: 23px; height: 23px; stroke: var(--sea); fill: none; stroke-width: 1.5; }
.dropzone h3 { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.dropzone p { font-size: 12px; color: var(--muted); margin-top: 6px; }
.dropzone .btn { margin-top: 16px; }
.import-steps { display: flex; gap: 18px; margin: 18px 0; }
.import-step { flex: 1; padding-top: 12px; border-top: 2px solid var(--line); font-size: 11.5px; color: var(--muted); }
.import-step b { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted-2); margin-bottom: 3px; }
.import-step.active { border-color: var(--amber); color: var(--text); }
.import-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.import-summary .stat { background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; min-width: 96px; }
.import-summary .stat b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.1; }
.import-summary .stat span { font-size: 10.5px; color: var(--muted); }
.import-panel { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); margin-top: 16px; }
.import-panel-head { padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.import-panel-head h3 { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.import-panel-body { padding: 14px 18px; }
.mapping-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mapping-chip { font-size: 10.5px; padding: 3px 7px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); }
.mapping-chip b { color: var(--ink-2); font-weight: 600; }
.preview-table-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--line); }
.preview-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.preview-table th { position: sticky; top: 0; background: #f0f3ee; font-size: 10px; text-align: left; padding: 7px 9px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.preview-table td { font-size: 10.5px; padding: 6px 9px; border-bottom: 1px solid #edf0eb; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.preview-table tr.dup { background: #fffaf0; }
.preview-table .dup-tag { color: var(--amber); font-size: 9.5px; }
.import-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.radio-card { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--line); background: #fbfcfa; padding: 10px 12px; cursor: pointer; }
.radio-card:hover { border-color: var(--line-strong); }
.radio-card input { margin-top: 3px; accent-color: var(--sea); }
.radio-card b { display: block; font-size: 12px; font-weight: 550; }
.radio-card span { font-size: 10.5px; color: var(--muted); }
.import-warning { background: var(--amber-soft); border-left: 2px solid var(--amber); padding: 10px 12px; font-size: 11.5px; color: #7b5a16; margin-bottom: 12px; line-height: 1.65; }
.import-success { text-align: center; padding: 44px 20px; }
.import-success .ok-mark { width: 50px; height: 50px; margin: 0 auto 14px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.import-success h3 { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.import-success p { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.import-success .links { margin-top: 18px; display: flex; gap: 9px; justify-content: center; }
.import-tips { background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; }
.import-tips h3 { font-family: var(--serif); font-size: 18px; font-weight: 500; margin-bottom: 10px; }
.import-tips ul { margin: 0; padding-left: 16px; font-size: 11.5px; color: var(--muted); line-height: 1.9; }
.import-tips li::marker { color: var(--amber); }

/* ---------- users / roles / logs / account ---------- */
.section-card { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); }
.section-card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-card-head h2 { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.section-card-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.simple-table { width: 100%; border-collapse: collapse; }
.simple-table th { text-align: left; font-size: 10.5px; letter-spacing: 0.05em; color: var(--muted); background: #f5f7f3; padding: 9px 14px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.simple-table td { padding: 11px 14px; border-bottom: 1px solid #edf0eb; font-size: 12.5px; vertical-align: middle; }
.simple-table tr:last-child td { border-bottom: 0; }
.simple-table tr:hover td { background: #fafbf8; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { background: var(--ink-2); width: 30px; height: 30px; flex-basis: 30px; font-size: 13px; }
.user-cell b { display: block; font-size: 12.8px; font-weight: 550; }
.user-cell small { display: block; font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.role-badge { display: inline-block; font-size: 10.5px; padding: 2px 7px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-2); }
.state-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.state-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.state-dot.on::before { background: var(--green); }
.state-dot.off::before { background: var(--rust); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link-btn { border: 0; background: transparent; padding: 2px 4px; font-size: 11.5px; color: var(--sea); }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--rust); }
.link-btn[disabled] { color: var(--muted-2); cursor: not-allowed; text-decoration: none; }
.registry-note { margin-top: 14px; font-size: 11px; color: var(--muted-2); }

.role-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.role-list { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); }
.role-list-head { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.role-list-head h2 { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.role-option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid #edf0eb;
  background: transparent; padding: 13px 16px;
}
.role-option:last-child { border-bottom: 0; }
.role-option:hover { background: #f8f9f5; }
.role-option.active { background: var(--ink); color: #fff; }
.role-option .role-name { display: block; font-size: 13px; font-weight: 550; }
.role-option .role-sub { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.role-option.active .role-sub { color: rgba(255, 255, 255, 0.55); }
.role-option .role-count { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.role-option.active .role-count { color: rgba(255, 255, 255, 0.55); }
.role-detail { background: var(--surface); border: 1px solid var(--line); padding: 20px 22px; }
.role-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.role-detail-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.role-detail-head p { font-size: 11.5px; color: var(--muted); margin-top: 4px; max-width: 560px; }
.role-detail-actions { display: flex; gap: 7px; }
.perm-group-title { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); margin: 18px 0 8px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perm-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); background: #fbfcfa; }
.perm-item input { margin-top: 3px; accent-color: var(--sea); }
.perm-item b { display: block; font-size: 12px; font-weight: 550; }
.perm-item span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.perm-item.locked { opacity: 0.75; background: var(--paper); }
.role-lock-note { display: flex; gap: 8px; align-items: center; background: var(--amber-soft); border-left: 2px solid var(--amber); padding: 10px 12px; font-size: 11.5px; color: #7b5a16; margin-top: 16px; }
.role-save-bar { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.logs-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.logs-filter .search-box { flex: 1 1 240px; }
.logs-filter select, .logs-filter input[type="date"] { width: auto; }
.log-entry-action { font-size: 11px; padding: 2px 7px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }

.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-card { background: var(--ink); color: #f3f0e5; padding: 26px; border-top: 3px solid var(--amber); }
.profile-card .avatar { width: 56px; height: 56px; font-size: 22px; background: #1e4a56; margin-bottom: 16px; }
.profile-card h2 { font-family: var(--serif); font-size: 26px; font-weight: 500; }
.profile-card .profile-role { font-size: 11.5px; color: rgba(243, 240, 229, 0.55); margin-top: 5px; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.profile-facts dt { font-size: 10px; color: rgba(243, 240, 229, 0.45); }
.profile-facts dd { margin: 3px 0 0; font-size: 12px; }
.permission-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.permission-list span { font-size: 10.5px; padding: 3px 7px; border: 1px solid rgba(255, 255, 255, 0.18); color: rgba(243, 240, 229, 0.75); }
.account-form { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); padding: 20px 22px; }
.account-form h2 { font-family: var(--serif); font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.account-form > p { font-size: 11.5px; color: var(--muted); margin-bottom: 16px; }
.account-form .field { margin-bottom: 12px; }
.account-note { margin-top: 14px; font-size: 11px; color: var(--muted-2); line-height: 1.7; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 74px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 220px; max-width: 360px;
  background: var(--ink);
  color: #f3f0e5;
  padding: 11px 14px;
  font-size: 12.5px;
  border-left: 3px solid var(--amber);
  box-shadow: var(--shadow-sm);
  animation: toast-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  pointer-events: auto;
  line-height: 1.6;
}
.toast.success { border-left-color: #5cb88e; }
.toast.error { border-left-color: #d8735a; }
.toast.leaving { animation: toast-out 0.25s ease both; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(5, 15, 19, 0.92); display: flex; align-items: center; justify-content: center; padding: 30px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: 18px; right: 22px; border: 1px solid rgba(255, 255, 255, 0.3); background: transparent; color: #fff; width: 38px; height: 38px; font-size: 18px; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.3); color: #fff; width: 42px; height: 42px; font-size: 18px; }
.lightbox-nav.prev { left: 22px; }
.lightbox-nav.next { right: 22px; }

/* ---------- ledger / records redesign ---------- */
.ledger-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ledger-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  margin-bottom: 14px;
}
.ledger-summary-cell { padding: 12px 16px; border-right: 1px solid var(--line); min-width: 0; }
.ledger-summary-cell:last-child { border-right: 0; }
.ledger-summary-label { font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; }
.ledger-summary-value { font-family: var(--serif); font-size: 24px; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ledger-summary-value small { font-family: var(--sans); font-size: 10.5px; color: var(--muted); margin-left: 3px; }

.ledger-filters { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); padding: 14px 16px 12px; margin-bottom: 12px; }
.filter-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-top .search-box { flex: 1 1 300px; }
.date-range { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.date-range input[type="date"] { width: 132px; height: 36px; }
.date-range .dash { color: var(--muted-2); }
.filter-top select { width: auto; min-width: 140px; height: 36px; }
.filter-top .btn { height: 36px; }
.filter-chip-row { display: flex; align-items: flex-start; gap: 10px; padding-top: 11px; margin-top: 11px; border-top: 1px dashed var(--line); }
.filter-chip-label { flex: 0 0 44px; font-size: 11px; color: var(--muted); padding-top: 6px; letter-spacing: 0.04em; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fbfcfa;
  color: var(--ink-2);
  font-size: 11.5px;
  border-radius: 2px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.filter-chip b { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--muted-2); }
.filter-chip:hover { border-color: var(--line-strong); background: var(--paper); }
.filter-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-chip.active b { color: rgba(255, 255, 255, 0.6); }
.filter-chip.source-chip { height: 27px; font-size: 11px; background: transparent; }
.filter-chip.source-chip.active { background: var(--sea); border-color: var(--sea); color: #fff; }
.filter-chip.zero { opacity: 0.45; }
.filter-hint { font-size: 10.5px; color: var(--muted-2); padding-top: 2px; }

.channel-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; font-size: 10.5px; border-radius: 2px; border: 1px solid var(--line-strong); background: #fbfcfa; color: var(--ink-2); white-space: nowrap; }
.channel-badge[data-group="海派"] { border-color: rgba(15, 111, 104, 0.3); background: var(--sea-soft); color: var(--sea-dark); }
.channel-badge[data-group="空派"] { border-color: rgba(43, 111, 143, 0.3); background: var(--blue-soft); color: var(--blue); }
.channel-badge[data-group="快递"] { border-color: rgba(216, 154, 43, 0.4); background: var(--amber-soft); color: #8a5f12; }
.channel-badge[data-group="铁路"] { border-color: var(--line-strong); background: var(--slate-soft); color: #4e6166; }
.channel-badge[data-group="其他"] { border-color: var(--line); background: var(--paper); color: var(--muted); }
.channel-cell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.channel-cell small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.po-inline { display: inline-block; margin-left: 7px; font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--muted-2); }
.prod-main { min-width: 0; }
.data-table td.num, .data-table th.num-head { text-align: right; }
.data-table td.num { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.data-table td.num small { display: inline; font-family: var(--sans); font-size: 9.5px; color: var(--muted-2); margin-left: 2px; }
.data-table td.cell-actions-col { text-align: right; white-space: nowrap; }
.table-action {
  display: inline-flex; align-items: center; gap: 4px;
  height: 27px; padding: 0 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 11px; border-radius: 2px; margin-left: 4px;
}
.table-action:hover { border-color: var(--ink); background: var(--paper); }
.table-action.primary { border-color: rgba(15, 111, 104, 0.35); color: var(--sea-dark); }
.table-action.primary:hover { background: var(--sea-soft); }
.table-action svg { width: 13px; height: 13px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.table-footer .table-footer-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-footer .dot-sep { color: var(--line-strong); }

/* channel picker in form */
.channel-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.channel-option { position: relative; display: block; cursor: pointer; }
.channel-option input { position: absolute; opacity: 0; pointer-events: none; }
.channel-option-card {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 92px; padding: 8px 11px;
  border: 1px solid var(--line-strong);
  background: #fbfcfa;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.channel-option-card b { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.channel-option-card small { font-size: 9.5px; color: var(--muted-2); }
.channel-option:hover .channel-option-card { border-color: var(--ink-2); }
.channel-option input:checked + .channel-option-card { border-color: var(--ink); background: var(--ink); color: #fff; }
.channel-option input:checked + .channel-option-card b { color: #fff; }
.channel-option input:checked + .channel-option-card small { color: rgba(255, 255, 255, 0.55); }
.channel-option input:focus-visible + .channel-option-card { outline: 2px solid var(--sea); outline-offset: 2px; }
.source-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.source-preset {
  height: 26px; padding: 0 9px; border: 1px solid var(--line); background: #fbfcfa;
  color: var(--muted); font-size: 10.5px; border-radius: 2px;
}
.source-preset:hover { border-color: var(--sea); color: var(--sea-dark); background: var(--sea-soft); }
.form-section .form-hint { margin-top: 5px; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.small { font-size: 11px; }
.mono-text { font-family: var(--mono); }
.right { text-align: right; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
.spinner.dark { border-color: rgba(16, 41, 50, 0.2); border-top-color: var(--ink); }
.loading-block { padding: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes route-draw { from { stroke-dashoffset: 1100; } to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(14px); } }

/* ---------- follow-up board ---------- */
.follow-table { min-width: 1160px; table-layout: auto; }
.follow-table .order-cell { width: 100px; }
.order-wrap { display: flex; align-items: center; gap: 5px; }
.order-no { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.01em; color: var(--ink); white-space: nowrap; }
.copy-mini {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; flex: 0 0 22px;
  border: 0; background: transparent; color: var(--muted-2);
  border-radius: 2px; padding: 0;
}
.copy-mini:hover { background: var(--paper); color: var(--sea); }
.copy-mini svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tracking-cell { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 138px; }
.tracking-top { display: flex; align-items: center; gap: 2px; }
.tracking-checked { font-size: 8px; color: var(--muted-2); line-height: 1.3; }
.tracking-checked:empty { display: none; }
.tracking-state { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 9px; line-height: 1.45; color: var(--muted); }
.tracking-state b { font-weight: 650; }
.tracking-state[data-tone="teal"] { color: var(--sea-dark); }
.tracking-state[data-tone="blue"] { color: var(--blue); }
.tracking-state[data-tone="green"] { color: var(--green); }
.tracking-state[data-tone="amber"] { color: #8a5f12; }
.tracking-state[data-tone="rust"] { color: var(--rust); }
.tracking-state.error { color: var(--rust); }
.track-refresh { width: 18px; height: 18px; flex-basis: 18px; }
.track-refresh.spinning svg { animation: spin 0.9s linear infinite; }
.tracking-no { font-family: var(--mono); font-size: 10px; letter-spacing: -0.02em; color: var(--ink-2); word-break: break-all; line-height: 1.5; }
.copy-track { flex: 0 0 20px; width: 20px; height: 20px; }
.prod-en { margin-top: 2px; font-size: 10px; color: var(--muted-2); line-height: 1.4; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-count { margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.prod-count b { color: var(--ink-2); font-weight: 650; }
.route-col { width: 152px; min-width: 132px; }
.route-input { width: 100%; min-height: 48px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 2px; background: #fbfcfa; font-size: 11px; line-height: 1.55; color: var(--ink-2); resize: vertical; }
.route-input:focus { outline: none; border-color: var(--sea); background: #fff; box-shadow: 0 0 0 2px rgba(15, 111, 104, 0.1); }
.route-readonly { font-size: 11px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; }
.note-col { width: 170px; min-width: 155px; }
.note-cell {
  display: block;
  min-height: 34px;
  max-width: 170px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
}
.note-cell:hover { border-color: var(--line); background: #fbfcfa; }
.note-cell:focus-visible { outline: 2px solid var(--sea); outline-offset: 1px; }
.note-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink-2);
  word-break: break-word;
}
.note-empty { font-size: 11px; color: var(--muted-2); }
.channel-type-select { min-width: 250px; max-width: 310px; }
.status-select {
  height: 30px;
  min-width: 92px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--ink-2);
  background: #fbfcfa;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.status-select[data-tone="slate"] { background-color: var(--slate-soft); border-color: #d6dedb; color: #4e6166; }
.status-select[data-tone="amber"] { background-color: var(--amber-soft); border-color: #eed9ad; color: #8a5f12; }
.status-select[data-tone="teal"] { background-color: var(--sea-soft); border-color: #bfe0da; color: var(--sea-dark); }
.status-select[data-tone="blue"] { background-color: var(--blue-soft); border-color: #c6dde8; color: var(--blue); }
.status-select[data-tone="rust"] { background-color: var(--rust-soft); border-color: #efc9bf; color: var(--rust); }
.arrival-input {
  width: 102px; height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbfcfa;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--ink-2);
}
.arrival-input:hover { border-color: var(--line-strong); }
.table-action.deliver { border-color: rgba(47, 125, 93, 0.35); color: var(--green); }
.table-action.deliver:hover { background: var(--green-soft); border-color: var(--green); }
.follow-table td { vertical-align: middle; }
.follow-table .prod-thumb { width: 44px; height: 44px; flex-basis: 44px; }
.follow-table .prod-name { font-size: 12.5px; }
.follow-table .prod-info { max-width: 170px; }
.follow-table .channel-cell { min-width: 100px; }
.follow-table .channel-badge { white-space: normal; line-height: 1.45; }
.follow-table th, .follow-table td { padding-left: 10px; padding-right: 10px; }
.channel-badge[data-group="快速海派"] { border-color: rgba(15, 111, 104, 0.3); background: var(--sea-soft); color: var(--sea-dark); }
.channel-badge[data-group="普通海运"] { border-color: rgba(43, 111, 143, 0.3); background: var(--blue-soft); color: var(--blue); }
.archive-table { min-width: 880px; }
.archive-table .order-cell { width: 170px; }


/* ---------- cargo one-row sheet ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; transform: rotate(180deg); }
.cargo-sheet-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) var(--paper);
}
.cargo-sheet-wrap::-webkit-scrollbar { height: 10px; }
.cargo-sheet-wrap::-webkit-scrollbar-track { background: var(--paper); }
.cargo-sheet-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); }
.cargo-sheet { display: inline-block; min-width: 100%; vertical-align: top; }
.cargo-head, .cargo-row { display: flex; align-items: stretch; }
.cargo-head { background: #f0f3ee; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.cargo-cell {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-right: 1px solid var(--line);
  min-height: 168px;
  background: var(--surface);
  position: relative;
}
.cargo-head-cell { min-height: 0; padding: 10px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); align-items: flex-start; justify-content: center; background: #f0f3ee; }
.cargo-cell:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
.cargo-head .cargo-cell:first-child { z-index: 6; background: #f0f3ee; }
.cargo-row .cargo-cell:last-child { border-right: 0; }
.cell-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  padding: 5px 6px;
  font-size: 12.5px;
  color: var(--text);
  min-height: 30px;
}
.cell-input:hover { border-color: var(--line); background: #fbfcfa; }
.cell-input:focus { outline: none; border-color: var(--sea); background: #fff; box-shadow: 0 0 0 2px rgba(15, 111, 104, 0.1); }
textarea.cell-input { flex: 1; resize: vertical; min-height: 118px; line-height: 1.6; }
select.cell-input { height: 32px; padding-right: 8px; appearance: auto; background: #fff; border: 1px solid var(--line); }
.cargo-channel-select { font-size: 11px; }
.cargo-custom-channel { font-size: 11px; background: #fff; border: 1px solid var(--amber) !important; }
.cargo-mark-actions { display: flex; gap: 4px; }
.cargo-mini-btn { border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 9.5px; line-height: 1; padding: 4px 5px; cursor: pointer; border-radius: 2px; }
.cargo-mini-btn:hover { border-color: var(--sea); color: var(--sea); background: var(--sea-soft); }
.cargo-channel-note { display: block; padding: 2px 4px; font-size: 9.5px; line-height: 1.55; color: var(--muted); max-height: 66px; overflow: hidden; }
.cargo-cell input[type="number"], .cargo-cell input[type="date"] { font-family: var(--mono); font-size: 11.5px; }
.cargo-images { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }
.cargo-thumb { position: relative; width: 58px; height: 58px; border: 1px solid var(--line); background: var(--paper-2); }
.cargo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cargo-thumb button { position: absolute; top: 1px; right: 1px; width: 17px; height: 17px; border: 0; border-radius: 50%; background: rgba(10, 29, 36, 0.72); color: #fff; font-size: 10px; line-height: 1; display: grid; place-items: center; }
.cargo-thumb button:hover { background: var(--rust); }
.cargo-thumb.pending::after { content: ""; position: absolute; left: 2px; bottom: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.cargo-add-image {
  width: 58px; height: 58px;
  border: 1px dashed var(--line-strong);
  background: #fbfcfa;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 9.5px;
}
.cargo-add-image:hover { border-color: var(--sea); color: var(--sea); background: var(--sea-soft); }
.cargo-add-image svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cargo-order-copy { position: absolute; right: 8px; top: 42px; }
.cargo-hint { font-size: 11px; color: var(--muted-2); margin: 10px 2px 14px; line-height: 1.7; }
.cargo-extra { background: var(--surface); border: 1px solid var(--line); padding: 0 18px 16px; }
.cargo-extra summary { padding: 14px 0; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.cargo-extra summary::before { content: "+"; color: var(--amber); font-family: var(--mono); }
.cargo-extra[open] summary::before { content: "−"; }
.cargo-extra summary::-webkit-details-marker { display: none; }
.cargo-extra .form-grid { margin-top: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .view { padding: 22px 24px 56px; }
  .topbar { padding: 0 24px; }
  .manifest { grid-template-columns: repeat(3, 1fr); }
  .manifest-cell:nth-child(3) { border-right: 0; }
  .manifest-cell:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .manifest-cell.ink { border-right: 1px solid rgba(255, 255, 255, 0.1); }
}
@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .import-grid, .account-grid { grid-template-columns: 1fr; }
  .role-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .login-brand { padding: 34px 40px; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { min-height: auto; padding: 28px 28px 30px; }
  .login-copy { margin-top: 40px; }
  .login-copy h1 { font-size: 40px; }
  .route-map { display: none; }
  .login-foot { margin-top: 26px; }
  .login-panel { padding: 34px 24px 40px; }
  .login-legal { margin-top: 30px; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 20px 0 60px rgba(10, 29, 36, 0.3);
    z-index: 80;
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(7, 20, 26, 0.45); z-index: 70; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .breadcrumb { flex: 1; }
  .view { padding: 20px 16px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .manifest { grid-template-columns: 1fr 1fr; }
  .manifest-cell:nth-child(3) { border-right: 1px solid var(--line); }
  .manifest-cell:nth-child(2n) { border-right: 0; }
  .manifest-cell:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .role-layout { grid-template-columns: 1fr; }
  .role-list { display: flex; overflow-x: auto; }
  .role-list-head { display: none; }
  .role-option { min-width: 160px; border-bottom: 0; border-right: 1px solid var(--line); }
  .imp-exp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .manifest { grid-template-columns: 1fr 1fr; }
  .manifest-cell { padding: 14px 16px; }
  .manifest-value { font-size: 28px; }
  .data-table { min-width: 0; }
  .data-table thead { display: none; }
  .data-table tbody tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .data-table tbody tr:hover { background: transparent; }
  .data-table td { display: flex; gap: 14px; padding: 4px 0; border: 0; width: 100%; }
  .data-table td::before { content: attr(data-label); flex: 0 0 78px; color: var(--muted-2); font-size: 10.5px; padding-top: 2px; }
  .data-table td[data-label=""]::before { display: none; }
  .data-table td.cell-product-col { padding: 0 0 8px; }
  .data-table td.cell-product-col::before { display: none; }
  .data-table td.cell-actions-col { justify-content: flex-end; padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 6px; }
  .data-table td.cell-actions-col::before { display: none; }
  .data-table td.cell-date-col { padding-top: 0; }
  .data-table td.cell-date-col::before { display: none; }
  .prod-cell { min-width: 0; }
  .prod-info, .truncate { max-width: none; white-space: normal; }
  .cell-route { max-width: none; }
  .pagination { justify-content: center; }
  .page-info { width: 100%; text-align: center; }
  .filter-row select, .filter-row input[type="date"] { flex: 1 1 45%; width: auto; }
  .toolbar-actions { width: 100%; margin-left: 0; }
  .toolbar-actions .btn { flex: 1; }
  .filter-spacer { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-top-width: 3px; }
  .modal-foot { padding: 12px 16px; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 15px 16px 12px; }
  .drawer-head { padding: 18px 18px 15px; }
  .drawer-body { padding: 16px 18px 40px; }
  .drawer-actions { flex-wrap: wrap; }
  .import-steps { gap: 8px; }
  .import-step { font-size: 10.5px; }
  .radio-card { padding: 9px; }
  .import-mode { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
  .account-grid { gap: 14px; }
  .profile-facts { grid-template-columns: 1fr 1fr; }
  .simple-table { display: block; overflow-x: auto; white-space: nowrap; }
  .toasts { top: auto; bottom: 18px; left: 16px; right: 16px; }
  .toast { max-width: none; }
  .today-label { display: none; }
  .panel-title small { display: none; }
}
@media (max-width: 480px) {
  .login-copy h1 { font-size: 34px; }
  .login-form-head h2 { font-size: 28px; }
  .page-head h1 { font-size: 25px; }
  .manifest-cell { padding: 12px 14px; }
  .manifest-cell:last-child { grid-column: 1 / -1; }
  .manifest-value { font-size: 25px; }
  .manifest-note { font-size: 10px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .pipeline { padding: 18px 14px; }
  .pipe-count { font-size: 22px; }
  .drawer-actions .btn { flex: 1; }
}

/* ledger responsive */
@media (max-width: 1100px) {
  .ledger-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ledger-summary-cell:nth-child(3n) { border-right: 0; }
  .ledger-summary-cell:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .ledger-actions { width: 100%; }
  .ledger-actions .btn { flex: 1; }
  .filter-top .search-box { flex-basis: 100%; }
  .filter-top select { flex: 1; }
  .filter-top .date-range { width: 100%; }
  .filter-top .date-range input[type="date"] { flex: 1; width: auto; }
  .ledger-filters { padding: 12px; }
}
@media (max-width: 700px) {
  .ledger-summary { grid-template-columns: 1fr 1fr; }
  .ledger-summary-cell { padding: 10px 12px; }
  .ledger-summary-cell:nth-child(2n) { border-right: 0; }
  .ledger-summary-cell:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .ledger-summary-cell:last-child { grid-column: 1 / -1; }
  .ledger-summary-value { font-size: 21px; }
  .filter-chip-row { flex-direction: column; gap: 6px; }
  .filter-chip-label { flex: none; padding-top: 0; }
  .filter-chip { height: 28px; }
  .data-table td.num { text-align: left; font-family: var(--sans); font-size: 12.5px; }
  .data-table td.num small { display: inline; }
  .data-table td.cell-actions-col { justify-content: flex-start; }
  .table-action { margin-left: 0; margin-right: 6px; height: 30px; padding: 0 10px; }
  .table-footer { justify-content: center; }
  .channel-option-card { min-width: 78px; padding: 7px 9px; }
}
@media (max-width: 480px) {
  .ledger-summary-cell:last-child { grid-column: 1 / -1; }
  .filter-top .date-range { flex-wrap: wrap; }
}


/* follow-up / cargo responsive */
@media (max-width: 900px) {
  .follow-table { min-width: 0; }
  .archive-table { min-width: 0; }
  .follow-table td.order-cell, .archive-table td.order-cell { width: auto; }
  .cargo-head { position: static; }
  .cargo-cell:first-child { position: sticky; }
  .cargo-cell { min-height: 150px; }
  .cargo-sheet-wrap { border-left: 0; border-right: 0; }
}
@media (max-width: 700px) {
  .follow-table td.cell-actions-col, .archive-table td.cell-actions-col { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .follow-table .table-action, .archive-table .table-action { margin-right: 0; }
  .status-select { min-width: 100px; }
  .arrival-input { width: 140px; }
  .cargo-cell { min-height: 140px; padding: 7px; }
  .cargo-head-cell { min-height: 0; padding: 9px 7px; }
  .cargo-hint { font-size: 10.5px; }
  .cargo-extra { padding: 0 14px 14px; }
}


/* fit all follow-up columns on medium desktop widths */
@media (min-width: 901px) and (max-width: 1520px) {
  .follow-table { min-width: 0; width: 100%; table-layout: fixed; }
  .follow-table th:nth-child(1), .follow-table td:nth-child(1) { width: 8%; }
  .follow-table th:nth-child(2), .follow-table td:nth-child(2) { width: 14%; }
  .follow-table th:nth-child(3), .follow-table td:nth-child(3) { width: 12%; }
  .follow-table th:nth-child(4), .follow-table td:nth-child(4) { width: 9%; }
  .follow-table th:nth-child(5), .follow-table td:nth-child(5) { width: 14%; }
  .follow-table th:nth-child(6), .follow-table td:nth-child(6) { width: 10%; }
  .follow-table th:nth-child(7), .follow-table td:nth-child(7) { width: 16%; }
  .follow-table th:nth-child(8), .follow-table td:nth-child(8) { width: 17%; }
  .follow-table .order-cell { width: auto; }
  .note-col { width: auto; min-width: 0; }
  .note-cell { max-width: none; }
  .tracking-cell { min-width: 0; }
  .table-action { padding-left: 8px; padding-right: 8px; }
}


/* ---------- integration settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.settings-card { min-width: 0; }
.settings-body { padding: 20px 22px 22px; }
.integration-state { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.integration-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); display: block; }
.integration-state.on { color: var(--green); }
.integration-state.on i { background: var(--green); box-shadow: 0 0 0 3px rgba(47, 125, 93, 0.12); }
.integration-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.integration-meta > div { display: flex; flex-direction: column; gap: 3px; }
.integration-meta strong { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 16px 0 20px; }
.checkbox-line { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.checkbox-line input { width: 15px; height: 15px; accent-color: var(--sea); }
.field-inline { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; margin: 0; }
.field-inline .field-label { margin: 0; white-space: nowrap; }
.field-inline input { width: 76px; }
.field-suffix { font-size: 11px; color: var(--muted); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-help { padding: 20px 22px; }
.settings-help .section-head { margin-bottom: 12px; }
.settings-steps { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.9; color: var(--ink-2); }
.settings-steps li { margin-bottom: 4px; }
.settings-help code { font-family: var(--mono); font-size: 10.5px; background: var(--paper); padding: 1px 4px; border-radius: 2px; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .integration-meta { grid-template-columns: 1fr; } .settings-body { padding: 16px; } .settings-actions .btn { flex: 1; } }


/* ---------- tracking timeline ---------- */
.tracking-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tracking-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 2px; font-size: 10.5px; font-weight: 600; border: 1px solid var(--line); background: var(--paper); color: var(--muted); }
.tracking-badge[data-tone="teal"] { background: var(--sea-soft); border-color: #bfe0da; color: var(--sea-dark); }
.tracking-badge[data-tone="blue"] { background: var(--blue-soft); border-color: #c6dde8; color: var(--blue); }
.tracking-badge[data-tone="green"] { background: var(--green-soft); border-color: #bfe2d0; color: var(--green); }
.tracking-badge[data-tone="rust"] { background: var(--rust-soft); border-color: #efc9bf; color: var(--rust); }
.tracking-checked { font-size: 10px; color: var(--muted-2); }
.tracking-error { margin: 0 0 10px; font-size: 11px; color: var(--rust); }
.tracking-timeline { position: relative; padding-left: 4px; }
.tracking-event { display: grid; grid-template-columns: 12px 1fr; gap: 9px; padding-bottom: 12px; position: relative; }
.tracking-event:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: -2px; width: 1px; background: var(--line); }
.tracking-event-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sea); margin-top: 5px; position: relative; z-index: 1; }
.tracking-event-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.tracking-event-head strong { font-size: 11.5px; font-weight: 550; color: var(--ink-2); }
.tracking-event-head time { font-size: 9.5px; color: var(--muted-2); font-family: var(--mono); }
.tracking-event-place { font-size: 10px; color: var(--muted); margin-top: 2px; }
.section-head .btn { margin-left: auto; }


/* ---------- cargo two-row form card ---------- */
.cargo-form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
}
.cargo-form-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cargo-form-row-primary { grid-template-columns: 110px 160px 180px 112px 205px minmax(160px, 1fr) minmax(180px, 1fr); }
.cargo-form-row-meta { grid-template-columns: 120px 92px 90px 78px 82px 138px 108px 142px minmax(160px, 1fr); border-top: 1px solid var(--line); }
.cargo-field {
  min-width: 0;
  padding: 8px 9px 9px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--surface);
}
.cargo-field:last-child { border-right: 0; }
.cargo-form-row-primary .cargo-field { min-height: 154px; }
.cargo-form-row-meta .cargo-field { min-height: 84px; }
.cargo-label { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cargo-field .cell-input { border: 1px solid var(--line); background: #fbfcfa; border-radius: 2px; }
.cargo-field .cell-input:hover { border-color: var(--line-strong); background: #fff; }
.cargo-field .cell-input:focus { border-color: var(--sea); background: #fff; }
.cargo-field textarea.cell-input { flex: 1; resize: vertical; min-height: 76px; line-height: 1.55; }
.cargo-form-row-meta .cargo-field textarea.cell-input { min-height: 58px; }
.cargo-order-line { display: flex; align-items: center; gap: 4px; position: relative; }
.cargo-order-line .cell-input { padding-right: 26px; }
.cargo-order-line .copy-mini { position: absolute; right: 2px; top: 2px; }
.cargo-field.cw-image { justify-content: flex-start; }
.cargo-field.cw-channel { gap: 4px; }
.cargo-field.cw-note textarea { min-height: 58px; }
.cargo-field .cargo-mark-actions { margin-top: auto; }
.cargo-field .cargo-channel-note { max-height: 52px; overflow: hidden; }
.cargo-field .cargo-images { flex: 1; align-content: flex-start; }
@media (max-width: 1100px) {
  .cargo-form-row-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cargo-form-row-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cargo-field { min-height: 112px; }
  .cargo-form-row-primary .cargo-field { min-height: 132px; }
}
@media (max-width: 650px) {
  .cargo-form-row-primary, .cargo-form-row-meta { grid-template-columns: 1fr; }
  .cargo-field { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .cargo-form-row-primary .cargo-field, .cargo-form-row-meta .cargo-field { min-height: 88px; }
}

.tracking-courier { font-size: 10px; color: var(--ink-2); font-weight: 600; }


/* ---------- compact follow-up table ---------- */
@media (min-width: 901px) {
  .follow-table th { padding: 7px 8px; font-size: 9.5px; }
  .follow-table td { padding: 6px 8px; font-size: 11px; vertical-align: middle; }
  .follow-table .order-no { font-size: 12px; }
  .follow-table .copy-mini { width: 18px; height: 18px; flex-basis: 18px; }
  .follow-table .copy-mini svg { width: 11px; height: 11px; }
  .follow-table .prod-cell { gap: 7px; min-width: 0; }
  .follow-table .prod-thumb { width: 34px; height: 34px; flex-basis: 34px; }
  .follow-table .prod-name { font-size: 11.5px; line-height: 1.35; }
  .follow-table .prod-en { font-size: 9px; margin-top: 0; line-height: 1.3; }
  .follow-table .prod-count { font-size: 9.5px; margin-top: 2px; line-height: 1.35; }
  .follow-table .prod-info { display: none; }
  .follow-table .tracking-cell { min-width: 138px; gap: 0; }
  .follow-table .tracking-top { gap: 2px; }
  .follow-table .tracking-no { font-size: 9.5px; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
  .follow-table .track-refresh { width: 16px; height: 16px; flex-basis: 16px; }
  .follow-table .tracking-state { font-size: 8.8px; line-height: 1.35; -webkit-line-clamp: 1; white-space: nowrap; }
  .follow-table .tracking-checked { display: none; }
  .follow-table .channel-badge { font-size: 9px; padding: 1px 5px; line-height: 1.4; }
  .follow-table .channel-cell { min-width: 100px; }
  .follow-table .channel-cell small { font-size: 8.8px; line-height: 1.35; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .follow-table .route-input { min-height: 30px; height: 32px; padding: 3px 5px; font-size: 10px; line-height: 1.4; resize: none; }
  .follow-table .route-readonly { font-size: 10px; line-height: 1.4; max-height: 32px; overflow: hidden; }
  .follow-table .note-cell { min-height: 28px; padding: 3px 5px; }
  .follow-table .note-text { font-size: 10px; line-height: 1.4; -webkit-line-clamp: 2; }
  .follow-table .note-empty { font-size: 9.5px; }
  .follow-table .arrival-input { height: 26px; width: 102px; font-size: 9.5px; padding: 0 4px; }
  .follow-table .table-action { height: 24px; padding: 0 6px; font-size: 10px; margin-left: 3px; gap: 3px; }
  .follow-table .table-action svg { width: 11px; height: 11px; }
  .follow-table .cell-actions-col { vertical-align: middle; }
}


/* ---------- version update banner ---------- */
.version-banner {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  max-width: calc(100vw - 32px);
  padding: 11px 12px;
  background: #10292f;
  color: #f3f6f2;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 34px rgba(10, 29, 36, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.version-banner.visible { opacity: 1; transform: translateY(0); }
.version-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: 0 0 7px; box-shadow: 0 0 0 3px rgba(216, 154, 43, 0.2); }
.version-copy { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.version-copy strong { font-size: 12px; font-weight: 650; }
.version-copy small { font-size: 10px; color: rgba(243, 246, 242, 0.65); }
.version-refresh { height: 28px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, 0.24); background: transparent; color: #fff; font-size: 11px; border-radius: 2px; cursor: pointer; }
.version-refresh:hover { background: rgba(255, 255, 255, 0.12); }
.version-close { border: 0; background: transparent; color: rgba(255, 255, 255, 0.55); font-size: 17px; line-height: 1; padding: 0 2px; cursor: pointer; }
.version-close:hover { color: #fff; }
@media (max-width: 600px) {
  .version-banner { left: 12px; right: 12px; bottom: 12px; min-width: 0; }
}


.drawer-status { display: inline-flex; align-items: center; gap: 5px; }
.drawer-status > span { font-size: 9.5px; color: var(--muted); }
.drawer-status select { height: 25px; border: 1px solid var(--line); background: #fbfcfa; color: var(--ink-2); font-size: 10.5px; padding: 0 22px 0 7px; border-radius: 2px; }


/* compact archive table */
@media (min-width: 901px) {
  .archive-table th { padding: 7px 8px; font-size: 9.5px; }
  .archive-table td { padding: 6px 8px; font-size: 11px; vertical-align: middle; }
  .archive-table .order-no { font-size: 12px; }
  .archive-table .prod-thumb { width: 34px; height: 34px; flex-basis: 34px; }
  .archive-table .prod-name { font-size: 11.5px; }
  .archive-table .prod-en { font-size: 9px; }
  .archive-table .prod-info { font-size: 9px; }
  .archive-table .channel-badge { font-size: 9px; padding: 1px 5px; }
  .archive-table .channel-cell small { font-size: 8.8px; }
  .archive-table .table-action { height: 24px; padding: 0 6px; font-size: 10px; }
  .archive-table .table-action svg { width: 11px; height: 11px; }
}


/* batch selection + tracking modal */
.follow-table .row-select { width: 13px; height: 13px; margin: 0 4px 0 0; flex: 0 0 13px; accent-color: var(--sea-dark); cursor: pointer; }
.follow-table .order-wrap { display: flex; align-items: center; gap: 0; }
.follow-table th:first-child { white-space: nowrap; }
.follow-table #select-all { width: 13px; height: 13px; margin: 0 4px 0 0; vertical-align: -2px; accent-color: var(--sea-dark); }
.bulk-bar { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 7px 10px; background: var(--sea-soft); border: 1px solid rgba(15, 111, 104, 0.22); }
.bulk-bar[hidden] { display: none; }
.bulk-count { font-size: 11px; color: var(--sea-dark); font-weight: 600; }
.bulk-spacer { flex: 1; }
.bulk-bar .btn-sm { height: 26px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.batch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.batch-grid .field { gap: 4px; }
.tracking-state.clickable { cursor: pointer; }
.tracking-state.clickable:hover { text-decoration: underline; text-underline-offset: 2px; }
.tracking-modal-summary { padding: 2px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tracking-modal-summary > div:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tracking-modal-no { margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); word-break: break-all; }
.tracking-modal-last { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }
.privacy-note { margin: 0 0 12px; padding: 9px 11px; background: #f7f1e4; border: 1px solid #ead9b7; color: #7a5b19; font-size: 11px; line-height: 1.55; }
@media (max-width: 600px) { .batch-grid { grid-template-columns: 1fr; } }


/* ---------- cargo two-stage workflow ---------- */
.cargo-stage { background: var(--surface); }
.cargo-stage + .cargo-stage { border-top: 1px solid var(--line); }
.cargo-stage-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #f6f8f3; border-bottom: 1px solid var(--line); }
.cargo-stage-no { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 22px; background: var(--ink); color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: 0.03em; flex: 0 0 25px; }
.cargo-stage-head h2 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: 0.03em; color: var(--ink); }
.cargo-stage-head p { margin: 2px 0 0; font-size: 10px; line-height: 1.4; color: var(--muted); }
.cargo-stage-forwarder .cargo-stage-head { background: #f2f6f6; }
.cargo-stage-forwarder .cargo-stage-no { background: var(--sea-dark); }
.cargo-stage-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.cargo-stage-grid .cargo-field { background: var(--surface); border: 0; min-height: 106px; padding: 9px 11px 10px; }
.cargo-stage-internal .cw-order { grid-column: span 2; }
.cargo-stage-internal .cw-product { grid-column: span 4; }
.cargo-stage-internal .cw-image { grid-column: span 2; }
.cargo-stage-internal .cw-channel { grid-column: span 4; }
.cargo-stage-internal .cw-address { grid-column: span 4; }
.cargo-stage-internal .cw-marks { grid-column: span 4; }
.cargo-stage-internal .cw-total { grid-column: span 2; }
.cargo-stage-internal .cw-customs { grid-column: span 2; }
.cargo-stage-internal .cw-domestic { grid-column: span 3; }
.cargo-stage-internal .cw-expected { grid-column: span 3; }
.cargo-stage-internal .cw-note { grid-column: span 6; }
.cargo-stage-forwarder-grid .cw-weight { grid-column: span 2; }
.cargo-stage-forwarder-grid .cw-boxes { grid-column: span 2; }
.cargo-stage-forwarder-grid .cw-tracking { grid-column: span 4; }
.cargo-stage-forwarder-grid .cw-delivery { grid-column: span 4; }
.cargo-stage-forwarder-grid .cw-packing { grid-column: span 4; }
.cargo-stage-forwarder-grid .cw-freight { grid-column: span 4; }
.cargo-stage-forwarder-grid .cw-arrival { grid-column: span 4; }
.cargo-stage-internal .cw-address .cargo-field,
.cargo-stage-internal .cw-address textarea,
.cargo-stage-internal .cw-marks textarea { min-height: 82px; }
.cargo-stage-grid .cargo-label { font-size: 10px; }
.cargo-stage-grid .cargo-field .cell-input { background: #fcfdfb; }
.cargo-stage-grid .cargo-field textarea.cell-input { min-height: 58px; }
.cargo-stage-grid .cw-note textarea, .cargo-stage-grid .cw-packing textarea, .cargo-stage-grid .cw-freight textarea, .cargo-stage-grid .cw-arrival textarea { min-height: 58px; }
@media (max-width: 1100px) {
  .cargo-stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cargo-stage-grid .cargo-field { grid-column: span 1 !important; }
  .cargo-stage-grid .cw-product, .cargo-stage-grid .cw-address, .cargo-stage-grid .cw-marks, .cargo-stage-grid .cw-note, .cargo-stage-grid .cw-packing, .cargo-stage-grid .cw-freight, .cargo-stage-grid .cw-arrival { grid-column: span 2 !important; }
}
@media (max-width: 650px) {
  .cargo-stage-grid { grid-template-columns: 1fr; }
  .cargo-stage-grid .cargo-field { grid-column: span 1 !important; min-height: 0; }
  .cargo-stage-head { padding: 10px 12px; }
}


/* ---------- compact two-row cargo sheet ---------- */
.cargo-sheet-row + .cargo-sheet-row { border-top: 1px solid var(--line); }
.cargo-row-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #f5f8f3; border-bottom: 1px solid var(--line); min-height: 29px; }
.cargo-row-no { display: inline-flex; align-items: center; justify-content: center; height: 17px; min-width: 23px; padding: 0 4px; background: var(--ink); color: #fff; font-family: var(--mono); font-size: 9px; }
.cargo-row-head strong { font-size: 11px; font-weight: 650; letter-spacing: 0.03em; color: var(--ink); }
.cargo-row-head small { margin-left: auto; font-size: 9px; color: var(--muted-2); letter-spacing: 0.04em; }
.cargo-forwarder-row .cargo-row-head { background: #f1f6f6; }
.cargo-forwarder-row .cargo-row-no { background: var(--sea-dark); }
.cargo-row-fields { display: grid; gap: 1px; background: var(--line); }
.cargo-own-fields { grid-template-columns: 92px minmax(150px, 1.2fr) 72px 145px minmax(140px, 1.3fr) minmax(140px, 1.3fr) 72px 74px 112px 104px minmax(130px, 1.2fr); }
.cargo-forwarder-fields { grid-template-columns: 90px 74px 150px 100px minmax(180px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr); }
.cargo-row-fields .cargo-field { border: 0; min-height: 92px; padding: 6px 8px 7px; gap: 4px; background: var(--surface); }
.cargo-row-fields .cargo-field .cargo-label { font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cargo-row-fields .cargo-field .cell-input { font-size: 11px; }
.cargo-row-fields .cargo-field textarea.cell-input { min-height: 52px; height: 52px; resize: vertical; line-height: 1.45; padding: 4px 5px; }
.cargo-row-fields .cw-note textarea, .cargo-row-fields .cw-packing textarea, .cargo-row-fields .cw-freight textarea, .cargo-row-fields .cw-arrival textarea { min-height: 52px; height: 52px; }
.cargo-row-fields .cw-address textarea, .cargo-row-fields .cw-marks textarea { min-height: 58px; height: 58px; }
.cargo-row-fields .cargo-mark-actions { margin-top: auto; gap: 3px; }
.cargo-row-fields .cargo-mini-btn { font-size: 8.5px; padding: 2px 5px; }
.cargo-row-fields .cargo-channel-note { max-height: 28px; font-size: 8.5px; line-height: 1.35; overflow: hidden; }
.cargo-row-fields .cargo-add-image { min-height: 46px; width: 56px; }
@media (max-width: 1280px) {
  .cargo-own-fields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cargo-forwarder-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cargo-row-fields .cargo-field { min-height: 88px; }
}
@media (max-width: 760px) {
  .cargo-own-fields, .cargo-forwarder-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cargo-row-head { padding: 6px 8px; }
  .cargo-row-fields .cargo-field { min-height: 78px; }
}
@media (max-width: 480px) {
  .cargo-own-fields, .cargo-forwarder-fields { grid-template-columns: 1fr; }
}


.settings-security { margin-top: 16px; }
.security-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.security-points > div { padding: 11px 12px; background: #f7f9f5; border: 1px solid var(--line); }
.security-points strong { display: block; margin-bottom: 4px; font-size: 11.5px; color: var(--ink-2); }
.security-points span { display: block; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
@media (max-width: 900px) { .security-points { grid-template-columns: 1fr; } }


/* ---------- pending shipments ---------- */
.pending-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 10px; padding: 8px 10px; background: #f7f9f5; border: 1px solid var(--line); font-size: 11px; color: var(--ink-2); }
.pending-summary b { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.pending-table .prod-thumb { width: 34px; height: 34px; flex-basis: 34px; }
.pending-table .prod-name { font-size: 11.5px; }
.pending-table .prod-en { font-size: 9px; }
.pending-table .order-no { font-size: 12px; }
.pending-table .channel-badge { font-size: 9px; padding: 1px 5px; }
.pending-table .channel-cell small { font-size: 8.8px; display: block; }
.pending-table th { padding: 7px 8px; font-size: 9.5px; }
.pending-table td { padding: 8px; font-size: 11px; vertical-align: middle; }
.pending-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.pending-actions .btn-sm { height: 26px; padding: 0 8px; font-size: 10px; }
@media (max-width: 800px) {
  .pending-table thead { display: none; }
  .pending-table td { display: flex; gap: 10px; padding: 4px 0; border: 0; }
  .pending-table td::before { content: attr(data-label); flex: 0 0 70px; color: var(--muted-2); font-size: 10px; }
  .pending-table td:first-child::before { display: none; }
  .pending-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .pending-actions { justify-content: flex-start; }
}


/* pending shipments — cargo-style cards */
#pending-board { display: flex; flex-direction: column; gap: 14px; }
.pending-card { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); }
.pending-card .cargo-row-head { padding: 6px 10px; }
.pending-card .pending-head-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pending-card .pending-created { margin: 0; font-size: 9px; color: var(--muted-2); white-space: nowrap; }
.pending-card .cargo-row-fields .cargo-field { min-height: 76px; padding: 6px 8px 7px; }
.pending-card .cargo-row-fields .cargo-field .cell-input { font-size: 11px; }
.pending-card .cargo-row-fields textarea.cell-input { min-height: 52px; height: 52px; }
.pending-value { min-height: 20px; font-size: 11px; line-height: 1.45; color: var(--ink-2); overflow: hidden; }
.pending-value.pre { white-space: pre-wrap; max-height: 58px; overflow: hidden; }
.pending-value.mono { font-family: var(--mono); font-size: 10.5px; }
.pending-empty { color: var(--muted-2); font-size: 10px; }
.pending-product { display: flex; flex-direction: column; gap: 2px; }
.pending-product strong { font-size: 11.5px; font-weight: 550; color: var(--ink); }
.pending-product span { font-size: 9px; color: var(--muted-2); line-height: 1.3; }
.pending-image { width: 38px; height: 38px; object-fit: cover; border: 1px solid var(--line); background: #f2f4ef; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.pending-image.blank { background: #f2f4ef; }
.pending-sub { display: block; margin-top: 3px; font-size: 8.8px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-card .channel-badge { font-size: 9px; padding: 1px 5px; }
.pending-card .cargo-label { font-size: 9.5px; }
.pending-card .cargo-row-head strong { font-size: 11px; }
@media (max-width: 1280px) {
  .pending-card .cargo-own-fields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pending-card .cargo-forwarder-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pending-card .cargo-own-fields, .pending-card .cargo-forwarder-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pending-card .cargo-row-fields .cargo-field { min-height: 70px; }
  .pending-card .pending-head-actions { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .pending-card .cargo-own-fields, .pending-card .cargo-forwarder-fields { grid-template-columns: 1fr; }
}


/* pending read-only values: clearer emphasis */
.pending-card .cargo-label { font-size: 10px; font-weight: 650; color: var(--muted); }
.pending-value { font-size: 12.5px; font-weight: 550; color: var(--ink); line-height: 1.5; }
.pending-value.mono { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); }
.pending-product strong { font-size: 13px; font-weight: 650; color: var(--ink); }
.pending-product span { font-size: 10px; color: var(--muted-2); }
.pending-empty { font-size: 11px; font-weight: 500; }
.pending-card .cargo-row-head strong { font-size: 12px; font-weight: 700; }
.pending-card .cargo-row-fields .cargo-field { min-height: 82px; }


/* inline internal status selector */
.route-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.route-status-select { width: 100%; height: 21px; padding: 0 21px 0 6px; border: 1px solid var(--line); border-radius: 2px; background: #fbfcfa; color: var(--ink-2); font-size: 9.5px; font-weight: 600; }
.route-status-select:focus { border-color: var(--sea); background: #fff; }


.route-selects { display: flex; gap: 3px; }
.route-selects .route-status-select, .route-selects .route-issue-select { width: 50%; min-width: 0; }
.route-issue-select { height: 21px; padding: 0 16px 0 5px; border: 1px solid var(--line); border-radius: 2px; background: #fbfcfa; color: var(--muted); font-size: 9px; }
.route-issue-select.has-issue { color: var(--rust); border-color: rgba(176, 74, 53, 0.42); background: #fdf4f0; font-weight: 650; }
.route-issue-select:focus { border-color: var(--sea); background: #fff; }

.route-selects > :only-child { width: 100%; }


.route-state-select { width: 100%; height: 21px; padding: 0 18px 0 5px; border: 1px solid var(--line); border-radius: 2px; background: #fbfcfa; color: var(--ink-2); font-size: 9px; font-weight: 600; }
.route-state-select:focus { border-color: var(--sea); background: #fff; }
.route-state-select.has-issue { color: var(--rust); border-color: rgba(176, 74, 53, 0.42); background: #fdf4f0; }


/* dashboard priority alerts */
.dash-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 0 9px; }
.dash-section-head h2 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: 0.02em; color: var(--ink); }
.dash-section-head span { font-size: 10px; color: var(--muted-2); }
.dash-alerts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px; }
.dash-alerts.single { grid-template-columns: 1fr; }
.dash-alerts .panel { min-width: 0; }
.alert-panel .panel-head { padding-bottom: 9px; }
.alert-list { display: flex; flex-direction: column; }
.alert-row { display: flex; align-items: center; gap: 8px; padding: 8px 3px; border-bottom: 1px solid #edf0eb; text-decoration: none; color: inherit; min-width: 0; }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { background: #f8faf6; }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: var(--muted-2); }
.alert-dot[data-tone="rust"] { background: var(--rust); }
.alert-dot[data-tone="amber"] { background: var(--amber); }
.alert-dot[data-tone="teal"] { background: var(--sea); }
.alert-dot[data-tone="green"] { background: var(--green); }
.alert-main { display: flex; flex-direction: column; gap: 1px; min-width: 92px; max-width: 145px; }
.alert-main b { font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-main small { font-size: 9px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-reason { margin-left: auto; font-size: 10px; line-height: 1.35; color: var(--ink-2); text-align: right; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.alert-arrow { font-size: 9px; color: var(--sea-dark); white-space: nowrap; }
@media (max-width: 900px) {
  .dash-alerts { grid-template-columns: 1fr; }
  .alert-main { max-width: none; flex: 1; }
}


/* ---------- mobile app shell ---------- */
.mobile-tabbar { display: none; }
@media (max-width: 900px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 65;
    align-items: stretch;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 22px rgba(10, 29, 36, 0.08);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    backdrop-filter: blur(14px);
  }
  .mobile-tab {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    color: var(--muted);
    text-decoration: none;
    font-size: 9.5px;
    letter-spacing: 0.02em;
  }
  .mobile-tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-tab.active { color: var(--sea-dark); }
  .mobile-tab.active svg { stroke-width: 2; }
  .mobile-tab[hidden] { display: none; }
  .view { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: env(safe-area-inset-top); }
  .page-actions .btn, .ledger-actions .btn { min-height: 38px; }
  .mobile-tabbar + * { padding-bottom: 0; }
}
@media (max-width: 700px) {
  input, select, textarea { font-size: 16px !important; }
  .route-state-select { height: 32px; font-size: 12px !important; }
  .route-input { font-size: 12px !important; min-height: 34px; }
  .table-action, .pending-actions .btn-sm { min-height: 34px; }
  .alert-row { padding: 10px 2px; }
  .alert-main { min-width: 0; }
  .dash-section-head { margin-top: 16px; }
  .mobile-tabbar { padding-left: 2px; padding-right: 2px; }
  .mobile-tab { font-size: 9px; }
}
@media (display-mode: standalone) {
  .topbar { padding-top: calc(env(safe-area-inset-top) + 2px); }
}


/* ---------- identity watermark: screenshot deterrence ---------- */
.privacy-watermark {
  position: fixed;
  inset: 0;
  z-index: 1001;
  pointer-events: none;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  opacity: 0.055;
  user-select: none;
}
.privacy-watermark span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  transform: rotate(-24deg);
  transform-origin: center;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #102932;
  text-align: center;
}
@media (max-width: 600px) {
  .privacy-watermark { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .privacy-watermark span { font-size: 9px; }
}


/* mobile share */
.topbar-share { height: 28px; padding: 0 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 10.5px; border-radius: 2px; }
.topbar-share:hover { border-color: var(--sea); color: var(--sea-dark); }
.mobile-share-tip { margin: 0 0 10px; font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.mobile-share-row { display: flex; gap: 7px; align-items: stretch; }
.mobile-share-row select { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); background: #fbfcfa; font-family: var(--mono); font-size: 11px; padding: 0 7px; }
.mobile-share-actions { display: flex; gap: 7px; margin-top: 12px; }
.mobile-share-actions .btn { flex: 1; }
@media (max-width: 700px) {
  .topbar-share { height: 30px; font-size: 10px; padding: 0 8px; }
}


.pending-value-row { display: flex; align-items: flex-start; gap: 5px; min-width: 0; }
.pending-value-row .pending-value { flex: 1; min-width: 0; }
.pending-value.pre { max-height: none !important; overflow: visible !important; }
.pending-value { max-height: none !important; overflow: visible !important; }
.pending-copy { flex: 0 0 auto; height: 19px; padding: 0 5px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 8.5px; border-radius: 2px; cursor: pointer; }
.pending-copy:hover { border-color: var(--sea); color: var(--sea-dark); }
.pending-card .pending-head-actions { flex-wrap: wrap; justify-content: flex-end; }
.pending-card .pending-head-actions .btn-sm { height: 24px; font-size: 9.5px; padding: 0 7px; }


/* multi-product editor */
.product-editor { display: flex; flex-direction: column; gap: 3px; }
.product-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 17px; gap: 3px; align-items: center; }
.product-row .cell-input { min-width: 0; height: 27px; font-size: 10.5px; padding: 3px 5px; }
.product-remove { width: 17px; height: 24px; border: 0; background: transparent; color: var(--muted-2); font-size: 15px; line-height: 1; cursor: pointer; }
.product-remove:hover { color: var(--rust); }
.product-add { align-self: flex-start; margin-top: 2px; }
@media (max-width: 700px) {
  .product-row { grid-template-columns: 1fr 1fr 24px; }
  .product-row .cell-input { height: 34px; }
}


.pending-value-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }
.pending-expand { height: 18px; padding: 0 4px; border: 0; background: transparent; color: var(--sea-dark); font-size: 8.5px; cursor: pointer; }
.pending-expand:hover { text-decoration: underline; }
.pending-value.clamped:not(.expanded) { max-height: 60px !important; overflow: hidden !important; }
.pending-value.clamped.expanded { max-height: none !important; overflow: visible !important; }
.pending-product-item + .pending-product-item { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #edf0eb; }
.pending-product-item strong { display: block; font-size: 12px; }
.pending-product-item span { display: block; font-size: 9px; color: var(--muted-2); }


/* expected arrival column */
.expected-cell { display: flex; flex-direction: column; gap: 2px; min-width: 82px; }
.expected-cell .mono { font-size: 10px; color: var(--ink-2); font-family: var(--mono); }
.expected-badge { display: inline-block; font-size: 8.5px; line-height: 1.4; padding: 1px 4px; width: fit-content; border: 1px solid var(--line); }
.expected-badge.late { color: var(--rust); border-color: rgba(176, 74, 53, 0.4); background: var(--rust-soft); }
.expected-badge.today { color: #7a5b19; border-color: #ead9b7; background: #f7f1e4; }
@media (min-width: 901px) and (max-width: 1520px) {
  .follow-table th:nth-child(1), .follow-table td:nth-child(1) { width: 8%; }
  .follow-table th:nth-child(2), .follow-table td:nth-child(2) { width: 13%; }
  .follow-table th:nth-child(3), .follow-table td:nth-child(3) { width: 11%; }
  .follow-table th:nth-child(4), .follow-table td:nth-child(4) { width: 9%; }
  .follow-table th:nth-child(5), .follow-table td:nth-child(5) { width: 13%; }
  .follow-table th:nth-child(6), .follow-table td:nth-child(6) { width: 8%; }
  .follow-table th:nth-child(7), .follow-table td:nth-child(7) { width: 9%; }
  .follow-table th:nth-child(8), .follow-table td:nth-child(8) { width: 13%; }
  .follow-table th:nth-child(9), .follow-table td:nth-child(9) { width: 16%; }
}
@media (min-width: 1521px) {
  .follow-table .note-col { width: 150px; min-width: 140px; }
}


/* pending fields: compact but fully readable */
.pending-field-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.pending-field-head .cargo-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pending-copy { flex: 0 0 auto; height: 17px; padding: 0 4px; border: 1px solid var(--line); background: #fff; color: var(--muted-2); font-size: 8px; border-radius: 2px; cursor: pointer; }
.pending-copy:hover { border-color: var(--sea); color: var(--sea-dark); }
.pending-value { font-size: 11.5px; line-height: 1.5; font-weight: 500; color: var(--ink); white-space: normal; max-height: none !important; overflow: visible !important; }
.pending-value.mono { font-size: 11px; }
.pending-value.pre { font-size: 10.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.cargo-own-fields { grid-template-columns: 92px minmax(140px, 1fr) 72px 145px minmax(170px, 1.6fr) minmax(170px, 1.6fr) 72px 74px 112px 104px minmax(120px, 1fr); }
@media (max-width: 1280px) {
  .cargo-own-fields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .cargo-own-fields { grid-template-columns: 1fr; }
}


/* ---------- clarity / typography pass ---------- */
:root {
  --muted: #50686d;
  --muted-2: #72868a;
}
.privacy-watermark { opacity: 0.028; }
.privacy-watermark span { font-size: 10px; color: #0a1d24; }

.pending-card { border-color: #d5ddd7; }
.pending-card .cargo-row-head { background: #f4f7f2; }
.pending-forwarder-row .cargo-row-head { background: #eff5f4; }
.pending-card .cargo-label { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.pending-value { font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.55; }
.pending-value.mono { font-size: 12px; font-weight: 600; color: var(--ink); }
.pending-value.pre { font-size: 11.5px; font-weight: 400; line-height: 1.62; color: var(--ink-2); }
.pending-product strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.pending-product-item span { font-size: 9.5px; color: var(--muted); }
.pending-sub { font-size: 9.5px; color: var(--muted); }
.pending-created { font-size: 9.5px; color: var(--muted); }
.pending-copy { font-size: 9px; color: var(--muted); }
.pending-card .cargo-row-head strong { font-size: 12.5px; font-weight: 700; color: var(--ink); }

@media (min-width: 901px) {
  .follow-table th { font-size: 10px; color: var(--muted); }
  .follow-table td { font-size: 11.5px; }
  .follow-table .order-no { font-size: 12.5px; }
  .follow-table .prod-name { font-size: 12px; }
  .follow-table .prod-en { font-size: 9.5px; color: var(--muted); }
  .follow-table .prod-count { font-size: 10px; color: var(--muted); }
  .follow-table .tracking-no { font-size: 10px; }
  .follow-table .tracking-state { font-size: 9.5px; }
  .follow-table .channel-badge { font-size: 9.5px; }
  .follow-table .channel-cell small { font-size: 9.3px; color: var(--muted); }
  .follow-table .route-state-select { height: 22px; font-size: 10px; }
  .follow-table .route-status-select, .follow-table .route-issue-select { font-size: 10px; }
  .follow-table .route-input { font-size: 10.5px; }
  .follow-table .note-text { font-size: 10.5px; color: var(--ink-2); }
  .follow-table .arrival-input { font-size: 10px; }
  .follow-table .table-action { font-size: 10.5px; }
  .follow-table .expected-cell .mono { font-size: 10.5px; color: var(--ink-2); }
}
.dash-section-head h2 { font-size: 14px; }
.alert-main b { font-size: 11.5px; }
.alert-main small { font-size: 9.5px; }
.alert-reason { font-size: 10.5px; color: var(--ink-2); }


.table-action.danger { border-color: rgba(176, 74, 53, 0.3); color: var(--rust); }
.table-action.danger:hover { background: var(--rust-soft); border-color: var(--rust); }
.follow-table td.cell-actions-col, .archive-table td.cell-actions-col { white-space: nowrap; }
@media (max-width: 1520px) {
  .follow-table .table-action, .archive-table .table-action { padding-left: 5px; padding-right: 5px; font-size: 9.5px; gap: 3px; }
  .follow-table .table-action svg, .archive-table .table-action svg { width: 11px; height: 11px; }
}

