:root {
  --page: #e9edf5;
  --page-deep: #dbe2ef;
  --surface: #fbfcff;
  --surface-raised: #f4f7fd;
  --surface-inset: #edf2fa;
  --border: rgba(20, 41, 88, 0.1);
  --border-strong: rgba(20, 41, 88, 0.18);
  --ink-1: #101a31;
  --ink-2: #34415c;
  --ink-3: #586783;
  --ink-on-dark: #f4f7ff;
  --rail: #111827;
  --rail-2: #1c2944;
  --rail-ink: #9eacc5;
  --accent: #2457d6;
  --accent-hover: #1947ba;
  --accent-soft: rgba(36, 87, 214, 0.16);
  --accent-border: rgba(36, 87, 214, 0.42);
  --accent-card: #f0f4ff;
  --success: #0f7a45;
  --success-soft: rgba(15, 122, 69, 0.16);
  --success-border: rgba(15, 122, 69, 0.38);
  --success-card: #ecfaf2;
  --warning: #a65a00;
  --warning-soft: rgba(166, 90, 0, 0.17);
  --warning-border: rgba(166, 90, 0, 0.4);
  --warning-card: #fff5e5;
  --danger: #b52e36;
  --danger-soft: rgba(181, 46, 54, 0.15);
  --danger-border: rgba(181, 46, 54, 0.36);
  --danger-card: #fff0f1;
  --violet: #7837c7;
  --violet-soft: rgba(120, 55, 199, 0.16);
  --violet-border: rgba(120, 55, 199, 0.38);
  --violet-card: #f7efff;
  --slate: #526176;
  --slate-soft: rgba(82, 97, 118, 0.16);
  --slate-border: rgba(82, 97, 118, 0.34);
  --slate-card: #f0f3f7;
  --shadow: 0 4px 16px rgba(17, 45, 97, 0.075);
  --shadow-md: 0 20px 52px -34px rgba(17, 45, 97, 0.42);
  --shadow-lg: 0 40px 90px -50px rgba(17, 45, 97, 0.54);
  --r-sm: 11px;
  --r-md: 15px;
  --r-lg: 19px;
  --r-xl: 28px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--ink-1);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--ink-on-dark);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.tabular,
td,
.num {
  font-variant-numeric: tabular-nums;
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-1);
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled,
.icon-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.button-primary {
  background: var(--accent);
  color: var(--ink-on-dark);
  box-shadow: 0 8px 22px rgba(36, 87, 214, 0.26);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.button-secondary:hover:not(:disabled) {
  background: var(--surface-inset);
  border-color: var(--border-strong);
}

.button-success {
  color: var(--surface);
  background: var(--success);
}

.button-danger-quiet {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.button-large {
  min-height: 48px;
  width: 100%;
  font-size: 16px;
}

.button-compact {
  min-height: 44px;
  padding: 0 11px;
  font-size: 14px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}

.icon-button-dark {
  margin-left: auto;
  background: var(--rail-2);
  color: var(--rail-ink);
  border-color: rgba(255, 255, 255, 0.06);
}

.text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 3px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 20px 15px 16px;
  display: flex;
  flex-direction: column;
  background: var(--rail);
  color: var(--ink-on-dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 0 8px 17px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ink-on-dark);
  background: var(--accent);
  flex: 0 0 auto;
}

.brand > span:last-of-type {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand small {
  color: var(--rail-ink);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}

.sidebar-close {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  padding: 15px 13px 6px;
  color: var(--rail-ink);
  opacity: 0.68;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sidebar-nav a {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--rail-ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 560;
  position: relative;
}

.sidebar-nav a:hover {
  background: var(--rail-2);
  color: var(--ink-on-dark);
}

.sidebar-nav a.active {
  background: var(--accent);
  color: var(--ink-on-dark);
  box-shadow: 0 12px 28px -16px rgba(36, 87, 214, 0.8);
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 12px 8px 2px;
}

.sidebar-account {
  margin-top: auto;
  padding: 12px 9px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--rail-2);
  color: var(--ink-on-dark);
  font-weight: 750;
}

.sidebar-account > div:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-account strong {
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.sidebar-account span {
  color: var(--rail-ink);
  font-size: 12px;
}

.app-content {
  min-width: 0;
}

.page-content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 29px 30px 48px;
}

.mobile-topbar {
  display: none;
}

.mobile-scrim {
  display: none;
}

.page-header {
  min-height: 66px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-header h1 {
  margin-bottom: 6px;
  font-size: 31px;
  font-weight: 820;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.page-header p {
  margin-bottom: 0;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1.6;
}

.page-eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.page-actions,
.order-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.readonly-notice,
.topbar-role {
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--surface-inset);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 650;
}

.surface,
.metric-card,
.workstation-card,
.stats-metrics article {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  border-radius: var(--r-lg);
}

.section-heading {
  min-height: 42px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin-bottom: 4px;
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.55;
}

.section-heading > a {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}

.metric-card {
  min-height: 148px;
  padding: 19px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 5px 11px;
}

.metric-card-accent,
.stat-card-accent {
  background: var(--accent-card) !important;
  border-color: var(--accent-border) !important;
}

.metric-card-green,
.stat-card-green {
  background: var(--success-card) !important;
  border-color: var(--success-border) !important;
}

.metric-card-amber,
.stat-card-amber {
  background: var(--warning-card) !important;
  border-color: var(--warning-border) !important;
}

.metric-card-violet,
.stat-card-violet {
  background: var(--violet-card) !important;
  border-color: var(--violet-border) !important;
}

.metric-card-red {
  background: var(--danger-card) !important;
  border-color: var(--danger-border) !important;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
}

.tone-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tone-green {
  background: var(--success-soft);
  color: var(--success);
}

.tone-amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.tone-violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.tone-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.metric-card > span:not(.metric-icon) {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 720;
}

.metric-card strong {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 37px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.045em;
}

.metric-card small {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.station-overview,
.due-panel,
.recent-orders,
.order-table-surface,
.process-surface,
.timeline-surface,
.files-surface,
.audit-surface,
.user-list {
  padding: 20px;
}

.station-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.station-row {
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: grid;
  grid-template-columns: 38px minmax(175px, 0.8fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 12px;
  background: var(--surface-raised);
}

.station-row:last-child {
  border-bottom: 1px solid var(--border);
}

.station-index,
.workstation-number {
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.station-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.station-name strong {
  font-size: 15px;
  font-weight: 760;
}

.station-name span,
.station-products > span {
  color: var(--ink-3);
  font-size: 12px;
}

.station-products {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.station-products a {
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.attention-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attention-item {
  min-height: 58px;
  padding: 10px 11px;
  border-radius: var(--r-sm);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  text-decoration: none;
}

.attention-item.overdue {
  border-color: var(--danger-border);
  background: var(--danger-card);
}

.attention-item > div:first-child,
.attention-date {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.attention-item strong {
  font-size: 14px;
}

.attention-item span {
  color: var(--ink-3);
  font-size: 12px;
}

.attention-date {
  text-align: right;
}

.attention-item.overdue .attention-date strong {
  color: var(--danger);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

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

th {
  height: 38px;
  padding: 0 12px;
  color: var(--ink-3);
  background: var(--surface-inset);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

th:first-child {
  border-radius: 10px 0 0 10px;
}

th:last-child {
  border-radius: 0 10px 10px 0;
}

td {
  min-height: 48px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(36, 87, 214, 0.045);
}

.align-right {
  text-align: right;
}

.cell-primary,
.order-short-name {
  display: block;
  color: var(--ink-1);
  font-weight: 700;
}

.order-short-name {
  text-decoration: none;
}

.order-short-name:hover {
  color: var(--accent);
}

.cell-sub {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
}

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

.text-muted {
  color: var(--ink-3);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 780;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-processing,
.status-in_progress {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-completed {
  color: var(--success);
  background: var(--success-soft);
}

.status-paused {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-rework {
  color: var(--violet);
  background: var(--violet-soft);
}

.status-skipped,
.status-not_started,
.status-cancelled {
  color: var(--slate);
  background: var(--slate-soft);
}

.state-panel {
  min-height: 240px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-3);
  background: var(--surface);
  text-align: center;
}

.state-panel strong {
  color: var(--ink-1);
  font-size: 16px;
}

.state-panel span {
  max-width: 420px;
  font-size: 14px;
}

.state-panel .button {
  margin-top: 4px;
}

.state-error > svg {
  color: var(--danger);
}

.filter-surface,
.workstation-toolbar,
.stats-filter {
  margin-bottom: 16px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-input,
.select-inline,
.input-with-icon {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-raised);
  color: var(--ink-3);
}

.search-input {
  flex: 1;
  max-width: 430px;
  padding: 0 12px;
}

.search-input input,
.select-inline select,
.input-with-icon input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-1);
  font-size: 14px;
}

.select-inline {
  padding: 0 7px 0 11px;
}

.select-inline select {
  min-width: 115px;
  height: 44px;
}

.select-step select {
  min-width: 190px;
}

.result-count,
.toolbar-summary {
  color: var(--ink-3);
  font-size: 13px;
  white-space: nowrap;
}

.result-count strong,
.toolbar-summary strong {
  color: var(--ink-1);
}

.table-footer {
  min-height: 49px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 13px;
}

.table-footer > div {
  display: flex;
  gap: 7px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(15, 16, 27, 0.55);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal:focus {
  outline: none;
}

.modal-wide {
  width: min(1040px, 100%);
}

.modal-header {
  padding: 21px 23px 17px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(251, 252, 253, 0.96);
  backdrop-filter: blur(10px);
}

.modal-header h2 {
  margin-bottom: 5px;
  font-size: 20px;
}

.modal-header p {
  margin-bottom: 0;
  color: var(--ink-3);
  font-size: 13px;
}

.modal-body {
  padding: 21px 23px 23px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.sticky-actions {
  position: sticky;
  bottom: -23px;
  z-index: 4;
  margin: 20px -23px -23px;
  padding: 14px 23px;
  border-top: 1px solid var(--border);
  background: rgba(251, 252, 253, 0.96);
  backdrop-filter: blur(10px);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
}

.field small {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 0 12px;
  background: var(--surface-raised);
  color: var(--ink-1);
  outline: 0;
  font-size: 14px;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
  padding-top: 11px;
  line-height: 1.5;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--accent-border);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input:disabled {
  background: var(--surface-inset);
  color: var(--ink-3);
}

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

.field-full {
  grid-column: 1 / -1;
}

.form-alert,
.inline-warning {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.form-alert {
  color: var(--danger);
  background: var(--danger-soft);
}

.inline-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

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

.workflow-sections {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-section {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-raised);
}

.form-section-title {
  margin-bottom: 17px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.form-section-title > span {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.form-section-title h3 {
  margin-bottom: 3px;
  font-size: 15px;
}

.form-section-title p {
  margin-bottom: 0;
  color: var(--ink-3);
  font-size: 12px;
}

.workflow-check {
  position: sticky;
  top: 86px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}

.check-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 13px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
}

.workflow-check h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.workflow-check > p {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
}

.check-list {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-list > div {
  min-height: 32px;
  display: grid;
  grid-template-columns: 19px 1fr auto;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-size: 12px;
}

.check-list > div.pass {
  color: var(--success);
}

.check-list strong {
  font-size: 11px;
}

.form-receipt {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.form-receipt > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.form-receipt dt {
  color: var(--ink-3);
  font-size: 12px;
}

.form-receipt dd {
  margin: 0;
  max-width: 160px;
  text-align: right;
  color: var(--ink-1);
  font-size: 12px;
  font-weight: 650;
}

.detail-back {
  margin-bottom: 14px;
}

.detail-back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13px;
}

.order-hero {
  margin-bottom: 17px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.order-kicker {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.order-kicker > span:first-child {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 650;
}

.order-identity h1 {
  margin-bottom: 6px;
  font-size: 35px;
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.order-identity p {
  margin-bottom: 0;
  color: var(--ink-3);
  font-size: 14px;
}

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

.order-facts article {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.order-facts article:first-child {
  border-color: var(--accent-border);
  background: var(--accent-card);
}

.order-facts article:nth-child(4) {
  border-color: var(--violet-border);
  background: var(--violet-card);
}

.order-facts span {
  color: var(--ink-3);
  font-size: 12px;
}

.order-facts strong {
  margin-top: auto;
  font-size: 20px;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.order-facts small {
  color: var(--ink-3);
  font-size: 11px;
}

.fact-danger {
  border-color: var(--danger-border) !important;
  background: var(--danger-card) !important;
}

.fact-danger strong,
.fact-danger small {
  color: var(--danger);
}

.notice-strip {
  margin-bottom: 13px;
  padding: 12px 15px;
  border: 1px solid var(--warning-border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--warning-card);
}

.notice-strip strong {
  color: var(--warning);
  font-size: 13px;
  white-space: nowrap;
}

.notice-strip p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

.process-surface {
  margin-bottom: 16px;
}

.process-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.process-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.process-legend span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.legend-processing {
  color: var(--accent) !important;
  background: var(--accent-card);
}

.legend-completed {
  color: var(--success) !important;
  background: var(--success-card);
}

.legend-paused {
  color: var(--warning) !important;
  background: var(--warning-card);
}

.legend-rework {
  color: var(--violet) !important;
  background: var(--violet-card);
}

.legend-skipped {
  color: var(--slate) !important;
  background: var(--slate-card);
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.process-node {
  min-height: 116px;
  padding: 13px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  background: var(--surface-inset);
}

.process-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.process-number {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 820;
}

.process-state-icon {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--slate);
  background: var(--slate-soft);
}

.process-node > strong {
  min-height: 31px;
  color: var(--ink-1);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.process-node-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 740;
}

.process-connector {
  position: absolute;
  top: 50%;
  right: -9px;
  z-index: 2;
  transform: translate(50%, -50%);
  color: var(--ink-3);
  font-size: 13px;
}

.process-node:nth-child(5n) .process-connector {
  display: none;
}

.process-node-processing {
  border-color: var(--accent);
  background: var(--accent-card);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

.process-node-processing .process-state-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.process-node-completed {
  border-color: var(--success);
  background: var(--success-card);
  box-shadow: inset 0 0 0 1px var(--success-soft);
}

.process-node-completed .process-state-icon {
  color: var(--success);
  background: var(--success-soft);
}

.process-node-paused {
  border-color: var(--warning);
  background: var(--warning-card);
  box-shadow: inset 0 0 0 1px var(--warning-soft);
}

.process-node-paused .process-state-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.process-node-rework {
  border-color: var(--violet);
  background: var(--violet-card);
  box-shadow: inset 0 0 0 1px var(--violet-soft);
}

.process-node-rework .process-state-icon {
  color: var(--violet);
  background: var(--violet-soft);
}

.process-node-skipped {
  border-color: var(--slate);
  background: var(--slate-card);
  box-shadow: inset 0 0 0 1px var(--slate-soft);
}

.process-node-skipped .process-state-icon {
  color: var(--slate);
  background: var(--slate-soft);
}

.process-node-processing .process-node-meta {
  color: var(--accent);
}

.process-node-completed .process-node-meta {
  color: var(--success);
}

.process-node-paused .process-node-meta {
  color: var(--warning);
}

.process-node-rework .process-node-meta {
  color: var(--violet);
}

.process-node-skipped .process-node-meta {
  color: var(--slate);
}

.rework-count {
  color: var(--violet);
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.7fr);
  align-items: start;
  gap: 16px;
}

.detail-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  position: relative;
}

.timeline-item::before {
  content: "";
  width: 1px;
  position: absolute;
  top: 16px;
  bottom: -12px;
  left: 6px;
  background: var(--border-strong);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-mark {
  width: 13px;
  height: 13px;
  margin-top: 16px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  z-index: 1;
  background: var(--slate);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.timeline-processing .timeline-mark {
  background: var(--accent);
}

.timeline-completed .timeline-mark {
  background: var(--success);
}

.timeline-paused .timeline-mark {
  background: var(--warning);
}

.timeline-rework .timeline-mark {
  background: var(--violet);
}

.timeline-card {
  margin-bottom: 11px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-raised);
}

.timeline-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.timeline-sequence {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 700;
}

.timeline-card h3 {
  margin-bottom: 0;
  font-size: 14px;
}

.timeline-times {
  margin: 11px 0;
  display: grid;
  grid-template-columns: 1fr 1fr 0.7fr;
  gap: 7px;
}

.timeline-times > div {
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--surface-inset);
}

.timeline-times dt {
  margin-bottom: 4px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.timeline-times dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
}

.timeline-card footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--ink-3);
  font-size: 11px;
}

.timeline-card footer > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.visit-note {
  flex: 1;
  color: var(--ink-2);
}

.timeline-note {
  margin: 10px 0 4px;
  color: var(--ink-3);
  font-size: 12px;
}

.file-list,
.audit-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.file-item {
  min-height: 55px;
  padding: 9px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  background: var(--surface-inset);
  text-decoration: none;
}

.file-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
}

.file-item > span:nth-child(2) {
  min-width: 0;
}

.file-item strong,
.file-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item strong {
  font-size: 12px;
}

.file-item small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.compact-empty {
  padding: 25px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-inset);
  color: var(--ink-3);
  text-align: center;
  font-size: 12px;
}

.audit-item {
  min-height: 42px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.audit-mark {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.audit-item strong {
  font-size: 12px;
}

.audit-item p {
  margin: 3px 0 0;
  color: var(--ink-3);
  font-size: 10.5px;
}

.transition-summary {
  padding: 14px;
  border-radius: var(--r-sm);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: var(--surface-inset);
}

.transition-summary > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.transition-summary > div:last-child {
  text-align: right;
}

.transition-summary span {
  color: var(--ink-3);
  font-size: 11px;
}

.transition-summary strong {
  font-size: 13px;
}

.radio-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.radio-card-grid label {
  min-height: 118px;
  padding: 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  position: relative;
  cursor: pointer;
}

.radio-card-grid label.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.radio-card-grid input {
  position: absolute;
  top: 12px;
  right: 12px;
}

.radio-card-grid svg {
  color: var(--accent);
}

.radio-card-grid strong {
  font-size: 14px;
}

.radio-card-grid span {
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.45;
}

.upload-dropzone {
  min-height: 130px;
  padding: 18px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-inset);
  cursor: pointer;
}

.upload-dropzone svg {
  color: var(--accent);
}

.upload-dropzone strong {
  font-size: 14px;
}

.upload-dropzone span {
  color: var(--ink-3);
  font-size: 11px;
}

.upload-dropzone input {
  max-width: 100%;
  margin-top: 7px;
  font-size: 12px;
}

.workstation-toolbar .search-input {
  max-width: 420px;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 13px;
}

.toolbar-summary {
  margin-left: auto;
}

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

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

.workstation-card > header {
  min-height: 56px;
  margin-bottom: 13px;
  padding: 10px 11px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r-sm);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  background: var(--accent-card);
}

.workstation-card h2 {
  margin-bottom: 3px;
  font-size: 16px;
  font-weight: 780;
}

.workstation-card header p {
  margin-bottom: 0;
  color: var(--ink-3);
  font-size: 11px;
}

.workstation-count {
  min-width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 17px;
  font-weight: 850;
}

.workstation-orders {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workstation-order {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  background: var(--surface-raised);
  text-decoration: none;
}

.workstation-order:hover {
  border-color: var(--accent-border);
  background: var(--accent-card);
}

.workstation-order.overdue {
  border-color: var(--danger-border);
  background: var(--danger-card);
}

.workstation-order > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.workstation-order > div:first-child strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 800;
}

.workstation-order > div:first-child span {
  color: var(--ink-3);
  font-size: 10.5px;
}

.workstation-order dl {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 7px;
}

.workstation-order dt {
  margin-bottom: 3px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.workstation-order dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
}

.workstation-empty {
  opacity: 0.74;
}

.workstation-no-orders {
  min-height: 98px;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-3);
  background: var(--surface-inset);
  font-size: 12px;
}

.stats-filter {
  max-width: 690px;
}

.stats-filter .field {
  min-width: 180px;
}

.stats-filter .field > span {
  display: none;
}

.stats-filter > span {
  color: var(--ink-3);
  font-size: 13px;
}

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

.stats-metrics article {
  min-height: 128px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.stats-metrics article > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stats-metrics article > div > span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 720;
}

.stats-metrics strong {
  margin-top: 4px;
  font-size: 33px;
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.stats-metrics small {
  color: var(--ink-3);
  font-size: 10.5px;
}

.count-pill,
.account-total {
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--ink-3);
  background: var(--surface-inset);
  font-size: 12px;
  font-weight: 750;
}

.count-active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

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

.user-cards article {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-disabled {
  opacity: 0.62;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 800;
}

.user-avatar.role-viewer {
  color: var(--slate);
  background: var(--slate-soft);
}

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

.user-main > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.user-main strong {
  font-size: 16px;
  font-weight: 780;
}

.role-chip {
  min-height: 21px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10.5px;
  font-weight: 700;
}

.role-chip.role-viewer {
  color: var(--slate);
  background: var(--slate-soft);
}

.username {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 11px;
}

.user-main dl {
  margin: 11px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.user-main dt {
  margin-bottom: 3px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.user-main dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 650;
}

.user-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(460px, 1.1fr);
  background: var(--page);
}

.login-context {
  padding: 44px 52px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  color: var(--ink-on-dark);
  background: var(--rail);
}

.login-context::after {
  content: "";
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
  position: absolute;
  right: -170px;
  bottom: -170px;
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.018),
    0 0 0 140px rgba(255, 255, 255, 0.012);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.brand-mark-large {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.login-brand > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.login-brand strong {
  font-size: 19px;
}

.login-brand span {
  color: var(--rail-ink);
  font-size: 10.5px;
  letter-spacing: 0.17em;
}

.login-copy {
  max-width: 510px;
  margin: auto 0;
  position: relative;
  z-index: 1;
}

.context-label {
  display: block;
  margin-bottom: 14px;
  color: var(--rail-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-copy h1 {
  margin-bottom: 18px;
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.login-copy p {
  max-width: 460px;
  color: var(--rail-ink);
  font-size: 16px;
  line-height: 1.8;
}

.login-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.06);
}

.login-proof > div {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--rail);
}

.login-proof strong {
  font-size: 18px;
}

.login-proof span {
  color: var(--rail-ink);
  font-size: 11px;
}

.login-panel,
.bootstrap-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(390px, 100%);
  padding: 31px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  gap: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.login-card header {
  margin-bottom: 2px;
}

.login-card header > span {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}

.login-card h2 {
  margin-bottom: 7px;
  font-size: 24px;
}

.login-card header p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.5;
}

.input-with-icon {
  padding: 0 12px;
}

.input-with-icon input {
  min-height: 44px;
  padding: 0;
}

.dev-credentials {
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--ink-3);
  background: var(--surface-inset);
  text-align: center;
  font-size: 11px;
}

@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .detail-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .process-node:nth-child(5n) .process-connector {
    display: block;
  }

  .process-node:nth-child(4n) .process-connector {
    display: none;
  }

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

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

  .sidebar {
    width: min(320px, 90vw);
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .brand > span:last-of-type {
    flex: 1;
  }

  .brand strong {
    white-space: normal;
    font-size: 17px;
    letter-spacing: 0.01em;
  }

  .brand small {
    display: none;
  }

  .sidebar-open {
    transform: translateX(0);
  }

  .sidebar-close {
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--rail-ink);
    background: var(--rail-2);
  }

  .mobile-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    background: rgba(15, 16, 27, 0.48);
  }

  .mobile-scrim-visible {
    display: block;
  }

  .mobile-topbar {
    height: 58px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 11px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(233, 237, 245, 0.96);
    backdrop-filter: blur(10px);
  }

  .mobile-topbar strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }

  .topbar-role {
    margin-left: auto;
  }

  .page-content {
    padding: 23px 18px 40px;
  }

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

  .order-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-facts,
  .stats-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .workflow-check {
    position: static;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-context {
    min-height: 390px;
    padding: 30px;
  }

  .login-copy {
    margin: 55px 0;
  }
}

@media (max-width: 720px) {
  .page-content {
    padding: 18px 12px 34px;
  }

  .page-header {
    min-height: 0;
    flex-direction: column;
    gap: 13px;
  }

  .page-header h1 {
    font-size: 27px;
  }

  .page-actions,
  .order-actions {
    width: 100%;
  }

  .page-actions .button,
  .order-actions .button {
    flex: 1 1 140px;
    justify-content: center;
  }

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

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

  .metric-card {
    min-height: 126px;
    padding: 15px;
  }

  .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .metric-card strong {
    font-size: 34px;
  }

  .station-row {
    grid-template-columns: 30px 1fr;
    padding: 10px;
  }

  .station-products {
    grid-column: 2;
    justify-content: flex-start;
  }

  .filter-surface,
  .filter-bar,
  .workstation-toolbar,
  .stats-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .search-input,
  .select-inline,
  .select-step select,
  .stats-filter,
  .stats-filter .field {
    width: 100%;
    max-width: none;
  }

  .result-count,
  .toolbar-summary {
    margin-left: 0;
  }

  .order-table {
    min-width: 920px;
  }

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

  .process-node:nth-child(4n) .process-connector {
    display: block;
  }

  .process-node:nth-child(2n) .process-connector {
    display: none;
  }

  .process-legend {
    justify-content: flex-start;
  }

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

  .timeline-times {
    grid-template-columns: 1fr;
  }

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

  .field-full {
    grid-column: auto;
  }

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }

  .modal {
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }

  .modal-header,
  .modal-body {
    padding-left: 17px;
    padding-right: 17px;
  }

  .sticky-actions {
    margin-left: -17px;
    margin-right: -17px;
    padding-left: 17px;
    padding-right: 17px;
  }

  .user-cards article {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .user-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .user-actions .button {
    flex: 1 1 130px;
    justify-content: center;
  }

  .login-context {
    min-height: 350px;
    padding: 25px 22px;
  }

  .login-copy h1 {
    font-size: 35px;
  }

  .login-proof > div {
    padding: 13px 10px;
  }

  .login-panel {
    padding: 20px 13px 35px;
  }

  .login-card {
    padding: 23px 19px;
  }
}

@media (max-width: 430px) {
  .page-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .order-facts,
  .stats-metrics {
    gap: 8px;
  }

  .process-node {
    min-height: 110px;
    padding: 11px 9px;
  }

  .process-node strong {
    font-size: 13px;
  }

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

  .modal-actions .button {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
