:root {
  --app-bg: #e9ecf2;
  --rail: #252525;
  --rail-soft: #343434;
  --accent: #cc0088;
  --accent-soft: #ffe7f6;
  --surface: #ffffff;
  --side: #eef1f7;
  --side-line: #d8dde7;
  --line: #e5e7ec;
  --line-strong: #c9ced8;
  --text: #222936;
  --muted: #6f7784;
  --faint: #a2a9b5;
  --blue: #2563eb;
  --blue-soft: #dceafe;
  --green: #12805c;
  --yellow: #c48200;
  --red: #d1122b;
  --orange: #d15b00;
  --shadow: 0 12px 28px rgba(33, 40, 54, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  min-width: 1060px;
  background: var(--app-bg);
  color: var(--text);
  font-family: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

button, input { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 72px 360px minmax(640px, 1fr);
  height: 100vh;
  min-height: 680px;
  background: var(--app-bg);
  transition: grid-template-columns .22s ease;
}
.app-shell.sidebar-collapsed { grid-template-columns: 72px 0 minmax(640px, 1fr); }
.app-shell.sidebar-collapsed .site-sidebar { padding-left: 0; padding-right: 0; opacity: 0; pointer-events: none; }

.global-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 58px;
  margin: 8px 0 8px 8px;
  padding: 20px 0 18px;
  border-radius: 29px;
  background: var(--rail);
  color: #fff;
  box-shadow: 0 20px 32px rgba(0, 0, 0, .16);
  z-index: 4;
}

.rail-logo {
  width: 52px;
  height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  margin-bottom: 0;
  color: #fff;
  line-height: 1;
}
.logo-symbol {
  width: 38px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
}
.rail-logo small { font-size: 9px; font-weight: 800; opacity: .86; }

.rail-live { margin-top: auto; display: grid; justify-items: center; gap: 6px; color: #cbd0d8; font-size: 9px; font-weight: 800; }
.rail-live i { width: 8px; height: 8px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 0 5px rgba(57,217,138,.12); }
.rail-version { margin-top: 22px; color: #747984; font-size: 8px; font-weight: 800; line-height: 1.5; text-align: center; }

.site-sidebar {
  min-width: 0;
  padding: 74px 28px 24px 24px;
  overflow: auto;
  color: #2f3542;
  transition: padding .22s ease, opacity .16s ease;
}
.sidebar-section { margin-bottom: 26px; }
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
  color: #202632;
  font-size: 16px;
}
.sidebar-title span {
  width: 22px;
  color: #7f8793;
  text-align: center;
  font-size: 17px;
}
.favorite-row {
  display: block;
  width: 100%;
  min-height: 31px;
  padding: 5px 0 5px 34px;
  color: #394150;
  text-align: left;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.favorite-row:hover { color: #111827; }

.facility-tree,
.facility-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.facility-tree ul {
  position: relative;
  margin-left: 24px;
  padding-left: 20px;
}
.facility-tree ul::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 9px;
  width: 1px;
  background: var(--side-line);
}
.facility-tree li {
  position: relative;
  min-width: 0;
}
.facility-tree li:not(.open) > ul { display: none; }
.facility-tree ul li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 20px;
  width: 14px;
  height: 1px;
  background: var(--side-line);
}
.facility-tree button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px 0 0;
  color: #394150;
  text-align: left;
  font-size: 16px;
  white-space: nowrap;
}
.facility-tree button span {
  width: 20px;
  color: #333a46;
  text-align: center;
  font-size: 24px;
  line-height: 1;
}
.facility-tree .selected > button {
  height: 48px;
  padding-right: 16px;
  background: #dcdfeb;
  color: #1d2430;
  font-weight: 700;
}
.facility-tree li.selected > button { color: #1d2430; font-weight: 800; }

.workspace {
  min-width: 0;
  min-height: 0;
  height: calc(100vh - 65px);
  display: grid;
  grid-template-rows: 183px minmax(0, 1fr);
  margin: 65px 0 0;
  overflow: hidden;
  border-top-left-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-rows: 85px 98px;
  min-width: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.location-row {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 48px 0 30px;
  border-bottom: 1px solid var(--line);
}
.menu-button {
  width: 34px;
  height: 34px;
  margin-right: 18px;
  color: #808793;
  font-size: 21px;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  color: #2b3341;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumbs i {
  color: #a4abb5;
  font-style: normal;
  font-size: 21px;
}
.breadcrumbs strong { color: #171d28; font-weight: 800; }
.icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-left: 2px;
  color: #4f5662;
  font-size: 20px;
}
.icon-button.active-favorite { color: #d69a00; }
.module-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
  height: 98px;
}
.module-tabs button {
  position: relative;
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #2d3441;
  font-size: 16px;
  font-weight: 600;
}
.module-tabs button.active {
  color: #101827;
  font-weight: 900;
}
.module-tabs button.active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 2px;
  background: #20242d;
}
.module-tabs em {
  min-width: 30px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #f0f1f4;
  color: #545c68;
  font-size: 11px;
  font-style: normal;
}
.module-tabs button:nth-child(3) em::after,
.module-tabs button:nth-child(4) em::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  margin-left: 23px;
  margin-top: -16px;
  border-radius: 50%;
  background: #fb1538;
}

.viewer-shell {
  position: relative;
  min-height: 0;
  background: #dfe4ec;
  overflow: hidden;
}
.module-view { position: absolute; inset: 0; display: none; }
.module-view.active { display: block; }
.scene-container {
  position: absolute;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #858585;
}
.viewport-tools.is-hidden { display: none; }
#scene3d {
  display: block;
  width: 100%;
  height: 100%;
}
.viewport-tools {
  position: absolute;
  z-index: 12;
  left: 0;
  top: 0;
  width: 58px;
  display: grid;
  gap: 8px;
  padding: 12px 8px;
  background: #e7ebf3;
  box-shadow: 1px 0 0 #d2d8e3;
}
.viewport-tools button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #c5ccd7;
  border-radius: 7px;
  background: #eef2f8;
  color: #707987;
  font-size: 21px;
  box-shadow: 0 1px 2px rgba(29, 38, 54, .08);
}
.viewport-tools button:hover,
.viewport-tools button.active {
  border-color: #8db5f5;
  background: #bcd5ff;
  color: #32445f;
}

.viewport-hud {
  position: absolute;
  z-index: 5;
  color: var(--text);
  pointer-events: none;
}
.viewport-hud.top-left {
  top: 20px;
  left: 78px;
  max-width: min(590px, calc(100% - 470px));
  padding: 12px 14px;
  border: 1px solid rgba(220, 225, 234, .92);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 22px rgba(20, 28, 42, .10);
}
.viewport-hud.top-left strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}
.viewport-hud.top-left span {
  color: #596271;
  font-size: 12px;
}
.viewport-hud.bottom-left {
  left: 76px;
  bottom: 128px;
  display: flex;
  gap: 8px;
  font-size: 12px;
}
.viewport-hud.bottom-left span {
  padding: 7px 10px;
  border: 1px solid rgba(203, 211, 222, .9);
  border-radius: 7px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 6px 14px rgba(20, 28, 42, .08);
}
.viewport-hud.bottom-right {
  right: 330px;
  bottom: 128px;
  width: 280px;
  padding: 11px 12px;
  border: 1px solid rgba(203, 211, 222, .9);
  border-radius: 8px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 8px 20px rgba(20, 28, 42, .10);
}
.viewport-hud.bottom-right span {
  display: block;
  color: #7b8491;
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.viewport-hud.bottom-right b {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}
.viewport-hud.bottom-right i {
  display: block;
  margin-top: 4px;
  color: #5f6876;
  font-size: 12px;
  font-style: normal;
}

.analysis-drawer {
  position: absolute;
  z-index: 6;
  top: 18px;
  right: 18px;
  width: 292px;
  max-height: calc(100% - 140px);
  overflow: auto;
  display: grid;
  gap: 8px;
  pointer-events: auto;
}
.drawer-card {
  padding: 10px;
  border: 1px solid rgba(215, 220, 230, .95);
  border-radius: 8px;
  background: rgba(255,255,255,.90);
  box-shadow: 0 10px 26px rgba(26, 34, 49, .12);
  backdrop-filter: blur(10px);
}
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.status-grid div {
  min-width: 0;
  padding: 7px;
  border-radius: 7px;
  background: #f3f5f8;
}
.status-grid span {
  display: block;
  color: #818996;
  font-size: 10px;
  text-transform: uppercase;
}
.status-grid strong {
  display: block;
  margin-top: 3px;
  color: #212936;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}
.panel-title span {
  color: #202633;
  font-size: 14px;
  font-weight: 900;
}
.panel-title small {
  color: #8a929f;
  font-size: 11px;
}

.candidate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.candidate-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 6px 9px;
  border: 1px solid #d7dce6;
  border-left: 4px solid #aab2bf;
  border-radius: 7px;
  background: #fff;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.candidate-card:hover,
.candidate-card.selected {
  transform: translateX(-2px);
  border-color: #9dbdf3;
  border-left-color: var(--blue);
  background: #eef5ff;
}
.candidate-card.danger { border-left-color: var(--orange); }
.candidate-card span {
  display: block;
  min-width: 0;
  color: #697280;
  font-size: 11px;
  line-height: 1.25;
}
.candidate-card b {
  display: block;
  margin-bottom: 2px;
  color: #202633;
  font-size: 13px;
}
.candidate-card strong {
  color: var(--green);
  font-size: 18px;
}
.candidate-card.danger strong { color: var(--orange); }

.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  margin-bottom: 11px;
}
.analysis-header span {
  color: #818996;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.analysis-header h2 {
  margin: 2px 0 0;
  color: #202633;
  font-size: 15px;
  line-height: 1.25;
}
.score-dial {
  width: 54px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #e8f7ef;
  color: var(--green);
  font-size: 22px;
  font-weight: 900;
}
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: #4d5664;
  font-size: 12px;
}
.metric-row b { color: #1f2632; }
.bar {
  width: 100%;
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf1;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #15856a;
  transition: width .35s ease;
}
.bar.risk i { background: var(--red); }
.analysis-note {
  margin-top: 11px;
  padding: 8px 10px;
  border: 1px solid #d8e5fb;
  border-radius: 7px;
  background: #f2f7ff;
  color: #465062;
  font-size: 12px;
  line-height: 1.45;
}
.issue-card {
  padding: 8px 10px;
  border: 1px solid #e4e7ee;
  border-left: 4px solid var(--red);
  border-radius: 7px;
  background: #fff;
}
.issue-card + .issue-card { margin-top: 7px; }
.issue-card b {
  color: var(--red);
  font-size: 13px;
}
.issue-card.medium { border-left-color: var(--yellow); }
.issue-card.medium b { color: var(--yellow); }
.issue-card p {
  margin: 4px 0 0;
  color: #566171;
  font-size: 12px;
  line-height: 1.4;
}

.timeline-panel {
  position: absolute;
  z-index: 6;
  left: 76px;
  right: 18px;
  bottom: 16px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(215, 220, 230, .95);
  border-radius: 9px;
  background: rgba(255,255,255,.90);
  box-shadow: 0 12px 28px rgba(26, 34, 49, .14);
  backdrop-filter: blur(12px);
}
.bottom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bottom-header strong {
  display: block;
  color: #202633;
  font-size: 14px;
}
.bottom-header span {
  display: block;
  margin-top: 3px;
  color: #7a8391;
  font-size: 11px;
}
.time-chip {
  padding: 6px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.log-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.log-card {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e1e5ed;
  border-top: 3px solid #98a1af;
  border-radius: 7px;
  background: #fff;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.log-card.active {
  transform: translateY(-2px);
  border-color: #9dbdf3;
  background: #f2f7ff;
}
.log-card b {
  display: block;
  margin-bottom: 4px;
  color: #202633;
  font-size: 12px;
}
.log-card span {
  display: block;
  color: #767f8d;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-card em {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.log-card.warning { border-top-color: var(--yellow); }
.log-card.warning em { color: var(--yellow); }
.log-card.success { border-top-color: var(--green); }
.log-card.success em { color: var(--green); }

.layer-popover {
  position: fixed;
  z-index: 30;
  left: 528px;
  top: 250px;
  width: 292px;
  display: none;
}
.layer-popover.active { display: block; }
.layer-popover-panel {
  padding: 13px;
  border: 1px solid #d2d8e4;
  border-radius: 9px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 44px rgba(24, 31, 45, .20);
}
.layer-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  border-bottom: 1px solid #edf0f4;
  color: #394251;
  font-size: 13px;
}
.layer-row:last-of-type { border-bottom: 0; }
.layer-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
}
.wide {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border-radius: 7px;
}
.secondary {
  border: 1px solid #d1d7e2;
  background: #f6f8fb;
  color: #3d4654;
  font-weight: 700;
}

.mini-progress,
.scan-progress {
  width: 100%;
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e6ee;
}
.mini-progress em,
.scan-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #177b64;
  transition: width .22s ease;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: rgba(235, 239, 246, .58);
  backdrop-filter: blur(3px);
}
.scan-overlay.active { display: grid; }
.scan-card {
  width: min(370px, calc(100% - 48px));
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 25px;
  border: 1px solid #d2d8e4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(24, 31, 45, .20);
}
.scan-card span {
  color: #6f7784;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.loader-ring {
  width: 44px;
  height: 44px;
  border: 3px solid #d6dce7;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.world-label {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  min-width: 82px;
  padding: 6px 10px 7px 12px;
  border: 1px solid rgba(215, 221, 232, .94);
  border-left: 4px solid #64748b;
  border-radius: 8px;
  background: rgba(255, 255, 255, .91);
  color: #222b38;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 9px 18px rgba(18, 28, 42, .14);
  backdrop-filter: blur(8px);
}
.world-label::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: -14px;
  width: 1px;
  height: 14px;
  background: rgba(90, 101, 118, .45);
}
.world-label span { display: block; }
.world-label span:first-child {
  color: #121926;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}
.world-label span + span {
  margin-top: 3px;
  color: #657080;
  font-size: 10px;
  font-weight: 800;
}
.world-label.small {
  min-width: auto;
  padding: 3px 6px;
  border-left-width: 1px;
  color: #6c7480;
  font-size: 10px;
}
.world-label.small::after { display: none; }
.world-label.equipment { border-left-color: #2563eb; }
.world-label.robot { border-left-color: #cc0088; }
.world-label.area { border-left-color: #d97706; }
.world-label.route { border-left-color: #12805c; }
.world-label.storage { border-left-color: #7c3aed; }
.world-label.danger {
  border-color: rgba(209, 18, 43, .35);
  border-left-color: var(--red);
  background: rgba(255, 242, 244, .94);
  color: #9a1025;
}
.world-label.sensor {
  border-color: rgba(23, 123, 100, .32);
  border-left-color: #14a098;
  background: rgba(239, 252, 248, .92);
  color: #0f6954;
}

/* Product-concept modules */
.operations-view {
  overflow: auto;
  padding: 28px 32px 36px;
  background: #f5f7fa;
  color: #1d2532;
}
.module-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.module-page-header.compact { margin-bottom: 20px; }
.module-page-header span,
.section-heading > div > span {
  color: #7c8592;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.module-page-header h1 { margin: 6px 0 4px; font-size: 25px; line-height: 1.15; letter-spacing: 0; }
.module-page-header p { margin: 0; color: #697382; font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.live-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #d9dee7; border-radius: 6px; background: #fff; color: #4f5968 !important; letter-spacing: 0 !important; }
.live-chip i { width: 7px; height: 7px; border-radius: 50%; background: #18a66f; }
.primary-action { min-height: 36px; padding: 0 14px; border-radius: 6px; background: #242b36; color: #fff; font-size: 12px; font-weight: 800; }
.primary-action:hover { background: #10151d; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { position: relative; min-height: 128px; padding: 16px; overflow: hidden; border: 1px solid #dde2ea; border-radius: 8px; background: #fff; }
.kpi-card.attention { border-top: 3px solid #d1122b; }
.kpi-card > span { display: block; color: #6d7683; font-size: 12px; font-weight: 700; }
.kpi-card > strong { display: block; margin-top: 10px; font-size: 27px; letter-spacing: 0; }
.kpi-card > em { display: block; margin-top: 6px; color: #7d8693; font-size: 11px; font-style: normal; }
.kpi-card > em.positive { color: #12805c; }
.kpi-card > button { position: absolute; right: 14px; bottom: 14px; color: #245ca7; font-size: 11px; font-weight: 800; }
.sparkline { position: absolute; right: 15px; bottom: 16px; width: 80px; height: 46px; display: flex; align-items: end; gap: 4px; }
.sparkline i { flex: 1; min-height: 5px; border-radius: 2px 2px 0 0; background: #7eb8aa; }
.meter { height: 6px; margin-top: 18px; overflow: hidden; border-radius: 5px; background: #e8ebf0; }
.meter i { display: block; height: 100%; border-radius: inherit; background: #2e8970; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr); gap: 14px; }
.dashboard-panel { min-width: 0; padding: 18px; border: 1px solid #dde2ea; border-radius: 8px; background: #fff; }
.cell-status-panel { min-height: 250px; }
.activity-panel { grid-column: 1 / -1; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { margin: 4px 0 0; font-size: 15px; letter-spacing: 0; }
.section-heading > button { color: #245ca7; font-size: 11px; font-weight: 800; }
.section-heading small { color: #8a929d; font-size: 11px; }
.cell-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.cell-node { position: relative; min-height: 106px; padding: 14px 12px; border: 1px solid #dce1e9; border-top: 4px solid #16835f; border-radius: 7px; background: #f9fafc; text-align: left; }
.cell-node.warning { border-top-color: #d08a00; background: #fffaf0; }
.cell-node span { color: #717a87; font-size: 10px; font-weight: 900; }
.cell-node b { display: block; margin-top: 7px; font-size: 12px; }
.cell-node em { display: block; margin-top: 12px; color: #16835f; font-size: 10px; font-style: normal; }
.cell-node.warning em { color: #b36f00; }
.flow-line { position: relative; height: 34px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; margin: 0 36px; border-bottom: 2px solid #cfd5df; }
.flow-line i { width: 8px; height: 8px; justify-self: center; align-self: end; margin-bottom: -5px; border: 2px solid #fff; border-radius: 50%; background: #667384; box-shadow: 0 0 0 1px #b6bfcb; }
.flow-line span { position: absolute; bottom: -21px; color: #929aa5; font-size: 9px; font-weight: 900; }
.flow-line span:last-child { right: 0; }
.alarm-chart { height: 136px; display: grid; grid-template-columns: repeat(8, 1fr); align-items: end; gap: 8px; padding-top: 5px; border-bottom: 1px solid #dfe3e9; }
.alarm-chart > div { height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.alarm-chart i { width: min(18px, 68%); min-height: 4px; border-radius: 3px 3px 0 0; background: #aeb8c5; }
.alarm-chart .current i { background: #d45b5b; }
.alarm-chart span { color: #8b939e; font-size: 9px; }
.chart-legend { display: flex; gap: 14px; margin-top: 14px; color: #707985; font-size: 10px; }
.chart-legend i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #aeb8c5; }
.chart-legend .high-dot { background: #d1122b; }
.chart-legend .medium-dot { background: #d08a00; }
.activity-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.activity-item { display: grid; grid-template-columns: 9px 1fr auto; gap: 10px; align-items: start; padding: 11px; border: 1px solid #e4e7ed; border-radius: 6px; }
.activity-item > i { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #16835f; }
.activity-item.warning > i { background: #d08a00; }
.activity-item.danger > i { background: #d1122b; }
.activity-item b { display: block; font-size: 11px; }
.activity-item p { margin: 4px 0 0; color: #747d89; font-size: 10px; line-height: 1.4; }
.activity-item time { color: #969da7; font-size: 9px; }

.segmented { display: flex; padding: 3px; border: 1px solid #d9dee6; border-radius: 7px; background: #eceff3; }
.segmented button { min-width: 62px; min-height: 30px; padding: 0 10px; border-radius: 5px; color: #69727f; font-size: 11px; font-weight: 800; }
.segmented button.active { background: #fff; color: #1f2733; box-shadow: 0 1px 4px rgba(32,40,52,.12); }
.alarm-layout { min-height: 480px; display: grid; grid-template-columns: minmax(520px, 1.25fr) minmax(300px, .75fr); gap: 14px; }
.table-panel, .detail-panel, .workorder-column, .workorder-detail { border: 1px solid #dce1e8; border-radius: 8px; background: #fff; }
.table-toolbar { min-height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid #e5e8ed; }
.table-toolbar strong { font-size: 12px; }
.table-toolbar span { color: #8b939e; font-size: 10px; }
.alarm-list { padding: 6px; }
.alarm-row { width: 100%; min-height: 70px; display: grid; grid-template-columns: 7px minmax(0, 1fr) 86px 60px; gap: 12px; align-items: center; padding: 10px; border-bottom: 1px solid #eceef2; text-align: left; }
.alarm-row:hover, .alarm-row.selected { border-radius: 6px; background: #f1f5fa; }
.alarm-row > i { width: 7px; height: 32px; border-radius: 4px; background: #aeb7c3; }
.alarm-row.high > i { background: #d1122b; }
.alarm-row.medium > i { background: #d08a00; }
.alarm-row b { display: block; font-size: 12px; }
.alarm-row p { margin: 4px 0 0; color: #69727f; font-size: 10px; }
.alarm-row span, .alarm-row time { color: #7d8692; font-size: 10px; }
.alarm-row.acknowledged { opacity: .58; }
.empty-state { padding: 70px 20px; color: #8a929c; font-size: 12px; text-align: center; }
.detail-panel { padding: 20px; }
.detail-status { display: flex; align-items: center; justify-content: space-between; }
.severity-chip { padding: 5px 8px; border-radius: 5px; background: #fff0f2; color: #b41025; font-size: 10px; font-weight: 900; }
.severity-chip.medium { background: #fff5db; color: #9b6100; }
.detail-panel h2 { margin: 18px 0 6px; font-size: 18px; letter-spacing: 0; }
.detail-panel > p { margin: 0 0 18px; color: #68717f; font-size: 12px; line-height: 1.55; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid #e1e5eb; border-radius: 6px; background: #e1e5eb; }
.detail-meta div { padding: 10px; background: #fafbfc; }
.detail-meta span { display: block; color: #8a929d; font-size: 9px; }
.detail-meta b { display: block; margin-top: 4px; font-size: 11px; }
.detail-recommendation { margin-top: 14px; padding: 12px; border-left: 3px solid #2b69bf; background: #f2f6fc; color: #526071; font-size: 11px; line-height: 1.5; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.detail-actions button { min-height: 36px; border: 1px solid #ccd3de; border-radius: 6px; background: #fff; font-size: 11px; font-weight: 800; }
.detail-actions button.primary { border-color: #252c37; background: #252c37; color: #fff; }

.workorder-board { min-height: 490px; display: grid; grid-template-columns: repeat(3, minmax(190px, .78fr)) minmax(290px, 1.15fr); gap: 12px; }
.workorder-column { padding: 12px; background: #eef1f5; }
.column-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; color: #596371; font-size: 11px; font-weight: 900; }
.column-title::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #8993a0; }
.column-title.progress::before { background: #2563eb; }
.column-title.done::before { background: #16835f; }
.column-title span { flex: 1; }
.column-title b { min-width: 22px; padding: 3px 6px; border-radius: 9px; background: #fff; text-align: center; }
.workorder-list { display: grid; gap: 8px; }
.workorder-card { width: 100%; min-height: 132px; padding: 12px; border: 1px solid #d9dee6; border-left: 4px solid #8993a0; border-radius: 7px; background: #fff; text-align: left; }
.workorder-card.priority-high { border-left-color: #d1122b; }
.workorder-card.priority-medium { border-left-color: #d08a00; }
.workorder-card.selected { box-shadow: 0 0 0 2px #8ab2ed; }
.workorder-card > span { color: #78818d; font-size: 9px; font-weight: 900; }
.workorder-card b { display: block; margin-top: 7px; font-size: 12px; line-height: 1.4; }
.workorder-card p { margin: 7px 0 10px; color: #737c88; font-size: 10px; }
.workorder-card footer { display: flex; justify-content: space-between; color: #8b939d; font-size: 9px; }
.workorder-detail { padding: 20px; }
.workorder-detail h2 { margin: 13px 0 5px; font-size: 17px; letter-spacing: 0; }
.workorder-detail > p { margin: 0; color: #707986; font-size: 11px; line-height: 1.5; }
.progress-steps { display: grid; gap: 8px; margin: 20px 0; }
.progress-step { display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: center; color: #828a95; font-size: 10px; }
.progress-step i { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #cfd5de; border-radius: 50%; background: #fff; font-style: normal; }
.progress-step.active { color: #26303c; font-weight: 800; }
.progress-step.active i { border-color: #2563eb; background: #2563eb; color: #fff; }
.workorder-note { padding: 11px; border-radius: 6px; background: #f3f5f8; color: #626d7a; font-size: 10px; line-height: 1.5; }

.context-menu { position: fixed; z-index: 40; top: 122px; right: 30px; width: 205px; display: none; padding: 6px; border: 1px solid #d8dde6; border-radius: 7px; background: #fff; box-shadow: 0 14px 34px rgba(28,35,48,.18); }
.context-menu.active { display: grid; }
.context-menu button { min-height: 36px; padding: 0 10px; border-radius: 5px; text-align: left; font-size: 11px; }
.context-menu button:hover { background: #f1f4f8; }
.toast-stack { position: fixed; z-index: 80; right: 22px; bottom: 22px; display: grid; gap: 8px; pointer-events: none; }
.toast { width: 290px; padding: 12px 14px; border: 1px solid #d9dee6; border-left: 4px solid #16835f; border-radius: 7px; background: #fff; color: #343e4c; box-shadow: 0 12px 30px rgba(24,31,43,.18); font-size: 11px; animation: toastIn .2s ease; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1320px) {
  .app-shell { grid-template-columns: 66px 310px minmax(620px, 1fr); }
  .app-shell.sidebar-collapsed { grid-template-columns: 66px 0 minmax(620px, 1fr); }
  .global-rail { width: 54px; margin-left: 6px; }
  .site-sidebar { padding-left: 18px; padding-right: 18px; }
  .workspace {
    height: calc(100vh - 52px);
    margin-top: 52px;
  }
  .analysis-drawer { width: 268px; }
  .viewport-hud.bottom-right { right: 304px; }
  .timeline-panel { grid-template-columns: 220px minmax(0, 1fr); }
  .operations-view { padding: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workorder-board { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .workorder-detail { grid-column: 1 / -1; }
}

@media (max-width: 1120px) {
  html, body { overflow: auto; }
  body { min-width: 0; }
  .app-shell {
    grid-template-columns: 66px minmax(260px, 310px) minmax(560px, 1fr);
    min-height: 820px;
  }
  .module-tabs { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .analysis-drawer {
    top: 12px;
    right: 12px;
    width: 250px;
  }
  .timeline-panel {
    left: 70px;
    grid-template-columns: 1fr;
  }
  .log-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .alarm-layout { grid-template-columns: 1fr; }
  .activity-list { grid-template-columns: 1fr; }
}
