:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-2: #eef4ef;
  --ink: #16221c;
  --muted: #6a766f;
  --line: #d9e0da;
  --green: #1f8a5b;
  /* Used by the phone Scan buttons and a few links; it was never defined, so those buttons had no background
     and their white text was invisible (16 Nov 2026). */
  --primary: var(--green);
  --blue: #2367d1;
  --amber: #b86b12;
  --red: #c94343;
  --shadow: 0 18px 50px rgba(22, 34, 28, 0.08);
  --ds-radius: 8px;
  --ds-card-padding: 16px;
  --ds-section-gap: 14px;
  --ds-control-height: 40px;
  --ds-control-padding: 10px 12px;
  --ds-hover-shadow: 0 18px 46px rgba(22, 34, 28, 0.12);
  --ds-transition: 160ms ease;
  --ds-focus: 0 0 0 3px rgba(31, 138, 91, 0.18);
  --ds-success-bg: #e5f7ed;
  --ds-success-text: #147849;
  --ds-warning-bg: #fff2d8;
  --ds-warning-text: #8a5a00;
  --ds-danger-bg: #ffe9e9;
  --ds-danger-text: #b42318;
  --ds-info-bg: #e9f1ff;
  --ds-info-text: #1f5fbf;
  --ds-neutral-bg: #eef4ef;
  --ds-neutral-text: #405047;
}

/* Materials Inventory V1 stabilization */
#glass .inventory-dashboard > .glass-entry {
  border-color: #4f83bd;
  background: #4f83bd;
  color: #fff;
}

#glass .inventory-dashboard > .pvb-entry {
  border-color: #05b457;
  background: #05b457;
  color: #fff;
}

#glass .inventory-dashboard > .daily-cutting-entry {
  border-color: #d40000;
  background: #d40000;
  color: #fff;
}

#glass .inventory-dashboard > .lea-hin-entry {
  border-color: #f4c62d;
  background: #f4c62d;
  color: #172018;
}

#glass .inventory-dashboard > .inventory-entry-card span,
#glass .inventory-dashboard > .inventory-entry-card small {
  color: currentColor;
}

.material-kpi-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.material-kpi-panel article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--ds-radius);
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.material-kpi-panel span,
.material-stock-card-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.material-kpi-panel strong,
.material-stock-card-summary strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.material-filter-bar {
  position: sticky;
  top: 48px;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--ds-radius);
  background: var(--surface);
}

.material-filter-bar label {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.material-filter-bar input {
  width: 100%;
  min-height: var(--ds-control-height);
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--ds-radius);
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.material-filter-bar span {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.material-helper-note {
  margin: 0 0 12px;
  border: 1px solid #d8e7ff;
  border-radius: var(--ds-radius);
  padding: 10px 12px;
  background: #f2f7ff;
  color: #1f5fbf;
  font-weight: 800;
}

.material-info-banner {
  margin: 8px 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: var(--ds-radius);
  padding: 10px 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.material-stock-health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-radius: var(--ds-radius);
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 900;
}

.material-stock-health-healthy {
  background: #e6f7ef;
  color: #08743f;
}

.material-stock-health-low {
  background: #fff4bd;
  color: #8a5a00;
}

.material-stock-health-critical {
  background: #ffe4e4;
  color: var(--red);
}

#glass .inventory-panel tbody tr {
  cursor: pointer;
}

#glass .inventory-panel tbody tr.material-row-selected {
  background: #e8f3ff;
  outline: 2px solid #4f83bd;
  outline-offset: -2px;
}

.material-stock-card-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.material-stock-card-summary article,
.material-threshold-card,
.material-ledger-section,
.material-adjustment-approvals,
.material-adjustment-request {
  border: 1px solid var(--line);
  border-radius: var(--ds-radius);
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.material-threshold-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.material-threshold-card h3 {
  margin: 0 0 4px;
}

.material-threshold-card p {
  margin: 0;
  color: var(--muted);
}

.material-ledger-section .table-wrap {
  max-height: 45vh;
  overflow: auto;
}

.material-adjustment-approvals {
  grid-column: 1 / -1;
}

.material-adjustment-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.material-adjustment-request p {
  margin: 4px 0 0;
  color: var(--muted);
}

.material-adjustment-request small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.inventory-empty-cell {
  padding: 22px !important;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

@media (max-width: 1200px) {
  .material-kpi-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-stock-card-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px;
  background: #16221c;
  color: #f4fbf6;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar::-webkit-scrollbar {
  width: 0;
}

.brand,
.site-card,
.nav-list a,
.topbar,
.panel-header,
.section-header,
.asset-copy,
.catalog-card header,
.equipment-profile-header,
.order-card header,
.part-status {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #43c27d;
  color: #0e1712;
  font-weight: 900;
}

.brand strong,
.site-card strong {
  display: block;
}

.brand span:not(.brand-mark),
.site-card span,
.panel-header p,
.section-header p,
.asset-copy span,
.order-card small,
.metric span,
.metric small,
.feed-item span {
  color: var(--muted);
}

.sidebar .brand span:not(.brand-mark),
.sidebar .site-card span {
  color: #b9c8bf;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  min-height: 44px;
  gap: 12px;
  color: #dce9e1;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
}

.nav-list a[hidden] {
  display: none !important;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.11);
  color: white;
}

.icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  flex: 0 0 24px;
}

.icon::before,
.icon::after {
  content: "";
  position: absolute;
  border-color: currentColor;
}

.dashboard-icon::before {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: 7px 0 0 -4px currentColor, 0 7px 0 -4px currentColor;
}

.orders-icon::before {
  width: 12px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.orders-icon::after {
  width: 8px;
  height: 2px;
  top: 8px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.equipment-icon::before {
  width: 16px;
  height: 11px;
  bottom: 5px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background:
    linear-gradient(currentColor, currentColor) 4px 3px / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 9px 3px / 2px 5px no-repeat;
}

.equipment-icon::after {
  width: 5px;
  height: 5px;
  top: 5px;
  left: 6px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
  box-shadow: 8px -2px 0 -1px currentColor, 2px 12px 0 -1px currentColor, 11px 12px 0 -1px currentColor;
}

.certifications-icon::before {
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background:
    linear-gradient(currentColor, currentColor) 3px 5px / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 9px / 6px 2px no-repeat;
}

.certifications-icon::after {
  width: 8px;
  height: 8px;
  right: 2px;
  bottom: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--sidebar);
  box-shadow: 0 5px 0 -3px currentColor;
}

.parts-icon {
  background: rgba(255, 255, 255, 0.1);
}

.parts-icon::before {
  width: 16px;
  height: 5px;
  left: 4px;
  top: 13px;
  border: 0;
  border-radius: 5px;
  background: currentColor;
  transform: rotate(-42deg);
  transform-origin: center;
}

.parts-icon::after {
  width: 8px;
  height: 8px;
  right: 3px;
  top: 3px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  background: transparent;
  transform: rotate(42deg);
  box-shadow: none;
}

.suppliers-icon::before {
  width: 7px;
  height: 7px;
  top: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.suppliers-icon::after {
  width: 15px;
  height: 8px;
  bottom: 5px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 3px 3px;
  border-bottom-width: 3px;
}

.factory-icon::before {
  width: 18px;
  height: 12px;
  left: 3px;
  bottom: 4px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
  background:
    linear-gradient(currentColor, currentColor) 4px 6px / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 9px 6px / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 14px 6px / 2px 4px no-repeat;
  clip-path: polygon(0 38%, 34% 18%, 34% 0, 64% 18%, 64% 0, 100% 24%, 100% 100%, 0 100%);
}

.factory-icon::after {
  width: 4px;
  height: 9px;
  right: 5px;
  top: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  box-shadow: -7px 3px 0 -1px currentColor;
}

.glass-icon::before {
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: skewX(-8deg);
}

.glass-icon::after {
  width: 9px;
  height: 2px;
  background: currentColor;
  transform: rotate(-32deg);
  box-shadow: 0 5px 0 currentColor;
  opacity: 0.9;
}

.calendar-icon::before {
  width: 15px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.calendar-icon::after {
  width: 11px;
  height: 2px;
  top: 8px;
  background: currentColor;
  box-shadow:
    -3px -5px 0 -1px currentColor,
    3px -5px 0 -1px currentColor,
    0 5px 0 currentColor,
    -4px 2px 0 -1px currentColor,
    4px 2px 0 -1px currentColor;
}

.checklist-icon::before {
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.checklist-icon::after {
  width: 8px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.site-card {
  margin-top: auto;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #43c27d;
  box-shadow: 0 0 0 5px rgba(67, 194, 125, 0.16);
}

.main {
  min-width: 0;
  padding: 24px 24px 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(320px, 480px) minmax(220px, 1fr);
  justify-content: initial;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar-title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  letter-spacing: 0;
}

.build-label {
  display: inline-flex;
  margin-top: 8px;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 7px;
  background: #e8eefb;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.16rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-role-switcher {
  display: grid;
  gap: 4px;
  min-width: 180px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.account-role-switcher select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
}

.topbar-search {
  width: 100%;
  align-self: start;
  justify-self: center;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.icon-button,
.segmented button {
  border: 0;
  min-height: 40px;
  border-radius: 8px;
}

.primary-button {
  background: var(--green);
  color: white;
  padding: 0 16px;
  font-weight: 800;
}

.secondary-button,
.text-button {
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 700;
}

.inventory-floor-button {
  background: #0f766e;
  color: white;
}

.inventory-floor-button:hover,
.inventory-floor-button:focus-visible {
  background: #115e59;
  color: white;
}

.danger-button {
  background: #fde8e8;
  color: #b42318;
  padding: 0 14px;
  font-weight: 900;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: #fbd5d5;
}

.text-button {
  color: var(--green);
}

.icon-button {
  width: 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.2rem;
}

.sync-status-button,
.notification-button,
.settings-button,
.language-button {
  position: relative;
  display: grid;
  place-items: center;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--amber);
  color: white;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

.notification-count.critical {
  background: var(--red);
}

.notification-count.warning {
  background: var(--amber);
}

.notification-icon,
.settings-icon,
.language-icon {
  position: relative;
  width: 19px;
  height: 19px;
}

.notification-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 11px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 9px 9px 5px 5px;
  border-bottom-width: 2px;
}

.notification-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 9px -12px 0 -1px var(--red);
}

.settings-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow:
    0 -7px 0 -5px currentColor,
    0 7px 0 -5px currentColor,
    7px 0 0 -5px currentColor,
    -7px 0 0 -5px currentColor;
}

.settings-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.language-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.language-icon::after {
  content: "EN";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0;
}

.sync-status-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.sync-status-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 0;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(40deg);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

#certifications.active-view,
#checklists.active-view {
  margin-bottom: 0;
  padding-bottom: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric,
.panel,
.order-card,
.asset-card,
.checklist-panel,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric-action {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.metric-action:hover,
.metric-action:focus-visible {
  border-color: rgba(31, 138, 91, 0.42);
  background: #f2faf5;
  outline: none;
}

.metric strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 2rem;
}

.good {
  color: var(--green) !important;
}

.warn {
  color: var(--amber) !important;
}

.bad {
  color: var(--red) !important;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

.priority-list,
.risk-list,
.trend-grid {
  display: grid;
  gap: 10px;
}

.priority-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.priority-list strong,
.priority-list span,
.priority-list small {
  display: block;
}

.priority-list span,
.priority-list small {
  color: var(--muted);
}

.priority-list .text-button {
  min-width: 72px;
  background: white;
  color: var(--green);
}

.risk-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.risk-list small {
  color: var(--muted);
  font-weight: 800;
}

.risk-bar {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.risk-bar::before {
  content: "";
  display: block;
  width: calc(var(--risk) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--red));
}

.trend-panel {
  grid-column: span 2;
}

.trend-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trend-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.trend-grid span,
.trend-grid small {
  color: var(--muted);
  font-weight: 800;
}

.trend-grid strong {
  font-size: 1.22rem;
}

.dashboard-analytics-panel {
  display: grid;
  gap: 12px;
}

.dashboard-analytics-list {
  display: grid;
  gap: 8px;
}

.dashboard-analytics-list article,
.dashboard-cost-breakdown article,
.dashboard-cost-summary {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--ds-card-radius, 8px);
  background: #f8fbf8;
}

.dashboard-analytics-list span,
.dashboard-cost-breakdown span,
.dashboard-cost-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-analytics-list strong,
.dashboard-cost-breakdown strong,
.dashboard-cost-summary strong {
  color: var(--ink);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.dashboard-analytics-list small {
  color: var(--muted);
}

.dashboard-subheading {
  margin: 6px 0 0;
  font-size: 0.88rem;
}

.dashboard-alerts-panel {
  grid-column: 1 / -1;
}

.dashboard-alert-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-alert-summary article {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--ds-card-radius, 8px);
  background: var(--surface-2);
}

.dashboard-alert-summary span,
.dashboard-alert-card-body span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-alert-summary strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.dashboard-alert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.dashboard-alert-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--ds-card-radius, 8px);
  background: #f8fbf8;
}

.dashboard-alert-card.critical {
  border-left-color: var(--red);
}

.dashboard-alert-card.warning {
  border-left-color: var(--amber);
}

.dashboard-alert-card.info {
  border-left-color: var(--green);
}

.dashboard-alert-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-alert-card-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-alert-card-body {
  display: grid;
  gap: 5px;
}

.dashboard-alert-card-body p {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.dashboard-alert-card-body small {
  color: var(--muted);
}

.dashboard-cost-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-cost-trend {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 150px;
}

.dashboard-cost-trend article {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  min-width: 0;
  min-height: 130px;
}

.dashboard-cost-trend div {
  align-self: end;
  min-height: 8px;
  height: calc(var(--value) * 1%);
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #1f8a5b, #9fd9b7);
}

.dashboard-cost-trend span,
.dashboard-cost-trend strong {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.sparkline {
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 48%, rgba(31, 138, 91, 0.3) 49%, rgba(31, 138, 91, 0.3) 53%, transparent 54%),
    repeating-linear-gradient(90deg, rgba(23, 32, 24, 0.05) 0 1px, transparent 1px 18px),
    white;
}

.sparkline.down {
  background:
    linear-gradient(45deg, transparent 48%, rgba(198, 40, 40, 0.28) 49%, rgba(198, 40, 40, 0.28) 53%, transparent 54%),
    repeating-linear-gradient(90deg, rgba(23, 32, 24, 0.05) 0 1px, transparent 1px 18px),
    white;
}

.sparkline.flat {
  background:
    linear-gradient(0deg, transparent 45%, rgba(245, 130, 32, 0.3) 46%, rgba(245, 130, 32, 0.3) 54%, transparent 55%),
    repeating-linear-gradient(90deg, rgba(23, 32, 24, 0.05) 0 1px, transparent 1px 18px),
    white;
}

.panel {
  padding: 18px;
}

.panel-header,
.section-header,
.order-card header {
  justify-content: space-between;
  gap: 16px;
}

.panel-header p,
.section-header p {
  margin-bottom: 0;
}

.feed-panel {
  grid-column: 1 / -1;
}

.bar-chart {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 12px;
  padding-top: 20px;
}

.bar-chart div {
  height: calc(var(--value) * 1%);
  min-height: 52px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #43c27d, #2367d1);
  position: relative;
}

.bar-chart span {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.machine-visual {
  height: 190px;
  margin: 18px 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 14% 22%, rgba(35, 103, 209, 0.18), transparent 26%),
    linear-gradient(135deg, #eaf3ef, #f7faf8);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}

.conveyor {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 38px;
  height: 58px;
  border-radius: 8px;
  background: #2b3b32;
  box-shadow: inset 0 -16px 0 rgba(255, 255, 255, 0.08);
}

.conveyor span {
  position: absolute;
  bottom: -24px;
  width: 34px;
  height: 34px;
  border: 7px solid #6a766f;
  border-radius: 50%;
}

.conveyor span:nth-child(1) {
  left: 18%;
}

.conveyor span:nth-child(2) {
  left: 48%;
}

.conveyor span:nth-child(3) {
  right: 14%;
}

.qr {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: repeat(4, 10px);
  grid-auto-rows: 10px;
  gap: 4px;
  padding: 9px;
  background: white;
  border-radius: 6px;
}

.qr span:nth-child(odd),
.qr span:nth-child(4n) {
  background: #16221c;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  font-weight: 900;
  font-size: 0.78rem;
  background: var(--surface-2);
}

.badge.danger {
  background: #ffe9e9;
  color: var(--red);
}

.badge.ok {
  background: #e5f7ed;
  color: var(--green);
}

.badge.waiting {
  background: #fff2d8;
  color: var(--amber);
}

.feed-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.feed-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.feed-item strong {
  display: block;
  margin-bottom: 6px;
}

.section-header {
  margin-bottom: 14px;
}

#calendar .section-header {
  margin-bottom: 8px;
}

#calendar .section-header p {
  font-size: 0.9rem;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 8px;
  gap: 3px;
}

.segmented button {
  background: transparent;
  padding: 0 12px;
  color: var(--muted);
}

.segmented button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 5px 18px rgba(22, 34, 28, 0.08);
}

.task-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.task-filter-panel .segmented {
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.task-filter-panel .segmented button {
  min-width: 76px;
  white-space: normal;
  line-height: 1.15;
}

.task-dropdown-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.task-dropdown-filters label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.task-dropdown-filters select {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
}

.stage5b-reservation-panel {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.stage5b-reservation-panel .section-title-row {
  margin-bottom: 10px;
}

.stage5b-reservation-panel .section-title-row h3 {
  margin: 0;
}

.stage5b-reservation-panel .section-title-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.stage5b-reservation-panel [data-stage5b-reservation-summary] {
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.stage5b-reservation-panel .table-scroll {
  max-height: 260px;
  overflow: auto;
}

.stage5b-reservation-panel th,
.stage5b-reservation-panel td {
  white-space: nowrap;
}

.order-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  overflow-x: visible;
  padding-bottom: 10px;
}

.kanban-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 540px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kanban-column h3 {
  margin: 0;
  font-size: 0.95rem;
}

.kanban-column > header strong {
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

.kanban-stack {
  display: grid;
  gap: 10px;
}

.empty-kanban {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.order-card,
.asset-card,
.catalog-card {
  min-width: 0;
  padding: 16px;
}

.asset-card {
  padding: 14px;
}

.order-card p {
  margin: 12px 0;
}

.task-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.task-edit-button,
.task-status-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.task-status-button {
  background: #eaf3ff;
  color: #1f5fbf;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.task-detail-grid span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

.task-detail-grid b {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.task-detail-grid .task-timing {
  grid-column: 1 / -1;
}

.task-detail-grid .task-timing em {
  display: block;
  font-style: normal;
}

.waiting-workflow,
.close-requirements {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.waiting-workflow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.close-requirements strong,
.close-requirements span {
  display: block;
}

.close-requirements span {
  color: var(--muted);
  font-size: 0.82rem;
}

.close-requirements.missing {
  border-color: rgba(198, 40, 40, 0.24);
  background: #fff7f7;
}

.close-requirements.ready {
  border-color: rgba(31, 138, 91, 0.24);
  background: #f2faf5;
}

.order-meta,
.asset-meta,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-meta span,
.asset-meta span,
.tag-list span,
.tag-list button {
  padding: 6px 8px;
  background: var(--surface-2);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.tag-list button {
  border: 0;
  color: var(--green);
  font-weight: 800;
}

.equipment-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f0;
}

.equipment-filter-bar label {
  font-weight: 800;
}

.equipment-filter-bar select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.catalog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

button.catalog-card {
  display: block;
  width: 100%;
  color: var(--ink);
  text-align: left;
}

button.catalog-card:hover,
.part-entry:hover,
.linked-equipment:hover,
.tag-list button:hover {
  outline: 2px solid rgba(31, 138, 91, 0.22);
}

.catalog-table {
  min-width: 920px;
}

#catalog .catalog-table th,
#catalog .catalog-table td {
  overflow-wrap: anywhere;
  padding: 10px 8px;
  font-size: 0.82rem;
}

#catalog .sort-button {
  white-space: normal;
  line-height: 1.2;
  text-align: center;
  justify-content: center;
}

#catalog .catalog-table {
  min-width: 0;
  table-layout: fixed;
}

#catalog .table-wrap {
  overflow-x: hidden;
}

#catalog .catalog-table th:nth-child(1),
#catalog .catalog-table td:nth-child(1) {
  width: 17%;
}

#catalog .catalog-table th:nth-child(2),
#catalog .catalog-table td:nth-child(2) {
  width: 13%;
}

#catalog .catalog-table th:nth-child(3),
#catalog .catalog-table td:nth-child(3) {
  width: 13%;
}

#catalog .catalog-table th:nth-child(4),
#catalog .catalog-table td:nth-child(4) {
  width: 15%;
}

#catalog .catalog-table th:nth-child(5),
#catalog .catalog-table td:nth-child(5) {
  width: 17%;
}

#catalog .catalog-table th:nth-child(6),
#catalog .catalog-table td:nth-child(6) {
  width: 25%;
}

.catalog-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.catalog-link-list button,
.catalog-link-list span {
  border: 0;
  border-radius: 7px;
  padding: 6px 8px;
  background: var(--surface-2);
  color: var(--green);
  font-weight: 800;
  font-size: 0.82rem;
}

.catalog-link-list span {
  color: var(--muted);
}

.catalog-card header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.catalog-card h3 {
  margin: 0;
  font-size: 1rem;
}

.catalog-card p {
  margin-bottom: 12px;
  color: var(--muted);
}

.asset-thumb {
  height: 108px;
  border-radius: 8px;
  margin-bottom: 10px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.55) 48% 52%, transparent 52%),
    linear-gradient(135deg, #d9efe4, #dbe7fb);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.asset-thumb:not(.has-image)::before,
.asset-thumb:not(.has-image)::after {
  content: "";
  position: absolute;
  border-radius: 7px;
  background: #2b3b32;
}

.asset-thumb:not(.has-image)::before {
  left: 18px;
  right: 18px;
  bottom: 26px;
  height: 34px;
}

.asset-thumb:not(.has-image)::after {
  width: 54px;
  height: 54px;
  right: 22px;
  top: 20px;
  background: var(--blue);
}

.image-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
}

.asset-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.asset-actions .image-upload {
  margin-bottom: 0;
}

.detail-button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #e8eefb;
  color: var(--blue);
  font-weight: 800;
  font-size: 0.84rem;
}

.certificate-thumb {
  width: 82px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(35, 103, 209, 0.08), rgba(31, 138, 91, 0.08)),
    #f8fbf9;
  background-position: center;
  background-size: cover;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

#certifications .certificate-thumb {
  width: min(76px, 100%);
  height: 48px;
  margin: 0;
}

.certificate-thumb.has-image,
.certificate-preview.has-image,
.invoice-preview.has-image {
  background-position: center;
  background-size: cover;
}

.certificate-preview {
  min-height: 230px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(35, 103, 209, 0.08), rgba(31, 138, 91, 0.08)),
    #f8fbf9;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.certificate-invoice-preview {
  min-height: 230px;
}

.image-upload input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.image-delete-button {
  width: 100%;
  margin: 8px 0;
}

.asset-card h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.asset-code {
  margin-bottom: 4px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
}

.table-wrap {
  overflow-x: auto;
}

#certifications .table-wrap {
  overflow-x: hidden;
}

#certifications .catalog-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#certifications .catalog-table th,
#certifications .catalog-table td {
  padding: 9px 8px;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: middle;
}

#certifications .catalog-table .sort-button {
  justify-content: flex-start;
  text-align: left;
}

#certifications .catalog-table th:nth-child(1),
#certifications .catalog-table td:nth-child(1) {
  width: 20%;
}

#certifications .catalog-table th:nth-child(2),
#certifications .catalog-table td:nth-child(2),
#certifications .catalog-table th:nth-child(3),
#certifications .catalog-table td:nth-child(3) {
  width: 12%;
}

#certifications .catalog-table th:nth-child(4),
#certifications .catalog-table td:nth-child(4) {
  width: 16%;
}

#certifications .catalog-table th:nth-child(5),
#certifications .catalog-table td:nth-child(5) {
  width: 14%;
}

#certifications .catalog-table th:nth-child(6),
#certifications .catalog-table td:nth-child(6) {
  width: 13%;
}

#certifications .catalog-table th:nth-child(7),
#certifications .catalog-table td:nth-child(7) {
  width: 13%;
}

#certifications .detail-button {
  width: auto;
  min-width: 0;
  padding: 0 8px;
  white-space: normal;
  line-height: 1.1;
}

.cert-expiry-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.cert-expiry-badge.expired {
  background: #ffe4e4;
  color: var(--red);
}

.cert-expiry-badge.within-30 {
  background: #ffe9cf;
  color: #b54708;
}

.cert-expiry-badge.within-90 {
  background: #fff4bd;
  color: #8a5a00;
}

.table-wrap h3 {
  margin: 0 0 12px;
}

.inventory-subsection {
  margin-top: 18px;
}

.inventory-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.inventory-chart-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}

.inventory-metric,
.inventory-entry-card {
  min-height: 122px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.inventory-metric span,
.inventory-entry-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.inventory-metric strong,
.inventory-entry-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.35rem;
  line-height: 1.15;
}

.inventory-metric small,
.inventory-entry-card small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.inventory-entry-card {
  appearance: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.inventory-entry-card:hover,
.inventory-entry-card:focus,
.inventory-entry-card.active {
  border-color: rgba(23, 32, 24, 0.2);
  transform: translateY(-2px);
}

.inventory-entry-card.active {
  box-shadow: 0 0 0 3px rgba(35, 135, 82, 0.18), var(--shadow);
}

.glass-entry {
  border-color: #4f83bd;
  background: #4f83bd;
  color: white;
}

.pvb-entry {
  border-color: #05b457;
  background: #05b457;
  color: white;
}

.daily-cutting-entry {
  border-color: #d40000;
  background: #d40000;
  color: white;
}

.lea-hin-entry {
  border-color: #f4c62d;
  background: #f4c62d;
  color: #172018;
}

.inventory-entry-small {
  min-height: 72px;
  padding: 14px 16px;
}

.inventory-entry-small span {
  margin-bottom: 6px;
  color: inherit;
  font-size: 0.96rem;
  text-transform: none;
}

.inventory-entry-small small {
  color: currentColor;
  font-size: 0.82rem;
  opacity: 0.86;
}

#glass .inventory-panel {
  max-height: min(62vh, 620px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

#glass .inventory-panel h3 {
  position: sticky;
  top: -12px;
  z-index: 2;
  margin: -12px -12px 10px;
  padding: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-control-bar {
  position: sticky;
  top: 47px;
  z-index: 3;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.inventory-control-bar input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.inventory-control-bar button {
  min-height: 40px;
  min-width: 48px;
  white-space: nowrap;
  font-size: 1.2rem;
  line-height: 1;
}

.inventory-control-bar button.active {
  box-shadow: 0 0 0 3px rgba(35, 135, 82, 0.18);
  transform: translateY(-1px);
}

.inventory-control-bar [data-inventory-quantity-mode="add"] {
  border-color: #1f8a5b;
  background: #1f8a5b;
  color: white;
}

.inventory-history-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.inventory-history-panel .panel-header {
  align-items: flex-start;
  margin-bottom: 12px;
}

.inventory-history-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.inventory-history-list {
  display: grid;
  gap: 0;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 4px;
}

.inventory-history-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.4fr) minmax(150px, 0.7fr) 150px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 10px;
  background: #fbfcfb;
}

.inventory-history-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  border-radius: 8px 8px 0 0;
  background: #eef6f1;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.inventory-history-heading button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.inventory-history-heading button:hover,
.inventory-history-heading button:focus {
  color: var(--green);
}

.inventory-history-row + .inventory-history-row {
  border-top: 0;
}

.inventory-history-row:last-child {
  border-radius: 0 0 8px 8px;
}

.inventory-history-list strong {
  color: var(--green);
}

.inventory-history-list span {
  min-width: 0;
  font-weight: 800;
}

.inventory-history-list small {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.inventory-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inventory-chart-panel {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.inventory-chart-dashboard .inventory-chart-panel {
  min-width: 0;
  border-left: 5px solid #3b82f6;
  box-shadow: var(--shadow);
}

.inventory-chart-dashboard .pvb-chart {
  border-left-color: #16a34a;
}

.inventory-chart-dashboard .daily-chart {
  border-left-color: #f59e0b;
}

.inventory-chart-dashboard .lea-hin-chart {
  border-left-color: #0f766e;
}

.inventory-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.combined-chart .inventory-chart-header {
  align-items: flex-start;
}

.inventory-chart-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inventory-chart-selectors label,
.inventory-history-filter {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.inventory-chart-selectors select,
.inventory-history-filter select,
.inventory-history-filter input {
  min-width: 150px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  text-transform: none;
}

.lea-hin-movement-search-bar {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 14px;
}

.lea-hin-movement-search-bar label {
  display: grid;
  gap: 5px;
  width: min(100%, 520px);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lea-hin-movement-search-bar input {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  text-transform: none;
}

.inventory-chart-header h4 {
  margin: 0 0 3px;
  font-size: 0.95rem;
}

.inventory-chart-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.inventory-chart-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.inventory-chart-filters button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.inventory-chart-filters button.active {
  border-color: #1f8a5b;
  background: #1f8a5b;
  color: white;
}

.inventory-pie-layout {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.inventory-pie {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: #e9efeb;
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.72);
}

.inventory-pie.empty {
  display: grid;
  place-items: center;
  background: #e9efeb;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
}

.inventory-pie-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.inventory-pie-legend article {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 0.75rem;
}

.inventory-pie-legend article[data-pie-detail-section] {
  cursor: pointer;
}

.inventory-pie-legend article[data-pie-detail-section]:hover {
  border-color: rgba(35, 103, 209, 0.36);
  background: #f4f8fb;
}

.inventory-pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.inventory-pie-legend span {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-pie-legend strong {
  font-size: 0.76rem;
}

.inventory-chart-detail-list {
  display: grid;
  gap: 8px;
  max-height: min(62vh, 520px);
  overflow-y: auto;
}

.inventory-chart-detail-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.inventory-chart-detail-row i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.inventory-chart-detail-row span {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#glass .catalog-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 0.78rem;
}

#glass .catalog-table th,
#glass .catalog-table td {
  padding: 8px 7px;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.28;
  text-align: center;
}

#glass .catalog-table tbody tr:nth-child(even) {
  background: #f7faf7;
}

#glass .catalog-table tbody tr:nth-child(odd) {
  background: var(--surface);
}

#glass .catalog-table tbody tr:hover {
  background: #eef6f1;
}

#glass .inventory-sort-button {
  width: 100%;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

#glass .inventory-edit-button {
  min-height: 34px;
  padding: 0 12px;
  flex: 0 0 auto;
}

#glass [data-editable-inventory-cell="true"] {
  border-radius: 6px;
  cursor: default;
}

#glass [data-inventory-editing="true"] [data-editable-inventory-cell="true"] {
  cursor: text;
  background: rgba(35, 103, 209, 0.04);
}

#glass [data-inventory-editing="true"] [data-editable-inventory-cell="true"]:hover {
  background: #edf6ff;
}

#glass [data-inventory-editing="true"] [data-editable-inventory-cell="true"]:focus {
  outline: 2px solid rgba(35, 103, 209, 0.32);
  outline-offset: -2px;
  background: #f7fbff;
}

#glass .inventory-cell-control {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 4px 6px;
  font-size: 0.76rem;
  text-align: center;
}

#glass .inventory-percent-field,
#glass .inventory-number-field,
#glass .inventory-size-field {
  display: grid;
  align-items: center;
  gap: 4px;
}

#glass .inventory-size-field {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

#glass .inventory-size-field span {
  color: var(--muted);
  font-weight: 900;
}

#glass .inventory-quantity-adjuster {
  display: grid;
  grid-template-columns: auto 50px 48px;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

#glass .inventory-quantity-adjuster strong {
  min-width: 22px;
  font-size: 0.78rem;
}

#glass .inventory-quantity-adjuster input {
  width: 50px;
  min-width: 50px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: white;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

#glass .quantity-submit-button {
  min-height: 30px;
  min-width: 48px;
  padding: 4px 5px;
  font-size: 0.68rem;
  white-space: nowrap;
}

#pvbInventoryTable .inventory-quantity-adjuster {
  grid-template-columns: auto 46px 48px;
  gap: 2px;
}

#pvbInventoryTable .inventory-quantity-adjuster strong {
  min-width: 18px;
  font-size: 0.7rem;
}

#pvbInventoryTable .inventory-quantity-adjuster input {
  width: 46px;
  min-width: 46px;
  padding: 3px 4px;
  font-size: 0.68rem;
}

#pvbInventoryTable .quantity-submit-button {
  min-width: 48px;
  padding: 3px 4px;
  font-size: 0.56rem;
}

#glassInventoryTable .catalog-table th:nth-child(6) .inventory-sort-button {
  display: grid;
  gap: 2px;
}

#glassInventoryTable .catalog-table th:nth-child(6) .inventory-sort-button::after {
  content: "(L) x (H)";
  width: auto;
  height: auto;
  flex: 0 0 auto;
  border: 0;
  opacity: 1;
  transform: none;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

#glass .inventory-percent-field {
  grid-template-columns: minmax(0, 1fr) auto;
}

#glass .inventory-percent-field span {
  color: var(--muted);
  font-weight: 900;
}

#glassInventoryTable .catalog-table th:nth-child(1),
#glassInventoryTable .catalog-table td:nth-child(1) {
  width: 7%;
}

#glassInventoryTable .catalog-table th:nth-child(2),
#glassInventoryTable .catalog-table td:nth-child(2) {
  width: 11%;
}

#glassInventoryTable .catalog-table th:nth-child(3),
#glassInventoryTable .catalog-table td:nth-child(3) {
  width: 13%;
}

#glassInventoryTable .catalog-table th:nth-child(4),
#glassInventoryTable .catalog-table td:nth-child(4) {
  width: 11%;
}

#glassInventoryTable .catalog-table th:nth-child(5),
#glassInventoryTable .catalog-table td:nth-child(5) {
  width: 10%;
}

#glassInventoryTable .catalog-table th:nth-child(6),
#glassInventoryTable .catalog-table td:nth-child(6) {
  width: 19%;
}

#glassInventoryTable .catalog-table th:nth-child(7),
#glassInventoryTable .catalog-table td:nth-child(7) {
  width: 9%;
}

#glassInventoryTable .catalog-table th:nth-child(7) .inventory-sort-button {
  white-space: nowrap;
  overflow-wrap: normal;
}

#glassInventoryTable .catalog-table th:nth-child(8),
#glassInventoryTable .catalog-table td:nth-child(8) {
  width: 8%;
}

#glassInventoryTable .catalog-table th:nth-child(9),
#glassInventoryTable .catalog-table td:nth-child(9) {
  width: 11%;
}

#glassInventoryTable {
  overflow-x: auto;
  overflow-y: visible;
}

#glassInventoryTable .catalog-table {
  width: max(100%, 1320px);
  min-width: 1320px;
  table-layout: fixed;
}

#glassInventoryTable .catalog-table th,
#glassInventoryTable .catalog-table td {
  box-sizing: border-box;
  max-width: 100%;
}

#glassInventoryTable .catalog-table th:nth-child(1),
#glassInventoryTable .catalog-table td:nth-child(1) {
  width: 56px;
}

#glassInventoryTable .catalog-table th:nth-child(2),
#glassInventoryTable .catalog-table td:nth-child(2) {
  width: 150px;
}

#glassInventoryTable .catalog-table th:nth-child(3),
#glassInventoryTable .catalog-table td:nth-child(3) {
  width: 160px;
}

#glassInventoryTable .catalog-table th:nth-child(4),
#glassInventoryTable .catalog-table td:nth-child(4) {
  width: 170px;
}

#glassInventoryTable .catalog-table th:nth-child(5),
#glassInventoryTable .catalog-table td:nth-child(5) {
  width: 120px;
}

#glassInventoryTable .catalog-table th:nth-child(6),
#glassInventoryTable .catalog-table td:nth-child(6) {
  width: 180px;
}

#glassInventoryTable .catalog-table th:nth-child(7),
#glassInventoryTable .catalog-table td:nth-child(7) {
  width: 140px;
}

#glassInventoryTable .catalog-table th:nth-child(8),
#glassInventoryTable .catalog-table td:nth-child(8),
#glassInventoryTable .catalog-table th:nth-child(9),
#glassInventoryTable .catalog-table td:nth-child(9) {
  width: 110px;
}

#glassInventoryTable .catalog-table th:nth-child(10),
#glassInventoryTable .catalog-table td:nth-child(10) {
  width: 130px;
}

#glassInventoryTable .catalog-table th:nth-child(1),
#glassInventoryTable .catalog-table td:nth-child(1),
#glassInventoryTable .catalog-table th:nth-child(5),
#glassInventoryTable .catalog-table td:nth-child(5),
#glassInventoryTable .catalog-table th:nth-child(7),
#glassInventoryTable .catalog-table td:nth-child(7),
#glassInventoryTable .catalog-table th:nth-child(8),
#glassInventoryTable .catalog-table td:nth-child(8),
#glassInventoryTable .catalog-table th:nth-child(9),
#glassInventoryTable .catalog-table td:nth-child(9),
#glassInventoryTable .catalog-table th:nth-child(10),
#glassInventoryTable .catalog-table td:nth-child(10) {
  overflow-wrap: normal;
  white-space: nowrap;
}

#glassInventoryTable .catalog-table td:nth-child(2),
#glassInventoryTable .catalog-table td:nth-child(3),
#glassInventoryTable .catalog-table td:nth-child(4),
#glassInventoryTable .catalog-table td:nth-child(6) {
  overflow-wrap: anywhere;
}

#glassInventoryTable .material-stock-health {
  white-space: nowrap;
}

.goods-receipt-photo-preview-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 132px));
  gap: 10px;
  margin-top: -4px;
  align-items: start;
}

.goods-receipt-photo-thumb {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.goods-receipt-photo-thumb:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.goods-receipt-photo-image {
  appearance: none;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.goods-receipt-photo-image img,
.goods-receipt-history-photo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
  background: var(--surface-muted);
}

.goods-receipt-photo-thumb span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goods-receipt-photo-thumb .ghost-button {
  width: 100%;
  margin-top: 6px;
  justify-content: center;
}

.goods-receipt-history-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.goods-receipt-history-photo {
  appearance: none;
  width: 88px;
  min-width: 88px;
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
  background: #fff;
  cursor: zoom-in;
}

.goods-receipt-photo-count {
  color: var(--accent);
  font-weight: 800;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.goods-receipt-preview-large {
  margin: 0;
  padding: 16px;
  background: var(--surface);
}

.goods-receipt-preview-large img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #111827;
}

#pvbInventoryTable .catalog-table th:nth-child(1),
#pvbInventoryTable .catalog-table td:nth-child(1) {
  width: 7%;
}

#pvbInventoryTable .catalog-table th:nth-child(2),
#pvbInventoryTable .catalog-table td:nth-child(2) {
  width: 13%;
}

#pvbInventoryTable .catalog-table th:nth-child(3),
#pvbInventoryTable .catalog-table td:nth-child(3) {
  width: 12%;
}

#pvbInventoryTable .catalog-table th:nth-child(4),
#pvbInventoryTable .catalog-table td:nth-child(4) {
  width: 12%;
}

#pvbInventoryTable .catalog-table th:nth-child(5),
#pvbInventoryTable .catalog-table td:nth-child(5) {
  width: 12%;
}

#pvbInventoryTable .catalog-table th:nth-child(6),
#pvbInventoryTable .catalog-table td:nth-child(6) {
  width: 11%;
}

#pvbInventoryTable .catalog-table th:nth-child(7),
#pvbInventoryTable .catalog-table td:nth-child(7) {
  width: 16%;
}

#pvbInventoryTable .catalog-table th:nth-child(8),
#pvbInventoryTable .catalog-table td:nth-child(8) {
  width: 18%;
}

#pvbInventoryTable .catalog-table td:nth-child(7),
#pvbInventoryTable .catalog-table td:nth-child(8) {
  padding-left: 4px;
  padding-right: 4px;
}

#dailyGlassCuttingTable .catalog-table th:nth-child(1),
#dailyGlassCuttingTable .catalog-table td:nth-child(1) {
  width: 8%;
}

#dailyGlassCuttingTable .catalog-table th:nth-child(2),
#dailyGlassCuttingTable .catalog-table td:nth-child(2) {
  width: 14%;
}

#dailyGlassCuttingTable .catalog-table th:nth-child(3),
#dailyGlassCuttingTable .catalog-table td:nth-child(3) {
  width: 18%;
}

#dailyGlassCuttingTable .catalog-table th:nth-child(4),
#dailyGlassCuttingTable .catalog-table td:nth-child(4) {
  width: 18%;
}

#dailyGlassCuttingTable .catalog-table th:nth-child(5),
#dailyGlassCuttingTable .catalog-table td:nth-child(5) {
  width: 25%;
}

#dailyGlassCuttingTable .catalog-table th:nth-child(6),
#dailyGlassCuttingTable .catalog-table td:nth-child(6) {
  width: 17%;
  padding-left: 4px;
  padding-right: 4px;
}

.daily-cutting-entry-controls {
  display: grid;
  grid-template-columns: minmax(54px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

#dailyGlassCuttingTable select.inventory-cell-control {
  min-width: 0;
}

#dailyGlassCuttingTable [data-daily-delete] {
  min-width: 72px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.sort-button::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.35;
  transform: rotate(45deg);
}

.sort-button[data-direction="asc"]::after {
  opacity: 1;
  transform: rotate(225deg);
}

.sort-button[data-direction="desc"]::after {
  opacity: 1;
  transform: rotate(45deg);
}

.sort-button:hover,
.sort-button:focus-visible {
  color: var(--primary);
}

.asset-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.asset-sort-button::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.45;
  transform: rotate(45deg);
}

.asset-sort-button[data-direction="asc"]::after {
  opacity: 1;
  transform: rotate(225deg);
}

.asset-sort-button[data-direction="desc"]::after {
  opacity: 1;
  transform: rotate(45deg);
}

.part-image-cell {
  width: 118px;
}

.part-thumb {
  width: 76px;
  height: 56px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(31, 138, 91, 0.16), rgba(35, 103, 209, 0.16)),
    var(--surface-2);
  background-size: cover;
  background-position: center;
}

.part-thumb.has-image {
  background-color: var(--surface);
}

.stock-cell-value {
  display: inline-block;
  min-width: 28px;
  margin-right: 6px;
  font-weight: 900;
}

.stock-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eaf6ef;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.stock-status.low {
  background: #fff0df;
  color: #b65b00;
}

.stock-status.ok {
  background: #eaf6ef;
  color: var(--green);
}

.part-upload {
  margin: 7px 0 0;
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.76rem;
}

.linked-equipment {
  border: 0;
  border-radius: 7px;
  padding: 6px 8px;
  background: var(--surface-2);
  color: var(--green);
  font-weight: 800;
  font-size: 0.82rem;
}

#equipmentDialog,
#partDialog,
#purchaseRequestDialog,
#supplierDialog,
#orderDialog,
#leaHinFinishedGoodDetailsDialog,
dialog.record-modal {
  width: min(95vw, 1800px);
  height: 90vh;
  max-width: none;
  max-height: 90vh;
  overflow: hidden;
}

dialog.record-modal {
  width: min(95vw, 1800px) !important;
  max-width: min(95vw, 1800px) !important;
  height: 90vh !important;
  max-height: 90vh !important;
  padding: 0;
  overflow: hidden;
}

.record-modal-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.record-modal-header {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  z-index: 20;
}

.record-modal-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  box-sizing: border-box;
}

.record-modal-body *,
.record-modal-shell * {
  box-sizing: border-box;
}

.record-modal-body img,
.record-modal-body video,
.record-modal-body canvas,
.record-modal-body svg {
  max-width: 100%;
}

.record-modal-body table,
.record-modal-body .catalog-table,
.record-modal-body .equipment-import-table {
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

.record-modal-body .table-wrap,
.record-modal-body .equipment-import-table-wrap,
.record-modal-body .debug-table-wrap {
  max-width: 100%;
  overflow-x: hidden;
}

.record-modal-footer {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

#equipmentImportDialog,
#certificationDialog,
#calendarDateDialog,
#calendarMonthDialog,
#subCalendarDialog,
#locationDialog,
#floorItemDialog,
#approvalRequestDialog,
#leaHinAllocationActionDialog,
#leaHinMovementDetailsDialog,
#leaHinAdjustmentMetadataDialog,
#leaHinAdjustmentDialog {
  width: min(75vw, 1200px);
  height: 80vh;
  max-width: none;
  max-height: 80vh;
  overflow: hidden;
}

#certificationDialog .equipment-profile {
  padding: 18px;
}

.certification-profile-header {
  margin-bottom: 14px;
}

.certification-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.certification-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.certification-media-grid .image-upload {
  margin-bottom: 0;
}

.certification-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.certification-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.certification-edit-form .profile-actions {
  grid-column: 1 / -1;
}

#imagePreviewDialog {
  width: min(1120px, calc(100vw - 36px));
  max-width: none;
}

.image-preview-dialog {
  padding: 18px;
}

.image-preview-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.equipment-profile {
  padding: 20px;
}

.equipment-import-profile {
  padding: 20px;
}

.equipment-import-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f0;
  margin-bottom: 12px;
}

.equipment-import-summary span {
  color: var(--muted);
  font-weight: 700;
}

.equipment-import-debug {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.equipment-import-debug section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.equipment-import-debug h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.equipment-import-debug p {
  margin: 0;
  font-weight: 800;
}

.equipment-import-header-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.equipment-import-header-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--surface);
  font-weight: 700;
}

.debug-table-wrap {
  max-height: 220px;
}

.equipment-import-errors {
  border: 1px solid #f5c2bd;
  border-radius: 8px;
  background: #fff5f3;
  color: #912018;
  padding: 12px;
  margin-bottom: 12px;
}

.equipment-import-errors h3 {
  margin: 0 0 8px;
}

.equipment-import-errors ul {
  margin: 0;
  padding-left: 18px;
}

.equipment-import-table-wrap {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.equipment-import-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.equipment-import-table th,
.equipment-import-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.equipment-import-table th {
  position: sticky;
  top: 0;
  background: #eef5f0;
  color: var(--muted);
  font-weight: 800;
}

.equipment-import-table tr.invalid td {
  background: #fff5f3;
  color: #912018;
}

.equipment-profile-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.equipment-glance-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: stretch;
  gap: 8px;
  margin: 0 0 14px;
}

.equipment-glance-card,
.equipment-glance-risk {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.equipment-glance-card span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.equipment-glance-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.equipment-glance-risk {
  display: grid;
  place-items: center;
}

.badge.warning {
  background: #fff1cf;
  color: #8a5a00;
}

.equipment-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.equipment-static-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.equipment-static-panel h3 {
  margin: 0 0 10px;
}

.equipment-profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 30fr) minmax(0, 40fr) minmax(240px, 30fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

#equipmentDialog .equipment-profile-layout > div:nth-child(2) {
  grid-column: span 2;
}

.equipment-profile-image {
  max-width: 100%;
  min-height: 320px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.55) 48% 52%, transparent 52%),
    linear-gradient(135deg, #d9efe4, #dbe7fb);
  background-size: cover;
  background-position: center;
}

.part-entry {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green);
  font-weight: 900;
  text-align: left;
}

.catalog-row {
  cursor: pointer;
}

.catalog-row:hover {
  background: #fbfcfb;
}

.invoice-preview {
  display: grid;
  min-height: 320px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(31, 138, 91, 0.12), rgba(35, 103, 209, 0.12)),
    var(--surface-2);
  background-size: cover;
  background-position: center;
  color: var(--muted);
  font-weight: 800;
}

.equipment-field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.equipment-field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.equipment-field.full {
  grid-column: 1 / -1;
}

.equipment-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.equipment-field strong {
  display: block;
  line-height: 1.4;
}

.equipment-form {
  display: grid;
  gap: 10px;
}

.equipment-form label,
.equipment-form .form-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.equipment-form input,
.equipment-form select,
.equipment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 600;
  text-transform: none;
}

.equipment-form textarea {
  min-height: 104px;
  resize: vertical;
}

.part-stock-panel {
  margin-top: 14px;
  padding: 14px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.purchase-request-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.replenishment-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.replenishment-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.replenishment-summary article {
  padding: 10px 12px;
  border: 1px solid #dfe7e2;
  border-radius: 8px;
  background: #fbfcfb;
}

.replenishment-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.replenishment-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 1.25rem;
}

.replenishment-note {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px dashed #cbd9d0;
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.replenishment-table-wrap {
  overflow-x: auto;
}

.replenishment-table {
  min-width: 1980px;
  table-layout: fixed;
}

.replenishment-table th,
.replenishment-table td {
  vertical-align: top;
}

.replenishment-table th:nth-child(1),
.replenishment-table td:nth-child(1) {
  width: 190px;
}

.replenishment-table th:nth-child(3),
.replenishment-table td:nth-child(3),
.replenishment-table th:nth-child(4),
.replenishment-table td:nth-child(4),
.replenishment-table th:nth-child(5),
.replenishment-table td:nth-child(5),
.replenishment-table th:nth-child(6),
.replenishment-table td:nth-child(6),
.replenishment-table th:nth-child(7),
.replenishment-table td:nth-child(7),
.replenishment-table th:nth-child(13),
.replenishment-table td:nth-child(13),
.replenishment-table th:nth-child(14),
.replenishment-table td:nth-child(14),
.replenishment-table th:nth-child(15),
.replenishment-table td:nth-child(15) {
  width: 105px;
}

.replenishment-table td strong,
.replenishment-table td small {
  display: block;
}

.replenishment-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.replenishment-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.replenishment-no-action {
  color: #59656f;
}

.purchase-request-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.purchase-request-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fbfcfd;
}

.mr-card-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 0.8fr) minmax(160px, 0.8fr) minmax(180px, auto);
  gap: 10px;
  align-items: center;
}

.mr-card-summary strong,
.mr-card-summary span,
.mr-card-summary small,
.purchase-request-actions small {
  display: block;
}

.mr-card-summary small,
.purchase-request-actions small {
  color: var(--muted);
  font-size: 0.82rem;
}

.mr-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.mr-status-draft {
  border-color: #d9dee3;
  background: #eef1f4;
  color: #4b5563;
}

.mr-status-submitted {
  border-color: #b6d6ff;
  background: #e9f3ff;
  color: #15549a;
}

.mr-status-approved,
.mr-status-fulfilled {
  border-color: #bfe6ce;
  background: #eaf7f0;
  color: #17643a;
}

.mr-status-pending-fulfilment,
.mr-status-partially-received {
  border-color: #f2cf8c;
  background: #fff4dc;
  color: #8a5a00;
}

.mr-status-closed {
  border-color: #c8cdd3;
  background: #dfe3e8;
  color: #303842;
}

.mr-status-cancelled {
  border-color: #f3b6b6;
  background: #fdeaea;
  color: #9c1c1c;
}

.mr-status-archived {
  border-color: #e4e7eb;
  background: #f6f7f8;
  color: #65717d;
}

.mr-workflow-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5ece8;
  border-radius: 8px;
  background: #f8faf9;
}

.mr-workflow-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mr-workflow-summary strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: none;
  overflow-wrap: anywhere;
}

.mr-workflow-summary .mr-overdue strong {
  color: #9c1c1c;
}

.mr-ui-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mr-ui-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #dce5df;
  border-radius: 999px;
  background: #f8faf9;
  color: #405046;
  font-size: 0.76rem;
  font-weight: 800;
}

.mr-lifecycle-tracker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1px dashed #dce5df;
  border-radius: 8px;
  background: #fff;
}

.mr-lifecycle-tracker span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #64707a;
  font-size: 0.76rem;
  font-weight: 800;
}

.mr-lifecycle-tracker span.complete {
  background: #eaf7f0;
  color: #17643a;
}

.mr-lifecycle-tracker span.current {
  box-shadow: inset 0 0 0 2px #16864f;
}

.mr-lifecycle-tracker.cancelled span.terminal {
  background: #fdeaea;
  color: #9c1c1c;
}

.mr-lifecycle-tracker.archived span.terminal {
  background: #f6f7f8;
  color: #65717d;
}

.mr-cancellation-details,
.mr-lifecycle-timeline {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mr-cancellation-details {
  border-color: #f3c4c4;
  background: #fff7f7;
}

.mr-cancellation-details > strong,
.mr-lifecycle-timeline > strong {
  display: block;
  margin-bottom: 8px;
}

.mr-cancellation-details dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.mr-cancellation-details dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mr-cancellation-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.mr-lifecycle-timeline {
  display: grid;
  gap: 8px;
}

.mr-lifecycle-event {
  position: relative;
  display: grid;
  grid-template-columns: minmax(135px, 0.45fr) minmax(160px, 1fr);
  gap: 4px 10px;
  padding-left: 14px;
}

.mr-lifecycle-event::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #16864f;
}

.mr-lifecycle-event time {
  color: var(--muted);
  font-size: 0.82rem;
}

.mr-lifecycle-event span {
  font-weight: 700;
}

.mr-lifecycle-event small {
  grid-column: 2;
  color: var(--muted);
}

@media (max-width: 900px) {
  .mr-card-summary,
  .mr-workflow-summary,
  .mr-cancellation-details dl,
  .mr-lifecycle-event {
    grid-template-columns: 1fr;
  }

  .mr-lifecycle-event small {
    grid-column: 1;
  }
}

.lea-hin-allocation-item-option {
  justify-content: flex-start;
  text-align: left;
  border: 1px solid #dfe7e2;
}

.lea-hin-allocation-item-option.selected {
  border-color: #16864f;
  background: #eaf7f0;
  color: #0f5132;
  box-shadow: inset 4px 0 0 #16864f;
}

.lea-hin-allocation-item-option.selected::before {
  content: "✓";
  margin-right: 8px;
  font-weight: 800;
}

.lea-hin-clear-selection {
  margin-left: 10px;
}

.lea-hin-impact-panel,
.lea-hin-warning-banner,
.lea-hin-photo-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.lea-hin-warning-banner {
  border-color: #f0c96d;
  background: #fff8e6;
  color: #6d4a00;
}

.lea-hin-warning-banner p,
.lea-hin-warning-banner ul {
  margin: 6px 0 0;
}

.lea-hin-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lea-hin-impact-grid section {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #dfe7e2;
  border-radius: 8px;
  background: #fff;
}

.lea-hin-impact-grid h4,
.lea-hin-impact-grid span {
  margin: 0;
}

.lea-hin-upload-grid,
.lea-hin-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.lea-hin-upload-card,
.lea-hin-attachment-card,
.lea-hin-audit-card,
.lea-hin-success-reference {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dfe7e2;
  border-radius: 8px;
  background: #fff;
}

.lea-hin-upload-card {
  cursor: pointer;
}

.lea-hin-upload-card.uploaded {
  border-color: #16864f;
  background: #eaf7f0;
}

.lea-hin-upload-card.uploaded strong::before {
  content: "✓ ";
}

.lea-hin-upload-card input {
  font-size: 0.82rem;
}

.lea-hin-supporting-docs {
  margin-top: 10px;
}

.lea-hin-attachment-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  color: #166534;
}

.lea-hin-movement-details {
  max-width: 880px;
}

.lea-hin-movement-header {
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.lea-hin-movement-subtitle {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.lea-hin-fg-header-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.lea-hin-fg-header-facts strong {
  color: var(--ink);
}

.lea-hin-fg-summary-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 0;
}

.lea-hin-fg-summary-panel label {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  background: #f8fbff;
}

.lea-hin-fg-summary-panel span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lea-hin-info-card-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lea-hin-info-card {
  padding: 12px;
  border: 1px solid #dfe7e2;
  border-radius: 8px;
  background: #fff;
}

.lea-hin-info-card h5 {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.lea-hin-info-card-grid {
  display: grid;
  gap: 8px;
}

.lea-hin-info-card-grid div {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: baseline;
}

.lea-hin-info-card-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.lea-hin-info-card-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lea-hin-movement-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  background: var(--ds-neutral-bg);
  color: var(--ds-neutral-text);
}

.lea-hin-movement-type-badge.stock-in {
  background: var(--ds-success-bg);
  color: var(--ds-success-text);
}

.lea-hin-movement-type-badge.stock-out {
  background: var(--ds-danger-bg);
  color: var(--ds-danger-text);
}

.lea-hin-movement-type-badge.adjustment {
  background: var(--ds-warning-bg);
  color: var(--ds-warning-text);
}

.lea-hin-movement-type-badge.transfer {
  background: #e0f2fe;
  color: #075985;
}

.lea-hin-reference-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1d4ed8;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .lea-hin-fg-summary-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lea-hin-info-card-layout {
    grid-template-columns: 1fr;
  }
}

.lea-hin-detail-section {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dfe7e2;
  border-radius: 8px;
  background: #fbfcfb;
}

.lea-hin-detail-section h4 {
  margin: 0;
  font-size: 0.95rem;
}

.lea-hin-remarks-box {
  min-height: 54px;
  margin: 0;
  padding: 10px;
  border: 1px solid #dfe7e2;
  border-radius: 8px;
  background: #fff;
  white-space: pre-wrap;
}

.lea-hin-claim-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #edf2f7;
  color: #334155;
}

.lea-hin-claim-badge.status-pending {
  background: #fff3cd;
  color: #7a4b00;
}

.lea-hin-claim-badge.status-submitted {
  background: #dbeafe;
  color: #1d4ed8;
}

.lea-hin-claim-badge.status-approved {
  background: #dcfce7;
  color: #166534;
}

.lea-hin-claim-badge.status-replaced {
  background: #e0f2fe;
  color: #0369a1;
}

.lea-hin-claim-badge.status-credited {
  background: #ede9fe;
  color: #6d28d9;
}

.lea-hin-claim-badge.status-closed {
  background: #e5e7eb;
  color: #374151;
}

.lea-hin-attachment-card {
  color: inherit;
  text-decoration: none;
}

.lea-hin-attachment-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.lea-hin-audit-list {
  display: grid;
  gap: 8px;
}

.lea-hin-audit-card small {
  word-break: break-word;
}

.lea-hin-success-reference {
  margin: 12px 0;
  background: #eaf7f0;
  border-color: #16864f;
}

.lea-hin-success-reference span,
.lea-hin-success-reference strong {
  display: block;
}

.muted-text {
  color: var(--muted);
}

.purchase-request-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.9fr) minmax(120px, 0.6fr) minmax(220px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fbfcfd;
}

.purchase-request-row strong,
.purchase-request-row span,
.purchase-request-row small {
  display: block;
}

.purchase-request-row small {
  color: var(--muted);
  font-size: 0.82rem;
}

.purchase-request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.compact-action {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.purchase-request-form {
  margin-top: 14px;
}

.purchase-request-audit {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.purchase-request-audit h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.purchase-request-audit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.purchase-request-audit article {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.purchase-request-audit span,
.purchase-request-audit small,
.purchase-request-audit em {
  color: var(--muted);
  font-style: normal;
  overflow-wrap: anywhere;
}

.part-stock-panel .panel-header.compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.part-stock-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.part-stock-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.part-stock-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.part-stock-summary article {
  border: 1px solid var(--line);
  border-radius: var(--ds-radius);
  padding: 12px;
  background: #fbfcfb;
}

.part-stock-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.part-stock-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
}

.part-stock-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 10px;
  align-items: end;
  min-width: 0;
  max-width: 100%;
}

.part-stock-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.part-stock-form input,
.part-stock-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-transform: none;
}

.part-stock-form-error {
  border: 1px solid var(--ds-danger-text);
  border-radius: var(--ds-radius);
  padding: 10px 12px;
  background: var(--ds-danger-bg);
  color: var(--ds-danger-text);
  font-size: 0.86rem;
  font-weight: 800;
}

.part-movement-history {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  max-width: 100%;
}

.part-movement-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) auto minmax(120px, 0.65fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.part-movement-row strong,
.part-movement-row span,
.part-movement-row small {
  display: block;
}

.part-movement-row span,
.part-movement-row small {
  color: var(--muted);
  font-size: 0.82rem;
}

.part-movement-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--ds-neutral-bg);
  color: var(--ds-neutral-text);
  font-size: 0.76rem;
  font-weight: 900;
}

.part-movement-type.return,
.part-movement-type.initial,
.part-movement-type.goods-receipt {
  background: var(--ds-success-bg);
  color: var(--ds-success-text);
}

.part-movement-type.issue,
.part-movement-type.work_order_consumption {
  background: var(--ds-danger-bg);
  color: var(--ds-danger-text);
}

.part-movement-type.adjustment {
  background: var(--ds-warning-bg);
  color: var(--ds-warning-text);
}

.movement-qty {
  min-width: 56px;
  border-radius: 999px;
  padding: 5px 9px;
  text-align: center;
  font-weight: 900;
}

.movement-qty.in {
  background: #eaf6ef;
  color: var(--green);
}

.movement-qty.out {
  background: #fff0df;
  color: #b65b00;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.profile-actions .danger-button {
  margin-right: auto;
}

.link-picker {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fbfcfb;
}

.link-picker input[type="search"] {
  flex: 1;
  min-width: 180px;
  border: 0;
  padding: 6px;
  background: transparent;
  outline: 0;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 7px;
  padding: 0 9px;
  background: var(--blue);
  color: white;
  font-size: 0.82rem;
  font-weight: 900;
}

.work-order-part-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.task-readonly-parts {
  display: grid;
  gap: 8px;
}

.work-order-part-row.readonly {
  grid-template-columns: minmax(160px, 1fr) auto;
  background: #fbfcfb;
}

.work-order-part-name {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.work-order-part-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.work-order-part-row input[type="number"] {
  width: 72px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 7px;
  color: var(--ink);
  background: #fbfcfb;
}

.work-order-part-row .secondary-button {
  min-height: 32px;
  padding: 6px 10px;
}

.work-order-completion-form {
  max-width: min(75vw, 980px);
}

.completion-consumption-summary {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.completion-consumption-list {
  display: grid;
  gap: 8px;
}

.completion-consumption-emergency {
  display: grid;
  gap: 10px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.inline-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.completion-consumption-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px 120px 42px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.completion-consumption-row strong,
.completion-consumption-row span {
  min-width: 0;
}

.completion-consumption-row input[type="number"] {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  background: #fbfcfb;
}

.completion-consumption-add {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.completion-consumption-add[hidden] {
  display: none !important;
}

.completion-part-autocomplete {
  position: relative;
  display: grid;
  gap: 6px;
}

.completion-part-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(18, 37, 28, 0.16);
}

.completion-part-results[hidden] {
  display: none !important;
}

.completion-part-result {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.completion-part-result:hover,
.completion-part-result:focus {
  background: #edf5ef;
  outline: none;
}

.completion-part-result strong {
  font-size: 0.86rem;
}

.completion-part-result span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

@media (max-width: 900px) {
  .completion-consumption-row,
  .completion-consumption-add {
    grid-template-columns: 1fr;
  }
}

.suggestion-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  max-height: 190px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.suggestion-menu.active {
  display: grid;
  gap: 4px;
}

.suggestion-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 7px 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.suggestion-menu button:hover {
  background: var(--surface-2);
}

.spare-part-supplier-fieldset {
  min-width: 0;
  margin: 4px 0 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}

.spare-part-supplier-fieldset legend {
  padding: 0 5px;
  color: var(--ink);
  font-weight: 900;
}

.field-help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.stage8f-migration-note {
  margin: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff3d6;
  color: #7a5412;
  font-size: 0.8rem;
  font-weight: 800;
}

.spare-part-supplier-editor {
  position: relative;
  display: grid;
  gap: 9px;
}

.spare-part-supplier-results {
  top: 67px;
}

.spare-part-supplier-results button,
.spare-part-supplier-results button small {
  display: block;
}

.spare-part-supplier-results button small {
  margin-top: 3px;
  color: var(--muted);
}

.spare-part-supplier-selections {
  display: grid;
  gap: 7px;
}

.spare-part-supplier-selection {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.spare-part-supplier-selection label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.supplier-link-name {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 900;
  cursor: pointer;
}

.spare-part-supplier-selection small {
  color: var(--muted);
}

.primary-supplier-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 6px;
  background: #dff5e7;
  color: #17643a;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .spare-part-supplier-selection {
    grid-template-columns: 1fr auto;
  }

  .spare-part-supplier-selection small {
    grid-column: 1 / -1;
  }
}

.equipment-linked {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.equipment-parent-back-button {
  margin-top: 8px;
}

.equipment-linked h3 {
  margin-bottom: 10px;
}

.equipment-linked .tag-list button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.equipment-subassets-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.equipment-subassets-panel h3 {
  margin: 0 0 12px;
}

.equipment-subasset-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 10px;
}

.equipment-subasset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.equipment-subasset-thumb {
  display: grid;
  place-items: center;
  flex: 0 0 72px;
  width: 72px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.55) 48% 52%, transparent 52%),
    linear-gradient(135deg, #d9efe4, #dbe7fb);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.equipment-subasset-thumb.has-image {
  background: #fff;
}

.equipment-subasset-thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
}

.equipment-subasset-summary {
  min-width: 0;
  flex: 1;
}

.equipment-subasset-card.has-children {
  border-color: rgba(21, 101, 72, 0.35);
  background: #eef7f1;
  box-shadow: inset 4px 0 0 var(--green);
  cursor: pointer;
}

.equipment-subasset-card.has-children:hover {
  border-color: var(--green);
  background: #e5f2eb;
}

.equipment-subasset-card strong,
.equipment-subasset-card span {
  display: block;
}

.equipment-subasset-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.equipment-subasset-card .subasset-child-count {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 7px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #dcefe5;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.subasset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.equipment-history-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.equipment-history-panel h3 {
  margin: 0 0 12px;
}

.equipment-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.equipment-history-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.equipment-history-grid h4 {
  margin: 0 0 8px;
}

.equipment-history-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.equipment-history-grid li {
  display: grid;
  gap: 3px;
  border-radius: 6px;
  background: var(--surface);
  padding: 8px;
}

.equipment-history-grid li span,
.equipment-history-grid li small,
.equipment-history-grid .muted-history {
  color: var(--muted);
}

.equipment-pm-history-panel {
  margin-top: 16px;
}

.equipment-pm-history-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.equipment-pm-history-row {
  display: grid;
  grid-template-columns: 0.75fr 1.35fr 1.25fr 0.9fr 0.75fr 1.2fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.equipment-pm-history-row:last-child {
  border-bottom: 0;
}

.equipment-pm-history-row.header {
  background: #eef5f0;
  color: var(--muted);
  font-weight: 800;
}

.calendar-board,
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

#maintenanceChecklistGrid {
  display: block;
}

.checklist-workspace {
  display: grid;
  gap: 14px;
}

.checklist-workflow-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.checklist-workflow-hero h3,
.checklist-workflow-hero p {
  margin: 0;
}

.checklist-workflow-hero p {
  margin-top: 4px;
  color: var(--muted);
}

.checklist-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: #eef5f0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checklist-tab {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.checklist-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.checklist-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.operator-due-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.operator-due-card {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #eef5f0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.operator-due-card.overdue {
  background: #fff5f3;
  border-color: #f5c2bd;
}

.operator-due-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.checklist-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  background: #eef5f0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checklist-filter-bar label {
  font-weight: 800;
}

.checklist-filter-bar select,
.checklist-filter-bar input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface);
}

.checklist-auto-load-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef5f0;
  color: var(--muted);
  font-weight: 700;
}

.checklist-kpi-grid article,
.checklist-workspace-panel,
.checklist-review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.checklist-kpi-grid article {
  padding: 16px;
}

.checklist-kpi-grid span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.checklist-kpi-grid strong {
  display: block;
  font-size: 1.9rem;
}

.checklist-workspace-panel {
  padding: 16px;
}

.checklist-template-form {
  display: grid;
  gap: 12px;
}

.checklist-template-form label,
.checklist-submission-form label {
  display: block;
  font-weight: 700;
}

.checklist-template-form input,
.checklist-template-form select,
.checklist-template-form textarea,
.checklist-submission-form input,
.checklist-submission-form select,
.checklist-submission-form textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.checklist-template-form textarea,
.checklist-submission-form textarea {
  min-height: 86px;
  resize: vertical;
}

.checklist-template-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.compact {
  min-height: 34px;
  padding: 8px 10px;
}

.danger-button.compact {
  background: #fef3f2;
  color: #b42318;
}

.checklist-submission-items {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.checklist-answer-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.checklist-answer-row legend {
  padding: 0 6px;
  font-weight: 800;
}

.pass-fail-toggle {
  display: flex;
  gap: 12px;
  margin: 8px 0;
}

.pass-fail-toggle label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.task-pm-checklist-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.task-pm-checklist-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.task-pm-checklist-header h3,
.task-pm-checklist-header p {
  margin: 0;
}

.task-pm-checklist-header p {
  margin-top: 4px;
  color: var(--muted);
}

.task-pm-checklist-items {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.pm-calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pm-calendar-grid {
  display: grid;
  gap: 12px;
}

.checklist-table.pm-calendar-table .checklist-table-row {
  grid-template-columns: 0.8fr 1.3fr 1.4fr 0.8fr;
}

.checklist-table.pm-calendar-table.has-actions .checklist-table-row {
  grid-template-columns: 0.75fr 1.2fr 1.25fr 0.75fr auto;
}

.compact-upload {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
}

.checklist-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.checklist-table-row {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.5fr 0.9fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.checklist-table.history .checklist-table-row {
  grid-template-columns: 0.8fr 1.2fr 0.8fr 1fr 0.8fr 0.6fr;
}

.checklist-table.due .checklist-table-row {
  grid-template-columns: 1fr 1.2fr 0.8fr 0.8fr 1fr;
}

.checklist-table-row:last-child {
  border-bottom: 0;
}

.checklist-table-row.header {
  background: #eef5f0;
  font-weight: 800;
  color: var(--muted);
}

.checklist-review-card {
  padding: 14px;
  margin-bottom: 12px;
}

.checklist-review-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.checklist-review-card h3,
.checklist-review-card p {
  margin: 0;
}

.factory-floor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-height: auto;
}

.inventory-floor-shell {
  grid-template-columns: minmax(0, 1fr);
}

.factory-inventory-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.inventory-floor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.inventory-floor-toolbar h3 {
  margin-bottom: 4px;
}

.inventory-floor-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
}

.factory-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.factory-zoom-controls .secondary-button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.factory-zoom-controls .secondary-button.active {
  background: #dff3e8;
  color: var(--green);
}

.factory-inventory-scene {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0;
}

.factory-inventory-scene .glass-factory-plan {
  margin-top: 34px;
  margin-bottom: 58px;
  transform: translateX(var(--factory-plan-offset-x, 0px)) scale(var(--inventory-factory-fit-scale, 1));
}

.factory-inventory-scene .floor-resize-handle {
  display: none;
}

.factory-scene {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34, 125, 79, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(35, 103, 209, 0.08), transparent 36%),
    #f7faf8;
  box-shadow: var(--shadow);
  perspective: 1200px;
}

.factory-floor-plane {
  position: relative;
  width: min(1120px, 100%);
  min-width: 920px;
  height: 650px;
  margin: 34px auto 58px;
  transform: rotateX(58deg) rotateZ(-34deg);
  transform-style: preserve-3d;
  background:
    linear-gradient(rgba(22, 44, 34, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 44, 34, 0.08) 1px, transparent 1px),
    #eef4ef;
  background-size: 42px 42px;
  border: 2px solid #d8e2dc;
  border-radius: 8px;
  box-shadow: 34px 46px 32px rgba(19, 40, 30, 0.18);
}

.floor-zone,
.floor-aisle,
.floor-equipment {
  position: absolute;
  transform-style: preserve-3d;
}

.floor-zone {
  border: 1px solid rgba(18, 37, 28, 0.2);
  border-radius: 8px;
  background: var(--zone-color);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.floor-zone > span {
  position: absolute;
  top: 10px;
  left: 12px;
  color: rgba(18, 37, 28, 0.82);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  transform: translateZ(12px);
}

.zone-packaging {
  --zone-color: rgba(79, 128, 189, 0.24);
  left: 42px;
  top: 42px;
  width: 520px;
  height: 176px;
}

.zone-filling {
  --zone-color: rgba(0, 176, 80, 0.22);
  left: 606px;
  top: 42px;
  width: 260px;
  height: 176px;
}

.zone-processing {
  --zone-color: rgba(245, 130, 32, 0.22);
  left: 606px;
  top: 282px;
  width: 260px;
  height: 210px;
}

.zone-dispatch {
  --zone-color: rgba(112, 48, 160, 0.18);
  left: 42px;
  top: 442px;
  width: 520px;
  height: 150px;
}

.zone-utilities {
  --zone-color: rgba(102, 102, 102, 0.16);
  left: 904px;
  top: 42px;
  width: 174px;
  height: 450px;
}

.floor-aisle {
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(18, 37, 28, 0.24);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  transform: translateZ(6px);
}

.aisle-main {
  left: 42px;
  top: 250px;
  width: 824px;
  height: 72px;
}

.aisle-service {
  left: 884px;
  top: 42px;
  width: 14px;
  height: 450px;
  writing-mode: vertical-rl;
}

.floor-equipment {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 7px 10px;
  background: var(--equipment-color, #217d4f);
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow:
    0 10px 0 color-mix(in srgb, var(--equipment-color, #217d4f) 72%, #0e2018),
    8px 14px 14px rgba(18, 37, 28, 0.2);
  cursor: pointer;
  transform: translateZ(40px);
}

.floor-equipment:hover,
.floor-equipment:focus,
.floor-equipment.located {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.floor-equipment.located {
  filter: brightness(1.15);
  box-shadow:
    0 10px 0 color-mix(in srgb, var(--equipment-color, #217d4f) 72%, #0e2018),
    0 0 0 8px rgba(255, 255, 255, 0.55),
    12px 20px 18px rgba(18, 37, 28, 0.28);
}

.floor-equipment.located::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -58px;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  background: #16a34a;
  box-shadow:
    0 11px 0 #0f7a37,
    0 18px 24px rgba(15, 122, 55, 0.34);
  transform: translateX(-50%) rotate(-45deg) skew(-8deg, -8deg);
}

.floor-equipment.located::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -47px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 11px 0 rgba(255, 255, 255, 0.42);
  transform: translateX(-50%);
}

.conveyor-unit {
  --equipment-color: #2367d1;
  left: 58px;
  top: 74px;
  width: 300px;
}

.labeler-unit {
  --equipment-color: #4f80bd;
  left: 382px;
  top: 128px;
  width: 110px;
}

.filler-unit {
  --equipment-color: #008f4a;
  left: 42px;
  top: 86px;
  width: 160px;
}

.mixer-unit {
  --equipment-color: #d16b13;
  left: 58px;
  top: 82px;
  width: 142px;
}

.palletizer-unit {
  --equipment-color: #7030a0;
  left: 330px;
  top: 58px;
  width: 150px;
}

.air-unit {
  --equipment-color: #666666;
  left: 28px;
  top: 70px;
  width: 118px;
}

.chiller-unit {
  --equipment-color: #00a2e8;
  left: 28px;
  top: 184px;
  width: 118px;
}

.pump-unit {
  --equipment-color: #c00000;
  left: 28px;
  top: 318px;
  width: 118px;
}

.glass-factory-plan {
  width: 1120px;
  height: 660px;
  min-width: 1120px;
  margin: 30px auto 64px;
  transform: rotateX(48deg) rotateZ(-8deg);
  background:
    linear-gradient(rgba(22, 44, 34, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 44, 34, 0.06) 1px, transparent 1px),
    #f8fbf8;
  background-size: 40px 40px;
  border-color: #cfdad2;
}

.plan-outline {
  position: absolute;
  inset: 18px 20px 74px 18px;
  border: 3px solid rgba(18, 37, 28, 0.48);
  border-radius: 6px 90px 10px 6px;
  clip-path: polygon(0 0, 63% 0, 63% 11%, 84% 11%, 94% 22%, 100% 37%, 98% 37%, 98% 79%, 94% 79%, 94% 100%, 0 100%);
  pointer-events: none;
}

.plan-block,
.plan-triangle,
.plan-zone-label {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
  transform-style: preserve-3d;
  transform: translateZ(26px);
}

.glass-factory-plan .plan-block {
  --equipment-color: #217d4f;
  min-height: 0;
  border: 1px solid rgba(18, 37, 28, 0.18);
  border-radius: 3px;
  padding: 4px 6px;
  background: var(--equipment-color);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow:
    0 8px 0 color-mix(in srgb, var(--equipment-color) 70%, #0e2018),
    7px 12px 14px rgba(18, 37, 28, 0.17);
}

.glass-factory-plan .floor-equipment {
  cursor: pointer;
}

.factory-editing .glass-factory-plan .floor-map-editable[data-floor-marker] {
  cursor: grab;
  outline: 2px dashed rgba(35, 103, 209, 0.45);
  outline-offset: 4px;
  pointer-events: auto;
}

.factory-editing .glass-factory-plan .plan-outline,
.factory-editing .glass-factory-plan .concept-wall {
  cursor: default;
  outline: 0;
  pointer-events: none;
}

.factory-editing .glass-factory-plan .plan-block[data-floor-marker] {
  cursor: pointer;
}

.factory-editing .glass-factory-plan .floor-map-editable[data-floor-marker]:hover {
  outline-color: rgba(35, 103, 209, 0.78);
}

.factory-editing .glass-factory-plan .dragging {
  cursor: grabbing;
  z-index: 20;
  filter: brightness(1.08) drop-shadow(0 0 12px rgba(35, 103, 209, 0.45));
}

.factory-editing .glass-factory-plan .resizing {
  z-index: 21;
  outline: 3px solid rgba(35, 103, 209, 0.78);
  outline-offset: 4px;
}

.floor-resize-handle {
  position: absolute;
  z-index: 30;
  width: 13px;
  height: 13px;
  border: 2px solid white;
  border-radius: 999px;
  background: #2367d1;
  box-shadow: 0 2px 6px rgba(18, 37, 28, 0.28);
}

.resize-nw {
  left: -8px;
  top: -8px;
  cursor: nwse-resize;
}

.resize-ne {
  right: -8px;
  top: -8px;
  cursor: nesw-resize;
}

.resize-sw {
  left: -8px;
  bottom: -8px;
  cursor: nesw-resize;
}

.resize-se {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.custom-map-item {
  --equipment-color: #111827;
  left: 520px;
  top: 520px;
  width: 88px;
  height: 46px;
}

.plan-block small,
.plan-zone-label small {
  display: block;
  margin-top: 2px;
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1.1;
  opacity: 0.86;
  text-transform: none;
}

.glass-factory-plan .plan-block small {
  display: none;
}

.plan-triangle {
  width: 0;
  height: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-bottom: 42px solid #5e756b;
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 42px;
  filter: drop-shadow(7px 12px 10px rgba(18, 37, 28, 0.16));
}

.glass-factory-plan .plan-triangle.floor-equipment {
  min-height: 0;
  border-top: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-bottom: 42px solid #5e756b;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.plan-zone-label {
  z-index: 1;
  min-height: 38px;
  border: 1px dashed rgba(18, 37, 28, 0.24);
  border-radius: 4px;
  color: rgba(18, 37, 28, 0.82);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.62);
  transform: translateZ(14px);
}

.glass-inventory-zone {
  left: 18px;
  top: 552px;
  width: 744px;
  height: 74px;
}

.level-one-zone {
  left: 24px;
  top: 610px;
  width: 242px;
  height: 34px;
  min-height: 34px;
  background: rgba(255, 255, 255, 0.78);
}

.forklift-zone {
  left: 764px;
  top: 552px;
  width: 250px;
  height: 74px;
}

.reception-zone {
  left: 926px;
  top: 210px;
  width: 126px;
  height: 66px;
}

.lorry-zone {
  left: 816px;
  top: 76px;
  width: 144px;
  height: 88px;
}

.cutting-2a { --equipment-color: #f2c94c; left: 338px; top: 374px; width: 126px; height: 72px; color: #172018; }
.cutting-2b-top { --equipment-color: #f2c94c; left: 480px; top: 372px; width: 138px; height: 36px; color: #172018; }
.cutting-2b-bottom { --equipment-color: #f2c94c; left: 480px; top: 422px; width: 138px; height: 36px; color: #172018; }
.cutting-2c { --equipment-color: #f2c94c; left: 626px; top: 426px; width: 88px; height: 82px; color: #172018; }
.cnc-6 { --equipment-color: #8e44ad; left: 188px; top: 458px; width: 110px; height: 72px; }
.waterjet-7 { --equipment-color: #c0392b; left: 34px; top: 456px; width: 112px; height: 68px; }
.tempering-8 { --equipment-color: #16a085; left: 518px; top: 232px; width: 236px; height: 86px; }
.heat-10 { --equipment-color: #34495e; left: 804px; top: 310px; width: 118px; height: 162px; }
.washing-5a { --equipment-color: #00a2e8; left: 252px; top: 274px; width: 58px; height: 42px; }
.washing-5b { --equipment-color: #00a2e8; left: 274px; top: 216px; width: 58px; height: 42px; }
.washing-5c { --equipment-color: #00a2e8; left: 354px; top: 256px; width: 110px; height: 72px; }
.washing-5d { --equipment-color: #00a2e8; left: 274px; top: 340px; width: 58px; height: 36px; }
.flat-3a { --equipment-color: #e67e22; left: 178px; top: 386px; width: 70px; height: 28px; }
.flat-3b { --equipment-color: #e67e22; left: 132px; top: 334px; width: 42px; height: 62px; }
.flat-3c { --equipment-color: #e67e22; left: 178px; top: 332px; width: 70px; height: 30px; }
.flat-3d { --equipment-color: #e67e22; left: 76px; top: 330px; width: 38px; height: 78px; }
.flat-3e { --equipment-color: #e67e22; left: 28px; top: 330px; width: 38px; height: 78px; }
.drill-4a { --equipment-color: #9b59b6; left: 34px; top: 254px; width: 54px; height: 50px; }
.drill-4b { --equipment-color: #9b59b6; left: 36px; top: 190px; width: 52px; height: 40px; }
.drill-4c { --equipment-color: #9b59b6; left: 64px; top: 142px; width: 54px; height: 40px; }
.drill-4d { --equipment-color: #9b59b6; left: 136px; top: 146px; width: 54px; height: 40px; }
.drill-4e { --equipment-color: #9b59b6; left: 218px; top: 132px; width: 52px; height: 64px; }
.drill-4f { --equipment-color: #9b59b6; left: 290px; top: 146px; width: 56px; height: 42px; }
.lamination-9a { --equipment-color: #27ae60; left: 88px; top: 56px; width: 136px; height: 76px; }
.lamination-9b { --equipment-color: #27ae60; left: 238px; top: 62px; width: 142px; height: 76px; }
.lamination-9c { --equipment-color: #27ae60; left: 392px; top: 66px; width: 138px; height: 76px; }
.lamination-9d { --equipment-color: #27ae60; left: 608px; top: 76px; width: 136px; height: 62px; }
.lamination-9e { --equipment-color: #27ae60; left: 606px; top: 158px; width: 140px; height: 62px; }
.lamination-9f { --equipment-color: #27ae60; left: 936px; top: 312px; width: 76px; height: 102px; }
.press-12a { --equipment-color: #7f4f24; left: 348px; top: 18px; width: 136px; height: 42px; }
.press-12b { --equipment-color: #7f4f24; left: 162px; top: 12px; width: 112px; height: 42px; }
.sand-11a { --equipment-color: #2c3e50; left: 910px; top: 132px; width: 54px; height: 58px; }
.sand-11b { --equipment-color: #2c3e50; left: 972px; top: 112px; width: 54px; height: 70px; }
.inventory-rack { --equipment-color: #d35400; left: 934px; top: 434px; width: 82px; height: 138px; writing-mode: vertical-rl; }
.pump-0a { left: 690px; top: 394px; border-bottom-color: #1abc9c; }
.pump-0b { left: 36px; top: 408px; border-bottom-color: #1abc9c; }
.pump-0c { left: 520px; top: 146px; border-bottom-color: #1abc9c; }
.inv-1a { left: 686px; top: 508px; border-bottom-color: #2367d1; }
.inv-1b { left: 638px; top: 506px; border-bottom-color: #2367d1; }

.glass-factory-plan .pump-0a,
.glass-factory-plan .pump-0b,
.glass-factory-plan .pump-0c {
  border-bottom-color: #1abc9c;
}

.glass-factory-plan .inv-1a,
.glass-factory-plan .inv-1b {
  border-bottom-color: #2367d1;
}

.level-two-deck {
  position: absolute;
  left: 762px;
  top: 10px;
  width: 316px;
  height: 152px;
  border: 2px solid rgba(18, 37, 28, 0.42);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(235, 241, 238, 0.82)),
    repeating-linear-gradient(90deg, rgba(18, 37, 28, 0.08) 0 2px, transparent 2px 24px);
  box-shadow:
    0 18px 0 rgba(129, 143, 136, 0.58),
    18px 32px 26px rgba(18, 37, 28, 0.22);
  transform: translateZ(164px);
  transform-style: preserve-3d;
}

.level-two-floor-label {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: rgba(18, 37, 28, 0.7);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.level-two-rail {
  position: absolute;
  background: rgba(18, 37, 28, 0.62);
  transform: translateZ(24px);
}

.rail-front,
.rail-back {
  left: 10px;
  right: 10px;
  height: 4px;
}

.rail-front { bottom: 8px; }
.rail-back { top: 8px; }

.rail-left,
.rail-right {
  top: 10px;
  bottom: 10px;
  width: 4px;
}

.rail-left { left: 8px; }
.rail-right { right: 8px; }

.level-two-leg {
  position: absolute;
  width: 12px;
  height: 138px;
  border-radius: 4px;
  background: #87938e;
  box-shadow: 4px 7px 9px rgba(18, 37, 28, 0.18);
  transform: rotateX(90deg) translateZ(-70px);
  transform-origin: center top;
}

.leg-a { left: 22px; top: 136px; }
.leg-b { right: 22px; top: 136px; }
.leg-c { left: 22px; top: -2px; }
.leg-d { right: 22px; top: -2px; }

.level-two-ladder {
  position: absolute;
  right: -54px;
  bottom: -80px;
  width: 46px;
  height: 112px;
  border-left: 5px solid #8d9892;
  border-right: 5px solid #8d9892;
  transform: translateZ(-28px) rotateZ(18deg);
}

.level-two-ladder span {
  display: block;
  height: 4px;
  margin: 15px 0 0;
  background: #8d9892;
}

.level-two-machine {
  --equipment-color: #ff2f2f;
  color: white;
  width: 62px;
  height: 46px;
  transform: translateZ(48px);
}

.compressor-20a { left: 34px; top: 38px; }
.compressor-20b { left: 108px; top: 38px; }
.compressor-20c { left: 182px; top: 38px; }
.compressor-20d { left: 108px; top: 92px; }
.dryer-21a { --equipment-color: #8cff18; left: 182px; top: 38px; color: #172018; }
.dryer-21b { --equipment-color: #8cff18; left: 108px; top: 92px; color: #172018; }

.glass-factory-plan .cutting-2a { --equipment-color: #ff2f2f; left: 424px; top: 420px; width: 124px; height: 74px; color: white; }
.glass-factory-plan .cutting-2b-top { --equipment-color: #ff2f2f; left: 564px; top: 506px; width: 104px; height: 40px; color: white; }
.glass-factory-plan .cutting-2b-bottom { --equipment-color: #ff2f2f; left: 564px; top: 506px; width: 104px; height: 40px; color: white; }
.glass-factory-plan .cutting-2b-bottom { display: none; }
.glass-factory-plan .cutting-2c { --equipment-color: #ff2f2f; left: 614px; top: 390px; width: 120px; height: 46px; color: white; }
.glass-factory-plan .cutting-2d { --equipment-color: #ff2f2f; left: 674px; top: 506px; width: 58px; height: 40px; }
.glass-factory-plan .cnc-6 { --equipment-color: #bfff76; left: 430px; top: 558px; width: 132px; height: 50px; color: #172018; }
.glass-factory-plan .waterjet-7a { --equipment-color: #ff9f1a; left: 108px; top: 558px; width: 196px; height: 52px; }
.glass-factory-plan .waterjet-7b { --equipment-color: #ff9f1a; left: 198px; top: 362px; width: 118px; height: 44px; }
.glass-factory-plan .tempering-8a { --equipment-color: #06498d; left: 448px; top: 222px; width: 62px; height: 76px; }
.glass-factory-plan .tempering-8b { --equipment-color: #06498d; left: 516px; top: 222px; width: 62px; height: 76px; }
.glass-factory-plan .tempering-8c { --equipment-color: #06498d; left: 584px; top: 222px; width: 62px; height: 76px; }
.glass-factory-plan .tempering-8d { --equipment-color: #06498d; left: 652px; top: 222px; width: 62px; height: 76px; }
.glass-factory-plan .heat-10 { --equipment-color: #ffe066; left: 746px; top: 256px; width: 84px; height: 138px; color: #172018; font-size: 1.45rem; }
.glass-factory-plan .washing-5a { --equipment-color: #fff200; left: 210px; top: 298px; width: 112px; height: 52px; color: #172018; }
.glass-factory-plan .washing-5b { --equipment-color: #fff200; left: 206px; top: 210px; width: 112px; height: 52px; color: #172018; }
.glass-factory-plan .washing-5c { --equipment-color: #fff200; left: 332px; top: 392px; width: 64px; height: 84px; color: #172018; }
.glass-factory-plan .washing-5d { --equipment-color: #fff200; left: 206px; top: 484px; width: 70px; height: 36px; color: #172018; }
.glass-factory-plan .flat-3a { --equipment-color: #c13be0; left: 100px; top: 448px; width: 184px; height: 48px; }
.glass-factory-plan .flat-3b { --equipment-color: #c13be0; left: 110px; top: 308px; width: 58px; height: 128px; }
.glass-factory-plan .flat-3c { --equipment-color: #c13be0; left: 110px; top: 506px; width: 96px; height: 34px; }
.glass-factory-plan .flat-3d { --equipment-color: #c13be0; left: 46px; top: 306px; width: 36px; height: 148px; }
.glass-factory-plan .flat-3e { --equipment-color: #c13be0; left: 0; top: 306px; width: 36px; height: 148px; }
.glass-factory-plan .drill-4a { --equipment-color: #20f59a; left: 18px; top: 202px; width: 48px; height: 36px; color: #172018; }
.glass-factory-plan .drill-4b { --equipment-color: #20f59a; left: 18px; top: 160px; width: 48px; height: 34px; color: #172018; }
.glass-factory-plan .drill-4c { --equipment-color: #20f59a; left: 46px; top: 116px; width: 48px; height: 34px; color: #172018; }
.glass-factory-plan .drill-4d { --equipment-color: #20f59a; left: 98px; top: 116px; width: 48px; height: 34px; color: #172018; }
.glass-factory-plan .drill-4e { --equipment-color: #20f59a; left: 152px; top: 116px; width: 48px; height: 34px; color: #172018; }
.glass-factory-plan .drill-4f { --equipment-color: #20f59a; left: 96px; top: 166px; width: 58px; height: 36px; color: #172018; }
.glass-factory-plan .drill-4g { --equipment-color: #20f59a; left: 172px; top: 150px; width: 48px; height: 34px; color: #172018; }
.glass-factory-plan .lamination-9a { --equipment-color: #42aa22; left: 130px; top: 58px; width: 124px; height: 58px; }
.glass-factory-plan .lamination-9b { --equipment-color: #42aa22; left: 260px; top: 58px; width: 152px; height: 58px; }
.glass-factory-plan .lamination-9c { --equipment-color: #42aa22; left: 418px; top: 58px; width: 138px; height: 58px; }
.glass-factory-plan .lamination-9d { --equipment-color: #42aa22; left: 616px; top: 42px; width: 74px; height: 54px; }
.glass-factory-plan .lamination-9e { --equipment-color: #42aa22; left: 616px; top: 104px; width: 74px; height: 48px; }
.glass-factory-plan .lamination-9f { --equipment-color: #42aa22; left: 128px; top: 16px; width: 286px; height: 30px; }
.glass-factory-plan .lamination-9g { --equipment-color: #42aa22; left: 98px; top: 76px; width: 42px; height: 34px; }
.glass-factory-plan .press-12a { --equipment-color: #8fefff; left: 430px; top: 16px; width: 62px; height: 46px; color: white; }
.glass-factory-plan .press-12b { --equipment-color: #8fefff; left: 54px; top: 14px; width: 58px; height: 46px; }
.glass-factory-plan .press-12c { --equipment-color: #8fefff; left: 8px; top: 24px; width: 42px; height: 34px; }
.glass-factory-plan .sand-11a { --equipment-color: #c13be0; left: 994px; top: 118px; width: 56px; height: 66px; }
.glass-factory-plan .sand-11b { --equipment-color: #c13be0; left: 1056px; top: 118px; width: 56px; height: 66px; }
.glass-factory-plan .grind-13a { --equipment-color: #ffd2b8; left: 196px; top: 408px; width: 62px; height: 42px; color: #172018; }
.glass-factory-plan .grind-13b { --equipment-color: #ffd2b8; left: 264px; top: 408px; width: 62px; height: 42px; color: #172018; }
.glass-factory-plan .film-14 { --equipment-color: #ff1db4; left: 398px; top: 330px; width: 42px; height: 80px; }
.glass-factory-plan .vinyl-16 { --equipment-color: #ff1db4; left: 452px; top: 330px; width: 42px; height: 80px; }
.glass-factory-plan .laser-15 { --equipment-color: #ff1db4; left: 942px; top: 438px; width: 38px; height: 54px; }
.glass-factory-plan .recycle-17 { --equipment-color: #1bbdd0; left: 36px; top: 590px; width: 240px; height: 70px; font-size: 1.5rem; }
.glass-factory-plan .compressor-20c-main { --equipment-color: #ff2f2f; left: 704px; top: 12px; width: 40px; height: 32px; }
.glass-factory-plan .compressor-20d-main { --equipment-color: #ff2f2f; left: 704px; top: 118px; width: 40px; height: 32px; }
.glass-factory-plan .compressor-20e-main { --equipment-color: #ff2f2f; left: 664px; top: 152px; width: 38px; height: 30px; }
.glass-factory-plan .compressor-20f-main { --equipment-color: #ff2f2f; left: 592px; top: 310px; width: 38px; height: 30px; }
.glass-factory-plan .dryer-21c-main { --equipment-color: #8cff18; left: 660px; top: 12px; width: 40px; height: 32px; color: #172018; }

.factory-scene {
  position: relative;
  min-height: 760px;
  background:
    radial-gradient(circle at 42% 18%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(145deg, #f5f6f3 0%, #e5e8e1 50%, #d6ddd5 100%);
  perspective: 1450px;
}

.glass-factory-plan {
  width: 1180px;
  min-width: 1180px;
  height: 720px;
  margin: 58px 34px 86px;
  overflow: visible;
  transform: rotateX(56deg) rotateZ(-4deg);
  border: 0;
  border-radius: 6px;
  background:
    radial-gradient(circle at 25% 28%, rgba(255, 255, 255, 0.44), transparent 34%),
    radial-gradient(circle at 76% 60%, rgba(255, 255, 255, 0.26), transparent 28%),
    repeating-linear-gradient(45deg, rgba(18, 37, 28, 0.028) 0 2px, transparent 2px 18px),
    #d9dbd4;
  box-shadow:
    0 22px 0 #b8bdb6,
    42px 58px 54px rgba(18, 37, 28, 0.24);
}

.glass-factory-plan .plan-outline {
  inset: 14px 22px 68px 18px;
  border: 0;
  border-radius: 7px 98px 18px 7px;
  clip-path: polygon(0 0, 62% 0, 62% 7%, 81% 7%, 93% 18%, 100% 34%, 98% 34%, 98% 79%, 94% 79%, 94% 100%, 0 100%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 30%),
    rgba(230, 232, 226, 0.36);
  box-shadow:
    inset 0 0 0 4px rgba(104, 111, 105, 0.42),
    inset 0 0 0 10px rgba(255, 255, 255, 0.22);
}

.glass-boundary {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  transform: translateZ(72px);
}

.glass-boundary-main {
  left: 0;
  top: 600px;
  width: 922px;
  height: 72px;
  border-top: 4px dashed #e11d1d;
  transform: translateZ(76px) rotate(4deg);
}

.customer-loading-boundary {
  left: 790px;
  top: 62px;
  width: 178px;
  height: 222px;
  border: 4px dashed #e11d1d;
  border-top: 0;
  border-bottom-left-radius: 14px;
  transform: translateZ(78px);
}

.concept-wall,
.concept-room,
.concept-window,
.concept-forklift,
.concept-table {
  position: absolute;
  pointer-events: none;
  transform-style: preserve-3d;
}

.concept-wall {
  z-index: 1;
  border: 1px solid rgba(95, 99, 94, 0.2);
  background: linear-gradient(180deg, #f1f1ee, #bebfb8);
  box-shadow: 0 14px 16px rgba(18, 37, 28, 0.12);
  transform: translateZ(86px);
}

.wall-top { left: 18px; top: -26px; width: 1110px; height: 34px; }
.wall-left { left: -24px; top: 16px; width: 30px; height: 614px; }
.wall-bottom { left: 22px; top: 650px; width: 1088px; height: 32px; }
.wall-right { left: 1114px; top: 24px; width: 32px; height: 626px; }

.concept-room {
  z-index: 2;
  display: grid;
  place-items: center;
  border: 4px solid #d8d8d2;
  border-radius: 4px;
  background: #f4f3ee;
  color: #243128;
  font-weight: 900;
  line-height: 1.15;
  text-transform: none;
  box-shadow:
    0 18px 0 #bfc2bb,
    16px 24px 18px rgba(18, 37, 28, 0.18);
  transform: translateZ(92px);
}

.pantry-room { left: 620px; top: 12px; width: 82px; height: 62px; }
.reception-room { left: 968px; top: 244px; width: 150px; height: 92px; }
.office-room { left: 1008px; top: 452px; width: 126px; height: 126px; font-size: 1rem; }
.store-room {
  left: 908px;
  top: 566px;
  width: 182px;
  height: 84px;
  background: #e5f4df;
  color: #168a3c;
}

.concept-window {
  z-index: 3;
  width: 92px;
  height: 17px;
  border: 2px solid #a8b5b1;
  background:
    linear-gradient(90deg, transparent 18%, rgba(88, 98, 96, 0.45) 18% 22%, transparent 22% 42%, rgba(88, 98, 96, 0.45) 42% 46%, transparent 46% 66%, rgba(88, 98, 96, 0.45) 66% 70%, transparent 70%),
    linear-gradient(180deg, #fbffff, #d9eeee);
  box-shadow: 0 8px 12px rgba(18, 37, 28, 0.12);
  transform: translateZ(102px);
}

.window-a { left: 44px; top: -18px; }
.window-b { left: 194px; top: -18px; }
.window-c { left: 360px; top: -18px; }

.concept-table {
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #cda66c;
  box-shadow:
    0 10px 0 #9c7646,
    0 16px 12px rgba(18, 37, 28, 0.16);
  transform: translateZ(52px);
}

.concept-table::before,
.concept-table::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0, #8cc6c9 0 7px, transparent 8px),
    radial-gradient(circle at 100% 50%, #8cc6c9 0 7px, transparent 8px),
    radial-gradient(circle at 50% 100%, #8cc6c9 0 7px, transparent 8px),
    radial-gradient(circle at 0 50%, #8cc6c9 0 7px, transparent 8px);
}

.table-a { left: 706px; top: 28px; }
.table-b { left: 760px; top: 76px; }
.table-c { left: 678px; top: 96px; }

.concept-forklift {
  z-index: 2;
  width: 34px;
  height: 62px;
  border-radius: 7px;
  background:
    linear-gradient(90deg, #202522 0 20%, #f1b72e 20% 78%, #202522 78%),
    #2a2f2c;
  box-shadow:
    0 9px 0 #1a1e1c,
    0 16px 16px rgba(18, 37, 28, 0.2);
  transform: translateZ(58px);
}

.concept-forklift::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 9px;
  height: 18px;
  border-radius: 4px;
  background: #3e4541;
}

.concept-forklift::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -16px;
  height: 18px;
  border-left: 4px solid #323935;
  border-right: 4px solid #323935;
}

.forklift-a { left: 842px; top: 90px; }
.forklift-b { left: 906px; top: 90px; }
.forklift-c { left: 830px; top: 582px; }
.forklift-d { left: 912px; top: 582px; }

.glass-factory-plan .plan-block {
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 40%),
    var(--equipment-color);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.22),
    inset 0 -4px 0 rgba(0, 0, 0, 0.12),
    0 14px 0 color-mix(in srgb, var(--equipment-color) 58%, #172018),
    10px 24px 22px rgba(18, 37, 28, 0.24);
  transform: translateZ(58px);
}

.glass-factory-plan .plan-block span {
  font-size: 1.08em;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.glass-factory-plan .heat-10,
.glass-factory-plan .recycle-17 {
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.26),
    inset 0 -4px 0 rgba(0, 0, 0, 0.1),
    0 18px 0 color-mix(in srgb, var(--equipment-color) 56%, #172018),
    12px 28px 28px rgba(18, 37, 28, 0.25);
}

.glass-factory-plan .plan-triangle {
  z-index: 6;
  filter:
    drop-shadow(0 9px 0 rgba(78, 83, 80, 0.76))
    drop-shadow(8px 18px 12px rgba(18, 37, 28, 0.18));
  transform: translateZ(62px);
}

.glass-factory-plan .plan-zone-label {
  z-index: 2;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(18, 37, 28, 0.68);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  transform: translateZ(22px);
}

.glass-factory-plan .customer-loading-label {
  left: 838px;
  top: 232px;
  width: 142px;
  min-height: 38px;
  color: #111827;
  font-size: 0.82rem;
}

.glass-factory-plan .lea-hin-label {
  left: 974px;
  top: 458px;
  width: 150px;
  min-height: 42px;
  color: #e9500e;
  font-size: 0.8rem;
  white-space: nowrap;
}

.glass-factory-plan .floor-key {
  min-height: 24px;
  font-size: 0.72rem;
  text-align: left;
  justify-items: start;
  opacity: 0.9;
}

.glass-factory-plan .key-cutting { left: 26px; top: 700px; color: #ff2f2f; }
.glass-factory-plan .key-lamination { left: 370px; top: 700px; color: #2c8e1f; }
.glass-factory-plan .key-compressor { left: 788px; top: 700px; color: #ff2f2f; }
.glass-factory-plan .key-dryer { left: 968px; top: 700px; color: #48a90b; }

.glass-factory-plan .reception-zone,
.glass-factory-plan .lorry-zone {
  opacity: 0;
}

.glass-factory-plan .forklift-zone {
  top: 646px;
  left: 820px;
  width: 220px;
  height: 38px;
  min-height: 38px;
  font-size: 0.88rem;
}

.glass-factory-plan .level-one-zone {
  display: none;
}

.glass-factory-plan .glass-inventory-zone {
  left: 360px;
  top: 632px;
  width: 330px;
  height: 38px;
  min-height: 38px;
  color: #e11d1d;
}

.glass-factory-plan .inventory-rack {
  left: 936px;
  top: 496px;
  width: 150px;
  height: 46px;
  writing-mode: horizontal-tb;
  color: #eaffea;
}

.glass-factory-plan .level-two-deck {
  z-index: 4;
  left: 444px;
  top: 284px;
  width: 286px;
  height: 96px;
  border: 4px solid #8e6f49;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(142, 111, 73, 0.38) 0 5px, transparent 5px 28px),
    linear-gradient(180deg, rgba(213, 180, 132, 0.72), rgba(174, 132, 83, 0.72));
  box-shadow:
    0 28px 0 rgba(113, 86, 56, 0.48),
    22px 36px 30px rgba(18, 37, 28, 0.24);
  transform: translateZ(164px);
}

.glass-factory-plan .level-two-floor-label {
  top: -24px;
  bottom: auto;
  color: #59432e;
}

.glass-factory-plan .level-two-ladder {
  right: -34px;
  bottom: -78px;
}

.glass-factory-plan .level-two-machine {
  width: 48px;
  height: 34px;
  transform: translateZ(56px);
}

.glass-factory-plan .compressor-20a { left: 206px; top: 24px; }
.glass-factory-plan .compressor-20b { left: 42px; top: 24px; }
.glass-factory-plan .dryer-21a { left: 152px; top: 24px; }
.glass-factory-plan .dryer-21b { left: 50px; top: 60px; }

.glass-factory-plan .floor-equipment:hover,
.glass-factory-plan .floor-equipment:focus,
.glass-factory-plan .floor-equipment.located {
  outline: 3px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
  filter: brightness(1.08);
}

.glass-factory-plan .plan-block.located,
.glass-factory-plan .plan-triangle.located {
  outline: 4px solid #16a34a;
  outline-offset: 5px;
  filter: brightness(1.12) drop-shadow(0 0 14px rgba(22, 163, 74, 0.45));
}

.glass-factory-plan .plan-block.located::before,
.glass-factory-plan .plan-triangle.located::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -50px;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: #16a34a;
  box-shadow:
    0 9px 0 #0f7a37,
    0 16px 22px rgba(15, 122, 55, 0.34);
  transform: translateX(-50%) rotate(-45deg) skew(-8deg, -8deg);
}

.glass-factory-plan .plan-block.located::after,
.glass-factory-plan .plan-triangle.located::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -41px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  transform: translateX(-50%);
}

.floor-location-marker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 3px solid white;
  border-radius: 999px;
  background: #2367d1;
  opacity: 0;
  pointer-events: none;
  transform: translateZ(74px) scale(0.72);
  box-shadow: 0 12px 18px rgba(18, 37, 28, 0.24);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.floor-location-marker::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: white;
}

.floor-location-marker span {
  position: absolute;
  left: 18px;
  bottom: 18px;
  min-width: 132px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(18, 37, 28, 0.9);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.floor-location-marker.located {
  opacity: 1;
  transform: translateZ(92px) scale(1);
}

.spare-bearing { left: 352px; top: 360px; background: #2367d1; }
.spare-photoeye { left: 822px; top: 286px; background: #2367d1; }
.spare-seal { left: 548px; top: 222px; background: #2367d1; }
.spare-gasket { left: 700px; top: 382px; background: #2367d1; }
.consumable-oil { left: 198px; top: 530px; background: #f1c232; }
.consumable-sanitizer { left: 650px; top: 210px; background: #f1c232; }
.consumable-thread { left: 240px; top: 426px; background: #f1c232; }
.consumable-tape { left: 956px; top: 426px; background: #f1c232; }

/* Clean 2D factory plan */
.factory-scene {
  min-height: 0;
  background:
    linear-gradient(rgba(18, 37, 28, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 37, 28, 0.035) 1px, transparent 1px),
    #f4f7f3;
  background-size: 42px 42px;
  perspective: none;
}

.factory-floor-plane,
.glass-factory-plan {
  width: 1600px;
  min-width: 1600px;
  height: 1000px;
  margin: 24px auto 30px;
  overflow: hidden;
  transform: translateX(var(--factory-plan-offset-x, 0px)) scale(var(--factory-fit-scale, 1));
  transform-origin: top left;
  transform-style: flat;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background:
    linear-gradient(rgba(18, 37, 28, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 37, 28, 0.04) 1px, transparent 1px),
    #fbfcfa;
  background-size: 40px 40px;
  box-shadow: var(--shadow);
}

.glass-factory-plan .plan-outline {
  inset: 14px 18px 68px 18px;
  border: 3px solid #8c968e;
  border-radius: 6px;
  clip-path: none;
  background: transparent;
  box-shadow: inset 0 0 0 8px rgba(140, 150, 142, 0.08);
}

.concept-wall,
.concept-room,
.concept-forklift,
.glass-boundary,
.glass-factory-plan .plan-block,
.glass-factory-plan .plan-triangle,
.glass-factory-plan .plan-zone-label,
.glass-factory-plan .level-two-deck,
.glass-factory-plan .level-two-machine,
.floor-location-marker {
  transform: none;
  transform-style: flat;
}

.concept-wall {
  z-index: 1;
  border: 0;
  background: #d9dfd9;
  box-shadow: none;
}

.wall-top { left: 18px; top: 14px; width: 1530px; height: 10px; }
.wall-left { left: 18px; top: 14px; width: 10px; height: 918px; }
.wall-bottom { left: 18px; top: 922px; width: 1530px; height: 10px; }
.wall-right { left: 1538px; top: 14px; width: 10px; height: 918px; }

.concept-room {
  z-index: 2;
  border: 2px solid #bfc8c1;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: none;
}

.concept-window,
.concept-table {
  display: none;
}

.concept-forklift {
  z-index: 3;
  box-shadow: none;
}

.concept-forklift::after {
  bottom: -10px;
}

.glass-boundary {
  z-index: 3;
}

.glass-boundary-main {
  transform: rotate(4deg);
}

.customer-loading-boundary {
  transform: none;
}

.glass-factory-plan .plan-block {
  z-index: 5;
  border: 1px solid rgba(18, 37, 28, 0.18);
  border-radius: 5px;
  background: var(--equipment-color);
  box-shadow: none;
}

.glass-factory-plan .plan-block.floor-hovered,
.glass-factory-plan .plan-triangle.floor-hovered {
  z-index: 24;
  outline: 4px solid #16a34a;
  outline-offset: 5px;
  filter: brightness(1.08);
}

.glass-factory-plan .plan-triangle.floor-hovered {
  border-bottom-color: #16a34a;
  filter:
    drop-shadow(0 0 0 #16a34a)
    drop-shadow(0 10px 0 rgba(22, 163, 74, 0.6))
    drop-shadow(8px 18px 14px rgba(18, 37, 28, 0.26));
}

.floor-hover-card {
  position: absolute;
  z-index: 60;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  width: 210px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid rgba(18, 37, 28, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(18, 37, 28, 0.22);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.floor-hover-card.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.floor-hover-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid rgba(18, 37, 28, 0.16);
  border-bottom: 1px solid rgba(18, 37, 28, 0.16);
  transform: translateX(-50%) rotate(45deg);
}

.floor-hover-image {
  display: grid;
  place-items: center;
  min-width: 54px;
  height: 54px;
  border-radius: 7px;
  background-size: cover;
  background-position: center;
  color: white;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  overflow: hidden;
}

.floor-hover-image span {
  padding: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}

.floor-hover-card strong {
  display: block;
  margin-top: 5px;
  font-size: 0.86rem;
  line-height: 1.15;
}

.glass-factory-plan .plan-block span {
  text-shadow: none;
}

.glass-factory-plan .heat-10,
.glass-factory-plan .recycle-17 {
  box-shadow: none;
}

.glass-factory-plan .plan-triangle {
  z-index: 5;
  filter: none;
}

.glass-factory-plan .plan-zone-label {
  z-index: 2;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

.glass-factory-plan .floor-key {
  display: none;
}

.glass-factory-plan .level-two-deck {
  z-index: 4;
  border: 2px solid #8e6f49;
  background: rgba(214, 180, 132, 0.34);
  box-shadow: none;
}

.glass-factory-plan .level-two-rail,
.glass-factory-plan .level-two-leg,
.glass-factory-plan .level-two-ladder {
  display: none;
}

.glass-factory-plan .level-two-floor-label {
  top: 6px;
  bottom: auto;
  color: #59432e;
}

.glass-factory-plan .level-two-machine {
  box-shadow: none;
}

.glass-factory-plan .floor-equipment:hover,
.glass-factory-plan .floor-equipment:focus,
.glass-factory-plan .floor-equipment.located {
  outline: 3px solid #16a34a;
  outline-offset: 4px;
  filter: none;
}

.glass-factory-plan .plan-block.located,
.glass-factory-plan .plan-triangle.located {
  outline: 3px solid #16a34a;
  outline-offset: 4px;
  filter: none;
}

.glass-factory-plan .plan-block.located::before,
.glass-factory-plan .plan-triangle.located::before {
  top: -26px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.18);
  transform: translateX(-50%);
}

.glass-factory-plan .plan-block.located::after,
.glass-factory-plan .plan-triangle.located::after {
  top: -20px;
  width: 8px;
  height: 8px;
  background: white;
  transform: translateX(-50%);
}

.glass-factory-plan .factory-position-linked {
  cursor: pointer;
}

.glass-factory-plan .factory-position-linked::selection {
  background: transparent;
}

.glass-factory-plan .factory-position-search-match {
  outline: 3px solid #2367d1;
  outline-offset: 5px;
  filter: brightness(1.08);
}

.factory-editing .glass-factory-plan .factory-position-linked {
  cursor: grab;
}

.floor-hover-equipment {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.factory-position-chip {
  background: #e8f2ff !important;
  color: #1d4ed8 !important;
}

.floor-location-marker {
  box-shadow: none;
}

.floor-location-marker.located {
  transform: scale(1);
}

/* 3D isometric factory floor treatment */
.factory-scene {
  background:
    radial-gradient(circle at 46% 20%, rgba(255, 255, 255, 0.78), transparent 28%),
    linear-gradient(145deg, #f7f7f4 0%, #e8e9e4 58%, #d8ded6 100%);
  perspective: none;
}

.factory-floor-plane,
.glass-factory-plan {
  border: 0;
  border-radius: 7px;
  background:
    radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.5), transparent 36%),
    repeating-linear-gradient(45deg, rgba(18, 37, 28, 0.025) 0 2px, transparent 2px 18px),
    #dedfd8;
  box-shadow:
    0 18px 0 #b7bcb5,
    30px 36px 42px rgba(18, 37, 28, 0.22);
}

.glass-factory-plan .plan-outline {
  border: 0;
  background: rgba(232, 233, 228, 0.38);
  box-shadow:
    inset 0 0 0 5px rgba(102, 111, 104, 0.42),
    inset 0 0 0 12px rgba(255, 255, 255, 0.22);
}

.concept-wall {
  border: 1px solid rgba(95, 99, 94, 0.18);
  background: linear-gradient(180deg, #f4f4f0 0%, #c0c3ba 100%);
  box-shadow: 0 12px 0 #aab0a8, 8px 18px 16px rgba(18, 37, 28, 0.18);
}

.concept-room {
  border: 4px solid #d7d9d2;
  background: linear-gradient(180deg, #faf9f4 0%, #e6e5df 100%);
  box-shadow: 0 16px 0 #bfc3ba, 14px 22px 18px rgba(18, 37, 28, 0.17);
}

.store-room {
  background: linear-gradient(180deg, #ebf8e4 0%, #d4ebcb 100%);
  color: #168a3c;
}

.concept-window {
  display: block;
  box-shadow: 0 8px 10px rgba(18, 37, 28, 0.12);
}

.concept-table {
  display: block;
}

.concept-forklift {
  box-shadow: 0 9px 0 #1a1e1c, 0 15px 15px rgba(18, 37, 28, 0.2);
}

.glass-factory-plan .plan-block {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 42%),
    var(--equipment-color);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.24),
    inset 0 -5px 0 rgba(0, 0, 0, 0.12),
    0 13px 0 color-mix(in srgb, var(--equipment-color) 58%, #172018),
    10px 22px 20px rgba(18, 37, 28, 0.24);
}

.glass-factory-plan .heat-10,
.glass-factory-plan .recycle-17 {
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.26),
    inset 0 -5px 0 rgba(0, 0, 0, 0.1),
    0 18px 0 color-mix(in srgb, var(--equipment-color) 56%, #172018),
    12px 28px 28px rgba(18, 37, 28, 0.25);
}

.glass-factory-plan .plan-block span,
.glass-factory-plan .plan-triangle {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.glass-factory-plan .plan-triangle {
  filter:
    drop-shadow(0 8px 0 rgba(82, 87, 84, 0.76))
    drop-shadow(8px 17px 12px rgba(18, 37, 28, 0.18));
}

.glass-factory-plan .level-two-deck {
  border: 4px solid #8e6f49;
  background:
    repeating-linear-gradient(90deg, rgba(142, 111, 73, 0.38) 0 5px, transparent 5px 28px),
    linear-gradient(180deg, rgba(222, 190, 146, 0.78), rgba(178, 133, 85, 0.78));
  box-shadow: 0 26px 0 rgba(113, 86, 56, 0.48), 20px 34px 28px rgba(18, 37, 28, 0.24);
}

.glass-factory-plan .level-two-rail,
.glass-factory-plan .level-two-ladder {
  display: block;
}

.glass-factory-plan .level-two-rail {
  background: rgba(85, 61, 37, 0.76);
}

.glass-factory-plan .level-two-ladder {
  right: 10px;
  bottom: -106px;
  width: 42px;
  height: 112px;
  border-left: 5px solid #8d9892;
  border-right: 5px solid #8d9892;
  transform: rotate(18deg);
  transform-origin: top center;
}

.glass-factory-plan .level-two-ladder span {
  display: block;
  height: 4px;
  margin: 15px 0 0;
  background: #8d9892;
}

.glass-factory-plan .level-two-machine {
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.22),
    inset 0 -4px 0 rgba(0, 0, 0, 0.12),
    0 10px 0 color-mix(in srgb, var(--equipment-color) 58%, #172018),
    8px 18px 16px rgba(18, 37, 28, 0.22);
}

.glass-boundary-main,
.customer-loading-boundary {
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.7));
}

.floor-hover-card {
  box-shadow: 0 16px 0 rgba(183, 188, 181, 0.55), 0 24px 34px rgba(18, 37, 28, 0.2);
}

/* Reference image layout */
.pantry-room { left: 790px; top: 28px; width: 86px; height: 64px; }
.reception-room { left: 1350px; top: 300px; width: 150px; height: 92px; }
.office-room { left: 1484px; top: 676px; width: 124px; height: 126px; }
.store-room { left: 1302px; top: 738px; width: 210px; height: 90px; }

.window-a { left: 68px; top: 24px; }
.window-b { left: 230px; top: 24px; }
.window-c { left: 430px; top: 24px; }
.table-a { left: 880px; top: 58px; }
.table-b { left: 938px; top: 104px; }
.table-c { left: 840px; top: 118px; }

.forklift-a { left: 1238px; top: 128px; }
.forklift-b { left: 1324px; top: 128px; }
.forklift-c { left: 1226px; top: 842px; }
.forklift-d { left: 1328px; top: 842px; }

.customer-loading-boundary { left: 1150px; top: 70px; width: 250px; height: 258px; }
.glass-boundary-main { left: 34px; top: 790px; width: 1244px; }
.glass-factory-plan .customer-loading-label { left: 1196px; top: 308px; width: 190px; }
.glass-factory-plan .glass-inventory-zone { left: 360px; top: 902px; width: 440px; }
.glass-factory-plan .forklift-zone {
  left: 1240px;
  top: 910px;
  width: 300px;
}
.glass-factory-plan .lea-hin-label { left: 1358px; top: 548px; width: 164px; }

.glass-factory-plan .press-12c { left: 88px; top: 46px; width: 48px; height: 42px; }
.glass-factory-plan .press-12b { left: 148px; top: 36px; width: 68px; height: 56px; }
.glass-factory-plan .press-12a { left: 704px; top: 44px; width: 70px; height: 56px; }

.glass-factory-plan .lamination-9f { left: 250px; top: 38px; width: 430px; height: 38px; }
.glass-factory-plan .lamination-9g { left: 222px; top: 118px; width: 48px; height: 38px; }
.glass-factory-plan .lamination-9a { left: 278px; top: 110px; width: 150px; height: 74px; }
.glass-factory-plan .lamination-9b { left: 446px; top: 112px; width: 180px; height: 78px; }
.glass-factory-plan .lamination-9c { left: 644px; top: 116px; width: 170px; height: 78px; }
.glass-factory-plan .lamination-9d { left: 974px; top: 96px; width: 96px; height: 72px; }
.glass-factory-plan .lamination-9e { left: 974px; top: 192px; width: 96px; height: 72px; }

.glass-factory-plan .dryer-21c-main { left: 1040px; top: 42px; width: 48px; height: 40px; }
.glass-factory-plan .compressor-20c-main { left: 1094px; top: 42px; width: 48px; height: 40px; }
.glass-factory-plan .compressor-20d-main { left: 1078px; top: 180px; width: 48px; height: 40px; }
.glass-factory-plan .compressor-20e-main { left: 1022px; top: 246px; width: 46px; height: 36px; }
.glass-factory-plan .compressor-20f-main { left: 912px; top: 522px; width: 46px; height: 36px; }

.glass-factory-plan .drill-4c { left: 94px; top: 188px; width: 56px; height: 40px; }
.glass-factory-plan .drill-4d { left: 158px; top: 188px; width: 56px; height: 40px; }
.glass-factory-plan .drill-4e { left: 226px; top: 188px; width: 56px; height: 40px; }
.glass-factory-plan .drill-4b { left: 78px; top: 242px; width: 56px; height: 40px; }
.glass-factory-plan .drill-4g { left: 290px; top: 224px; width: 56px; height: 40px; }
.glass-factory-plan .drill-4a { left: 80px; top: 300px; width: 56px; height: 40px; }
.glass-factory-plan .drill-4f { left: 176px; top: 272px; width: 66px; height: 44px; }

.glass-factory-plan .washing-5b { left: 378px; top: 280px; width: 118px; height: 58px; }
.glass-factory-plan .washing-5a { left: 372px; top: 368px; width: 118px; height: 58px; }
.glass-factory-plan .washing-5c { left: 548px; top: 438px; width: 76px; height: 96px; }
.glass-factory-plan .washing-5d { left: 332px; top: 570px; width: 78px; height: 42px; }

.glass-factory-plan .flat-3e { left: 54px; top: 370px; width: 42px; height: 168px; }
.glass-factory-plan .flat-3d { left: 108px; top: 370px; width: 42px; height: 168px; }
.glass-factory-plan .flat-3b { left: 176px; top: 372px; width: 72px; height: 164px; }
.glass-factory-plan .flat-3a { left: 178px; top: 568px; width: 210px; height: 54px; }
.glass-factory-plan .flat-3c { left: 176px; top: 662px; width: 118px; height: 42px; }

.glass-factory-plan .grind-13a { left: 350px; top: 492px; width: 68px; height: 46px; }
.glass-factory-plan .grind-13b { left: 428px; top: 492px; width: 68px; height: 46px; }
.glass-factory-plan .waterjet-7b { left: 386px; top: 420px; width: 132px; height: 52px; }
.glass-factory-plan .waterjet-7a { left: 286px; top: 718px; width: 236px; height: 60px; }
.glass-factory-plan .recycle-17 { left: 164px; top: 862px; width: 300px; height: 66px; }

.glass-factory-plan .level-two-deck { left: 682px; top: 372px; width: 324px; height: 126px; }
.glass-factory-plan .tempering-8a { left: 682px; top: 282px; width: 76px; height: 86px; }
.glass-factory-plan .tempering-8b { left: 772px; top: 282px; width: 76px; height: 86px; }
.glass-factory-plan .tempering-8c { left: 862px; top: 282px; width: 76px; height: 86px; }
.glass-factory-plan .tempering-8d { left: 952px; top: 282px; width: 76px; height: 86px; }
.glass-factory-plan .compressor-20b { left: 740px; top: 396px; width: 58px; height: 42px; }
.glass-factory-plan .dryer-21b { left: 742px; top: 448px; width: 58px; height: 42px; }
.glass-factory-plan .dryer-21a { left: 838px; top: 418px; width: 58px; height: 42px; }
.glass-factory-plan .compressor-20a { left: 914px; top: 418px; width: 58px; height: 42px; }

.glass-factory-plan .film-14 { left: 710px; top: 540px; width: 52px; height: 92px; }
.glass-factory-plan .vinyl-16 { left: 784px; top: 540px; width: 52px; height: 92px; }
.glass-factory-plan .cutting-2c { left: 900px; top: 544px; width: 150px; height: 60px; }
.glass-factory-plan .cutting-2a { left: 708px; top: 646px; width: 156px; height: 88px; }
.glass-factory-plan .cutting-2b-top { left: 880px; top: 730px; width: 136px; height: 50px; }
.glass-factory-plan .cutting-2d { left: 1030px; top: 730px; width: 76px; height: 50px; }
.glass-factory-plan .cnc-6 { left: 706px; top: 808px; width: 158px; height: 64px; }

.glass-factory-plan .heat-10 { left: 1080px; top: 360px; width: 112px; height: 180px; }
.glass-factory-plan .sand-11a { left: 1394px; top: 246px; width: 70px; height: 84px; }
.glass-factory-plan .sand-11b { left: 1480px; top: 246px; width: 70px; height: 84px; }
.glass-factory-plan .laser-15 { left: 1390px; top: 612px; width: 54px; height: 70px; }
.glass-factory-plan .inventory-rack {
  left: 1304px;
  top: 748px;
  width: 210px;
  height: 58px;
  writing-mode: horizontal-tb;
}

.glass-factory-plan .inventory-rack span {
  font-size: 0.86rem;
  line-height: 1.1;
}

.glass-factory-plan .plan-block span,
.glass-factory-plan .plan-zone-label {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.12;
}

.glass-factory-plan .pump-0c { left: 920px; top: 170px; }
.glass-factory-plan .pump-0b { left: 66px; top: 642px; }
.glass-factory-plan .pump-0a { left: 1030px; top: 676px; }
.glass-factory-plan .inv-1b { left: 900px; top: 804px; }
.glass-factory-plan .inv-1a { left: 976px; top: 806px; }

.glass-factory-plan .wall-right {
  left: 1868px;
  top: 14px;
  width: 12px;
  height: 918px;
}

.factory-floor-plane,
.glass-factory-plan {
  width: 2200px;
  min-width: 2200px;
}

.glass-factory-plan .wall-top,
.glass-factory-plan .wall-bottom {
  width: 2182px;
}

.glass-factory-plan .wall-right {
  left: 2188px;
}

.floor-location-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.inventory-floor-drawers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.floor-location-section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 320px;
  padding: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.floor-location-section + .floor-location-section {
  margin-top: 2px;
}

.floor-location-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.floor-location-section summary::-webkit-details-marker {
  display: none;
}

.floor-location-section summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.floor-location-section[open] summary::after {
  transform: rotate(225deg);
}

.floor-location-section summary strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.floor-location-section div,
.floor-location-section button {
  display: grid;
  gap: 3px;
  width: 100%;
  margin: 0 8px;
  width: calc(100% - 16px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  text-align: left;
}

.floor-location-section[open] {
  max-height: 320px;
}

.floor-location-section[open] > :not(summary) {
  flex: 0 0 auto;
}

.floor-location-section[open] {
  overflow-y: auto;
}

.floor-location-section summary {
  position: sticky;
  top: 0;
  z-index: 1;
}

.floor-location-section div {
  cursor: default;
}

.floor-location-section [data-locate-floor^="equipment-"] {
  cursor: pointer;
}

.floor-location-section button {
  cursor: pointer;
}

.floor-location-section button:hover,
.floor-location-section button:focus,
.floor-location-section [data-locate-floor].locating {
  border-color: rgba(35, 103, 209, 0.45);
  outline: 2px solid rgba(35, 103, 209, 0.12);
}

.floor-location-section span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.floor-location-section strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.floor-location-section small {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.floor-location-section small b {
  color: var(--ink);
  font-weight: 900;
}

.calendar-workspace {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 160px);
  min-height: 620px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.calendar-legend-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
  overflow: visible;
}

.calendar-legend-title,
.month-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sub-calendar-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 0;
}

.sub-calendar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  max-width: 190px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--sub-color);
  color: white;
  font-weight: 800;
  font-size: 0.78rem;
}

.sub-calendar-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-calendar-item input {
  accent-color: white;
}

.month-calendar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.month-toolbar {
  min-height: 48px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.month-toolbar h3,
.calendar-month-picker-button {
  margin: 0;
  font-size: 1.18rem;
}

.calendar-month-picker-button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 11px;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.calendar-month-picker-button:hover,
.calendar-month-picker-button:focus {
  border-color: var(--line);
  background: #f3f8f5;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 26px repeat(6, minmax(84px, 1fr));
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.month-header-cell {
  min-height: 0;
  padding: 5px 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 0.8rem;
}

.month-day {
  position: relative;
  min-height: 0;
  padding: 16px 5px 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
  cursor: pointer;
}

.month-day:hover {
  outline: 2px solid rgba(35, 103, 209, 0.18);
  outline-offset: -2px;
}

.month-day:focus {
  outline: 3px solid rgba(35, 103, 209, 0.32);
  outline-offset: -3px;
}

.weekend-day {
  background: #eef9fb;
}

.muted-day {
  background: #eef0f2;
  color: #a9b0ad;
  cursor: default;
}

.day-number {
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 0.72rem;
}

.week-label {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 0.72rem;
}

.calendar-events {
  display: grid;
  gap: 1px;
  margin-left: -5px;
  margin-right: -5px;
}

.pending-approvals-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pending-approvals-panel .panel-header {
  margin-bottom: 12px;
}

.pending-approvals-panel h3 {
  margin: 0;
}

.pending-approvals-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.pending-approval-list {
  display: grid;
  gap: 10px;
}

.pending-approval-drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfb;
}

.pending-approval-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 13px 14px;
  background: #f0f6f2;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pending-approval-trigger span,
.pending-approval-trigger strong,
.pending-approval-trigger small {
  font-weight: 900;
}

.pending-approval-trigger small {
  color: var(--muted);
}

.pending-approval-details {
  display: none;
  gap: 8px;
  padding: 10px;
}

.pending-approval-drawer.open .pending-approval-details {
  display: grid;
}

.pending-approval-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.pending-approval-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pending-approval-row strong {
  display: block;
  margin-top: 3px;
  font-size: 0.98rem;
}

.pending-approval-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.pending-approval-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  grid-column: 1 / -1;
  gap: 8px;
  white-space: nowrap;
}

.approval-history-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.approval-history-panel h3 {
  margin: 0 0 10px;
}

.approval-history-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.approval-history-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(110px, 0.9fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: white;
  font-size: 0.82rem;
}

.approval-history-row:last-child {
  border-bottom: 0;
}

.approval-history-head {
  background: #f0f6f2;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.approval-history-empty {
  padding: 13px;
  color: var(--muted);
  font-weight: 800;
}

.calendar-event {
  min-height: 10px;
  border-radius: 0;
  padding: 0 4px;
  background: var(--event-color);
  color: white;
  font-size: 0.52rem;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.range-start {
  margin-left: 5px;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.calendar-event.range-end {
  margin-right: 5px;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

.calendar-event.range-continued {
  color: transparent;
}

.sub-calendar-edit-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 10px;
  margin-bottom: 10px;
}

.sub-calendar-edit-row input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.mini-month-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.mini-month-title {
  color: var(--ink);
  font-weight: 900;
  text-transform: none;
}

.mini-month-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.mini-month-toolbar .mini-month-nav {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  pointer-events: auto;
}

.mini-month-title {
  flex: 1;
  text-align: center;
  pointer-events: none;
}

.mini-month-weekdays,
.mini-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.mini-month-weekdays span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
}

.mini-month-empty,
.mini-month-day {
  min-height: 30px;
}

.mini-month-day {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.mini-month-day.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.color-block-dropdown {
  position: relative;
}

.color-dropdown-trigger {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 34px 6px 8px;
  background: white;
  position: relative;
}

.color-dropdown-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
}

.color-dropdown-trigger span,
.color-dropdown-option span {
  display: block;
  width: 100%;
  height: 24px;
  border-radius: 6px;
}

.color-dropdown-trigger span {
  background: var(--selected-color);
}

.color-dropdown-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.color-block-dropdown.open .color-dropdown-menu {
  display: grid;
}

.color-dropdown-option {
  min-height: 34px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px;
  background: white;
}

.color-dropdown-option span {
  background: var(--option-color);
}

.color-dropdown-option.selected {
  border-color: var(--ink);
}

.color-dropdown-option.disabled,
.color-dropdown-option:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

.supabase-status-banner {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f6f2;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.supabase-status-banner.visible {
  display: block;
}

.supabase-status-banner.error {
  border-color: rgba(192, 0, 0, 0.28);
  background: #fff1f1;
  color: #8d1111;
}

.supabase-status-banner.loading {
  border-color: rgba(35, 103, 209, 0.25);
  background: #eef4ff;
  color: #1854aa;
}

.upload-status {
  display: block;
  margin-top: 6px;
  color: #64746b;
  font-size: 0.85rem;
  font-weight: 700;
}

.upload-status.error-text {
  color: #b42318;
}

.task-photo-preview {
  display: block;
  width: min(260px, 100%);
  aspect-ratio: 16 / 9;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #eef4f0;
  background-position: center;
  background-size: cover;
}

.task-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 8;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #eef4f0;
  background-position: center;
  background-size: cover;
}

.day-card,
.schedule-card,
.maintenance-checklist-card {
  min-height: 190px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.day-card strong,
.day-card span {
  display: block;
}

.day-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.schedule-card {
  min-height: auto;
}

.schedule-card header,
.maintenance-checklist-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.schedule-card h3,
.maintenance-checklist-card h3 {
  margin: 0;
  font-size: 1rem;
}

.schedule-card p,
.maintenance-checklist-card p {
  color: var(--muted);
  margin-bottom: 12px;
}

.checklist-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.checklist-panel {
  width: 330px;
  padding: 18px;
}

.checklist-panel label,
.order-form label {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
}

.checklist-panel input {
  margin-right: 8px;
  accent-color: var(--green);
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(520px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 28px);
  box-shadow: 0 30px 90px rgba(22, 34, 28, 0.28);
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(16, 24, 20, 0.45);
}

.order-form {
  padding: 20px;
}

#purchaseRequestDialog > .equipment-profile,
#supplierDialog > .equipment-profile,
#leaHinFinishedGoodDetailsDialog > .order-form,
#certificationDialog > .equipment-profile,
#calendarDateDialog > .equipment-profile,
#equipmentImportDialog > .equipment-import-profile,
#locationDialog > .order-form,
#floorItemDialog > .order-form,
#subCalendarDialog > .order-form,
#calendarMonthDialog > .order-form,
#approvalRequestDialog > .order-form,
#orderDialog > .order-form,
#leaHinAllocationActionDialog > .order-form,
#leaHinMovementDetailsDialog > .order-form,
#leaHinAdjustmentMetadataDialog > .order-form,
#leaHinAdjustmentDialog > .order-form,
dialog.record-modal > .record-modal-body {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

#equipmentDialog .equipment-profile-header,
#partDialog .equipment-profile-header,
#purchaseRequestDialog .equipment-profile-header,
#supplierDialog .equipment-profile-header,
#leaHinFinishedGoodDetailsDialog .dialog-title-row,
#certificationDialog .equipment-profile-header,
#calendarDateDialog .equipment-profile-header,
#equipmentImportDialog .equipment-profile-header,
#locationDialog .panel-header,
#floorItemDialog .panel-header,
#subCalendarDialog .panel-header,
#calendarMonthDialog .panel-header,
#approvalRequestDialog .panel-header,
#orderDialog .panel-header,
#leaHinAllocationActionDialog .dialog-title-row,
#leaHinMovementDetailsDialog .dialog-title-row,
#leaHinAdjustmentMetadataDialog .dialog-title-row,
#leaHinAdjustmentDialog .dialog-title-row {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -20px -20px 18px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

dialog.record-modal .record-modal-header {
  position: static;
  top: auto;
  margin: 0;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

#orderDialog .profile-actions,
#equipmentDialog .profile-actions,
#partDialog .profile-actions,
#purchaseRequestDialog .profile-actions,
#supplierDialog .profile-actions,
#leaHinFinishedGoodDetailsDialog .dialog-actions,
#certificationDialog .profile-actions,
#calendarDateDialog .profile-actions,
#leaHinAllocationActionDialog .dialog-actions,
#leaHinMovementDetailsDialog .dialog-actions,
#leaHinAdjustmentMetadataDialog .dialog-actions,
#leaHinAdjustmentDialog .dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 18px -20px -20px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.record-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 30fr) minmax(0, 40fr) minmax(0, 30fr);
  gap: 16px;
  align-items: start;
}

.record-modal-span,
.record-modal-table,
.record-modal-timeline,
.record-modal-history {
  grid-column: 1 / -1;
}

#equipmentDialog .equipment-profile *,
#partDialog .equipment-profile *,
#purchaseRequestDialog .equipment-profile *,
#supplierDialog .equipment-profile *,
#leaHinFinishedGoodDetailsDialog .order-form *,
#orderDialog .order-form *,
#leaHinMovementDetailsDialog .order-form *,
#leaHinAdjustmentDialog .order-form * {
  min-width: 0;
}

#orderDialog .order-form {
  display: grid;
  grid-template-columns: minmax(0, 30fr) minmax(0, 40fr) minmax(0, 30fr);
  gap: 12px;
  align-content: start;
}

#orderDialog .panel-header,
#orderDialog .work-order-popup-summary,
#orderDialog .task-pm-checklist-panel,
#orderDialog #taskMaintenanceCostPanel,
#orderDialog #taskActivityTimelinePanel,
#orderDialog .profile-actions,
#orderDialog .maintenance-datetime-section {
  grid-column: 1 / -1;
}

.work-order-popup-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--ds-card-radius, 8px);
  background: #f8fbf8;
}

.work-order-popup-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.work-order-popup-status strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-order-popup-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

/* Phones (16 Nov 2026): the task summary's two columns and five fact boxes were squeezed to one letter wide. */
@media (max-width: 700px) {
  .work-order-popup-summary { grid-template-columns: 1fr; }
  .work-order-popup-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #equipmentDialog .ep-body button,
  #equipmentDialog .ep-body a.secondary-button { min-height: 40px; }
}

.work-order-popup-meta span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
}

.work-order-popup-meta b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.maintenance-cost-panel,
.equipment-maintenance-cost-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--ds-card-radius, 8px);
  background: #fff;
}

.maintenance-cost-grid,
.equipment-maintenance-cost-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.equipment-maintenance-cost-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.equipment-reliability-panel {
  display: grid;
  gap: 12px;
}

.equipment-reliability-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.reliability-failure-list {
  margin-top: 2px;
}

.reliability-tracking-section .muted-text {
  margin: -4px 0 10px;
}

.reliability-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.maintenance-cost-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--ds-card-radius, 8px);
  background: #f8fbf8;
}

.maintenance-cost-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.maintenance-cost-card strong {
  min-width: 0;
  font-size: 1.12rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.maintenance-cost-card.total {
  border-color: rgba(20, 125, 74, 0.35);
  background: #eef8f2;
}

.maintenance-cost-lines {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.maintenance-cost-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf8;
}

.maintenance-cost-lines span,
.maintenance-cost-lines strong {
  min-width: 0;
}

#orderDialog .order-form label,
#orderDialog .order-form section {
  margin-bottom: 0;
}

.order-form select,
.order-form input,
.order-form textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.order-form textarea {
  min-height: 100px;
  resize: vertical;
}

.form-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.maintenance-datetime-section {
  margin: 4px 0 12px;
}

.maintenance-datetime-section h3 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 1rem;
}

.maintenance-datetime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.maintenance-datetime-grid label {
  margin-bottom: 0;
  font-weight: 800;
}

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.checkbox-line input {
  width: auto;
  margin: 0;
  accent-color: var(--green);
}

.location-form {
  width: 100%;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  overflow-x: hidden;
}

.location-accordion {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.location-form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.location-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  border: 0;
  padding: 14px;
  background: white;
  color: var(--ink);
  text-align: left;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.location-section-toggle::-webkit-details-marker {
  display: none;
}

.location-section-toggle::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.location-form-section[open] .location-section-toggle::after {
  transform: rotate(225deg);
}

.floor-item-form {
  width: min(520px, calc(100vw - 32px));
}

.floor-color-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
}

.floor-color-preview {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.42);
}

.location-section-toggle strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.location-section-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.location-unit {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.location-unit h4 {
  margin: 0 0 8px;
  font-size: 0.86rem;
}

.location-unit label {
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.location-unit input {
  min-height: 38px;
  padding: 8px;
}

.activity-timeline-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  margin-top: 16px;
}

.activity-timeline-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.activity-timeline-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.activity-timeline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-timeline-title time {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.activity-timeline-body p {
  margin: 6px 0 0;
  color: var(--text);
}

.activity-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.activity-note-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.activity-note-form textarea {
  resize: vertical;
}

.timeline-setup-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.text-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
}

/* Maintainly Design System V1.0 reusable component standards */
.ds-card,
.metric,
.panel,
.order-card,
.asset-card,
.catalog-card,
.inventory-entry-card,
.equipment-glance-card,
.equipment-static-panel,
.equipment-linked,
.equipment-subasset-card,
.part-stock-panel,
.checklist-review-card,
.operator-due-card,
.day-card,
.schedule-card,
.maintenance-checklist-card,
.activity-timeline-panel,
.lea-hin-detail-section,
.lea-hin-upload-card,
.lea-hin-attachment-card,
.lea-hin-audit-card {
  border: 1px solid var(--line);
  border-radius: var(--ds-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ds-card,
.order-card,
.asset-card,
.catalog-card,
.inventory-entry-card,
.equipment-static-panel,
.equipment-linked,
.equipment-subasset-card,
.part-stock-panel,
.checklist-review-card,
.operator-due-card,
.day-card,
.schedule-card,
.maintenance-checklist-card,
.activity-timeline-panel {
  padding: var(--ds-card-padding);
}

.ds-card-hover,
button.catalog-card,
.metric-action,
.inventory-entry-card,
.equipment-subasset-card,
.asset-card,
.order-card {
  transition: transform var(--ds-transition), box-shadow var(--ds-transition), border-color var(--ds-transition), background-color var(--ds-transition);
}

.ds-card-hover:hover,
button.catalog-card:hover,
.metric-action:hover,
.inventory-entry-card:hover,
.equipment-subasset-card:hover,
.asset-card:hover,
.order-card:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 138, 91, 0.32);
  box-shadow: var(--ds-hover-shadow);
}

.ds-section-header,
.panel-header,
.section-header,
.equipment-profile-header,
.dialog-title-row,
.certification-profile-header {
  gap: 16px;
  justify-content: space-between;
}

.ds-section-header h2,
.ds-section-header h3,
.panel-header h2,
.section-header h2,
.equipment-profile-header h2,
.dialog-title-row h2,
.equipment-linked h3,
.equipment-static-panel h3,
.activity-timeline-panel h3,
.part-stock-panel h3 {
  margin-top: 0;
  letter-spacing: 0;
}

.ds-section-header p,
.panel-header p,
.section-header p,
.equipment-profile-header p,
.dialog-title-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.primary-button,
.secondary-button,
.danger-button,
.warning-button,
.ghost-button,
.text-button,
.icon-button,
.compact-action,
.task-status-button,
.segmented button {
  min-height: var(--ds-control-height);
  border-radius: var(--ds-radius);
  border: 1px solid transparent;
  transition: background-color var(--ds-transition), color var(--ds-transition), border-color var(--ds-transition), box-shadow var(--ds-transition), transform var(--ds-transition);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.warning-button:hover,
.ghost-button:hover,
.text-button:hover,
.icon-button:hover,
.compact-action:hover,
.task-status-button:hover,
.segmented button:hover {
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.danger-button:focus-visible,
.warning-button:focus-visible,
.ghost-button:focus-visible,
.text-button:focus-visible,
.icon-button:focus-visible,
.compact-action:focus-visible,
.task-status-button:focus-visible,
.segmented button:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus);
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.secondary-button,
.text-button {
  background: var(--ds-neutral-bg);
  color: var(--ink);
}

.danger-button {
  background: var(--ds-danger-bg);
  color: var(--ds-danger-text);
}

.warning-button {
  background: var(--ds-warning-bg);
  color: var(--ds-warning-text);
  padding: 0 14px;
  font-weight: 900;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 800;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: var(--ds-control-height);
  height: var(--ds-control-height);
}

.badge,
.stock-status,
.part-status,
.cert-expiry-badge,
.lea-hin-claim-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: var(--ds-radius);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  background: var(--ds-neutral-bg);
  color: var(--ds-neutral-text);
}

.badge.ok,
.badge.active,
.badge.completed,
.badge.normal,
.stock-status.ok,
.part-status.ok,
.cert-expiry-badge.within-90,
.lea-hin-claim-badge.status-approved,
.lea-hin-claim-badge.status-replaced,
.lea-hin-claim-badge.status-credited,
.lea-hin-claim-badge.status-closed {
  background: var(--ds-success-bg);
  color: var(--ds-success-text);
}

.badge.waiting,
.badge.pending,
.badge.warning,
.badge.overdue,
.badge.low-stock,
.stock-status.low,
.cert-expiry-badge.within-30,
.lea-hin-claim-badge.status-pending,
.lea-hin-claim-badge.status-submitted {
  background: var(--ds-warning-bg);
  color: var(--ds-warning-text);
}

.badge.danger,
.badge.critical,
.badge.retired,
.badge.inactive,
.stock-status.critical,
.cert-expiry-badge.expired {
  background: var(--ds-danger-bg);
  color: var(--ds-danger-text);
}

.table-wrap,
.equipment-import-table-wrap,
.debug-table-wrap {
  overflow: auto;
  border-radius: var(--ds-radius);
}

table,
.catalog-table,
.equipment-import-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

th,
td,
.catalog-table th,
.catalog-table td,
.equipment-import-table th,
.equipment-import-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th,
.catalog-table th,
.equipment-import-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fbf9;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr,
.catalog-table tbody tr,
.equipment-import-table tbody tr {
  transition: background-color var(--ds-transition);
}

tbody tr:hover,
.catalog-table tbody tr:hover,
.equipment-import-table tbody tr:hover {
  background: #f7fbf8;
}

.ds-form,
.equipment-form,
.order-form,
.checklist-template-form,
.checklist-submission-form,
.part-stock-form,
.purchase-request-form {
  gap: 12px;
}

.ds-form label,
.equipment-form label,
.equipment-form .form-field,
.order-form label,
.checklist-template-form label,
.checklist-submission-form label,
.part-stock-form label,
.purchase-request-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ds-form input,
.ds-form select,
.ds-form textarea,
.equipment-form input,
.equipment-form select,
.equipment-form textarea,
.order-form input,
.order-form select,
.order-form textarea,
.checklist-template-form input,
.checklist-template-form select,
.checklist-template-form textarea,
.checklist-submission-form input,
.checklist-submission-form select,
.checklist-submission-form textarea,
.part-stock-form input,
.part-stock-form select,
.part-stock-form textarea,
.purchase-request-form input,
.purchase-request-form select,
.purchase-request-form textarea {
  min-height: var(--ds-control-height);
  border: 1px solid var(--line);
  border-radius: var(--ds-radius);
  padding: var(--ds-control-padding);
  background: #fbfcfb;
  color: var(--ink);
}

.ds-form textarea,
.equipment-form textarea,
.order-form textarea,
.checklist-template-form textarea,
.checklist-submission-form textarea {
  min-height: 104px;
  resize: vertical;
}

.error-text,
.validation-message,
.form-error {
  color: var(--ds-danger-text);
  font-size: 0.82rem;
  font-weight: 800;
}

.activity-timeline-panel {
  display: grid;
  gap: 12px;
}

.activity-timeline-row {
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  border-radius: var(--ds-radius);
  background: #fbfdfb;
}

.activity-timeline-title {
  align-items: flex-start;
}

.activity-timeline-meta,
.activity-timeline-title time {
  color: var(--muted);
}

.ds-empty-state,
.empty-kanban,
.approval-history-empty,
.mini-month-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 96px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--ds-radius);
  background: #fbfcfb;
  color: var(--muted);
  text-align: center;
}

.ds-empty-state-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--green);
  font-weight: 900;
}

.ds-empty-state h3,
.ds-empty-state p {
  margin: 0;
}

.ds-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: ds-spin 900ms linear infinite;
}

.ds-skeleton,
.ds-skeleton-card,
.ds-skeleton-row,
.ds-skeleton-timeline {
  border-radius: var(--ds-radius);
  background: linear-gradient(90deg, #eef4ef 25%, #f8fbf9 37%, #eef4ef 63%);
  background-size: 400% 100%;
  animation: ds-shimmer 1300ms ease infinite;
}

.ds-skeleton-card {
  min-height: 120px;
}

.ds-skeleton-row {
  min-height: 44px;
}

.ds-skeleton-timeline {
  min-height: 72px;
}

@keyframes ds-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ds-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: 0 0;
  }
}

.record-view {
  display: grid;
  gap: var(--ds-section-gap);
}

.record-at-a-glance,
.record-quick-actions,
.record-static-info,
.record-dynamic-info,
.record-activity-timeline,
.record-history {
  min-width: 0;
}

@media (max-width: 1599px) {
  .record-modal-grid,
  #orderDialog .order-form {
    grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  }

  .equipment-maintenance-cost-grid,
  .equipment-reliability-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .equipment-profile-layout {
    grid-template-columns: minmax(240px, 35fr) minmax(0, 65fr);
  }

  #equipmentDialog .equipment-profile-layout > div:nth-child(2) {
    grid-column: auto;
  }
}

@media (max-width: 1199px) {
  #equipmentDialog,
  #partDialog,
  #purchaseRequestDialog,
  #supplierDialog,
  #orderDialog,
  #leaHinFinishedGoodDetailsDialog,
  dialog.record-modal {
    width: min(95vw, 1800px);
    height: 90vh;
  }

  #equipmentImportDialog,
  #certificationDialog,
#calendarDateDialog,
#calendarMonthDialog,
#subCalendarDialog,
  #locationDialog,
  #floorItemDialog,
  #approvalRequestDialog,
  #leaHinAllocationActionDialog,
  #leaHinMovementDetailsDialog,
  #leaHinAdjustmentMetadataDialog,
  #leaHinAdjustmentDialog {
    width: min(92vw, 920px);
    height: 82vh;
  }

  .record-modal-grid,
  #orderDialog .order-form,
  .equipment-profile-layout,
  .certification-profile-layout,
  .certification-media-grid,
  .certification-field-grid,
  .certification-edit-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .equipment-glance-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 86px 1fr;
  }

  .brand div,
  .nav-list span:last-child,
  .site-card div {
    display: none;
  }

  .sidebar {
    padding: 18px;
    align-items: center;
  }

  .metrics-grid,
  .inventory-dashboard,
  .inventory-chart-dashboard,
  .checklist-kpi-grid,
  .checklist-template-list,
  .operator-due-board,
  .checklist-filter-bar,
  .order-board,
  .asset-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pending-approval-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-approval-trigger {
    grid-template-columns: 1fr;
  }

  .approval-history-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .feed-list,
  .calendar-board,
  .checklist-grid,
  .calendar-workspace,
  .factory-floor-shell,
  .equipment-profile-layout {
    grid-template-columns: 1fr;
  }

  .maintenance-cost-grid,
  .equipment-maintenance-cost-grid,
  .equipment-reliability-grid,
  .maintenance-cost-lines li {
    grid-template-columns: 1fr;
  }

  .certification-profile-layout,
  .certification-media-grid,
  .certification-field-grid,
  .certification-edit-form {
    grid-template-columns: 1fr;
  }

  .trend-panel {
    grid-column: auto;
  }

  .trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .location-section-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-dropdown-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-control-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-control-bar button {
    width: 100%;
  }

  .inventory-chart-header,
  .inventory-pie-layout {
    grid-template-columns: 1fr;
  }

  .inventory-chart-header {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-chart-filters {
    justify-content: flex-start;
  }

  .inventory-pie {
    justify-self: center;
  }

  .floor-location-panel,
  .inventory-floor-drawers {
    grid-template-columns: 1fr;
  }

  .checklist-table-row,
  .checklist-table.history .checklist-table-row,
  .checklist-table.due .checklist-table-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    overflow-x: auto;
  }

  .nav-list {
    display: flex;
  }

  .site-card {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .search {
    width: 100%;
  }

  .metrics-grid,
  .inventory-dashboard,
  .inventory-chart-dashboard,
  .checklist-kpi-grid,
  .checklist-template-list,
  .operator-due-board,
  .checklist-filter-bar,
  .order-board,
  .asset-grid,
  .catalog-grid,
  .location-section-list,
  .calendar-board,
  .checklist-grid,
  .calendar-workspace,
  .factory-floor-shell {
    grid-template-columns: 1fr;
  }

  .task-dropdown-filters,
  .form-two-column,
  .checklist-table-row,
  .checklist-table.history .checklist-table-row,
  .checklist-table.due .checklist-table-row,
  .maintenance-datetime-grid,
  .task-detail-grid,
  .waiting-workflow,
  .inventory-control-bar,
  .inventory-history-row,
  .purchase-request-row,
  .purchase-request-audit-grid {
    grid-template-columns: 1fr;
  }

  .inventory-history-list small {
    text-align: left;
  }

  .trend-grid,
  .priority-list article {
    grid-template-columns: 1fr;
  }

  .factory-floor-shell {
    min-height: auto;
  }

  .floor-location-panel,
  .inventory-floor-drawers {
    grid-template-columns: 1fr;
  }

  .inventory-floor-toolbar {
    align-items: stretch;
    flex-direction: column;
  }


  .factory-scene {
    min-height: 520px;
  }

  .calendar-legend-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .checklist-panel {
    width: auto;
  }

  .equipment-field-grid {
    grid-template-columns: 1fr;
  }

  .equipment-glance-panel,
  .equipment-subasset-list {
    grid-template-columns: 1fr;
  }

  .equipment-subasset-card {
    align-items: flex-start;
  }

  .part-stock-form,
  .part-movement-row {
    grid-template-columns: 1fr;
  }

  .activity-timeline-row {
    grid-template-columns: 1fr;
  }

  .activity-timeline-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Materials Inventory V1 final override */
#glass .inventory-dashboard > .glass-entry {
  border-color: #4f83bd;
  background: #4f83bd;
  color: #fff;
}

#glass .inventory-dashboard > .pvb-entry {
  border-color: #05b457;
  background: #05b457;
  color: #fff;
}

#glass .inventory-dashboard > .daily-cutting-entry {
  border-color: #d40000;
  background: #d40000;
  color: #fff;
}

#glass .inventory-dashboard > .lea-hin-entry {
  border-color: #f4c62d;
  background: #f4c62d;
  color: #172018;
}

#glass .inventory-dashboard > .inventory-entry-card span,
#glass .inventory-dashboard > .inventory-entry-card small {
  color: currentColor;
}



/* Stage 8A - Factory Floor / Location Master */
.location-master-panel { display: grid; gap: 16px; }
.location-master-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 180px 180px; gap: 12px; align-items: end; }
.location-master-toolbar label, .location-master-form label { display: grid; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.location-master-toolbar input, .location-master-toolbar select, .location-master-form input, .location-master-form select, .location-master-form textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--text); font: inherit; text-transform: none; box-sizing: border-box; }
.location-master-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.location-master-summary article, .location-master-card, .location-master-form, .location-hierarchy-tree { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft); }
.location-master-summary article { padding: 12px; }
.location-master-summary span, .location-master-card small, .location-master-meta span { color: var(--muted); font-size: 0.78rem; }
.location-master-summary strong { display: block; margin-top: 4px; font-size: 1.2rem; }
.location-master-layout { display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.6fr); gap: 16px; align-items: start; }
.location-hierarchy-tree { padding: 12px; max-height: 70vh; overflow: auto; }
.location-tree-node { margin-left: calc(var(--location-depth, 0) * 16px); margin-top: 6px; }
.location-tree-node button { width: 100%; display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: #f8faf8; text-align: left; cursor: pointer; }
.location-tree-node.inactive button, .location-master-card.inactive { opacity: 0.62; }
.location-master-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.location-master-form { grid-column: 1 / -1; padding: 14px; }
.location-master-card { display: grid; gap: 8px; padding: 14px; }
.location-master-card-header, .location-master-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.location-master-card h4, .location-master-card p { margin: 0; }
.location-master-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.location-master-help { margin: 0 0 8px; color: var(--muted); font-size: 0.86rem; text-transform: none; }
.location-master-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; background: #f7faf7; }
.warning-button { border: 1px solid #f59e0b; background: #fff7ed; color: #92400e; }

/* Stage 8D-2 - Physical Stocktake UI */
.stocktake-panel { display: grid; gap: 14px; }
.stocktake-header, .stocktake-draft-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stocktake-header h3, .stocktake-draft-header h4, .stocktake-history h4 { margin: 0; }
.stocktake-header p, .stocktake-draft-header p { margin: 4px 0 0; color: var(--muted); }
.stocktake-controls { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: end; }
.stocktake-controls label { display: grid; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.stocktake-controls select, .stocktake-table input, .stocktake-table select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; background: #fff; color: var(--text); font: inherit; box-sizing: border-box; }
.stocktake-table-wrap { overflow-x: auto; }
.stocktake-table { min-width: 980px; table-layout: fixed; }
.stocktake-table th:nth-child(1), .stocktake-table td:nth-child(1) { width: 46px; }
.stocktake-table th:nth-child(4), .stocktake-table td:nth-child(4), .stocktake-table th:nth-child(5), .stocktake-table td:nth-child(5), .stocktake-table th:nth-child(6), .stocktake-table td:nth-child(6), .stocktake-table th:nth-child(7), .stocktake-table td:nth-child(7) { width: 120px; white-space: nowrap; }
.stocktake-table td strong, .stocktake-table td small { display: block; }
.stocktake-table td small { color: var(--muted); margin-top: 2px; }
.stocktake-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.stocktake-stage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stocktake-current-draft { margin: 0; color: var(--muted); font-size: 0.84rem; }
.stocktake-review { display: grid; gap: 10px; }
.stocktake-review-header, .stocktake-review-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stocktake-review-header h4, .stocktake-review-card h5 { margin: 0; }
.stocktake-review-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; display: grid; gap: 10px; }
.stocktake-review-card p, .stocktake-review-card small { margin: 0; color: var(--muted); }
.stocktake-review-table { min-width: 900px; table-layout: fixed; }
.stocktake-review-table th:nth-child(1), .stocktake-review-table td:nth-child(1) { width: 46px; }
.stocktake-review-table th:nth-child(3), .stocktake-review-table td:nth-child(3), .stocktake-review-table th:nth-child(4), .stocktake-review-table td:nth-child(4), .stocktake-review-table th:nth-child(5), .stocktake-review-table td:nth-child(5) { width: 130px; white-space: nowrap; }
.stocktake-review-table td strong, .stocktake-review-table td small { display: block; }
.stocktake-history { display: grid; gap: 8px; }
.stocktake-history-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px 12px; display: grid; gap: 5px; }
.stocktake-history-card > div { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.stocktake-history-card p, .stocktake-history-card small { margin: 0; }
.stocktake-history-card small { color: var(--muted); }

@media (max-width: 1100px) { .location-master-toolbar, .location-master-layout, .location-master-summary { grid-template-columns: 1fr; } }

/* Stage 8C - QR Identification Layer */
.qr-scan-form {
  align-self: start;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  min-width: 260px;
}

.topbar-search-stack,
.topbar-search:has(.qr-scan-form) {
  display: grid;
  gap: 8px;
}

.qr-scan-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.qr-scan-form input {
  min-height: 40px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-transform: none;
  box-sizing: border-box;
}

.qr-scan-form button {
  align-self: end;
  min-height: 40px;
}

.qr-scan-message {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 800;
}

.qr-dialog {
  width: min(92vw, 980px);
  max-width: min(92vw, 980px);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.qr-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.qr-dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  background: #fff;
}

.qr-dialog-header,
.qr-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.qr-dialog-header h2,
.qr-dialog-header p {
  margin: 0;
}

.qr-dialog-header p:not(.eyebrow) {
  color: var(--muted);
}

.qr-dialog-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.qr-dialog-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.qr-print-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.qr-code-frame {
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-svg {
  display: block;
  width: 190px;
  height: 190px;
}

.qr-label-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.qr-label-copy > span,
.qr-meta-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.qr-label-copy > strong {
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.qr-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.qr-meta-grid div,
.qr-location-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-location-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.qr-location-section h3 {
  margin: 0 0 10px;
}

.qr-location-list {
  display: grid;
  gap: 8px;
}

.qr-location-list span,
.qr-location-list small {
  color: var(--muted);
}

@media (max-width: 1200px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .qr-scan-form {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .qr-print-label,
  .qr-location-detail {
    grid-template-columns: 1fr;
  }
}

@media print {
  body.printing-qr-label > :not(.qr-dialog) {
    display: none !important;
  }

  body.printing-qr-label .qr-dialog {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    box-shadow: none !important;
  }

  body.printing-qr-label .qr-dialog-shell {
    max-height: none;
  }

  body.printing-qr-label .qr-dialog-header,
  body.printing-qr-label .qr-dialog-actions,
  body.printing-qr-label .qr-location-detail {
    display: none !important;
  }

  body.printing-qr-label .qr-dialog-body {
    padding: 0;
    overflow: visible;
  }

  body.printing-qr-label .qr-print-label {
    width: 90mm;
    border: 1px solid #111827;
    break-inside: avoid;
  }
}

/* Mobile M1A/M1B technician layer */
.mobile-app-shell {
  display: none;
}

@media (max-width: 760px) {
  body {
    background: #f4f7fb;
  }

  .app-shell {
    display: block;
  }

  .sidebar,
  .topbar,
  .main > .view {
    display: none !important;
  }

  .main {
    padding: 0;
  }

  .mobile-app-shell {
    display: block;
    min-height: 100vh;
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom, 0px));
    background: #f4f7fb;
  }

  .mobile-app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -14px -14px 14px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 12px;
    background: rgba(244, 247, 251, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }

  .mobile-app-header h1,
  .mobile-card h2,
  .mobile-card h3 {
    margin: 0;
    letter-spacing: 0;
  }

  .mobile-scan-fab,
  .mobile-full-button,
  .mobile-action-grid button,
  .mobile-bottom-nav button,
  .mobile-back-button {
    min-height: 44px;
  }

  .mobile-scan-fab {
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
  }

  .mobile-view-root {
    display: grid;
    gap: 12px;
    outline: none;
  }

  .mobile-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  }

  .mobile-hero-card {
    display: grid;
    gap: 8px;
  }

  .mobile-hero-card p,
  .mobile-card p,
  .mobile-muted,
  .mobile-empty {
    margin: 0;
    color: var(--muted);
  }

  .mobile-kicker {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .mobile-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-metric {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
  }

  .mobile-metric span,
  .mobile-part-stock small,
  .mobile-job-card small,
  .mobile-movement-row small {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
  }

  .mobile-metric strong {
    display: block;
    font-size: 1.5rem;
    line-height: 1.1;
    margin-top: 6px;
  }

  .mobile-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-action-grid.vertical {
    grid-template-columns: 1fr;
  }

  .mobile-action-grid button,
  .mobile-back-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 800;
    padding: 10px;
  }

  .mobile-full-button {
    width: 100%;
  }

  .mobile-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .mobile-section-title span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
  }

  .mobile-list,
  .mobile-part-card-list,
  .mobile-job-list {
    display: grid;
    gap: 10px;
  }

  .mobile-recent-row,
  .mobile-part-card,
  .mobile-job-card {
    width: 100%;
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    text-align: left;
  }

  .mobile-part-card strong,
  .mobile-job-card strong,
  .mobile-recent-row strong {
    display: block;
    line-height: 1.25;
  }

  .mobile-part-card small,
  .mobile-recent-row span {
    color: var(--muted);
    display: block;
    margin-top: 4px;
  }

  .mobile-part-stock {
    min-width: 96px;
    text-align: right;
  }

  .mobile-part-stock span,
  .mobile-status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 8px;
  }

  .mobile-part-stock strong {
    font-size: 1.35rem;
    margin-top: 5px;
  }

  .mobile-status-pill.good,
  .mobile-part-stock .good {
    background: #e9f7ef;
    color: #166534;
  }

  .mobile-status-pill.warn,
  .mobile-part-stock .warn {
    background: #fff7ed;
    color: #9a3412;
  }

  .mobile-status-pill.bad,
  .mobile-part-stock .bad {
    background: #fee2e2;
    color: #991b1b;
  }

  .mobile-search,
  .mobile-qr-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-search input,
  .mobile-filter-grid select,
  .mobile-qr-form input {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .mobile-qr-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }

  .mobile-scan-suggestions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
  }

  .mobile-scan-suggestion {
    min-height: 56px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
  }

  .mobile-scan-suggestion strong,
  .mobile-scan-suggestion small {
    overflow-wrap: anywhere;
  }

  .mobile-inline-message {
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
    padding: 10px;
  }

  .mobile-quantity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .mobile-quantity-grid article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
  }

  .mobile-quantity-grid span,
  .mobile-detail-list dt {
    color: var(--muted);
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-quantity-grid strong {
    display: block;
    font-size: 1.25rem;
    margin-top: 4px;
  }

  .mobile-detail-card {
    display: grid;
    gap: 8px;
  }

  .mobile-detail-list {
    display: grid;
    gap: 8px;
    margin: 0;
  }

  .mobile-detail-list div {
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
  }

  .mobile-detail-list dd {
    margin: 3px 0 0;
    font-weight: 700;
  }

  .mobile-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
  }

  .mobile-chip-row span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .mobile-movement-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
  }

  .mobile-movement-row span {
    color: var(--muted);
    display: block;
    margin-top: 3px;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
  }

  .mobile-bottom-nav button {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
  }

  .mobile-bottom-nav button.active {
    background: #e8eefc;
    color: var(--primary);
  }

  .mobile-bottom-nav .mobile-nav-scan {
    background: var(--primary);
    color: #fff;
  }
}

/* F15: operator mode — one screen with Daily checklists and Weekly PM, no menu or tools. */
body.operator-mode .sidebar,
body.operator-mode .topbar-search,
body.operator-mode .qr-scan-form,
body.operator-mode .account-role-switcher,
body.operator-mode .topbar-actions .icon-button,
body.operator-mode #checklists > .section-header {
  display: none !important;
}

body.operator-mode .app-shell {
  grid-template-columns: 1fr;
}

@media (max-width: 760px) {
  body.operator-mode .mobile-app-shell {
    display: none !important;
  }

  body.operator-mode .topbar {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }

  body.operator-mode .main > .view.active-view {
    display: block !important;
    padding: 0 12px 24px;
  }

  body.operator-mode #checklists input,
  body.operator-mode #checklists select,
  body.operator-mode #checklists textarea {
    max-width: 100%;
    box-sizing: border-box;
  }

  body.operator-mode #checklists .form-two-column {
    grid-template-columns: 1fr;
  }

  body.operator-mode #checklists .image-upload {
    position: relative;
    overflow: hidden;
  }
}

/* F16: equipment group tabs */
.equipment-group-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.equipment-group-tabs .active { background: var(--accent, #1f7a5a); color: #fff; border-color: transparent; }
/* F4: inventory category filter */
.inventory-category-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.inventory-category-filter .active { background: var(--accent, #1f7a5a); color: #fff; border-color: transparent; }
/* F8: supplier category tick-boxes */
.supplier-area-fieldset { display: flex; gap: 14px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.supplier-area-choice { display: flex; align-items: center; gap: 6px; font-weight: 500; }
/* F12 / F13: buttons on dashboard alerts */
.dashboard-alert-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Batch 2: note under read-only stock */
.field-hint { display: block; color: #5b6670; font-size: 0.8rem; font-weight: 400; }

/* Tasks page: counters, chips, compact cards */
.task-page-header { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.task-parts-toggle { display: inline-flex; align-items: center; gap: 8px; }
.task-parts-toggle.active { background: var(--accent, #1f7a5a); color: #fff; border-color: transparent; }
.task-counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.task-counter { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 12px; border: 1px solid #dfe5e3; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.task-counter svg { grid-row: 1 / 3; width: 26px; height: 26px; }
.task-counter strong { font-size: 1.5rem; line-height: 1.1; }
.task-counter span { font-size: 0.85rem; color: #5b6670; }
.task-counter.active { outline: 2px solid var(--accent, #1f7a5a); outline-offset: -1px; }
.task-counter.tone-danger svg { color: #b42318; } .task-counter.tone-warning svg { color: #b26a00; }
.task-counter.tone-accent svg { color: #1f7a5a; } .task-counter.tone-muted svg { color: #5b6670; }
.task-filter-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.task-chips { display: flex; gap: 6px; }
.task-chips button { border: 1px solid #cfd8d5; background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.9rem; cursor: pointer; }
.task-chips button.active { background: var(--accent, #1f7a5a); color: #fff; border-color: transparent; }
.task-select-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.task-select-chips select { border-radius: 999px; padding: 6px 30px 6px 12px; font-size: 0.88rem; min-height: 0; width: auto; max-width: 220px; }
.order-board.closed-collapsed { grid-template-columns: repeat(3, minmax(0, 1fr)) 140px; }
.kanban-column-collapsed .kanban-collapsed-count { display: grid; justify-items: center; gap: 6px; padding: 18px 0; }
.kanban-column-collapsed .kanban-collapsed-count strong { font-size: 1.6rem; }
.kanban-column-collapsed .kanban-collapsed-count span { font-size: 0.85rem; color: #5b6670; }
.task-card { padding: 0; overflow: hidden; display: grid; }
.task-card.is-urgent, .task-card.is-overdue { border-left: 4px solid #d92d20; }
.task-card-main { all: unset; cursor: pointer; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 12px 12px 8px; align-items: center; }
.task-card-main:focus-visible { outline: 2px solid var(--accent, #1f7a5a); outline-offset: -2px; }
.task-card-photo { width: 52px; height: 52px; border-radius: 10px; background: #eef3f1 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #5b6670; }
.task-card-photo svg { width: 24px; height: 24px; }
.task-card-text { display: grid; gap: 2px; min-width: 0; }
.task-card-text strong { font-size: 0.95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card-text small { color: #5b6670; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 12px 12px; }
.task-card-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.task-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; padding: 3px 8px; border-radius: 999px; background: #eef3f1; color: #33433d; }
.task-tag svg { width: 14px; height: 14px; }
.task-tag.tag-danger { background: #fde7e6; color: #9b1c13; } .task-tag.tag-muted { background: #f0f2f1; color: #5b6670; }
.task-avatar { width: 26px; height: 26px; border-radius: 50%; background: #dcefe7; color: #1f5f47; font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.task-card-footer .task-status-button { flex: none; }
/* Each task column scrolls on its own; the page stays put. */
#orderBoard .kanban-stack { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 300px); min-height: 120px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
#orderBoard .kanban-stack > * { flex: none; }
#orderBoard .kanban-column { min-height: 0; }
@media (max-width: 900px) {
  #orderBoard .kanban-stack { max-height: 70vh; }
  .task-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-board.closed-collapsed { grid-template-columns: 1fr; }
}

/* Equipment page: counters, filter row, condition cards, list */
.equipment-page-header { display: flex; justify-content: flex-end; margin-bottom: 10px; }
[data-equipment-group-count] { margin-left: 4px; opacity: 0.75; font-weight: 600; }
.equipment-search { flex: 1 1 220px; max-width: 320px; border-radius: 999px; padding: 7px 14px; }
.equipment-filter-row .task-select-chips { flex: 1 1 auto; }
.eq-card { position: relative; background: #fff; border: 1px solid #dfe5e3; border-radius: 12px; overflow: hidden; }
.eq-card:hover { border-color: #b9c7c2; }
.eq-card-main { all: unset; cursor: pointer; display: grid; width: 100%; }
.eq-card-main:focus-visible { outline: 2px solid var(--accent, #1f7a5a); outline-offset: -2px; }
.eq-photo { position: relative; height: 120px; background: #eef3f1 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #8a9893; }
.eq-status { position: absolute; top: 10px; left: 10px; font-size: 0.75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.eq-status.tone-ok, .eq-status-inline.tone-ok { background: #dcf3e6; color: #17603a; }
.eq-status.tone-danger, .eq-status-inline.tone-danger { background: #fde7e6; color: #9b1c13; }
.eq-status.tone-warning, .eq-status-inline.tone-warning { background: #fff1d6; color: #8a5600; }
.eq-status.tone-muted, .eq-status-inline.tone-muted { background: #eceeef; color: #5b6670; }
.eq-status-inline { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.eq-qr { position: absolute; top: 8px; right: 8px; border: 0; background: #fff; border-radius: 8px; padding: 5px; line-height: 0; cursor: pointer; color: #33433d; }
.eq-qr:hover { background: #eef3f1; }
.eq-body { display: grid; gap: 3px; padding: 10px 12px 12px; min-width: 0; }
.eq-code { font-size: 0.75rem; font-weight: 700; color: var(--accent, #1f7a5a); letter-spacing: 0.02em; }
.eq-body strong { font-size: 1rem; }
.eq-body small { color: #5b6670; font-size: 0.8rem; }
.eq-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 0.8rem; color: #33433d; }
.eq-meta span { display: inline-flex; align-items: center; gap: 4px; }
.eq-meta svg { width: 14px; height: 14px; }
.eq-meta .tone-danger, .equipment-list-table td.tone-danger { color: #b42318; font-weight: 600; }
.eq-meta .tone-warning, .equipment-list-table td.tone-warning { color: #8a5600; font-weight: 600; }
.eq-bar { display: block; height: 6px; border-radius: 3px; background: #eef3f1; overflow: hidden; margin-top: 6px; }
.eq-bar i { display: block; height: 100%; border-radius: 3px; }
.eq-bar i.tone-ok { background: #2f9e6a; } .eq-bar i.tone-warning { background: #d99a1e; } .eq-bar i.tone-danger { background: #d92d20; }
.asset-grid.asset-list-view { display: block; }
.eq-list-row { cursor: pointer; } .eq-list-row:hover td { background: #f6f9f8; }
.eq-list-photo { width: 38px; height: 38px; border-radius: 8px; background: #eef3f1 center / cover no-repeat; display: inline-flex; align-items: center; justify-content: center; color: #8a9893; }
.eq-qr-inline { border: 0; background: transparent; cursor: pointer; color: #33433d; padding: 4px; line-height: 0; }

/* Equipment profile (view) */
.ep-header { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.ep-photo { width: 84px; height: 84px; border-radius: 14px; background: #eef3f1 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #8a9893; }
.ep-title { min-width: 0; } .ep-title h2 { margin: 2px 0 6px; }
.ep-code { margin: 0; font-size: 0.8rem; font-weight: 700; color: var(--accent, #1f7a5a); }
.ep-parent-link { all: unset; cursor: pointer; text-decoration: underline; font-weight: 600; }
.ep-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ep-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; background: #eef3f1; color: #33433d; }
.ep-chip svg { width: 14px; height: 14px; }
.ep-chip.tone-ok { background: #dcf3e6; color: #17603a; } .ep-chip.tone-danger { background: #fde7e6; color: #9b1c13; }
.ep-chip.tone-warning { background: #fff1d6; color: #8a5600; } .ep-chip.tone-muted { background: #eceeef; color: #5b6670; }
.ep-actions { display: grid; gap: 6px; justify-items: stretch; }
.ep-actions-row { display: flex; gap: 6px; align-items: center; }
.ep-more { position: relative; } .ep-more summary { list-style: none; cursor: pointer; } .ep-more summary::-webkit-details-marker { display: none; }
.ep-more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid #dfe5e3; border-radius: 10px; padding: 6px; display: grid; min-width: 210px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.ep-more-menu button { all: unset; cursor: pointer; padding: 8px 10px; border-radius: 6px; font-size: 0.9rem; }
.ep-more-menu button:hover { background: #eef3f1; } .ep-more-menu .ep-danger { color: #b42318; }
.ep-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ep-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #f4f7f6; }
.ep-tile svg { grid-column: 1; grid-row: 1 / 3; width: 24px; height: 24px; color: #5b6670; }
.ep-tile strong, .ep-tile span { grid-column: 2; }
.ep-body { align-content: start; }
.ep-tile strong { font-size: 1.25rem; } .ep-tile span { font-size: 0.8rem; color: #5b6670; }
.ep-tile.tone-danger strong { color: #b42318; } .ep-tile.tone-warning strong { color: #8a5600; }
.ep-tabs { display: flex; gap: 18px; border-bottom: 1px solid #dfe5e3; margin-bottom: 14px; }
.ep-tab { all: unset; cursor: pointer; padding: 8px 2px; font-size: 0.95rem; color: #5b6670; border-bottom: 2px solid transparent; }
.ep-tab.active { color: #12201b; font-weight: 600; border-bottom-color: var(--accent, #1f7a5a); }
.ep-attention { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.ep-attention.tone-danger { background: #fde7e6; color: #9b1c13; } .ep-attention.tone-warning { background: #fff1d6; color: #8a5600; } .ep-attention.tone-ok { background: #dcf3e6; color: #17603a; }
.ep-overview-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-top: 10px; }
.ep-subhead { font-size: 0.95rem; margin: 8px 0 6px; }
.ep-row { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box; padding: 8px 10px; border-bottom: 1px solid #eef1f0; font-size: 0.88rem; }
.ep-row:hover { background: #f6f9f8; } .ep-status { color: #5b6670; white-space: nowrap; }
.ep-empty { color: #5b6670; font-size: 0.88rem; margin: 4px 0; }
.ep-link { all: unset; cursor: pointer; color: var(--accent, #1f7a5a); font-weight: 600; font-size: 0.88rem; }
.ep-details-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; }
.ep-detail-photo { height: 180px; border-radius: 12px; background: #eef3f1 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #8a9893; }
.ep-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0 0 10px; }
.ep-detail-list dt { font-size: 0.75rem; color: #5b6670; } .ep-detail-list dd { margin: 0; font-weight: 600; }
@media (max-width: 760px) {
  .ep-header { grid-template-columns: 64px minmax(0, 1fr); } .ep-actions { grid-column: 1 / -1; }
  .ep-photo { width: 64px; height: 64px; } .ep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ep-overview-grid, .ep-details-grid { grid-template-columns: 1fr; }
}

/* Equipment edit form: sections */
.ef-form { gap: 12px; }
.ef-section { border: 1px solid #dfe5e3; border-radius: 12px; padding: 12px 14px; margin: 0; display: grid; gap: 10px; min-width: 0; }
.ef-section legend { font-weight: 700; font-size: 0.95rem; padding: 0 6px; }
.ef-optional summary { cursor: pointer; font-weight: 700; font-size: 0.95rem; list-style: none; }
.ef-optional summary::-webkit-details-marker { display: none; }
.ef-optional summary::before { content: '+ '; color: var(--accent, #1f7a5a); }
.ef-optional[open] summary::before { content: '- '; }
.ef-optional summary small { font-weight: 400; color: #5b6670; margin-left: 6px; }
.ef-optional[open] { gap: 10px; } .ef-optional:not([open]) { padding: 10px 14px; }
.ef-field { display: grid; gap: 6px; } .ef-label { font-size: 0.85rem; font-weight: 600; }
.ef-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ef-pill { display: inline-flex !important; cursor: pointer; }
.ef-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ef-pill span { border: 1px solid #cfd8d5; background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 0.88rem; }
.ef-pill input:checked + span { background: var(--accent, #1f7a5a); color: #fff; border-color: transparent; }
.ef-pill input:focus-visible + span { outline: 2px solid var(--accent, #1f7a5a); outline-offset: 2px; }
.ef-switch { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-weight: 600; }
.ef-pm-fields { display: grid; gap: 10px; } .ef-pm-fields[hidden] { display: none; }
.ef-actions { position: sticky; bottom: 0; background: #fff; padding: 10px 0 2px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #eef1f0; z-index: 2; }
.ef-spacer { flex: 1; }
.ef-retire { all: unset; cursor: pointer; color: #b42318; font-weight: 600; font-size: 0.88rem; }
.ef-retire:hover { text-decoration: underline; }

/* Equipment edit form: photo left, form right */
.ef-layout { display: grid !important; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.ef-photo { position: sticky; top: 0; display: grid; gap: 8px; }
.ef-photo .equipment-profile-image { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
@media (max-width: 760px) { .ef-layout { grid-template-columns: 1fr; } .ef-photo { position: static; max-width: 220px; } }

/* Equipment edit form: control fixes */
.ef-switch { justify-content: flex-start; text-transform: none; letter-spacing: normal; }
.ef-switch input { width: 18px !important; height: 18px; min-height: 0 !important; flex: none; margin: 0; padding: 0; }
.ef-switch span { text-transform: none; letter-spacing: normal; font-size: 0.92rem; color: inherit; }
.ef-pill span, .ef-label { text-transform: none; letter-spacing: normal; }
.ef-photo .equipment-profile-image:not(.has-image) { display: grid; place-items: center; text-align: center; padding: 12px; font-size: 0.8rem; color: #5b6670; }

/* Header rows: column widths for the columns added later (Supplier category, Stock Health).
 * The old widths added up to 100% without them, so the last column had no width and its
 * heading stood one letter per line. */
#catalog .catalog-table th:nth-child(1), #catalog .catalog-table td:nth-child(1) { width: 16%; }
#catalog .catalog-table th:nth-child(2), #catalog .catalog-table td:nth-child(2) { width: 11%; }
#catalog .catalog-table th:nth-child(3), #catalog .catalog-table td:nth-child(3) { width: 12%; }
#catalog .catalog-table th:nth-child(4), #catalog .catalog-table td:nth-child(4) { width: 12%; }
#catalog .catalog-table th:nth-child(5), #catalog .catalog-table td:nth-child(5) { width: 13%; }
#catalog .catalog-table th:nth-child(6), #catalog .catalog-table td:nth-child(6) { width: 18%; }
#catalog .catalog-table th:nth-child(7), #catalog .catalog-table td:nth-child(7) { width: 18%; }
#pvbInventoryTable .catalog-table th:nth-child(1), #pvbInventoryTable .catalog-table td:nth-child(1) { width: 6%; }
#pvbInventoryTable .catalog-table th:nth-child(2), #pvbInventoryTable .catalog-table td:nth-child(2) { width: 12%; }
#pvbInventoryTable .catalog-table th:nth-child(3), #pvbInventoryTable .catalog-table td:nth-child(3) { width: 11%; }
#pvbInventoryTable .catalog-table th:nth-child(4), #pvbInventoryTable .catalog-table td:nth-child(4) { width: 9%; }
#pvbInventoryTable .catalog-table th:nth-child(5), #pvbInventoryTable .catalog-table td:nth-child(5) { width: 9%; }
#pvbInventoryTable .catalog-table th:nth-child(6), #pvbInventoryTable .catalog-table td:nth-child(6) { width: 9%; }
#pvbInventoryTable .catalog-table th:nth-child(7), #pvbInventoryTable .catalog-table td:nth-child(7) { width: 11%; }
#pvbInventoryTable .catalog-table th:nth-child(8), #pvbInventoryTable .catalog-table td:nth-child(8) { width: 16%; }
#pvbInventoryTable .catalog-table th:nth-child(9), #pvbInventoryTable .catalog-table td:nth-child(9) { width: 17%; }
/* Lea Hin movement ledger: 16 columns scroll sideways instead of being squeezed. */
#leaHinMovementPanel { overflow-x: auto !important; }
#leaHinMovementPanel .catalog-table { min-width: 1900px; table-layout: auto; }
#leaHinMovementPanel .catalog-table th { white-space: nowrap; }
#leaHinMovementPanel .catalog-table td:first-child { max-width: 160px; overflow-wrap: anywhere; }

/* Camera QR scanning on the phone Scan screen (qr-camera.js, 16 Nov 2026). */
.mobile-qr-camera { display: grid; gap: 10px; margin-top: 12px; }
.mobile-qr-camera-panel { display: grid; gap: 10px; }
.mobile-qr-camera-panel[hidden] { display: none; }
.mobile-qr-camera-view { position: relative; overflow: hidden; border-radius: 10px; background: #111827; }
.mobile-qr-camera-view video { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.mobile-qr-camera-frame {
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.qr-unavailable {
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: #991b1b;
  background: #fee2e2;
  border-radius: 6px;
  box-sizing: border-box;
}
[data-qr-camera-start][hidden] { display: none !important; }
