@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700;12..96,800&family=IBM+Plex+Mono:wght@500;600&display=swap&subset=vietnamese,latin");

/*
 * AGRIBEACON FIELD COMMAND
 * A complete visual layer over the existing semantic UI contracts.
 */

:root {
  --background: #f3f1e9;
  --foreground: #17201a;
  --card: #fbfaf5;
  --card-foreground: #17201a;
  --muted: #edeee7;
  --muted-foreground: #667069;
  --primary: #4e9b3e;
  --primary-foreground: #f9fff5;
  --primary-soft: #e4f2dc;
  --primary-ink: #2f7029;
  --secondary: #e9ece4;
  --accent: #c9f55a;
  --border: #d8ddd3;
  --border-strong: #bdc6ba;
  --input: #cbd2c7;
  --ring: #4e9b3e;
  --sidebar: #152019;
  --sidebar-soft: #1e2b22;
  --sidebar-accent: #29382d;
  --sidebar-foreground: #edf3eb;
  --success: #31843a;
  --warning: #c66b16;
  --danger: #b73b35;
  --info: #356f8c;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(20, 32, 25, 0.05), 0 12px 30px rgba(20, 32, 25, 0.06);
  --shadow-hover: 0 2px 4px rgba(20, 32, 25, 0.06), 0 20px 44px rgba(20, 32, 25, 0.1);
  --shadow-floating: 0 28px 80px rgba(10, 18, 12, 0.22);
  --font-body: "Be Vietnam Pro", sans-serif;
  --font-display: "Bricolage Grotesque", "Be Vietnam Pro", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --fast: 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --enter: 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  scrollbar-color: #aeb9aa transparent;
  scrollbar-width: thin;
}

*::selection {
  background: var(--accent);
  color: #17201a;
}

html {
  background: var(--background);
}

body {
  position: relative;
  min-width: 320px;
  background:
    linear-gradient(rgba(29, 48, 34, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 48, 34, 0.026) 1px, transparent 1px),
    var(--background);
  background-size: 40px 40px;
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 88% 2%, rgba(201, 245, 90, 0.13), transparent 23%),
    radial-gradient(circle at 28% 100%, rgba(78, 155, 62, 0.08), transparent 28%);
  content: "";
  pointer-events: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  text-wrap: balance;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(25px, 2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.045em;
}

h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
input,
select,
textarea {
  font-family: var(--font-body);
}

button,
a,
input,
select,
textarea {
  transition:
    border-color var(--fast),
    background-color var(--fast),
    color var(--fast),
    box-shadow var(--fast),
    transform var(--fast);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(78, 155, 62, 0.25);
  outline-offset: 2px;
}

/* Login */
.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
  min-height: 100svh;
  padding: 0;
  overflow: hidden;
  background: var(--sidebar);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(28px, 4vw, 62px);
  background:
    linear-gradient(rgba(201, 245, 90, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 245, 90, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 76% 51%, rgba(78, 155, 62, 0.22), transparent 30%),
    #152019;
  background-size: 56px 56px, 56px 56px, auto, auto;
  color: var(--sidebar-foreground);
}

.login-story::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, transparent 0 47%, rgba(201, 245, 90, 0.08) 47.1% 47.25%, transparent 47.35%);
  content: "";
}

.brand-block {
  position: relative;
  z-index: 1;
  border: 0;
}

.login-brand {
  align-self: flex-start;
  padding: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(201, 245, 90, 0.62);
  border-radius: 12px 4px 12px 4px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(201, 245, 90, 0.08), 0 0 36px rgba(201, 245, 90, 0.22);
  color: #142017;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
}

.brand-mark::after {
  position: absolute;
  right: -9px;
  bottom: -10px;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(21, 32, 25, 0.38);
  border-radius: 50%;
  content: "";
}

.brand-kicker,
.top-kicker,
.login-index,
.nav-group-label,
.environment-pill,
.brand-version {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.brand-kicker {
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
}

.login-brand h1,
.shell-brand h1 {
  color: #f4f7f2;
  font-size: 20px;
}

.login-message {
  position: relative;
  z-index: 2;
  width: min(700px, 87%);
  margin: auto 0;
}

.login-index {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 11px;
}

.login-message h2 {
  max-width: 690px;
  color: #f5f8f3;
  font-size: clamp(42px, 5.2vw, 78px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.login-message h2 em {
  color: var(--accent);
  font-style: normal;
}

.login-message > p:last-child {
  max-width: 530px;
  margin-top: 28px;
  color: #aebcaf;
  font-size: clamp(14px, 1.3vw, 17px);
  font-weight: 400;
}

.beacon-visual {
  position: absolute;
  top: 50%;
  right: clamp(-160px, -8vw, -80px);
  width: min(42vw, 620px);
  aspect-ratio: 1;
  transform: translateY(-50%);
}

.beacon-ring,
.beacon-core {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.beacon-ring {
  border: 1px solid rgba(201, 245, 90, 0.18);
}

.ring-one { width: 100%; height: 100%; }
.ring-two { width: 68%; height: 68%; border-color: rgba(201, 245, 90, 0.28); }
.ring-three { width: 36%; height: 36%; border-color: rgba(201, 245, 90, 0.45); }

.beacon-ring::before,
.beacon-ring::after {
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(201, 245, 90, 0.18);
  content: "";
  transform: translate(-50%, -50%);
}

.beacon-ring::before { width: 100%; height: 1px; }
.beacon-ring::after { width: 1px; height: 100%; }

.beacon-core {
  width: 18px;
  height: 18px;
  background: var(--accent);
  box-shadow: 0 0 0 13px rgba(201, 245, 90, 0.12), 0 0 44px rgba(201, 245, 90, 0.72);
  animation: beaconPulse 2.8s ease-in-out infinite;
}

.beacon-label {
  position: absolute;
  top: calc(50% + 24px);
  left: calc(50% + 28px);
  width: 160px;
  color: rgba(237, 243, 235, 0.55);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.login-system-strip {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 28px;
  color: #93a396;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-system-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-system-strip i,
.environment-pill i,
.status-pulse {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(201, 245, 90, 0.58);
}

.login-card {
  position: relative;
  align-content: center;
  width: auto;
  min-height: 100svh;
  gap: 22px;
  padding: clamp(36px, 7vw, 100px);
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 100% 0, rgba(78, 155, 62, 0.12), transparent 24%),
    var(--card);
  box-shadow: none;
}

.login-card::before {
  position: absolute;
  top: 44px;
  right: 44px;
  width: 42px;
  height: 42px;
  border-top: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  content: "";
}

.login-card-head {
  margin-bottom: 12px;
}

.login-card-head .login-index {
  margin-bottom: 14px;
  color: var(--primary-ink);
}

.login-card-head h2 {
  margin-bottom: 8px;
  font-size: clamp(32px, 3vw, 46px);
}

.login-card-head > p:last-child {
  color: var(--muted-foreground);
  font-weight: 400;
}

.login-card label {
  gap: 9px;
  color: var(--foreground);
  font-size: 13px;
}

.login-card input {
  min-height: 52px;
  padding: 0 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.login-submit {
  min-height: 52px;
  justify-content: space-between;
  margin-top: 4px;
  padding-inline: 18px;
}

.login-footnote {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-error:not(:empty) {
  padding: 10px 12px;
  border: 1px solid rgba(183, 59, 53, 0.24);
  border-radius: 8px;
  background: rgba(183, 59, 53, 0.08);
}

/* Application shell */
.app-shell {
  grid-template-columns: 274px minmax(0, 1fr);
  min-height: 100svh;
  background: transparent;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: 274px;
  min-height: 100svh;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-right: 1px solid rgba(201, 245, 90, 0.08);
  background:
    linear-gradient(rgba(201, 245, 90, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 245, 90, 0.035) 1px, transparent 1px),
    var(--sidebar);
  background-size: 34px 34px;
  box-shadow: 14px 0 50px rgba(16, 28, 19, 0.08);
}

.sidebar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(201, 245, 90, 0.08);
  border-radius: 50% 0 0;
  content: "";
  transform: translate(38%, 38%);
  pointer-events: none;
}

.shell-brand {
  min-height: 86px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(237, 243, 235, 0.09);
}

.shell-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px 3px 10px 3px;
  font-size: 18px;
}

.shell-brand h1 { font-size: 18px; }

.brand-version {
  margin-left: auto;
  color: #77867a;
  font-size: 9px;
}

.sidebar-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 14px 14px 8px;
  padding: 9px 10px;
  border: 1px solid rgba(201, 245, 90, 0.12);
  border-radius: 8px;
  background: rgba(201, 245, 90, 0.04);
  color: #aab8ac;
  font-size: 10px;
}

.sidebar-status strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.side-nav {
  display: block;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 18px;
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.nav-group-label {
  margin: 0 0 7px;
  padding: 0 10px;
  color: #68776b;
  font-size: 9px;
  font-weight: 600;
}

.side-nav a,
.side-nav button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: 30px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 7px;
  border: 0;
  border-radius: 9px;
  color: #bbc6bd;
  font-size: 13px;
  font-weight: 500;
}

.side-nav a:hover,
.side-nav button:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #f1f5ef;
  transform: translateX(2px);
}

.side-nav a.active,
.side-nav button.active {
  border-left: 0;
  background: linear-gradient(90deg, rgba(201, 245, 90, 0.14), rgba(201, 245, 90, 0.055));
  box-shadow: inset 0 0 0 1px rgba(201, 245, 90, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon-wrap {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  color: #829085;
}

.side-nav a:hover .nav-icon-wrap,
.side-nav a.active .nav-icon-wrap,
.side-nav button:hover .nav-icon-wrap,
.side-nav button.active .nav-icon-wrap {
  background: rgba(201, 245, 90, 0.08);
  color: var(--accent);
}

.nav-icon-wrap .ui-icon {
  width: 17px;
  height: 17px;
}

.nav-active-mark {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.side-nav a.active .nav-active-mark,
.side-nav button.active .nav-active-mark {
  background: var(--accent);
  box-shadow: 0 0 9px rgba(201, 245, 90, 0.7);
}

.role-card {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 68px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 10px 12px 14px;
  padding: 10px;
  border: 1px solid rgba(237, 243, 235, 0.09);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(201, 245, 90, 0.26);
  border-radius: 10px 4px 10px 4px;
  background: rgba(201, 245, 90, 0.1);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}

.user-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.user-copy strong,
.user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  color: #f2f5f0;
  font-size: 12px;
}

.side-label {
  color: #849187;
  font-size: 10px;
  font-weight: 500;
}

.user-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(201, 245, 90, 0.55);
}

.main {
  grid-column: 2;
  min-width: 0;
  padding: 0 26px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 86px;
  margin: 0 -26px 24px;
  padding: 14px 26px;
  border-bottom: 1px solid rgba(189, 198, 186, 0.74);
  background: rgba(243, 241, 233, 0.86);
  backdrop-filter: blur(18px) saturate(1.2);
}

.topbar-leading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.top-kicker {
  margin: 0 0 3px;
  color: var(--primary-ink);
  font-size: 9px;
  font-weight: 600;
}

.topbar h2 {
  font-size: 26px;
  line-height: 1.05;
}

.page-context {
  margin-top: 4px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 400;
}

.top-actions {
  gap: 8px;
}

.save-status,
.environment-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(251, 250, 245, 0.7);
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.save-status .ui-icon {
  width: 13px;
  height: 13px;
  color: var(--primary);
}

.environment-pill {
  color: var(--primary-ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.environment-pill i {
  width: 6px;
  height: 6px;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(78, 155, 62, 0.5);
}

.mobile-menu-button {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--foreground);
}

.sidebar-backdrop {
  display: none;
}

.view-frame {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.view:not(.hidden) {
  animation: viewEnter var(--enter) both;
}

/* Controls */
.button {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.button-primary {
  border: 1px solid #3d8333;
  background: linear-gradient(180deg, #5aa849, #438f37);
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2) inset, 0 5px 14px rgba(47, 112, 41, 0.18);
  color: #fff;
}

.button-primary:hover {
  background: linear-gradient(180deg, #61b24f, #438f37);
  box-shadow: 0 7px 20px rgba(47, 112, 41, 0.24);
  transform: translateY(-1px);
}

.button-primary:active {
  transform: translateY(0);
}

.button-secondary {
  border: 1px solid var(--border);
  background: rgba(251, 250, 245, 0.86);
  color: var(--foreground);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: #fff;
  box-shadow: 0 5px 16px rgba(20, 32, 25, 0.08);
}

.logout-button {
  padding-inline: 11px;
}

.logout-button .ui-icon {
  width: 15px;
  height: 15px;
}

.text-button {
  color: var(--primary-ink);
  font-size: 12px;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--foreground);
  font-size: 11px;
}

.mini-button:hover {
  border-color: rgba(78, 155, 62, 0.45);
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

label {
  gap: 7px;
  color: #364139;
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  border: 1px solid var(--input);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 1px rgba(20, 32, 25, 0.025) inset;
}

input,
select {
  min-height: 42px;
  padding: 8px 11px;
}

textarea {
  padding: 11px 12px;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: #949e96;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(78, 155, 62, 0.13);
}

/* Surfaces and layout */
.panel {
  border: 1px solid rgba(189, 198, 186, 0.74);
  border-radius: var(--radius-lg);
  background: rgba(251, 250, 245, 0.92);
  box-shadow: var(--shadow);
}

.panel:hover {
  border-color: var(--border-strong);
}

.form-panel,
.message-panel,
.preview-panel,
.queue-panel {
  padding: clamp(16px, 2vw, 24px);
}

.queue-panel {
  max-width: none;
  margin-top: 16px;
}

.standalone-queue {
  margin-top: 0;
}

.section-title {
  gap: 18px;
  margin-bottom: 18px;
}

.section-title h3 {
  position: relative;
  padding-left: 13px;
}

.section-title h3::before {
  position: absolute;
  top: 0.24em;
  bottom: 0.2em;
  left: 0;
  width: 4px;
  border-radius: 3px;
  background: var(--primary);
  content: "";
}

.section-title p {
  max-width: 660px;
  margin: 5px 0 0 13px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 400;
}

.workspace {
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
  gap: 16px;
  max-width: none;
}

.side-stack {
  gap: 16px;
}

.form-grid {
  gap: 15px;
}

.stats-row {
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  min-height: 84px;
  padding: 16px 18px;
  border-color: rgba(189, 198, 186, 0.75);
  border-radius: 14px;
  background: rgba(251, 250, 245, 0.9);
  box-shadow: var(--shadow);
}

.stat strong {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--primary-ink);
}

.stat span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Data tables */
.item-table-shell,
.queue-table-shell,
.detail-table-shell {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
}

.item-table th,
.queue-table th,
.detail-table th {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  background: #e9ece4;
  color: #536057;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.item-table td,
.queue-table td,
.detail-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(216, 221, 211, 0.72);
  background: rgba(255, 255, 255, 0.38);
  font-size: 12px;
}

.item-table tbody tr:last-child td,
.queue-table tbody tr:last-child td,
.detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.queue-table tbody tr:hover td,
.detail-table tbody tr:hover td {
  background: rgba(228, 242, 220, 0.58);
}

.queue-table tr.selected-row td {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.data-table-toolbar,
.data-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-table-toolbar {
  margin-bottom: 10px;
}

.data-table-search {
  flex: 1 1 340px;
  max-width: 520px;
}

.data-table-search input {
  width: 100%;
  min-height: 38px;
  padding-left: 13px;
  background: rgba(255, 255, 255, 0.86);
}

.data-table-toolbar-actions,
.data-table-pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-table-toolbar select {
  min-height: 38px;
  min-width: 128px;
  background: rgba(255, 255, 255, 0.86);
}

.data-table-footer {
  min-height: 36px;
  padding-top: 9px;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 10px;
}

.data-table-pages > span {
  min-width: 76px;
  text-align: center;
}

.data-table-pages .mini-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.data-table-empty {
  padding: 28px 12px !important;
  text-align: center;
}

.hardware-workspace > .data-table-toolbar,
.product-entity-section > .data-table-toolbar {
  padding: 0 24px;
}

.hardware-workspace > .data-table-footer,
.product-entity-section > .data-table-footer {
  padding: 9px 24px 14px;
}

#bomAvailabilityResult .data-table-toolbar {
  margin-top: 12px;
}

.item-table input,
.item-table textarea {
  border-color: transparent;
  border-radius: 7px;
  background: rgba(243, 245, 239, 0.85);
}

.item-table input:focus,
.item-table textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.request-code {
  color: var(--primary-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.status-badge {
  min-height: 25px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.status-pending {
  border-color: rgba(198, 107, 22, 0.25);
  background: #fff0dd;
  color: #944d0c;
}

.status-approved {
  border-color: rgba(49, 132, 58, 0.26);
  background: #e4f2dc;
  color: #296e31;
}

.status-rejected {
  border-color: rgba(183, 59, 53, 0.24);
  background: #f9e5e2;
  color: #9f302c;
}

.queue-actions {
  gap: 6px;
}

/* Dashboard */
.dash-header {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  background:
    linear-gradient(112deg, rgba(201, 245, 90, 0.1), transparent 38%),
    rgba(251, 250, 245, 0.94);
}

.dash-header::after {
  position: absolute;
  top: -62px;
  right: -42px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(78, 155, 62, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(78, 155, 62, 0.04), 0 0 0 68px rgba(78, 155, 62, 0.025);
  content: "";
}

.dash-title,
.dash-controls {
  position: relative;
  z-index: 1;
}

.dash-title h3 {
  font-size: 20px;
}

.dash-title p {
  max-width: 620px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 400;
}

.dash-controls {
  gap: 7px;
}

.dash-controls select,
.dash-controls input[type="date"] {
  min-height: 36px;
  padding: 6px 9px;
  border-color: var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

.kpi-row {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.kpi {
  position: relative;
  min-height: 126px;
  justify-content: flex-end;
  gap: 5px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(189, 198, 186, 0.75);
  border-radius: 14px;
  background: rgba(251, 250, 245, 0.94);
  box-shadow: var(--shadow);
}

.kpi::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent) 54%, transparent 54%);
  content: "";
  opacity: 0.76;
}

button.kpi:hover {
  border-color: rgba(78, 155, 62, 0.5);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.kpi-label {
  order: 2;
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi-value {
  order: 1;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.kpi-sub,
.delta {
  order: 3;
  font-size: 10px;
}

.dash-main,
.charts-grid {
  gap: 16px;
}

.chart-panel {
  min-height: 260px;
  padding: 20px;
}

.chart-panel h3 {
  margin-bottom: 18px;
}

.hbar-chart {
  gap: 11px;
}

.hbar-row {
  grid-template-columns: 138px minmax(0, 1fr) 32px;
}

.hbar-label,
.hbar-value {
  font-size: 11px;
}

.hbar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #e4e8df;
}

.hbar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-ink), var(--primary));
}

.col-chart {
  gap: 10px;
  min-height: 190px;
  border-bottom: 1px solid var(--border);
}

.col-bar {
  max-width: 28px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

.col-value {
  font-family: var(--font-mono);
  font-size: 10px;
}

.col-label {
  font-size: 10px;
}

.deal-panel {
  margin-top: 16px;
  overflow: hidden;
  background: rgba(251, 250, 245, 0.96);
}

.deal-head {
  position: relative;
  display: flex;
  min-height: 142px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 25px 28px;
  background:
    linear-gradient(rgba(201, 245, 90, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 245, 90, 0.045) 1px, transparent 1px),
    #17251b;
  background-size: 28px 28px;
  color: #f4f6ef;
}

.deal-head::after {
  position: absolute;
  top: -80px;
  right: 11%;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(201, 245, 90, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 37px rgba(201, 245, 90, 0.035), 0 0 0 74px rgba(201, 245, 90, 0.018);
  content: "";
  pointer-events: none;
}

.deal-head-copy,
.deal-head-stat {
  position: relative;
  z-index: 1;
}

.deal-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.deal-head h3 {
  margin: 0;
  color: #f4f6ef;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1;
}

.deal-head p {
  max-width: 760px;
  margin: 9px 0 0;
  color: #9eada1;
  font-size: 11px;
  line-height: 1.55;
}

.deal-head-stat {
  display: grid;
  min-width: 174px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(201, 245, 90, 0.18);
  border-radius: 10px;
  background: rgba(201, 245, 90, 0.055);
}

.deal-head-stat strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
}

.deal-head-stat span {
  color: #bac5bc;
  font-size: 10px;
  line-height: 1.4;
}

.quality-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--border);
}

.quality-tile {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 16px 20px;
  background: #edf0e8;
}

.quality-label {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quality-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.quality-value-row strong {
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1;
}

.quality-value-row span {
  color: var(--primary-ink);
  font-family: var(--font-mono);
  font-size: 9px;
}

.quality-detail {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-meter {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(106, 121, 108, 0.16);
}

.quality-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.quality-warning .quality-meter i { background: #c47722; }
.quality-muted .quality-meter i { background: #8a958c; }

.deal-scope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 249, 244, 0.9);
}

.deal-scope-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.deal-scope-copy strong {
  color: var(--foreground);
  font-size: 11px;
}

.deal-scope-copy span {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.45;
}

.deal-toggle {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 10px;
}

.deal-list {
  display: grid;
}

.deal-row {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 44px minmax(160px, 1.15fr) minmax(240px, 1.15fr) minmax(150px, 0.8fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid rgba(216, 221, 211, 0.8);
  background: rgba(255, 255, 255, 0.28);
  transition: background 150ms ease, transform 150ms ease;
}

.deal-row::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #879188;
  content: "";
}

.deal-row:last-child { border-bottom: 0; }
.deal-row:hover { z-index: 1; background: rgba(228, 242, 220, 0.5); }
.deal-high::before { background: var(--primary); }
.deal-medium::before { background: #c47722; }

.deal-rank {
  color: #919b93;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.deal-high .deal-rank { color: var(--primary-ink); }

.deal-shop {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.deal-source {
  color: var(--primary-ink);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.deal-shop strong {
  overflow: hidden;
  color: var(--foreground);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-shop > span:last-child,
.deal-money span,
.deal-money small,
.deal-signal small {
  color: var(--muted-foreground);
  font-size: 9px;
}

.deal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 6px;
}

.deal-metrics > span {
  display: grid;
  gap: 1px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.deal-metrics strong {
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.1;
}

.deal-metrics small {
  color: var(--muted-foreground);
  font-size: 8px;
  white-space: nowrap;
}

.deal-money,
.deal-signal {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.deal-money > span {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.deal-money strong {
  color: var(--foreground);
  font-size: 12px;
}

.deal-signal-label {
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid rgba(89, 102, 91, 0.18);
  border-radius: 5px;
  background: rgba(89, 102, 91, 0.06);
  color: #4e5a50;
  font-size: 9px;
  font-weight: 700;
}

.deal-high .deal-signal-label {
  border-color: rgba(49, 132, 58, 0.25);
  background: #e4f2dc;
  color: #296e31;
}

.deal-medium .deal-signal-label {
  border-color: rgba(198, 107, 22, 0.23);
  background: #fff0dd;
  color: #944d0c;
}

.deal-shop-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(78, 155, 62, 0.32);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--primary-ink);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.deal-shop-link:hover {
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.deal-link-disabled {
  border-color: var(--border);
  color: var(--muted-foreground);
  cursor: default;
}

.deal-empty {
  margin: 0;
  padding: 24px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.deal-footnote {
  margin: 0;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: rgba(237, 240, 232, 0.7);
  color: var(--muted-foreground);
  font-size: 9px;
  line-height: 1.5;
}

.attention-panel,
.help-panel {
  margin-top: 16px;
  padding: 20px;
}

.attn-group {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.attn-group:first-of-type { padding-top: 0; }
.attn-group:last-child { padding-bottom: 0; border-bottom: 0; }

.attn-count {
  background: var(--muted);
  font-family: var(--font-mono);
}

.attn-row {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 8px;
}

.attn-row:hover {
  border-color: var(--border);
  background: rgba(228, 242, 220, 0.52);
  transform: translateX(2px);
}

.help-panel summary {
  color: var(--primary-ink);
}

/* Request, detail and paper */
.item-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 30px;
}

.item-title::before {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(78, 155, 62, 0.1);
  content: "";
}

.paste-box {
  border-color: var(--border);
  background: #f7f8f3;
}

.message-panel textarea,
.share-textarea {
  background: #f4f6f0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.request-detail {
  gap: 16px;
}

.detail-grid {
  gap: 10px;
}

.detail-grid div {
  padding: 12px;
  border-color: var(--border);
  border-radius: 10px;
  background: rgba(237, 238, 231, 0.62);
}

.detail-grid span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-grid strong {
  font-size: 12px;
}

.preview-panel {
  background:
    linear-gradient(45deg, rgba(23, 32, 26, 0.025) 25%, transparent 25%, transparent 75%, rgba(23, 32, 26, 0.025) 75%),
    rgba(251, 250, 245, 0.92);
  background-size: 16px 16px;
}

.paper {
  min-height: 600px;
  border: 1px solid #aab2a6;
  border-radius: 2px;
  box-shadow: 0 16px 34px rgba(25, 37, 28, 0.13);
}

.empty-preview {
  color: var(--muted-foreground);
  font-family: var(--font-body);
}

/* Leaves and roles */
.leave-chips {
  gap: 8px;
  margin: 14px 0 18px;
}

.leave-chip {
  min-width: 140px;
  padding: 10px 12px;
  border-color: var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.48);
}

.leave-chip:hover {
  border-color: rgba(78, 155, 62, 0.42);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.leave-badge {
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--muted);
  font-size: 10px;
}

.process-grid {
  gap: 10px;
}

.process-grid div,
.role-row,
.permission-grid {
  border-color: var(--border);
  border-radius: 11px;
  background: rgba(237, 238, 231, 0.55);
}

.role-row {
  position: relative;
  padding: 15px 16px;
  overflow: hidden;
}

.role-row::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--primary);
  content: "";
  opacity: 0;
}

.role-row:hover {
  border-color: rgba(78, 155, 62, 0.42);
  background: var(--primary-soft);
}

.role-row:hover::after,
.role-row.selected-role::after {
  opacity: 1;
}

.permission-grid {
  padding: 14px;
}

.permission-option {
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 7px;
}

.permission-option:hover {
  background: rgba(255, 255, 255, 0.65);
}

/* Modal and toast */
.modal-backdrop {
  padding: 24px;
  background: rgba(10, 18, 12, 0.64);
  backdrop-filter: blur(8px);
  animation: fadeIn 180ms ease both;
}

.modal-panel {
  border: 1px solid rgba(216, 221, 211, 0.92);
  border-radius: 18px;
  background: #f9f8f2;
  box-shadow: var(--shadow-floating);
  animation: modalEnter 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-header,
.modal-actions {
  padding: 18px 22px;
}

.modal-header {
  background: linear-gradient(112deg, rgba(201, 245, 90, 0.11), transparent 42%);
}

.modal-header h3 {
  font-size: 20px;
}

.modal-body {
  padding: 22px;
}

.modal-actions {
  background: rgba(233, 236, 228, 0.55);
}

.toast {
  right: 22px;
  bottom: 22px;
  padding: 13px 16px 13px 20px;
  border: 1px solid rgba(201, 245, 90, 0.22);
  border-radius: 11px;
  background: #1b2a20;
  box-shadow: var(--shadow-floating);
  color: #f2f6f0;
  font-size: 12px;
}

.toast::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  content: "";
}

/* Motion */
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes beaconPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.88); opacity: 0.82; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

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

  .sidebar {
    position: fixed;
    min-height: 100svh;
    transform: translateX(-104%);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    border: 0;
    background: rgba(10, 18, 12, 0.46);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(3px);
  }

  .sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-open {
    overflow: hidden;
  }

  .main {
    grid-column: 1;
  }

  .mobile-menu-button {
    display: grid;
  }

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

  .preview-panel {
    max-height: none;
  }

  .kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  }
}

@media (max-width: 860px) {
  .login-screen {
    grid-template-columns: 1fr;
    background: var(--card);
  }

  .login-story {
    min-height: 320px;
    padding: 28px;
  }

  .login-message {
    margin: 45px 0 30px;
  }

  .login-message h2 {
    font-size: clamp(38px, 10vw, 62px);
  }

  .login-message > p:last-child,
  .login-system-strip,
  .beacon-label {
    display: none;
  }

  .beacon-visual {
    right: -120px;
    width: 360px;
  }

  .login-card {
    min-height: auto;
    padding: 42px clamp(24px, 8vw, 70px) 54px;
  }

  .dash-main,
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .deal-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: start;
  }

  .deal-shop-link {
    grid-column: 3;
    grid-row: 1;
  }

  .deal-metrics,
  .deal-money,
  .deal-signal {
    grid-column: 2 / -1;
  }
}

@media (max-width: 720px) {
  body {
    background-size: 28px 28px;
  }

  .main {
    padding: 0 12px 24px;
  }

  .topbar {
    position: sticky;
    flex-direction: row;
    align-items: center;
    min-height: 72px;
    margin: 0 -12px 16px;
    padding: 10px 12px;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .page-context,
  .environment-pill,
  .save-status,
  .logout-button span {
    display: none;
  }

  .logout-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .top-actions {
    flex-direction: row;
    align-items: center;
  }

  .section-title {
    align-items: stretch;
    gap: 14px;
  }

  .section-title .row-actions,
  .section-title > .button {
    width: 100%;
  }

  .row-actions {
    align-items: stretch;
  }

  .row-actions .button,
  .section-title > .button {
    width: 100%;
  }

  .button {
    width: auto;
  }

  .form-panel,
  .message-panel,
  .preview-panel,
  .queue-panel,
  .chart-panel,
  .attention-panel,
  .help-panel {
    padding: 16px;
  }

  .panel {
    border-radius: 14px;
  }

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

  .wide {
    grid-column: auto;
  }

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

  .kpi {
    min-height: 112px;
    padding: 13px;
  }

  .kpi-value {
    font-size: 31px;
  }

  .dash-header {
    padding: 17px;
  }

  .deal-head {
    min-height: 0;
    align-items: flex-start;
    padding: 22px 18px;
  }

  .deal-head-stat {
    min-width: 150px;
  }

  .quality-strip {
    grid-template-columns: 1fr;
  }

  .quality-tile {
    padding: 14px 17px;
  }

  .deal-scope {
    align-items: stretch;
    flex-direction: column;
    padding: 13px 17px;
  }

  .deal-toggle {
    width: 100%;
  }

  .deal-row {
    gap: 13px;
    padding: 16px;
  }

  .deal-footnote {
    padding-inline: 16px;
  }

  .dash-controls,
  .dash-controls select,
  .dash-controls input[type="date"] {
    width: 100%;
    max-width: none;
  }

  .hbar-row {
    grid-template-columns: 95px minmax(0, 1fr) 28px;
    gap: 7px;
  }

  .attn-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .attn-age {
    display: none;
  }

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

  .modal-panel {
    width: 100%;
    max-height: calc(100svh - 20px);
    border-radius: 18px 18px 12px 12px;
  }

  .modal-header,
  .modal-actions,
  .modal-body {
    padding: 16px;
  }

  .modal-actions .button {
    flex: 1;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 460px) {
  .login-story {
    min-height: 270px;
  }

  .login-message {
    margin-bottom: 12px;
  }

  .login-message h2 {
    font-size: 38px;
  }

  .login-card {
    padding-inline: 22px;
  }

  .sidebar {
    width: min(294px, calc(100vw - 34px));
  }

  .kpi-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .deal-head {
    display: grid;
    gap: 18px;
  }

  .deal-head-stat {
    width: 100%;
  }

  .deal-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .deal-shop-link,
  .deal-metrics,
  .deal-money,
  .deal-signal {
    grid-column: 2;
  }

  .deal-shop-link {
    grid-row: auto;
    width: 100%;
  }

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

  .kpi-sub,
  .delta {
    font-size: 9px;
  }

  .paper {
    padding: 14px 9px 18px;
  }
}

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

@media print {
  body {
    background: #fff;
  }

  body::before,
  .sidebar-backdrop {
    display: none;
  }

  .paper {
    border: 0;
    box-shadow: none;
  }
}

/* Hardware digital thread */
.hardware-command {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(360px, .8fr);
  gap: 28px;
  padding: 28px;
  color: #f3f7ec;
  background:
    linear-gradient(115deg, rgba(21, 32, 25, .98), rgba(36, 66, 42, .93)),
    repeating-linear-gradient(90deg, transparent 0 59px, rgba(255,255,255,.05) 60px);
  border-color: rgba(255,255,255,.08);
}

.hardware-command::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -80px;
  top: -140px;
  border: 1px solid rgba(197, 237, 86, .28);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(197, 237, 86, .035), 0 0 0 72px rgba(197, 237, 86, .025);
}

.hardware-command-copy { position: relative; z-index: 1; }
.hardware-eyebrow { color: #c5ed56; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.hardware-command h3, .trace-search h3 { margin: 8px 0; font-family: var(--font-display); font-size: clamp(25px, 3vw, 40px); line-height: 1; }
.hardware-command p { max-width: 640px; margin: 0; color: rgba(243, 247, 236, .68); }

.hardware-pulse-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  align-self: stretch;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.12);
}

.hardware-pulse-grid div { display: flex; flex-direction: column; justify-content: center; padding: 15px; background: rgba(14, 24, 18, .8); }
.hardware-pulse-grid strong { font-family: var(--font-display); color: #c5ed56; font-size: 28px; }
.hardware-pulse-grid span { color: rgba(255,255,255,.58); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }

.hardware-workspace { padding: 0; overflow: hidden; }
.hardware-tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--line); background: rgba(245, 246, 239, .7); }
.hardware-tabs button { min-width: max-content; padding: 17px 20px; border: 0; border-right: 1px solid var(--line); border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.hardware-tabs button span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 20px; background: #e2e7db; font-size: 10px; }
.hardware-tabs button.active { color: var(--ink); border-bottom-color: #6e9f39; background: #fff; }
.hardware-tabs button.active span { color: #23451d; background: #dff0c7; }
.product-thread-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  overflow: hidden;
  border-color: #b9c5ad;
  background: #17251b;
}
.product-thread-map button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 18px 20px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .13);
  color: #f3f7ec;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.product-thread-map button:last-child { border-right: 0; }
.product-thread-map button:hover { color: #c5ed56; background: rgba(197, 237, 86, .08); }
.product-thread-map button strong,
.product-thread-map button small { display: block; }
.product-thread-map button strong { font-family: var(--font-display); font-size: 15px; }
.product-thread-map button small { margin-top: 2px; color: rgba(243, 247, 236, .56); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.product-thread-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(197, 237, 86, .45);
  color: #c5ed56;
  font-family: var(--font-display);
  font-size: 12px;
}
.product-thread-sections { display: grid; gap: 16px; }
.product-entity-section { position: relative; scroll-margin-top: 92px; }
.product-entity-section .hardware-section-head { padding-top: 29px; }
.product-entity-section .queue-table-shell { border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
.product-entity-section[data-product-entity="bomItems"] .hardware-table { min-width: 1260px; }
.product-entity-kicker {
  position: absolute;
  top: 10px;
  left: 24px;
  color: #75924f;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
}
.hardware-section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 24px 18px; }
.hardware-section-head h4 { margin: 0 0 3px; font-family: var(--font-display); font-size: 24px; }
.hardware-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.hardware-table td { max-width: 290px; }
.hardware-table td:nth-child(2) { font-weight: 700; color: var(--ink); }
.hardware-status { display: inline-flex; padding: 5px 9px; border: 1px solid #d1dfc2; border-radius: 99px; color: #315225; background: #f2f8eb; font-size: 10px; font-weight: 800; white-space: nowrap; }
.hardware-empty { padding: 45px !important; text-align: center; }
.hardware-empty strong, .hardware-empty span { display: block; }
.hardware-empty span { margin-top: 6px; color: var(--muted); font-size: 12px; }
.hardware-form .checkbox-line { min-height: 42px; margin-top: 22px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: #fafbf7; }
.hardware-form .form-hint { margin: -4px 0 2px; padding: 10px 12px; border-left: 3px solid #86ad43; color: var(--muted); background: #f4f7ef; font-size: 11px; line-height: 1.5; }

.trace-search { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; align-items: center; padding: 22px 24px; }
.trace-search h3 { margin-bottom: 0; color: var(--ink); font-size: 23px; }
.trace-search-form { display: flex; gap: 8px; }
.trace-search-form input, .trace-search-form select { flex: 1; min-width: 0; }
#bomQuantityInput { flex: 0 0 110px; }
#traceResult { grid-column: 1 / -1; }
.trace-thread { display: grid; grid-template-columns: repeat(4, 1fr auto); align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.trace-thread div { min-height: 86px; padding: 14px; border-left: 3px solid #86ad43; background: #f4f7ef; }
.trace-thread span, .trace-thread small, .trace-thread strong { display: block; }
.trace-thread span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.trace-thread strong { margin: 6px 0; font-size: 14px; }
.trace-thread small { color: var(--muted); }
.trace-thread i { color: #91a384; font-style: normal; }
.trace-error { margin: 4px 0 0; color: #a93426; font-size: 12px; }
.hardware-readiness { margin: 4px 0 12px; padding: 12px 14px; border-left: 4px solid #9a7423; background: #fff7df; }
.hardware-readiness.ready { border-left-color: #5f8e31; background: #eef8e4; }
.hardware-readiness.short { border-left-color: #b24a39; background: #fff0ec; }
.cost-rollup { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--line); }
.cost-rollup div { padding: 14px; background: #f4f7ef; }
.cost-rollup span, .cost-rollup strong { display: block; }
.cost-rollup span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.cost-rollup strong { margin-top: 5px; color: var(--ink); font-family: var(--font-display); font-size: 20px; }
.device-label { width: min(320px, 100%); margin: 0 auto; padding: 22px; border: 1px dashed #8a9981; text-align: center; background: #fff; }
.device-label-qr svg { display: block; width: 220px; height: 220px; margin: 0 auto 12px; }
.device-label span, .device-label strong, .device-label small { display: block; }
.device-label span { color: #5e6b59; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.device-label strong { margin: 7px 0 3px; font-family: var(--font-display); font-size: 22px; }
.device-label small { color: #70806a; }

@media (max-width: 920px) {
  .hardware-command, .trace-search { grid-template-columns: 1fr; }
  .product-thread-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-thread-map button:nth-child(2) { border-right: 0; }
  .product-thread-map button:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .13); }
  #traceResult { grid-column: auto; }
  .trace-thread { grid-template-columns: 1fr; }
  .trace-thread i { display: none; }
}

@media (max-width: 560px) {
  .hardware-command { padding: 21px; }
  .hardware-pulse-grid { grid-template-columns: 1fr 1fr; }
  .hardware-section-head { align-items: flex-start; flex-direction: column; padding: 18px 16px; }
  .hardware-section-head .button { width: 100%; }
  .product-thread-map { grid-template-columns: 1fr; }
  .product-thread-map button,
  .product-thread-map button:nth-child(2) { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .13); }
  .product-thread-map button:last-child { border-bottom: 0; }
  .product-entity-kicker { left: 16px; }
  .trace-search { padding: 18px 16px; }
  .trace-search-form { flex-direction: column; }
  #bomQuantityInput { flex: 0 0 auto; width: 100%; }
  .cost-rollup { grid-template-columns: 1fr; }
  .data-table-toolbar,
  .data-table-footer { align-items: stretch; flex-direction: column; }
  .data-table-search { flex-basis: auto; width: 100%; max-width: none; }
  .data-table-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .data-table-toolbar select { min-width: 0; width: 100%; }
  .data-table-footer { align-items: center; }
  .hardware-workspace > .data-table-toolbar,
  .product-entity-section > .data-table-toolbar { padding: 0 16px; }
  .hardware-workspace > .data-table-footer,
  .product-entity-section > .data-table-footer { padding: 9px 16px 14px; }
}

/* Hardware Operations v2 — PLM + Procurement + MES-lite + Traceability */
.hw-page-head {
  position: relative;
  margin-bottom: 16px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--border);
}

.hw-head-top,
.hw-page-head-row,
.hw-page-actions,
.hw-breadcrumb,
.hw-global-search,
.hw-section-head,
.hw-row-menu footer {
  display: flex;
  align-items: center;
}

.hw-head-top,
.hw-page-head-row,
.hw-section-head {
  justify-content: space-between;
  gap: 18px;
}

.hw-head-top { min-height: 34px; }

.hw-breadcrumb {
  min-width: 0;
  gap: 7px;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hw-breadcrumb span:last-child { color: var(--primary-ink); font-weight: 700; }
.hw-breadcrumb i { color: var(--border-strong); font-style: normal; }

.hw-page-head-row { align-items: flex-end; }
.hw-page-head h3 { margin: 7px 0 1px; font-size: clamp(24px, 2.3vw, 34px); letter-spacing: -.045em; }
.hw-page-head p { max-width: 760px; margin: 0; color: var(--muted-foreground); font-size: 12px; font-weight: 400; }
.hw-page-actions { justify-content: flex-end; gap: 8px; }
.hw-head-select { min-width: 230px; max-width: 360px; }

.hw-global-search {
  position: relative;
  z-index: 12;
  width: min(440px, 42vw);
}

.hw-global-search input {
  width: 100%;
  min-height: 34px;
  padding: 0 13px 0 34px;
  border-radius: 999px;
  background: var(--card);
  font-size: 11px;
}

.hw-global-search::before {
  position: absolute;
  left: 13px;
  color: var(--muted-foreground);
  content: "⌕";
  font-size: 16px;
}

.hw-global-search > div {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: min(520px, 90vw);
  max-height: 440px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-floating);
}

.hw-global-search > div.open { display: block; }
.hw-global-search section + section { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border); }
.hw-global-search section > strong { display: block; padding: 5px 8px; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; }
.hw-global-search section button { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 9px; border: 0; border-radius: 8px; background: transparent; color: var(--foreground); text-align: left; cursor: pointer; }
.hw-global-search section button:hover { background: var(--primary-soft); }
.hw-global-search section button span { font-weight: 700; }
.hw-global-search section button small { color: var(--muted-foreground); }
.hw-global-search > div > p { margin: 8px; color: var(--muted-foreground); }

.hw-kpi-grid { display: grid; gap: 10px; margin-bottom: 16px; }
.hw-kpi-grid-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.hw-kpi-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hw-kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.hw-kpi {
  position: relative;
  min-width: 0;
  min-height: 112px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(20, 32, 25, .04);
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
}

.hw-kpi::after { position: absolute; right: 0; bottom: 0; width: 48px; height: 48px; border-radius: 48px 0 0; background: rgba(78, 155, 62, .045); content: ""; }
.hw-kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.hw-kpi > span { display: block; min-height: 27px; color: var(--muted-foreground); font-size: 9px; font-weight: 700; letter-spacing: .05em; line-height: 1.35; text-transform: uppercase; }
.hw-kpi > strong { display: block; margin: 5px 0 2px; overflow: hidden; font-family: var(--font-display); font-size: clamp(21px, 2vw, 29px); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.hw-kpi > small { display: block; overflow: hidden; color: var(--muted-foreground); font-size: 9px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.hw-kpi > i { position: absolute; right: 12px; bottom: 8px; z-index: 1; color: var(--primary-ink); font-style: normal; }
.hw-kpi.warning { border-top: 3px solid var(--warning); }
.hw-kpi.danger { border-top: 3px solid var(--danger); }
.hw-kpi.good { border-top: 3px solid var(--success); }

.hw-overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, .72fr); gap: 16px; }
.hw-overview-main { display: grid; min-width: 0; gap: 16px; }
.hw-section-head { padding: 18px 20px 14px; }
.hw-section-head h4 { margin: 0; font-size: 18px; }
.hw-section-head p { margin: 2px 0 0; color: var(--muted-foreground); font-size: 10px; font-weight: 400; }

.hw-portfolio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 16px 16px; }
.hw-product-card { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; align-items: stretch; min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--foreground); text-align: left; cursor: pointer; }
.hw-product-card:hover { transform: translateY(-2px); border-color: #a8c291; box-shadow: var(--shadow); }
.hw-product-art { display: grid; width: 74px; min-height: 116px; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #26372b, #101a13); box-shadow: inset 0 0 0 1px rgba(201,245,90,.18); color: var(--accent); font-family: var(--font-display); font-size: 25px; letter-spacing: -.08em; }
.hw-product-art.large { width: 100%; min-height: 136px; font-size: 42px; }
.hw-product-copy { min-width: 0; }
.hw-product-copy > span,.hw-portfolio-line header > span,.hw-model-title > span,.hw-document-card > div > span,.hw-build-card header > span,.hw-plan-card header > span,.hw-passport header span,.hw-rma-grid header > span,.hw-device-card header > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hw-product-copy > strong { display: block; margin: 4px 0 1px; font-family: var(--font-display); font-size: 18px; }
.hw-product-copy > small { display: block; color: var(--muted-foreground); font-size: 9px; line-height: 1.5; }
.hw-progress { display: block; height: 5px; margin-top: 11px; overflow: hidden; border-radius: 8px; background: var(--muted); }
.hw-progress b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.hw-product-copy > em { display: block; margin-top: 4px; color: var(--muted-foreground); font-size: 8px; font-style: normal; }
.hw-product-copy mark,.hw-portfolio-line mark { display: block; margin-top: 8px; padding: 5px 7px; border-radius: 5px; background: #fff2dc; color: #885017; font-size: 8px; }

.hw-alert-list { display: grid; gap: 7px; padding: 0 16px 16px; }
.hw-alert { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--foreground); text-align: left; cursor: pointer; }
.hw-alert:hover { border-color: var(--border-strong); transform: translateX(2px); }
.hw-alert > i { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.hw-alert.danger > i { background: var(--danger); }
.hw-alert span strong,.hw-alert span small { display: block; }
.hw-alert span strong { font-size: 11px; }
.hw-alert span small { color: var(--muted-foreground); font-size: 9px; font-weight: 400; }
.hw-alert > b { color: var(--primary-ink); }
.hw-all-clear { margin: 0 16px 16px; padding: 17px; border: 1px solid #c8dec1; border-radius: 9px; background: #f1f8ed; color: #35642b; font-weight: 700; }

.hw-timeline { align-self: start; overflow: hidden; }
.hw-timeline > div:last-child { padding: 0 18px 18px; }
.hw-timeline article { position: relative; padding: 4px 0 18px 21px; border-left: 1px solid var(--border); }
.hw-timeline article:last-child { padding-bottom: 2px; }
.hw-timeline article > i { position: absolute; top: 4px; left: -5px; width: 9px; height: 9px; border: 2px solid var(--card); border-radius: 50%; background: var(--primary); }
.hw-timeline article span { color: var(--muted-foreground); font-family: var(--font-mono); font-size: 8px; text-transform: uppercase; }
.hw-timeline article strong { display: block; margin: 1px 0; font-size: 11px; }
.hw-timeline article p { margin: 0; color: var(--muted-foreground); font-size: 8px; }

.hw-portfolio-page { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hw-portfolio-line { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 14px; padding: 14px; }
.hw-portfolio-line header { min-width: 0; }
.hw-portfolio-line h4 { margin: 3px 0 4px; font-size: 20px; }
.hw-portfolio-line header p { margin: 0; color: var(--muted-foreground); font-size: 9px; }
.hw-portfolio-meta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 9px; }
.hw-portfolio-meta div { padding: 10px; border-right: 1px solid var(--border); }
.hw-portfolio-meta div:last-child { border-right: 0; }
.hw-portfolio-meta strong,.hw-portfolio-meta span { display: block; }
.hw-portfolio-meta strong { font-family: var(--font-display); font-size: 17px; }
.hw-portfolio-meta span { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-portfolio-line > .hw-progress,.hw-portfolio-line > mark,.hw-portfolio-line > footer { grid-column: 1 / -1; }
.hw-portfolio-line footer { display: flex; align-items: center; justify-content: space-between; }
.hw-portfolio-line footer button { border: 0; background: transparent; color: var(--primary-ink); font-weight: 700; cursor: pointer; }

.hw-segment,.hw-view-tabs,.hw-detail-tabs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--muted); }
.hw-segment button,.hw-view-tabs button,.hw-detail-tabs button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-foreground); font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.hw-segment button.active,.hw-view-tabs button.active,.hw-detail-tabs button.active { background: #fff; box-shadow: 0 1px 3px rgba(20,32,25,.08); color: var(--primary-ink); }
.hw-view-tabs { width: max-content; max-width: 100%; margin-bottom: 12px; overflow-x: auto; }

.hw-master-detail { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); gap: 14px; align-items: start; }
.hw-product-tree,.hw-part-list,.hw-pcb-list,.hw-lot-list { position: sticky; top: 102px; max-height: calc(100vh - 125px); overflow: auto; }
.hw-product-tree { padding: 8px; }
.hw-product-tree section + section { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--border); }
.hw-tree-line,.hw-tree-model,.hw-part-list > button,.hw-pcb-list > button,.hw-lot-list > button { width: 100%; border: 0; background: transparent; color: var(--foreground); text-align: left; cursor: pointer; }
.hw-tree-line { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 9px; border-radius: 8px; }
.hw-tree-line > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 7px; background: var(--sidebar); color: var(--accent); font-family: var(--font-mono); font-size: 8px; }
.hw-tree-line small { color: var(--muted-foreground); }
.hw-tree-line.active { background: var(--primary-soft); }
.hw-tree-model { display: block; margin: 2px 0; padding: 8px 9px 8px 45px; border-radius: 7px; }
.hw-tree-model strong,.hw-tree-model span { display: block; }
.hw-tree-model strong { font-size: 10px; }
.hw-tree-model span { color: var(--muted-foreground); font-size: 8px; }
.hw-tree-model:hover,.hw-tree-model.active { background: #edf3e9; color: var(--primary-ink); }

.hw-model-detail { overflow: hidden; }
.hw-model-detail > header { display: grid; grid-template-columns: 90px minmax(220px, 1fr) minmax(360px, .9fr); gap: 16px; align-items: center; padding: 18px; border-bottom: 1px solid var(--border); }
.hw-model-art { display: grid; width: 90px; height: 90px; place-items: center; border-radius: 13px; background: linear-gradient(145deg,#24382a,#121c15); color: var(--accent); font-family: var(--font-display); font-size: 29px; }
.hw-model-title h3 { margin: 3px 0; font-size: 25px; }
.hw-model-title p { margin: 0; color: var(--muted-foreground); font-size: 10px; font-weight: 400; }
.hw-model-metrics { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 10px; }
.hw-model-metrics div { padding: 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.hw-model-metrics div:nth-child(even) { border-right: 0; }
.hw-model-metrics div:nth-last-child(-n+2) { border-bottom: 0; }
.hw-model-metrics span,.hw-model-metrics strong { display: block; }
.hw-model-metrics span { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-model-metrics strong { margin-top: 2px; font-size: 11px; }
.hw-model-alerts { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 18px; border-bottom: 1px solid #ecd1ba; background: #fff6e9; }
.hw-model-alerts span { color: #884e13; font-size: 9px; font-weight: 700; }
.hw-model-alerts.all-clear { border-color: #c7dbc0; background: #f0f7ec; }
.hw-model-alerts.all-clear span { color: #35642b; }
.hw-detail-tabs { margin: 12px 18px 0; overflow-x: auto; border-radius: 8px 8px 0 0; }
.hw-detail-tabs button { white-space: nowrap; }
.hw-detail-body { min-height: 290px; padding: 18px; }
.hw-spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.hw-spec-grid > div { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.hw-spec-grid span,.hw-spec-grid strong { display: block; }
.hw-spec-grid span { color: var(--muted-foreground); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.hw-spec-grid strong { margin-top: 3px; overflow-wrap: anywhere; font-size: 10px; }

.hw-matrix { min-width: 720px; }
.hw-matrix th { vertical-align: bottom; }
.hw-matrix th small { display: block; color: var(--muted-foreground); font-size: 7px; font-weight: 400; }
.hw-matrix td { text-align: center; }
.hw-revision-timeline { display: grid; gap: 8px; }
.hw-revision-timeline article { display: grid; grid-template-columns: minmax(220px,1fr) minmax(260px,.9fr) auto; gap: 15px; align-items: center; padding: 13px; border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 9px; background: #fff; }
.hw-revision-timeline article.released { border-left-color: var(--success); }
.hw-revision-timeline article.draft { border-left-color: var(--warning); }
.hw-revision-timeline article > div > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 8px; text-transform: uppercase; }
.hw-revision-timeline article > div > strong,.hw-revision-timeline article > div > small { display: block; }
.hw-revision-timeline article > div > small { color: var(--muted-foreground); font-size: 8px; }
.hw-revision-timeline dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 0; }
.hw-revision-timeline dl div { padding: 7px; border-radius: 6px; background: var(--muted); }
.hw-revision-timeline dt { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-revision-timeline dd { margin: 2px 0 0; font-size: 9px; font-weight: 700; }
.hw-revision-timeline footer { display: grid; justify-items: end; gap: 4px; }
.hw-revision-timeline footer button { border: 0; background: transparent; color: var(--primary-ink); font-size: 9px; font-weight: 700; cursor: pointer; }
.hw-revision-timeline footer button.primary { padding: 6px 9px; border-radius: 6px; background: var(--primary); color: white; }

.hw-status { display: inline-flex; max-width: 150px; min-height: 21px; align-items: center; padding: 0 7px; border: 1px solid #d4ded0; border-radius: 99px; background: #f1f5ee; color: #4a5b47; font-size: 8px; font-weight: 800; white-space: nowrap; }
.hw-status-released,.hw-status-approved,.hw-status-passed,.hw-status-pass,.hw-status-ready,.hw-status-accepted,.hw-status-compatible,.hw-status-active,.hw-status-healthy,.hw-status-completed,.hw-status-done,.hw-status-success,.hw-status-posted,.hw-status-verified { border-color: #bfd7b4; background: #eef7e8; color: #346029; }
.hw-status-failed,.hw-status-fail,.hw-status-rejected,.hw-status-blocked,.hw-status-critical,.hw-status-incompatible,.hw-status-recalled,.hw-status-eol { border-color: #ebc4be; background: #fff0ed; color: #9c382e; }
.hw-status-draft,.hw-status-in_review,.hw-status-warning,.hw-status-conditional,.hw-status-nrnd,.hw-status-on_hold,.hw-status-hold,.hw-status-incoming_qc { border-color: #ead6ac; background: #fff8e6; color: #805616; }
.hw-status-in_progress,.hw-status-running,.hw-status-fabrication,.hw-status-smt,.hw-status-testing,.hw-status-deployed { border-color: #bbd5df; background: #eef7fa; color: #326b80; }
.hw-status.muted { opacity: .55; }

.hw-data-panel { min-width: 0; margin-bottom: 14px; overflow: hidden; }
.hw-data-panel.compact .hw-section-head { padding-block: 12px; }
.hw-table td { max-width: 260px; vertical-align: middle; }
.hw-table td:first-child { font-weight: 700; }
.hw-table td small { display: block; color: var(--muted-foreground); font-size: 8px; font-weight: 400; }
.hw-row-menu { position: relative; display: inline-block; }
.hw-row-menu > summary { display: grid; width: 31px; height: 29px; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--foreground); cursor: pointer; list-style: none; }
.hw-row-menu > summary::-webkit-details-marker { display: none; }
.hw-row-menu > div { position: absolute; right: 0; z-index: 15; display: grid; width: 185px; padding: 5px; border: 1px solid var(--border); border-radius: 9px; background: #fff; box-shadow: var(--shadow-floating); }
.hw-row-menu:not([open]) > div { display: none; }
.hw-row-menu > div button { padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--foreground); font: inherit; font-size: 9px; text-align: left; cursor: pointer; }
.hw-row-menu > div button:hover { background: var(--muted); }
.hw-row-menu > div button:last-child { color: var(--danger); }
.hw-readiness-inline { display: flex; min-width: 80px; align-items: center; gap: 7px; }
.hw-readiness-inline i { width: 48px; height: 5px; overflow: hidden; border-radius: 9px; background: var(--muted); }
.hw-readiness-inline i::after { display: block; width: var(--value); height: 100%; background: var(--primary); content: ""; }
.hw-readiness-inline strong { font-size: 8px; }

.hw-empty { display: grid; min-height: 210px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.hw-empty-mark { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 8px; border: 1px dashed var(--border-strong); border-radius: 50%; color: var(--primary-ink); font-size: 20px; }
.hw-empty strong { font-family: var(--font-display); font-size: 16px; }
.hw-empty p { max-width: 460px; margin: 4px auto 12px; color: var(--muted-foreground); font-size: 10px; font-weight: 400; }

.hw-document-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.hw-document-card { display: grid; grid-template-columns: 66px minmax(0,1fr); gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); }
.hw-file-thumb { display: grid; width: 66px; height: 76px; place-items: center; align-content: center; overflow: hidden; border-radius: 8px; background: linear-gradient(145deg,#1d2f22,#112016); color: #fff; }
.hw-file-thumb span { color: var(--accent); font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.hw-file-thumb i { display: block; max-width: 58px; margin-top: 3px; overflow: hidden; color: rgba(255,255,255,.56); font-size: 6px; font-style: normal; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.hw-document-card > div:nth-child(2) { min-width: 0; align-self: center; }
.hw-document-card > div > strong,.hw-document-card > div > small { display: block; }
.hw-document-card > div > strong { margin: 3px 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.hw-document-card > div > small { color: var(--muted-foreground); font-size: 8px; }
.hw-document-card footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid var(--border); }
.hw-document-card footer > a { color: var(--primary-ink); font-size: 9px; font-weight: 700; text-decoration: none; }

.hw-readiness-banner { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 17px 20px; background: linear-gradient(110deg,#17271c,#233d28); color: #fff; }
.hw-readiness-banner span { color: var(--accent); font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; }
.hw-readiness-banner strong { display: block; margin: 3px 0; font-family: var(--font-display); font-size: 21px; }
.hw-readiness-banner p { margin: 0; color: rgba(255,255,255,.62); font-size: 9px; }
.hw-readiness-ring { --angle: calc(var(--value) * 3.6deg); display: grid; width: 74px; height: 74px; flex: none; place-items: center; border-radius: 50%; background: radial-gradient(circle at center,#1b2e20 57%,transparent 58%),conic-gradient(var(--accent) var(--angle),rgba(255,255,255,.14) 0); }
.hw-readiness-ring strong { color: white; font-family: var(--font-display); font-size: 16px; }
.hw-document-checklist { margin-bottom: 12px; }
.hw-document-checklist > div:last-child { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; padding: 0 18px 18px; }
.hw-document-checklist > div > span { display: flex; min-width: 0; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted-foreground); font-size: 8px; text-transform: capitalize; }
.hw-document-checklist span i { display: grid; width: 16px; height: 16px; flex: none; place-items: center; border-radius: 50%; background: var(--muted); font-style: normal; }
.hw-document-checklist span.done { border-color: #c6dcb9; background: #f0f8eb; color: #35642b; }
.hw-document-checklist span.done i { background: #d3eac6; }
.hw-document-checklist span.missing { border-color: #ead3aa; background: #fff9ea; color: #825718; }

.hw-bom-body { min-width: 0; }
.hw-bom-tree { overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: var(--card); }
.hw-bom-tree > header,.hw-bom-node { display: grid; grid-template-columns: minmax(320px,1.7fr) 75px 90px 95px 130px 34px; gap: 8px; align-items: center; }
.hw-bom-tree > header { padding: 9px 13px; border-bottom: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.hw-bom-node { position: relative; padding: 8px 12px 8px calc(12px + var(--depth) * 21px); border-bottom: 1px solid var(--border); font-size: 9px; }
.hw-bom-node:last-child { border-bottom: 0; }
.hw-bom-node:hover { background: #f7faf4; }
.hw-bom-node.dnp { opacity: .55; text-decoration: line-through; }
.hw-bom-node > .hw-bom-branch { position: absolute; left: calc(11px + var(--depth) * 21px); color: #8fa083; }
.hw-bom-node > div { padding-left: 19px; }
.hw-bom-node > div strong,.hw-bom-node > div small { display: block; }
.hw-bom-node > div small { color: var(--muted-foreground); font-size: 8px; }
.hw-bom-node > button { border: 0; background: transparent; cursor: pointer; }
.hw-cost-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(240px,.7fr); gap: 12px; }
.hw-cost-bars { display: grid; gap: 10px; padding: 0 20px 20px; }
.hw-cost-bars > div { display: grid; grid-template-columns: 140px minmax(100px,1fr) 120px; gap: 10px; align-items: center; }
.hw-cost-bars span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hw-cost-bars i { height: 7px; overflow: hidden; border-radius: 9px; background: var(--muted); }
.hw-cost-bars i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--primary),#8bb956); }
.hw-cost-bars strong { text-align: right; font-size: 9px; }
.hw-cost-quantity { padding: 18px; }
.hw-cost-quantity h4 { margin: 0 0 12px; }
.hw-cost-quantity > div { padding: 9px 0; border-top: 1px solid var(--border); }
.hw-cost-quantity span,.hw-cost-quantity strong,.hw-cost-quantity small { display: block; }
.hw-cost-quantity span { color: var(--muted-foreground); font-size: 8px; text-transform: uppercase; }
.hw-cost-quantity strong { font-family: var(--font-display); font-size: 16px; }
.hw-cost-quantity small { color: var(--muted-foreground); font-size: 8px; }

.hw-readiness-tool,.hw-compare-tool { display: grid; grid-template-columns: minmax(280px,1fr) minmax(360px,1fr); gap: 18px; align-items: center; padding: 18px; }
.hw-readiness-tool > div:first-child > span,.hw-compare-tool > div:first-child > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; }
.hw-readiness-tool h4,.hw-compare-tool h4 { margin: 4px 0; font-size: 19px; }
.hw-readiness-tool p,.hw-compare-tool p { margin: 0; color: var(--muted-foreground); font-size: 9px; }
.hw-readiness-tool > div:nth-child(2),.hw-compare-tool > div:nth-child(2) { display: flex; gap: 7px; }
.hw-readiness-tool > .wide,.hw-compare-tool > .wide { grid-column: 1 / -1; }
.hw-readiness-result { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 10px 12px; border-left: 4px solid var(--danger); background: #fff0ed; }
.hw-readiness-result.ready { border-color: var(--success); background: #eef7e8; }
.hw-readiness-result span { color: var(--muted-foreground); font-size: 9px; }
.hw-readiness-tool tr.short td:first-child { border-left: 3px solid var(--danger); }
.hw-readiness-tool tr.ready td:first-child { border-left: 3px solid var(--success); }
.hw-diff-summary { display: flex; gap: 8px; margin-bottom: 10px; }
.hw-diff-summary span { padding: 8px 12px; border-radius: 8px; background: var(--muted); font-size: 9px; }
.hw-diff-summary strong { margin-right: 5px; font-size: 16px; }
.hw-diff-summary .added { background: #eaf7e4; color: #376c2a; }
.hw-diff-summary .removed { background: #fff0ed; color: #9c382e; }
.hw-diff-summary .changed { background: #fff7df; color: #805616; }
.hw-diff-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.hw-diff-list article { padding: 10px; border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: 8px; background: #fff; }
.hw-diff-list article.added { border-left-color: var(--success); }
.hw-diff-list article.removed { border-left-color: var(--danger); }
.hw-diff-list article span { font-size: 7px; font-weight: 800; }
.hw-diff-list article strong { display: block; margin-top: 3px; }
.hw-diff-list article p,.hw-diff-list article small { margin: 2px 0 0; color: var(--muted-foreground); font-size: 8px; }

/* Hardware workflows: engineering changes, prototype gates and operational boards */
.hw-workflow-strip,.hw-stage-track { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 0; margin-bottom: 12px; padding: 13px; overflow: hidden; }
.hw-workflow-strip article,.hw-stage-track article { position: relative; display: grid; min-width: 0; gap: 2px; padding: 9px 13px; border-left: 2px solid var(--border); }
.hw-workflow-strip article:first-child,.hw-stage-track article:first-child { border-left: 0; }
.hw-workflow-strip article > span,.hw-stage-track article > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 8px; font-weight: 800; }
.hw-workflow-strip article > strong,.hw-stage-track article > strong { font-size: 10px; }
.hw-workflow-strip article > small,.hw-stage-track article > small { color: var(--muted-foreground); font-size: 8px; }
.hw-workflow-strip article > i { position: absolute; right: -5px; top: 18px; z-index: 1; color: var(--border-strong); font-style: normal; }
.hw-stage-track article.done { border-color: var(--success); background: #f0f8eb; }
.hw-stage-track article.active { border-color: var(--warning); background: #fff8e6; }
.hw-change-board,.hw-task-board { display: grid; grid-template-columns: repeat(4,minmax(220px,1fr)); gap: 10px; align-items: start; margin-bottom: 12px; overflow-x: auto; }
.hw-change-board > div,.hw-task-board > div { min-height: 260px; padding: 10px; }
.hw-change-board > div > header,.hw-task-board > div > header { display: flex; align-items: center; justify-content: space-between; padding: 4px 3px 10px; }
.hw-change-board > div > header span,.hw-task-board > div > header span { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--muted); font-size: 8px; }
.hw-change-board article,.hw-task-board article { margin-bottom: 8px; padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.hw-change-board article > span,.hw-task-board article > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 7px; font-weight: 700; text-transform: uppercase; }
.hw-change-board article > strong,.hw-task-board article > strong { display: block; margin: 4px 0; font-size: 10px; }
.hw-change-board article > p,.hw-task-board article > p { margin: 0 0 9px; color: var(--muted-foreground); font-size: 8px; }
.hw-change-board article footer,.hw-task-board article footer { display: flex; align-items: center; justify-content: space-between; }
.hw-change-board article footer button,.hw-task-board article footer button { border: 0; background: transparent; color: var(--primary-ink); font-size: 8px; font-weight: 800; cursor: pointer; }
.hw-column-empty { padding: 20px 5px; color: var(--muted-foreground); font-size: 9px; text-align: center; }
.hw-build-grid,.hw-test-cards,.hw-device-mini-grid,.hw-deployment-grid,.hw-rma-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.hw-build-grid article,.hw-test-cards article,.hw-device-mini-grid article,.hw-deployment-grid article,.hw-rma-grid article { padding: 13px; }
.hw-build-grid article > span,.hw-test-cards article > span,.hw-device-mini-grid article > span,.hw-deployment-grid article > span,.hw-rma-grid article > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 7px; font-weight: 700; text-transform: uppercase; }
.hw-build-grid article > strong,.hw-test-cards article > strong,.hw-device-mini-grid article > strong,.hw-deployment-grid article > strong,.hw-rma-grid article > strong { display: block; margin: 4px 0; font-size: 11px; }
.hw-build-grid article > p,.hw-test-cards article > p,.hw-deployment-grid article > p,.hw-rma-grid article > p { margin: 0 0 10px; color: var(--muted-foreground); font-size: 8px; }
.hw-build-grid dl,.hw-test-cards dl,.hw-task-board dl { display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; margin: 9px 0; }
.hw-build-grid dl div,.hw-test-cards dl div,.hw-task-board dl div { padding: 6px; border-radius: 6px; background: var(--muted); }
.hw-build-grid dt,.hw-test-cards dt,.hw-task-board dt { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-build-grid dd,.hw-test-cards dd,.hw-task-board dd { margin: 2px 0 0; font-size: 8px; font-weight: 700; }
.hw-task-board mark { display: block; margin: 8px 0; padding: 6px; border-radius: 5px; background: #fff0ed; color: var(--danger); font-size: 8px; }
.hw-history-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.hw-history-summary > div { padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.hw-history-summary span,.hw-history-summary strong,.hw-history-summary small { display: block; }
.hw-history-summary span { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-history-summary strong { margin: 3px 0; font-size: 10px; }
.hw-history-summary small { color: var(--muted-foreground); font-size: 8px; }

/* Part, PCB and manufacturing master-detail workspaces */
.hw-part-layout,.hw-pcb-layout,.hw-manufacturing-layout,.hw-shop-layout { grid-template-columns: 270px minmax(0,1fr); }
.hw-part-list,.hw-pcb-list,.hw-lot-list,.hw-routing-list { align-self: start; max-height: calc(100vh - 210px); overflow: auto; }
.hw-part-list > button,.hw-pcb-list > button,.hw-lot-list > button,.hw-routing-list > button { display: block; width: 100%; padding: 11px 13px; border: 0; border-top: 1px solid var(--border); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.hw-part-list > button:hover,.hw-pcb-list > button:hover,.hw-lot-list > button:hover,.hw-routing-list > button:hover { background: var(--muted); }
.hw-part-list > button.active,.hw-pcb-list > button.active,.hw-lot-list > button.active,.hw-routing-list > button.active { background: #edf5e8; box-shadow: inset 3px 0 var(--primary); }
.hw-part-list button > span,.hw-pcb-list button > span,.hw-lot-list button > span,.hw-routing-list button > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 7px; font-weight: 700; }
.hw-part-list button > strong,.hw-part-list button > small,.hw-pcb-list button > strong,.hw-pcb-list button > small,.hw-lot-list button > strong,.hw-lot-list button > small,.hw-routing-list button > strong,.hw-routing-list button > small { display: block; }
.hw-part-list button > strong,.hw-pcb-list button > strong,.hw-lot-list button > strong,.hw-routing-list button > strong { margin: 3px 0; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hw-part-list button > small,.hw-pcb-list button > small,.hw-lot-list button > small,.hw-routing-list button > small { color: var(--muted-foreground); font-size: 8px; }
.hw-part-list .hw-status { margin-top: 6px; }
.hw-part-detail > header,.hw-pcb-detail > header,.hw-lot-detail > header,.hw-passport > header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.hw-part-detail > header span,.hw-pcb-detail > header span,.hw-lot-detail > header span,.hw-passport > header span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 8px; font-weight: 700; }
.hw-part-detail > header h3,.hw-pcb-detail > header h3,.hw-lot-detail > header h3,.hw-passport > header h3 { margin: 4px 0; font-size: 18px; }
.hw-part-detail > header p,.hw-pcb-detail > header p,.hw-lot-detail > header p,.hw-passport > header p { margin: 0; color: var(--muted-foreground); font-size: 9px; }
.hw-part-detail > footer,.hw-pcb-detail > footer,.hw-lot-detail > footer,.hw-passport > footer { padding: 14px 18px; border-top: 1px solid var(--border); }
.hw-detail-split,.hw-two-column { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px 20px 20px; }
.hw-detail-split > section,.hw-two-column > section { min-width: 0; }
.hw-detail-split h4,.hw-two-column h4 { margin: 0 0 9px; font-size: 11px; }
.hw-detail-split article,.hw-two-column article { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.hw-detail-split article strong,.hw-two-column article strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hw-detail-split article span,.hw-two-column article span { grid-column: 1; color: var(--muted-foreground); font-size: 8px; }
.hw-detail-split article .hw-status,.hw-two-column article .hw-status { grid-column: 2; grid-row: 1 / span 2; }
.hw-dependency-warning { margin: 8px 0; padding: 9px; border-left: 3px solid var(--warning); background: #fff8e6; color: #805616; font-size: 8px; }
.hw-package-copy { margin-bottom: 16px; padding: 10px; border: 1px dashed var(--border-strong); border-radius: 7px; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 8px; white-space: pre-line; }
.hw-pcb-list button > i,.hw-lot-list button > i { display: block; height: 4px; margin: 8px 0 5px; overflow: hidden; border-radius: 9px; background: var(--muted); }
.hw-pcb-list button > i b,.hw-lot-list button > i b { display: block; height: 100%; background: var(--primary); }
.hw-pcb-list button > footer,.hw-lot-list button > footer { display: flex; align-items: center; justify-content: space-between; }
.hw-pcb-list button > footer em,.hw-lot-list button > footer em { color: var(--muted-foreground); font-size: 7px; font-style: normal; }
.hw-pcb-timeline { display: flex; padding: 18px 20px 4px; }
.hw-pcb-timeline > span { position: relative; display: grid; flex: 1; place-items: center; gap: 5px; color: var(--muted-foreground); font-size: 7px; text-align: center; }
.hw-pcb-timeline > span::before { position: absolute; top: 10px; right: 50%; left: -50%; height: 2px; background: var(--border); content: ""; }
.hw-pcb-timeline > span:first-child::before { display: none; }
.hw-pcb-timeline i { z-index: 1; display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: var(--muted); font-size: 7px; font-style: normal; }
.hw-pcb-timeline span.done::before,.hw-pcb-timeline span.done i { background: var(--primary); color: white; }
.hw-pcb-timeline em { font-style: normal; }
.hw-cost-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 9px; }
.hw-cost-total { margin-top: 10px; padding: 13px; border-radius: 8px; background: #18281d; color: white; }
.hw-cost-total span,.hw-cost-total strong,.hw-cost-total small { display: block; }
.hw-cost-total span { color: rgba(255,255,255,.6); font-size: 8px; text-transform: uppercase; }
.hw-cost-total strong { margin: 4px 0; color: var(--accent); font-family: var(--font-display); font-size: 19px; }
.hw-cost-total small { color: rgba(255,255,255,.55); font-size: 8px; }
.hw-progress { height: 8px; overflow: hidden; border-radius: 9px; background: var(--muted); }
.hw-progress b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--primary),#8bb956); }
.hw-work-order-flow { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; padding: 0 20px 20px; }
.hw-work-order-flow article { padding: 9px; border: 1px solid var(--border); border-radius: 7px; }
.hw-work-order-flow article > span,.hw-work-order-flow article > strong,.hw-work-order-flow article > small { display: block; }
.hw-work-order-flow article > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 7px; }
.hw-work-order-flow article > strong { margin: 3px 0; font-size: 9px; }
.hw-work-order-flow article > small { color: var(--muted-foreground); font-size: 7px; }
.hw-shop-card { margin-bottom: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.hw-shop-card > header { display: flex; align-items: center; justify-content: space-between; }
.hw-shop-card > header strong { font-size: 10px; }
.hw-shop-card > p { margin: 6px 0; color: var(--muted-foreground); font-size: 8px; }

/* Risk, quality, device passports and lifecycle */
.hw-risk-register { display: grid; gap: 8px; margin-bottom: 12px; }
.hw-risk-register article { display: grid; grid-template-columns: 100px minmax(180px,1.2fr) repeat(4,minmax(80px,.6fr)) minmax(150px,1fr); gap: 10px; align-items: center; padding: 11px 14px; }
.hw-risk-register article > div span,.hw-risk-register article > div strong { display: block; }
.hw-risk-register article > div span { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-risk-register article > div strong { margin-top: 2px; font-size: 9px; }
.hw-plan-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.hw-plan-card { padding: 15px; }
.hw-plan-card > header { display: flex; align-items: start; justify-content: space-between; }
.hw-plan-card > header span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 8px; }
.hw-plan-card > header h4 { margin: 3px 0; }
.hw-plan-card > p { color: var(--muted-foreground); font-size: 9px; }
.hw-plan-card dl { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.hw-plan-card dl div { padding: 8px; border-radius: 6px; background: var(--muted); }
.hw-plan-card dt { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-plan-card dd { margin: 2px 0 0; font-size: 10px; font-weight: 800; }
.hw-quality-grid { display: grid; grid-template-columns: minmax(240px,.65fr) minmax(0,1.35fr); gap: 12px; margin-bottom: 12px; }
.hw-yield-chart { display: grid; place-items: center; align-content: start; }
.hw-yield-chart .hw-section-head { width: 100%; }
.hw-donut { --angle: calc(var(--value) * 3.6deg); display: grid; width: 120px; height: 120px; place-items: center; align-content: center; margin: 8px; border-radius: 50%; background: radial-gradient(circle at center,#fff 58%,transparent 59%),conic-gradient(var(--success) var(--angle),#e7ece4 0); }
.hw-donut strong,.hw-donut span { display: block; }
.hw-donut strong { font-family: var(--font-display); font-size: 24px; }
.hw-donut span { color: var(--muted-foreground); font-size: 8px; }
.hw-yield-legend { display: flex; gap: 14px; margin: 7px 0 18px; font-size: 8px; }
.hw-yield-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; }
.hw-yield-legend i.pass { background: var(--success); }
.hw-yield-legend i.fail { background: var(--danger); }
.hw-defect-pareto { padding-bottom: 18px; }
.hw-defect-pareto > div:not(.hw-section-head) { display: grid; grid-template-columns: 110px minmax(100px,1fr) 28px; gap: 9px; align-items: center; padding: 5px 18px; font-size: 8px; }
.hw-defect-pareto i { height: 8px; overflow: hidden; border-radius: 9px; background: var(--muted); }
.hw-defect-pareto i b { display: block; height: 100%; background: linear-gradient(90deg,var(--danger),#e9a47c); }
.hw-trace-search { display: flex; gap: 8px; margin-bottom: 12px; padding: 12px; }
.hw-trace-search input { flex: 1; min-width: 160px; }
.hw-device-grid { display: grid; grid-template-columns: repeat(4,minmax(190px,1fr)); gap: 10px; margin-bottom: 12px; }
.hw-device-card { display: grid; min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.hw-device-card:hover,.hw-device-card.active { border-color: var(--primary); box-shadow: 0 5px 20px rgba(35,67,38,.08); }
.hw-device-card > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 7px; }
.hw-device-card > strong { margin: 5px 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.hw-device-card > small { color: var(--muted-foreground); font-size: 8px; }
.hw-device-card > footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.hw-device-card > footer em { color: var(--muted-foreground); font-size: 7px; font-style: normal; }
.hw-passport { margin-bottom: 12px; }
.hw-genealogy { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.hw-genealogy > div { position: relative; min-width: 0; padding: 9px; border: 1px solid var(--border); border-radius: 7px; }
.hw-genealogy > div::after { position: absolute; top: 50%; right: -7px; color: var(--border-strong); content: "›"; }
.hw-genealogy > div:last-child::after { display: none; }
.hw-genealogy span,.hw-genealogy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-genealogy span { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-genealogy strong { margin-top: 3px; font-size: 8px; }
.hw-passport-tabs { padding: 0 20px 18px; }
.hw-compatibility { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(0,1.3fr); gap: 12px; margin-bottom: 12px; }
.hw-compatibility > section { min-width: 0; }
.hw-warranty { display: inline-flex; padding: 6px 9px; border-radius: 99px; background: #eef7e8; color: #346029; font-size: 8px; font-weight: 700; }
.hw-rma-flow { display: flex; margin-bottom: 12px; padding: 13px; overflow-x: auto; }
.hw-rma-flow > span { position: relative; min-width: 125px; flex: 1; padding: 9px 13px; border-left: 2px solid var(--border); }
.hw-rma-flow > span:first-child { border-left: 0; }
.hw-rma-flow strong,.hw-rma-flow small { display: block; }
.hw-rma-flow strong { font-size: 9px; }
.hw-rma-flow small { margin-top: 3px; color: var(--muted-foreground); font-size: 7px; }
.hw-readiness-modal { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 18px; align-items: start; }
.hw-readiness-modal > div:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.hw-readiness-modal section { padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.hw-readiness-modal section > header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.hw-readiness-modal section > header span { color: var(--primary-ink); font-size: 8px; font-weight: 800; }
.hw-readiness-modal section p { display: flex; gap: 7px; margin: 7px 0 0; }
.hw-readiness-modal section p > i { display: grid; width: 17px; height: 17px; flex: none; place-items: center; border-radius: 50%; background: #fff0ed; color: var(--danger); font-size: 8px; font-style: normal; }
.hw-readiness-modal section p.done > i { background: #e8f5e2; color: var(--success); }
.hw-readiness-modal section p strong,.hw-readiness-modal section p small { display: block; }
.hw-readiness-modal section p strong { font-size: 8px; }
.hw-readiness-modal section p small { color: var(--muted-foreground); font-size: 7px; }
.hw-loading { display: grid; min-height: 250px; place-items: center; color: var(--muted-foreground); font-size: 10px; }

/* Product-line and hardware-revision detail centers */
.hw-line-detail { overflow: hidden; }
.hw-line-detail > header { display: grid; grid-template-columns: 108px minmax(220px,1fr) minmax(280px,.8fr) auto; gap: 18px; align-items: center; padding: 18px; border-bottom: 1px solid var(--border); }
.hw-line-detail > header > div:nth-child(2) > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.hw-line-detail > header h3 { margin: 3px 0; font-size: 24px; }
.hw-line-detail > header p { margin: 0; color: var(--muted-foreground); font-size: 9px; }
.hw-line-detail > header dl { display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; margin: 0; }
.hw-line-detail > header dl div { padding: 7px; border-radius: 6px; background: var(--muted); }
.hw-line-detail > header dt { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-line-detail > header dd { margin: 2px 0 0; font-size: 9px; font-weight: 700; }
.hw-line-detail > .hw-detail-tabs,.hw-revision-detail > .hw-detail-tabs { margin: 12px 18px 0; overflow-x: auto; }
.hw-link-button { border: 0; background: transparent; color: var(--primary-ink); text-align: left; cursor: pointer; }
.hw-link-button strong,.hw-link-button small { display: block; }
.hw-link-button small { color: var(--muted-foreground); font-size: 8px; }
.hw-shared-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.hw-shared-grid article { padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.hw-shared-grid article > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 7px; }
.hw-shared-grid article > strong { display: block; margin: 3px 0; font-size: 10px; }
.hw-shared-grid article > p { margin: 0 0 7px; color: var(--muted-foreground); font-size: 8px; }
.hw-roadmap { display: flex; min-width: 720px; overflow-x: auto; }
.hw-roadmap article { position: relative; min-width: 100px; flex: 1; padding: 12px; border-top: 3px solid var(--border); background: var(--muted); }
.hw-roadmap article::before { position: absolute; top: -7px; left: 12px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: var(--border-strong); content: ""; }
.hw-roadmap article.done { border-color: var(--primary); background: #f0f7ec; }
.hw-roadmap article.done::before { background: var(--primary); }
.hw-roadmap span,.hw-roadmap strong,.hw-roadmap small { display: block; }
.hw-roadmap span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 7px; }
.hw-roadmap strong { margin: 4px 0; font-size: 9px; }
.hw-roadmap small { color: var(--muted-foreground); font-size: 7px; }
.hw-revision-detail { margin-top: 14px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.hw-revision-detail > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 15px 18px; border-bottom: 1px solid var(--border); background: #f8faf6; }
.hw-revision-detail > header > div:first-child > span { color: var(--primary-ink); font-family: var(--font-mono); font-size: 8px; }
.hw-revision-detail > header h4 { margin: 3px 0; font-size: 18px; }
.hw-revision-detail > header p { margin: 0; color: var(--muted-foreground); font-size: 9px; }
.hw-revision-detail > header > div:last-child { display: flex; gap: 7px; align-items: center; }
.hw-revision-dashboard { display: grid; grid-template-columns: repeat(7,minmax(80px,1fr)); gap: 1px; border-bottom: 1px solid var(--border); background: var(--border); }
.hw-revision-dashboard div { padding: 10px; background: #fff; }
.hw-revision-dashboard div.good { box-shadow: inset 0 3px var(--success); }
.hw-revision-dashboard div.warning { box-shadow: inset 0 3px var(--warning); }
.hw-revision-dashboard span,.hw-revision-dashboard strong { display: block; }
.hw-revision-dashboard span { color: var(--muted-foreground); font-size: 7px; text-transform: uppercase; }
.hw-revision-dashboard strong { margin-top: 3px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hw-snapshot-lock { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; align-items: center; margin-bottom: 10px; padding: 10px; border: 1px solid #c8dec1; border-radius: 8px; background: #f0f7ec; }
.hw-snapshot-lock span { color: #35642b; font-size: 7px; font-weight: 800; }
.hw-snapshot-lock strong { overflow: hidden; font-family: var(--font-mono); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.hw-snapshot-lock small { color: var(--muted-foreground); font-size: 8px; }

@media (max-width: 1080px) {
  .hardware-page-head { grid-template-columns: minmax(0,1fr) minmax(220px,.7fr); }
  .hardware-page-head > div:last-child { grid-column: 1 / -1; justify-content: flex-end; }
  .hw-kpi-grid { grid-template-columns: repeat(2,1fr); }
  .hw-overview-grid,.hw-cost-layout,.hw-quality-grid,.hw-compatibility { grid-template-columns: 1fr; }
  .hw-overview-alerts { grid-column: auto; }
  .hw-overview-portfolio { grid-row: auto; }
  .hw-document-grid,.hw-build-grid,.hw-test-cards,.hw-deployment-grid,.hw-rma-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hw-document-checklist > div:last-child { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .hw-risk-register article { grid-template-columns: 90px minmax(180px,1.4fr) repeat(2,minmax(80px,.7fr)); }
  .hw-risk-register article > div:nth-last-child(-n+3) { display: none; }
  .hw-device-grid { grid-template-columns: repeat(3,minmax(180px,1fr)); }
  .hw-genealogy { grid-template-columns: repeat(3,1fr); }
  .hw-work-order-flow { grid-template-columns: repeat(3,1fr); }
  .hw-line-detail > header { grid-template-columns: 90px minmax(220px,1fr) minmax(240px,.8fr); }
  .hw-line-detail > header > .button { grid-column: 1 / -1; justify-self: end; }
  .hw-revision-dashboard { grid-template-columns: repeat(4,1fr); }
}

@media (max-width: 760px) {
  .hardware-view { padding: 10px; }
  .hardware-page-head { grid-template-columns: 1fr; align-items: stretch; padding: 13px; }
  .hardware-page-head h2 { font-size: 18px; }
  .hardware-page-head > div:last-child { grid-column: auto; justify-content: stretch; }
  .hardware-page-head > div:last-child .button { flex: 1; }
  .hw-global-search { max-width: none; }
  .hw-kpi-grid,.hw-overview-grid,.hw-plan-grid,.hw-document-grid,.hw-build-grid,.hw-test-cards,.hw-deployment-grid,.hw-rma-grid,.hw-quality-grid { grid-template-columns: 1fr; }
  .hw-kpi-card { min-height: 98px; }
  .hw-master-detail,.hw-part-layout,.hw-pcb-layout,.hw-manufacturing-layout,.hw-shop-layout { grid-template-columns: 1fr; }
  .hw-product-tree,.hw-part-list,.hw-pcb-list,.hw-lot-list,.hw-routing-list { max-height: 280px; }
  .hw-model-hero,.hw-part-detail > header,.hw-pcb-detail > header,.hw-lot-detail > header,.hw-passport > header { display: grid; gap: 10px; }
  .hw-model-stats,.hw-spec-grid,.hw-history-summary { grid-template-columns: repeat(2,1fr); }
  .hw-model-tabs { overflow-x: auto; }
  .hw-model-tabs button { white-space: nowrap; }
  .hw-workflow-strip,.hw-stage-track { display: flex; overflow-x: auto; }
  .hw-workflow-strip article,.hw-stage-track article { min-width: 150px; }
  .hw-change-board,.hw-task-board { grid-template-columns: repeat(4,250px); }
  .hw-readiness-banner { align-items: flex-start; }
  .hw-document-checklist > div:last-child { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hw-bom-tree { overflow-x: auto; }
  .hw-bom-tree > header,.hw-bom-node { min-width: 820px; }
  .hw-cost-bars > div { grid-template-columns: 90px minmax(80px,1fr) 90px; }
  .hw-readiness-tool,.hw-compare-tool { grid-template-columns: 1fr; }
  .hw-readiness-tool > .wide,.hw-compare-tool > .wide { grid-column: auto; }
  .hw-readiness-tool > div:nth-child(2),.hw-compare-tool > div:nth-child(2) { flex-wrap: wrap; }
  .hw-diff-list,.hw-detail-split,.hw-two-column { grid-template-columns: 1fr; }
  .hw-device-grid { display: flex; padding-bottom: 5px; overflow-x: auto; }
  .hw-device-card { min-width: 235px; }
  .hw-genealogy { grid-template-columns: repeat(2,1fr); }
  .hw-work-order-flow { grid-template-columns: repeat(2,1fr); }
  .hw-risk-register { overflow-x: auto; }
  .hw-risk-register article { min-width: 660px; }
  .hw-readiness-modal { grid-template-columns: 1fr; }
  .hw-readiness-modal > div:last-child { grid-template-columns: 1fr; }
  .hw-line-detail > header { grid-template-columns: 1fr; }
  .hw-line-detail > header > .hw-product-art { width: 84px; min-height: 84px; }
  .hw-line-detail > header > .button { grid-column: auto; justify-self: stretch; }
  .hw-shared-grid { grid-template-columns: 1fr; }
  .hw-revision-detail > header { display: grid; }
  .hw-revision-detail > header > div:last-child { flex-wrap: wrap; }
  .hw-revision-dashboard { grid-template-columns: repeat(2,1fr); }
  .hw-snapshot-lock { grid-template-columns: 1fr; }
}
