:root{
  --bg: #0b1220;
  --panel: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2a44;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --success: #22c55e;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color:var(--text);
  background:var(--bg);
}

/* Layout */
#layout{
  display:flex;
  height:100vh;
  width:100%;
}

#panorama{
  flex:1 1 auto;
  min-width:0;
  height:100%;
}

/* Right Sidebar */
#sidebar{
  width:340px;
  background:var(--panel);
  border-left:1px solid var(--border);
  display:flex;
  flex-direction:column;
  box-shadow: var(--shadow);
  z-index:2;
}

.sidebar__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.9rem .9rem .8rem 1rem;
  border-bottom:1px solid var(--border);
}
.sidebar__header .title{
  display:flex; align-items:center; gap:.5rem;
}
.sidebar__header h1{
  font-size:1rem;
  letter-spacing:.02em;
  margin:0;
}
.toolbar{ display:flex; align-items:center; gap:.5rem; }

.empty{
  margin:1rem;
  padding:1rem;
  border:1px dashed var(--border);
  border-radius:.5rem;
  color:var(--muted);
  font-size:.95rem;
}

.hotspot-list{
  list-style:none;
  margin:0;
  padding:.5rem;
  overflow:auto;
  flex:1;
}
.hotspot-list li{
  border:1px solid var(--border);
  border-radius:.6rem;
  padding:.75rem .75rem;
  margin:.5rem;
  background:rgba(255,255,255,0.02);
  display:flex;
  gap:.75rem;
  align-items:flex-start;
  transition:background .2s, border-color .2s;
}
.hotspot-list li:hover{ background:rgba(255,255,255,0.04); border-color:#243459; }

.hotspot-list .dot{
  width:10px; height:10px; border-radius:999px;
  background:var(--accent);
  margin-top:.4rem;
  box-shadow:0 0 0 3px rgba(59,130,246,.25);
  flex:0 0 auto;
}
.hotspot-list .item-content{ flex:1 1 auto; min-width:0; }
.hotspot-list .item-title{
  font-weight:600; color:#dbeafe; margin:0 0 .15rem; font-size:.98rem;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.hotspot-list .item-desc{
  margin:0; color:var(--muted); font-size:.9rem;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

.actions{ display:flex; gap:.35rem; align-items:center; }
.actions .icon-btn{
  border:1px solid var(--border);
  background:transparent;
  color:#cbd5e1;
  border-radius:.5rem;
  padding:.3rem .45rem;
  cursor:pointer;
  transition: all .15s ease;
}
.actions .icon-btn:hover{ color:#dbeafe; border-color:#2a3b63; }

/* Buttons */
.btn{
  appearance:none;
  border:none;
  border-radius:.6rem;
  padding:.55rem .8rem;
  font-weight:600;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:.4rem;
}
.btn--primary{ background:var(--accent); color:#0b1220; }
.btn--primary:hover{ background:var(--accent-2); }
.btn--ghost{
  background:transparent;
  color:#cbd5e1;
  border:1px solid var(--border);
}
.btn--ghost:hover{ border-color:#2a3b63; color:#e5e7eb; }

/* Popup */
#popup{
  position:fixed;
  top:50%; left:50%;
  transform:translate(-50%,-50%) scale(.98);
  background:rgba(15,23,42,.98);
  padding:1.2rem 1.4rem;
  border-radius:1rem;
  box-shadow: var(--shadow);
  min-width:320px;
  max-width:420px;
  opacity:0; pointer-events:none;
  transition: all .25s ease;
  text-align:left;
  z-index:5;
}
#popup.show{ opacity:1; transform:translate(-50%,-50%) scale(1); pointer-events:auto; }
#popup h3{ margin-top:0; margin-bottom:.35rem; color:#dbeafe; }
#popup p{ margin:.4rem 0 0; color:var(--muted); }

/* Modal */
#modalBackdrop{
  position:fixed; inset:0;
  background:rgba(2,6,23,.6);
  backdrop-filter: blur(2px);
  z-index:6;
}
#formModal{
  position:fixed;
  top:50%; left:50%;
  transform:translate(-50%,-50%);
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:1rem;
  width:min(560px, calc(100% - 2rem));
  box-shadow: var(--shadow);
  z-index:7;
}
.modal__header{ padding:1rem 1rem .75rem; border-bottom:1px solid var(--border); }
.modal__header h2{ margin:0; font-size:1.1rem; }
.modal__body{ padding:1rem; }
.modal__footer{ padding:0 1rem 1rem; display:flex; gap:.75rem; justify-content:flex-end; }

.field{ display:flex; flex-direction:column; gap:.35rem; margin-bottom:.9rem; }
.field label{ color:#cbd5e1; font-size:.92rem; }
.field .req{ color:#93c5fd; }
.field input[type="text"], .field input[type="number"], .field textarea{
  background:#0b1426;
  border:1px solid #1c2744;
  color:#e5e7eb;
  padding:.6rem .7rem;
  border-radius:.55rem;
  outline:none;
  transition:border-color .15s ease;
}
.field input:focus, .field textarea:focus{ border-color:#355da8; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }

/* Pannellum hotspot indicator */
.custom-hotspot {
  width:18px; height:18px; border-radius:999px;
  background:var(--accent);
  box-shadow:0 0 0 4px rgba(59,130,246,.25), 0 6px 18px rgba(0,0,0,.35);
  border:2px solid rgba(255,255,255,.25);
}
.custom-hotspot:hover { transform: scale(1.05); }

/* Hide pannellum default zoom controls on very small screens? Keep defaults. */
