/* OpsGrid Brand System — primitive → semantic → component tokens */
@font-face {
  font-family: "Geist OpsGrid";
  src: url("./fonts/geist-latin-variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Jakarta OpsGrid";
  src: url("./fonts/plus-jakarta-sans-latin-variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Primitive */
  --brand-black-1000: #050505;
  --brand-black-950: #09090b;
  --brand-black-900: #0d0d10;
  --brand-black-850: #121216;
  --brand-white: #f8f7fb;
  --brand-warm-white: #f7f8fb;
  --brand-card-white: #ffffff;
  --brand-purple: 124 92 255;
  --brand-emerald: 4 120 87;
  --brand-amber: 217 119 6;
  --brand-red: 220 38 38;
  --brand-blue: 37 99 235;

  /* Semantic — light theme is the default product surface */
  --surface-canvas: #f4f6fa;
  --surface-raised: #ffffff;
  --surface-raised-strong: #f8fafc;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --surface-field: #f8fafc;
  --surface-hover: #eef2f7;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-tertiary: #475569;
  --stroke-hairline: rgba(15, 23, 42, 0.1);
  --stroke-subtle: rgba(15, 23, 42, 0.06);
  --accent-primary: rgb(var(--brand-emerald));
  --accent-secondary: rgb(var(--brand-purple));
  --accent-warm: rgb(var(--brand-amber));
  --accent-danger: rgb(var(--brand-red));
  --motion-premium: cubic-bezier(0.32, 0.72, 0, 1);
  --duration-fast: 500ms;
  --duration-base: 680ms;
  --duration-slow: 820ms;
  /* Product default: Microsoft YaHei for all desktop UI text */
  --font-display: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-body: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-data: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-size-root: 15px;
  --font-size-nav-label: 0.95rem;
  --font-size-nav-item: 0.94rem;
  --font-size-body: 0.94rem;
  --font-size-meta: 0.78rem;
  --font-size-title: clamp(1.7rem, 2.6vw, 2.35rem);
  --space-section: clamp(6rem, 8vw, 10rem);
  --radius-tray: 2rem;
  --radius-core: calc(2rem - 0.375rem);
  --radius-control: 999px;
  --z-base: 0;
  --z-nav: 40;
  --z-overlay: 60;
  --z-modal: 80;
  --z-toast: 90;

  /* Compatibility aliases for the existing application */
  --ink: var(--surface-canvas);
  --ink-2: #e8edf5;
  --panel: var(--surface-raised);
  --panel-2: var(--surface-raised-strong);
  --line: var(--stroke-subtle);
  --line-strong: var(--stroke-hairline);
  --text: #0f172a;
  --muted: #334155;
  --dim: #475569;
  --mint: var(--accent-primary);
  --mint-dark: rgba(var(--brand-emerald), 0.12);
  --amber: var(--accent-warm);
  --red: var(--accent-danger);
  --blue: rgb(var(--brand-blue));
  --radius: var(--radius-tray);
  --mono: var(--font-data);
  --sans: var(--font-body);

  /* Component */
  --card-border: 1px solid var(--stroke-hairline);
  --card-inner-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(15, 23, 42, 0.03);
  --card-ambient-shadow: 0 18px 48px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --button-bg: rgba(15, 23, 42, 0.04);
  --button-primary-bg: rgba(var(--brand-emerald), 0.96);
  --button-primary-text: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
  --surface-canvas: var(--brand-black-1000);
  --surface-raised: rgba(255, 255, 255, 0.055);
  --surface-raised-strong: rgba(255, 255, 255, 0.075);
  --surface-glass: rgba(13, 13, 16, 0.72);
  --surface-field: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --text-primary: var(--brand-white);
  --text-secondary: rgba(248, 247, 251, 0.64);
  --text-tertiary: rgba(248, 247, 251, 0.38);
  --stroke-hairline: rgba(255, 255, 255, 0.1);
  --stroke-subtle: rgba(255, 255, 255, 0.055);
  --card-border: 1.5px solid var(--stroke-hairline);
  --card-inner-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.15), inset 0 -1px 0 rgba(255, 255, 255, 0.025);
  --card-ambient-shadow: 0 24px 80px rgba(0, 0, 0, 0.22), 0 0 80px rgba(var(--brand-purple), 0.025);
  --button-bg: rgba(255, 255, 255, 0.055);
  --button-primary-bg: rgba(var(--brand-emerald), 0.94);
  --button-primary-text: #ffffff;
  --nav-bg: rgba(10, 10, 12, 0.72);
  --ink: var(--surface-canvas);
  --ink-2: var(--brand-black-900);
  --panel: var(--surface-raised);
  --panel-2: var(--surface-raised-strong);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--brand-emerald), 0.24) transparent;
}

html {
  scroll-behavior: smooth;
  background: var(--surface-canvas);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(60rem 42rem at 78% -8%, rgba(var(--brand-purple), 0.08), transparent 66%),
    radial-gradient(44rem 36rem at -6% 72%, rgba(var(--brand-emerald), 0.07), transparent 68%),
    var(--surface-canvas);
  font-family: var(--font-body);
  font-size: var(--font-size-root);
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: var(--z-base);
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.08;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(15, 23, 42, 0.06) 0 0.55px, transparent 0.7px),
    radial-gradient(circle at 75% 75%, rgba(15, 23, 42, 0.04) 0 0.45px, transparent 0.6px);
  background-size: 6px 6px, 9px 9px;
  mix-blend-mode: multiply;
}

button,
input,
textarea,
select {
  font-family: var(--font-body);
}

button,
a,
input,
textarea,
select,
.panel,
.metric-card,
.iot-asset-card,
.document-card {
  transition-timing-function: var(--motion-premium);
}

button,
a,
.panel-link,
.link-button {
  -webkit-tap-highlight-color: transparent;
}

.link-button.danger {
  color: #f87171;
}

.link-button.is-disabled,
.link-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--text-tertiary, #94a3b8);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid rgba(var(--brand-emerald), 0.82);
  outline-offset: 4px;
}

::selection {
  color: #06120e;
  background: rgba(var(--brand-emerald), 0.82);
}

.skip-link {
  position: fixed;
  z-index: calc(var(--z-toast) + 1);
  top: 1rem;
  left: 50%;
  padding: 0.75rem 1.2rem;
  transform: translate3d(-50%, -180%, 0);
  border: var(--card-border);
  border-radius: var(--radius-control);
  background: var(--text-primary);
  color: var(--surface-canvas);
  font-size: 0.75rem;
  transition: transform var(--duration-fast) var(--motion-premium);
}

.skip-link:focus {
  transform: translate3d(-50%, 0, 0);
}

.ambient-field {
  position: fixed;
  z-index: var(--z-base);
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-field i {
  position: absolute;
  width: 34rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.08;
}

.ambient-field i:first-child {
  top: -18rem;
  right: 10%;
  background: rgb(var(--brand-purple));
}

.ambient-field i:last-child {
  bottom: -22rem;
  left: 8%;
  background: rgb(var(--brand-emerald));
}

/* Application shell */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.125rem;
  min-height: 100dvh;
  padding: 1.5rem;
}

.sidebar {
  position: sticky;
  z-index: var(--z-nav);
  top: 1.5rem;
  width: 18rem;
  height: calc(100dvh - 3rem);
  min-height: 0;
  flex-basis: 18rem;
  overflow: auto;
  padding: 1.5rem 1rem 1rem;
  border: var(--card-border);
  border-radius: var(--radius-tray);
  background: var(--nav-bg);
  box-shadow: var(--card-inner-highlight), var(--card-ambient-shadow);
  backdrop-filter: blur(28px) saturate(128%);
}

.sidebar::after,
.topbar::after {
  position: absolute;
  inset: 0.4rem;
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: calc(var(--radius-tray) - 0.4rem);
  pointer-events: none;
  content: "";
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.brand-lockup {
  gap: 0.8rem;
  padding: 0.25rem 0.7rem 2rem;
}

.brand-mark {
  height: 1.7rem;
  filter: drop-shadow(0 0 12px rgba(var(--brand-emerald), 0.32));
}

.brand-mark span {
  width: 0.3rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--accent-primary));
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
}

.brand-subtitle {
  margin-top: 0.28rem;
  color: var(--text-tertiary);
  font-size: var(--font-size-meta);
  letter-spacing: 0.02em;
  text-transform: none;
}

.site-switcher {
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 0.85rem 0.9rem;
  border: var(--card-border);
  border-radius: 1.2rem;
  background: var(--surface-raised);
  box-shadow: var(--card-inner-highlight);
  transition: transform var(--duration-fast) var(--motion-premium);
}

.site-switcher > div {
  min-width: 0;
  flex: 1;
}

.site-switcher strong,
.site-switcher small,
#site-name,
#site-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-switcher:hover {
  transform: translate3d(0, -2px, 0);
  border-color: rgba(var(--brand-emerald), 0.28);
  background: var(--surface-hover);
}

.site-switcher strong {
  font-size: 0.88rem;
  font-weight: 650;
}

.site-switcher small {
  margin-top: 0.25rem;
  font-size: var(--font-size-meta);
}

.status-dot {
  background: var(--accent-primary);
  box-shadow: 0 0 0 0.3rem rgba(var(--brand-emerald), 0.08), 0 0 1.2rem rgba(var(--brand-emerald), 0.35);
}

.nav-groups {
  gap: 1.65rem;
}

.nav-group {
  gap: 0.25rem;
}

.nav-label,
.eyebrow,
.demo-badge,
.live-pulse,
.document-hero-mark,
.iot-fleet-head > div:first-child > span {
  width: fit-content;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-control);
  color: rgba(var(--brand-emerald), 0.95);
  background: rgba(var(--brand-emerald), 0.08);
  font-family: var(--font-body);
  font-size: var(--font-size-meta);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-transform: none;
}

.nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: calc(100% - 0.5rem);
  margin: 0.25rem 0.35rem 0.5rem;
  padding: 0.4rem 0.55rem;
  color: var(--text-primary);
  background: transparent;
  font-size: var(--font-size-nav-label);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  white-space: nowrap;
}

.nav-group a {
  position: relative;
  gap: 0.8rem;
  min-height: 2.55rem;
  padding: 0.72rem 0.85rem;
  border-radius: 1rem;
  color: var(--text-secondary);
  font-size: var(--font-size-nav-item);
  font-weight: 500;
  line-height: 1.4;
  transition: transform var(--duration-fast) var(--motion-premium);
}

.nav-group a:hover {
  transform: translate3d(0.2rem, 0, 0);
  color: var(--text-primary);
  background: var(--surface-hover);
}

.nav-group a.active {
  color: var(--text-primary);
  background:
    radial-gradient(circle at 16% 50%, rgba(var(--brand-emerald), 0.14), transparent 42%),
    var(--surface-hover);
  box-shadow: var(--card-inner-highlight);
}

.nav-group a.active::before {
  position: absolute;
  top: 50%;
  left: -0.05rem;
  width: 0.24rem;
  height: 1.15rem;
  transform: translate3d(0, -50%, 0);
  border-radius: 999px;
  background: var(--accent-primary);
  content: "";
  box-shadow: 0 0 1.25rem rgba(var(--brand-emerald), 0.6);
}

.nav-icon {
  color: var(--text-tertiary);
  font-size: 1.05rem;
}

.nav-text {
  font-size: inherit;
  font-weight: inherit;
}

.active .nav-icon {
  color: var(--accent-primary);
}

.nav-count {
  min-width: 1.7rem;
  margin-left: auto;
  padding: 0.22rem 0.48rem;
  border: 1px solid rgba(var(--brand-blue), 0.12);
  border-radius: 999px;
  color: rgb(var(--brand-blue));
  background: rgba(var(--brand-blue), 0.07);
  font-family: var(--font-data);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.nav-count.amber {
  border-color: rgba(var(--brand-amber), 0.12);
  color: var(--accent-warm);
  background: rgba(var(--brand-amber), 0.065);
}

.nav-count.red {
  border-color: rgba(var(--brand-red), 0.12);
  color: var(--accent-danger);
  background: rgba(var(--brand-red), 0.065);
}

.sync-card,
.user-chip {
  border-top: 1px solid var(--stroke-subtle);
}

.sync-heading {
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

.sync-line {
  height: 0.2rem;
  background: var(--surface-raised-strong);
}

.sync-line i {
  background: linear-gradient(90deg, rgba(var(--brand-purple), 0.8), var(--accent-primary));
  box-shadow: 0 0 1rem rgba(var(--brand-emerald), 0.35);
}

.user-chip {
  border-radius: 1.25rem;
  transition: transform var(--duration-fast) var(--motion-premium);
}

.user-chip:hover {
  transform: translate3d(0, -2px, 0);
  background: var(--surface-hover);
}

.avatar,
.top-avatar {
  border: 1px solid rgba(var(--brand-purple), 0.22);
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.2), transparent 30%), rgba(var(--brand-purple), 0.18);
  color: var(--text-primary);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14), 0 0 1.5rem rgba(var(--brand-purple), 0.12);
}

.main-content {
  min-width: 0;
  flex: 1;
}

.topbar {
  position: sticky;
  z-index: var(--z-nav);
  top: 1.5rem;
  height: 4rem;
  margin: 0;
  padding: 0 1.2rem 0 1.55rem;
  border: var(--card-border);
  border-radius: var(--radius-control);
  background: var(--nav-bg);
  box-shadow: var(--card-inner-highlight), var(--card-ambient-shadow);
  backdrop-filter: blur(28px) saturate(130%);
}

.breadcrumbs {
  gap: 0.7rem;
  color: var(--text-tertiary);
  font-size: var(--font-size-meta);
}

.breadcrumbs strong {
  color: var(--text-primary);
  font-weight: 620;
}

.top-actions {
  gap: 0.45rem;
}

.demo-badge {
  border: 1px solid rgba(var(--brand-amber), 0.14);
  color: var(--accent-warm);
  background: rgba(var(--brand-amber), 0.055);
}

.icon-button,
.menu-toggle {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  transition: transform var(--duration-fast) var(--motion-premium);
}

.icon-button:hover,
.menu-toggle:hover {
  transform: scale(1.04);
  border-color: var(--stroke-hairline);
  color: var(--text-primary);
  background: var(--surface-hover);
}

.icon-button:active,
.menu-toggle:active {
  transform: scale(0.96);
}

.menu-toggle {
  display: none;
  position: relative;
}

.menu-toggle span {
  position: absolute;
  width: 1rem;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transition: transform var(--duration-fast) var(--motion-premium), opacity var(--duration-fast) var(--motion-premium);
}

.menu-toggle span:first-child {
  transform: translate3d(0, -0.28rem, 0);
}

.menu-toggle span:last-child {
  transform: translate3d(0, 0.28rem, 0);
}

body.nav-open .menu-toggle span:first-child {
  transform: rotate(45deg);
}

body.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .menu-toggle span:last-child {
  transform: rotate(-45deg);
}

.nav-scrim {
  display: none;
}

.page-root {
  max-width: 94rem;
  padding: var(--space-section) clamp(1.5rem, 3vw, 3.4rem) 8rem;
}

/* Typography */
.page-heading {
  align-items: flex-end;
  margin-bottom: clamp(3rem, 5vw, 5rem);
}

.page-heading > div:first-child {
  max-width: 58rem;
}

.page-heading h1,
.document-hero h2,
.iot-fleet-head h2,
.detail-title h2,
.modal h2 {
  font-family: var(--font-display);
  font-weight: 820;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.page-heading h1 {
  max-width: 16ch;
  font-size: clamp(2.75rem, 5vw, 5.7rem);
  line-height: 0.95;
}

.page-heading p {
  max-width: 62ch;
  margin-top: 1.2rem;
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  line-height: 1.72;
  text-wrap: pretty;
}

.eyebrow {
  margin-bottom: 1.25rem;
}

.code,
.metric-value,
.iot-metric strong,
.iot-card-metrics strong,
.iot-realtime-grid strong,
time,
td,
.nav-count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

.code {
  font-family: var(--font-data);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

/* Controls */
.heading-actions,
.modal-actions,
.row-actions,
.document-card-actions {
  gap: 0.65rem;
}

.button {
  min-height: 2.75rem;
  padding: 0.72rem 1.2rem;
  border: var(--card-border);
  border-radius: var(--radius-control);
  background: var(--button-bg);
  color: var(--text-primary);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform var(--duration-fast) var(--motion-premium);
}

.button:hover {
  transform: scale(1.02);
  border-color: rgba(var(--brand-emerald), 0.28);
  color: var(--text-primary);
  background: var(--surface-hover);
}

.button:active {
  transform: scale(0.98);
}

.button.primary {
  border-color: rgba(var(--brand-emerald), 0.48);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.42), transparent 36%),
    var(--button-primary-bg);
  color: #ffffff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 0 2rem rgba(var(--brand-emerald), 0.13);
  font-weight: 720;
}

.button.primary:hover {
  border-color: rgba(var(--brand-emerald), 0.72);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.48), transparent 38%),
    rgba(var(--brand-emerald), 1);
  color: var(--button-primary-text);
}

.heading-actions .button.primary > span:last-child {
  display: inline-grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  font-size: 0.78rem;
}

.button.ghost {
  background: rgba(15, 23, 42, 0.03);
}

.button.danger {
  border-color: rgba(var(--brand-red), 0.2);
  color: var(--accent-danger);
  background: rgba(var(--brand-red), 0.04);
}

.button.small {
  min-height: 2.2rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
}

.link-button,
.panel-link {
  color: var(--accent-primary);
  font-weight: 400;
  transition: transform var(--duration-fast) var(--motion-premium), opacity var(--duration-fast) var(--motion-premium);
}

.link-button:hover,
.panel-link:hover {
  transform: translate3d(0.15rem, 0, 0);
  color: var(--text-primary);
}

/* Doppelrand cards */
.panel,
.metric-card,
.setting-card,
.document-card,
.iot-fleet,
.iot-metric,
.iot-asset-card,
.iot-realtime-hero,
.iot-trend-chart,
.iot-alarm-list article,
.iot-maintenance-groups section,
.permission-editor,
.user-directory-panel,
.role-summary-card,
.user-card {
  position: relative;
  border: var(--card-border);
  border-radius: var(--radius-tray);
  background:
    radial-gradient(circle at 92% -8%, rgba(var(--brand-purple), 0.075), transparent 38%),
    var(--surface-raised);
  box-shadow: var(--card-inner-highlight), var(--card-ambient-shadow);
}

.panel::before,
.metric-card::before,
.setting-card::before,
.document-card::before,
.iot-fleet::before,
.iot-metric::before,
.iot-asset-card::after,
.iot-realtime-hero::before,
.iot-trend-chart::before,
.permission-editor::before,
.user-directory-panel::before,
.role-summary-card::before,
.user-card::before {
  position: absolute;
  z-index: 0;
  inset: 0.42rem;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-core);
  pointer-events: none;
  content: "";
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.09);
}

.panel > *,
.metric-card > *,
.setting-card > *,
.document-card > *,
.iot-fleet > *,
.iot-metric > *,
.iot-asset-card > *,
.iot-realtime-hero > *,
.iot-trend-chart > *,
.permission-editor > *,
.user-directory-panel > *,
.role-summary-card > *,
.user-card > * {
  position: relative;
  z-index: 1;
}

.panel {
  padding: clamp(1.75rem, 2.5vw, 2.6rem);
}

.metric-grid {
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  min-height: 10.5rem;
  padding: 1.8rem;
  overflow: hidden;
}

.metric-card::after {
  right: -4rem;
  bottom: -5.5rem;
  width: 10rem;
  height: 10rem;
  border: 1px solid rgba(var(--brand-emerald), 0.09);
  background: radial-gradient(circle, rgba(var(--brand-emerald), 0.08), transparent 68%);
}

.metric-label {
  color: var(--text-secondary);
  font-size: 0.68rem;
}

.metric-label span {
  font-family: var(--font-data);
  color: var(--text-tertiary);
}

.metric-value {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.25rem);
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.metric-foot {
  margin-top: 0.9rem;
  color: var(--text-tertiary);
  font-size: 0.64rem;
}

.grid {
  gap: 1.25rem;
}

.dashboard-main {
  grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 0.75fr);
  margin-bottom: 1.25rem;
}

.dashboard-bottom {
  grid-template-columns: minmax(18rem, 0.78fr) minmax(0, 1.22fr);
}

.settings-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.settings-grid > :nth-child(3) {
  grid-column: 1 / -1;
}

.panel-heading {
  margin-bottom: 2rem;
}

.panel-heading h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.panel-heading p {
  margin-top: 0.5rem;
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

.signal-card {
  min-height: 20rem;
  height: auto;
  background:
    radial-gradient(circle at 18% 18%, rgba(var(--brand-emerald), 0.11), transparent 34%),
    radial-gradient(circle at 86% 6%, rgba(var(--brand-purple), 0.1), transparent 32%),
    var(--surface-raised);
}

.task-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--stroke-subtle);
}

.task-info strong {
  font-size: 0.75rem;
  font-weight: 610;
}

.task-info small,
.task-status {
  font-size: 0.61rem;
}

/* Data tables */
.table-panel {
  padding: 0.5rem;
  overflow: visible;
}

.table-toolbar {
  gap: 1rem;
  padding: 1.3rem 1.4rem;
  border-bottom: 1px solid var(--stroke-subtle);
}

.search-box,
.filter-select,
.field input,
.field textarea,
.field select,
.document-search,
.iot-control-bar select,
.iot-detail-toolbar select {
  border: var(--card-border);
  border-radius: 1rem;
  background: var(--surface-field);
  color: var(--text-primary);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.055);
  transition: transform var(--duration-fast) var(--motion-premium);
}

.search-box:focus-within,
.field input:focus,
.field textarea:focus,
.field select:focus,
.document-search:focus-within,
.filter-select:focus {
  transform: translate3d(0, -1px, 0);
  border-color: rgba(var(--brand-emerald), 0.34);
  background: rgba(var(--brand-emerald), 0.045);
}

/* Restore a recognizable dropdown for <select> inside modals.
   brand-system's earlier `.field select` rule resets the background to a light
   surface and never sets `appearance`, so on Chrome 130+ the control renders
   as a flat bar with no visible arrow — users perceive it as locked. Force a
   dark surface, hide the native widget, and paint a crisp custom caret via
   inline SVG so the dropdown affordance is unambiguous across browsers. */
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  /* Dark surface matching .field input; readable in the dark modal theme. */
  background-color: #0a1b27 !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px 14px;
  padding-right: 2.4rem !important; /* beat the later `.field select { padding: 0.85rem 1rem }` shorthand */
  /* Light text on dark surface — the global color rule no longer forces dark
     text on `.field select` (we removed it from that rule list). */
  color: #f4f6fa;
}

/* Keep the option list readable when the native dropdown pops open. */
.field select option {
  background-color: #0a1b27;
  color: #f4f6fa;
}

.search-box {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-control);
}

.search-box input {
  color: var(--text-primary);
  font-size: 0.72rem;
}

.filter-select {
  padding: 0.7rem 1rem;
  font-size: 0.68rem;
}

/* Compact action dropdown inside table rows (e.g. BOM stock operations). */
.row-action-select {
  min-width: 7.5rem;
  max-width: 10rem;
  padding: 0.45rem 1.9rem 0.45rem 0.7rem;
  font-size: 0.68rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 12px 12px;
}

.table-wrap {
  border-radius: 1.45rem;
  background: rgba(15, 23, 42, 0.05);
}

table {
  font-size: 0.72rem;
}

th {
  padding: 1rem 1.4rem;
  color: var(--text-tertiary);
  background: rgba(15, 23, 42, 0.03);
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 540;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

td {
  padding: 1.15rem 1.4rem;
  border-top: 1px solid var(--stroke-subtle);
  color: rgba(248, 247, 251, 0.76);
}

tr:hover td {
  background: rgba(var(--brand-emerald), 0.025);
}

.status,
.task-status,
.document-state,
.iot-readonly {
  min-height: 1.55rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-control);
  background: rgba(var(--brand-emerald), 0.055);
  font-size: 0.72rem;
}

.status::before {
  box-shadow: 0 0 0.8rem currentColor;
}

.notice-strip {
  gap: 0.8rem;
  margin-bottom: 1.25rem;
  padding: 0.95rem 1.2rem;
  border: 1.5px solid rgba(var(--brand-amber), 0.14);
  border-radius: var(--radius-control);
  color: var(--accent-warm);
  background: rgba(var(--brand-amber), 0.045);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.045);
  font-size: 0.67rem;
}

.empty-state,
.document-empty,
.iot-empty,
.iot-detail-empty {
  border-color: var(--stroke-hairline);
  border-radius: var(--radius-tray);
  color: var(--text-secondary);
  background: radial-gradient(circle at 50% 0%, rgba(var(--brand-purple), 0.07), transparent 52%);
}

/* Modals and feedback */
.modal-backdrop {
  z-index: var(--z-modal);
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(18px) saturate(120%);
  animation: brandFade var(--duration-fast) var(--motion-premium) both;
}

.modal {
  width: min(38rem, 100%);
  max-height: min(86dvh, 56rem);
  overflow: auto;
  padding: 0.5rem;
  border: var(--card-border);
  border-radius: var(--radius-tray);
  background: var(--surface-raised-strong);
  box-shadow: var(--card-inner-highlight), 0 28px 80px rgba(15, 23, 42, 0.16), 0 0 40px rgba(var(--brand-purple), 0.05);
  animation: brandModalIn var(--duration-base) var(--motion-premium) both;
}

.modal-header,
.modal-body,
.modal-actions {
  padding-right: 1.5rem;
  padding-left: 1.5rem;
}

.modal-header {
  padding-top: 1.5rem;
}

.modal-body {
  padding-bottom: 0.5rem;
}

.modal-actions {
  padding-bottom: 1.5rem;
}

.modal h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1;
}

.modal-close {
  border: var(--card-border);
  border-radius: 50%;
  background: var(--surface-field);
  color: var(--text-primary);
}

.field {
  margin: 1.2rem 0;
}

.field label {
  margin-bottom: 0.55rem;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
}

.toast {
  z-index: var(--z-toast);
  right: 1.5rem;
  bottom: 1.5rem;
  border: 1.5px solid rgba(var(--brand-emerald), 0.18);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-primary);
  box-shadow: var(--card-inner-highlight), 0 18px 48px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
  animation: toast-in var(--duration-base) var(--motion-premium);
}

.toast.error {
  border-color: rgba(var(--brand-red), 0.2);
  background: rgba(254, 242, 242, 0.98);
  color: #991b1b;
}

/* Knowledge, user management and IoT inherit the same visual language */
.document-hero,
.user-hero,
.role-summary,
.iot-control-bar {
  border: var(--card-border);
  border-radius: var(--radius-tray);
  background:
    radial-gradient(circle at 86% 0%, rgba(var(--brand-purple), 0.12), transparent 42%),
    radial-gradient(circle at 8% 100%, rgba(var(--brand-emerald), 0.07), transparent 48%),
    var(--surface-raised);
  box-shadow: var(--card-inner-highlight);
}

.document-hero,
.user-hero {
  padding: clamp(1.35rem, 2.4vw, 2.1rem) clamp(1.35rem, 2.6vw, 2.4rem);
}

.document-hero h2 {
  max-width: min(42ch, 100%);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.2;
}

.user-hero h2 {
  max-width: 18ch;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.document-hero p {
  max-width: 62ch;
  font-size: 0.9rem;
  line-height: 1.6;
}

.document-card {
  overflow: hidden;
}

.document-spine {
  background: rgba(var(--brand-purple), 0.07);
}

/* Knowledge cards: denser layout and readable type scale */
.document-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 0.9rem;
  align-items: stretch;
}

.document-card-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.1rem 0.9rem;
}

.document-card h2 {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.document-reference .code {
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.document-reference b {
  font-size: 0.72rem;
  font-weight: 400;
}

.document-scope {
  max-width: 42%;
  font-size: 0.72rem;
  line-height: 1.4;
}

.document-scope strong {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
}

.document-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.document-tags span,
.document-section-title span,
.document-section-title small,
.document-file strong,
.document-no-file,
.document-pagination {
  font-size: 0.84rem;
  line-height: 1.4;
}

.document-tags span {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
}

.document-file small,
.document-section-title small,
.document-pagination {
  font-size: 0.78rem;
}

.document-file {
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
}

.document-file strong {
  max-width: 15rem;
  font-weight: 400;
}

.document-card-actions {
  margin-top: auto;
  padding-top: 0.2rem;
}

.document-metrics span {
  font-size: 0.9rem;
  font-weight: 400;
}

.document-metrics strong {
  font-size: 0.9rem;
  font-weight: 400;
}

.document-search input {
  font-size: 0.9rem;
}

.document-file,
.permission-choice,
.permission-preset {
  border: var(--card-border);
  border-radius: 1rem;
  background: var(--surface-field);
  transition: transform var(--duration-fast) var(--motion-premium);
}

.document-file:hover,
.permission-choice:hover,
.permission-preset:hover {
  transform: translate3d(0, -2px, 0);
}

.iot-control-bar {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
}

.iot-metrics {
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.iot-metric {
  padding: 1.2rem;
}

/* IoT KPI card titles must stay readable on wallboard density */
.iot-metric > span {
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.3;
}

.iot-metric strong {
  font-size: 1.25rem;
  line-height: 1.15;
}

.iot-metric small {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  line-height: 1.35;
}

.iot-fleet {
  padding: clamp(1.25rem, 2vw, 1.75rem);
}

.iot-fleet-head h2 {
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.25;
}

.iot-fleet-head p,
.iot-legend {
  font-size: 0.84rem;
  line-height: 1.45;
}

.iot-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.iot-asset-card {
  display: flex;
  min-height: 196px;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.95rem 1rem 0.85rem;
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 92% 0%, rgba(var(--brand-purple), 0.08), transparent 42%),
    var(--surface-raised);
  transition: transform var(--duration-fast) var(--motion-premium), opacity var(--duration-fast) var(--motion-premium);
  filter: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.iot-asset-card:hover {
  transform: translate3d(0, -0.2rem, 0);
  border-color: rgba(var(--brand-emerald), 0.24);
  background: var(--surface-raised-strong);
  box-shadow: var(--card-inner-highlight), 0 18px 40px rgba(15, 23, 42, 0.1);
}

.iot-card-signal {
  font-size: 0.78rem;
  font-weight: 400;
}

.iot-card-title .code {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.iot-card-title h3 {
  margin: 0.35rem 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
}

.iot-card-title p {
  font-size: 0.78rem;
  line-height: 1.4;
}

.iot-card-metrics {
  gap: 0.5rem;
  min-height: 3.25rem;
  margin-top: auto;
}

.iot-card-metrics > span,
.iot-no-metric {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--stroke-subtle);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.06);
}

.iot-card-metrics small {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.iot-card-metrics strong {
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.iot-card-alarm {
  font-size: 0.78rem;
  font-weight: 400;
}

.iot-card-foot {
  font-size: 0.72rem;
  line-height: 1.3;
}

.iot-fleet > footer,
.iot-fleet > footer button {
  font-size: 0.78rem;
}

.iot-drawer-backdrop {
  z-index: var(--z-overlay);
  background: rgba(5, 5, 5, 0.68);
  backdrop-filter: blur(18px);
}

.iot-drawer {
  border-left: var(--card-border);
  background:
    radial-gradient(circle at 90% 0%, rgba(var(--brand-purple), 0.12), transparent 32%),
    var(--brand-black-900);
  box-shadow: -24px 0 80px rgba(15, 23, 42, 0.12);
  animation: iotDrawerIn var(--duration-base) var(--motion-premium);
}

.iot-drawer-loading span {
  animation: iotSpin 1.2s var(--motion-premium) infinite;
}

.iot-realtime-hero,
.iot-trend-chart {
  padding: 1.6rem;
}

/* Scroll entrance — keep light surfaces readable while animating */
.reveal-item {
  opacity: 0.001;
  transform: translate3d(0, 0.85rem, 0);
  transition:
    transform var(--duration-base) var(--motion-premium),
    opacity var(--duration-base) var(--motion-premium);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes brandFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes brandModalIn {
  from { opacity: 0; transform: translate3d(0, 2rem, 0) scale(0.975); filter: blur(10px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate3d(0, 1.25rem, 0) scale(0.98); filter: blur(8px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

@keyframes iotDrawerIn {
  from { opacity: 0; transform: translate3d(3rem, 0, 0); filter: blur(10px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

@keyframes iotPulse {
  50% { opacity: 0.35; transform: scale(0.82); }
}

@keyframes iotSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1120px) {
  .app-shell { padding: 1rem; }
  .sidebar { top: 1rem; height: calc(100dvh - 2rem); }
  .topbar { top: 1rem; }
  .dashboard-main,
  .dashboard-bottom,
  .detail-layout { grid-template-columns: 1fr; }
  .page-root { padding-right: 1.5rem; padding-left: 1.5rem; }
}

@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .app-shell {
    display: block;
    padding: 0.75rem;
  }

  .main-content,
  .page-root,
  .page-heading,
  .metric-grid,
  .dashboard-main,
  .dashboard-bottom,
  .panel {
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    position: fixed;
    top: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: min(20rem, calc(100vw - 1.5rem));
    height: auto;
    min-height: 0;
    padding: 1.35rem 1rem 1rem;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(calc(-100% - 1.5rem), 0, 0);
    transition: transform var(--duration-base) var(--motion-premium), opacity var(--duration-base) var(--motion-premium);
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .sidebar {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
  }

  .nav-scrim {
    position: fixed;
    z-index: calc(var(--z-nav) - 1);
    inset: 0;
    display: block;
    border: 0;
    background: rgba(5, 5, 5, 0.58);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(8px);
    transition: opacity var(--duration-base) var(--motion-premium);
  }

  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .brand-name,
  .brand-subtitle,
  .site-switcher div,
  .site-switcher .chevron,
  .nav-label,
  .nav-group a,
  .user-chip div:not(.avatar),
  .user-chip .more {
    display: initial;
    font-size: revert;
  }

  .nav-label {
    display: block;
    font-size: 0.625rem;
  }

  .nav-group a {
    display: flex;
    justify-content: flex-start;
    padding: 0.75rem 0.8rem;
    font-size: 0.76rem;
  }

  .nav-count {
    display: inline-flex;
  }

  .site-switcher {
    justify-content: flex-start;
    padding: 0.85rem 0.9rem;
  }

  .sync-card {
    display: block;
  }

  .user-chip {
    justify-content: flex-start;
    padding: 0.75rem;
  }

  .menu-toggle {
    display: grid;
  }

  .topbar {
    top: 0.75rem;
    min-height: 3.8rem;
    padding: 0 0.65rem;
  }

  .breadcrumbs span,
  .breadcrumbs b,
  .demo-badge,
  .top-actions .icon-button[aria-label="搜索"] {
    display: none;
  }

  .breadcrumbs strong {
    max-width: 9rem;
    overflow: hidden;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-root {
    padding: 6rem 0.25rem 5rem;
  }

  .page-heading {
    margin-bottom: 3rem;
  }

  .page-heading h1 {
    width: 100%;
    max-width: 100%;
    font-size: clamp(2.55rem, 12.8vw, 3rem);
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .page-heading p {
    font-size: 0.78rem;
  }

  .heading-actions {
    display: flex;
    width: 100%;
    flex-direction: column;
    flex-wrap: wrap;
    margin-top: 1.75rem;
  }

  .heading-actions .button {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-card {
    min-height: 9rem;
  }

  .panel {
    padding: 1.35rem;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid > :nth-child(3) {
    grid-column: auto;
  }

  .table-toolbar,
  .toolbar-left {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-left {
    display: flex;
  }

  .search-box,
  .filter-select {
    width: 100%;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0.75rem;
  }

  .modal {
    max-height: calc(100dvh - 1.5rem);
    border-radius: 1.65rem;
  }

  .iot-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .iot-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .iot-metrics { grid-template-columns: 1fr; }
  .top-avatar { display: none; }
  .metric-value { font-size: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-item {
    opacity: 1;
    filter: none;
    transform: none;
  }
}


/* OpsGrid typography scale — Microsoft YaHei */
html {
  font-size: 16px;
}

body,
button,
input,
textarea,
select,
.panel,
.metric-card,
.table-wrap,
.modal,
.toast {
  font-family: var(--font-body);
}

.page-heading h1,
.modal h2,
.brand-name,
.landing-hero h1,
.landing-section-head h2,
.landing-final h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

.page-heading h1 {
  font-size: var(--font-size-title);
  line-height: 1.2;
}

.page-heading p,
.panel p,
.metric-foot,
.task-info small,
.muted {
  font-size: var(--font-size-meta);
  line-height: 1.55;
}

.panel h2,
.setting-card h3,
.document-card h3,
.landing-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.table-wrap table,
.table-wrap th,
.table-wrap td {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.45;
}

.table-wrap th {
  font-size: 0.84rem;
  font-weight: 650;
}

/* Plan/list body text uses regular weight; only headers stay medium-bold. */
.table-wrap td,
.table-wrap td strong,
.table-wrap td span,
.table-wrap td b {
  font-weight: 400 !important;
}

.field label,
.breadcrumbs,
.demo-badge,
.live-pulse {
  font-family: var(--font-body);
}

/* Keep Chinese labels readable; no forced uppercase for primary nav */
.nav-label {
  text-transform: none !important;
}


/* Light readable text overrides — global, all desktop pages/subpages */
:root,
html[data-theme="light"],
body {
  --ink: #f4f6fa;
  --ink-2: #e8edf5;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #334155;
  --dim: #475569;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-tertiary: #475569;
  color: #0f172a;
}

/* Universal text inheritance for app content */
body,
.app-shell,
.main-content,
.page-root,
.panel,
.table-panel,
.table-wrap,
.metric-card,
.task-list,
.task-row,
.task-info,
.modal,
.modal-body,
.field,
.empty-state,
.notice-strip,
.document-card,
.document-hero,
.user-card,
.user-directory-panel,
.permission-editor,
.iot-fleet,
.iot-metric,
.iot-asset-card,
.iot-drawer,
.setting-card,
.kv,
.timeline,
.detail-banner,
.detail-title {
  color: #0f172a;
}

/* Headings and strong labels */
h1, h2, h3, h4, h5, h6,
.page-heading h1,
.panel-heading h2,
.panel-heading h3,
.brand-name,
.brand-subtitle,
.metric-value,
.metric-label,
.metric-foot,
.table-wrap th,
.table-wrap td,
.table-wrap strong,
.table-wrap span,
.table-wrap small,
.table-wrap .code,
.table-wrap .muted,
.code,
.muted,
.dim,
.status,
.status *,
.task-status,
.task-info strong,
.task-info small,
.breadcrumbs,
.breadcrumbs span,
.breadcrumbs strong,
.breadcrumbs b,
.demo-badge,
.live-pulse,
.sync-card,
.sync-card strong,
.sync-card small,
.sync-heading,
.user-chip,
.user-chip strong,
.user-chip small,
.site-switcher,
.site-switcher strong,
.site-switcher small,
.nav-label,
.nav-group a,
.nav-text,
.nav-count,
.button:not(.primary),
.button.ghost,
.icon-button,
.menu-toggle,
.filter-select,
.search-box,
.search-box input,
.field label,
.field input,
.field textarea,
.modal h2,
.modal-body,
.modal-body p,
.modal-close,
.toast,
.empty-state,
.empty-state strong,
.empty-state span,
.notice-strip,
.notice-strip strong,
.notice-strip span,
.document-card *,
.user-card *,
.permission-editor *,
.iot-fleet *,
.iot-metric *,
.iot-asset-card *,
.iot-control-bar *,
.iot-drawer *,
.setting-card *,
.kv label,
.kv strong,
.timeline small,
.timeline strong,
.timeline p,
.signal-legend,
.signal-legend span,
.chart-caption,
.chart-caption span,
.chart-caption strong,
.mini-kpi,
.mini-kpi strong,
.mini-kpi span,
.directory-label,
.permission-count,
.channel-state,
.channel-id,
.subtle,
.user-directory-foot,
.permission-matrix-head,
.matrix-state,
.permission-note,
.dispatch-source,
.document-search,
.document-search input,
.iot-control-bar select,
.iot-detail-toolbar select {
  color: #0f172a !important;
}

/* Secondary text still dark gray, not white */
.muted,
.dim,
.metric-foot,
.metric-label,
.page-heading p,
.panel-heading p,
.panel p,
.task-info small,
.table-wrap small,
.breadcrumbs span,
.site-switcher small,
.user-chip small,
.sync-card small,
.field label,
.empty-state span,
.notice-strip span,
.chart-caption span,
.signal-legend span,
.kv label,
.timeline small,
.timeline p {
  color: #334155 !important;
}

/* Unified page action buttons: logout / create / import share one family */
.heading-actions,
.page-heading .heading-actions,
.toolbar-actions,
.document-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.heading-actions .button,
.page-heading .button,
.toolbar-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.7rem;
  padding: 0.62rem 1.05rem 0.62rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #0f172a !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.heading-actions .button *,
.page-heading .button *,
.toolbar-actions .button * {
  color: inherit !important;
}

.heading-actions .button.ghost,
.page-heading .button.ghost,
.toolbar-actions .button.ghost,
.button.ghost {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05) !important;
}

.heading-actions .button.ghost:hover,
.page-heading .button.ghost:hover,
.toolbar-actions .button.ghost:hover,
.button.ghost:hover {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
  color: #0f172a !important;
}

/* Primary shares same shell; only fill differs */
.button.primary,
.heading-actions .button.primary,
.page-heading .button.primary,
.toolbar-actions .button.primary,
.landing-button.primary {
  background: #047857 !important;
  border-color: #047857 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.22) !important;
  font-weight: 700;
}

.button.primary:hover,
.heading-actions .button.primary:hover,
.page-heading .button.primary:hover,
.toolbar-actions .button.primary:hover,
.landing-button.primary:hover {
  background: #036649 !important;
  border-color: #036649 !important;
  color: #ffffff !important;
}

.button.primary *,
.button.primary span,
.heading-actions .button.primary *,
.heading-actions .button.primary span,
.page-heading .button.primary *,
.landing-button.primary * {
  color: #ffffff !important;
}

/* Trailing + / arrow badge: same language on primary and secondary */
.heading-actions .button > span:last-child,
.page-heading .button > span:last-child,
.heading-actions .button.primary > span:last-child,
.heading-actions .button.primary:not(:has(> span))::after {
  display: inline-grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  margin-left: 0.1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  content: none;
}

.heading-actions .button.primary:not(:has(> span))::after {
  content: "+";
}

.heading-actions .button.ghost > span:last-child,
.page-heading .button.ghost > span:last-child {
  background: rgba(15, 23, 42, 0.06);
}

.heading-actions .button.primary > span:last-child,
.page-heading .button.primary > span:last-child {
  background: rgba(15, 23, 42, 0.1);
}

/* Keep non-heading primary/ghost consistent system-wide */
.button {
  border-radius: 999px;
  min-height: 2.7rem;
  font-size: 0.9rem;
  font-weight: 650;
}

.button.small {
  min-height: 2.25rem;
  padding: 0.48rem 0.9rem;
  font-size: 0.84rem;
}

/* Links stay green but not pale */
.link-button,
.panel-link,
a.panel-link {
  color: #047857 !important;
}

/* Status chips: dark text on light tinted backgrounds */
.status,
.task-status,
.document-state,
.repair-work-state {
  color: #0f172a !important;
}

/* Inputs placeholders readable */
input::placeholder,
textarea::placeholder {
  color: #64748b !important;
  opacity: 1;
}

/* Prevent old dark-theme white text bleed from minified CSS */
.sidebar,
.sidebar *,
.topbar,
.topbar * {
  color: #0f172a;
}

.sidebar .nav-group a,
.sidebar .nav-label,
.sidebar .brand-name,
.sidebar .brand-subtitle,
.sidebar .site-switcher strong,
.sidebar .site-switcher small,
.sidebar .sync-card strong,
.sidebar .sync-card small,
.sidebar .user-chip strong,
.sidebar .user-chip small {
  color: #0f172a !important;
}

.topbar .breadcrumbs,
.topbar .breadcrumbs *,
.topbar .demo-badge,
.topbar .icon-button {
  color: #0f172a !important;
}

/* Active nav remains dark text */
.nav-group a.active,
.nav-group a.active .nav-text,
.nav-group a.active .nav-icon {
  color: #0f172a !important;
}

/* IoT/document page specific leftovers */
.iot-guest,
.iot-guest *,
.document-guest,
.document-guest *,
.iot-card-metrics,
.iot-card-metrics *,
.iot-realtime-grid,
.iot-realtime-grid *,
.iot-alarm-list,
.iot-alarm-list *,
.iot-maintenance-groups,
.iot-maintenance-groups * {
  color: #0f172a !important;
}

/* IoT fleet cards: restore hierarchy and status colors after light-theme overrides */
.iot-card-title h3,
.iot-card-metrics strong {
  color: #0f172a !important;
}

.iot-card-title .code,
.iot-card-title p,
.iot-card-metrics small,
.iot-card-foot,
.iot-card-foot time,
.iot-fleet-head p,
.iot-legend {
  color: #475569 !important;
}

.iot-card-signal,
.iot-card-signal i {
  color: inherit !important;
}

.state-running .iot-card-signal {
  color: #047857 !important;
  background: rgba(4, 120, 87, 0.12) !important;
}

.state-idle .iot-card-signal {
  color: #b45309 !important;
  background: rgba(245, 158, 11, 0.14) !important;
}

.state-fault .iot-card-signal,
.state-stopped .iot-card-signal,
.has-critical .iot-card-signal {
  color: #b91c1c !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

.state-maintenance .iot-card-signal {
  color: #1d4ed8 !important;
  background: rgba(37, 99, 235, 0.12) !important;
}

.iot-card-foot .connection-live { color: #047857 !important; }
.iot-card-foot .connection-stale { color: #b91c1c !important; }
.iot-card-foot .connection-no_data { color: #b45309 !important; }

.iot-card-alarm {
  color: #b91c1c !important;
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.18) !important;
}

.iot-card-alarm b {
  color: #ffffff !important;
  background: #dc2626 !important;
}

/* ============================================================================
   Item editor (in-modal table for maintenance/inspection standard items)
   Visual language mirrors .permission-editor: dark card, soft border, mono
   uppercase header row, so the two stay consistent inside the same modal.
   ============================================================================ */
.item-editor{margin:18px 0 4px;border:1px solid var(--line-strong);border-radius:14px;overflow:hidden;background:rgba(7,19,30,.34)}
.item-editor-title{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;padding:16px 18px;border-bottom:1px solid var(--line);background:linear-gradient(90deg,rgba(4, 120, 87, .08),transparent 58%)}
.item-editor-title>div>strong{display:block;font-size:13px}
.item-editor-title p{margin:5px 0 0;color:var(--muted);font-size:10px;line-height:1.5}
.item-editor-head,.item-editor-row{display:grid;grid-template-columns:40px minmax(80px,1fr) minmax(70px,1fr) minmax(120px,1.4fr) minmax(100px,1.2fr) 56px;align-items:center;gap:8px}
.item-editor-head{min-height:34px;padding:0 18px;color:var(--dim);font-family:var(--mono);font-size:8px;letter-spacing:.08em;text-transform:uppercase}
.item-editor-row{min-height:48px;padding:8px 18px;border-top:1px solid var(--line)}
.item-editor-row .seq{font-family:var(--mono);font-size:11px;color:var(--muted);text-align:center}
.item-editor-row input{width:100%;min-width:0;color:var(--text);background:var(--ink-2);border:1px solid var(--line-strong);border-radius:8px;padding:8px 10px;outline:none;font-size:11px}
.item-editor-row input:focus{border-color:var(--blue);box-shadow:0 0 0 2px rgba(37,99,235,.18)}
.item-editor-row .link-button{padding:6px 0;text-align:center}
.item-editor-empty{margin:0;padding:14px 18px;border-top:1px solid var(--line);color:var(--muted);font-size:10px;line-height:1.55}
.field-hint{margin:0 0 12px;color:var(--muted);font-size:10px;line-height:1.55}
.purchase-item-editor{margin:14px 0 4px;border:1px solid var(--line-strong);border-radius:14px;overflow:hidden;background:rgba(7,19,30,.34)}
.purchase-item-editor-title{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;padding:16px 18px;border-bottom:1px solid var(--line);background:linear-gradient(90deg,rgba(4, 120, 87, .08),transparent 58%)}
.purchase-item-editor-title>div>strong{display:block;font-size:13px}
.purchase-item-editor-title p{margin:5px 0 0;color:var(--muted);font-size:10px;line-height:1.5}
.purchase-item-head,.purchase-item-row{display:grid;grid-template-columns:40px minmax(160px,1.8fr) 110px 56px;align-items:center;gap:8px}
.purchase-item-head{min-height:34px;padding:0 18px;color:var(--dim);font-family:var(--mono);font-size:8px;letter-spacing:.08em;text-transform:uppercase}
.purchase-item-row{min-height:48px;padding:8px 18px;border-top:1px solid var(--line)}
.purchase-item-row .seq{font-family:var(--mono);font-size:11px;color:var(--muted);text-align:center}
.purchase-item-row select,.purchase-item-row input{width:100%;min-width:0;color:var(--text);background:var(--ink-2);border:1px solid var(--line-strong);border-radius:8px;padding:8px 10px;outline:none;font-size:11px}
.purchase-item-row select:focus,.purchase-item-row input:focus{border-color:var(--blue);box-shadow:0 0 0 2px rgba(37,99,235,.18)}
.purchase-item-row .link-button{padding:6px 0;text-align:center}
.purchase-spare-picker{padding:12px 18px 16px;border-top:1px solid var(--line)}
.purchase-spare-picker>span{display:block;margin-bottom:8px;color:var(--dim);font-size:9px;letter-spacing:.04em}
.purchase-spare-chips{display:flex;flex-wrap:wrap;gap:6px}
.purchase-spare-chip{max-width:100%;padding:6px 10px;border:1px solid var(--line-strong);border-radius:999px;background:rgba(15,36,50,.55);color:var(--text);font-size:10px;cursor:pointer}
.purchase-spare-chip:hover{border-color:rgba(4, 120, 87, .45);color:var(--mint)}
@media (max-width:720px){
  .item-editor-title{align-items:flex-start;flex-direction:column}
  .item-editor-head,.item-editor-row{grid-template-columns:28px minmax(60px,1fr) 60px 80px 70px 44px;padding-left:12px;padding-right:12px;gap:6px;font-size:10px}
  .item-editor-row input{padding:7px 8px;font-size:10px}
}

/* === Premium Surface Pass 2026-08 ===
   Visual-only polish: denser light, glass depth, refined controls.
   No business/API/DOM contract changes.
*/
:root,
html[data-theme="light"],
body {
  --surface-canvas: #eef2f7;
  --surface-raised: rgba(255, 255, 255, 0.86);
  --surface-raised-strong: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-field: rgba(248, 250, 252, 0.96);
  --surface-hover: rgba(236, 242, 248, 0.96);
  --stroke-hairline: rgba(15, 23, 42, 0.1);
  --stroke-subtle: rgba(15, 23, 42, 0.06);
  --card-ambient-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 18px 50px rgba(15, 23, 42, 0.08),
    0 4px 14px rgba(15, 23, 42, 0.04);
  --card-inner-highlight:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(15, 23, 42, 0.035);
  --premium-ring: 0 0 0 1px rgba(4, 120, 87, 0.14), 0 0 0 6px rgba(4, 120, 87, 0.06);
  --premium-glow: 0 12px 40px rgba(4, 120, 87, 0.14);
}

html {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(124, 92, 255, 0.12), transparent 55%),
    radial-gradient(900px 500px at 88% 0%, rgba(4, 120, 87, 0.12), transparent 50%),
    radial-gradient(700px 420px at 50% 100%, rgba(37, 99, 235, 0.07), transparent 55%),
    var(--surface-canvas);
}

body {
  min-height: 100dvh;
  background: transparent;
}

.ambient-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-field i {
  position: absolute;
  width: min(48rem, 70vw);
  height: min(48rem, 70vw);
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.22;
  animation: ambient-drift 18s var(--motion-premium) infinite alternate;
}

.ambient-field i:first-child {
  top: -18rem;
  right: 4%;
  background: rgb(var(--brand-purple));
}

.ambient-field i:last-child {
  bottom: -20rem;
  left: 0%;
  background: rgb(var(--brand-emerald));
  animation-delay: -7s;
}

@keyframes ambient-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2%, -2%, 0) scale(1.06); }
}

.app-shell {
  gap: 1.25rem;
  padding: 1.35rem;
}

.sidebar,
.topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    var(--card-inner-highlight),
    0 20px 60px rgba(15, 23, 42, 0.09),
    0 2px 8px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
}

.sidebar {
  width: 18.25rem;
  flex-basis: 18.25rem;
  border-radius: 1.75rem;
}

.brand-name {
  background: linear-gradient(120deg, #0f172a 10%, #047857 55%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  filter: drop-shadow(0 0 14px rgba(4, 120, 87, 0.35));
}

.site-switcher {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.nav-group a {
  border-radius: 0.95rem;
  transition: background 220ms var(--motion-premium), transform 220ms var(--motion-premium), box-shadow 220ms var(--motion-premium);
}

.nav-group a:hover {
  background: rgba(4, 120, 87, 0.08);
  transform: translateX(2px);
}

.nav-group a.active {
  background:
    linear-gradient(90deg, rgba(4, 120, 87, 0.16), rgba(4, 120, 87, 0.05));
  box-shadow: inset 3px 0 0 rgba(4, 120, 87, 0.85);
}

.nav-label {
  letter-spacing: 0.08em;
  opacity: 0.78;
}

.main-content,
.page-root,
#page-root {
  position: relative;
  z-index: 1;
}

.page-heading {
  margin-bottom: 1.35rem;
  padding: 0.25rem 0.15rem 0.5rem;
}

.page-heading h1 {
  letter-spacing: -0.03em;
}

.page-heading p {
  max-width: 48rem;
  color: var(--text-secondary);
}

.notice-strip {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0 0 1.1rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid rgba(4, 120, 87, 0.16);
  border-radius: 1.1rem;
  background:
    linear-gradient(120deg, rgba(4, 120, 87, 0.1), rgba(124, 92, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  color: #0f172a;
  font-size: 0.82rem;
  line-height: 1.5;
}

.panel,
.metric-card,
.setting-card,
.document-card,
.iot-fleet,
.iot-metric,
.iot-asset-card,
.iot-realtime-hero,
.iot-trend-chart,
.permission-editor,
.user-directory-panel,
.role-summary-card,
.user-card,
.table-panel {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.07), transparent 36%),
    radial-gradient(circle at 0% 100%, rgba(4, 120, 87, 0.06), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88));
  box-shadow: var(--card-ambient-shadow);
  transition: transform 320ms var(--motion-premium), box-shadow 320ms var(--motion-premium);
}

.metric-card:hover,
.setting-card:hover,
.document-card:hover,
.iot-asset-card:hover,
.user-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 24px 60px rgba(15, 23, 42, 0.12),
    0 8px 20px rgba(4, 120, 87, 0.08);
}

.metric-value {
  background: linear-gradient(135deg, #0f172a 20%, #047857 70%, #047857 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.table-panel {
  padding: 0.55rem;
  overflow: visible;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 1.35rem;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.98));
}

.table-wrap table {
  width: 100%;
  min-width: max(100%, 58rem);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.table-wrap th:nth-last-child(2),
.table-wrap td:nth-last-child(2) {
  white-space: nowrap;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 9.5rem;
  padding-right: 1.1rem;
  white-space: nowrap;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.72), #ffffff 28%);
  box-shadow: -8px 0 16px rgba(15, 23, 42, 0.04);
}

.table-wrap thead th:last-child {
  z-index: 3;
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.98) 28%);
}

.table-wrap tbody tr:hover td:last-child {
  background: linear-gradient(90deg, rgba(236, 253, 245, 0.72), rgba(236, 253, 245, 0.96) 28%);
}

.table-wrap .row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.table-wrap .row-actions .link-button,
.table-wrap .link-button {
  white-space: nowrap;
  font-weight: 400;
}

.status-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 5.5rem;
}

.status-cell small {
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: nowrap;
}

.table-wrap td .code {
  white-space: nowrap;
}

.table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.table-wrap td {
  color: #0f172a !important;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  background: transparent;
  transition: background 180ms ease;
}

.table-wrap tbody tr:hover td {
  background: rgba(4, 120, 87, 0.045);
}

.table-wrap tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.015);
}

.table-wrap tbody tr:nth-child(even):hover td {
  background: rgba(4, 120, 87, 0.06);
}

.status,
.task-status,
.document-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.55rem;
  padding: 0.18rem 0.62rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.status::before,
.task-status::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
  content: "";
}

.status.green,
.status[data-tone="green"] { color: #047857; background: rgba(4, 120, 87, 0.1); border-color: rgba(4, 120, 87, 0.2); }
.status.amber,
.status[data-tone="amber"] { color: #b45309; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.22); }
.status.red,
.status[data-tone="red"] { color: #b91c1c; background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }
.status.gray,
.status[data-tone="gray"] { color: #475569; background: rgba(100, 116, 139, 0.1); border-color: rgba(100, 116, 139, 0.18); }

.button {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

.button:hover {
  border-color: rgba(4, 120, 87, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 24px rgba(15, 23, 42, 0.08);
}

.button.primary {
  border-color: rgba(4, 120, 87, 0.45);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.55), transparent 40%),
    linear-gradient(180deg, rgba(4, 120, 87, 0.98), rgba(4, 120, 87, 0.95));
  color: #ffffff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    var(--premium-glow);
}

.button.primary:hover {
  filter: brightness(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 14px 36px rgba(4, 120, 87, 0.22);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.55);
}

.link-button {
  padding: 0.15rem 0.25rem;
  border-radius: 0.4rem;
}

.link-button:hover {
  background: rgba(4, 120, 87, 0.08);
}

.modal-backdrop {
  background:
    radial-gradient(circle at 50% 20%, rgba(4, 120, 87, 0.08), transparent 40%),
    rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal {
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 30px 90px rgba(15, 23, 42, 0.28);
  color: #0f172a;
}

.modal h2 {
  letter-spacing: -0.02em;
}

.field label {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 650;
}

.field input,
.field textarea,
.field select,
.search-box,
.filter-select,
.document-search {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: #0f172a !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.modal .field select,
.field select {
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px 14px;
  color: #0f172a !important;
}

.modal .field select option,
.field select option {
  background-color: #ffffff;
  color: #0f172a;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-box:focus-within,
.filter-select:focus {
  border-color: rgba(4, 120, 87, 0.45);
  box-shadow: var(--premium-ring);
  outline: none;
}

.empty-state {
  padding: 2.2rem 1.4rem;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 1.2rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(4, 120, 87, 0.08), transparent 55%),
    rgba(248, 250, 252, 0.9);
  text-align: center;
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
  color: #0f172a;
}

.live-pulse,
.demo-badge {
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.1);
  border: 1px solid rgba(4, 120, 87, 0.2);
  color: #047857;
  font-weight: 700;
}

.user-chip,
.sync-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.15rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.module-tabs a {
  padding: 0.55rem 0.9rem;
  border-radius: 0.8rem;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 650;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.module-tabs a:hover {
  background: rgba(4, 120, 87, 0.08);
  color: #0f172a;
}

.module-tabs a.active {
  background: linear-gradient(180deg, rgba(4, 120, 87, 0.18), rgba(4, 120, 87, 0.1));
  color: #047857;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.item-editor,
.purchase-item-editor {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.1rem;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.item-editor-title,
.purchase-item-editor-title {
  background: linear-gradient(90deg, rgba(4, 120, 87, 0.1), transparent 60%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.item-editor-row input,
.purchase-item-row input,
.purchase-item-row select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.35);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(4, 120, 87, 0.45);
  background-clip: padding-box;
}

@media (max-width: 960px) {
  .app-shell { padding: 0.85rem; gap: 0.85rem; }
  .sidebar { border-radius: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-field i,
  .metric-card,
  .setting-card,
  .document-card,
  .iot-asset-card,
  .user-card,
  .nav-group a,
  .button {
    animation: none !important;
    transition: none !important;
  }
}

/* === Knowledge Library Card Polish 2026-08 ===
   Rebalance type scale, spacing and hierarchy for document cards.
*/
.document-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 1rem;
  align-items: stretch;
}

.document-card {
  --doc-accent: #047857;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  min-height: 100%;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--doc-accent) 10%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 14px 34px rgba(15, 23, 42, 0.06);
  transition: transform 240ms var(--motion-premium), box-shadow 240ms var(--motion-premium), border-color 240ms ease;
}

.document-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--doc-accent) 28%, rgba(15, 23, 42, 0.08));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 18px 40px rgba(15, 23, 42, 0.1);
}

.document-card.category-standard { --doc-accent: #047857; }
.document-card.category-inspection { --doc-accent: #2563eb; }
.document-card.category-maintenance { --doc-accent: #d97706; }
.document-card.category-repair { --doc-accent: #ea580c; }
.document-card.category-safety { --doc-accent: #dc2626; }
.document-card.category-manual { --doc-accent: #7c3aed; }
.document-card.category-other { --doc-accent: #64748b; }

.document-spine {
  display: grid;
  place-items: center;
  padding: 0.85rem 0;
  border-right: 1px solid color-mix(in srgb, var(--doc-accent) 22%, transparent);
  background: color-mix(in srgb, var(--doc-accent) 8%, transparent);
}

.document-spine span {
  color: color-mix(in srgb, var(--doc-accent) 85%, #0f172a);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.document-card-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.05rem 0.95rem;
}

.document-card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.document-reference {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.document-reference .code {
  color: color-mix(in srgb, var(--doc-accent) 75%, #0f172a);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.document-version {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
  font-size: 0.68rem;
  font-weight: 400;
}

.document-state {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.35rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid rgba(4, 120, 87, 0.18);
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.08);
  color: #047857;
  font-size: 0.68rem;
  font-weight: 400;
}

.document-state:before {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.document-state.draft {
  border-color: rgba(217, 119, 6, 0.2);
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.document-state.archived {
  border-color: rgba(100, 116, 139, 0.18);
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

.document-scope {
  display: flex;
  max-width: 44%;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  color: #64748b;
  font-size: 0.66rem;
  line-height: 1.35;
  text-align: right;
}

.document-scope strong {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.document-title,
.document-card h2.document-title,
.document-card h2 {
  margin: 0;
  color: #0f172a;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.4;
}

.document-description {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.document-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.document-tags span {
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.2;
}

.document-tags .is-empty {
  border-style: dashed;
  color: #94a3b8;
}

.document-attachments {
  margin-top: 0.15rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.document-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.document-section-title span {
  color: #0f172a;
  font-size: 0.74rem;
  font-weight: 650;
}

.document-section-title small {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 400;
  white-space: nowrap;
}

.document-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.document-file {
  display: flex;
  width: 100%;
  max-width: none;
  margin: 0;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.8rem;
  background: rgba(248, 250, 252, 0.9);
  color: #0f172a;
  text-align: left;
}

.document-file:hover {
  border-color: color-mix(in srgb, var(--doc-accent) 35%, transparent);
  background: color-mix(in srgb, var(--doc-accent) 6%, #ffffff);
}

.document-file-icon {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--doc-accent) 12%, transparent);
  color: color-mix(in srgb, var(--doc-accent) 80%, #0f172a);
  font-size: 0.8rem;
}

.document-file span:last-child {
  min-width: 0;
  flex: 1;
}

.document-file strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-file small {
  display: block;
  margin-top: 0.12rem;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 400;
}

.document-no-file {
  padding: 0.55rem 0.7rem;
  border: 1px dashed rgba(217, 119, 6, 0.25);
  border-radius: 0.75rem;
  background: rgba(245, 158, 11, 0.05);
  color: #b45309;
  font-size: 0.74rem;
  line-height: 1.45;
}

.document-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.55rem;
}

.document-card-actions .button.small {
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 650;
}

.document-hero {
  margin-bottom: 1rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(circle at 92% 12%, rgba(124, 92, 255, 0.1), transparent 34%),
    radial-gradient(circle at 8% 88%, rgba(4, 120, 87, 0.1), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 14px 36px rgba(15, 23, 42, 0.06);
}

.document-hero h2 {
  margin: 0.45rem 0 0.4rem;
  color: #0f172a;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
}

.document-hero p {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.55;
}

.document-hero-mark {
  color: #047857 !important;
  background: rgba(4, 120, 87, 0.1);
  border: 1px solid rgba(4, 120, 87, 0.14);
}

.document-hero-seal {
  width: 5.75rem;
  height: 5.75rem;
  border: 1px solid rgba(4, 120, 87, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95), transparent 42%),
    linear-gradient(160deg, rgba(236, 253, 245, 0.98), rgba(209, 250, 229, 0.75));
  box-shadow:
    inset 0 0 0 0.4rem rgba(4, 120, 87, 0.05),
    0 10px 24px rgba(4, 120, 87, 0.1);
}

.document-hero-seal:before {
  border: 1px dashed rgba(4, 120, 87, 0.28);
}

.document-hero-seal strong {
  color: #047857 !important;
  font-size: 1.45rem;
  font-weight: 700;
}

.document-hero-seal span {
  color: #64748b !important;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.document-metrics {
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.document-metrics > div {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.06), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(4, 120, 87, 0.07), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 24px rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

.document-metrics span {
  color: #64748b !important;
  font-family: var(--font-body);
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  line-height: 1.45;
}

.document-metrics strong {
  color: #0f172a !important;
  font-family: var(--font-body);
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  line-height: 1.45;
}

.document-filter-panel {
  margin-bottom: 1rem;
  border-radius: 1.1rem;
}

@media (max-width: 720px) {
  .document-card {
    grid-template-columns: 2.1rem minmax(0, 1fr);
  }
  .document-card-meta {
    flex-direction: column;
  }
  .document-scope {
    max-width: none;
    align-items: flex-start;
    text-align: left;
  }
  .document-section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .document-card-actions {
    justify-content: flex-start;
  }
}


/* === THREE-COLOR STATUS LAMPS (2026-08-04) === */
/* Unified status presentation: green / amber / red only. Text stays required. */
:root {
  --status-green: #047857;
  --status-green-soft: rgba(4, 120, 87, 0.12);
  --status-green-ring: rgba(4, 120, 87, 0.22);
  --status-amber: #b45309;
  --status-amber-soft: rgba(245, 158, 11, 0.14);
  --status-amber-ring: rgba(245, 158, 11, 0.24);
  --status-red: #b91c1c;
  --status-red-soft: rgba(239, 68, 68, 0.12);
  --status-red-ring: rgba(239, 68, 68, 0.22);
}

.status,
.task-status,
.document-state,
.status-lamp {
  display: inline-flex !important;
  align-items: center;
  gap: 0.42rem;
  min-height: 1.55rem;
  padding: 0.16rem 0.64rem 0.16rem 0.48rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
}

.status::before,
.task-status::before,
.document-state::before {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent);
  content: "";
  flex: 0 0 auto;
}

.status.status-lamp::before,
.task-status.status-lamp::before {
  display: none;
  content: none;
}

.status-light {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    0 0 0 3px color-mix(in srgb, currentColor 20%, transparent),
    0 0 8px color-mix(in srgb, currentColor 45%, transparent);
  flex: 0 0 auto;
  animation: status-lamp-breathe 2.4s ease-in-out infinite;
}

.status-text {
  line-height: 1.1;
}

.status.green,
.status[data-tone="green"],
.task-status.green,
.task-status[data-tone="green"],
.document-state.published,
.document-state.green {
  color: var(--status-green) !important;
  background: var(--status-green-soft) !important;
  border-color: var(--status-green-ring) !important;
}

.status.amber,
.status[data-tone="amber"],
.task-status.amber,
.task-status[data-tone="amber"],
.document-state.draft,
.document-state.amber,
.status.blue,
.status[data-tone="blue"],
.task-status.blue,
.task-status[data-tone="blue"] {
  color: var(--status-amber) !important;
  background: var(--status-amber-soft) !important;
  border-color: var(--status-amber-ring) !important;
}

.status.red,
.status[data-tone="red"],
.task-status.red,
.task-status[data-tone="red"],
.document-state.archived,
.document-state.red,
.status.gray,
.status[data-tone="gray"],
.task-status.gray,
.task-status[data-tone="gray"] {
  color: var(--status-red) !important;
  background: var(--status-red-soft) !important;
  border-color: var(--status-red-ring) !important;
}

.status:not(.green):not(.amber):not(.red):not(.blue):not(.gray):not([data-tone]),
.task-status:not(.green):not(.amber):not(.red):not(.blue):not(.gray):not([data-tone]) {
  color: var(--status-amber);
  background: var(--status-amber-soft);
  border-color: var(--status-amber-ring);
}

.legend-dot,
.legend-dot.green {
  background: var(--status-green);
  box-shadow: 0 0 0 4px var(--status-green-ring);
}
.legend-dot.amber {
  background: var(--status-amber);
  box-shadow: 0 0 0 4px var(--status-amber-ring);
}
.legend-dot.red {
  background: var(--status-red);
  box-shadow: 0 0 0 4px var(--status-red-ring);
}
.legend-dot.blue {
  background: var(--status-amber);
  box-shadow: 0 0 0 4px var(--status-amber-ring);
}

.task-priority { background: var(--status-amber); }
.task-priority.red { background: var(--status-red); }
.task-priority.amber { background: var(--status-amber); }
.task-priority.green { background: var(--status-green); }
.task-priority.blue { background: var(--status-amber); }

.channel-state.connected { color: var(--status-green) !important; }
.channel-state.connected::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px var(--status-green-ring);
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: middle;
}

/* Match account status lamp sizing (font/padding/dot). */
.repair-work-state {
  display: inline-flex !important;
  align-items: center;
  gap: 0.42rem;
  min-height: 1.55rem;
  padding: 0.16rem 0.64rem 0.16rem 0.48rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
  vertical-align: middle;
  box-sizing: border-box;
}

.repair-work-state::before {
  content: "";
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent);
  flex: 0 0 auto;
}

.repair-work-state.idle {
  color: var(--status-green) !important;
  border-color: var(--status-green-ring) !important;
  background: var(--status-green-soft) !important;
}
.repair-work-state.busy {
  color: var(--status-amber) !important;
  border-color: var(--status-amber-ring) !important;
  background: var(--status-amber-soft) !important;
}

.iot-asset-card.state-maintenance:before { background: var(--status-amber) !important; }
.state-maintenance .iot-card-signal { color: var(--status-amber) !important; }
.iot-legend .running:before { background: var(--status-green) !important; }
.iot-legend .idle:before { background: var(--status-amber) !important; }
.iot-legend .fault:before { background: var(--status-red) !important; }
.iot-legend .offline:before { background: var(--status-red) !important; opacity: 0.75; }
.iot-connection[data-state="LIVE"]:before,
.iot-connection[data-state="LIVE"] { color: var(--status-green); }
.iot-connection[data-state="RECONNECTING"]:before,
.iot-connection[data-state="RECONNECTING"],
.iot-connection[data-state="NO_DATA"]:before,
.iot-connection[data-state="NO_DATA"] { color: var(--status-amber); }
.iot-connection[data-state="STALE"]:before,
.iot-connection[data-state="STALE"],
.iot-connection[data-state="ERROR"]:before,
.iot-connection[data-state="ERROR"],
.iot-connection[data-state="UNCONNECTED"]:before,
.iot-connection[data-state="UNCONNECTED"] { color: var(--status-red); }
.iot-card-foot .connection-live { color: var(--status-green) !important; }
.iot-card-foot .connection-no_data,
.iot-card-foot .connection-reconnecting { color: var(--status-amber) !important; }
.iot-card-foot .connection-stale,
.iot-card-foot .connection-unconnected,
.iot-card-foot .connection-error { color: var(--status-red) !important; }

@keyframes status-lamp-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.72; transform: scale(0.92); }
}

@media (prefers-reduced-motion: reduce) {
  .status-light { animation: none !important; }
}

/* Force lamp core color to match status tone (avoid inheriting ink #0f172a). */
.status-light,
.status > .status-light,
.status-lamp > .status-light,
.task-status > .status-light {
  background-color: currentColor !important;
  color: inherit !important;
}

.status.green .status-light,
.status[data-tone="green"] .status-light,
.task-status.green .status-light,
.task-status[data-tone="green"] .status-light,
.document-state.published .status-light,
.document-state.green .status-light {
  background-color: var(--status-green) !important;
  color: var(--status-green) !important;
  box-shadow:
    0 0 0 3px var(--status-green-ring),
    0 0 8px color-mix(in srgb, var(--status-green) 45%, transparent) !important;
}

.status.amber .status-light,
.status[data-tone="amber"] .status-light,
.task-status.amber .status-light,
.task-status[data-tone="amber"] .status-light,
.document-state.draft .status-light,
.document-state.amber .status-light,
.status.blue .status-light,
.status[data-tone="blue"] .status-light,
.task-status.blue .status-light,
.task-status[data-tone="blue"] .status-light {
  background-color: var(--status-amber) !important;
  color: var(--status-amber) !important;
  box-shadow:
    0 0 0 3px var(--status-amber-ring),
    0 0 8px color-mix(in srgb, var(--status-amber) 45%, transparent) !important;
}

.status.red .status-light,
.status[data-tone="red"] .status-light,
.task-status.red .status-light,
.task-status[data-tone="red"] .status-light,
.document-state.archived .status-light,
.document-state.red .status-light,
.status.gray .status-light,
.status[data-tone="gray"] .status-light,
.task-status.gray .status-light,
.task-status[data-tone="gray"] .status-light {
  background-color: var(--status-red) !important;
  color: var(--status-red) !important;
  box-shadow:
    0 0 0 3px var(--status-red-ring),
    0 0 8px color-mix(in srgb, var(--status-red) 45%, transparent) !important;
}

/* Also tint legacy ::before dots the same way */
.status.green::before,
.status[data-tone="green"]::before,
.task-status.green::before,
.task-status[data-tone="green"]::before { background: var(--status-green) !important; box-shadow: 0 0 0 3px var(--status-green-ring) !important; }
.status.amber::before,
.status[data-tone="amber"]::before,
.task-status.amber::before,
.task-status[data-tone="amber"]::before,
.status.blue::before,
.status[data-tone="blue"]::before { background: var(--status-amber) !important; box-shadow: 0 0 0 3px var(--status-amber-ring) !important; }
.status.red::before,
.status[data-tone="red"]::before,
.task-status.red::before,
.task-status[data-tone="red"]::before,
.status.gray::before,
.status[data-tone="gray"]::before { background: var(--status-red) !important; box-shadow: 0 0 0 3px var(--status-red-ring) !important; }


/* === TABLE FIELD TYPE UNIFY (2026-08-04) === */
/* Keep table headers, cells, codes and table footers at the same body size. */
.table-panel,
.table-wrap,
.table-wrap table {
  font-size: 0.9rem;
  line-height: 1.5;
}

.table-wrap th,
.table-wrap td,
.table-wrap td strong,
.table-wrap td span,
.table-wrap td b,
.table-wrap td small,
.table-wrap .code,
.table-wrap .muted,
.table-wrap .status,
.table-wrap .status-text,
.table-wrap .link-button {
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  letter-spacing: 0.01em;
}

.table-wrap .link-button,
.table-wrap .row-actions .link-button,
.user-row-actions .link-button {
  font-weight: 400 !important;
}

.table-wrap th {
  font-weight: 650 !important;
  text-transform: none !important;
  color: #334155 !important;
}

.table-wrap td,
.table-wrap td strong,
.table-wrap td span,
.table-wrap td b {
  font-weight: 400 !important;
  color: #0f172a;
}

/* Footer under tables: same size as field body text */
.table-panel > .table-toolbar,
.table-panel > .table-toolbar .muted,
.table-panel > .table-toolbar span,
.table-toolbar .muted[style*="font-size"],
.user-directory-foot,
.user-directory-foot span,
.user-directory-foot .code {
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
}

/* Status lamps in tables keep visual weight but match text size */
.table-wrap .status,
.table-wrap .status-lamp {
  font-size: 0.9rem !important;
  min-height: 1.7rem;
}

/* IoT asset card code: normal weight, not bold */
.iot-asset-card .iot-card-title .code,
.iot-card-title .code {
  font-weight: 400 !important;
}


/* === TABLE CLIP FIX (2026-08-04) === */
/* Prevent right-side columns (操作) from being cropped; allow horizontal scroll. */
.table-panel {
  overflow: visible !important;
}

.table-wrap {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table-wrap table {
  width: 100%;
  min-width: 0 !important;
  table-layout: auto;
}

/* Long task/asset codes should wrap instead of forcing the whole table wider. */
.table-wrap td,
.table-wrap th {
  white-space: normal !important;
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.table-wrap td .code,
.table-wrap .code {
  display: inline-block;
  max-width: 18rem;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 1.35;
}

/* Keep action buttons on one line and visible. */
.table-wrap td:last-child,
.table-wrap th:last-child {
  white-space: nowrap !important;
  word-break: normal;
  overflow-wrap: normal;
}

.table-wrap .row-actions,
.table-wrap .link-button {
  white-space: nowrap !important;
}

/* Sticky last column so 操作 remains reachable while scrolling horizontally. */
.table-wrap th:last-child,
.table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(255,255,255,0.72), #fff 28%);
  box-shadow: -8px 0 12px rgba(15, 23, 42, 0.04);
}

.table-wrap tbody tr:nth-child(even) td:last-child {
  background: linear-gradient(90deg, rgba(248,250,252,0.72), #f8fafc 28%);
}

.table-wrap tbody tr:hover td:last-child {
  background: linear-gradient(90deg, rgba(236,253,245,0.85), #ecfdf5 28%);
}

/* Slightly tighter cell padding on dense business tables. */
.table-wrap th,
.table-wrap td {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

/* Visible scroll affordance on light UI */
.table-wrap {
  background:
    linear-gradient(90deg, #fff 30%, rgba(255,255,255,0)),
    linear-gradient(90deg, rgba(255,255,255,0), #fff 70%) 100% 0,
    linear-gradient(90deg, rgba(15,23,42,0.06), rgba(15,23,42,0)),
    linear-gradient(90deg, rgba(15,23,42,0), rgba(15,23,42,0.06)) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}


/* Document card: only title stays bold */
.document-card,
.document-card *:not(h2):not(.document-title):not(.button):not(.button *) {
  font-weight: 400 !important;
}

.document-card h2,
.document-card h2.document-title,
.document-card .document-title {
  font-weight: 700 !important;
}


/* === IOT DASHBOARD SIMPLIFY (2026-08-04) === */
/* One overview band + compact chips + denser device cards. */

.iot-control-bar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem !important;
  padding: 0.85rem 1rem !important;
  border-radius: 1rem !important;
}

.iot-control-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex-wrap: wrap;
}

.iot-control-field {
  display: inline-flex !important;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: #334155 !important;
  font-size: 0.9rem !important;
  font-weight: 600;
}

.iot-control-field span {
  color: #475569;
  font-size: 0.9rem !important;
  white-space: nowrap;
}

.iot-control-field select {
  min-width: 10rem !important;
  height: 2.4rem !important;
  padding: 0 2rem 0 0.8rem !important;
  font-size: 0.9rem !important;
}

.iot-control-status {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: #475569;
  font-size: 0.9rem !important;
}

.iot-connection,
.iot-updated,
.iot-readonly {
  font-size: 0.9rem !important;
  line-height: 1.3;
}

.iot-readonly {
  flex: 0 0 auto;
  padding: 0.35rem 0.7rem !important;
  border-radius: 999px;
  white-space: nowrap;
}

.iot-overview {
  margin-bottom: 1rem;
  padding: 1rem 1.05rem 0.95rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,250,252,0.96));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.iot-overview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.iot-overview-head h2 {
  margin: 0;
  font-size: 1.05rem !important;
  font-weight: 750;
  line-height: 1.25;
  color: #0f172a;
}

.iot-overview-head p {
  margin: 0.3rem 0 0;
  color: #64748b !important;
  font-size: 0.9rem !important;
  line-height: 1.45 !important;
}

.iot-metrics-focus {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 0.7rem !important;
  margin: 0 0 0.75rem !important;
}

.iot-metrics-focus .iot-metric {
  min-width: 0;
  padding: 0.85rem 0.9rem 0.75rem !important;
  border-radius: 1rem !important;
  background: #fff !important;
  border: 1px solid rgba(15, 23, 42, 0.07) !important;
  box-shadow: none !important;
}

.iot-metrics-focus .iot-metric > span {
  color: #64748b !important;
  font-size: 0.9rem !important;
  font-weight: 650 !important;
  line-height: 1.3 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iot-metrics-focus .iot-metric strong {
  margin: 0.45rem 0 0.25rem !important;
  color: #0f172a !important;
  font-size: 1.45rem !important;
  line-height: 1.1 !important;
  letter-spacing: -0.03em;
}

.iot-metrics-focus .iot-metric small {
  color: #94a3b8 !important;
  font-size: 0.84rem !important;
  line-height: 1.35 !important;
}

.iot-metrics-focus .iot-metric.danger strong { color: #b91c1c !important; }
.iot-metrics-focus .iot-metric.warn strong { color: #b45309 !important; }

.iot-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.iot-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  color: #334155;
  font-size: 0.9rem !important;
  line-height: 1.2;
  white-space: nowrap;
}

.iot-summary-chip b {
  color: #0f172a;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.iot-summary-chip em {
  font-style: normal;
  color: #64748b;
  font-weight: 550;
}

.iot-summary-chip.warn b { color: #b45309; }
.iot-summary-chip.danger b { color: #b91c1c; }

.iot-inline-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0.75rem;
  border-radius: 0.8rem;
  background: rgba(15, 23, 42, 0.03);
  color: #475569;
  font-size: 0.9rem !important;
  line-height: 1.4;
}

.iot-inline-note strong {
  color: #0f172a;
  font-weight: 700;
}

.iot-inline-note.demo {
  background: rgba(245, 158, 11, 0.08);
}

.iot-metric-block {
  display: none !important;
}

.iot-fleet {
  padding: 1rem 1.05rem 0.9rem !important;
}

.iot-fleet-head {
  align-items: center !important;
  margin-bottom: 0.85rem !important;
}

.iot-fleet-head h2 {
  margin: 0 !important;
  font-size: 1.05rem !important;
  font-weight: 750 !important;
}

.iot-fleet-head p,
.iot-legend {
  color: #64748b !important;
  font-size: 0.9rem !important;
}

.iot-legend {
  gap: 0.75rem !important;
}

.iot-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 0.7rem !important;
}

.iot-asset-card {
  min-height: 0 !important;
  gap: 0.45rem !important;
  padding: 0.8rem 0.85rem 0.7rem !important;
  border-radius: 1rem !important;
}

.iot-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.iot-card-signal,
.iot-card-top > span:last-child,
.iot-card-foot,
.iot-card-foot time {
  font-size: 0.84rem !important;
}

.iot-card-title h3 {
  margin: 0.15rem 0 0.15rem !important;
  font-size: 0.98rem !important;
  line-height: 1.25 !important;
}

.iot-card-title p,
.iot-card-title .code {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 0.84rem !important;
  line-height: 1.35 !important;
}

.iot-card-metrics {
  min-height: 0 !important;
  gap: 0.35rem !important;
}

.iot-card-metrics > span {
  padding: 0.4rem 0.5rem !important;
}

.iot-card-metrics small {
  font-size: 0.78rem !important;
}

.iot-card-metrics strong {
  margin-top: 0.15rem !important;
  font-size: 0.9rem !important;
}

.iot-card-alarm {
  margin-top: 0.15rem !important;
  font-size: 0.84rem !important;
}

.iot-card-foot {
  margin-top: auto !important;
  padding-top: 0.45rem !important;
}

@media (max-width: 1200px) {
  .iot-metrics-focus {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .iot-metrics-focus {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .iot-control-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* === User list/detail secondary page 2026-08 === */
.user-simple-panel .user-simple-list {
  display: flex;
  flex-direction: column;
}

.user-simple-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) minmax(150px, 0.9fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: inherit;
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.user-simple-row:hover {
  background: rgba(4, 120, 87, 0.05);
}

.user-simple-row:last-child {
  border-bottom: 0;
}

.user-simple-job strong,
.user-simple-status .directory-label {
  display: block;
}

.user-simple-job strong {
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: #0f172a;
}

.user-simple-job span:last-child {
  color: #64748b;
  font-size: 0.78rem;
}

.user-simple-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.user-simple-go {
  color: #047857;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}

.user-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.2rem 1.3rem;
}

.user-avatar-lg {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.2rem;
}

.user-detail-name {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.user-detail-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
  align-items: center;
}

.user-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.user-detail-kv {
  gap: 0.85rem 1rem;
}

.user-detail-workload .workload-heading {
  margin-bottom: 0.75rem;
  color: #334155;
  font-size: 0.86rem;
}

@media (max-width: 960px) {
  .user-simple-row {
    grid-template-columns: 1fr 1fr;
  }
  .user-simple-go {
    grid-column: 1 / -1;
    justify-self: end;
  }
  .user-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .user-simple-row {
    grid-template-columns: 1fr;
  }
  .user-detail-hero {
    align-items: flex-start;
  }
}



/* Asset card text uses regular weight for wallboard readability trial */
.iot-asset-card,
.iot-asset-card *,
.iot-card-signal,
.iot-card-title h3,
.iot-card-title p,
.iot-card-title .code,
.iot-card-metrics small,
.iot-card-metrics strong,
.iot-card-alarm,
.iot-card-alarm b,
.iot-card-foot,
.iot-card-foot span,
.iot-card-foot time,
.iot-card-top > span {
  font-weight: 400 !important;
}

/* English text color: unified brand green */
.eyebrow,
.eyebrow *,
.live-pulse,
.live-pulse *,
.demo-badge,
.demo-badge *,
.document-hero-mark,
.document-hero-mark *,
.code,
.code *,
.table-wrap .code,
.table-wrap td .code,
.document-reference .code,
.iot-card-title .code,
.iot-asset-card .iot-card-title .code,
.user-directory-foot .code,
.panel-heading .code,
.iot-fleet-head > div:first-child > span,
.iot-metric-block-head > span,
.iot-control-bar .iot-readonly,
.iot-readonly,
.document-version,
.document-version * {
  color: #047857 !important;
}

.eyebrow,
.live-pulse,
.document-hero-mark,
.iot-fleet-head > div:first-child > span,
.iot-metric-block-head > span {
  background: rgba(4, 120, 87, 0.1) !important;
  border-color: rgba(4, 120, 87, 0.16);
}

.demo-badge {
  color: #047857 !important;
  border-color: rgba(4, 120, 87, 0.18) !important;
  background: rgba(4, 120, 87, 0.08) !important;
}


/* === DOCUMENT PREVIEW DETAIL (2026-08-04) === */
.document-card-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.document-card-open:hover .document-title {
  color: #047857;
}

.document-file-icon {
  font-size: 0.95rem;
}

.document-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.document-detail-side,
.document-detail-preview {
  min-width: 0;
}

.document-detail-identity h2 {
  margin: 0.75rem 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.document-detail-identity > p {
  margin: 0 0 0.75rem;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.55;
}

.document-detail-kv {
  margin-top: 0.85rem;
}

.document-detail-files {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
}

.document-detail-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.document-detail-file {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.document-detail-file strong,
.document-detail-file small {
  display: block;
}

.document-detail-file small {
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.82rem;
}

.document-detail-file.is-active,
.document-detail-file:hover {
  border-color: rgba(4, 120, 87, 0.35);
  background: rgba(4, 120, 87, 0.06);
}

.document-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.document-preview-toolbar strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
}

.document-preview-body {
  min-height: 62vh;
}

.document-preview-frame {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 62vh;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: #0b1220;
}

.document-preview-iframe {
  width: 100%;
  min-height: 62vh;
  border: 0;
  background: #fff;
}

.document-preview-image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  margin: auto;
  object-fit: contain;
  background: #0b1220;
}

.document-preview-loading,
.document-preview-empty {
  display: grid;
  place-content: center;
  min-height: 62vh;
  padding: 2rem;
  text-align: center;
  color: #64748b;
  background: rgba(248, 250, 252, 0.9);
  border-radius: 1rem;
}

.document-preview-empty strong,
.document-preview-loading {
  color: #0f172a;
  font-size: 1rem;
}

.document-preview-empty span {
  display: block;
  max-width: 36rem;
  margin: 0.55rem auto 0;
  line-height: 1.6;
}


/* Document attachment preview page: full-width preview only */
.document-preview-only {
  width: 100%;
}

.document-preview-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}

.document-preview-chip {
  max-width: 100%;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.95);
  color: #334155;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.document-preview-chip.is-active,
.document-preview-chip:hover {
  border-color: rgba(4, 120, 87, 0.35);
  background: rgba(4, 120, 87, 0.08);
  color: #047857;
}

.document-preview-only .document-preview-body,
.document-preview-only .document-preview-frame,
.document-preview-only .document-preview-iframe,
.document-preview-only .document-preview-loading,
.document-preview-only .document-preview-empty {
  min-height: min(74vh, 820px);
}

@media (max-width: 960px) {
  .document-detail-layout {
    grid-template-columns: 1fr;
  }
  .document-preview-body,
  .document-preview-frame,
  .document-preview-iframe,
  .document-preview-loading,
  .document-preview-empty {
    min-height: 50vh;
  }
  .document-preview-only .document-preview-body,
  .document-preview-only .document-preview-frame,
  .document-preview-only .document-preview-iframe,
  .document-preview-only .document-preview-loading,
  .document-preview-only .document-preview-empty {
    min-height: 56vh;
  }
}



/* Global button color lock to #047857 (except danger) */
.button.primary,
.heading-actions .button.primary,
.page-heading .button.primary,
.toolbar-actions .button.primary,
.modal-actions .button.primary,
.landing-button.primary,
button.primary,
.primary {
  background: #047857 !important;
  border-color: #047857 !important;
  color: #ffffff !important;
}

.button.primary:hover,
.heading-actions .button.primary:hover,
.page-heading .button.primary:hover,
.toolbar-actions .button.primary:hover,
.modal-actions .button.primary:hover,
.landing-button.primary:hover,
button.primary:hover,
.primary:hover {
  background: #036649 !important;
  border-color: #036649 !important;
  color: #ffffff !important;
}

.button:hover:not(.danger):not(.primary) {
  border-color: #047857;
}

.link-button,
.panel-link,
a.panel-link,
.table-wrap .link-button,
.row-actions .link-button {
  color: #047857 !important;
}

.link-button:hover,
.panel-link:hover,
a.panel-link:hover {
  color: #036649 !important;
}

.button.primary *,
.landing-button.primary *,
button.primary * {
  color: #ffffff !important;
}

/* === Spares filter/pagination layout 2026-08 === */
.spares-tabs {
  margin-bottom: 0.9rem;
}

.spares-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.spares-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.spares-filter-form .search-box {
  min-width: min(100%, 14rem);
  flex: 1 1 12rem;
}

.spares-filter-form .filter-select {
  min-width: 8rem;
}

.spares-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  color: #64748b;
  font-size: 0.78rem;
}

.spares-pagination > div {
  display: flex;
  gap: 0.45rem;
}

.spares-pagination .button.is-disabled,
.spares-pagination a.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

@media (max-width: 900px) {
  .spares-toolbar {
    align-items: stretch;
  }
  .spares-filter-form {
    width: 100%;
  }
  .spares-filter-form .filter-select,
  .spares-filter-form .button {
    flex: 1 1 auto;
  }
}



/* ENGLISH_ACCENT_COLOR_STANDARD_v1 */
/* Product brand green for English labels, codes, mono captions, and primary actions: #047857 */
:root {
  --brand-green: #047857;
  --brand-green-rgb: 4 120 87;
  --brand-green-hover: #036649;
  --brand-green-soft: rgba(4, 120, 87, 0.10);
  --brand-green-soft-strong: rgba(4, 120, 87, 0.16);
}

.eyebrow,
.eyebrow *,
.live-pulse,
.live-pulse *,
.demo-badge,
.demo-badge *,
.document-hero-mark,
.document-hero-mark *,
.code,
.code *,
.table-wrap .code,
.table-wrap td .code,
.document-reference .code,
.iot-card-title .code,
.iot-asset-card .iot-card-title .code,
.user-directory-foot .code,
.panel-heading .code,
.channel-id,
.channel-id *,
.permission-count,
.nav-count,
.iot-fleet-head > div:first-child > span,
.iot-metric-block-head > span,
.iot-control-bar .iot-readonly,
.iot-readonly,
.document-version,
.document-version *,
.module-tabs a.active,
.user-simple-go,
.link-button,
.panel-link,
a.panel-link {
  color: var(--brand-green, #047857) !important;
}

.status[data-tone="green"],
.status.green,
.channel-state.connected,
.iot-card-foot .connection-live,
.iot-connection[data-state="LIVE"] {
  color: var(--brand-green, #047857) !important;
}

.button.primary,
.landing-button.primary,
button.primary,
.primary {
  background: var(--brand-green, #047857) !important;
  border-color: var(--brand-green, #047857) !important;
  color: #ffffff !important;
}

/* Live data refresh chip (was non-clickable status text) */
button.live-pulse {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(4, 120, 87, 0.18);
  cursor: pointer;
}

button.live-pulse:hover {
  background: rgba(4, 120, 87, 0.14) !important;
}

button.live-pulse:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Repair order codes: always brand green for existing and new rows */
.repair-order-code,
.table-wrap .repair-order-code,
.table-wrap td .repair-order-code {
  color: #047857 !important;
  font-weight: 400;
}

/* Purchase request codes: always brand green for existing and new rows */
.purchase-request-code,
.table-wrap .purchase-request-code,
.table-wrap td .purchase-request-code {
  color: #047857 !important;
  font-weight: 400;
}

/* Inspection task codes: always brand green for existing and new rows */
.inspection-task-code,
.table-wrap .inspection-task-code,
.table-wrap td .inspection-task-code {
  color: #047857 !important;
  font-weight: 400;
}

/* Inspection plan code color */
.inspection-plan-code,
.table-wrap .inspection-plan-code {
  color: #047857 !important;
  font-weight: 400;
}

/* inspection standard code color */
.inspection-standard-code,
.table-wrap .inspection-standard-code,
.table-wrap td .inspection-standard-code {
  color: #047857 !important;
}

/* Import batch codes: always brand green for existing and new rows */
.import-batch-code,
.table-wrap .import-batch-code,
.table-wrap td .import-batch-code {
  color: #047857 !important;
  font-weight: 400;
}


/* DASHBOARD_SIGNAL_CARD_REDESIGN_v1 */
/* Operations dashboard: readable, non-overlapping runtime status card */
.dashboard-main .signal-card,
.signal-card {
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.35rem 1.4rem !important;
}

.signal-card .panel-heading {
  margin-bottom: 0.85rem;
  align-items: flex-start;
  gap: 0.75rem;
}

.signal-card .panel-heading h2 {
  font-size: 1.15rem !important;
  font-weight: 650 !important;
  line-height: 1.3;
  color: #0f172a !important;
}

.signal-card .panel-heading p,
.signal-card .panel-link {
  font-size: 0.9rem !important;
  line-height: 1.45;
  font-weight: 400 !important;
}

.signal-card .panel-heading p {
  color: #475569 !important;
}

.signal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.signal-card .mini-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(4, 120, 87, 0.14);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(4, 120, 87, 0.08), rgba(4, 120, 87, 0.02)),
    #ffffff;
}

.signal-card .mini-kpi-value {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.signal-card .mini-kpi strong {
  font-size: clamp(2.1rem, 2.8vw, 2.6rem) !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  color: #047857 !important;
  letter-spacing: -0.03em;
}

.signal-card .mini-kpi-total {
  font-size: 1.05rem !important;
  color: #64748b !important;
  font-weight: 400 !important;
}

.signal-card .mini-kpi-label,
.signal-card .mini-kpi span {
  font-size: 0.94rem !important;
  color: #475569 !important;
  font-weight: 400 !important;
}

.signal-card .signal-legend {
  position: static !important;
  inset: auto !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.signal-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.85rem;
  background: #f8fafc;
}

.signal-chip em {
  flex: 1 1 auto;
  font-style: normal;
  font-size: 0.92rem !important;
  color: #475569 !important;
  font-weight: 400 !important;
}

.signal-chip b {
  font-size: 1.08rem !important;
  font-weight: 400 !important;
  color: #0f172a !important;
  font-variant-numeric: tabular-nums;
}

.signal-card .legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin: 0;
}

.signal-card .signal-path,
.signal-card::before,
.signal-card::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 720px) {
  .signal-card .signal-legend {
    grid-template-columns: 1fr;
  }
}

/* === User detail page redesign 2026-08 === */
.ud-profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.15rem 1.25rem !important;
}

.ud-profile-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.9rem;
}

.ud-profile-name,
.ud-profile-sub,
.ud-k,
.ud-v,
.ud-card-title,
.ud-chips .ud-chip,
.ud-link,
.ud-mono {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
}

.ud-profile-name {
  color: #0f172a;
}

.ud-profile-sub {
  margin-top: 0.15rem;
  color: #64748b;
}

.ud-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
  align-items: center;
}

.ud-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ud-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.ud-main,
.ud-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.ud-card {
  padding: 1.15rem 1.2rem !important;
}

.ud-card-title {
  margin: 0 0 0.9rem;
  color: #0f172a;
}

.ud-list {
  display: flex;
  flex-direction: column;
}

.ud-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.72rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.ud-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.ud-row:last-child {
  padding-bottom: 0;
}

.ud-k {
  color: #64748b;
}

.ud-v {
  color: #0f172a;
  word-break: break-word;
}

.ud-mono {
  font-family: var(--font-data), ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  color: #334155 !important;
}

.ud-load-top {
  margin-bottom: 0.85rem;
}

.ud-load-state {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.3rem;
}

.ud-load-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.ud-load-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.95);
}

.ud-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.ud-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(4, 120, 87, 0.14);
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.07);
  color: #065f46 !important;
}

.ud-chip.is-empty {
  border-style: dashed;
  background: transparent;
  color: #94a3b8 !important;
}

.ud-link {
  display: inline-flex;
  margin-top: 0.9rem;
  padding: 0;
  border: 0;
  background: none;
  color: #047857 !important;
  cursor: pointer;
}

@media (max-width: 980px) {
  .ud-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ud-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .ud-load-grid {
    grid-template-columns: 1fr;
  }
  .ud-profile {
    align-items: flex-start;
  }
}
/* === User detail single card 2026-08 === */
.ud-single-card {
  width: 100%;
  max-width: none;
  padding: 1.25rem 1.4rem 1.45rem !important;
}

.ud-single-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.ud-single-card .ud-profile-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.9rem;
}

.ud-single-card .ud-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ud-section {
  padding: 1.05rem 0 0.2rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.ud-section:first-of-type {
  border-top: 0;
  padding-top: 0.9rem;
}

.ud-single-card .ud-card-title {
  margin: 0 0 0.7rem;
  color: #0f172a;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
}

/* Fill page width with 2-column field tiles */
.ud-single-card .ud-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1.1rem;
}

.ud-single-card .ud-row {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.55rem 0.85rem;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.9);
}

.ud-single-card .ud-row:first-child {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding-top: 0.7rem;
}

.ud-single-card .ud-k,
.ud-single-card .ud-v,
.ud-single-card .ud-mono,
.ud-single-card .ud-chip,
.ud-single-card .ud-link,
.ud-single-card .ud-profile-name,
.ud-single-card .ud-profile-sub {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
}

.ud-single-card .ud-k {
  color: #64748b !important;
}

.ud-single-card .ud-v,
.ud-single-card .ud-profile-name {
  color: #0f172a !important;
  word-break: break-word;
}

.ud-single-card .ud-profile-sub {
  margin-top: 0.15rem;
  color: #64748b !important;
}

.ud-single-card .ud-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  align-items: center;
}

.ud-single-card .ud-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.ud-single-card .ud-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(4, 120, 87, 0.14);
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.07);
  color: #065f46 !important;
}

.ud-single-card .ud-chip.is-empty {
  border-style: dashed;
  background: transparent;
  color: #94a3b8 !important;
}

.ud-single-card .ud-link {
  display: inline-flex;
  margin-top: 0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: #047857 !important;
  cursor: pointer;
}

.ud-single-card .ud-mono {
  font-family: var(--font-data), ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  color: #334155 !important;
}

/* Open ID / long values span full width for balance */
.ud-single-card .ud-list .ud-row:has(.ud-mono) {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .ud-single-card .ud-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ud-single-head {
    align-items: flex-start;
  }
  .ud-single-card .ud-row {
    grid-template-columns: 1fr;
    gap: 0.18rem;
  }
}
/* === User list directory label size fix 2026-08 === */
/* Keep list labels (岗位/状态) same size as body text */
.user-simple-row .directory-label,
.user-simple-job .directory-label,
.user-simple-status .directory-label {
  font-family: var(--font-body) !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  margin-bottom: 0.35rem !important;
  color: #64748b !important;
}

.user-simple-job strong {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
}

.user-simple-job span:last-child {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
}

.user-simple-row .user-identity strong {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
}

.user-simple-row .user-idline {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
}

.user-simple-go {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
}
/* === Repair analytics 2026-08 === */
.ra-panel {
  margin-bottom: 14px;
}

.ra-grid-2 {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}

.ra-funnel {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.ra-funnel-step {
  flex: 1 1 88px;
  min-width: 88px;
  padding: 0.85rem 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
  text-align: center;
}

.ra-funnel-step strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.ra-funnel-step span {
  display: block;
  margin-top: 0.3rem;
  color: #64748b;
  font-size: 0.8rem;
}

.ra-funnel-arrow {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 0.95rem;
  padding: 0 0.1rem;
}

.ra-bar-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.ra-bar-row {
  display: grid;
  grid-template-columns: minmax(88px, 1.1fr) minmax(80px, 2fr) auto;
  gap: 0.7rem;
  align-items: center;
}

.ra-bar-name {
  color: #0f172a;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.ra-bar-name:hover {
  color: #047857;
}

.ra-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.ra-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(4, 120, 87, 0.55), #047857);
}

.ra-bar-row strong {
  font-family: var(--mono, monospace);
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  min-width: 1.5rem;
  text-align: right;
}

.ra-priority-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.ra-priority-card {
  padding: 0.9rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
}

.ra-priority-card span {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
}

.ra-priority-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.ra-priority-card small {
  display: block;
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.78rem;
}

.ra-priority-card.is-p1 {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(254, 242, 242, 0.85);
}

.ra-priority-card.is-p2 {
  border-color: rgba(217, 119, 6, 0.18);
  background: rgba(255, 251, 235, 0.9);
}

.ra-priority-card.is-p3 {
  border-color: rgba(4, 120, 87, 0.16);
  background: rgba(236, 253, 245, 0.75);
}

.ra-aging {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.ra-aging > div {
  padding: 0.75rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.72);
}

.ra-aging span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
}

.ra-aging strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.15rem;
  color: #0f172a;
}

.ra-trend {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 0.45rem;
  align-items: end;
  min-height: 150px;
  padding-top: 0.4rem;
}

.ra-trend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.ra-trend-cols {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 100%;
  height: 120px;
}

.ra-trend-open,
.ra-trend-close {
  flex: 1;
  min-height: 6px;
  border-radius: 4px 4px 0 0;
}

.ra-trend-open {
  background: linear-gradient(180deg, rgba(4, 120, 87, 0.85), rgba(4, 120, 87, 0.35));
}

.ra-trend-close {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.8), rgba(37, 99, 235, 0.28));
}

.ra-trend-item small {
  color: #64748b;
  font-size: 0.68rem;
  white-space: nowrap;
}

.ra-legend {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  color: #64748b;
  font-size: 0.8rem;
}

.ra-legend-open::before,
.ra-legend-close::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.ra-legend-open::before { background: #047857; }
.ra-legend-close::before { background: #2563eb; }

.ra-kpi-notes {
  display: grid;
  gap: 0.75rem;
}

.ra-kpi-notes > div {
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.88);
}

.ra-kpi-notes strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #0f172a;
  font-size: 0.9rem;
}

.ra-kpi-notes span {
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .ra-grid-2 {
    grid-template-columns: 1fr;
  }

  .ra-trend {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    row-gap: 0.9rem;
  }
}

@media (max-width: 720px) {
  .ra-priority-grid,
  .ra-aging {
    grid-template-columns: 1fr;
  }

  .ra-bar-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .ra-bar-row strong {
    text-align: left;
  }
}

/* === Repair list + detail 2026-08 === */
.repair-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.repair-toolbar .toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.repair-pagination {
  margin-top: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

a.repair-order-code,
a.repair-asset-link,
a.repair-desc-link {
  color: inherit;
  text-decoration: none;
}

a.repair-order-code:hover,
a.repair-asset-link:hover,
a.repair-desc-link:hover {
  color: #047857;
}

.repair-detail-card .repair-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.repair-photo-group,
.repair-photo-empty {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
}

.repair-photo-group strong,
.repair-photo-empty strong {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.repair-photo-empty span {
  color: #64748b;
  font-size: 0.84rem;
}

.repair-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.repair-photo-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(4, 120, 87, 0.18);
  background: rgba(4, 120, 87, 0.06);
  color: #047857;
  font-size: 0.78rem;
}

.repair-timeline {
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .repair-detail-card .repair-photo-grid {
    grid-template-columns: 1fr;
  }
}

/* === Dashboard: ops+risk merged under signal 2026-08 === */
.dashboard-signal-full {
  margin-bottom: 14px;
}

.dashboard-ops-card {
  margin-bottom: 14px;
}

.dashboard-ops-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.dashboard-ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
  align-items: start;
}

.dashboard-ops-col + .dashboard-ops-col {
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  padding-left: 1.25rem;
}

.dashboard-ops-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.dashboard-ops-subhead strong {
  font-size: 0.95rem;
  font-weight: 650;
  color: #0f172a;
}

.dashboard-ops-subhead span {
  color: #64748b;
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .dashboard-ops-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .dashboard-ops-col + .dashboard-ops-col {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 1.1rem;
  }
}

/* === User list dual status columns 2026-08 === */
.user-simple-row {
  grid-template-columns: minmax(220px, 1.25fr) minmax(170px, 0.95fr) minmax(220px, 1.1fr) auto !important;
}

.user-simple-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
}

.user-simple-status-item {
  min-width: 0;
}

.user-simple-status-item .directory-label {
  display: block;
  margin-bottom: 0.35rem;
}

/* Keep work-state badge size identical to account status lamp in list/detail. */
.user-simple-status .repair-work-state,
.ud-profile-tags .repair-work-state,
.ud-list .repair-work-state {
  min-height: 1.55rem !important;
  padding: 0.16rem 0.64rem 0.16rem 0.48rem !important;
  gap: 0.42rem !important;
  font-size: 0.78rem !important;
  font-weight: 650 !important;
  line-height: 1.1 !important;
}

.user-simple-status .repair-work-state::before,
.ud-profile-tags .repair-work-state::before,
.ud-list .repair-work-state::before {
  width: 0.52rem !important;
  height: 0.52rem !important;
}

@media (max-width: 1100px) {
  .user-simple-status {
    grid-template-columns: 1fr;
  }
}

