:root {
  --bg: #07101e;
  --panel: #0d1728;
  --panel-2: #111d31;
  --panel-3: #152239;
  --text: #e6eefb;
  --muted: #91a6c3;
  --muted-2: #607696;
  --line: rgba(145, 166, 195, 0.18);
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --warn: #f59e0b;
  --danger: #ef4444;
  --ok: #22c55e;
  --orange: #fb923c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(56, 189, 248, 0.22), transparent 32rem),
    radial-gradient(circle at 85% 18%, rgba(94, 234, 212, 0.18), transparent 30rem),
    linear-gradient(135deg, #050914 0%, #07101e 48%, #0b1324 100%);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.is-hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr);
  gap: 40px;
  padding: 56px;
  align-items: center;
  overflow: hidden;
}

.login-card {
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 34px;
  background: rgba(9, 17, 31, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  z-index: 2;
}

.login-logo {
  width: 248px;
  max-width: 90%;
  margin-bottom: 28px;
}

.login-card h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.login-copy,
.security-note {
  color: var(--muted);
  line-height: 1.65;
}

.login-copy {
  margin: 0 0 28px;
  max-width: 46ch;
}

.security-note {
  margin: 22px 0 0;
  font-size: 13px;
}

#login-form {
  display: grid;
  gap: 10px;
}

#login-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#login-form input {
  height: 54px;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 0 16px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.86);
  outline: none;
  transition: border 180ms ease, box-shadow 180ms ease;
}

#login-form input:focus {
  border-color: rgba(94, 234, 212, 0.8);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

.primary-btn,
.ghost-btn,
.logout-btn,
.command-btn,
.filter-btn,
.icon-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 150ms ease, opacity 150ms ease, border-color 150ms ease, background 150ms ease;
}

.primary-btn {
  height: 56px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #05111e;
  box-shadow: 0 16px 48px rgba(94, 234, 212, 0.2);
}

.primary-btn:hover,
.ghost-btn:hover,
.logout-btn:hover,
.command-btn:hover,
.filter-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.login-actions {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.ghost-btn,
.logout-btn,
.command-btn,
.filter-btn,
.icon-btn {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
}

.ghost-btn,
.logout-btn,
.command-btn,
.filter-btn {
  min-height: 40px;
  padding: 0 16px;
}

.login-error {
  color: #fecaca;
  font-size: 13px;
}

.login-visual {
  min-height: 680px;
  position: relative;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.72;
}

.orb-a {
  width: 440px;
  height: 440px;
  right: 12%;
  top: 8%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.34), transparent 62%);
  animation: float 7s ease-in-out infinite;
}

.orb-b {
  width: 300px;
  height: 300px;
  right: 38%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.24), transparent 66%);
  animation: float 8.5s ease-in-out infinite reverse;
}

.demo-map-card {
  position: absolute;
  width: min(760px, 88vw);
  height: 520px;
  right: 0;
  top: 64px;
  border: 1px solid var(--line);
  border-radius: 32px;
  overflow: hidden;
  background:
    linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    rgba(9, 17, 31, 0.78);
  background-size: 42px 42px;
  box-shadow: var(--shadow);
  transform: perspective(1400px) rotateY(-9deg) rotateX(4deg);
}

.mini-topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.7);
}

.mini-station {
  position: absolute;
  width: 132px;
  height: 88px;
  border-radius: 22px;
  border: 1px solid rgba(94, 234, 212, 0.32);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: inset 0 0 40px rgba(94, 234, 212, 0.08);
}

.mini-station::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(145, 166, 195, 0.28);
}

.s1 { left: 74px; top: 126px; }
.s2 { right: 98px; top: 150px; }
.s3 { left: 248px; bottom: 88px; }

.mini-path {
  position: absolute;
  left: 118px;
  right: 138px;
  top: 232px;
  height: 180px;
  border: 3px dashed rgba(56, 189, 248, 0.35);
  border-left: 0;
  border-radius: 0 120px 120px 0;
}

.mini-amr {
  position: absolute;
  width: 72px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f766e, #5eead4);
  box-shadow: 0 0 0 8px rgba(94, 234, 212, 0.1), 0 18px 35px rgba(0,0,0,0.28);
  animation: miniDrive 6s linear infinite;
}

.mini-amr::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 18px;
  border-radius: 8px;
  left: 19px;
  top: -10px;
  background: #f8fafc;
}

.mini-panel {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 220px;
  height: 118px;
  border-radius: 22px;
  padding: 22px;
  background: rgba(2, 6, 23, 0.82);
  border: 1px solid var(--line);
}

.mini-panel span {
  display: block;
  height: 11px;
  margin-bottom: 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.8), rgba(56, 189, 248, 0.2));
  animation: pulseBar 2s ease-in-out infinite;
}

.mini-panel span:nth-child(2) { width: 72%; animation-delay: .25s; }
.mini-panel span:nth-child(3) { width: 48%; animation-delay: .5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.04); }
}

@keyframes miniDrive {
  0% { left: 80px; top: 302px; transform: rotate(0deg); }
  28% { left: 316px; top: 302px; transform: rotate(0deg); }
  46% { left: 510px; top: 220px; transform: rotate(-18deg); }
  66% { left: 540px; top: 154px; transform: rotate(0deg); }
  82% { left: 304px; top: 358px; transform: rotate(160deg); }
  100% { left: 80px; top: 302px; transform: rotate(180deg); }
}

@keyframes pulseBar {
  0%, 100% { opacity: 0.45; transform: scaleX(.86); transform-origin: left; }
  50% { opacity: 1; transform: scaleX(1); transform-origin: left; }
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(7, 16, 30, 0.82);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 10;
}

.brand-block {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 76px;
}

.brand-block img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  object-position: left;
  border-radius: 18px;
}

.brand-block strong,
.user-chip strong,
.side-card strong {
  display: block;
}

.brand-block span,
.side-card small,
.user-chip small,
.clock-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
}

.nav-btn.active,
.nav-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(15, 23, 42, 0.88);
}

.nav-btn.active {
  box-shadow: inset 4px 0 0 var(--accent);
}

.side-card {
  margin-top: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.live-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.14), 0 0 22px rgba(34, 197, 94, 0.62);
}

.logout-btn {
  width: 100%;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 30, 0.76);
  backdrop-filter: blur(20px);
}

.topbar h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -0.035em;
}

.topbar-right {
  display: flex;
  gap: 14px;
  align-items: center;
}

.clock-box,
.user-chip {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
}

.clock-box {
  display: block;
  padding: 10px 16px;
  text-align: right;
}

.clock-box strong {
  font-variant-numeric: tabular-nums;
}

.user-chip {
  padding: 8px 14px 8px 8px;
}

#user-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange), var(--danger));
  color: #fff;
  font-weight: 900;
}

.icon-btn {
  width: 46px;
  height: 46px;
  display: none;
}

.content {
  padding: 30px;
  display: grid;
  gap: 24px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 23, 40, 0.82);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.card-pad {
  padding: 22px;
}

.card-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head h3,
.card h3,
.metric h3 {
  margin: 0;
}

.card-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.metric {
  position: relative;
  min-height: 148px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(94, 234, 212, 0.11), transparent 50%),
    rgba(15, 23, 42, 0.78);
  overflow: hidden;
}

.metric small {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.metric strong {
  display: block;
  font-size: clamp(28px, 4vw, 42px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.metric em {
  display: inline-flex;
  gap: 6px;
  margin-top: 14px;
  color: var(--accent);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.kpi-ring {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 8px solid rgba(94, 234, 212, 0.12);
  box-shadow: inset 0 0 0 4px rgba(56, 189, 248, 0.12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.hero-card {
  padding: 26px;
  min-height: 280px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  align-items: center;
  background:
    radial-gradient(circle at 78% 26%, rgba(56, 189, 248, 0.22), transparent 38%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(9, 17, 31, 0.72));
}

.hero-card h3 {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.4vw, 50px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero-card p {
  color: var(--muted);
  line-height: 1.65;
  max-width: 62ch;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(2, 6, 23, 0.28);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.ok,
.status-badge.ok { color: #bbf7d0; border-color: rgba(34, 197, 94, 0.32); background: rgba(34, 197, 94, 0.08); }
.pill.warn,
.status-badge.warn { color: #fde68a; border-color: rgba(245, 158, 11, 0.32); background: rgba(245, 158, 11, 0.08); }
.pill.info,
.status-badge.info { color: #bae6fd; border-color: rgba(56, 189, 248, 0.32); background: rgba(56, 189, 248, 0.08); }
.pill.danger,
.status-badge.danger { color: #fecaca; border-color: rgba(239, 68, 68, 0.32); background: rgba(239, 68, 68, 0.08); }

.live-map {
  position: relative;
  min-height: 500px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    #0a1425;
  background-size: 38px 38px;
}

.map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.station {
  position: absolute;
  width: 140px;
  min-height: 72px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(145, 166, 195, 0.28);
  border-radius: 18px;
  background: rgba(17, 29, 49, 0.92);
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.22);
}

.station strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.station small {
  color: var(--muted);
  font-size: 11px;
}

.station.active {
  border-color: rgba(94, 234, 212, 0.75);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.08), 0 16px 40px rgba(0,0,0,0.22);
}

.amr-marker {
  position: absolute;
  width: 76px;
  height: 52px;
  transform: translate(-50%, -50%);
  border-radius: 17px;
  border: 1px solid rgba(94, 234, 212, 0.5);
  background: linear-gradient(135deg, #0f766e, #14b8a6 55%, #67e8f9);
  box-shadow: 0 0 0 8px rgba(94, 234, 212, 0.09), 0 18px 42px rgba(0,0,0,0.32);
  transition: left 900ms linear, top 900ms linear, transform 900ms ease;
}

.amr-marker::before {
  content: attr(data-id);
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.amr-marker::after {
  content: "";
  position: absolute;
  left: 18px;
  top: -7px;
  width: 40px;
  height: 16px;
  border-radius: 8px 8px 3px 3px;
  background: #f8fafc;
}

.amr-marker.idle {
  background: linear-gradient(135deg, #334155, #64748b);
  border-color: rgba(148, 163, 184, 0.45);
}

.amr-marker.alert {
  background: linear-gradient(135deg, #991b1b, #f97316);
  border-color: rgba(239, 68, 68, 0.66);
  animation: shake 1.3s linear infinite;
}

@keyframes shake {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
}

.map-legend {
  position: absolute;
  left: 18px;
  bottom: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.robot-list,
.alarm-list,
.task-list,
.timeline,
.insight-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.robot-row,
.alarm-row,
.task-row,
.timeline-row,
.insight-row {
  display: grid;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.54);
}

.robot-row {
  grid-template-columns: 1.2fr .9fr .9fr .8fr auto;
}

.robot-row strong,
.alarm-row strong,
.task-row strong {
  display: block;
}

.robot-row small,
.alarm-row small,
.task-row small,
.timeline-row small,
.insight-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.battery {
  width: 100%;
  min-width: 110px;
  height: 13px;
  border-radius: 999px;
  background: rgba(96, 118, 150, 0.26);
  overflow: hidden;
  border: 1px solid var(--line);
}

.battery span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 600ms ease;
}

.battery.low span {
  background: linear-gradient(90deg, var(--warn), var(--danger));
}

.commands {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.command-btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.command-btn.primary {
  background: rgba(94, 234, 212, 0.14);
  border-color: rgba(94, 234, 212, 0.42);
  color: #ccfbf1;
}

.command-btn.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.38);
  color: #fde68a;
}

.command-btn.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.38);
  color: #fecaca;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  padding: 20px;
}

.step-card {
  position: relative;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.74);
  padding: 16px;
  overflow: hidden;
}

.step-card::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  height: 5px;
  border-radius: 99px;
  background: rgba(96, 118, 150, 0.22);
}

.step-card.active::after {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: progressFlash 1.4s ease-in-out infinite;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(94, 234, 212, 0.12);
  color: var(--accent);
  font-weight: 900;
}

.step-card h4 {
  margin: 14px 0 8px;
}

.step-card p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
  line-height: 1.48;
}

@keyframes progressFlash {
  0%, 100% { opacity: .42; }
  50% { opacity: 1; }
}

.video-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 20px;
}

.video-tile {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #020617;
}

.video-tile video {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
  object-fit: cover;
  background: #020617;
}

.video-meta {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
}

.video-meta strong { display: block; }
.video-meta small { color: var(--muted); }

.video-stack {
  display: grid;
  gap: 20px;
}

.video-stack .video-tile video {
  min-height: 180px;
}

.chart-wrap {
  height: 300px;
  padding: 18px;
}

.chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.timeline-row {
  grid-template-columns: 110px 1fr auto;
}

.alarm-row {
  grid-template-columns: 92px 1fr auto;
}

.task-row {
  grid-template-columns: 1.2fr .8fr .8fr auto;
}

.insight-row {
  grid-template-columns: auto 1fr;
}

.insight-dot {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
}

.integration-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.endpoint {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
  margin-bottom: 12px;
}

.endpoint code {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  word-break: break-all;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
}

.config-table th,
.config-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 10px;
  text-align: left;
  vertical-align: top;
}

.config-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  min-width: 280px;
  max-width: min(480px, calc(100vw - 44px));
  padding: 16px 18px;
  border-radius: 18px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms ease, opacity 200ms ease;
  z-index: 100;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-card,
  .video-grid,
  .integration-layout { grid-template-columns: 1fr; }
  .process-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .login-screen {
    grid-template-columns: 1fr;
    padding: 28px;
  }
  .login-visual {
    display: none;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 292px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .icon-btn {
    display: inline-grid;
    place-items: center;
  }
  .topbar {
    padding: 16px;
  }
  .topbar-right .clock-box {
    display: none;
  }
  .content {
    padding: 16px;
  }
  .robot-row,
  .task-row,
  .alarm-row,
  .timeline-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .process-flow {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 24px;
    border-radius: 24px;
  }
  .user-chip {
    display: none;
  }
  .live-map {
    min-height: 620px;
  }
  .station {
    width: 120px;
  }
  .map-legend {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Build 2.0 additions: HMI, traceability, Google sync and title-logo header */
.topbar-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
  flex: 0 0 auto;
}

.mini-hmi-card,
.sync-stack,
.cloud-tiles,
.report-card,
.qr-flow,
.integration-flow,
.checklist {
  padding: 18px;
}

.mini-hmi-card {
  display: grid;
  gap: 12px;
}

.mini-hmi-card div,
.sync-card,
.cloud-tiles div,
.report-card,
.flow-row,
.check-row,
.qr-step {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
}

.mini-hmi-card div,
.sync-card,
.cloud-tiles div {
  padding: 14px;
}

.mini-hmi-card span,
.sync-card small,
.cloud-tiles small,
.report-card small,
.flow-row small,
.check-row small,
.qr-step small,
.tag-tile small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mini-hmi-card strong,
.sync-card strong,
.cloud-tiles strong,
.report-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.sync-stack {
  display: grid;
  gap: 12px;
}

.hmi-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  gap: 20px;
}

.hmi-card {
  overflow-x: auto;
}

.hmi-screen {
  margin: 18px;
  min-width: 900px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  overflow: hidden;
  background: #f4f7fb;
  color: #111827;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.25);
}

.hmi-topline {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #a7b0bd;
  background: #eef2f7;
  font-size: 12px;
}

.hmi-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hmi-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.hmi-reset,
.hmi-logout,
.hmi-main-btn,
.hmi-speed-buttons button,
.hmi-nav-grid button,
.hmi-bottom-controls button {
  border: 1px solid #9ca3af;
  background: linear-gradient(#ffffff, #dce4ee);
  color: #111827;
  min-height: 30px;
  border-radius: 4px;
  font-weight: 800;
  padding: 0 10px;
}

.hmi-reset {
  color: #111827;
  background: #ffffff;
}

.hmi-warning {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 8px;
  border-radius: 4px;
  background: #facc15;
  color: #111827;
}

.hmi-title {
  padding: 8px 12px;
  text-align: center;
  font-weight: 900;
  background: linear-gradient(#f8fafc, #d9e2ec);
  border-bottom: 1px solid #9ca3af;
}

.hmi-event-window {
  height: 180px;
  overflow: auto;
  background: white;
  border-bottom: 1px solid #9ca3af;
}

.hmi-event-window table,
.hmi-event-window th,
.hmi-event-window td {
  border-collapse: collapse;
}

.hmi-event-window table {
  width: 100%;
}

.hmi-event-window th {
  position: sticky;
  top: 0;
  padding: 7px 8px;
  text-align: left;
  background: #6b7280;
  color: #fff;
  font-size: 12px;
}

.hmi-event-window td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
}

.hmi-panel-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr 1.05fr 1.1fr;
  gap: 10px;
  padding: 12px;
  background: #edf2f7;
}

.hmi-section {
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.hmi-section h4 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #d1d5db;
  text-align: center;
  font-size: 13px;
}

.hmi-field,
.hmi-toggle-row {
  display: grid;
  grid-template-columns: 102px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.hmi-field output,
.hmi-toggle-row strong {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hmi-main-btn {
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
  background: linear-gradient(#d1fae5, #86efac);
}

.hmi-speed-buttons,
.hmi-bottom-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hmi-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hmi-nav-grid button {
  min-height: 42px;
  font-size: 11px;
}

.hmi-bottom-controls {
  padding: 12px;
  border-top: 1px solid #9ca3af;
  background: #e5e7eb;
}

.hmi-bottom-controls button {
  min-height: 36px;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.tag-tile {
  padding: 14px;
  position: relative;
}

.tag-tile::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 6px rgba(96, 118, 150, 0.10);
}

.tag-tile.on::before {
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12), 0 0 18px rgba(34, 197, 94, 0.62);
}

.tag-tile.off::before {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12);
}

.tag-tile strong,
.tag-tile span {
  display: block;
}

.tag-tile span {
  margin: 8px 0;
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.qr-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.qr-step {
  position: relative;
  min-height: 160px;
  padding: 16px;
  overflow: hidden;
}

.qr-step span {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
  font-weight: 900;
}

.qr-step strong {
  display: block;
  margin-bottom: 8px;
}

.qr-step.active {
  border-color: rgba(94, 234, 212, 0.62);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.16), 0 0 32px rgba(94, 234, 212, 0.08);
}

.qr-step.active span {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.report-card {
  margin: 18px;
}

.report-card strong {
  font-size: 26px;
}

.report-meter {
  height: 12px;
  margin: 18px 0 8px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(96, 118, 150, 0.24);
  border: 1px solid var(--line);
}

.report-meter span {
  display: block;
  width: 82%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: meterMove 2.3s ease-in-out infinite;
}

@keyframes meterMove {
  0%, 100% { width: 74%; }
  50% { width: 96%; }
}

.trace-table code,
.json-box {
  color: var(--accent);
}

.google-hero {
  grid-template-columns: 1.1fr .9fr;
}

.cloud-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.cloud-tiles strong {
  font-size: clamp(30px, 4vw, 54px);
}

.integration-flow {
  display: grid;
  gap: 12px;
}

.flow-row,
.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
}

.flow-row span,
.check-row span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(94, 234, 212, 0.12);
  color: var(--accent);
  font-weight: 900;
}

.json-box {
  margin: 0;
  padding: 22px;
  min-height: 260px;
  overflow: auto;
  background: rgba(2, 6, 23, 0.68);
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

.checklist {
  display: grid;
  gap: 12px;
}

.config-table-wrap {
  overflow-x: auto;
}

@media (max-width: 1280px) {
  .hmi-layout,
  .google-hero {
    grid-template-columns: 1fr;
  }
  .tag-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .qr-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .topbar-logo {
    width: 44px;
    height: 44px;
  }
  .tag-grid,
  .qr-flow {
    grid-template-columns: 1fr;
  }
  .hmi-screen {
    min-width: 780px;
  }
}

@media (max-width: 680px) {
  .topbar-logo {
    display: none;
  }
  .cloud-tiles {
    padding: 12px;
  }
}


.company-link { text-decoration: none; }
.website-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: #f3f5f7;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.website-btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.08); }
.topbar-link { display: inline-flex; align-items: center; }
.app-footer {
  padding: 14px 24px 24px;
  color: rgba(228,234,241,.78);
  font-size: 12px;
}
.app-footer a { color: #c51f1f; font-weight: 700; }
