:root{--bg:#eef3f7;--card:#fff;--text:#172033;--muted:#64748b;--line:#e2e8f0;--primary:#0f766e;--primary-dark:#115e59;--danger:#dc2626;--success:#16a34a;--warning:#f59e0b;--shadow:0 10px 30px rgba(15,23,42,.08)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Arial,Helvetica,sans-serif}.app{max-width:1200px;margin:auto;padding:12px}.hero{background:linear-gradient(135deg,#0f766e,#134e4a);color:#fff;border-radius:22px;padding:18px;box-shadow:var(--shadow);display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:12px}.hero h1{margin:0 0 5px;font-size:28px}.hero p{margin:0;opacity:.92}.live-status{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.25);border-radius:999px;padding:10px 12px}#connectionDot{width:10px;height:10px;border-radius:50%;display:inline-block;background:var(--warning)}.toolbar,.summary,.map-canvas,.legend{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.toolbar{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:end;padding:12px;margin-bottom:12px}label{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:13px;font-weight:700}select{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px;font-size:16px}button,.text-link{border:0;border-radius:14px;padding:12px 15px;font-weight:800;font-size:14px;background:var(--primary);color:white;text-decoration:none;cursor:pointer;display:inline-flex;justify-content:center;align-items:center}button:hover,.text-link:hover{background:var(--primary-dark)}.summary{display:grid;grid-template-columns:repeat(3,1fr);margin-bottom:12px;overflow:hidden}.summary div{padding:14px;border-right:1px solid var(--line)}.summary div:last-child{border-right:0}.summary span{display:block;color:var(--muted);font-size:13px;margin-bottom:4px}.summary strong{font-size:26px}.map-canvas{position:relative;overflow:hidden;min-height:520px;background:#f8fafc}.map-canvas.empty{border:1px dashed var(--line);display:flex;align-items:center;justify-content:center;color:var(--muted)}.map-canvas img{width:100%;display:block;user-select:none}.lamp-marker{position:absolute;transform:translate(-50%,-50%);min-width:46px;min-height:46px;border-radius:50%;border:4px solid white;box-shadow:0 8px 20px rgba(15,23,42,.3);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .15s ease,opacity .15s ease}.lamp-marker:hover{transform:translate(-50%,-50%) scale(1.08)}.lamp-marker:before{content:'💡';font-size:22px}.lamp-marker.on{background:#fbbf24}.lamp-marker.off{background:#94a3b8}.lamp-marker.pending{background:#38bdf8;animation:pulse 1s infinite}.lamp-marker.offline{background:#ef4444;opacity:.65;cursor:not-allowed}.lamp-marker span{position:absolute;left:50%;top:calc(100% + 6px);transform:translateX(-50%);background:rgba(15,23,42,.86);color:white;padding:5px 8px;border-radius:999px;font-size:12px;white-space:nowrap;pointer-events:none}.legend{margin-top:12px;padding:12px;display:flex;flex-wrap:wrap;gap:12px}.legend span{display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-weight:700}.dot{width:14px;height:14px;border-radius:50%;display:inline-block}.dot.on{background:#fbbf24}.dot.off{background:#94a3b8}.dot.pending{background:#38bdf8}.dot.offline{background:#ef4444}@keyframes pulse{0%,100%{opacity:1}50%{opacity:.55}}@media(max-width:720px){.hero{flex-direction:column;align-items:flex-start}.toolbar{grid-template-columns:1fr}.summary{grid-template-columns:1fr}.summary div{border-right:0;border-bottom:1px solid var(--line)}.summary div:last-child{border-bottom:0}.map-canvas{min-height:340px}}


@media (min-width: 1400px) {
  .map-canvas {
    min-height: 78vh;
  }

  .map-canvas img {
    min-height: 78vh;
  }
}


/* V6 forced small staff map bulbs */
.lamp-marker {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.28) !important;
}

.lamp-marker::before {
  font-size: 14px !important;
  line-height: 1 !important;
}

.lamp-marker span {
  font-size: 10px !important;
  padding: 3px 6px !important;
  top: calc(100% + 4px) !important;
}

.lamp-marker:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
}


/* V7 forced tiny staff map bulbs */
.lamp-marker {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  padding: 0 !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.28) !important;
}

.lamp-marker::before {
  font-size: 12px !important;
  line-height: 1 !important;
}

.lamp-marker span {
  font-size: 9px !important;
  padding: 2px 5px !important;
  top: calc(100% + 3px) !important;
}

.lamp-marker:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
}


/* V8 brighter ON glow for staff floor map */
.lamp-marker.on {
  background: #ffd43b !important;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 0 12px 5px rgba(255, 212, 59, 0.95),
    0 0 28px 12px rgba(255, 193, 7, 0.55) !important;
  animation: lampGlowV8 1.4s ease-in-out infinite alternate !important;
}

.lamp-marker.on::before {
  filter: drop-shadow(0 0 6px rgba(255, 255, 180, 1)) !important;
}

@keyframes lampGlowV8 {
  from {
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.95),
      0 0 10px 4px rgba(255, 212, 59, 0.9),
      0 0 22px 10px rgba(255, 193, 7, 0.45);
  }
  to {
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 1),
      0 0 18px 8px rgba(255, 212, 59, 1),
      0 0 42px 18px rgba(255, 193, 7, 0.65);
  }
}
