:root {
  --blue-950: #0b2f57;
  --blue-900: #0d3f73;
  --blue-800: #155a9f;
  --blue-700: #1890ff;
  --blue-600: #2f78c4;
  --blue-500: #4d9eed;
  --blue-100: #e6f4ff;
  --blue-050: #f5faff;
  --panel-soft: #f5faff;
  --floor-bg: #f8fafc;
  --floor-card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #d6e1ee;
  --line-dark: #b6c7dc;
  --paper: #ffffff;
  --bg: #f8fafc;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #10b981;
  --idle: #94a3b8;
}

/* V1 real-backend layer: keeps the industrial shell, replaces prototype data with API-driven controls. */
.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 440px);
  gap: 18px;
  min-height: 100vh;
  padding: 20px;
  background: var(--floor-bg);
}

.login-hero,
.login-panel-v1 {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 22px;
}

.login-hero {
  display: grid;
  align-content: center;
  min-height: 420px;
}

.login-hero h1 {
  color: var(--blue-950);
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
}

.login-hero p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.6;
}

.login-panel-v1,
.field-stack {
  display: grid;
  gap: 12px;
}

.field-stack label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field-stack input,
.inline-industrial-form input,
.inline-industrial-form select,
.scan-line input,
.checkin-actions select {
  min-height: 42px;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}

.role-grid {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.dev-login-helper {
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px;
}

.dev-login-helper summary {
  cursor: pointer;
  color: var(--blue-950);
  font-weight: 900;
}

.dev-login-helper .role-grid {
  margin-top: 10px;
}

.role-card {
  display: grid;
  gap: 3px;
  min-height: 62px;
  border: 1px solid var(--line);
  background: var(--blue-050);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.role-card strong {
  color: var(--blue-950);
}

.role-card span,
.role-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.login-health,
.system-banner,
.toast {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
}

.login-health,
.system-banner {
  display: grid;
  gap: 4px;
}

.login-health strong,
.system-banner strong {
  color: var(--blue-950);
}

.login-health span,
.system-banner span,
.toast {
  color: var(--muted);
  line-height: 1.45;
}

.login-health.warn,
.system-banner.warn {
  border-left: 5px solid var(--warn);
  background: #fffbeb;
}

.login-health.ok,
.system-banner.ok,
.toast.ok {
  border-left: 5px solid var(--ok);
  background: #f0fdf4;
}

.login-health.danger,
.system-banner.danger,
.toast.danger {
  border-left: 5px solid var(--danger);
  background: #fffafa;
  color: var(--ink);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-workbench-body {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-workbench-body .sidebar {
  min-height: auto;
}

.admin-workbench-main {
  display: grid;
  gap: 14px;
}

.inline-industrial-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.empty-card {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line-dark);
  background: #fff;
  padding: 16px;
}

.empty-card strong {
  color: var(--blue-950);
}

.empty-card span {
  color: var(--muted);
}

.step-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.step-strip span {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 900;
}

.step-strip span.done {
  background: #ecfdf3;
  color: var(--ok);
}

.step-strip span.active {
  background: var(--blue-100);
  color: var(--blue-950);
  border-color: var(--blue-700);
}

.floor-console {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--blue-050);
  padding: 18px;
}

.floor-main h2 {
  color: var(--blue-950);
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1.05;
}

.scan-line,
.checkin-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.checkin-actions {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.scan-line input {
  min-height: 58px;
  font-size: 22px;
  font-weight: 900;
}

.scan-result {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-dark);
  background: #fff;
  padding: 14px;
}

.scan-result strong {
  color: var(--blue-950);
  font-size: 28px;
}

.scan-result span {
  color: var(--muted);
}

.scan-result.danger {
  border-left: 5px solid var(--danger);
  background: #fffafa;
}

.danger-note {
  border-color: var(--danger);
  background: #fffafa;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue-700);
  background: #fff;
  padding: 10px 12px;
}

.timeline-item strong {
  color: var(--blue-950);
}

.timeline-item span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .login-page {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .login-hero {
    min-height: auto;
  }

  .scan-line,
  .checkin-actions {
    grid-template-columns: 1fr;
  }

  .mobile-bottom-nav {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}

:root {
  --primary: var(--blue-700);
}

.security-details {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.security-details summary {
  cursor: pointer;
  color: var(--blue-950);
  font-size: 13px;
  font-weight: 900;
  padding: 9px 14px;
}

.password-strip {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(150px, 220px) auto;
  gap: 8px;
  padding: 10px 14px;
}

.password-strip input {
  min-height: 36px;
  border: 1px solid var(--line);
  padding: 0 9px;
}

@media (max-width: 760px) {
  .password-strip {
    grid-template-columns: 1fr;
  }
}

/* 最新 Pencil 设计稿同步层：老板看板 V11 / 计划排产 V7 / 订单 V7 / 报表 V2E */
.app-topbar {
  grid-template-columns: minmax(220px, 260px) minmax(140px, 180px) minmax(180px, 220px) auto;
}

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

.command-card {
  display: grid;
  gap: 8px;
  min-height: 122px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue-700);
  background: #fff;
  padding: 12px;
}

.command-card.main {
  background: var(--blue-050);
}

.command-card.danger {
  border-top-color: var(--danger);
  background: #fffafa;
}

.command-card.warn {
  border-top-color: var(--warn);
  background: #fffbeb;
}

.command-card span,
.task-group-card span,
.exception-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.command-card strong {
  color: var(--blue-950);
  font-size: 24px;
  line-height: 1.15;
}

.command-card em,
.task-group-card p,
.exception-card p,
.rule-box span,
.current-next em,
.more-line {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.process-route {
  display: grid;
  gap: 8px;
}

.process-node {
  display: grid;
  grid-template-columns: 44px minmax(84px, 0.7fr) minmax(84px, 0.8fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--idle);
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.process-node.normal {
  border-left-color: var(--ok);
}

.process-node.warn {
  border-left-color: var(--warn);
  background: #fffbeb;
}

.process-node.danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.process-index {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-dark);
  background: var(--blue-050);
  color: var(--blue-950);
  font-weight: 900;
}

.process-node strong {
  color: var(--blue-950);
  font-size: 16px;
}

.process-node em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
}

.process-node small {
  color: var(--muted);
  line-height: 1.35;
}

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

.current-next > div,
.rule-box {
  display: grid;
  gap: 8px;
  min-height: 108px;
  border: 1px solid var(--line);
  background: var(--blue-050);
  padding: 12px;
}

.current-next strong,
.rule-box strong {
  color: var(--blue-950);
  font-size: 26px;
  line-height: 1.1;
}

.schedule-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.schedule-overview > div {
  display: grid;
  gap: 8px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue-700);
  background: #fff;
  padding: 12px;
}

.schedule-overview > div.danger {
  border-top-color: var(--danger);
  background: #fffafa;
}

.schedule-overview span,
.recommendation-card span,
.plan-order-line span,
.blocked-plan-item span,
.manual-schedule-panel summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-overview strong {
  color: var(--blue-950);
  font-size: 28px;
  line-height: 1.05;
}

.schedule-overview em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.4;
}

.recommendation-panel {
  border-top: 5px solid var(--blue-700);
}

.recommendation-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 0.9fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--blue-050);
  padding: 14px;
}

.recommendation-card.danger {
  border-color: var(--danger);
  background: #fffafa;
}

.recommendation-card strong {
  display: block;
  margin-top: 6px;
  color: var(--blue-950);
  font-size: 36px;
  line-height: 1;
}

.recommendation-card p {
  margin-top: 8px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.4;
}

.schedule-action {
  min-width: 150px;
  white-space: normal;
}

.schedule-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.plan-group-list {
  display: grid;
  gap: 10px;
}

.plan-group-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue-700);
  background: #fff;
  padding: 12px;
}

.plan-group-card.danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.plan-group-card.selected {
  outline: 2px solid var(--blue-700);
  outline-offset: -2px;
}

.plan-group-card .schedule-action {
  justify-self: start;
}

.plan-order-lines {
  display: grid;
  gap: 6px;
}

.plan-order-line {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(64px, 0.3fr) minmax(110px, 0.45fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.plan-order-line.danger {
  border-color: var(--danger);
  background: #fffafa;
}

.plan-order-line strong {
  color: var(--blue-950);
  line-height: 1.35;
}

.blocked-plan-panel {
  border-left: 5px solid var(--warn);
}

.blocked-plan-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.blocked-plan-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(180px, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  background: #fffbeb;
  padding: 10px;
}

.blocked-plan-item strong {
  color: var(--blue-950);
}

.manual-schedule-panel {
  border: 1px solid var(--line);
  background: #fff;
}

.manual-schedule-panel summary {
  cursor: pointer;
  padding: 12px;
}

.manual-schedule-panel .inline-industrial-form {
  border-top: 1px solid var(--line);
  padding: 12px;
}

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

.task-group-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue-700);
  background: #fff;
  padding: 12px;
}

.task-group-card.danger {
  border-top-color: var(--danger);
  background: #fffafa;
}

.task-group-card.warn {
  border-top-color: var(--warn);
  background: #fffbeb;
}

.task-group-card.idle {
  border-top-color: var(--idle);
  background: #f8fafc;
}

.task-group-card.selected {
  outline: 2px solid var(--blue-700);
  outline-offset: -2px;
}

.task-group-head,
.order-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.task-group-head strong {
  color: var(--blue-950);
  font-size: 28px;
  line-height: 1;
}

.task-group-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.task-group-meta span {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 8px;
}

.exception-list {
  display: grid;
  gap: 10px;
}

.exception-list.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.exception-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--warn);
  background: #fffbeb;
  padding: 12px;
}

.exception-card.danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.exception-card strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-950);
  line-height: 1.35;
}

.exception-card .btn {
  margin-top: 8px;
}

.exception-resolution-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.exception-readonly-note {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.exception-readonly-note strong {
  color: var(--blue-950);
}

.exception-readonly-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.owner-issue-log {
  display: grid;
  gap: 8px;
}

.owner-issue-log-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) minmax(180px, 0.9fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--warn);
  background: #ffffff;
  padding: 10px;
}

.owner-issue-log-row.danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.owner-issue-log-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.owner-issue-log-row strong,
.owner-issue-log-row em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.owner-issue-log-row strong {
  color: var(--blue-950);
}

.owner-issue-log-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.order-summary-list {
  display: grid;
  gap: 10px;
}

.order-summary-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue-700);
  background: #fff;
  padding: 12px;
}

.order-summary-card.warn {
  border-left-color: var(--warn);
  background: #fffbeb;
}

.order-summary-card.danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.order-summary-head strong {
  color: var(--blue-950);
  font-size: 17px;
}

.order-summary-head p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.worker-skill-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.worker-skill-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.worker-skill-head strong {
  color: var(--blue-950);
  font-size: 13px;
}

.worker-skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.worker-skill-option {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 8px;
  font-size: 12px;
  font-weight: 800;
}

.worker-skill-option input {
  flex: 0 0 auto;
}

.worker-skill-option span {
  min-width: 0;
}

.size-detail-list {
  display: grid;
  gap: 6px;
}

.size-detail-row {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(80px, auto) minmax(100px, auto) minmax(120px, auto) minmax(160px, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.size-detail-row strong {
  color: var(--blue-950);
}

.size-detail-row em {
  color: var(--muted);
  font-style: normal;
}

.more-line {
  border: 1px dashed var(--line-dark);
  background: #fff;
  padding: 8px;
}

.detail-page .page-head {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.detail-hero {
  display: grid;
  gap: 8px;
  border-top: 4px solid var(--blue-700);
  background: var(--blue-050);
}

.detail-hero.danger {
  border-top-color: var(--danger);
  background: #fffafa;
}

.detail-hero.warn {
  border-top-color: var(--warn);
  background: #fffbeb;
}

.detail-hero span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-hero strong {
  color: var(--blue-950);
  font-size: 28px;
  line-height: 1.15;
}

.detail-hero em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-list > div {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.detail-list strong {
  color: var(--blue-950);
}

.detail-list span {
  color: var(--muted);
  line-height: 1.45;
}

.status-sample-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.state-page .detail-hero {
  min-height: 122px;
}

.size-detail-row.editable {
  grid-template-columns: minmax(70px, auto) minmax(90px, 1fr) minmax(90px, 1fr) minmax(130px, 1.2fr) minmax(120px, 1fr);
}

.size-detail-row.editable label {
  gap: 4px;
}

.size-detail-row.editable input,
.size-detail-row.editable select {
  min-height: 34px;
  padding: 6px 8px;
}

@media (max-width: 1180px) {
  .app-topbar {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 180px);
  }

  .user-box {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
  }

  .command-grid,
  .task-group-grid,
  .schedule-overview,
  .exception-list.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recommendation-card {
    grid-template-columns: 1fr;
  }

  .exception-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .command-grid,
  .task-group-grid,
  .schedule-overview,
  .current-next,
  .exception-list.compact {
    grid-template-columns: 1fr;
  }

  .process-node,
  .plan-order-line,
  .blocked-plan-item,
  .size-detail-row,
  .size-detail-row.editable,
  .detail-list > div,
  .task-group-head,
  .order-summary-head {
    grid-template-columns: 1fr;
  }

  .process-index {
    width: 100%;
    justify-content: start;
    padding-left: 8px;
  }

  .command-card strong,
  .schedule-overview strong,
  .recommendation-card strong,
  .current-next strong,
  .task-group-head strong {
    font-size: 22px;
  }

  .schedule-action,
  .plan-group-card .schedule-action {
    width: 100%;
    justify-self: stretch;
  }
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-header {
  background: var(--blue-950);
  color: #fff;
  border-bottom: 3px solid var(--blue-700);
}

.app-topbar {
  display: grid;
  grid-template-columns: 250px minmax(180px, 1fr) auto;
  align-items: stretch;
  min-height: 66px;
  background: var(--blue-950);
  color: #fff;
}

.brand {
  padding: 12px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.top-focus {
  display: grid;
  align-content: center;
  padding: 10px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.top-focus span {
  font-size: 12px;
  opacity: 0.72;
}

.top-focus strong {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  color: currentColor;
  opacity: 0.72;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 19px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  color: var(--blue-950);
}

h3 {
  font-size: 16px;
  color: var(--blue-950);
}

.user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  min-width: 0;
}

.demo-btn {
  border-color: #fff;
  background: #fff;
  color: var(--blue-950);
}

.demo-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  background: #07335f;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
}

.secondary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.demo-link {
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.demo-link.active,
.demo-link:hover {
  background: #fff;
  color: var(--blue-950);
}

.top-menu {
  position: relative;
}

.user-box > .top-menu:not(.settings-menu) {
  display: none;
}

.top-link {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 8px 10px;
  font-weight: 800;
  white-space: nowrap;
}

.top-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: 280px;
  border: 1px solid var(--blue-800);
  background: #fff;
  color: var(--ink);
  padding: 12px;
  box-shadow: 0 14px 26px rgba(8, 40, 70, 0.2);
}

.top-menu:hover .top-dropdown,
.top-menu:focus-within .top-dropdown {
  display: grid;
  gap: 8px;
}

.top-dropdown p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-dropdown .security-details {
  border: 1px solid var(--line);
}

.settings-dropdown .password-strip {
  grid-template-columns: 1fr;
  padding: 10px;
}

.settings-actions {
  justify-content: stretch;
}

.settings-actions .btn {
  flex: 1;
}

.settings-button {
  border: 1px solid var(--blue-800);
  background: #fff;
  color: var(--blue-950);
}

.settings-button.active {
  background: var(--blue-800);
  color: #fff;
}

.settings-page-actions {
  justify-content: flex-start;
}

.settings-page-actions .btn {
  min-width: 140px;
}

.notice-list {
  display: grid;
  gap: 6px;
}

.notice-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 6px 8px;
  border: 1px solid var(--line);
  background: var(--blue-050);
  padding: 8px;
}

.notice-item strong {
  color: var(--blue-950);
}

.notice-item span {
  color: var(--ink);
  line-height: 1.4;
}

.notice-item em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.role-tag,
.badge,
.status-label {
  display: inline-block;
  min-width: 68px;
  min-height: 26px;
  padding: 5px 10px;
  background: var(--blue-700);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  vertical-align: middle;
}

.badge.danger {
  background: var(--danger);
}

.badge.warn-bg {
  background: var(--warn);
}

.badge.idle-bg {
  background: var(--idle);
}

.app-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 0;
}

.app-body.single-body {
  grid-template-columns: 1fr;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 10px;
}

.nav-group-title {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sidebar .nav-group-title:first-child {
  margin-top: 2px;
  color: var(--blue-950);
  font-size: 14px;
  font-weight: 900;
}

.nav-btn {
  width: 100%;
  min-height: 46px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  padding: 8px 11px;
}

.nav-btn.active,
.nav-btn:hover {
  border-color: var(--blue-700);
  background: var(--blue-100);
  color: var(--blue-950);
}

.nav-btn.is-p1 {
  border-style: dashed;
  color: var(--muted);
}

.nav-btn small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.nav-btn.active small,
.nav-btn:hover small {
  color: var(--blue-900);
}

.sidebar-note {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--blue-050);
  padding: 10px;
}

.sidebar-note strong {
  color: var(--blue-950);
}

.sidebar-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 14px;
}

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

.page-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 38px;
  height: 38px;
  border: 1px solid var(--blue-800);
  background: var(--blue-800);
  color: #fff;
  padding: 8px 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.btn.secondary {
  background: #fff;
  color: var(--blue-900);
  border-color: var(--blue-800);
}

.btn.secondary:hover,
.btn:hover {
  border-color: var(--blue-700);
  filter: brightness(0.98);
}

.btn.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.btn.floor {
  min-height: 68px;
  height: 68px;
  font-size: 18px;
  width: 100%;
}

.panel > .btn,
.panel > p + .btn {
  margin-top: 10px;
}

.grid-3 > .panel .btn {
  min-width: 118px;
}

.dashboard-section {
  margin-top: 12px;
}

.dashboard-overview {
  margin-bottom: 12px;
}

.dashboard-overview .size-overview,
.dashboard-overview .grid-4 {
  margin-bottom: 0 !important;
}

.dashboard-overview .size-overview + .grid-4 {
  margin-top: 10px;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.focus-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue-700);
  background: #fff;
  padding: 12px;
}

.focus-card.warn {
  border-top-color: var(--warn);
  background: #fffbeb;
}

.focus-card.danger {
  border-top-color: var(--danger);
  background: #fffafa;
}

.focus-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.focus-card strong {
  color: var(--blue-950);
  font-size: 20px;
  line-height: 1.25;
}

.focus-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.process-light-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.process-light {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 4px 8px;
  align-items: start;
  min-height: 86px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--idle);
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.process-light.normal {
  border-left-color: var(--ok);
}

.process-light.warn {
  border-left-color: var(--warn);
  background: #fffbeb;
}

.process-light.danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.process-light.idle {
  border-left-color: var(--idle);
  background: #f8fafc;
}

.light-dot {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 1px solid currentColor;
  background: var(--idle);
}

.process-light.normal .light-dot {
  background: var(--ok);
}

.process-light.warn .light-dot {
  background: var(--warn);
}

.process-light.danger .light-dot {
  background: var(--danger);
}

.process-light strong,
.process-light em,
.process-light small {
  grid-column: 2;
  min-width: 0;
}

.process-light strong {
  color: var(--blue-950);
  font-size: 16px;
}

.process-light em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
}

.process-light small {
  color: var(--muted);
  line-height: 1.35;
}

.workspace-page {
  display: grid;
  gap: 12px;
}

.workspace-summary .grid-4 {
  margin-bottom: 0 !important;
}

.workspace-filter {
  margin-bottom: 0 !important;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.workbench-main {
  min-width: 0;
}

.workbench-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.dashboard-main-grid {
  grid-template-columns: minmax(0, 1.9fr) minmax(340px, 0.85fr);
}

.dashboard-decision-rail {
  align-content: start;
}

.board-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.board-footnote span {
  border: 1px solid var(--line);
  background: var(--blue-050);
  color: var(--muted);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

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

.compact-cards {
  display: grid;
  gap: 8px;
}

.compact-cards > div {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.compact-cards strong,
.compact-cards span {
  display: block;
}

.compact-cards strong {
  color: var(--blue-950);
}

.compact-cards span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.compact-cards .btn {
  margin-top: 8px;
}

.size-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.size-card {
  min-height: 76px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue-700);
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.size-card strong,
.size-card span,
.size-card em {
  display: block;
}

.size-card strong {
  color: var(--blue-950);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.size-card span {
  margin-top: 4px;
  font-weight: 900;
}

.size-card em {
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.size-card.danger {
  border-top-color: var(--danger);
  background: #fffafa;
}

.size-card.idle {
  border-top-color: var(--idle);
  background: #f8fafc;
}

.board-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  border: 1px solid var(--blue-800);
  background: #fff;
}

.board-tabs button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--blue-800);
  background: #fff;
  color: var(--blue-900);
  padding: 7px 12px;
  font-weight: 900;
}

.board-tabs button:last-child {
  border-right: 0;
}

.board-tabs button.active {
  background: var(--blue-800);
  color: #fff;
}

.order-track-board {
  display: grid;
  gap: 10px;
}

.order-progress-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue-700);
  background: #fff;
  padding: 12px;
}

.order-progress-card.is-risk {
  border-left-color: var(--danger);
  background: #fffafa;
}

.order-progress-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.order-progress-head strong {
  color: var(--blue-950);
  font-size: 16px;
}

.order-progress-head p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.step-strip {
  display: grid;
  grid-template-columns: repeat(11, minmax(46px, 1fr));
  gap: 4px;
  margin-top: 10px;
}

.step {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.step small {
  display: block;
  font-size: 10px;
  font-weight: 800;
}

.step.done {
  background: #eafaf3;
  color: #087a53;
  border-color: #9ee4c4;
}

.step.doing {
  background: var(--blue-100);
  color: var(--blue-950);
  border-color: var(--blue-700);
}

.step.end {
  background: #fff0f0;
  color: var(--danger);
  border-color: var(--danger);
}

.order-progress-foot {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.order-progress-foot span,
.order-progress-foot em {
  font-weight: 900;
}

.order-progress-foot em {
  color: var(--muted);
  font-style: normal;
}

.timeline-row .row-tag,
.status-label,
.badge {
  user-select: none;
}

.timeline-row .row-tag {
  justify-self: start;
}


.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 12px;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

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

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

.panel,
.metric,
.login-card,
.floor-panel {
  background: var(--paper);
  border: 1px solid var(--line);
}

.panel,
.login-card {
  padding: 13px;
}

.metric {
  min-height: 96px;
  padding: 12px;
  border-top: 4px solid var(--blue-700);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.metric.danger {
  border-top-color: var(--danger);
}

.metric.warn {
  border-top-color: var(--warn);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: #eef6ff;
  color: var(--blue-950);
  text-align: left;
  font-weight: 900;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 9px;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: #f8fbff;
}

.clickable-row,
.clickable-card {
  cursor: pointer;
}

.clickable-row:hover,
.clickable-card:hover {
  outline: 2px solid var(--blue-700);
  outline-offset: -2px;
  background: var(--blue-050);
}

.process-name {
  color: var(--blue-950);
  font-weight: 900;
}

.progress-track {
  height: 14px;
  background: #edf4fb;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  background: var(--blue-700);
}

.status-normal,
.ok {
  background: var(--ok);
}

.status-warn,
.warn-bg {
  background: var(--warn);
}

.status-danger,
.danger-bg {
  background: var(--danger);
}

.status-idle,
.idle-bg {
  background: var(--idle);
}

.alert-list,
.timeline,
.order-cards,
.report-list,
.permission-list {
  display: grid;
  gap: 8px;
}

.alert-item,
.timeline-row,
.order-card,
.report-row,
.permission-row {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.alert-item {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(260px, 1fr) minmax(90px, auto);
  gap: 10px;
  border-left: 5px solid var(--danger);
  background: #fffafa;
}

.alert-item.warn {
  border-left-color: var(--warn);
  background: #fffbeb;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(110px, auto) minmax(220px, 1fr) minmax(78px, auto);
  gap: 10px;
  align-items: center;
}

.timeline-row .row-tag {
  border: 1px solid var(--line);
  background: #eef6ff;
  color: var(--blue-900);
  text-align: center;
  min-width: 68px;
  min-height: 26px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

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

.filter-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  background: #fff;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-700);
}

.toast {
  margin-top: 10px;
  border: 1px solid var(--ok);
  background: #eefaf4;
  color: var(--ok);
  padding: 9px 10px;
  font-weight: 800;
}

.toast.warn {
  border-color: var(--warn);
  background: #fff8ea;
  color: var(--warn);
}

.global-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  max-width: min(520px, calc(100vw - 24px));
  border: 1px solid var(--blue-800);
  background: #eef6ff;
  color: var(--blue-950);
  padding: 10px 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(8, 40, 70, 0.16);
}

.tour-panel + .global-toast,
.is-tour-mode .global-toast {
  display: none;
}

.login-wrap {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
}

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

.role-card {
  min-height: 116px;
  border: 1px solid var(--line-dark);
  background: #fff;
  padding: 12px;
  text-align: left;
}

.role-card:hover {
  border-color: var(--blue-700);
  background: var(--blue-050);
}

.role-card strong {
  display: block;
  color: var(--blue-950);
  font-size: 18px;
}

.role-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.password-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--blue-050);
  padding: 12px;
}

.password-panel p {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.floor-page {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 14px;
}

.floor-page h2,
.floor-page h3,
.floor-page .process-name {
  color: var(--blue-950);
}

.floor-page .page-head p,
.floor-page label {
  color: var(--muted);
}

.floor-panel {
  background: var(--floor-card);
  border-color: var(--line);
  padding: 14px;
}

.floor-page input,
.floor-page select,
.floor-page textarea {
  background: #fff;
  border-color: var(--line-dark);
  color: var(--ink);
}

.station-card {
  display: grid;
  gap: 12px;
  border: 2px solid var(--blue-700);
  background: var(--blue-050);
  padding: 14px;
}

.station-now {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.station-now strong {
  display: block;
  font-size: 32px;
}

.big-number {
  font-size: 44px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.scan-result {
  display: none;
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--blue-050);
  padding: 12px;
}

.scan-result.is-visible {
  display: block;
}

.report-row {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  gap: 10px;
  align-items: center;
}

.mini-bar {
  height: 18px;
  background: #dce9f6;
  border: 1px solid var(--line-dark);
}

.mini-bar > span {
  display: block;
  height: 100%;
  background: var(--blue-700);
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(140px, auto) minmax(260px, 1fr);
  gap: 10px;
  align-items: start;
}

.permission-row > *,
.timeline-row > *,
.alert-item > *,
.report-row > * {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.45;
}

.dashboard-ops .permission-row {
  grid-template-columns: minmax(80px, auto) minmax(130px, auto) minmax(300px, 1fr);
}

.dashboard-ops .timeline-row {
  grid-template-columns: minmax(86px, auto) minmax(90px, auto) minmax(240px, 1fr) minmax(70px, auto);
}

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.status-action {
  min-height: 26px;
  border: 1px solid var(--blue-800);
  background: #fff;
  color: var(--blue-900);
  padding: 4px 8px;
  font-weight: 800;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(11, 47, 87, 0.38);
}

.modal-box {
  width: min(520px, 100%);
  border: 2px solid var(--blue-800);
  background: #fff;
  padding: 16px;
  box-shadow: 0 18px 36px rgba(8, 40, 70, 0.28);
}

.modal-box p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.modal-detail {
  margin-top: 12px;
  border-left: 5px solid var(--warn);
  background: #fffbeb;
  padding: 10px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.5;
}

.modal-row {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(160px, 1fr) minmax(120px, auto);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.modal-row + .modal-row {
  margin-top: 6px;
}

.modal-row span,
.modal-row em {
  min-width: 0;
  overflow-wrap: break-word;
}

.modal-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  justify-content: flex-end;
  background: rgba(11, 47, 87, 0.18);
}

.drawer-panel {
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  border-left: 3px solid var(--blue-800);
  background: #fff;
  padding: 16px;
  box-shadow: -14px 0 28px rgba(8, 40, 70, 0.22);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

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

.detail-grid > div {
  border: 1px solid var(--line);
  background: var(--blue-050);
  padding: 10px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--blue-950);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.detail-progress {
  margin: 12px 0;
  height: 18px;
}

.drawer-section {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.drawer-section h4 {
  margin: 0 0 8px;
  color: var(--blue-950);
}

.drawer-section p {
  color: var(--ink);
  line-height: 1.6;
}

.drawer-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #fff;
  padding-top: 12px;
  margin-top: 14px;
}

.tour-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: min(520px, calc(100vw - 24px));
  border: 2px solid var(--blue-700);
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(8, 40, 70, 0.22);
  padding: 14px;
}

.tour-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.tour-text {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  margin-top: 10px;
}

.tour-scenes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.tour-scenes span {
  border: 1px solid var(--line-dark);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  padding: 5px 4px;
  white-space: nowrap;
}

.tour-scenes span.done {
  background: var(--blue-100);
  color: var(--blue-800);
}

.tour-scenes span.active {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: #fff;
}

.tour-progress {
  height: 8px;
  margin: 12px 0;
  border: 1px solid var(--line-dark);
  background: var(--blue-100);
}

.tour-progress span {
  display: block;
  height: 100%;
  background: var(--blue-700);
}

.scene-progress span {
  width: 0;
  animation: tourSceneProgress linear forwards;
}

.tour-panel.is-paused .scene-progress span {
  animation-play-state: paused;
}

.tour-total {
  height: 4px;
  margin: -5px 0 12px;
  background: var(--line);
}

.tour-total span {
  display: block;
  height: 100%;
  background: var(--blue-500);
  transition: width 0.25s ease;
}

.tour-actions {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 6px;
}

.tour-actions .btn {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.tour-highlight {
  position: relative;
  z-index: 20;
  outline: 4px solid #1a8cff;
  outline-offset: -4px;
  box-shadow: 0 0 0 9999px rgba(11, 47, 87, 0.18), 0 0 0 8px rgba(26, 140, 255, 0.16);
  animation: tourPulse 1.2s ease-in-out infinite;
}

.tour-highlight::after {
  content: "当前讲解";
  position: absolute;
  right: 8px;
  top: 8px;
  background: var(--blue-700);
  color: #fff;
  border: 1px solid var(--blue-800);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

@keyframes tourPulse {
  0% {
    outline-color: #1a8cff;
  }
  50% {
    outline-color: #73b9ff;
  }
  100% {
    outline-color: #1a8cff;
  }
}

@keyframes tourSceneProgress {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.mobile-cards {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1180px) {
  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
  }

  .top-focus {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-right: 0;
  }

  .user-box {
    grid-column: 2;
    grid-row: 1;
    padding: 10px 14px;
    border-top: 0;
  }

  .top-menu {
    display: none;
  }

  .settings-menu {
    display: block;
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .nav-btn {
    margin-bottom: 0;
    text-align: center;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .focus-strip,
  .process-light-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .grid-3,
  .grid-2,
  .login-wrap,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-ops .permission-row,
  .dashboard-ops .timeline-row {
    grid-template-columns: minmax(90px, auto) minmax(130px, auto) minmax(260px, 1fr);
  }

  .dashboard-ops .timeline-row .row-tag {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 1180px) {
  .dashboard-ops {
    grid-template-columns: 1fr;
  }

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

  .main > .grid-2 {
    grid-template-columns: 1fr;
  }

  .dashboard-ops .permission-row {
    grid-template-columns: minmax(90px, auto) minmax(140px, auto) minmax(320px, 1fr);
  }

  .dashboard-ops .timeline-row {
    grid-template-columns: minmax(90px, auto) minmax(110px, auto) minmax(320px, 1fr) minmax(78px, auto);
  }

  .alert-item {
    grid-template-columns: minmax(90px, auto) minmax(320px, 1fr) minmax(90px, auto);
  }
}

@media (max-width: 640px) {
  .main {
    padding: 10px 10px 74px;
  }

  .app-topbar {
    grid-template-columns: 1fr;
  }

  .brand,
  .top-focus,
  .user-box {
    grid-column: 1;
  }

  .top-focus {
    grid-row: 2;
  }

  .user-box {
    grid-row: 3;
    justify-content: stretch;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
  }

  .user-box .btn,
  .user-box .role-tag {
    flex: 1 1 130px;
  }

  .grid-4,
  .focus-strip,
  .process-light-grid,
  .role-grid,
  .form-grid,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    border-top: 1px solid var(--blue-800);
    background: #fff;
    box-shadow: 0 -8px 18px rgba(8, 40, 70, 0.12);
  }

  .mobile-bottom-nav button {
    min-height: 56px;
    border: 0;
    border-right: 1px solid var(--line);
    background: #fff;
    color: var(--blue-950);
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
  }

  .mobile-bottom-nav button:last-child {
    border-right: 0;
  }

  .mobile-bottom-nav button.active {
    background: var(--blue-800);
    color: #fff;
  }

  .single-mode .statusbar {
    padding-bottom: 88px;
  }

  .page-head,
  .section-heading,
  .station-now {
    display: grid;
    grid-template-columns: 1fr;
  }

  .desktop-table {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 8px;
  }

  .alert-item,
  .timeline-row,
  .report-row,
  .permission-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 20px;
  }

  .tour-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: 48vh;
    overflow-y: auto;
  }

  .tour-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .statusbar {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .size-overview {
    grid-template-columns: 1fr;
  }

  .board-tabs,
  .order-progress-head,
  .order-progress-foot {
    grid-template-columns: 1fr;
  }

  .board-tabs button {
    border-right: 0;
    border-bottom: 1px solid var(--blue-800);
  }

  .board-tabs button:last-child {
    border-bottom: 0;
  }

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

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

  .drawer-panel {
    width: 100%;
    border-left: 0;
    border-top: 3px solid var(--blue-800);
  }

  .drawer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* 最终覆盖：放在文件末尾，保证不被旧原型样式覆盖 */
.app-topbar {
  grid-template-columns: minmax(220px, 260px) minmax(140px, 180px) minmax(180px, 220px) auto;
}

.command-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.command-card {
  min-height: 134px;
}

.command-card strong {
  font-size: 22px;
}

@media (max-width: 1180px) {
  .app-topbar {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px);
  }

  .app-topbar > .top-focus:nth-of-type(2) {
    grid-column: 2;
  }

  .app-topbar > .top-focus:nth-of-type(3) {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
  }

  .user-box {
    grid-column: 1 / -1;
  }

  .command-grid,
  .task-group-grid,
  .schedule-overview,
  .exception-list.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recommendation-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-topbar {
    grid-template-columns: 1fr;
  }

  .app-topbar > .brand {
    grid-row: 1;
  }

  .app-topbar > .top-focus:nth-of-type(2) {
    grid-row: 2;
    grid-column: 1;
  }

  .app-topbar > .top-focus:nth-of-type(3) {
    grid-row: 3;
    grid-column: 1;
  }

  .app-topbar > .user-box {
    grid-row: 4;
    grid-column: 1;
  }

  .demo-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .secondary-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-link {
    width: 100%;
    white-space: normal;
  }

  .command-grid,
  .task-group-grid,
  .schedule-overview,
  .current-next,
  .exception-list.compact {
    grid-template-columns: 1fr;
  }

  .command-card {
    min-height: 0;
  }
}

/* 双端重构层：电脑端保留后台密度，手机端改成生产控制台，不再像电脑缩窄版 */
.mobile-command-home,
.mobile-schedule-console,
.mobile-order-console,
.mobile-report-console,
.mobile-process-list {
  display: none;
}

.mobile-section-title {
  display: grid;
  gap: 3px;
  margin: 2px 0 8px;
}

.mobile-section-title strong {
  color: var(--blue-950);
  font-size: 16px;
}

.mobile-section-title span {
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 1181px) {
  .main {
    max-width: 1480px;
  }

  .dashboard-v11 .command-panel,
  .plan-v7 > .blocked-panel,
  .orders-v7 > .filter-panel,
  .reports-page > .grid-4 {
    display: grid;
  }
}

@media (max-width: 900px) {
  body {
    background: #eef5fc;
  }

  .app-frame {
    min-width: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 10px rgba(15, 45, 80, 0.08);
  }

  .app-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    min-height: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    width: 100%;
    overflow: hidden;
  }

  .brand {
    min-width: 0;
    padding: 10px 12px;
    border-right: 0;
    background: #ffffff;
  }

  .brand .eyebrow {
    color: var(--blue-600);
    font-size: 10px;
  }

  .brand h1 {
    color: var(--blue-950);
    font-size: 17px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-focus {
    display: none;
  }

  .user-box {
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: end;
    padding: 8px 10px;
    border-top: 0;
    background: #ffffff;
    width: 88px;
    min-width: 0;
  }

  .app-topbar > .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .app-topbar > .user-box {
    grid-column: 2;
    grid-row: 1;
  }

  .app-topbar > .top-focus:nth-of-type(2),
  .app-topbar > .top-focus:nth-of-type(3) {
    display: none;
  }

  .user-box .role-tag,
  .user-box .top-menu {
    display: none;
  }

  .user-box .settings-menu {
    display: block;
  }

  .demo-btn {
    width: 68px;
    min-width: 0;
    min-height: 36px;
    padding: 6px 4px;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
  }

  .demo-strip {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .app-body {
    display: block;
  }

  .main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 10px 10px 84px;
  }

  .page-head {
    padding: 0 2px;
    border: 0;
    background: transparent;
  }

  .page-head h2 {
    font-size: 20px;
  }

  .page-head p {
    font-size: 13px;
    line-height: 1.45;
  }

  .page-head .actions {
    display: none;
  }

  .panel {
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 10px;
  }

  .section-heading {
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: start;
  }

  .section-heading h3 {
    font-size: 16px;
  }

  .mobile-command-home,
  .mobile-schedule-console,
  .mobile-order-console,
  .mobile-report-console {
    display: grid;
    gap: 10px;
    margin: 10px 0;
  }

  .mobile-hero-card,
  .mobile-next-card,
  .mobile-task-card,
  .mobile-order-card {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    display: grid;
    gap: 7px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue-700);
    background: #ffffff;
    padding: 12px;
  }

  .mobile-hero-card.danger,
  .mobile-task-card.danger,
  .mobile-order-card.danger {
    border-left-color: var(--danger);
    background: #fffafa;
  }

  .mobile-next-card.warn,
  .mobile-task-card.warn,
  .mobile-order-card.warn {
    border-left-color: var(--warn);
    background: #fffbeb;
  }

  .mobile-hero-card span,
  .mobile-next-card span,
  .mobile-task-card span,
  .mobile-order-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-hero-card strong {
    color: var(--blue-950);
    font-size: 30px;
    line-height: 1.05;
  }

  .mobile-next-card strong,
  .mobile-task-card strong,
  .mobile-order-card strong {
    color: var(--blue-950);
    font-size: 20px;
    line-height: 1.15;
  }

  .mobile-hero-card em,
  .mobile-next-card p,
  .mobile-task-card p,
  .mobile-order-card p,
  .mobile-order-foot em,
  .mobile-report-list em {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-style: normal;
    line-height: 1.4;
  }

  .mobile-kpi-row {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-kpi-row > div {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 10px;
  }

  .mobile-kpi-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-kpi-row strong {
    color: var(--blue-950);
    font-size: 24px;
    line-height: 1;
  }

  .mobile-action-row,
  .mobile-order-foot {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }

  .mobile-process-list {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 6px;
  }

  .mobile-process-row {
    min-width: 0;
    max-width: 100%;
    display: grid;
    grid-template-columns: 34px minmax(58px, 0.7fr) minmax(62px, 0.8fr) minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--idle);
    background: #ffffff;
    padding: 7px 8px;
    color: var(--ink);
    text-align: left;
  }

  .mobile-process-row.normal {
    border-left-color: var(--ok);
  }

  .mobile-process-row.warn {
    border-left-color: var(--warn);
    background: #fffbeb;
  }

  .mobile-process-row.danger {
    border-left-color: var(--danger);
    background: #fffafa;
  }

  .mobile-process-row span {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--line-dark);
    color: var(--blue-950);
    font-weight: 900;
  }

  .mobile-process-row strong,
  .mobile-process-row em {
    font-size: 13px;
    font-style: normal;
    line-height: 1.2;
  }

  .mobile-process-row small {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
  }

  .process-route {
    display: none;
  }

  .dashboard-v11 .command-panel .command-grid,
  .dashboard-v11 .command-panel,
  .plan-v7 > .blocked-panel,
  .plan-v7 > .grid-2,
  .plan-v7 > .panel[data-tour-target="task-pool"],
  .orders-v7 > .filter-panel,
  .orders-v7 > .panel[data-tour-target="order-ready"],
  .reports-page > .grid-4,
  .reports-page > .panel {
    display: none;
  }

  .dashboard-lower {
    grid-template-columns: 1fr;
  }

  .compact-cards {
    grid-template-columns: 1fr;
  }

  .mobile-task-list,
  .mobile-order-list,
  .mobile-report-list {
    display: grid;
    gap: 8px;
  }

  .mobile-task-card > div,
  .mobile-order-card > div:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .mobile-task-card.selected {
    outline: 2px solid var(--blue-700);
    outline-offset: -2px;
  }

  .mobile-filter-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow-x: auto;
  }

  .mobile-filter-chips button {
    min-height: 36px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--blue-950);
    font-weight: 800;
  }

  .mobile-filter-chips button.active {
    background: var(--blue-800);
    color: #ffffff;
  }

  .mobile-report-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 10px;
  }

  .mobile-report-list strong {
    color: var(--blue-950);
  }

  .mobile-report-list span {
    color: var(--blue-950);
    font-size: 22px;
    font-weight: 900;
  }

  .mobile-report-list em {
    grid-column: 1 / -1;
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: 62px;
    width: 100%;
    max-width: 100%;
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
  }

  .mobile-bottom-nav button {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .statusbar {
    display: none;
  }
}

@media (max-width: 430px) {
  .main {
    padding-left: 8px;
    padding-right: 8px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .mobile-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-kpi-row > div {
    padding: 8px 6px;
  }

  .mobile-kpi-row strong {
    font-size: 21px;
  }

  .mobile-process-row {
    grid-template-columns: 30px minmax(50px, 0.7fr) minmax(54px, 0.8fr) minmax(0, 1fr);
    gap: 5px;
    padding: 7px 6px;
  }

  .mobile-process-row small {
    font-size: 11px;
  }

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

  .mobile-bottom-nav button {
    font-size: 12px;
    padding: 5px 2px;
  }
}

.settings-menu {
  display: block !important;
  position: relative;
}

.settings-menu .top-link {
  min-height: 40px;
  border: 1px solid var(--blue-800);
  background: #fff;
  color: var(--blue-950);
  padding: 0 14px;
  font-weight: 900;
}

.settings-menu .top-dropdown {
  min-width: min(360px, calc(100vw - 28px));
}

.process-route {
  display: grid !important;
}

@media (max-width: 760px) {
  .user-box {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }

  .settings-menu {
    display: block !important;
  }

  .settings-menu .top-dropdown {
    right: 0;
    max-height: calc(100vh - 110px);
    overflow: auto;
  }

  .process-route {
    display: grid !important;
    gap: 8px;
  }

  .process-node {
    display: grid !important;
    grid-template-columns: 42px 1fr;
    gap: 6px 10px;
  }

  .process-node em,
  .process-node small {
    grid-column: 2;
  }
}

.collapsible-panel > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

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

.collapsible-panel > summary::before {
  grid-column: 3;
  order: 3;
  content: "收起";
  align-self: center;
  justify-self: end;
  border: 1px solid var(--line-dark);
  color: var(--blue-950);
  background: #fff;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 900;
}

.collapsible-panel:not([open]) > summary::before {
  content: "展开";
}

.collapsible-panel > summary .btn {
  grid-column: 2;
  order: 2;
  position: relative;
  z-index: 1;
}

.collapsible-panel > summary > div {
  grid-column: 1;
  order: 1;
  min-width: 0;
}

.process-collapse .process-route {
  margin-top: 10px;
}

.queue-collapse .production-queue {
  margin-top: 10px;
}

@media (max-width: 760px) {
  .collapsible-panel > summary {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .collapsible-panel > summary::before {
    padding: 8px 10px;
  }
}

@media (max-width: 520px) {
  .collapsible-panel > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .collapsible-panel > summary > div {
    grid-column: 1 / -1;
  }

  .collapsible-panel > summary .btn {
    grid-column: 1;
    justify-self: end;
  }

  .collapsible-panel > summary::before {
    grid-column: 2;
  }
}

.production-queue {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.queue-row {
  border-bottom: 1px solid var(--line);
}

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

.queue-row.danger {
  border-left: 4px solid var(--danger);
}

.queue-summary {
  display: grid;
  grid-template-columns: 54px minmax(92px, 1fr) 90px 90px 130px 96px 78px;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.queue-summary::-webkit-details-marker {
  display: none;
}

.queue-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--blue-800);
  color: var(--blue-950);
  font-weight: 900;
}

.queue-summary strong {
  color: var(--blue-950);
  font-size: 22px;
}

.queue-summary span,
.queue-summary em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
}

.queue-summary em {
  color: var(--blue-950);
}

.danger-text {
  color: var(--danger) !important;
}

.queue-detail {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px 12px 12px;
}

@media (max-width: 760px) {
  .queue-summary {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  .queue-summary strong {
    font-size: 24px;
  }

  .queue-summary span:nth-of-type(n + 2),
  .queue-summary em {
    grid-column: 2 / -1;
  }
}

/* V1 mobile final overrides: prevent the real-login shell from inheriting prototype overflow rules. */
.login-page,
.login-hero,
.login-panel-v1,
.login-health,
.system-banner,
.toast {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .login-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100vw;
    padding: 10px;
    overflow-x: hidden;
  }

  .login-hero,
  .login-panel-v1 {
    width: 100%;
    padding: 16px;
  }

  .login-hero h1 {
    font-size: 30px;
    line-height: 1.12;
  }

  .login-hero p,
  .login-health span {
    font-size: 14px;
  }
}

/* V1 form usability overrides: make API-backed forms readable for factory operators. */
.inline-industrial-form {
  align-items: start;
}

.industrial-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.industrial-field > span {
  color: var(--blue-950);
  font-size: 12px;
  font-weight: 900;
}

.industrial-field > em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.industrial-field input,
.industrial-field select {
  width: 100%;
  min-width: 0;
}

.industrial-field.readonly-field input:not([type="hidden"]) {
  background: #f8fafc;
  color: var(--blue-950);
  font-weight: 900;
}

.form-action {
  align-self: end;
  min-height: 42px;
}

.scan-result.is-v1-visible {
  display: grid;
}

.export-preview-panel {
  display: grid;
  gap: 14px;
}

.export-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.export-preview-grid > div,
.export-warning {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.export-preview-grid span,
.export-warning span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.export-preview-grid strong,
.export-warning strong {
  color: var(--blue-950);
  line-height: 1.35;
}

.stat-workbench {
  display: grid;
  gap: 14px;
}

.stat-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-desk-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.stat-entry-panel,
.stat-todo-panel,
.stat-ledger-panel {
  min-width: 0;
}

.stat-order-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.stat-order-form > .order-size-editor {
  grid-column: 1 / -1;
}

.order-size-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px;
}

.order-size-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.order-size-toolbar div {
  display: grid;
  gap: 4px;
}

.order-size-toolbar strong {
  color: var(--blue-950);
  font-size: 16px;
  font-weight: 900;
}

.order-size-toolbar span,
.order-size-row label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.order-size-list {
  display: grid;
  gap: 8px;
}

.order-size-row {
  display: grid;
  grid-template-columns: 42px minmax(90px, 0.8fr) minmax(90px, 0.8fr) minmax(140px, 1fr) minmax(120px, 0.9fr) minmax(160px, 1fr) 72px;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.order-size-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.order-size-line-no {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--blue-800);
  color: var(--blue-950);
  font-size: 20px;
  font-weight: 900;
}

.stat-process-config {
  min-width: 0;
}

.process-config-form {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.process-config-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px;
}

.process-config-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.process-config-list {
  display: grid;
  gap: 8px;
}

.process-config-row {
  display: grid;
  grid-template-columns: 42px 44px minmax(180px, 1fr) 170px 72px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue-700);
  background: #ffffff;
  padding: 8px;
}

.process-config-row.outbound {
  border-left-color: var(--idle);
  background: #f8fafc;
}

.process-config-row.dragging {
  opacity: 0.6;
  outline: 2px solid var(--blue-700);
}

.drag-handle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-dark);
  background: #eef6ff;
  color: var(--blue-950);
  cursor: grab;
  font-size: 18px;
  font-weight: 900;
}

.process-row-order {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--blue-950);
  font-weight: 900;
}

.process-config-row input,
.process-config-row select {
  min-height: 36px;
  padding: 6px 8px;
}

.stat-todo-list {
  display: grid;
  gap: 8px;
}

.stat-todo-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--warn);
  background: #fffbeb;
  padding: 10px;
}

.stat-todo-item.danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.stat-todo-item strong,
.stat-todo-item span,
.stat-todo-item em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stat-todo-item strong {
  color: var(--blue-950);
}

.stat-todo-item span,
.stat-todo-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.stat-todo-item em {
  grid-column: 1 / -1;
  color: var(--warn);
}

.stat-ledger-wrap table {
  min-width: 1240px;
}

.stat-ledger-table th,
.stat-ledger-table td {
  vertical-align: top;
}

.ledger-row.warn {
  background: #fffbeb;
}

.ledger-row.danger {
  background: #fffafa;
}

.ledger-row strong {
  color: var(--blue-950);
}

.ledger-edit-form {
  display: grid;
  grid-template-columns: 76px 144px 150px minmax(140px, 1fr) 74px;
  gap: 6px;
  align-items: center;
  min-width: 590px;
}

.ledger-edit-form input,
.ledger-edit-form select {
  min-height: 36px;
  padding: 6px 8px;
}

.ledger-edit-form .btn {
  min-height: 36px;
  padding: 0 10px;
}

.stat-card-fallback {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.stat-card-fallback summary {
  cursor: pointer;
  color: var(--blue-950);
  font-weight: 900;
}

.password-reset-panel {
  border-left: 5px solid var(--warn);
}

.password-reset-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fffbeb;
  padding: 14px;
}

.password-reset-card span,
.password-reset-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.password-reset-card strong {
  color: var(--blue-950);
  font-family: Consolas, "Courier New", monospace;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.worker-issue-panel {
  border-left: 5px solid var(--warn);
}

.worker-issue-form {
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) minmax(160px, 0.9fr) minmax(220px, 1.2fr) auto;
}

@media (max-width: 760px) {
  .inline-industrial-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-kpi-row,
  .stat-desk-grid,
  .stat-order-form,
  .process-config-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .worker-issue-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .process-config-toolbar,
  .order-size-toolbar,
  .order-size-row,
  .process-config-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-size-line-no {
    min-height: 34px;
  }

  .process-config-toolbar .action-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .drag-handle,
  .process-row-order {
    width: 100%;
  }

  .owner-issue-log-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .stat-ledger-wrap table {
    min-width: 980px;
  }

  .form-action {
    width: 100%;
  }

  .scan-result strong {
    font-size: 24px;
  }

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

  .mobile-bottom-nav {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}

.settings-menu {
  display: block !important;
  position: relative;
}

.settings-menu .top-link {
  min-height: 40px;
  border: 1px solid var(--blue-800);
  background: #fff;
  color: var(--blue-950);
  padding: 0 14px;
  font-weight: 900;
}

.settings-menu .top-dropdown {
  min-width: min(360px, calc(100vw - 28px));
}

.process-route {
  display: grid !important;
}

@media (max-width: 760px) {
  .user-box {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }

  .settings-menu,
  .user-box .settings-menu {
    display: block !important;
  }

  .settings-menu .top-dropdown {
    right: 0;
    max-height: calc(100vh - 110px);
    overflow: auto;
  }

  .process-route {
    display: grid !important;
    gap: 8px;
  }

  .process-node {
    display: grid !important;
    grid-template-columns: 42px 1fr;
    gap: 6px 10px;
  }

  .process-node em,
  .process-node small {
    grid-column: 2;
  }
}
