:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #657286;
  --line: #dfe4ea;
  --accent: #0f6b5f;
  --danger: #b42318;
  --warn: #a15c00;
  --ok: #157347;
  --shadow: 0 8px 24px rgba(24, 32, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
}

.sidebar {
  min-height: 100vh;
  padding: 20px 16px;
  background: #111820;
  color: #f6f7f9;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #9aa8b8;
  font-size: 13px;
}

.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: 6px;
  font-weight: 800;
}

nav {
  display: grid;
  gap: 6px;
}

nav button,
.auth button,
.google,
header button {
  border: 0;
  border-radius: 6px;
  min-height: 36px;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}

nav button {
  text-align: left;
  color: #cfd7df;
  background: transparent;
}

nav button.active,
nav button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
}

.auth {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.auth button,
.google {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  background: var(--accent);
}

.auth .secondary {
  background: rgba(255, 255, 255, 0.1);
}

main {
  min-width: 0;
  padding: 24px;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
}

input,
select {
  min-height: 38px;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #ffffff;
}

header button {
  color: #ffffff;
  background: var(--accent);
}

.status {
  min-height: 24px;
  margin-bottom: 12px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.content {
  display: grid;
  gap: 14px;
}

.flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.flow-actions button {
  border: 0;
  border-radius: 10px;
  min-height: 38px;
  padding: 9px 14px;
  color: #ffffff;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(18, 104, 214, 0.22);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.form-grid label {
  display: grid;
  gap: 5px;
}

.form-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-grid input,
.form-grid select {
  width: 100%;
}

.form-grid button {
  border: 0;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 12px;
  color: #ffffff;
  background: var(--accent);
  font: inherit;
  cursor: pointer;
}

pre {
  margin: 0;
  padding: 16px;
  max-height: 520px;
  overflow: auto;
  background: #0f1720;
  color: #d6e3ef;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel h2 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  /* 表格为 table-layout: fixed；客户名和文件名中的长不可断词
     若不允许断行，会溢出单元格并压住相邻列的文字。
     用 break-word 而非 anywhere：前者不参与 min-content 宽度计算，
     不会把徽标一类短标签压窄到逐字折行。 */
  overflow-wrap: break-word;
}

th {
  color: var(--muted);
  font-weight: 700;
  background: #fafbfc;
  white-space: nowrap;
}

td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
  background: #edf5f3;
  color: var(--accent);
}

.danger {
  color: var(--danger);
}

@media (max-width: 860px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  header {
    display: grid;
  }

  .actions,
  input {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

/* M1.5 blue-glass recovery layer */
:root {
  --bg: #eaf4ff;
  --panel: rgba(255, 255, 255, 0.78);
  --text: #10243f;
  --muted: #60728d;
  --line: rgba(69, 111, 161, 0.18);
  --accent: #1268d6;
  --accent-2: #2fb6ff;
  --danger: #bc2f2f;
  --warn: #a76600;
  --ok: #147a52;
  --shadow: 0 18px 48px rgba(36, 90, 150, 0.16);
}

body {
  background:
    radial-gradient(circle at 18% 10%, rgba(47, 182, 255, 0.25), transparent 28%),
    linear-gradient(135deg, #f7fbff 0%, #e8f4ff 42%, #dbeeff 100%);
}

body.login-mode {
  min-height: 100vh;
  grid-template-columns: 1fr;
  overflow-x: hidden;
  background: #e8f4ff;
}

body.login-mode .sidebar,
body.login-mode main > header,
body.login-mode .status,
body.login-mode .metrics {
  display: none;
}

body.login-mode main {
  min-height: 100vh;
  padding: 0;
  display: grid;
  place-items: center;
}

body.login-mode .content {
  width: min(360px, calc(100vw - 32px));
}

.login-shell {
  display: block;
  padding: 0;
}

.login-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 8px rgba(25, 74, 123, 0.1);
  backdrop-filter: blur(18px);
}

.login-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 2px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font-size: 23px;
  font-weight: 900;
}

.login-card h1 {
  margin: 0;
  color: #08243d;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

.login-card {
  display: grid;
  gap: 20px;
  padding: 32px 28px 28px;
  text-align: center;
}

.login-google {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  transition: background-color 180ms ease, transform 180ms ease;
}

.login-form {
  display: grid;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: #244b78;
  font-size: 12px;
  font-weight: 800;
}

.login-form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(18, 104, 214, 0.2);
  border-radius: 9px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: #08243d;
  font: inherit;
}

.login-form button,
.login-link-button {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.login-link-button {
  background: rgba(18, 104, 214, 0.1);
  color: #135a9d;
}

.secondary-login {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  background: rgba(18, 104, 214, 0.1);
  color: #135a9d;
}

.secondary-login:hover {
  color: #ffffff;
}

.login-google:hover {
  background: #0d5cbc;
}

.login-google:active {
  transform: translateY(1px);
}

.login-google:focus-visible {
  outline: 3px solid rgba(18, 104, 214, 0.28);
  outline-offset: 3px;
}

.login-google span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1268d6;
  font-weight: 900;
}

.login-dev {
  display: grid;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid rgba(69, 111, 161, 0.16);
  text-align: left;
}

.login-dev summary,
.login-card small,
.login-card .login-note {
  color: #72879c;
  font-size: 12px;
}

.login-dev summary {
  cursor: pointer;
  font-weight: 800;
}

.login-dev div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-dev button {
  border: 1px solid rgba(18, 104, 214, 0.14);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.72);
  color: #135a9d;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.sidebar {
  background: linear-gradient(180deg, rgba(13, 71, 137, 0.96), rgba(8, 37, 82, 0.98));
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 18px 0 50px rgba(24, 74, 130, 0.18);
}

.mark,
.auth button,
.google,
header button,
.flow-actions button,
.form-grid button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(18, 104, 214, 0.22);
}

main {
  padding: 28px;
}

header {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.metric,
.panel {
  border-color: rgba(63, 119, 182, 0.2);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
}

.metric {
  border-radius: 14px;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.dashboard-metrics,
.inventory-metrics,
.decision-metrics {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
}

.metric {
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(18, 104, 214, 0.12);
}

.metric.blue::after {
  background: rgba(18, 104, 214, 0.14);
}

.metric.green::after {
  background: rgba(20, 122, 82, 0.13);
}

.metric.amber::after {
  background: rgba(167, 102, 0, 0.14);
}

.metric.red::after {
  background: rgba(188, 47, 47, 0.13);
}

.dashboard-hero,
.inventory-hero,
.decision-hero,
.flow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid rgba(63, 119, 182, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(220, 239, 255, 0.68)),
    radial-gradient(circle at 12% 0%, rgba(47, 182, 255, 0.22), transparent 34%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.inventory-hero,
.decision-hero {
  grid-template-columns: 1fr;
}

.flow-hero {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
}

.dashboard-hero .eyebrow,
.inventory-hero .eyebrow,
.decision-hero .eyebrow,
.flow-hero .eyebrow,
.flow-result-head .eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: #0b5ec8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-hero h2,
.inventory-hero h2,
.decision-hero h2,
.flow-hero h2 {
  max-width: 780px;
  margin: 0;
  color: #0e2b54;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.dashboard-hero p,
.inventory-hero p,
.decision-hero p,
.flow-hero p {
  margin-top: 12px;
  color: #536a87;
  font-size: 14px;
}

.hero-stack {
  display: grid;
  place-content: center;
  min-height: 138px;
  border: 1px solid rgba(18, 104, 214, 0.16);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(18, 104, 214, 0.14), rgba(47, 182, 255, 0.08));
  text-align: center;
}

.hero-stack strong {
  color: #0b5ec8;
  font-size: 42px;
  line-height: 1;
}

.hero-stack span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-grid,
.inventory-grid,
.decision-grid,
.flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.inventory-grid.batch {
  grid-template-columns: minmax(0, 1fr);
}

.inventory-kind-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  align-self: start;
  width: min(100%, 480px);
  padding: 4px;
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px);
}

.inventory-kind-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  color: #49627f;
  background: transparent;
  box-shadow: none;
  font-weight: 800;
}

.inventory-kind-tabs button.active {
  color: #fff;
  background: #1976db;
  box-shadow: 0 8px 18px rgba(25, 118, 219, 0.18);
}

.inventory-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px);
}

.inventory-batch-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.inventory-batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}

.inventory-batch-head h2 {
  margin: 0;
  color: #10243f;
  font-size: 17px;
}

.inventory-batch-head p {
  margin-top: 3px;
  color: #607790;
  font-size: 12px;
}

.inventory-batch-head > span {
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(18, 104, 214, 0.09);
  color: #0b5ec8;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-batch-form {
  display: grid;
  grid-template-columns: minmax(0, 16fr) minmax(220px, 8fr);
  align-items: stretch;
  gap: 16px;
}

.inventory-batch-input {
  display: grid;
  gap: 7px;
  color: #536a87;
  font-size: 12px;
  font-weight: 800;
}

.inventory-batch-input textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid rgba(18, 104, 214, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  color: #173961;
  background: rgba(255, 255, 255, 0.92);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}

.inventory-batch-side {
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding-top: 23px;
}

.inventory-batch-rule {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(18, 104, 214, 0.13);
  border-radius: 9px;
  background: rgba(235, 246, 255, 0.66);
}

.inventory-batch-rule strong {
  color: #244b78;
  font-size: 12px;
}

.inventory-batch-rule span {
  color: #607790;
  font-size: 12px;
}

.inventory-batch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.inventory-batch-actions button {
  min-width: 110px;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  padding: 0 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px rgba(18, 104, 214, 0.18);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.inventory-batch-actions button.secondary {
  min-width: 82px;
  border: 1px solid rgba(18, 104, 214, 0.18);
  color: #0b5ec8;
  background: rgba(235, 246, 255, 0.9);
  box-shadow: none;
}

.batch-results {
  display: grid;
}

.batch-result-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.batch-result-summary > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(63, 119, 182, 0.14);
  border-radius: 9px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.7);
}

.batch-result-summary small {
  color: #607790;
  font-size: 11px;
  font-weight: 800;
}

.batch-result-summary strong {
  color: #10243f;
  font-size: 18px;
}

.batch-result-summary .ok { border-color: rgba(20, 122, 82, 0.18); }
.batch-result-summary .blue { border-color: rgba(18, 104, 214, 0.2); }
.batch-result-summary .warn { border-color: rgba(167, 102, 0, 0.22); }

.batch-result-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(220px, 1.7fr) repeat(3, minmax(72px, 0.55fr)) minmax(105px, 0.8fr);
  gap: 12px;
  align-items: center;
}

.batch-result-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: #607790;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.batch-result-row {
  min-height: 62px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(63, 119, 182, 0.12);
  color: #173961;
}

.batch-result-row:last-child {
  border-bottom: 0;
}

.batch-result-row.missing {
  background: rgba(255, 247, 232, 0.46);
}

.batch-result-row > div {
  min-width: 0;
}

.batch-sku-cell,
.batch-product-cell {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.batch-sku-cell strong,
.batch-product-cell strong {
  overflow-wrap: anywhere;
}

.batch-sku-cell small {
  color: #607790;
  font-size: 11px;
}

.batch-sku-cell small .link {
  font-size: 11px;
}

.batch-product-cell .badge {
  font-size: 10px;
}

.inventory-toolbar label {
  display: grid;
  gap: 6px;
  color: #536a87;
  font-size: 12px;
  font-weight: 800;
}

.inventory-toolbar select {
  min-width: 180px;
  min-height: 40px;
  border: 1px solid rgba(18, 104, 214, 0.2);
  border-radius: 8px;
  padding: 0 12px;
  color: #173961;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
}

.inventory-toolbar > span {
  color: #607790;
  font-size: 13px;
}

@media (max-width: 620px) {
  .inventory-kind-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .inventory-kind-tabs button {
    min-width: 0;
    padding-inline: 8px;
  }
}

.dashboard-main,
.inventory-main,
.decision-main,
.flow-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dashboard-rail,
.inventory-rail,
.decision-rail,
.flow-rail {
  display: grid;
  align-content: start;
  gap: 12px;
}

.flow-stage {
  display: grid;
  gap: 10px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(18, 104, 214, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 28px rgba(36, 90, 150, 0.1);
}

.flow-step span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(18, 104, 214, 0.12);
  color: #0b5ec8;
  font-size: 12px;
  font-weight: 900;
}

.flow-step strong {
  min-width: 0;
  color: #173961;
  font-size: 14px;
  line-height: 1.25;
}

.flow-copy {
  display: grid;
  gap: 7px;
  padding: 16px;
}

.flow-copy strong {
  color: #10243f;
  font-size: 17px;
}

.flow-copy span {
  color: #0b5ec8;
  font-size: 13px;
  font-weight: 800;
}

.flow-copy p {
  margin: 0;
  color: #5f718a;
  font-size: 13px;
  line-height: 1.45;
}

.flow-result-panel {
  overflow: hidden;
}

.flow-result {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
}

.flow-result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 0;
}

.flow-result-head h3 {
  margin: 0;
  color: #10243f;
  font-size: 18px;
}

.flow-result-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.flow-result-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px;
}

.flow-result .table-wrap {
  margin: 0 16px;
}

.flow-row-list {
  display: grid;
  gap: 10px;
  padding: 0 16px;
}

.flow-row-limit {
  padding: 10px 12px;
  border: 1px solid rgba(167, 102, 0, 0.16);
  border-radius: 10px;
  background: rgba(255, 248, 231, 0.72);
  color: #7b5a18;
  font-size: 12px;
  font-weight: 700;
}

.flow-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(63, 119, 182, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 12px 30px rgba(36, 90, 150, 0.1);
}

.flow-row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.flow-row-main span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.flow-row-main .link {
  justify-self: start;
  min-width: 0;
  padding: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.flow-row-main p {
  margin: 0;
  color: #5f718a;
  font-size: 12px;
  line-height: 1.35;
}

.flow-row-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.flow-row-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: rgba(235, 246, 255, 0.72);
}

.flow-row-stats span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.flow-row-stats strong {
  color: #10243f;
  font-size: 17px;
}

.flow-row-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.decision-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.decision-toolbar button {
  border: 1px solid rgba(18, 104, 214, 0.18);
  border-radius: 999px;
  min-height: 34px;
  padding: 7px 12px;
  color: #0b5ec8;
  background: rgba(235, 246, 255, 0.72);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.decision-toolbar button.active,
.decision-toolbar button:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px rgba(18, 104, 214, 0.18);
}

.evidence-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.evidence-row {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid rgba(63, 119, 182, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.evidence-row > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.evidence-row p {
  margin: 0;
  color: #526b89;
  font-size: 13px;
  line-height: 1.4;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.source-list span {
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(18, 104, 214, 0.09);
  color: #244b78;
  font-size: 12px;
  font-weight: 700;
}

.tasks-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.42fr) minmax(0, 0.58fr);
  gap: 16px;
  align-items: start;
}

.tasks-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(63, 119, 182, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(232, 247, 255, 0.66));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tasks-hero h2 {
  margin: 4px 0 0;
  color: #071d35;
  font-size: 32px;
}

.tasks-hero p {
  max-width: 760px;
  margin-top: 8px;
  color: #516a85;
  font-size: 14px;
}

.tasks-hero strong {
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(18, 104, 214, 0.1);
  color: #0b4b82;
  font-size: 13px;
  font-weight: 900;
}

.tasks-queue-panel,
.task-detail-card,
.task-detail-hero {
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tasks-queue-panel {
  overflow: hidden;
}

.tasks-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}

.tasks-panel-head.compact {
  padding: 0 0 12px;
}

.tasks-panel-head h2 {
  margin: 4px 0 0;
  color: #10243f;
  font-size: 20px;
}

.tasks-panel-head p {
  margin-top: 6px;
  color: #5a718b;
  font-size: 13px;
}

.tasks-panel-head > span {
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(18, 104, 214, 0.1);
  color: #0b4b82;
  font-size: 12px;
  font-weight: 900;
}

.task-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(132px, 0.7fr);
  gap: 10px;
  padding: 0 18px 14px;
}

.task-filter-form input,
.task-filter-form select {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(63, 119, 182, 0.16);
  border-radius: 11px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.74);
  color: #10243f;
  font: inherit;
}

.task-filter-form button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  background: rgba(235, 246, 255, 0.9);
  color: #0b4b82;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.task-filter-form button[type="submit"] {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 24px rgba(18, 104, 214, 0.2);
}

.workflow-home,
.workflow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(63, 119, 182, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.workflow-head-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workflow-home h2,
.workflow-head h2 {
  margin: 0;
  color: #0e2b54;
  font-size: 24px;
  line-height: 1.2;
}

.workflow-home p,
.workflow-head p {
  margin-top: 8px;
  color: #536a87;
  font-size: 13px;
}

.workflow-home button,
.workflow-head button,
.mini-actions button,
.source-links button,
.subnav button {
  border: 0;
  border-radius: 9px;
  min-height: 34px;
  padding: 8px 11px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.workflow-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.workflow-stepper button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(18, 104, 214, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #244b78;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.workflow-stepper button.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 28px rgba(18, 104, 214, 0.2);
}

.workflow-stepper span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(18, 104, 214, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.workflow-stepper button.active span {
  background: rgba(255, 255, 255, 0.2);
}

.ddt-stepper {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ddt-stepper button {
  min-width: 108px;
  min-height: 46px;
  flex: 1 0 108px;
  border-radius: 8px;
  padding: 7px 9px;
}

.ddt-stepper span {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.ddt-stepper strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.workflow-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.workflow-rail {
  position: sticky;
  top: 16px;
}

.ddt-workflow-main {
  width: 100%;
}

.ddt-check-strip {
  display: flex;
  gap: 13px;
  align-items: center;
  margin: 16px;
  padding: 15px;
  border: 1px solid rgba(20, 122, 82, 0.18);
  border-radius: 10px;
  background: rgba(225, 248, 240, 0.7);
}

.ddt-check-strip.warn {
  border-color: rgba(167, 102, 0, 0.22);
  background: rgba(255, 246, 228, 0.78);
}

.ddt-check-strip > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(20, 122, 82, 0.12);
  color: #147a52;
  font-weight: 900;
}

.ddt-check-strip.warn > span {
  background: rgba(167, 102, 0, 0.12);
  color: #a76600;
}

.ddt-check-strip strong,
.ddt-check-strip p {
  margin: 0;
}

.ddt-check-strip strong {
  color: #17334f;
  font-size: 15px;
}

.ddt-check-strip p {
  margin-top: 4px;
  color: #60728d;
  font-size: 12px;
}

.step-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.ddt-feedback-board {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.ddt-feedback-summary,
.ddt-issue-group,
.ddt-feedback-clear {
  border: 1px solid rgba(63, 119, 182, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 28px rgba(36, 90, 150, 0.08);
}

.ddt-feedback-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
}

.ddt-feedback-board.ok .ddt-feedback-summary,
.ddt-feedback-clear {
  border-color: rgba(20, 122, 82, 0.2);
  background: rgba(225, 248, 240, 0.7);
}

.ddt-feedback-board.warn .ddt-feedback-summary {
  border-color: rgba(167, 102, 0, 0.2);
  background: rgba(255, 247, 232, 0.72);
}

.ddt-feedback-board.blocked .ddt-feedback-summary {
  border-color: rgba(188, 47, 47, 0.2);
  background: rgba(255, 247, 232, 0.72);
}

.ddt-feedback-summary span,
.ddt-issue-group-head span {
  color: #2f6395;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ddt-feedback-summary h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.25;
}

.ddt-feedback-summary p,
.ddt-feedback-clear p,
.ddt-issue-group-head p {
  margin: 4px 0 0;
  color: #345a7e;
  line-height: 1.4;
}

.ddt-feedback-stats {
  display: grid;
  grid-template-columns: repeat(3, 86px);
  gap: 8px;
}

.ddt-feedback-stats span,
.ddt-issue-metrics span {
  display: grid;
  gap: 3px;
  min-height: 56px;
  align-content: center;
  justify-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #183452;
}

.ddt-feedback-stats small,
.ddt-issue-metrics small {
  color: #5e7694;
  font-size: 11px;
}

.ddt-feedback-stats strong,
.ddt-issue-metrics strong {
  font-size: 18px;
  line-height: 1;
}

.ddt-issue-group {
  padding: 12px;
}

.ddt-issue-group.danger {
  border-color: rgba(188, 47, 47, 0.2);
  background: rgba(255, 247, 232, 0.7);
}

.ddt-issue-group.warn {
  border-color: rgba(167, 102, 0, 0.2);
  background: rgba(255, 247, 232, 0.7);
}

.ddt-issue-group.note {
  border-color: rgba(18, 104, 214, 0.16);
  background: rgba(235, 246, 255, 0.72);
}

.ddt-issue-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ddt-issue-group-head strong {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #183452;
}

.ddt-issue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ddt-issue-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  border: 1px solid rgba(63, 119, 182, 0.14);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.ddt-issue-card.danger {
  border-color: rgba(188, 47, 47, 0.18);
}

.ddt-issue-card.warn {
  border-color: rgba(167, 102, 0, 0.18);
}

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

.ddt-issue-head span,
.ddt-issue-tags span {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(18, 104, 214, 0.09);
  color: #0b5ec8;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ddt-issue-card.danger .ddt-issue-head span {
  background: rgba(188, 47, 47, 0.1);
  color: var(--danger);
}

.ddt-issue-card.warn .ddt-issue-head span {
  background: rgba(167, 102, 0, 0.12);
  color: var(--warn);
}

.ddt-issue-head strong {
  overflow: hidden;
  color: #132c47;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ddt-issue-head em {
  color: #6a7e97;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.ddt-issue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ddt-issue-tags span {
  background: rgba(255, 255, 255, 0.75);
  color: #345a7e;
  font-weight: 800;
}

.ddt-issue-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.ddt-issue-detail {
  color: #526b89;
  font-size: 12px;
}

.ddt-issue-detail summary {
  cursor: pointer;
  font-weight: 800;
}

.ddt-issue-detail p {
  margin-top: 6px;
  color: #526b89;
}

.ddt-inline-action {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(63, 119, 182, 0.12);
}

.ddt-inline-action label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.ddt-inline-action label.wide {
  grid-column: 1 / -1;
}

.ddt-inline-action label span {
  color: #536a87;
  font-size: 12px;
  font-weight: 800;
}

.ddt-inline-action input,
.ddt-inline-action select {
  width: 100%;
  min-width: 0;
}

.ddt-inline-action button {
  min-height: 40px;
}

.ddt-inline-help,
.ddt-inline-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.ddt-inline-help.wide,
.ddt-inline-error.wide {
  grid-column: 1 / -1;
}

.ddt-inline-help {
  color: #536a87;
}

.ddt-inline-error {
  padding: 8px 10px;
  border: 1px solid rgba(190, 48, 48, 0.22);
  border-radius: 6px;
  background: rgba(255, 238, 238, 0.82);
  color: #a92727;
  font-weight: 700;
}

.ddt-inline-action input[aria-invalid="true"] {
  border-color: #c53b3b;
  box-shadow: 0 0 0 2px rgba(197, 59, 59, 0.1);
}

.ddt-resolution-confirmed {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid rgba(20, 122, 82, 0.18);
  border-radius: 8px;
  background: rgba(225, 248, 240, 0.72);
}

.ddt-resolution-confirmed > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(20, 122, 82, 0.12);
  color: #147a52;
  font-size: 12px;
  font-weight: 900;
}

.ddt-resolution-confirmed strong {
  color: #17334f;
}

.ddt-resolution-confirmed p {
  margin: 3px 0 0;
  color: #42647f;
  font-size: 12px;
  line-height: 1.45;
}

.ddt-resolution-path {
  display: grid;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 14px;
  border: 1px solid rgba(63, 119, 182, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.ddt-resolution-path-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.ddt-resolution-path-head p {
  margin: 3px 0 0;
  color: #526b89;
  font-size: 13px;
}

.ddt-resolution-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ddt-resolution-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(63, 119, 182, 0.14);
  border-radius: 8px;
  background: rgba(246, 250, 255, 0.82);
}

.ddt-resolution-step > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(63, 119, 182, 0.1);
  color: #2f6395;
  font-size: 11px;
  font-weight: 900;
}

.ddt-resolution-step strong,
.ddt-resolution-step small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ddt-resolution-step strong {
  color: #17334f;
  font-size: 12px;
}

.ddt-resolution-step small {
  color: #627994;
  font-size: 11px;
}

.ddt-resolution-step.done {
  border-color: rgba(20, 122, 82, 0.18);
  background: rgba(225, 248, 240, 0.72);
}

.ddt-resolution-step.done > span {
  background: rgba(20, 122, 82, 0.12);
  color: #147a52;
}

.ddt-resolution-step.active {
  border-color: rgba(45, 139, 232, 0.34);
  background: rgba(235, 246, 255, 0.88);
}

.ddt-resolution-step.locked {
  opacity: 0.58;
}

.ddt-feedback-clear {
  padding: 14px;
}

.mini-actions,
.source-links,
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-links {
  padding: 12px;
  border: 1px solid rgba(18, 104, 214, 0.16);
  border-radius: 12px;
  background: rgba(235, 246, 255, 0.72);
}

.source-links.inline {
  margin: 14px 16px;
}

.source-links span {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.subnav {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.subnav button {
  color: #0b5ec8;
  background: rgba(235, 246, 255, 0.9);
  border: 1px solid rgba(18, 104, 214, 0.18);
}

.subnav button.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.ddt-detail-metrics {
  display: none;
}

.ddt-detail-shell {
  display: grid;
  gap: 16px;
}

.ddt-detail-header {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 56px;
  gap: 20px;
  align-items: start;
  padding: 22px;
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 16px 40px rgba(36, 90, 150, 0.12);
  backdrop-filter: blur(18px);
}

.ddt-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #1c527f;
  font: inherit;
  cursor: pointer;
}

.ddt-detail-back span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(63, 119, 182, 0.22);
  border-radius: 50%;
  background: rgba(235, 246, 255, 0.86);
  font-size: 19px;
}

.ddt-detail-back strong {
  font-size: 13px;
}

.ddt-detail-identity {
  min-width: 0;
}

.ddt-detail-identity > div:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ddt-detail-identity h2,
.ddt-detail-identity p {
  margin: 0;
}

.ddt-detail-identity h2 {
  margin-top: 10px;
  color: #10243f;
  font-size: 30px;
  line-height: 1.1;
}

.ddt-detail-identity p {
  margin-top: 5px;
  color: #536a87;
  font-size: 15px;
}

.ddt-detail-meta {
  display: flex;
  gap: 24px;
  margin: 18px 0 0;
}

.ddt-detail-meta div {
  display: grid;
  grid-template-columns: auto auto;
  gap: 7px;
  align-items: baseline;
}

.ddt-detail-meta dt,
.ddt-detail-meta dd {
  margin: 0;
}

.ddt-detail-meta dt {
  color: #71839a;
  font-size: 12px;
}

.ddt-detail-meta dd {
  color: #17334f;
  font-size: 13px;
  font-weight: 800;
}

.ddt-detail-tools {
  display: flex;
  justify-content: flex-end;
}

.ddt-more-menu {
  position: relative;
}

.ddt-more-menu summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(63, 119, 182, 0.22);
  border-radius: 50%;
  background: rgba(235, 246, 255, 0.86);
  color: #1c527f;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.ddt-more-menu summary::-webkit-details-marker {
  display: none;
}

.ddt-more-menu > div {
  position: absolute;
  z-index: 20;
  top: 50px;
  right: 0;
  width: 160px;
  padding: 7px;
  border: 1px solid rgba(63, 119, 182, 0.18);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(36, 90, 150, 0.2);
}

.ddt-more-menu button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: rgba(188, 47, 47, 0.08);
  color: var(--danger);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ddt-detail-workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ddt-detail-nav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(63, 119, 182, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 30px rgba(36, 90, 150, 0.1);
  backdrop-filter: blur(16px);
}

.ddt-detail-nav button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: #536a87;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ddt-detail-nav button:hover {
  background: rgba(235, 246, 255, 0.78);
}

.ddt-detail-nav button.active {
  background: #e3f1ff;
  color: #0b5ec8;
  box-shadow: inset 3px 0 #1882e5;
}

.ddt-detail-nav button > span,
.ddt-detail-nav button > small {
  color: #7a8da4;
  font-size: 11px;
  font-weight: 800;
}

.ddt-detail-nav button > strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ddt-detail-nav button > small {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: rgba(63, 119, 182, 0.09);
}

.ddt-detail-surface {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(63, 119, 182, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 40px rgba(36, 90, 150, 0.12);
  backdrop-filter: blur(18px);
}

.ddt-detail-surface > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(63, 119, 182, 0.16);
}

.ddt-detail-surface > header h2,
.ddt-detail-surface > header p {
  margin: 0;
}

.ddt-detail-surface > header h2 {
  color: #10243f;
  font-size: 18px;
}

.ddt-detail-surface > header p {
  margin-top: 4px;
  color: #71839a;
  font-size: 12px;
}

.ddt-detail-surface-body {
  min-width: 0;
}

.ddt-detail-surface-body > .panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ddt-detail-surface-body > .panel > .panel-head {
  display: none;
}

.ddt-detail-state {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 120px;
  margin: 18px;
  padding: 20px;
  border: 1px solid rgba(20, 122, 82, 0.18);
  border-radius: 10px;
  background: rgba(225, 248, 240, 0.7);
}

.ddt-detail-state > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(20, 122, 82, 0.12);
  color: #147a52;
  font-size: 20px;
  font-weight: 900;
}

.ddt-detail-state strong {
  color: #17334f;
  font-size: 17px;
}

.ddt-detail-state p {
  margin: 5px 0 0;
  color: #5f718a;
  font-size: 13px;
}

.ddt-detail-page-action {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 16px;
}

.ddt-detail-page-action button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.compact-head {
  padding: 14px 16px;
}

.ops-filter-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.ops-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ops-field > span:first-child {
  color: #536a87;
  font-size: 12px;
  font-weight: 800;
}

.ops-field input,
.ops-field select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 9px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.86);
  color: #10243f;
  font: inherit;
}

.ops-control-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.ops-control-pair.date-pair {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.ops-control-pair i {
  color: #71869d;
  font-size: 12px;
  font-style: normal;
}

.ops-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.ops-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px rgba(18, 104, 214, 0.18);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ops-actions button.secondary {
  border: 1px solid rgba(18, 104, 214, 0.18);
  color: #0b5ec8;
  background: rgba(235, 246, 255, 0.9);
  box-shadow: none;
}

.ops-span-4 { grid-column: span 4; }
.ops-span-6 { grid-column: span 6; }

.inbound-upload-form .secondary {
  color: #0b5ec8;
  background: rgba(235, 246, 255, 0.9);
  border: 1px solid rgba(18, 104, 214, 0.18);
}

.ddt-upload-workbench {
  display: grid;
  grid-template-columns: minmax(0, 16fr) minmax(240px, 8fr);
  gap: 16px;
  padding: 18px;
}

.ddt-upload-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ddt-file-field {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px dashed rgba(18, 104, 214, 0.35);
  border-radius: 12px;
  padding: 18px;
  background: rgba(235, 246, 255, 0.5);
}

.ddt-file-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ddt-file-heading > b {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(18, 104, 214, 0.12);
  color: #0b5ec8;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.ddt-file-heading > span {
  display: grid;
  gap: 3px;
}

.ddt-file-heading strong {
  color: #10243f;
  font-size: 15px;
}

.ddt-file-heading small {
  color: #607790;
  font-size: 12px;
}

.ddt-file-field input[type="file"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 9px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.9);
  color: #536a87;
  font: inherit;
  font-size: 12px;
}

.ddt-file-field input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: rgba(18, 104, 214, 0.1);
  color: #0b5ec8;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ddt-upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ddt-upload-actions > span {
  color: #607790;
  font-size: 12px;
}

.ddt-upload-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  padding: 0 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px rgba(18, 104, 214, 0.2);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ddt-upload-checks {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid rgba(63, 119, 182, 0.16);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.ddt-upload-checks > strong {
  color: #244b78;
  font-size: 12px;
  text-transform: uppercase;
}

.ddt-upload-checks ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ddt-upload-checks li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 36px;
  color: #345a7e;
  font-size: 12px;
}

.ddt-upload-checks li b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(20, 122, 82, 0.1);
  color: #147a52;
  font-size: 10px;
}

.record-title {
  display: block;
  margin-bottom: 4px;
  font-weight: 900;
}

.table-wrap td small {
  display: block;
  margin-top: 4px;
  color: #607790;
  font-size: 11px;
  line-height: 1.3;
}

.inbound-upload-form {
  display: grid;
  gap: 14px;
  padding: 14px 16px;
}

.inbound-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inbound-upload-grid.nested {
  margin-top: 12px;
}

.inbound-upload-grid label {
  display: grid;
  gap: 7px;
  color: #506984;
  font-size: 12px;
  font-weight: 800;
}

.inbound-upload-grid .span-2 {
  grid-column: 1 / -1;
}

.inbound-upload-grid input,
.inbound-upload-grid select {
  width: 100%;
  min-height: 43px;
  border: 1px solid rgba(18, 104, 214, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  color: #0e2b54;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.advanced-fields {
  border: 1px dashed rgba(18, 104, 214, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(235, 246, 255, 0.38);
}

.advanced-fields summary {
  color: #0b4b82;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.history-table tbody tr[data-go] {
  cursor: pointer;
}

.history-table table {
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}

.history-table th,
.history-table td {
  padding: 8px;
}

.history-table .mini-actions {
  flex-direction: column;
  align-items: flex-start;
}

.history-table tbody tr[data-go]:hover {
  background: rgba(235, 246, 255, 0.72);
}

.table-sort {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tasks-detail-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.task-queue {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 390px);
  min-height: 440px;
  overflow: auto;
  padding: 0 18px 18px;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 110px;
  padding: 14px;
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  text-align: left;
  box-shadow: 0 10px 26px rgba(36, 90, 150, 0.1);
  cursor: pointer;
}

.task-card::after {
  content: "›";
  position: absolute;
  right: 14px;
  top: 50%;
  color: #0c4e82;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-50%);
}

.task-card.active,
.task-card:hover {
  border-color: rgba(18, 104, 214, 0.42);
  background: rgba(235, 246, 255, 0.86);
}

.task-card.red .task-priority {
  background: rgba(188, 47, 47, 0.12);
  color: #bc2f2f;
}

.task-card.amber .task-priority {
  background: rgba(208, 138, 25, 0.14);
  color: #a76600;
}

.task-card.blue .task-priority {
  background: rgba(18, 104, 214, 0.12);
  color: #1268d6;
}

.task-priority {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 1000;
}

.task-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-right: 22px;
}

.task-card strong {
  min-width: 0;
  color: #10243f;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.task-card small {
  color: #526b89;
  font-size: 13px;
  line-height: 1.3;
}

.task-card em {
  color: #526b89;
  font-size: 12px;
  font-style: normal;
}

.task-card-foot {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-right: 20px;
}

.task-card-foot b {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(20, 122, 82, 0.12);
  color: #147a52;
  font-size: 12px;
  font-weight: 900;
}

.task-card-foot i {
  color: #0b4b82;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.task-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.task-detail-hero h2 {
  margin: 4px 0 0;
  color: #071d35;
  font-size: 28px;
}

.task-detail-hero p {
  margin-top: 8px;
  color: #5a718b;
  font-size: 15px;
}

.task-detail-hero button {
  align-self: flex-start;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(235, 246, 255, 0.9);
  color: #0b4b82;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.task-detail-hero.red {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 242, 242, 0.66));
}

.task-detail-hero.amber {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 248, 235, 0.72));
}

.task-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.task-chip-row span {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(18, 104, 214, 0.1);
  color: #0b4b82;
  font-size: 12px;
  font-weight: 900;
}

.task-detail-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.task-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.task-info-grid article {
  min-height: 74px;
  display: grid;
  gap: 7px;
  align-content: center;
  border: 1px solid rgba(63, 119, 182, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.task-info-grid span,
.task-instructions span {
  color: #5a718b;
  font-size: 12px;
}

.task-info-grid strong {
  color: #10243f;
  font-size: 20px;
}

.task-instructions {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(63, 119, 182, 0.12);
  padding-top: 14px;
}

.task-instructions div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.task-instructions strong {
  color: #142a43;
  font-size: 15px;
  font-weight: 700;
}

.task-action-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(63, 119, 182, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.56);
}

.task-completed-notice {
  margin: 0;
  padding: 18px;
  font-weight: 800;
}

.task-action-form.compact {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) auto;
}

.task-action-form label {
  display: grid;
  gap: 6px;
  color: #5a718b;
  font-size: 12px;
  font-weight: 800;
}

.task-action-form input,
.task-action-form select {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(63, 119, 182, 0.14);
  border-radius: 11px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.76);
  color: #10243f;
  font: inherit;
}

.task-action-form button {
  align-self: end;
  border: 0;
  border-radius: 11px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(18, 104, 214, 0.2);
}

.task-check {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.task-check input {
  width: auto;
  min-height: auto;
}

.task-evidence-list {
  display: grid;
  gap: 9px;
}

.task-evidence-list article {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(63, 119, 182, 0.12);
  border-radius: 11px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.56);
}

.task-evidence-list span,
.task-evidence-list small,
.task-evidence-list time {
  color: #5a718b;
  font-size: 12px;
}

.task-evidence-list strong {
  color: #10243f;
  font-size: 13px;
}

.task-empty-state {
  margin: 0 18px 18px;
  padding: 18px;
  border: 1px dashed rgba(18, 104, 214, 0.22);
  border-radius: 13px;
  background: rgba(235, 246, 255, 0.58);
  color: #536a87;
  font-size: 13px;
}

.task-empty-state.large {
  margin: 0;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.confirm-line,
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 16px;
  color: #244b78;
  font-size: 13px;
  font-weight: 800;
}

.confirm-line input,
.check input {
  width: auto;
  min-height: auto;
}

.flow-result-empty {
  margin: 14px 16px;
  padding: 18px;
  border: 1px dashed rgba(18, 104, 214, 0.24);
  border-radius: 12px;
  background: rgba(235, 246, 255, 0.58);
  color: #536a87;
  font-size: 13px;
}

.rail-title {
  color: #244b78;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.focus-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(63, 119, 182, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 32px rgba(36, 90, 150, 0.12);
  backdrop-filter: blur(16px);
}

.focus-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.focus-card.red::before {
  background: var(--danger);
}

.focus-card.amber::before {
  background: #d08a19;
}

.focus-card.green::before {
  background: var(--ok);
}

.focus-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.focus-card strong {
  min-width: 0;
  color: #10243f;
  font-size: 26px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.focus-card p {
  margin: 0;
  color: #5f718a;
  font-size: 13px;
  line-height: 1.35;
}

.panel {
  border-radius: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel h2 {
  padding: 0;
  border: 0;
  font-size: 16px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.empty,
.notice {
  margin: 14px 16px;
  padding: 12px 14px;
  border: 1px solid rgba(18, 104, 214, 0.16);
  border-radius: 10px;
  background: rgba(235, 246, 255, 0.78);
  color: var(--muted);
}

.notice.danger {
  border-color: rgba(188, 47, 47, 0.24);
  background: rgba(255, 237, 237, 0.78);
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(18, 104, 214, 0.1);
  color: #0b5ec8;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: rgba(20, 122, 82, 0.12);
  color: var(--ok);
}

.badge.warn {
  background: rgba(167, 102, 0, 0.13);
  color: var(--warn);
}

.link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.kv-grid,
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.kv {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.kv span,
.evidence span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kv strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.evidence {
  margin: 14px 16px;
  border: 1px solid rgba(20, 122, 82, 0.16);
  border-radius: 12px;
  background: rgba(245, 253, 249, 0.76);
}

.evidence h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(20, 122, 82, 0.14);
  font-size: 15px;
}

.evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.drawer-root:empty {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(5, 22, 47, 0.28);
}

.drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 21;
  width: min(980px, calc(100vw - 36px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  background: rgba(247, 251, 255, 0.92);
  box-shadow: 0 24px 70px rgba(20, 62, 116, 0.34);
  backdrop-filter: blur(20px);
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 251, 255, 0.9);
}

.drawer-head h2 {
  margin: 0;
}

.drawer-head button {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
}

.drawer-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.sku-detail-hero {
  display: grid;
  gap: 14px;
  min-height: 220px;
  margin: -14px -14px 0;
  padding: 26px 30px 24px;
  border-bottom: 1px solid rgba(139, 188, 225, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(224, 244, 255, 0.66)),
    radial-gradient(circle at 82% 22%, rgba(67, 161, 220, 0.18), transparent 34%);
}

.sku-detail-hero .eyebrow {
  color: #2d6b91;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sku-detail-hero h2 {
  margin: 0;
  color: #0b253b;
  font-size: clamp(40px, 6vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
}

.sku-detail-hero p {
  margin: 0;
  color: #60768d;
  font-size: 22px;
  line-height: 1.25;
}

.sku-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sku-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.6);
  color: #24506d;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(20, 62, 116, 0.08);
}

.sku-pill.ok {
  background: rgba(207, 244, 231, 0.86);
  color: #0d7c5b;
}

.sku-pill.warn {
  background: rgba(255, 237, 204, 0.86);
  color: #9d6100;
}

.sku-pill.danger {
  background: rgba(255, 222, 222, 0.86);
  color: #b42318;
}

.sku-pill.blue {
  background: rgba(222, 242, 255, 0.86);
  color: #075a8f;
}

.sku-pill.muted {
  background: rgba(232, 238, 244, 0.86);
  color: #60768d;
}

.sku-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sku-hero-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.sku-hero-category {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.55);
  color: #4a5a6d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* 可折叠区块（Claude Design 1a）：折叠时只留一行标题+摘要。 */
.sku-collapsible {
  border: 1px solid rgba(175, 211, 233, 0.62);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 16px 36px rgba(20, 62, 116, 0.08);
  overflow: hidden;
}

.sku-collapsible > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  list-style: none;
  cursor: pointer;
  color: #10243f;
  font-weight: 700;
}

.sku-collapsible > summary::-webkit-details-marker {
  display: none;
}

.sku-collapsible-title {
  font-size: 15px;
}

.sku-collapsible-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #667b91;
  font-size: 13px;
  font-weight: 600;
}

.sku-collapsible-meta .chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #98a2b3;
  border-bottom: 2px solid #98a2b3;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.sku-collapsible[open] .chevron {
  transform: rotate(-135deg);
}

.sku-collapsible-body {
  padding: 0 20px 20px;
  border-top: 1px solid rgba(175, 211, 233, 0.4);
  padding-top: 16px;
}

/* 物理总量构成条 */
.sku-composition {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  margin-top: 4px;
  border-top: 1px solid rgba(175, 211, 233, 0.4);
}

.sku-composition-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: #667b91;
  font-size: 12px;
  font-weight: 700;
}

.sku-composition-total {
  font-variant-numeric: tabular-nums;
}

.sku-composition-bar {
  display: flex;
  height: 12px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(175, 211, 233, 0.3);
}

.sku-composition-bar .fill.green {
  background: #16815d;
}

.sku-composition-bar .fill.amber {
  background: #e0a13c;
}

.sku-composition-legend {
  display: flex;
  gap: 20px;
  color: #667b91;
  font-size: 12px;
}

.sku-composition-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
}

.sku-composition-legend .dot.green {
  background: #16815d;
}

.sku-composition-legend .dot.amber {
  background: #e0a13c;
}

.similar-items-head.compact {
  align-items: baseline;
}

.sku-detail-content {
  display: grid;
  gap: 14px;
}

.sku-detail-grid {
  display: grid;
  gap: 14px;
}

.sku-detail-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sku-detail-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(175, 211, 233, 0.62);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 16px 36px rgba(20, 62, 116, 0.08);
}

.sku-detail-card.prominent {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(238, 249, 255, 0.74)),
    rgba(255, 255, 255, 0.6);
}

.sku-detail-card.sea-panel {
  background: linear-gradient(135deg, rgba(226, 245, 255, 0.78), rgba(255, 255, 255, 0.66));
}

.sku-detail-card.weight-panel {
  background: linear-gradient(135deg, rgba(238, 248, 242, 0.8), rgba(255, 255, 255, 0.66));
}

.sku-detail-card.management-panel {
  background: linear-gradient(135deg, rgba(255, 247, 233, 0.82), rgba(255, 255, 255, 0.68));
}

.sku-detail-card h3 {
  margin: 0 0 14px;
  color: #10243f;
  font-size: 18px;
  line-height: 1.2;
}

.sku-detail-card p {
  margin: 0 0 14px;
  color: #60768d;
  line-height: 1.55;
}

.sku-info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.sku-info-list div {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: baseline;
}

.sku-info-list dt {
  color: #6a7e93;
  font-size: 14px;
}

.sku-info-list dd {
  min-width: 0;
  margin: 0;
  color: #0d2237;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sku-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sku-stat {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(187, 213, 231, 0.62);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.sku-stat span {
  display: block;
  color: #667b91;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sku-stat strong {
  display: block;
  margin-top: 5px;
  color: #0d2237;
  font-size: 24px;
  line-height: 1;
}

.sku-stat small {
  display: block;
  margin-top: 6px;
  color: #6b7f95;
  font-size: 12px;
}

.sku-stat.green {
  border-color: rgba(20, 122, 82, 0.18);
  background: rgba(238, 252, 246, 0.74);
}

.sku-stat.blue {
  border-color: rgba(18, 104, 214, 0.16);
  background: rgba(235, 246, 255, 0.74);
}

.sku-stat.amber {
  border-color: rgba(167, 102, 0, 0.18);
  background: rgba(255, 247, 232, 0.76);
}

.sku-source-note {
  margin-top: 12px;
  color: #71869d;
  font-size: 12px;
}

.compact {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
}

@media (max-width: 860px) {
  main {
    padding: 16px;
  }

  .sidebar {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 12px 14px;
    gap: 10px;
    box-shadow: 0 12px 30px rgba(24, 74, 130, 0.16);
  }

  .brand {
    min-width: 0;
    padding-right: 92px;
  }

  .brand .mark {
    width: 32px;
    height: 32px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand span {
    font-size: 11px;
  }

  .sidebar nav {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  body {
    overflow-x: hidden;
  }

  main {
    width: 100%;
    max-width: 100vw;
  }

  .sidebar nav button {
    min-height: 34px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .sidebar .auth {
    position: absolute;
    top: 12px;
    right: 14px;
    margin-top: 0;
    display: block;
  }

  .sidebar .auth .google {
    display: none;
  }

  .sidebar .auth button {
    min-height: 34px;
    padding: 6px 10px;
    box-shadow: none;
  }

  .dashboard-metrics,
  .decision-metrics,
  .dashboard-hero,
  .inventory-hero,
  .decision-hero,
  .flow-hero,
  .dashboard-grid,
  .inventory-grid,
  .decision-grid,
  .flow-grid,
  .tasks-grid,
  .workflow-home,
  .workflow-head,
  .workflow-layout,
  .step-summary-grid,
  .flow-result-metrics {
    grid-template-columns: 1fr;
  }

  .ops-filter-grid {
    grid-template-columns: 1fr;
  }

  .ops-filter-grid > * {
    grid-column: auto;
  }

  .inventory-metrics,
  .flow-metrics,
  .workflow-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-batch-form {
    grid-template-columns: 1fr;
  }

  .ddt-upload-workbench {
    grid-template-columns: 1fr;
  }

  .inventory-batch-actions {
    min-width: 0;
  }

  .inventory-batch-side {
    padding-top: 0;
  }

  .inventory-batch-actions {
    justify-content: stretch;
  }

  .inventory-batch-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .batch-result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-result-head {
    display: none;
  }

  .batch-result-body {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .batch-result-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    border: 1px solid rgba(63, 119, 182, 0.15);
    border-radius: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.66);
  }

  .batch-result-row > div::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #71869d;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .batch-sku-cell,
  .batch-product-cell {
    grid-column: 1 / -1;
  }

  .kv-grid,
  .evidence-grid,
  .flow-row-card,
  .compact,
  .sku-detail-grid.two,
  .sku-stat-grid,
  .sku-info-list div,
  .sku-edit-form-grid,
  .sku-lot-edit-row {
    grid-template-columns: 1fr;
  }

  .sku-detail-hero {
    min-height: 180px;
    padding: 22px;
  }

  .sku-detail-hero h2 {
    font-size: 38px;
  }

  .sku-collapsible > summary {
    padding: 14px 16px;
  }

  .sku-collapsible-body {
    padding: 0 16px 16px;
  }

  body.login-mode .content {
    width: min(360px, calc(100vw - 32px));
  }

  .login-shell {
    width: 100%;
    padding: 0;
  }

  .login-card {
    padding: 28px 22px 24px;
  }
}

@media (max-width: 520px) {
  .ops-control-pair,
  .ops-control-pair.date-pair,
  .ops-actions {
    grid-template-columns: 1fr;
  }

  .ops-control-pair.date-pair i {
    display: none;
  }

  .inventory-batch-head {
    align-items: flex-start;
  }

  .ddt-upload-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ddt-upload-actions button {
    width: 100%;
  }

  .batch-result-row {
    grid-template-columns: 1fr;
  }

  .batch-result-row > div,
  .batch-sku-cell,
  .batch-product-cell {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-google {
    transition: none;
  }
}

@media (max-width: 1180px) and (min-width: 861px) {
  body {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  main {
    padding: 24px;
  }

  .dashboard-metrics,
  .inventory-metrics,
  .decision-metrics,
  .flow-metrics,
  .flow-result-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero,
  .inventory-hero,
  .decision-hero,
  .flow-hero,
  .dashboard-grid,
  .inventory-grid,
  .decision-grid,
  .flow-grid,
  .tasks-grid {
    grid-template-columns: 1fr;
  }

  .workflow-layout {
    grid-template-columns: 1fr;
  }

  .workflow-stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .step-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-filter-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .ops-filter-grid .ops-span-4,
  .ops-filter-grid .ops-span-6 {
    grid-column: span 6;
  }

  .tasks-hero,
  .task-detail-hero {
    flex-direction: column;
  }

  .task-filter-form,
  .task-info-grid,
  .task-action-form,
  .task-action-form.compact,
  .task-instructions div,
  .task-evidence-list article {
    grid-template-columns: 1fr;
  }

  .task-queue {
    max-height: none;
    min-height: 0;
  }

  .workflow-rail {
    position: static;
  }

  .dashboard-rail,
  .inventory-rail,
  .decision-rail,
  .flow-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail-title {
    grid-column: 1 / -1;
  }
}
.related-inventory-row {
  background: rgba(231, 244, 255, 0.76);
  border-left: 3px solid #2d8be8;
}

.related-inventory-row .batch-sku-cell small {
  color: #2a699f;
}

.similar-items-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.similar-items-head h3,
.similar-items-head p {
  margin: 0;
}

.similar-catalog-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.similar-catalog-block h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.similar-catalog-block > p,
.form-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-hint.wide {
  grid-column: 1 / -1;
}

.similar-items-head p {
  margin-top: 5px;
  color: var(--muted);
}

.similar-family-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.similar-family-summary span {
  padding: 8px 10px;
  border: 1px solid rgba(45, 139, 232, 0.2);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.similar-family-summary strong {
  margin-left: 6px;
  color: var(--text);
}

.account-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.account-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto auto;
  align-items: end;
  gap: 10px;
  flex: 1;
}

.account-filter-form label,
.account-form label {
  display: grid;
  gap: 6px;
}

.account-filter-form label > span,
.account-form label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-workspace .enterprise-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.account-workspace td {
  vertical-align: middle;
}

.account-backend-mark {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.account-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.account-row-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .account-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .account-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .account-filter-form {
    grid-template-columns: 1fr;
  }

  .account-row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ddt-detail-header {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 14px;
    padding: 16px;
  }

  .ddt-detail-back {
    grid-column: 1 / -1;
  }

  .ddt-detail-identity h2 {
    font-size: 26px;
  }

  .ddt-detail-meta {
    gap: 14px;
    flex-wrap: wrap;
  }

  .ddt-detail-tools {
    grid-column: 2;
    grid-row: 2;
  }

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

  .ddt-detail-nav {
    position: static;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    overflow-x: auto;
  }

  .ddt-detail-nav button {
    grid-template-columns: 24px minmax(74px, 1fr);
  }

  .ddt-detail-nav button > small {
    display: none;
  }

  .similar-items-head {
    flex-direction: column;
  }

  .ddt-inline-action {
    grid-template-columns: 1fr;
  }

  .ddt-inline-action label.wide {
    grid-column: auto;
  }

  .ddt-resolution-path-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ddt-resolution-steps {
    grid-template-columns: 1fr;
  }
}

.history-pagination {
  align-items: center;
  border-top: 1px solid var(--line, #d7e2ee);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 16px;
}

.history-pagination > div {
  align-items: center;
  display: flex;
  gap: 10px;
}

.history-pagination > div:first-child {
  color: var(--muted, #60758c);
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.history-pagination > div:first-child strong {
  color: var(--ink, #13263d);
}

.history-page-size button,
.history-page-actions button {
  min-width: 44px;
}

.history-page-size button.active {
  background: var(--primary, #1f73d2);
  border-color: var(--primary, #1f73d2);
  color: #fff;
}

@media (max-width: 768px) {
  .history-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .history-pagination > div,
  .history-page-actions {
    justify-content: space-between;
  }

  .history-page-actions button {
    flex: 1;
  }
}

.provenance-summary {
  align-items: center;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #d7e2ee);
  border-left: 4px solid #d59a22;
  border-radius: 8px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  padding: 24px;
}

.provenance-summary.is-confirmed {
  border-left-color: #278a6c;
}

.provenance-summary h2 {
  margin: 4px 0 8px;
}

.provenance-summary p,
.provenance-recommendation p {
  margin: 0;
}

.provenance-estimate {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.provenance-estimate strong {
  color: var(--ink, #13263d);
  font-size: 34px;
  line-height: 1;
}

.provenance-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.provenance-panel,
.provenance-recommendation,
.provenance-ddt-list {
  margin: 0;
}

.provenance-recommendation small {
  color: var(--muted, #60758c);
  display: block;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .provenance-summary,
  .provenance-grid {
    grid-template-columns: 1fr;
  }

  .provenance-estimate {
    align-items: flex-start;
  }
}

/* 库存列表的货号列不折行：8508-0510 断成「8508-」「0510」两行会被当成两个货号。
   列宽由内容决定，描述列吸收剩余空间。 */
.link.sku-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 业务员与写法设置（非标库存页）。 */
.owner-admin-panel { margin: 12px 0; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; background: var(--surface, #fff); }
.owner-admin-panel > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.owner-admin-block { padding: 0 14px 12px; }
.owner-admin-block h4 { margin: 8px 0 4px; font-size: 13px; }
.owner-admin-list, .owner-unmapped-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.owner-admin-row { display: grid; grid-template-columns: minmax(120px, 180px) 1fr minmax(180px, 240px); gap: 10px; align-items: center;
  padding: 8px; border-radius: 8px; background: var(--surface-subtle, rgba(148,163,184,.08)); }
.owner-admin-name strong { display: block; }
.owner-admin-name small { color: var(--text-tertiary, #64748b); font-size: 12px; }
.owner-alias-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.owner-alias-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; border-radius: 999px;
  background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0); font-size: 12px; white-space: nowrap; }
.owner-alias-chip button { border: 0; background: transparent; cursor: pointer; color: var(--text-tertiary, #64748b);
  font-size: 14px; line-height: 1; padding: 0 4px; }
.owner-alias-chip button:hover { color: var(--danger, #dc2626); }
.owner-alias-add, .owner-create-form { display: flex; gap: 6px; flex-wrap: wrap; }
.owner-alias-add input, .owner-create-form input, .owner-create-form select { min-width: 0; flex: 1 1 120px; }
.owner-create-form { padding: 0 14px 14px; border-top: 1px solid var(--border, #e2e8f0); padding-top: 12px; }
.owner-unmapped-row { display: grid; grid-template-columns: minmax(100px, 200px) auto minmax(140px, 200px); gap: 10px; align-items: center;
  padding: 6px 8px; border-radius: 8px; background: var(--warn-surface, rgba(245,158,11,.10)); }
.owner-unmapped-row code { font-size: 13px; }
@media (max-width: 900px) {
  .owner-admin-row, .owner-unmapped-row { grid-template-columns: 1fr; }
}
.owner-admin-row.is-inactive { opacity: .55; }
.owner-admin-row.is-inactive .owner-admin-name strong { text-decoration: line-through; }


.settings-row-editable { align-items: flex-start; gap: 12px; }
.settings-row-editable > span { display: flex; flex-direction: column; gap: 2px; }
.settings-row-editable > span small { color: var(--text-tertiary, #64748b); font-size: 12px; font-weight: 400; }
.setting-edit { display: flex; gap: 6px; align-items: center; }
.setting-edit input { width: 96px; }

/* ── 基础档案页 ─────────────────────────────────────────────
   主从布局：左列表选一个，右侧改它。此前用折叠面板把所有对象的
   全部字段一次铺开，对象一多就变成一面墙，找不到刚才在改哪一个。 */
.master-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border, #e2e8f0); }
.master-tabs button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-size: 14px;
  color: var(--text-secondary, #475569); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.master-tabs button.active { color: var(--accent, #2563eb); border-bottom-color: var(--accent, #2563eb); font-weight: 600; }

.master-unmapped { margin-bottom: 14px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--warn-border, rgba(245,158,11,.4)); background: var(--warn-surface, rgba(245,158,11,.08)); }
.master-unmapped h3 { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.master-unmapped p { margin: 0 0 8px; font-size: 12px; color: var(--text-secondary, #475569); }
.master-unmapped ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.master-unmapped li { display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(150px, 200px); gap: 10px; align-items: center; }
.master-unmapped code { font-size: 13px; overflow-wrap: break-word; }
.master-unmapped small { color: var(--text-tertiary, #64748b); font-size: 12px; white-space: nowrap; }

.master-layout { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; }
.master-list { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; background: var(--surface, #fff); overflow: hidden; }
.master-list-head { display: flex; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border, #e2e8f0); }
.master-list-head input { flex: 1; min-width: 0; }
.master-count { font-size: 12px; color: var(--text-tertiary, #64748b); }
.master-list ul { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; }
.master-list li { border-bottom: 1px solid var(--border-subtle, rgba(148,163,184,.2)); }
.master-list li button { width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.master-list li button:hover { background: var(--surface-subtle, rgba(148,163,184,.08)); }
.master-list li button.active { background: var(--accent-subtle, rgba(37,99,235,.10)); box-shadow: inset 3px 0 0 var(--accent, #2563eb); }
.master-item-name { font-weight: 600; font-size: 14px; }
.master-item-meta { font-size: 12px; color: var(--text-tertiary, #64748b); }
.master-create { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-top: 1px solid var(--border, #e2e8f0); }
.master-create input, .master-create select { flex: 1 1 100px; min-width: 0; }

.master-detail { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; background: var(--surface, #fff); padding: 16px; }
.master-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--border, #e2e8f0); }
.master-detail-head h2 { margin: 0; font-size: 18px; overflow-wrap: break-word; }
.master-detail-head p { margin: 2px 0 0; font-size: 12px; }
.master-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }
.master-detail-block { padding-top: 12px; }
.master-detail-block h3 { margin: 0 0 4px; font-size: 14px; }
.master-alias-add { display: flex; gap: 6px; margin-top: 10px; }
.master-alias-add input { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .master-layout { grid-template-columns: 1fr; }
  .master-list ul { max-height: 240px; }
  .master-unmapped li { grid-template-columns: 1fr; }
}

/* ── 非标库存批量选择 ────────────────────────────────────────
   勾选列用第一列定位（表格组件不支持列级 class）。
   复选框缩到 15px：默认尺寸在密集表格里比正文还大，视觉上抢戏。 */
.non-standard-list-workspace table th:first-child,
.non-standard-list-workspace table td:first-child { width: 34px; padding-left: 10px; padding-right: 0; text-align: center; }
.row-check { width: 15px; height: 15px; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--accent, #2563eb); }

/* 操作条固定在底部：勾选是在长列表里进行的，操作放页顶等于逼人来回滚动。
   字段带标签，因为"替换/追加"这类词单独出现看不出在说什么。 */
.special-batch-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px;
  align-items: flex-end; padding: 10px 14px; margin: 10px 0 0; border-radius: 10px;
  border: 1px solid var(--accent, #2563eb); background: var(--surface, #fff);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, .10); }
.special-batch-bar .batch-count { font-size: 13px; padding-bottom: 6px; white-space: nowrap; }
.special-batch-bar .batch-count strong { font-size: 15px; color: var(--accent, #2563eb); }
.special-batch-bar .batch-clear { padding-bottom: 6px; font-size: 12px; }
.batch-divider { width: 1px; align-self: stretch; margin: 2px 2px; background: var(--border, #e2e8f0); }
.batch-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.batch-field > span { font-size: 11px; color: var(--text-tertiary, #64748b); }
.batch-field select, .batch-field input { height: 32px; }
.batch-field-grow { flex: 1 1 160px; }
.special-batch-bar button[type="submit"] { height: 32px; }

@media (max-width: 720px) {
  .special-batch-bar { gap: 8px; }
  .batch-divider { display: none; }
  .batch-field-grow { flex-basis: 100%; }

  /* 产品详情的在途明细在窄屏改成逐票卡片，避免为了看 ETA 或数量横向拖动。 */
  body.app-mode .sku-incoming-table .table-wrap { overflow: visible; }
  body.app-mode .sku-incoming-table .table-wrap table,
  body.app-mode .sku-incoming-table tbody,
  body.app-mode .sku-incoming-table tr { display: block; width: 100%; min-width: 0; }
  body.app-mode .sku-incoming-table thead { display: none; }
  body.app-mode .sku-incoming-table tbody { display: grid; gap: 10px; }
  body.app-mode .sku-incoming-table tr {
    padding: 10px 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    background: var(--surface, #fff);
  }
  body.app-mode .sku-incoming-table td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 6px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  body.app-mode .sku-incoming-table td::before {
    color: var(--text-tertiary, #64748b);
    font-size: 11px;
    font-weight: 700;
  }
  body.app-mode .sku-incoming-table td > small { grid-column: 2; margin-top: -6px; }
  body.app-mode .sku-incoming-table td:nth-child(1)::before { content: "装箱单号"; }
  body.app-mode .sku-incoming-table td:nth-child(2)::before { content: "预计到达"; }
  body.app-mode .sku-incoming-table td:nth-child(3)::before { content: "在途数量"; }
  body.app-mode .sku-incoming-table td:nth-child(4)::before { content: "库存归属"; }
  body.app-mode .sku-incoming-table td:nth-child(5)::before { content: "客户 / 订单"; }
  body.app-mode .sku-incoming-table td:nth-child(6)::before { content: "当前阶段"; }
}

/* select 的固有宽度由最长选项决定（客户全称可以很长），
   不约束就会把 grid 撑破导致整页横向滚动。 */
.master-unmapped select { width: 100%; min-width: 0; max-width: 100%; }
.master-unmapped li > * { min-width: 0; }

/* 全局 input 有统一高度，复选框会被拉成 15×38 的竖条。
   用属性选择器提高优先级把它按回方形。 */
input[type="checkbox"].row-check {
  width: 15px; height: 15px; min-height: 0; padding: 0; flex: 0 0 auto;
}

/* 专属库位标记：拣货的人要一眼看出这批货不在常规货位上。 */
.loc-dedicated { display: block; font-size: 11px; color: var(--warn-text, #b45309); }
.loc-origin { color: var(--text-tertiary, #64748b); }

/* ── 非标批次详情 ────────────────────────────────────────────
   此前一屏塞了：15 行字段墙 + 库位表单 + 转入大货表单 + 17 字段编辑面板，
   共 2771px（视口 714px，要滚 4 屏），且「库位」同时出现在三个表单里。
   现在概览只列有值的字段，操作与编辑默认收起。 */
.lot-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 20px; margin: 0 0 4px; }
.lot-summary > div { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle, rgba(148,163,184,.18)); }
.lot-summary dt { font-size: 11px; color: var(--text-tertiary, #64748b); }
.lot-summary dd { margin: 0; font-size: 14px; overflow-wrap: break-word; }

.lot-actions { display: flex; flex-direction: column; gap: 6px; }
.lot-action, .lot-edit-details { border: 1px solid var(--border, #e2e8f0); border-radius: 8px; background: var(--surface, #fff); }
.lot-action > summary, .lot-edit-details > summary {
  padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 14px;
  display: flex; align-items: baseline; gap: 10px; list-style: none;
}
.lot-action > summary::-webkit-details-marker, .lot-edit-details > summary::-webkit-details-marker { display: none; }
.lot-action > summary::before, .lot-edit-details > summary::before { content: "›"; display: inline-block; transition: transform .15s; color: var(--text-tertiary, #64748b); }
.lot-action[open] > summary::before, .lot-edit-details[open] > summary::before { transform: rotate(90deg); }
.lot-action > summary:hover, .lot-edit-details > summary:hover { background: var(--surface-subtle, rgba(148,163,184,.08)); }
.lot-edit-details > summary small { font-weight: 400; font-size: 12px; color: var(--text-tertiary, #64748b); }
.lot-action > form, .lot-action > .notice, .lot-edit-details > form { margin: 0 14px 14px; }
.lot-action.danger-action > summary { color: var(--danger, #dc2626); }
.lot-edit-details { margin-top: 12px; }

/* 批次行内的「转回大库存」：是操作不是字段，跟在批次引用信息后面。 */
.lot-release-btn { font-size: 12px; color: var(--accent, #2563eb); }
.lot-release-btn:hover { text-decoration: underline; }

/* 客户专属转回大库存：与非标划拨用同一套表单栅格，两处操作方式一致。 */
.sku-release-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; align-items: end; }
.sku-release-form label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sku-release-form label > span { font-size: 12px; color: var(--text-secondary, #475569); }
.sku-release-form .span-all { grid-column: 1 / -1; }
.release-move-hint { grid-column: 1 / -1; margin: 0; padding: 8px 10px; border-radius: 8px;
  background: var(--warn-surface, rgba(245,158,11,.10)); color: var(--warn-text, #b45309); font-size: 12px; }
.sku-release-form .lot-edit-actions { grid-column: 1 / -1; }

/* ── DDT 确认屏（流程由 6 步压到 3 步后的核心界面）────────────────── */

/* 需要人工确认的行。负库存用红色，其余是正常业务情形，用中性提示色，
   不要让「客户预留不够、同时动用大货」这种常态看起来像事故。 */
.ddt-attention { margin: 12px 0; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--warn-border, rgba(245,158,11,.4)); background: var(--warn-surface, rgba(245,158,11,.08)); }
.ddt-attention h3 { margin: 0 0 8px; font-size: 14px; }
.ddt-attention ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ddt-attention li { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 2px 12px; align-items: baseline;
  padding: 8px 10px; border-radius: 8px; background: var(--surface, #fff); }
.ddt-attention li strong { font-variant-numeric: tabular-nums; }
.ddt-attention li span { font-size: 13px; }
.ddt-attention li small { grid-column: 2; color: var(--text-tertiary, #64748b); font-size: 12px; }
.ddt-attention li.is-negative { border-left: 3px solid var(--danger, #dc2626); }
.ddt-attention li.is-negative span { color: var(--danger, #dc2626); font-weight: 600; }

/* 逐行明细默认收起：没有异常时大多数人只看汇总，不该被一张长表挡在确认按钮前面。 */
.ddt-collapsible { margin: 12px 0; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; background: var(--surface, #fff); }
.ddt-collapsible > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 14px;
  display: flex; align-items: baseline; gap: 10px; list-style: none; }
.ddt-collapsible > summary::-webkit-details-marker { display: none; }
.ddt-collapsible > summary::before { content: "›"; transition: transform .15s; color: var(--text-tertiary, #64748b); }
.ddt-collapsible[open] > summary::before { transform: rotate(90deg); }
.ddt-collapsible > summary small { font-weight: 400; color: var(--text-tertiary, #64748b); }
.ddt-collapsible-body { padding: 0 14px 14px; }

.ddt-info-note { margin: 10px 0; font-size: 12px; color: var(--text-tertiary, #64748b); }
.ddt-reason-field textarea { width: 100%; }
.ddt-reason-field small { color: var(--text-tertiary, #64748b); font-size: 12px; }

/* 确认区固定在末尾成组：说明、按钮、错误提示三者相邻，
   避免出现「点了按钮但提示在页面顶部看不见」的情况。 */
.ddt-confirm-bar { margin-top: 16px; padding: 14px; border-radius: 10px;
  border: 1px solid var(--accent, #2563eb); background: var(--surface, #fff); }
.ddt-confirm-bar > p { margin: 0 0 10px; font-size: 13px; }
.ddt-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ddt-confirm-error { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px;
  background: var(--danger-surface, rgba(220,38,38,.10)); color: var(--danger, #dc2626); font-size: 13px; }
