/* ========================================================================== 
   聚多折浅色运营后台 · 统一视觉系统
   与微信小程序共用品牌色、语义色和信息层级。
   ========================================================================== */

:root {
  color-scheme: light;
  --ui-color-primary: #3569b9;
  --ui-color-primary-strong: #285ca7;
  --ui-color-primary-soft: #e8f1fe;
  --ui-color-success: #2a8a69;
  --ui-color-success-soft: #e5f4ef;
  --ui-color-warning: #93600d;
  --ui-color-warning-soft: #fff2d9;
  --ui-color-danger: #b65550;
  --ui-color-danger-soft: #fbecea;
  --ui-color-text: #17243a;
  --ui-color-text-secondary: #5f6f86;
  --ui-color-text-muted: #7c899b;
  --ui-color-background: #f5f8fc;
  --ui-color-surface: #ffffff;
  --ui-color-surface-soft: #f7f9fc;
  --ui-color-border: #e3e9f2;
  --ui-color-disabled-background: #e7ecf3;
  --ui-color-disabled-text: #93a0b2;
  --ui-radius-small: 8px;
  --ui-radius-control: 10px;
  --ui-radius-card: 14px;
  --ui-radius-dialog: 18px;
  --ui-radius-pill: 999px;
  --ui-shadow-card: 0 8px 24px rgba(28, 49, 89, .05);
  --ui-shadow-focus: 0 0 0 3px rgba(53, 105, 185, .14);
  --ui-shadow-float: 0 24px 64px rgba(28, 49, 89, .16);

  /* Existing templates still use these aliases. */
  --ink: var(--ui-color-text);
  --forest: var(--ui-color-primary);
  --forest-deep: var(--ui-color-primary-strong);
  --paper: var(--ui-color-background);
  --paper-light: var(--ui-color-surface);
  --line: var(--ui-color-border);
  --muted: var(--ui-color-text-secondary);
  --orange: var(--ui-color-warning);
  --lime: var(--ui-color-success);
  --red: var(--ui-color-danger);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--ui-color-background);
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ui-color-text);
  background: var(--ui-color-background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before { display: none; }
body.menu-open { overflow: hidden; }

button,
input,
select,
textarea { font: inherit; }

button { color: inherit; }

button,
a,
input,
select,
textarea { -webkit-tap-highlight-color: transparent; }

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus { outline: none; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ui-color-primary);
  outline-offset: 2px;
}

img,
svg { display: block; }

h1,
h2,
h3,
strong,
b { font-weight: 600; }

code,
.number-cell,
.metric strong,
.summary-strip strong,
.health-score > strong,
.nav-count,
time { font-variant-numeric: tabular-nums; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.muted { color: var(--ui-color-text-muted); }

/* Shell and navigation */
.app-shell,
.app-shell.ready {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  filter: none;
  background: var(--ui-color-background);
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  padding: 24px 16px 18px;
  overflow-y: auto;
  border-right: 1px solid var(--ui-color-border);
  color: var(--ui-color-text);
  background: var(--ui-color-surface);
}

.brand,
.login-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-button {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand > span:last-child,
.login-brand > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.brand-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--ui-color-primary-strong), var(--ui-color-primary));
  box-shadow: 0 8px 18px rgba(53, 105, 185, .2);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
}

.brand strong,
.login-brand > span:last-child {
  display: block;
  font-size: 16px;
  letter-spacing: .04em;
}

.brand small,
.login-brand small {
  display: block;
  margin-top: 0;
  color: var(--ui-color-text-muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin-top: 28px;
}

.nav-group {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.nav-group-label {
  margin: 17px 11px 5px;
  color: var(--ui-color-text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
}

.nav-group-label:first-child { margin-top: 2px; }

.nav-item,
.nav-item:not(.active),
.nav-item.active {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 11px;
  align-items: center;
  justify-content: initial;
  gap: 10px;
  border: 0;
  border-radius: var(--ui-radius-control);
  color: var(--ui-color-text-secondary);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}

.nav-item:hover {
  color: var(--ui-color-text);
  background: var(--ui-color-surface-soft);
}

.nav-item.active {
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-primary-soft);
}

.nav-item > span:first-child,
.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: currentColor;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  opacity: .82;
}

img.nav-icon { object-fit: contain; }

.nav-count {
  display: inline-grid;
  min-width: 20px;
  min-height: 20px;
  margin-left: auto;
  padding: 1px 6px;
  place-items: center;
  border-radius: var(--ui-radius-pill);
  color: var(--ui-color-warning);
  background: var(--ui-color-warning-soft);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.nav-count:empty { display: none; }

.sidebar-foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.env-card {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 2px 10px;
  padding: 11px;
  border: 0;
  border-radius: 11px;
  color: var(--ui-color-text-secondary);
  background: var(--ui-color-surface-soft);
  font-size: 12px;
}

.env-card i,
.live i,
.order-sync-status::before,
.login-card footer i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--ui-color-success);
  box-shadow: 0 0 0 4px rgba(42, 138, 105, .12);
}

.env-card i { grid-row: span 2; }
.env-card > span { display: grid; min-width: 0; gap: 1px; }
.env-card small {
  color: var(--ui-color-text-muted);
  font-size: 10px;
}

.logout-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 9px 11px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--ui-radius-control);
  color: var(--ui-color-text-secondary);
  background: transparent;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.logout-button:hover {
  color: var(--ui-color-danger);
  background: var(--ui-color-danger-soft);
}

.logout-button img { width: 20px; height: 20px; flex: 0 0 20px; }

.workspace {
  min-width: 0;
  padding: 0;
  background: var(--ui-color-background);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 78px;
  padding: 14px clamp(20px, 3vw, 36px);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--ui-color-border);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}

.header-copy,
.topbar > div:first-of-type { min-width: 0; }

.eyebrow,
.edition {
  display: block;
  color: var(--ui-color-primary);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topbar h1 {
  max-width: min(70vw, 760px);
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ui-color-text);
  font-family: inherit;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--ui-color-text-secondary);
  font-size: 12px;
}

.operator-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  text-align: right;
}

.operator-copy { display: grid; max-width: 160px; min-width: 0; text-align: right; }
.operator-copy strong,
.operator-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator-copy strong { color: var(--ui-color-text); font-size: 12px; }
.operator-copy small { color: var(--ui-color-text-muted); font-size: 10px; }

.operator b,
.operator-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-primary-soft);
  font-weight: 600;
}

.mobile-menu,
.icon-button {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-control);
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-surface);
  cursor: pointer;
}

.icon-button { display: inline-grid; }
.icon-button img,
.icon-button svg,
.mobile-menu img,
.mobile-menu svg { width: 18px; height: 18px; }

.view-root {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px clamp(20px, 3vw, 36px) 48px;
}

/* Page headings and cards */
.section-stack {
  display: grid;
  min-width: 0;
  gap: 16px;
  animation: rise .24s ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(5px); }
}

.section-intro,
.panel-head,
.pagination,
.dialog-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-intro {
  align-items: flex-end;
  margin-bottom: 2px;
}

.section-intro > div,
.panel-copy,
.panel-head > div { min-width: 0; }

.section-intro strong {
  display: block;
  color: var(--ui-color-text);
  font-size: 20px;
  line-height: 1.35;
}

.section-intro p {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--ui-color-text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.fresh-status,
.security-note,
.table-caption {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  padding: 7px 10px;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  color: var(--ui-color-success);
  background: var(--ui-color-success-soft);
  font-size: 11px;
  line-height: 1.35;
}

.security-note {
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-primary-soft);
}

.processing-date {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  padding: 7px 10px;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-primary-soft);
  font-size: 11px;
  line-height: 1.35;
}

.fresh-status img,
.security-note img,
.processing-date img,
.table-caption img { width: 16px; height: 16px; flex: 0 0 16px; }

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-card);
  background: var(--ui-color-surface);
  box-shadow: var(--ui-shadow-card);
}

.panel h2 {
  margin: 0;
  color: var(--ui-color-text);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.panel-copy p,
.panel-head p {
  margin: 4px 0 0;
  color: var(--ui-color-text-secondary);
  font-size: 11px;
}

.panel-head > button { flex: 0 0 auto; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(270px, .8fr);
  gap: 14px;
  margin-top: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.metric {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 136px;
  padding: 18px;
  align-content: space-between;
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-card);
  background: var(--ui-color-surface);
  box-shadow: var(--ui-shadow-card);
}

.metric span,
.metric small {
  display: block;
  max-width: calc(100% - 34px);
  color: var(--ui-color-text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.metric strong {
  display: block;
  min-width: 0;
  margin: 10px 0 3px;
  overflow: hidden;
  color: var(--ui-color-text);
  font-family: inherit;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 650;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-icon {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 22px;
  height: 22px;
  opacity: .72;
}

.metric-hero {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(145deg, var(--ui-color-primary-strong), var(--ui-color-primary));
  box-shadow: 0 14px 28px rgba(53, 105, 185, .18);
}

.metric-hero strong { color: #fff; }
.metric-hero span,
.metric-hero small { color: rgba(255, 255, 255, .8); }
.metric-hero .metric-icon { filter: brightness(0) invert(1); opacity: .68; }
.metric small.hot { color: var(--ui-color-warning); }

.attention-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.attention-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 16px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 15px 0;
  align-items: center;
  gap: 11px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.attention-row:last-child { border-bottom: 0; }
.attention-row:hover > span strong { color: var(--ui-color-primary-strong); }

.attention-icon,
.attention-row > b:first-child {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-primary-soft);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.attention-icon img,
.attention-row > b:first-child img { width: 18px; height: 18px; }

.attention-row:nth-child(odd) .attention-icon {
  color: var(--ui-color-warning);
  background: var(--ui-color-warning-soft);
}

.attention-row > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.attention-row strong,
.attention-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-row small { color: var(--ui-color-text-secondary); font-size: 10px; }
.attention-row em { color: var(--ui-color-primary-strong); font-size: 14px; font-style: normal; font-weight: 600; }

.row-chevron,
.attention-row > img:last-child { width: 16px; height: 16px; opacity: .7; }

.tag {
  display: inline-flex;
  width: max-content;
  min-height: 26px;
  padding: 5px 9px;
  align-items: center;
  border-radius: var(--ui-radius-pill);
  color: var(--ui-color-text-secondary);
  background: #f2f4f7;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.tag.attention-total { color: var(--ui-color-warning); background: var(--ui-color-warning-soft); }

.health-score {
  display: flex;
  margin: 18px 0 16px;
  padding-bottom: 16px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eef2f7;
}

.health-score > strong {
  color: var(--ui-color-text);
  font-family: inherit;
  font-size: 38px;
  font-weight: 650;
  line-height: 1;
}

.health-score span,
.health-score small { display: block; font-size: 11px; }
.health-score small { margin-top: 3px; color: var(--ui-color-text-secondary); }

.order-bars { display: grid; gap: 0; margin-top: 16px; }
.order-bar {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  margin: 6px 0;
  align-items: center;
  gap: 10px;
  font-size: 10px;
}

.order-bar > i {
  height: 6px;
  overflow: hidden;
  border-radius: var(--ui-radius-pill);
  background: #edf1f6;
}

.order-bar > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ui-color-primary);
}

.width-10 { width: 10%; }
.width-20 { width: 20%; }
.width-30 { width: 30%; }
.width-40 { width: 40%; }
.width-50 { width: 50%; }
.width-60 { width: 60%; }
.width-70 { width: 70%; }
.width-80 { width: 80%; }
.width-90 { width: 90%; }
.width-100 { width: 100%; }

.order-bar strong {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.summary-strip > div {
  display: grid;
  min-width: 0;
  padding: 16px 18px;
  gap: 7px;
  border: 1px solid var(--ui-color-border);
  border-radius: 12px;
  background: var(--ui-color-surface);
  box-shadow: var(--ui-shadow-card);
}

.summary-strip span,
.summary-strip strong,
.summary-strip small { display: block; min-width: 0; }

.summary-strip span,
.summary-strip small { color: var(--ui-color-text-secondary); font-size: 10px; }

.summary-strip strong {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ui-color-text);
  font-family: inherit;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.25;
}

/* Controls */
.toolbar {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  padding: 12px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ui-color-border);
  border-radius: 12px;
  background: var(--ui-color-surface);
  box-shadow: var(--ui-shadow-card);
}

.compact-toolbar { justify-content: flex-start; }
.compact-toolbar > strong { margin-left: auto; color: var(--ui-color-text-secondary); font-size: 11px; }

.field { position: relative; min-width: 220px; flex: 1 1 320px; }
.select-field { display: inline-flex; min-width: 0; }

.search-field > img {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  transform: translateY(-50%);
}

.search-field input { padding-left: 38px; }

.field input,
.toolbar select,
.dialog-field input,
.dialog-field select,
.dialog-field textarea,
.login-card input {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #d8e0ea;
  border-radius: 9px;
  outline: none;
  color: var(--ui-color-text);
  background: var(--ui-color-surface);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.field input::placeholder,
.dialog-field input::placeholder,
.dialog-field textarea::placeholder,
.login-card input::placeholder { color: var(--ui-color-disabled-text); }

.field input:focus,
.toolbar select:focus,
.dialog-field input:focus,
.dialog-field select:focus,
.dialog-field textarea:focus,
.login-card input:focus {
  border-color: var(--ui-color-primary);
  box-shadow: var(--ui-shadow-focus);
}

.toolbar select { width: auto; min-width: 148px; cursor: pointer; }

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--ui-color-text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.button,
.login-button {
  display: inline-flex;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 9px 15px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.button:hover,
.login-button:hover { transform: translateY(-1px); }
.button:active,
.login-button:active { transform: translateY(0); }

.button:disabled,
.login-button:disabled {
  color: var(--ui-color-disabled-text);
  border-color: transparent;
  background: var(--ui-color-disabled-background);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.button.primary,
.login-button {
  color: #fff;
  background: var(--ui-color-primary);
  box-shadow: 0 7px 15px rgba(53, 105, 185, .16);
}

.button.primary:hover,
.login-button:hover { background: var(--ui-color-primary-strong); }

.button.secondary {
  border-color: #d8e0ea;
  color: var(--ui-color-text-secondary);
  background: var(--ui-color-surface);
}

.button.secondary:hover {
  border-color: #8baad7;
  color: var(--ui-color-primary-strong);
  background: #f7faff;
}

.button.danger {
  color: #fff;
  background: var(--ui-color-danger);
  box-shadow: 0 7px 15px rgba(182, 85, 80, .14);
}

.button.danger:hover { background: #a54a46; }

.button.danger-quiet {
  border-color: #f1c9c6;
  color: var(--ui-color-danger);
  background: #fffafa;
  box-shadow: none;
}

.button.danger-quiet:hover {
  border-color: #dda8a4;
  color: #9f4642;
  background: var(--ui-color-danger-soft);
}

.button.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 10px;
  white-space: nowrap;
}

.button.link {
  min-height: 32px;
  padding: 6px 0;
  border-color: transparent;
  color: var(--ui-color-primary);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}

.button.link:hover {
  color: var(--ui-color-primary-strong);
  background: transparent;
  transform: none;
}

.button:disabled,
.button:disabled:hover,
.login-button:disabled,
.login-button:disabled:hover {
  color: var(--ui-color-disabled-text);
  border-color: transparent;
  background: var(--ui-color-disabled-background);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.button.loading::before {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin .8s linear infinite;
}

.button-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.button.primary .button-icon,
.button.danger .button-icon,
.login-button .button-icon { filter: brightness(0) invert(1); }

/* Tables, tags and operational states */
.data-panel { overflow: hidden; padding: 0; }
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #c8d2df transparent;
}

.data-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table caption.table-caption {
  width: auto;
  margin: 12px 14px 0;
  text-align: left;
}

.data-table th {
  padding: 12px 14px;
  color: var(--ui-color-text-secondary);
  background: var(--ui-color-surface-soft);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .02em;
  text-align: left;
}

.data-table td {
  max-width: 360px;
  padding: 14px;
  border-top: 1px solid #eef2f7;
  color: var(--ui-color-text);
  font-size: 11px;
  line-height: 1.45;
  vertical-align: middle;
}

.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover td { background: #fafcff; }
.data-table strong,
.data-table small { display: block; min-width: 0; }

.data-table td > strong {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table small {
  max-width: 300px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ui-color-text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
}

.data-table code {
  padding: 3px 6px;
  border-radius: 6px;
  color: #344054;
  background: #f2f4f7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.number-cell { text-align: right !important; }

.long-cell {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-text { color: var(--ui-color-danger); }
.cell-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }

.status {
  display: inline-flex;
  width: max-content;
  min-height: 26px;
  padding: 5px 9px;
  align-items: center;
  gap: 6px;
  border-radius: var(--ui-radius-pill);
  color: var(--ui-color-text-secondary);
  background: #f2f4f7;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.pending,
.status.open,
.status.review,
.status.approved { color: var(--ui-color-warning); background: var(--ui-color-warning-soft); }

.status.verified,
.status.published,
.status.confirmed,
.status.paid,
.status.resolved { color: var(--ui-color-success); background: var(--ui-color-success-soft); }

.status.rejected,
.status.disabled,
.status.canceled,
.status.dismissed { color: var(--ui-color-danger); background: var(--ui-color-danger-soft); }

.status.unverified,
.status.draft { color: var(--ui-color-text-secondary); background: #f2f4f7; }

.role-tags { display: flex; max-width: 210px; flex-wrap: wrap; gap: 4px; }

.role-tag,
.issue-type {
  display: inline-flex;
  width: max-content;
  min-height: 24px;
  padding: 4px 8px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--ui-color-border);
  border-radius: 7px;
  color: var(--ui-color-text-secondary);
  background: var(--ui-color-surface);
  font-size: 9px;
  line-height: 1.2;
}

.role-tag.admin { border-color: var(--ui-color-primary); color: #fff; background: var(--ui-color-primary); }
.issue-type {
  border: 0;
  border-radius: var(--ui-radius-pill);
  color: var(--ui-color-warning);
  background: var(--ui-color-warning-soft);
  white-space: nowrap;
}

.pagination {
  padding: 12px 14px;
  border-top: 1px solid var(--ui-color-border);
  color: var(--ui-color-text-secondary);
  font-size: 10px;
}

.pagination > div,
.pagination div { display: flex; gap: 7px; }

.order-sync-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.order-sync-status {
  position: relative;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  max-width: 330px;
  padding: 8px 10px;
  align-items: center;
  gap: 2px 8px;
  border: 0;
  border-radius: 9px;
  color: var(--ui-color-text-secondary);
  background: var(--ui-color-surface-soft);
  font-size: 10px;
}

.order-sync-status::before { grid-row: span 2; margin: 0; content: ""; }
.order-sync-status b,
.order-sync-status small { grid-column: 2; min-width: 0; }
.order-sync-status b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.order-sync-status small { overflow-wrap: anywhere; color: var(--ui-color-text-muted); font-size: 9px; line-height: 1.4; }

.order-sync-status.running { color: var(--ui-color-warning); background: var(--ui-color-warning-soft); }
.order-sync-status.running::before { background: var(--ui-color-warning); box-shadow: 0 0 0 4px rgba(147, 96, 13, .12); }
.order-sync-status.idle::before { background: var(--ui-color-text-muted); box-shadow: 0 0 0 4px rgba(124, 137, 155, .12); }
.order-sync-status.succeeded { color: var(--ui-color-success); background: var(--ui-color-success-soft); }
.order-sync-status.failed { color: var(--ui-color-danger); background: var(--ui-color-danger-soft); }
.order-sync-status.failed::before { background: var(--ui-color-danger); box-shadow: 0 0 0 4px rgba(182, 85, 80, .12); }

/* Jutuike administrator endpoint catalog and safe request runner */
.jutuike-gateway-layout {
  display: grid;
  grid-template-columns: minmax(310px, .78fr) minmax(460px, 1.22fr);
  min-width: 0;
  align-items: start;
  gap: 14px;
}

.jutuike-catalog {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.jutuike-capability {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-card);
  background: var(--ui-color-surface);
  box-shadow: var(--ui-shadow-card);
}

.jutuike-capability > summary {
  display: flex;
  min-height: 46px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ui-color-text);
  background: var(--ui-color-surface-soft);
  cursor: pointer;
  list-style: none;
}

.jutuike-capability > summary::-webkit-details-marker { display: none; }
.jutuike-capability > summary::after {
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}

.jutuike-capability:not([open]) > summary::after { transform: rotate(-45deg); }
.jutuike-capability > summary span { flex: 1 1 auto; font-size: 12px; font-weight: 600; }
.jutuike-capability > summary small { color: var(--ui-color-text-muted); font-size: 10px; }

.jutuike-endpoint-list {
  display: grid;
  min-width: 0;
  padding: 6px;
  gap: 3px;
}

.jutuike-endpoint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 9px 10px;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ui-color-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.jutuike-endpoint:hover { background: var(--ui-color-surface-soft); }
.jutuike-endpoint.selected {
  border-color: #c6d8f2;
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-primary-soft);
}

.jutuike-endpoint > span:first-child { display: grid; min-width: 0; gap: 2px; }
.jutuike-endpoint strong,
.jutuike-endpoint small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jutuike-endpoint strong { font-size: 11px; }
.jutuike-endpoint small { color: var(--ui-color-text-muted); font-size: 9px; }

.jutuike-endpoint-state {
  min-width: 46px;
  padding: 4px 6px;
  border-radius: var(--ui-radius-pill);
  color: var(--ui-color-text-muted);
  background: #f2f4f7;
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
}

.jutuike-endpoint-state.available { color: var(--ui-color-success); background: var(--ui-color-success-soft); }

.jutuike-runner {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 116px);
  max-height: calc(100dvh - 116px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #c8d2df transparent;
}

.jutuike-runner-head { align-items: flex-start; }
.jutuike-runner-head .eyebrow { margin-bottom: 5px; font-size: 9px; }
.jutuike-runner-head h2 { margin-top: 2px; }
.jutuike-runner-head p code,
.jutuike-requirements code,
.jutuike-parameter code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #344054;
  background: #f2f4f7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.jutuike-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0 14px;
  overflow: hidden;
  border: 1px solid var(--ui-color-border);
  border-radius: 10px;
  background: var(--ui-color-surface-soft);
}

.jutuike-meta > span { display: grid; min-width: 0; padding: 10px 11px; gap: 2px; }
.jutuike-meta > span:nth-child(n + 4) { border-top: 1px solid var(--ui-color-border); }
.jutuike-meta > span:not(:nth-child(3n + 1)) { border-left: 1px solid var(--ui-color-border); }
.jutuike-meta small { color: var(--ui-color-text-muted); font-size: 9px; }
.jutuike-meta strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.jutuike-security-copy {
  display: flex;
  margin: 0 0 14px;
  padding: 10px 11px;
  align-items: flex-start;
  gap: 8px;
  border-radius: 9px;
  color: var(--ui-color-text-secondary);
  background: var(--ui-color-warning-soft);
  font-size: 10px;
  line-height: 1.6;
}

.jutuike-security-copy img { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.jutuike-unavailable {
  margin: 0 0 14px;
  padding: 10px 11px;
  border: 1px solid #efd6ad;
  border-radius: 9px;
  color: var(--ui-color-warning);
  background: #fffaf0;
  font-size: 10px;
}

.jutuike-form { min-width: 0; }
.jutuike-parameters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  gap: 11px;
}

.jutuike-parameter { display: grid; min-width: 0; gap: 6px; }
.jutuike-parameter > span { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; }
.jutuike-parameter em,
.jutuike-parameter small { flex: 0 0 auto; font-size: 9px; font-style: normal; }
.jutuike-parameter em { color: var(--ui-color-danger); }
.jutuike-parameter small { color: var(--ui-color-text-muted); }
.jutuike-parameter input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #d8e0ea;
  border-radius: 9px;
  color: var(--ui-color-text);
  background: var(--ui-color-surface);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.jutuike-parameter input:focus { border-color: var(--ui-color-primary); box-shadow: var(--ui-shadow-focus); }
.jutuike-no-parameters { margin: 0; color: var(--ui-color-text-muted); font-size: 11px; }
.jutuike-requirements { display: grid; margin-top: 12px; padding: 10px 11px; gap: 5px; border-radius: 9px; color: var(--ui-color-text-secondary); background: var(--ui-color-primary-soft); font-size: 10px; }
.jutuike-requirements strong { color: var(--ui-color-primary-strong); font-size: 10px; }
.jutuike-form-error { margin: 10px 0 0; }

.jutuike-form-actions {
  display: flex;
  margin-top: 15px;
  padding-top: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--ui-color-border);
}

.jutuike-form-actions > span { max-width: 330px; color: var(--ui-color-text-muted); font-size: 9px; line-height: 1.5; }
.jutuike-form-actions .button { flex: 0 0 auto; }

.jutuike-result { min-width: 0; margin-top: 18px; }
.jutuike-result > div { display: flex; margin-bottom: 7px; align-items: center; justify-content: space-between; gap: 10px; }
.jutuike-result > div strong { font-size: 11px; }
.jutuike-result > div small { color: var(--ui-color-text-muted); font-size: 9px; }
.jutuike-result pre {
  max-height: 420px;
  margin: 0;
  padding: 13px;
  overflow: auto;
  border: 1px solid #dce4ee;
  border-radius: 10px;
  color: #344054;
  background: #f7f9fc;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.jutuike-result pre.error { border-color: #efc7c4; color: var(--ui-color-danger); background: var(--ui-color-danger-soft); }
.jutuike-runner-empty { display: grid; min-height: 280px; place-items: center; align-content: center; gap: 6px; text-align: center; }
.jutuike-runner-empty strong { font-size: 16px; }
.jutuike-runner-empty p { margin: 0; color: var(--ui-color-text-muted); font-size: 11px; }

@media (max-width: 1100px) {
  .jutuike-gateway-layout { grid-template-columns: minmax(270px, .7fr) minmax(390px, 1.3fr); }
  .jutuike-parameters { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .jutuike-gateway-layout { grid-template-columns: 1fr; }
  .jutuike-runner { position: static; max-height: none; }
}

@media (max-width: 520px) {
  .jutuike-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jutuike-meta > span:nth-child(n + 3) { border-top: 1px solid var(--ui-color-border); }
  .jutuike-meta > span:not(:nth-child(3n + 1)) { border-left: 0; }
  .jutuike-meta > span:nth-child(even) { border-left: 1px solid var(--ui-color-border); }
  .jutuike-form-actions { align-items: stretch; flex-direction: column; }
  .jutuike-form-actions .button { width: 100%; }
}

/* Loading, empty and error states */
.loading-state,
.empty-state,
.error-state {
  display: grid;
  min-height: 340px;
  padding: 40px 24px;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-card);
  color: var(--ui-color-text-secondary);
  background: var(--ui-color-surface);
  box-shadow: var(--ui-shadow-card);
  text-align: center;
}

.loading-mark {
  width: 42px;
  height: 42px;
  border: 3px solid var(--ui-color-primary-soft);
  border-top-color: var(--ui-color-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-icon,
.state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 15px;
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-primary-soft);
}

.error-state .state-icon { color: var(--ui-color-danger); background: var(--ui-color-danger-soft); }
.empty-icon img,
.state-icon img,
.empty-icon svg,
.state-icon svg { width: 24px; height: 24px; }

.empty-state b,
.error-state b,
.empty-state h2,
.error-state h2 {
  margin: 0;
  color: var(--ui-color-text);
  font-family: inherit;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.empty-state p,
.error-state p {
  max-width: 480px;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ui-color-text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

/* Dialogs and notifications */
.action-dialog {
  width: min(480px, calc(100% - 28px));
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--ui-radius-dialog);
  color: var(--ui-color-text);
  background: var(--ui-color-surface);
  box-shadow: 0 28px 80px rgba(15, 35, 71, .28);
}

.action-dialog::backdrop { background: rgba(16, 24, 40, .55); backdrop-filter: blur(3px); }
.action-dialog form { position: relative; padding: 28px; }

.dialog-header {
  min-width: 0;
}

.dialog-header > p {
  margin: 0 0 20px;
  overflow-wrap: anywhere;
  color: var(--ui-color-text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 12px;
  color: var(--ui-color-primary-strong);
  background: var(--ui-color-primary-soft);
}

.dialog-icon img { width: 21px; height: 21px; }
.dialog-eyebrow { margin-bottom: 4px; }
.dialog-body { min-width: 0; }
.dialog-fields { min-width: 0; }

.action-dialog h2 {
  margin: 8px 44px 8px 0;
  overflow-wrap: anywhere;
  color: var(--ui-color-text);
  font-family: inherit;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.35;
}

.action-dialog form > p {
  margin: 0 0 20px;
  overflow-wrap: anywhere;
  color: var(--ui-color-text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--ui-color-text-secondary);
  background: #f2f4f7;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover { color: var(--ui-color-text); background: var(--ui-color-disabled-background); }

.dialog-object,
.dialog-warning {
  display: flex;
  margin: -5px 0 18px;
  padding: 10px 12px;
  align-items: flex-start;
  gap: 8px;
  overflow-wrap: anywhere;
  border-radius: 9px;
  color: #344054;
  background: var(--ui-color-surface-soft);
  font-size: 11px;
  line-height: 1.55;
}

.dialog-object::before,
.dialog-warning::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--ui-color-primary);
  content: "";
}

.dialog-warning { color: var(--ui-color-warning); background: var(--ui-color-warning-soft); }
.dialog-warning::before { background: var(--ui-color-warning); }

.dialog-field {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  color: var(--ui-color-text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.dialog-field textarea { min-height: 96px; resize: vertical; }
.dialog-field > span:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--ui-color-text-secondary);
}

.dialog-field > span:first-child em {
  color: var(--ui-color-danger);
  font-size: 10px;
  font-style: normal;
}

.dialog-field > span:first-child small {
  color: var(--ui-color-text-muted);
  font-size: 10px;
}
.dialog-actions { justify-content: flex-end; margin-top: 24px; }
.dialog-actions .button { min-width: 88px; }

.form-error {
  min-height: 18px;
  margin: -4px 0 0 !important;
  overflow-wrap: anywhere;
  color: var(--ui-color-danger) !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}

.toast-region {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  display: grid;
  max-width: min(380px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  min-width: 260px;
  padding: 12px 15px;
  align-items: center;
  gap: 9px;
  overflow-wrap: anywhere;
  border-radius: 10px;
  color: #fff;
  background: var(--ui-color-success);
  box-shadow: 0 12px 35px rgba(18, 76, 55, .22);
  font-size: 12px;
}

.toast img {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  filter: brightness(0) invert(1);
}

.toast.error { background: var(--ui-color-danger); }

/* Login */
.login-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(420px, .8fr);
  overflow: auto;
  color: var(--ui-color-text);
  background: var(--ui-color-surface);
}

.login-layer.hidden { display: none; }
.login-layer::before { display: none; }
.login-copy,
.login-card { position: relative; z-index: 1; }

.login-copy {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(44px, 6vw, 88px);
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .12), transparent 26%), linear-gradient(145deg, #0b3ea8, var(--ui-color-primary) 62%, #5b92ff);
}

.login-copy .edition { color: #d7e5ff; }
.login-copy .login-brand-light { color: #fff; }
.login-brand-light small { color: rgba(255, 255, 255, .7); }
.login-brand-light .brand-mark {
  color: var(--ui-color-primary-strong);
  background: #fff;
  box-shadow: 0 8px 18px rgba(13, 44, 105, .18);
}

.login-message { margin-block: auto; padding-block: 48px; }

.login-copy h2 {
  margin: 34px 0 18px;
  font-family: inherit;
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.login-copy h2 strong { color: #fff; font-weight: inherit; }

.login-message > p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  line-height: 1.9;
}

.login-proof {
  display: flex;
  margin-top: 50px;
  flex-wrap: wrap;
  gap: 30px;
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
}

.login-proof span {
  display: inline-flex;
  min-width: 150px;
  align-items: center;
  gap: 8px;
}
.login-proof img { width: 18px; height: 18px; flex: 0 0 18px; filter: brightness(0) invert(1); opacity: .9; }
.login-proof b {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

.login-card {
  align-self: center;
  width: min(410px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-dialog);
  color: var(--ui-color-text);
  background: var(--ui-color-surface);
  box-shadow: var(--ui-shadow-float);
}

.login-panel {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px;
  place-items: center;
  background: var(--ui-color-surface-soft);
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--ui-color-text);
  font-size: 15px;
  font-weight: 600;
}
.login-mobile-brand .brand-mark { width: 36px; height: 36px; flex-basis: 36px; font-size: 16px; }
.login-heading h1 { margin-bottom: 7px; }
.login-heading p { margin: 0; color: var(--ui-color-text-secondary); font-size: 12px; }

.login-brand { margin-bottom: 54px; color: var(--ui-color-text); }
.login-brand .brand-mark { width: 38px; height: 38px; flex-basis: 38px; font-size: 17px; }

.login-card h1 {
  margin: 8px 0 7px;
  color: var(--ui-color-text);
  font-family: inherit;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
}

.login-card > div > p { margin: 0 0 28px; color: var(--ui-color-text-secondary); font-size: 12px; }
.login-card form { display: grid; gap: 17px; }

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--ui-color-text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.login-button { width: 100%; min-height: 44px; margin-top: 2px; justify-content: center; }
.login-button b { margin-left: auto; font-size: 18px; font-weight: 400; }
.login-button > img { width: 17px; height: 17px; filter: brightness(0) invert(1); }

.password-field {
  position: relative;
  display: block;
  min-width: 0;
}

.password-field input { padding-right: 44px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--ui-color-text-muted);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover { background: var(--ui-color-surface-soft); }
.password-toggle img { width: 17px; height: 17px; }

.login-card footer {
  display: flex;
  margin-top: 30px;
  padding-top: 16px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-top: 1px solid #eef2f7;
  color: var(--ui-color-text-secondary);
  font-size: 10px;
}

.login-card footer i { display: inline-block; margin: 0; }
.login-card code { color: var(--ui-color-primary-strong); }

.mobile-overlay { display: none; }

@media (max-width: 1100px) {
  .app-shell,
  .app-shell.ready { grid-template-columns: 208px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .login-layer { grid-template-columns: minmax(340px, 1fr) minmax(380px, .8fr); }
}

/* 601–900 px: keep every navigation destination visible and readable. */
@media (min-width: 701px) and (max-width: 900px) {
  .app-shell,
  .app-shell.ready { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand > span:last-child,
  .nav-item,
  .nav-item:not(.active),
  .nav-item.active,
  .env-card { display: grid; }
  .nav-item,
  .nav-item:not(.active),
  .nav-item.active { justify-content: initial; padding-inline: 11px; font-size: 13px; }
  .topbar,
  .view-root { padding-left: 20px; padding-right: 20px; }
  .section-intro { align-items: flex-start; flex-direction: column; }
  .order-sync-actions { width: 100%; justify-content: flex-start; }
  .summary-strip {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

@media (max-width: 900px) {
  .login-layer {
    grid-template-columns: 1fr;
    align-content: center;
    background: var(--ui-color-surface-soft);
  }
  .login-copy { display: none; }
  .login-card { align-self: center; }
  .login-mobile-brand { display: flex; margin-bottom: 24px; }
}

@media (max-width: 700px) {
  .app-shell,
  .app-shell.ready { display: block; }

  .sidebar {
    position: fixed;
    z-index: 45;
    inset: 0 auto 0 0;
    display: flex;
    width: min(286px, calc(100vw - 48px));
    height: 100vh;
    height: 100dvh;
    padding: 22px 16px 18px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 20px 0 50px rgba(15, 35, 71, .18);
  }

  .sidebar.open { transform: translateX(0); }

  .brand > span:last-child,
  .nav-item,
  .nav-item:not(.active),
  .nav-item.active,
  .env-card { display: grid; }

  .nav-item,
  .nav-item:not(.active),
  .nav-item.active { justify-content: initial; padding-inline: 11px; font-size: 13px; }

  .mobile-overlay {
    position: fixed;
    z-index: 40;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(16, 24, 40, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .mobile-overlay.open,
  .mobile-overlay.is-open,
  .sidebar.open + .mobile-overlay { opacity: 1; pointer-events: auto; }

  .workspace { min-height: 100vh; min-height: 100dvh; padding: 0; }

  .topbar {
    min-height: 70px;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
  }

  .mobile-menu {
    display: grid;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-control);
    background: var(--ui-color-surface);
    font-size: 10px;
  }

  .topbar h1 { max-width: calc(100vw - 154px); font-size: 19px; }
  .operator { margin-left: auto; }
  .operator > span,
  .operator-copy { display: none; }
  .operator b,
  .operator-avatar { width: 36px; height: 36px; flex-basis: 36px; }

  .view-root { padding: 20px 16px 36px; }
  .section-intro { align-items: flex-start; flex-direction: column; }
  .section-intro > :last-child:not(:first-child),
  .fresh-status,
  .security-note { max-width: 100%; }
  .metric-grid,
  .summary-strip { grid-template-columns: 1fr; }
  .metric { min-height: 118px; }

  .toolbar { align-items: stretch; flex-direction: column; }
  .field { min-width: 0; flex-basis: auto; }
  .toolbar select,
  .select-field,
  .toolbar .button { width: 100%; }
  .compact-toolbar > strong { margin-left: 0; }

  .order-sync-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .order-sync-status { width: 100%; max-width: none; }
  .order-sync-actions .button { width: 100%; }

  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination > div,
  .pagination div { width: 100%; }
  .pagination .button { flex: 1 1 0; }

  .loading-state,
  .empty-state,
  .error-state { min-height: 300px; }

  .action-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }
  .action-dialog form { padding: 25px 20px 20px; }
  .action-dialog h2 { font-size: 21px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions .button { width: 100%; }

  .login-card { width: calc(100% - 28px); margin: 0 auto; padding: 28px 24px; }
  .login-brand { margin-bottom: 42px; }

  .toast-region { right: 16px; bottom: 16px; left: 16px; max-width: none; }
  .toast { width: 100%; min-width: 0; }
}

@media (max-width: 420px) {
  .topbar,
  .view-root { padding-left: 14px; padding-right: 14px; }
  .eyebrow { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .attention-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .row-chevron,
  .attention-row > img:last-child { display: none; }
  .cell-actions { flex-wrap: wrap; }
  .summary-strip strong { font-size: 19px; }
  .login-card { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (forced-colors: active) {
  .nav-item.active,
  .button,
  .status,
  .role-tag,
  .metric,
  .panel,
  .toolbar { border: 1px solid CanvasText; }
}
