/* Brand tokens and shared controls. Layout colours are kept central for maintainability. */
:root {
  --aebi-red: #e30613;
  --aebi-red-dark: #bc0510;
  --ink: #222a32;
  --muted: #6c7884;
  --line: #e2e7ec;
  --canvas: #f2f4f7;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
}
a {
  color: var(--aebi-red-dark);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button, input, select, textarea {
  font: inherit;
}
button, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid #d6dde4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
button:hover {
  background: #f5f7f9;
  border-color: #acb6c0;
}
button:disabled {
  opacity: .45;
  cursor: default;
}
.primary {
  background: var(--aebi-red);
  border-color: var(--aebi-red);
  color: white;
}
.primary:hover {
  background: var(--aebi-red-dark);
  border-color: var(--aebi-red-dark);
  color: white;
}
button:focus-visible, a:focus-visible {
  outline: 3px solid #94b6d2;
  outline-offset: 3px;
}
.topbar {
  min-height: 78px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: #242b32;
  color: #fff;
  border-top: 4px solid var(--aebi-red);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 19px;
  color: #fff;
  text-decoration: none;
}
.brand:hover {
  color: #fff;
  text-decoration: none;
}
.brand-logo {
  display: block;
  width: 98px;
  height: 62px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}
.brand-logo-stack {
  display: inline-grid;
  flex-shrink: 0;
}
.brand-logo-stack .brand-logo {
  grid-area: 1 / 1;
}
.brand-logo-accent {
  filter: none;
  clip-path: inset(0 0 29% 0);
  pointer-events: none;
}
.brand-title {
  font-size: 23px;
  line-height: 24px;
  font-weight: 650;
  letter-spacing: -.4px;
}
.brand-title small {
  display: block;
  margin-top: 3px;
  color: #b4c0c9;
  font-size: 12px;
  font-weight: 450;
  letter-spacing: .3px;
}
.simulation {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #58604a;
  border-radius: 5px;
  background: #363930;
  color: #f4d48b;
  font-size: 11px;
  font-weight: 650;
}
.simulation i {
  width: 6px;
  height: 6px;
  background: #efbc50;
  border-radius: 50%;
}
.account-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  font-size: 12px;
  font-weight: 550;
}
.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #59646e;
  border-radius: 50%;
  color: #dce4eb;
  font-size: 12px;
}
.account-link {
  color: #c7d1da;
  font-size: 12px;
}
.topbar form {
  margin: 0;
}
.signout {
  min-height: 32px;
  padding: 6px 11px;
  background: transparent;
  border-color: #57626d;
  color: #e6edf3;
  font-size: 11px;
}
.signout:hover {
  background: #343e48;
  color: white;
}
.navigation {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 57px;
  padding: 0 32px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.navigation a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 57px;
  padding: 0 18px;
  color: #64717d;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.navigation a > span {
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
.navigation a:hover {
  color: var(--ink);
  background: #f8f9fb;
}
.navigation a.active {
  color: var(--aebi-red);
  border-bottom-color: var(--aebi-red);
  background: #fff6f6;
}
.nav-location {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #9ba5ae;
  font-weight: 650;
}
.app-content {
  max-width: 2200px;
  padding: 28px 32px 15px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.7px;
  color: #84909b;
}
h1 {
  margin: 7px 0 8px;
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -.7px;
  font-weight: 650;
}
h2 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 650;
}
h3 {
  margin: 21px 0 11px;
  font-size: 14px;
  font-weight: 650;
}
p {
  margin: 8px 0 14px;
  line-height: 1.65;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.heading-separator {
  padding: 0 8px;
  color: #b7c0c7;
}
.live-badge {
  padding: 7px 11px;
  border: 1px solid #d6e7de;
  border-radius: 5px;
  background: #edf6f1;
  color: #2c7756;
  font-size: 11px;
  font-weight: 600;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 23px;
}
.metrics > div {
  position: relative;
  padding: 17px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 4px #24344204;
}
.metrics > div::before {
  content: '';
  position: absolute;
  top: 19px;
  right: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc9c31;
}
.metrics > div:nth-child(2)::before {
  background: var(--aebi-red);
}
.metrics > div:nth-child(3)::before {
  background: #3189d2;
}
.metrics > div:nth-child(4)::before {
  background: #94a0ae;
}
.metrics span {
  color: var(--muted);
  font-size: 12px;
}
.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 34px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -.7px;
}
.metrics small {
  font-size: 14px;
}
.red-text {
  color: #cb2230 !important;
}
.blue-text {
  color: #2476b5 !important;
}
.panel {
  padding: 23px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  box-shadow: 0 2px 5px #24344204;
  min-width: 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-heading h2 {
  margin: 0;
}
.panel-heading > span {
  color: var(--muted);
  font-size: 12px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.floor-panel {
  padding: 19px;
}
.floor-panel > .panel-heading {
  padding: 1px 2px 0;
}
/* The image and tower coordinates share this containing block; avoid image padding. */
.floor {
  position: relative;
  width: 100%;
  line-height: 0;
  isolation: isolate;
}
.floor img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}
.floor.editing {
  cursor: crosshair;
  outline: 2px dashed #e3061355;
  outline-offset: 4px;
}
.tower {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 25px;
  min-height: 0;
  padding: 4px 3px 3px;
  transform: translate(-50%, -50%);
  border: 1px solid #fff;
  border-radius: 5px;
  background: #25313c;
  box-shadow: 0 2px 5px #10213180, 0 0 0 1px #25313c;
  line-height: normal;
  cursor: pointer;
  touch-action: none;
}
.tower:hover {
  background: #25313c;
  border-color: white;
  outline: 3px solid #8db4d1;
  outline-offset: 2px;
  z-index: 4;
}
.tower.selected {
  outline: 3px solid var(--aebi-red);
  outline-offset: 3px;
  z-index: 5;
}
.editing .tower {
  cursor: grab;
}
.editing .tower:active {
  cursor: grabbing;
}
.light {
  display: block;
  flex: 0 0 auto;
  width: 17px;
  height: 8px;
  border-radius: 2px;
  border: 1px solid #ffffff15;
}
.light.red {
  background: #63303b;
}
.light.orange {
  background: #66513a;
}
.light.green {
  background: #2d5144;
}
.light.blue {
  background: #304f68;
}
.light.red.on {
  background: #ff4655;
  box-shadow: 0 0 4px #ff46557a;
}
.light.orange.on {
  background: #ffbc38;
  box-shadow: 0 0 4px #ffbc386b;
}
.light.green.on {
  background: #3add8a;
  box-shadow: 0 0 4px #3add8a80;
}
.light.blue.on {
  background: #45afff;
  box-shadow: 0 0 4px #45afff80;
}
.tower-label {
  display: block;
  width: 100%;
  margin-top: 1px;
  color: white;
  font-size: 8px;
  font-weight: 700;
  line-height: 10px;
  text-align: center;
}
.tower.offline {
  border: 2px dashed #8798a6;
  filter: saturate(.3);
}
.tower.offline .light.on {
  opacity: .6;
  box-shadow: none;
}
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid #edf0f3;
  font-size: 11px;
  color: #5d6b77;
  line-height: 1.5;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.floor-panel > .muted {
  margin-bottom: 0;
  margin-top: 10px;
  font-size: 10px;
}
.workplace-panel {
  border-top: 3px solid var(--aebi-red);
}
.workplace-panel h2 {
  margin-top: 9px;
  font-size: 21px;
}
.workplace-panel > p {
  font-size: 12px;
}
.status-stack {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.status-stack span, .badge {
  display: inline-block;
  padding: 5px 8px;
  border: 1px solid #e3e9ee;
  border-radius: 4px;
  background: #f5f7f9;
  font-size: 11px;
}
.ticket-link {
  display: block;
  padding: 13px;
  margin: 13px 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--aebi-red);
  border-radius: 5px;
  color: var(--ink);
}
.ticket-link strong, .ticket-link span {
  display: block;
  margin-bottom: 5px;
}
.ticket-link span {
  font-size: 12px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.actions button {
  font-size: 12px;
}
hr {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
label {
  display: block;
  margin: 14px 0;
  color: #50616f;
  font-size: 12px;
  font-weight: 550;
}
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid #d6dee5;
  border-radius: 5px;
  background: white;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #b3c8d8;
  outline-offset: 1px;
}
input[type=checkbox] {
  accent-color: var(--aebi-red);
}
.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 12px;
}
.inline input {
  width: auto;
  margin: 0;
}
.placement-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: #fff4f4;
  border: 1px solid #f6d4d7;
  border-radius: 5px;
  color: #9f1d28;
  line-height: 1.5;
}
.placement-icon {
  font-size: 26px;
}
.placement-banner strong {
  display: block;
  font-size: 12px;
}
.placement-banner div > span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}
.coordinate-readout {
  display: flex;
  gap: 10px;
}
.coordinate-readout > span {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
  color: var(--muted);
}
.coordinate-readout strong {
  float: right;
  color: var(--ink);
}
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
}
.filters label {
  margin: 0;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #7b8994;
}
td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf0f3;
  font-size: 12px;
}
td small {
  display: block;
  margin-top: 5px;
  color: #798894;
  font-size: 10px;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafbfc;
}
.table-panel {
  padding: 21px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.wide {
  grid-column: 1 / -1;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
fieldset:disabled input, fieldset:disabled textarea, fieldset:disabled select {
  background: #f5f7f9;
}
dt {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 500;
  color: #7b8994;
}
dd {
  margin: 4px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.block {
  display: block;
}
.warning {
  padding: 12px;
  border: 1px solid #efd3a0;
  border-radius: 5px;
  background: #fff4dc;
  color: #72501b;
}
.history details {
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.history summary {
  cursor: pointer;
  line-height: 1.6;
}
.history pre {
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  color: #647787;
}
.history-values, .analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.pareto-row {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f3;
  font-size: 12px;
}
.pareto-row strong {
  font-size: 11px;
  color: #647583;
}
.bar {
  height: 9px;
  max-width: 100%;
  margin: 8px 0;
  border-radius: 2px;
  background: var(--aebi-red);
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.record-button {
  display: block;
  width: 100%;
  margin: 9px 0;
  text-align: left;
  font-size: 12px;
}
.record-button span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
}
.auth-card {
  max-width: 460px;
  margin: 50px auto;
  padding: 35px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--aebi-red);
  border-radius: 9px;
  background: white;
  box-shadow: 0 8px 28px #26374608;
}
.auth-card h1 {
  margin-bottom: 20px;
}
.auth-card .primary {
  margin-top: 15px;
}
.message:empty {
  display: none;
}
.message {
  padding: 8px 0;
  color: #b52230;
  font-size: 12px;
}
.empty {
  padding: 45px;
  text-align: center;
}
footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 32px 25px;
  font-size: 10px;
  color: #8995a0;
}
footer strong {
  color: #647380;
  font-size: 10px;
  letter-spacing: .7px;
}
footer > span:last-child {
  margin-left: auto;
}
#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 0;
  z-index: 100;
  width: 100%;
  padding: 15px;
  background: #ffe4d7;
}
.validation-message {
  color: #c62632;
}
.components-rejoining-animation {
  display: none;
}
@media (min-width: 1700px) {
  .app-content {
  padding: 32px 40px 18px;
}
  .overview-grid {
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
}
  .floor-panel {
  padding: 24px;
}
  .tower {
  width: 29px;
  padding: 4px;
}
  .light {
  width: 19px;
  height: 10px;
}
  .tower-label {
  font-size: 9px;
  line-height: 11px;
}
}
@media (max-width: 1200px) {
  .app-content {
  padding: 23px 22px 12px;
}
  .topbar {
  padding: 0 22px;
  gap: 16px;
}
  .navigation {
  padding: 0 22px;
}
  .overview-grid {
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 16px;
}
  .floor-panel {
  padding: 14px;
}
  .legend {
  gap: 10px;
  font-size: 10px;
}
  .tower {
  width: 22px;
  padding: 3px 2px;
  gap: 1px;
}
  .light {
  width: 14px;
  height: 7px;
}
  .tower-label {
  font-size: 7px;
  line-height: 9px;
}
  .metrics > div {
  padding: 15px 17px;
}
  .detail-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
}
}
@media (max-width: 850px) {
  .overview-grid, .detail-grid, .analysis-grid {
  grid-template-columns: 1fr;
}
  .metrics {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
  .topbar {
  flex-wrap: wrap;
  padding: 14px 16px;
  gap: 12px;
}
  .brand-logo {
  width: 88px;
  height: 58px;
}
  .brand-title {
  font-size: 20px;
}
  .navigation {
  padding: 0 8px;
  overflow-x: auto;
  gap: 0;
}
  .navigation a {
  padding: 0 12px;
}
  .nav-location, .account-name, .account-link {
  display: none;
}
  .app-content {
  padding: 20px 15px 8px;
}
  .panel {
  padding: 16px;
}
  .form-grid, .check-grid, .history-values {
  grid-template-columns: 1fr;
}
  h1 {
  font-size: 25px;
}
  .live-badge {
  font-size: 10px;
  white-space: nowrap;
}
  footer {
  padding: 14px 15px;
  gap: 10px;
  flex-wrap: wrap;
}
}
/* Keep the complete factory map on a laptop or full-HD factory display. */
@media (min-width: 851px) {
  .topbar {
  min-height: 68px;
}
  .navigation, .navigation a {
  min-height: 50px;
}
  .app-content {
  padding-top: 22px;
}
  .page-heading {
  margin-bottom: 19px;
}
  .metrics > div {
  padding-top: 13px;
  padding-bottom: 13px;
}
  .metrics strong {
  font-size: 30px;
}
  /* The image and tower coordinates share this containing block; avoid image padding. */
.floor {
  width: min(100%, max(480px, calc((100dvh - 525px) * 2.09765625)));
  margin: 0 auto;
}
}
/* Lamp dimensions scale with the image, so labels remain visible. */
/* The image and tower coordinates share this containing block; avoid image padding. */
.floor {
  container-type: inline-size;
}
.tower {
  width: clamp(17px, 1.9cqw, 28px);
  padding: 3px 2px;
  gap: 1px;
}
.light {
  width: 100%;
  height: clamp(4px, .6cqw, 8px);
}
.tower-label {
  font-size: clamp(6px, .7cqw, 9px);
  line-height: 1.2;
}
.workplace-picker {
  margin: 0 0 20px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
}
.message.success {
  position: fixed;
  right: 26px;
  bottom: 22px;
  z-index: 30;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid #d2e4d9;
  border-left: 3px solid #2c8b5d;
  border-radius: 5px;
  background: white;
  color: #27764f;
  box-shadow: 0 3px 14px #21314012;
}

.email-recipient {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
