:root {
  color-scheme: light;
  --brand: #0033a0;
  --brand-strong: #002a83;
  --brand-soft: #eef4ff;
  --deep: #071225;
  --deep-2: #0b1730;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --soft: #f8fafc;
  --line: #d8dee8;
  --line-soft: #e8edf5;
  --ink: #111827;
  --muted: #64748b;
  --green: #07884a;
  --green-soft: #e9f8f0;
  --orange: #d97706;
  --orange-soft: #fff4df;
  --red: #c72c41;
  --red-soft: #fff0f2;
  --purple: #7c3aed;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 1180px; min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 13px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 34px;
  border: 1px solid var(--brand);
  border-radius: 7px;
  padding: 0 13px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  cursor: pointer;
}
button:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 71, 186, 0.24);
  outline-offset: 2px;
}
button.ghost {
  color: #334155;
  background: #fff;
  border-color: var(--line);
}
button.ghost:hover { color: var(--brand); border-color: #91afe8; background: var(--brand-soft); }
button:disabled { cursor: wait; opacity: 0.58; }
input, select, textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 96px; padding: 10px; resize: vertical; }
input::placeholder { color: #94a3b8; }
h1, h2, h3, h4, p { margin: 0; }
p { color: var(--muted); line-height: 1.5; }
a { color: var(--brand); }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Login */
.login-shell {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22.2vh 20px 36px;
  color: #f3f6fb;
  background: #06111d url("assets/v3-ai-login-secure-bay-1440x900.png?v=20260809") center top / cover no-repeat fixed;
}
.login-shell::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 22.2vh auto 0 50%;
  width: min(700px, calc(100vw - 40px));
  transform: translateX(-50%);
  background: #071522;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.46);
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(650px, calc(100vw - 40px));
  min-width: 0;
  padding: clamp(34px, 2.7vw, 43px) clamp(44px, 3.5vw, 56px) 34px;
  display: grid;
  gap: 20px;
  border: 0;
  border-radius: 2px;
  background: #071522;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.46);
}
.login-brand { display: grid; justify-items: center; text-align: center; }
.login-brand h1 {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  color: #f7f8fa;
  font-size: clamp(108px, 10vw, 142px);
  font-weight: 900;
  line-height: 0.75;
  letter-spacing: -0.03em;
  transform: scaleX(1.25);
  transform-origin: center;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.68);
}
.login-brand p { margin-top: 12px; color: #9ba4b6; font-size: clamp(17px, 1.42vw, 22px); font-weight: 700; line-height: 1.25; }
.login-signal-line { width: 136px; height: 4px; margin: 18px auto 7px; display: block; background: #f0a000; }
.login-card > label:not(.remember-row) { display: grid; gap: 8px; color: #f0f3f7; font-size: 17px; font-weight: 700; }
.login-card input:not([type="checkbox"]) {
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #7f8793;
  border-radius: 5px;
  color: #f5f7fb;
  background: #07131f;
  font-size: 17px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
.login-card input:not([type="checkbox"])::placeholder { color: #9299a7; }
.login-card input:not([type="checkbox"]):hover { border-color: #aab2bf; }
.login-card input:not([type="checkbox"]):focus {
  border-color: #3e78ff;
  outline: none;
  background: #081827;
  box-shadow: 0 0 0 3px rgba(31, 91, 255, 0.2);
}
.login-card > button {
  position: relative;
  overflow: hidden;
  min-height: 66px;
  border-color: #3266ff;
  border-radius: 6px;
  color: #fff;
  background: #0939b9;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18), 0 10px 28px rgba(0, 51, 160, 0.32);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.login-card > button::before,
.login-card > button::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.95);
  transform: scaleX(0);
  transform-origin: center;
  pointer-events: none;
}
.login-card > button::before { top: 3px; }
.login-card > button::after { bottom: 3px; }
.login-card > button.is-submitting { animation: v3LoginBusy 0.7s ease forwards; }
.login-card > button.is-submitting::before,
.login-card > button.is-submitting::after { animation: v3LoginRail 0.42s cubic-bezier(0.2, 0.75, 0.25, 1) forwards; }
.login-card > button:hover { border-color: #5a83ff; background: #1245cc; }
.login-card > button:active { transform: translateY(1px); }
.remember-row {
  width: max-content;
  grid-template-columns: auto auto !important;
  align-items: center;
  gap: 10px !important;
  color: #d3d8e0 !important;
  font-size: 17px !important;
  font-weight: 600 !important;
}
.remember-row input {
  appearance: none;
  width: 20px;
  min-height: 20px;
  margin: 0;
  border: 1px solid #c5ccd5;
  border-radius: 3px;
  background: #07131f;
  cursor: pointer;
}
.remember-row input:checked { border-color: #5c82ff; background: #174fe8; box-shadow: inset 0 0 0 4px #07131f; }
.remember-row input:focus-visible { outline: 3px solid rgba(103, 145, 255, 0.4); outline-offset: 2px; }
.login-card .error { min-height: 20px; color: #ff9da6; font-size: 14px; text-align: left; }
.login-card .error:empty { display: none; }
html:has(.login-shell:not(.hidden)),
body:has(.login-shell:not(.hidden)) { min-width: 0; }

/* Shared shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  padding: 20px 9px 14px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 58%, #08101e 100%);
}
.sidebar-brand {
  min-height: 88px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  color: #fff;
}
.sidebar-brand img { width: 108px; height: auto; display: block; }
.sidebar-brand strong { font-size: 18px; letter-spacing: 0.04em; }
.sidebar-nav { display: grid; gap: 7px; margin-top: 12px; }
.nav {
  width: 100%;
  min-height: 46px;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #c8d4e8;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  word-break: keep-all;
}
.nav:hover { color: #fff; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.08); }
.nav.active { color: #fff; background: var(--brand); border-color: #1e5fd8; box-shadow: 0 8px 18px rgba(0, 51, 160, 0.26); }
.sidebar-bottom { margin-top: auto; }
.sidebar-admin-tools { color: #d9e3f2; }
.sidebar-admin-tools summary {
  min-height: 38px;
  padding: 9px 8px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}
.sidebar-admin-tools summary::-webkit-details-marker { display: none; }
.sidebar-admin-tools summary:hover,
.sidebar-admin-tools[open] summary { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sidebar-admin-tools > button {
  width: 100%;
  min-height: 32px;
  margin-top: 5px;
  padding: 0 8px;
  color: #d9e3f2;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  font-size: 11px;
}
.sidebar-admin-tools > button:hover { color: #fff; background: var(--brand); }

.workspace { min-width: 0; min-height: 100vh; }
.topbar {
  min-height: 105px;
  padding: 14px 20px 11px;
  display: grid;
  align-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}
.topbar-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-heading { min-width: 0; display: flex; align-items: center; gap: 14px; }
.page-heading > h1 { color: var(--brand); font-size: 29px; letter-spacing: 0.025em; white-space: nowrap; }
.heading-divider { width: 1px; height: 34px; background: var(--line); }
.page-heading h2 { font-size: 19px; line-height: 1.2; white-space: nowrap; }
.page-heading > div > p { display: none; }
.priority-sync-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.priority-sync-line strong { color: #475569; font-weight: 700; }
.priority-live-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #526074;
}
.priority-live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.priority-live-status.is-connecting { color: var(--brand); }
.priority-live-status.is-connecting i {
  background: var(--brand);
  animation: priority-live-pulse 1.4s ease-in-out infinite;
}
.priority-live-status.is-live { color: var(--green); }
.priority-live-status.is-live i {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 136, 74, 0.11);
}
.priority-live-status.is-retrying { color: var(--orange); }
.priority-live-status.is-retrying i { background: var(--orange); }
.priority-live-status.is-error { color: var(--red); }
.priority-live-status.is-error i { background: var(--red); }
.priority-live-status.is-paused { color: var(--muted); }
@keyframes priority-live-pulse {
  50% { opacity: 0.42; transform: scale(0.82); }
}
.source-health { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.source-health i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.source-health.is-healthy { color: var(--green); }
.source-health.is-healthy i { background: var(--green); }
.source-health.is-warning { color: var(--orange); }
.source-health.is-warning i { background: var(--orange); }
.source-health.is-error { color: var(--red); }
.source-health.is-error i { background: var(--red); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.global-search { width: min(420px, 31vw); }
.global-search input { min-height: 36px; padding-left: 13px; }
.user-menu-wrap { position: relative; }
.user-menu-button {
  min-width: 116px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  background: #fff;
  border-color: transparent;
}
.user-menu-button:hover { color: var(--brand); background: var(--brand-soft); border-color: #d7e4ff; }
.user-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
}
.user-caret { color: var(--muted); font-size: 15px; }
.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  width: 176px;
  padding: 8px;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.16);
}
.user-menu strong { padding: 9px 10px; color: #475569; font-size: 12px; }
.user-menu a,
.user-menu button {
  min-height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}
.user-menu a:hover,
.user-menu button:hover { color: var(--brand); background: var(--brand-soft); }
.priority-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.priority-toolbar input,
.priority-toolbar select { width: 132px; min-height: 32px; font-size: 12px; }
.priority-toolbar select:nth-of-type(3) { width: 118px; }
.priority-toolbar button { min-height: 32px; font-size: 12px; }

.view { padding: 12px 18px 18px; }
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

/* KPI */
.priority-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.priority-kpi {
  min-height: 92px;
  padding: 15px 18px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}
.priority-kpi p { color: #526074; font-size: 12px; font-weight: 800; }
.priority-kpi strong { margin-top: 3px; font-size: 28px; line-height: 1; color: var(--brand); }
.priority-kpi span { color: var(--muted); font-size: 10px; }
.priority-kpi.accent-amber strong { color: var(--red); }
.priority-kpi.accent-blue strong { color: var(--orange); }
.priority-kpi.accent-green strong { color: var(--green); }
.priority-kpi.accent-red strong { color: var(--purple); }
.priority-kpi.is-loading {
  background: linear-gradient(90deg, #fff 20%, #f2f6fc 50%, #fff 80%);
  background-size: 240% 100%;
  animation: priority-shimmer 1.4s linear infinite;
}
@keyframes priority-shimmer { to { background-position: -240% 0; } }

/* Health strip */
.priority-health-panel { margin-bottom: 12px; padding: 12px 15px 13px; }
.priority-section-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.priority-section-title h3,
.priority-list-head h3 { font-size: 15px; color: #18345f; }
.priority-section-title p,
.priority-list-head p { font-size: 11px; }
.priority-stage-health { display: grid; grid-template-columns: repeat(8, minmax(102px, 1fr)); gap: 9px; }
.priority-health-item {
  width: 100%;
  min-height: 104px;
  padding: 11px 12px;
  display: grid;
  gap: 6px;
  border: 1px solid #d6e1f3;
  border-radius: 8px;
  color: inherit;
  background: #fbfdff;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.priority-health-item:hover {
  border-color: #8eace5;
  color: inherit;
  background: #f4f8ff;
  transform: translateY(-1px);
}
.priority-health-item:focus-visible {
  outline: 3px solid rgba(0, 71, 186, 0.24);
  outline-offset: 2px;
}
.priority-health-item.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px rgba(0, 51, 160, 0.11), 0 8px 18px rgba(0, 51, 160, 0.09);
}
.priority-health-item header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.priority-health-item header strong { color: #16396f; font-size: 13px; }
.priority-health-state {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.priority-health-item.is-warning .priority-health-state { background: var(--orange); }
.priority-health-item.is-danger .priority-health-state { background: var(--red); }
.priority-health-pending { color: #526074; font-size: 11px; font-weight: 700; }
.priority-health-pending strong { color: #172554; font-size: 18px; }
.priority-health-item.is-warning .priority-health-pending strong,
.priority-health-item.is-danger .priority-health-pending strong { color: var(--red); }
.priority-health-values { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.priority-health-values strong { color: #172554; font-size: 12px; }
.priority-health-values span { color: #526074; font-size: 9px; white-space: nowrap; }
.priority-health-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ecf6;
}
.priority-health-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
.priority-health-item.is-warning .priority-health-progress span { background: var(--orange); }
.priority-health-item.is-danger .priority-health-progress span { background: var(--red); }
.priority-health-loading { min-height: 72px; display: grid; place-items: center; color: var(--muted); }

/* Command center */
.priority-command-grid {
  display: grid;
  grid-template-columns: minmax(760px, 2.1fr) minmax(318px, 0.92fr);
  gap: 12px;
  align-items: start;
}
.priority-list-panel,
.priority-intervention-panel { overflow: hidden; }
.priority-list-head {
  min-height: 48px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.table-wrap { overflow: auto; }
.priority-table-wrap { max-height: calc(100vh - 437px); min-height: 410px; }
.priority-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}
.priority-table th,
.priority-table td {
  padding: 8px 5px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  font-size: 10.5px;
  line-height: 1.35;
}
.priority-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #345077;
  background: #eef4ff;
  font-size: 10px;
  font-weight: 900;
}
.priority-table th:nth-child(1) { width: 4%; }
.priority-table th:nth-child(2) { width: 10%; }
.priority-table th:nth-child(3) { width: 6%; }
.priority-table th:nth-child(4) { width: 6%; }
.priority-table th:nth-child(5) { width: 6%; }
.priority-table th:nth-child(6) { width: 8%; }
.priority-table th:nth-child(7) { width: 4%; }
.priority-table th:nth-child(8) { width: 21%; }
.priority-table th:nth-child(9) { width: 9%; }
.priority-table th:nth-child(10) { width: 12%; }
.priority-table th:nth-child(11) { width: 9%; }
.priority-table th:nth-child(12) { width: 5%; }
.priority-row { cursor: pointer; }
.priority-row:hover { background: #f8fbff; }
.priority-row.is-selected { background: #edf5ff; box-shadow: inset 3px 0 var(--brand); }
.priority-order-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 6px;
}
.priority-order-cell strong { overflow: hidden; text-overflow: ellipsis; word-break: break-all; }
.priority-item-count {
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--brand);
  background: #eaf1ff;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}
.priority-merge-orders {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.priority-image-wrap,
.priority-no-image {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #8492a6;
  background: #f3f6fa;
  font-size: 9px;
}
.priority-image-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; }
.priority-image-wrap small { display: none; }
.priority-level { color: #314967; font-weight: 800; }
.priority-order-status {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}
.priority-order-status.status-unprinted { color: #9a5800; background: var(--orange-soft); }
.priority-order-status.status-processing { color: var(--brand); background: #eaf1ff; }
.priority-order-status.status-completed { color: var(--green); background: var(--green-soft); }
.priority-order-status.status-cancelled { color: var(--red); background: var(--red-soft); }
.priority-order-status.status-pending { color: #667085; background: #edf1f6; }
.priority-delivery { display: grid; gap: 2px; }
.priority-delivery span { font-size: 9px; }
.priority-delivery.risk-overdue strong,
.priority-delivery.risk-overdue span { color: var(--red); }
.priority-delivery.risk-due-today strong,
.priority-delivery.risk-due-today span,
.priority-delivery.risk-at-risk strong,
.priority-delivery.risk-at-risk span { color: var(--orange); }
.priority-delivery.risk-normal span { color: var(--green); }
.priority-owner { display: block; overflow: hidden; text-overflow: ellipsis; word-break: break-word; }
.priority-current-stage { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.priority-commitment-cell { display: grid; gap: 4px; }
.priority-commitment-entry { display: grid; gap: 1px; }
.priority-commitment-entry strong { color: var(--brand); font-size: 9px; line-height: 1.2; }
.priority-commitment-entry small,
.priority-commitment-more,
.priority-commitment-empty { color: var(--muted); font-size: 8px; line-height: 1.25; }
.priority-commitment-entry.is-missing strong { color: var(--orange); }
.priority-commitment-entry.is-overdue strong { color: var(--red); }
.priority-pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: start; gap: 0; }
.priority-stage { position: relative; display: grid; justify-items: center; gap: 4px; color: #697386; font-size: 9px; text-align: center; }
.priority-stage::after {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% + 6px);
  right: calc(-50% + 6px);
  height: 1px;
  background: #d6dee9;
}
.priority-stage:last-child::after { display: none; }
.priority-stage-dot {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #a7adb5;
  box-shadow: 0 0 0 1px #a7adb5;
}
.stage-completed .priority-stage-dot { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.stage-in-progress .priority-stage-dot { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.stage-warning .priority-stage-dot { background: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.stage-blocked .priority-stage-dot { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.stage-not-applicable { opacity: .64; }
.stage-not-applicable .priority-stage-dot { background: #fff; box-shadow: 0 0 0 1px #a7adb5; }
.priority-progress-missing { color: var(--muted); }
.priority-push-status {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}
.priority-push-status.push-sent { color: var(--green); background: var(--green-soft); }
.priority-push-status.push-failed { color: var(--red); background: var(--red-soft); }
.priority-push-status.push-pending { color: #9a5800; background: var(--orange-soft); }
.priority-push-status.push-none { color: #667085; background: #edf1f6; }
.priority-table td:nth-last-child(2) small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.priority-detail-link {
  min-height: 28px;
  padding: 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 10px;
}
.priority-detail-link:hover { color: var(--brand-strong); background: transparent; text-decoration: underline; }
.empty-cell { padding: 32px !important; color: var(--muted); text-align: center !important; }
.empty-cell p { margin-top: 6px; font-size: 11px; }
.priority-pagination {
  min-height: 48px;
  padding: 8px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.priority-pagination label { display: flex; align-items: center; gap: 6px; }
.priority-pagination select { width: 82px; min-height: 30px; font-size: 11px; }
.priority-page-buttons { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.priority-page-buttons button { min-width: 30px; min-height: 30px; padding: 0 7px; font-size: 11px; }
.priority-page-buttons button.is-active { background: var(--brand); }

/* Intervention panel */
.priority-interventions { padding: 9px; display: grid; gap: 9px; max-height: calc(100vh - 389px); overflow: auto; }
.intervention-group { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.intervention-group.is-overdue { border-color: #f2c4cb; }
.intervention-group.is-due { border-color: #f5d5a3; }
.intervention-group.is-push { border-color: #d8c8fb; }
.intervention-group header {
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}
.intervention-group.is-overdue header { color: var(--red); background: var(--red-soft); }
.intervention-group.is-due header { color: var(--orange); background: var(--orange-soft); }
.intervention-group.is-push header { color: var(--purple); background: #f5f0ff; }
.intervention-group header strong { font-size: 12px; }
.intervention-group header span { font-size: 10px; }
.intervention-list { display: grid; }
.intervention-row {
  min-height: 53px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(105px, 1fr) 52px minmax(68px, 0.8fr) auto;
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--line-soft);
  font-size: 9.5px;
}
.intervention-row.has-manual-push {
  grid-template-columns: minmax(105px, 1fr) 52px minmax(68px, 0.8fr) 50px auto;
}
.intervention-row:first-child { border-top: 0; }
.intervention-row strong,
.intervention-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intervention-row button {
  min-height: 26px;
  padding: 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 9.5px;
}
.intervention-row button:hover { color: var(--brand-strong); background: transparent; text-decoration: underline; }
.intervention-row .intervention-push-button {
  min-width: 46px;
  padding: 0 8px;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}
.intervention-row .intervention-push-button:hover {
  color: #fff;
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  text-decoration: none;
}
.intervention-row .intervention-push-button:disabled {
  color: #fff;
  background: #9aafd0;
  border-color: #9aafd0;
  cursor: not-allowed;
  opacity: 0.72;
}
.intervention-empty { min-height: 48px; display: grid; place-items: center; color: var(--muted); font-size: 10px; }

/* Dialogs and details */
dialog {
  width: min(940px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}
dialog::backdrop { background: rgba(7, 18, 37, 0.54); }
.priority-dialog > section { min-width: 0; }
.priority-dialog-head {
  min-height: 66px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.priority-dialog-head h3 { font-size: 17px; }
.priority-dialog-head p { margin-top: 3px; font-size: 11px; }
.priority-dialog-head button { min-height: 32px; }
.priority-detail-empty,
.priority-dialog-empty,
.priority-dialog-loading,
.priority-dialog-error {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}
.priority-dialog-error { color: var(--red); }
.priority-detail-warning { margin: 12px 14px 0; padding: 9px 11px; color: #8b5c00; background: #fff5d9; border-radius: 7px; }
.priority-order-summary {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.priority-image-wrap.is-large,
.priority-no-image.is-large { width: 160px; height: 132px; border-radius: 8px; }
.priority-detail-order-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.priority-detail-order-line h4 { font-size: 18px; }
.priority-risk-badge { padding: 3px 8px; border-radius: 5px; font-size: 10px; font-weight: 900; }
.priority-risk-badge.risk-overdue { color: var(--red); background: var(--red-soft); }
.priority-risk-badge.risk-due-today,
.priority-risk-badge.risk-at-risk { color: var(--orange); background: var(--orange-soft); }
.priority-risk-badge.risk-normal { color: var(--green); background: var(--green-soft); }
.priority-order-summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin: 0; }
.priority-order-summary dl div { display: flex; gap: 8px; min-width: 0; }
.priority-order-summary dt { color: var(--muted); }
.priority-order-summary dd { margin: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
.priority-item-details { padding: 16px 18px 18px; border-bottom: 1px solid var(--line); background: #f8faff; }
.priority-item-details-head {
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.priority-item-details-head h4 { margin: 0; font-size: 13px; }
.priority-item-details-head span { color: var(--muted); font-size: 10px; text-align: right; }
.priority-item-list { display: grid; gap: 12px; }
.priority-item-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.priority-item-commitments { margin-top: 9px; padding: 8px 10px; display: grid; gap: 4px; border: 1px solid #c9d8f3; border-radius: 8px; background: #f3f7ff; font-size: 10px; }
.priority-item-commitments > strong { color: #173d7a; }
.priority-item-commitments > span { color: var(--brand); }
.priority-item-commitments > span.is-missing { color: var(--orange); }
.priority-item-commitments > span.is-overdue { color: var(--red); }
.priority-item-summary { min-width: 0; padding: 12px; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; }
.priority-image-wrap.is-item,
.priority-no-image.is-item { width: 128px; height: 104px; border-radius: 7px; }
.priority-item-copy { min-width: 0; }
.priority-item-title { min-width: 0; display: flex; align-items: center; gap: 8px; }
.priority-item-title > span,
.priority-item-title > b {
  flex: none;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}
.priority-item-title > span { color: var(--brand); background: #eaf1ff; }
.priority-item-title > b { color: #526174; background: #edf1f5; }
.priority-item-title h5 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; white-space: nowrap; }
.priority-item-copy dl {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 14px;
}
.priority-item-copy dl div { min-width: 0; display: flex; gap: 5px; font-size: 9px; }
.priority-item-copy dt { flex: none; color: var(--muted); }
.priority-item-copy dd { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 800; white-space: nowrap; }
.priority-item-stages { padding: 10px 12px 12px; border-top: 1px solid var(--line-soft); }
.priority-item-stages h6 { margin: 0 0 8px; font-size: 10px; }
.priority-item-stages .priority-pipeline { margin: 0 0 10px; }
.priority-item-stage-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.priority-item-stage-grid > div {
  min-width: 0;
  padding: 6px 4px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  text-align: center;
  font-size: 8px;
}
.priority-item-stage-grid span { color: var(--muted); font-variant-numeric: tabular-nums; }
.priority-item-stage-grid p,
.priority-item-empty { margin: 0; padding: 18px; color: var(--muted); text-align: center; }
.priority-recipient-block,
.priority-stage-detail { padding: 15px 18px; }
.priority-recipient-block { border-bottom: 1px solid var(--line); }
.priority-recipient-block h4,
.priority-stage-detail h4,
.priority-owner-rules h4 { margin: 0 0 10px; font-size: 13px; }
.priority-recipient-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.priority-stage-detail .priority-pipeline { margin: 10px 0 15px; }
.priority-stage-detail .priority-stage { gap: 7px; font-size: 10px; font-weight: 800; }
.priority-stage-detail .priority-stage-dot { width: 18px; height: 18px; border-width: 3px; }
.priority-stage-detail .priority-stage::after { top: 8px; left: calc(50% + 10px); right: calc(-50% + 10px); }
.priority-stage-matrix { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.priority-stage-matrix article { min-width: 0; padding: 9px 5px; display: grid; gap: 5px; border-right: 1px solid var(--line); text-align: center; font-size: 9px; }
.priority-stage-matrix article:last-child { border-right: 0; }
.priority-stage-matrix article span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.stage-text-completed { color: var(--green); }
.stage-text-in-progress { color: var(--brand); }
.stage-text-warning { color: var(--orange); }
.stage-text-not-applicable { color: var(--muted); }
.stage-text-blocked,
.stage-text-not-started { color: var(--red); }

.priority-settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.priority-settings-form label { display: grid; gap: 7px; color: #526074; font-weight: 800; }
.stage-board-settings-form { display: grid; gap: 18px; padding: 18px; }
.stage-board-config-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stage-board-config { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.stage-board-config-head,
.stage-board-section-head,
.stage-board-device { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-board-config-head { margin-bottom: 11px; }
.stage-board-config-head div { display: grid; gap: 2px; }
.stage-board-config-head strong { font-size: 15px; }
.stage-board-config-head span,
.stage-board-config-head a,
.stage-board-section-head p,
.stage-board-device span { color: var(--muted); font-size: 11px; }
.stage-board-config-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stage-board-config-fields label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 800; }
.stage-board-config-fields input,
.stage-board-config-fields select,
.stage-board-pairing input,
.photo-mapping-row input,
.photo-mapping-row select { min-width: 0; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.stage-board-pairing { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 8px; margin-top: 10px; }
.stage-board-pairing span { grid-column: 1 / -1; display: grid; gap: 3px; font-size: 11px; }
.stage-board-pairing small { color: var(--muted); }
.photo-mapping-settings,
.stage-board-device-list { padding: 15px; border: 1px solid var(--line); border-radius: 8px; }
.stage-board-section-head h4,
.stage-board-section-head p { margin: 0; }
.stage-board-section-head p { margin-top: 3px; }
#photoMappingRows { display: grid; gap: 7px; margin-top: 12px; }
.photo-mapping-row { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) auto; gap: 8px; }
#stageBoardDevices { display: grid; gap: 6px; margin-top: 12px; }
.stage-board-device { padding: 9px 11px; border: 1px solid var(--line-soft); border-radius: 6px; }
.stage-board-device span { display: grid; gap: 2px; }
.stage-board-device span strong { color: var(--text); font-size: 12px; }
.stage-board-device em { color: var(--muted); font-style: normal; }

/* Priority performance report */
.performance-view {
  padding: 16px 20px 24px;
  background: #f3f6fb;
}
.performance-heading h3 {
  margin: 0 0 14px;
  color: #0d1b33;
  font-size: 24px;
  letter-spacing: .01em;
}
.performance-control-bar {
  min-height: 62px;
  margin-bottom: 8px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.performance-tabs { align-self: stretch; display: flex; align-items: stretch; }
.performance-tabs button {
  min-width: 92px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: #15243d;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 800;
}
.performance-tabs button.active { color: #0c55d7; border-bottom-color: #0c55d7; }
.performance-date-field {
  min-width: 200px;
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #c9d4e5;
  border-radius: 6px;
  background: #fff;
}
.performance-date-field img,
.performance-settings-button img { width: 18px; height: 18px; }
.performance-date-field input { width: 100%; padding: 0; border: 0; color: #1d2a44; background: transparent; font-weight: 700; }
.performance-settings-button { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: #0c55d7; }
.performance-summary {
  min-height: 148px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1.45fr repeat(3, 1fr) 1.5fr;
  align-items: stretch;
}
.performance-rate-card,
.performance-stat,
.performance-freeze {
  min-width: 0;
  padding: 22px 28px;
  display: flex;
  align-items: baseline;
  align-content: center;
  flex-wrap: wrap;
  border-right: 1px solid #d8e0ec;
}
.performance-rate-card { display: grid; align-content: center; }
.performance-label { color: #16233c; font-size: 18px; font-weight: 900; }
.performance-label span { color: #60708b; font-size: 14px; }
.performance-rate-card strong { color: #1458d7; font-size: 58px; line-height: 1.08; letter-spacing: -.04em; }
.performance-stat { justify-content: center; }
.performance-stat span { width: 100%; color: #17243d; font-size: 18px; font-weight: 900; text-align: center; }
.performance-stat strong { color: #101d39; font-size: 48px; line-height: 1; }
.performance-stat small { margin-left: 8px; color: #34435f; font-size: 17px; }
.performance-stat.is-success strong { color: #13935c; }
.performance-stat.is-danger strong { color: #db273d; }
.performance-freeze {
  border-right: 0;
  display: grid;
  align-content: center;
  gap: 16px;
}
.performance-freeze strong { color: #12935b; font-size: 17px; }
.performance-freeze span { color: #65748d; font-size: 14px; }
.performance-chart-grid { display: grid; grid-template-columns: 1fr 1.14fr; gap: 8px; margin-bottom: 8px; }
.performance-chart-panel { min-height: 290px; padding: 18px 24px 16px; }
.performance-chart-panel h4,
.performance-table-head h4 { margin: 0; color: #11203b; font-size: 16px; }
.performance-chart-panel > p { margin: 8px 0 0; color: #67758c; font-size: 11px; }
.performance-line-chart { height: 225px; margin-top: 12px; }
.performance-line-chart canvas { width: 100%; height: 100%; display: block; }
.performance-stage-chart { min-height: 215px; padding-top: 11px; display: grid; gap: 6px; }
.performance-stage-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 28px; align-items: center; gap: 9px; }
.performance-stage-row span { overflow: hidden; color: #25334e; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.performance-stage-track { height: 9px; overflow: hidden; border-radius: 5px; background: #e6ebf3; }
.performance-stage-fill { height: 100%; border-radius: inherit; background: #165ad8; }
.performance-stage-row.is-critical .performance-stage-fill { background: #e02c3f; }
.performance-stage-row.is-warning .performance-stage-fill { background: #e97800; }
.performance-stage-row strong { color: #15243d; font-size: 12px; }
.performance-table-panel { padding: 0; overflow: hidden; }
.performance-table-head { min-height: 54px; padding: 14px 18px 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.performance-table-head span { color: #68768c; font-size: 11px; }
.performance-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.performance-table th { padding: 8px 9px; color: #293750; background: #eaf1fd; font-size: 11px; text-align: left; white-space: nowrap; }
.performance-table td { padding: 8px 9px; border-bottom: 1px solid #e0e6ef; color: #344158; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-table th:nth-child(1) { width: 48px; }
.performance-table th:nth-child(2) { width: 132px; }
.performance-table th:nth-child(3) { width: 150px; }
.performance-table th:nth-child(4) { width: 62px; }
.performance-table th:nth-child(5) { width: 118px; }
.performance-table th:nth-child(6) { width: 105px; }
.performance-table th:nth-child(7) { width: 100px; }
.performance-table th:nth-child(8) { width: 112px; }
.performance-table th:nth-child(9),
.performance-table th:nth-child(10) { width: 126px; }
.performance-table th:nth-child(11) { width: 58px; }
.performance-table td.is-urge { color: #dc273d; font-weight: 900; }
.performance-table button { padding: 0; border: 0; color: #0b56d5; background: transparent; box-shadow: none; font-size: 11px; font-weight: 900; }
.performance-settings-form { padding: 6px 2px; display: grid; gap: 12px; }
.performance-settings-form fieldset { margin: 0; padding: 14px; display: grid; grid-template-columns: 160px 1fr 1fr; align-items: end; gap: 12px; border: 1px solid var(--line); border-radius: 8px; }
.performance-settings-form legend { padding: 0 6px; color: #17243d; font-weight: 900; }
.performance-settings-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.performance-settings-form input,
.performance-settings-form select { min-height: 38px; }
.performance-settings-note { color: #68768c; font-size: 11px; line-height: 1.7; }

@media (max-width: 1180px) {
  .performance-summary { grid-template-columns: repeat(4, 1fr); }
  .performance-rate-card { grid-column: span 2; }
  .performance-freeze { grid-column: span 2; border-top: 1px solid #d8e0ec; }
  .performance-chart-grid { grid-template-columns: 1fr; }
}
.priority-settings-wide { grid-column: 1 / -1; }
.priority-owner-rules { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.priority-owner-rules p { font-size: 11px; }
.priority-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.priority-log-table { margin: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.priority-log-table table { width: 100%; min-width: 720px; border-collapse: collapse; }
.priority-log-table th,
.priority-log-table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
.priority-log-table th { color: #345077; background: var(--brand-soft); }
.priority-log-table small { display: block; margin-top: 3px; color: var(--muted); }
.priority-log-table button { min-height: 28px; font-size: 10px; }
.priority-receipt-details summary { cursor: pointer; color: var(--brand); font-weight: 800; white-space: nowrap; }
.priority-receipt-details div { min-width: 210px; margin-top: 7px; display: grid; gap: 6px; }
.priority-receipt-details p { margin: 0; padding: 6px 7px; border-radius: 6px; background: var(--brand-soft); }
.priority-receipt-details p strong,
.priority-receipt-details p span { display: block; }
.priority-receipt-details p span { margin-top: 2px; color: var(--muted); }
.priority-error-state p { margin: 5px 0 12px; }

/* 配件订单跟踪 */
.accessory-kpi-grid { grid-template-columns: repeat(5, minmax(160px, 1fr)); }
.accessory-kpi-grid .priority-kpi {
  width: 100%;
  min-height: 104px;
  text-align: left;
  cursor: pointer;
}
.accessory-kpi-grid .priority-kpi.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(9, 72, 180, 0.12); }
.accessory-kpi-grid .accent-purple { border-top-color: #8a5cf5; }
.accessory-kpi-grid .accent-purple strong { color: #7046dc; }
.accessory-risk-panel { margin-top: 14px; padding: 14px 16px 16px; }
.accessory-risk-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.accessory-risk-band button {
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: #253550;
  cursor: pointer;
}
.accessory-risk-band button:last-child { border-right: 0; }
.accessory-risk-band button strong { font-size: 23px; }
.accessory-risk-band button.is-selected { box-shadow: inset 0 0 0 2px currentColor; }
.accessory-risk-band .risk-overdue { color: var(--red); background: #fff7f7; }
.accessory-risk-band .risk-due { color: var(--orange); background: #fffaf3; }
.accessory-risk-band .risk-soon { color: #b27600; background: #fffdf3; }
.accessory-risk-band .risk-normal { color: var(--green); background: #f6fcf8; }
.accessory-command-grid { margin-top: 14px; grid-template-columns: minmax(0, 1fr) 272px; }
.accessory-side-column { display: grid; align-content: start; gap: 14px; }
.accessory-policy-chip { padding: 5px 9px; border: 1px solid #c7d7f5; border-radius: 999px; color: var(--brand); background: var(--brand-soft); font-size: 10px; font-weight: 900; }
.accessory-table-wrap { max-height: 544px; }
.accessory-table { min-width: 1120px; }
.accessory-table th:nth-child(1) { width: 8%; }
.accessory-table th:nth-child(2) { width: 10%; }
.accessory-table th:nth-child(3) { width: 8%; }
.accessory-table th:nth-child(4) { width: 9%; }
.accessory-table th:nth-child(5) { width: 11%; }
.accessory-table th:nth-child(6) { width: 6%; }
.accessory-table th:nth-child(7) { width: 7%; }
.accessory-table th:nth-child(8) { width: 6%; }
.accessory-table th:nth-child(9) { width: 9%; }
.accessory-table th:nth-child(10) { width: 9%; }
.accessory-table th:nth-child(11) { width: 10%; }
.accessory-table th:nth-child(12) { width: 7%; }
.accessory-table th,
.accessory-table td { padding: 10px 8px; font-size: 10px; vertical-align: middle; }
.accessory-table tbody tr { cursor: pointer; }
.accessory-table tbody tr.is-priority { background: #fbfdff; box-shadow: inset 3px 0 0 var(--brand); }
.accessory-risk-tag,
.accessory-state-tag,
.accessory-push-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-weight: 900;
  white-space: nowrap;
}
.accessory-risk-tag.risk-overdue,
.accessory-state-tag.state-cancelled { color: var(--red); background: var(--red-soft); }
.accessory-risk-tag.risk-due-today,
.accessory-state-tag.state-shortage,
.accessory-state-tag.state-exception { color: var(--orange); background: var(--orange-soft); }
.accessory-risk-tag.risk-soon { color: #a66d00; background: #fff4cf; }
.accessory-risk-tag.risk-normal,
.accessory-state-tag.state-complete { color: var(--green); background: var(--green-soft); }
.accessory-risk-tag.risk-unknown { color: #65728a; background: #edf1f6; }
.accessory-state-tag.state-unpicked { color: var(--brand); background: var(--brand-soft); }
.accessory-state-tag.state-pack { color: #7046dc; background: #f3edff; }
.accessory-shortage { color: var(--red); font-weight: 900; }
.accessory-stock-ok { color: var(--green); font-weight: 900; }
.accessory-owner { display: block; max-width: 126px; font-weight: 900; }
.accessory-warning { display: block; margin-top: 3px; color: var(--orange); font-size: 8px; }
.accessory-action { display: flex; align-items: center; gap: 6px; }
.accessory-action button { min-height: 26px; padding: 4px 8px; font-size: 9px; }
.accessory-push-tag { color: #65728a; background: #f3f5f8; }
.accessory-push-tag.push-auto { color: var(--green); background: var(--green-soft); }
.accessory-push-tag.push-wait { color: var(--orange); background: var(--orange-soft); }
.accessory-count-badge { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; color: var(--red); background: var(--red-soft); font-weight: 900; }
.accessory-rules-panel { padding: 14px; }
.accessory-rule { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line-soft); }
.accessory-rule:first-of-type { border-top: 0; }
.accessory-rule i { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--brand); }
.accessory-rule .overdue-dot { background: var(--red); }
.accessory-rule .normal-dot { background: var(--green); }
.accessory-rule .cancel-dot { background: #a85454; }
.accessory-rule span { display: grid; gap: 3px; }
.accessory-rule small { color: var(--muted); line-height: 1.45; }
.accessory-detail-dialog > section { width: min(780px, calc(100vw - 36px)); }
.accessory-push-dialog > section { width: min(520px, calc(100vw - 36px)); }
.accessory-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.accessory-detail-grid article { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.accessory-detail-grid span,
.accessory-detail-grid small { display: block; color: var(--muted); }
.accessory-detail-grid strong { display: block; margin-top: 5px; font-size: 18px; }
.accessory-detail-block { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.accessory-detail-block h4 { margin: 0 0 10px; }
.accessory-detail-block dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
.accessory-detail-block dl div { display: flex; gap: 8px; }
.accessory-detail-block dt { color: var(--muted); }
.accessory-detail-block dd { margin: 0; font-weight: 800; }
.accessory-timeline { display: grid; gap: 8px; }
.accessory-timeline article { padding: 9px 11px; border-left: 3px solid var(--brand); background: var(--soft); }
.accessory-detail-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; }

/* 十环节看板运维 */
.stage-board-ops-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stage-board-ops-kpi {
  min-height: 106px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 8px;
  background: #fff;
}
.stage-board-ops-kpi span { color: #445574; font-weight: 900; }
.stage-board-ops-kpi strong { color: #0d1b33; font-size: 30px; line-height: 1; }
.stage-board-ops-kpi strong small { margin-left: 3px; color: var(--muted); font-size: 13px; }
.stage-board-ops-kpi em { color: var(--muted); font-size: 10px; font-style: normal; }
.stage-board-ops-kpi.is-danger { border-top-color: var(--red); }
.stage-board-ops-kpi.is-danger strong { color: var(--red); }
.stage-board-ops-kpi.is-warning { border-top-color: var(--orange); }
.stage-board-ops-kpi.is-warning strong { color: var(--orange); }
.stage-board-ops-kpi.is-loading { min-height: 106px; background: linear-gradient(90deg, #f4f6fa 25%, #fff 50%, #f4f6fa 75%); background-size: 200% 100%; }
.stage-board-ops-panel,
.stage-board-preview-panel { padding: 0; overflow: hidden; }
.stage-board-ops-head,
.stage-board-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.stage-board-ops-head h3,
.stage-board-preview-head h3 { margin: 0; color: #10213d; font-size: 18px; }
.stage-board-ops-head p,
.stage-board-preview-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.stage-board-ops-actions { display: flex; gap: 8px; }
.stage-board-ops-actions button,
.stage-board-preview-head a { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 12px; }
.stage-board-ops-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: #f6f8fc;
}
.stage-board-ops-card {
  min-width: 0;
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.stage-board-ops-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(9, 72, 180, 0.13); }
.stage-board-ops-card.is-error { border-color: #efb2b8; }
.stage-board-ops-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 9px;
}
.stage-board-ops-card > header div { min-width: 0; display: grid; gap: 2px; }
.stage-board-ops-card > header strong { color: #10213d; font-size: 16px; }
.stage-board-ops-card > header small { color: var(--muted); font-size: 9px; }
.stage-board-ops-card > header > span,
.stage-board-page-status { color: var(--green); font-size: 9px; font-weight: 900; white-space: nowrap; }
.stage-board-page-status i,
.stage-board-device-state > i { width: 7px; height: 7px; display: inline-block; margin-right: 5px; border-radius: 50%; background: currentColor; }
.stage-board-ops-card.is-error > header > span { color: var(--red); }
.stage-board-ops-card.is-error > p { min-height: 68px; margin: 0; padding: 4px 12px 12px; color: var(--red); font-size: 10px; line-height: 1.5; }
.stage-board-ops-card.is-error > button { margin: 0 12px 12px; }
.stage-board-owner {
  min-height: 33px;
  margin: 0;
  padding: 0 12px 9px;
  color: #345077;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}
.stage-board-ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.stage-board-ops-metrics span { min-width: 0; display: grid; gap: 3px; padding: 9px 5px; text-align: center; }
.stage-board-ops-metrics small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.stage-board-ops-metrics strong { color: #15243d; font-size: 17px; }
.stage-board-ops-metrics .is-danger strong { color: var(--red); }
.stage-board-device-state { min-height: 44px; display: flex; align-items: center; padding: 9px 12px; color: var(--green); }
.stage-board-device-state > span { min-width: 0; display: grid; gap: 2px; }
.stage-board-device-state strong { font-size: 10px; }
.stage-board-device-state small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.stage-board-device-state.is-warning { color: var(--orange); background: #fffaf2; }
.stage-board-device-state.is-offline { color: var(--red); background: #fff7f7; }
.stage-board-ops-card footer { display: grid; grid-template-columns: 1fr auto; gap: 7px; padding: 10px 12px 12px; }
.stage-board-ops-card footer button,
.stage-board-ops-card footer a { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 9px; font-size: 9px; }
.stage-board-ops-card footer a,
.stage-board-preview-head a { border: 1px solid var(--line); border-radius: 6px; color: var(--brand); background: #fff; font-weight: 900; text-decoration: none; }
.stage-board-ops-loading,
.stage-board-ops-error { grid-column: 1 / -1; min-height: 150px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.stage-board-ops-error strong { color: var(--red); }
.stage-board-ops-error p { margin: 0; }
.stage-board-preview-panel { margin-top: 14px; }
.stage-board-preview-head > div { min-width: 0; }
.stage-board-preview-head > div > span { color: var(--brand); font-size: 9px; font-weight: 900; }
.stage-board-preview-frame-wrap { aspect-ratio: 16 / 9; min-height: 620px; background: #e8edf5; }
.stage-board-preview-frame-wrap iframe { width: 100%; height: 100%; display: block; border: 0; background: #fff; }

@media (max-width: 1500px) {
  .priority-kpi-grid { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .accessory-kpi-grid { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
  .priority-stage-health { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .stage-board-ops-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1260px) {
  html, body { min-width: 980px; }
  .app-shell { grid-template-columns: 118px minmax(0, 1fr); }
  .priority-command-grid { grid-template-columns: 1fr; }
  .priority-interventions { max-height: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .priority-stage-health { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
  .priority-table-wrap { max-height: 520px; }
  .stage-board-ops-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-board-preview-frame-wrap { min-height: 520px; }
}

@media (max-width: 720px) {
  .login-shell {
    padding: 108px 16px 28px;
    background-size: auto 100vh;
    background-attachment: scroll;
  }
  .login-shell::before {
    top: 108px;
    width: 100%;
  }
  .login-card {
    width: calc(100% + 32px);
    min-width: 0;
    min-height: calc(100vh - 108px);
    max-width: none;
    margin: 0 -16px -28px;
    padding: 28px 42px 26px;
    gap: 17px;
    background: #071522;
    box-shadow: none;
  }
  .login-brand h1 { font-size: 64px; line-height: 0.88; }
  .login-brand p { margin-top: 9px; font-size: 15px; }
  .login-signal-line { width: 108px; margin: 15px auto 5px; }
  .login-card > label:not(.remember-row) { gap: 7px; font-size: 15px; }
  .login-card input:not([type="checkbox"]) { min-height: 50px; font-size: 16px; }
  .remember-row { font-size: 15px !important; }
  .login-card > button { min-height: 58px; font-size: 22px; }
  html.public-accessory-mode,
  body.public-accessory-mode { min-width: 0; }
  .public-accessory-mode .app-shell { display: block; }
  .public-accessory-mode .sidebar { display: none; }
  .public-accessory-mode .topbar { min-height: 0; padding: 14px 12px 10px; gap: 12px; }
  .public-accessory-mode .topbar-main { align-items: flex-start; gap: 10px; }
  .public-accessory-mode .page-heading { flex: 1; flex-wrap: wrap; gap: 7px 10px; }
  .public-accessory-mode .page-heading > h1 { font-size: 23px; }
  .public-accessory-mode .heading-divider { height: 27px; }
  .public-accessory-mode .page-heading h2 { font-size: 17px; }
  .public-accessory-mode .priority-sync-line { width: 100%; flex-wrap: wrap; gap: 6px 10px; }
  .public-accessory-mode .topbar-actions { display: none; }
  .public-accessory-mode .priority-toolbar { overflow-x: auto; justify-content: flex-start; padding-bottom: 3px; }
  .public-accessory-mode .priority-toolbar select,
  .public-accessory-mode .priority-toolbar button { flex: 0 0 auto; }
  .public-accessory-mode .view { padding: 10px; }
  .public-accessory-mode .accessory-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .public-accessory-mode .accessory-kpi-grid .priority-kpi { min-height: 86px; padding: 12px; }
  .public-accessory-mode .accessory-kpi-grid .priority-kpi:last-child { grid-column: 1 / -1; }
  .public-accessory-mode .accessory-risk-panel { margin-top: 10px; padding: 12px; }
  .public-accessory-mode .accessory-risk-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-accessory-mode .accessory-risk-band button:nth-child(2) { border-right: 0; }
  .public-accessory-mode .accessory-risk-band button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .public-accessory-mode .accessory-command-grid { margin-top: 10px; grid-template-columns: 1fr; }
  .public-accessory-mode .accessory-table-wrap { max-height: none; overflow-x: auto; }
  .public-accessory-mode .accessory-table tbody tr { cursor: default; }
  .public-accessory-mode .accessory-side-column { gap: 10px; }
}

@keyframes v3LoginRail {
  from { transform: scaleX(0); opacity: 0; }
  20% { opacity: 1; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes v3LoginBusy {
  from { background: #0939b9; }
  to { background: #718ac5; border-color: #8ea7df; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
.accessory-stock-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}
