* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: #eef3f7;
  color: #17324d;
}

body {
  overflow-x: hidden;
  cursor: none;
}

.dashboard {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px 22px;
}

.hero {
  position: relative;
  min-height: 118px;
  padding: 8px 22px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, #003b70, #315da7);
  color: #fff;
}

.hero h1 {
  position: relative;
  z-index: 5;
  margin: 31px auto 0;
  width: max-content;
  max-width: 56%;
  white-space: nowrap;
  text-align: center;
  font-size: 42px;
  font-weight: 900;
}

.forklift-stage {
  position: absolute;
  inset: 0 22px;
  overflow: hidden;
  pointer-events: none;
}

.forklift-unit {
  position: absolute;
  top: 6px;
  width: 150px;
  height: 104px;
  will-change: transform;
  z-index: 3;
}

.forklift-unit-left { left: 0; }
.forklift-unit-right { right: 0; }

.forklift-unit-right .forklift-svg {
  transform: scaleX(-1);
  transform-origin: center;
}

.forklift-svg {
  width: 150px;
  height: 104px;
  display: block;
  overflow: visible;
}

.attached-pallet {
  opacity: 0;
}

.forklift-unit.has-pallet .attached-pallet {
  opacity: 1;
}

.beacon-glow {
  opacity: .25;
  filter: drop-shadow(0 0 0 rgba(255,189,46,0));
}

.forklift-unit.beacon-on .beacon-glow {
  opacity: 1;
  filter:
    drop-shadow(0 0 5px #ffbd2e)
    drop-shadow(0 0 12px #ffbd2e)
    drop-shadow(0 0 22px rgba(255,189,46,.95));
}

/* Paleta, která přelétne pouze během samotného předání */
.transfer-pallet {
  position: absolute;
  top: 74px;
  left: 50%;
  width: 58px;
  height: 42px;
  transform: translate(-50%, -50%);
  opacity: 0;
  will-change: transform, opacity;
  z-index: 6;
}

.pallet-box {
  position: absolute;
  left: 8px;
  top: 0;
  width: 42px;
  height: 28px;
  border: 3px solid #5f3519;
  background:
    linear-gradient(90deg,
      transparent 47%,
      #7b4a25 47%,
      #7b4a25 53%,
      transparent 53%),
    linear-gradient(#c68945, #a9622d);
  border-radius: 3px;
}

.pallet-base {
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 54px;
  height: 11px;
  border-top: 4px solid #70401f;
  border-bottom: 4px solid #70401f;
  background:
    linear-gradient(90deg,
      #70401f 0 10px,
      transparent 10px 22px,
      #70401f 22px 32px,
      transparent 32px 44px,
      #70401f 44px 54px);
}

.transfer-pallet.flash {
  filter:
    drop-shadow(0 0 7px #ffd66b)
    drop-shadow(0 0 15px rgba(255,214,107,.95));
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.metric {
  min-height: 145px;
  padding: 20px;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0,59,112,.09);
}

.metric-green { border-top: 7px solid #14804a; }
.metric-orange { border-top: 7px solid #f58220; }
.metric-blue { border-top: 7px solid #00529b; }

.metric span {
  color: #607488;
  font-size: 14px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 20px;
  color: #003b70;
  font-size: 52px;
}

.metric small {
  display: block;
  margin-top: 14px;
  color: #607488;
  font-size: 15px;
}

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

.panel {
  min-height: 420px;
  padding: 22px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0,59,112,.09);
}

.panel h2 {
  margin: 0 0 18px;
  color: #003b70;
  font-size: 30px;
}

.dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 10px;
}

.dot.green { background: #49d77d; }
.dot.red { background: #ed5061; }

.machine-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.machine-card {
  min-height: 58px;
  padding: 14px 16px;
  border-radius: 15px;
  font-size: 23px;
  font-weight: 900;
}

.machine-card.free {
  border: 1px solid #bde4cc;
  border-left: 8px solid #14804a;
  background: #e5f6ed;
  color: #003b70;
}

.machine-card.occupied {
  border: 1px solid #f5c9a5;
  border-left: 8px solid #f58220;
  background: #fff2e8;
  color: #003b70;
}

.machine-card .activity {
  display: block;
  margin-top: 6px;
  color: #d96e13;
  font-size: 18px;
}

.empty {
  padding: 16px;
  border-radius: 14px;
  background: #f0f3f5;
  color: #607488;
  font-size: 17px;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: #607488;
  font-size: 14px;
}

@media (max-width: 900px) {
  .dashboard { padding: 10px; }

  .hero {
    min-height: 84px;
    padding: 5px 10px;
  }

  .hero h1 {
    margin-top: 23px;
    max-width: 58%;
    font-size: 25px;
  }

  .forklift-stage { inset: 0 10px; }

  .forklift-unit {
    top: 6px;
    width: 92px;
    height: 68px;
  }

  .forklift-svg {
    width: 92px;
    height: 68px;
  }

  .transfer-pallet {
    top: 52px;
    transform: translate(-50%, -50%) scale(.72);
  }

  .metrics,
  .panels {
    gap: 10px;
  }
}
