:root{
  --bg:#0b0f14;
  --fg:#eaf2ff;
  --muted:#aab7c7;
  --card:rgba(18,24,33,.78);
  --line:rgba(255,255,255,.12);
  --accent:#57a6ff;
  --ok:#35d07f;
  --bad:#ff5d5d;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
  --pad:12px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; font-family:var(--font); background:var(--bg); color:var(--fg); }

.bg{
  background: radial-gradient(1200px 700px at 20% 10%, rgba(87,166,255,.12), transparent 60%),
              radial-gradient(900px 500px at 80% 60%, rgba(53,208,127,.10), transparent 60%),
              var(--bg);
}

a{ color:var(--accent); text-decoration:none; }

/* ===== login ===== */
.login-wrap{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.card{
  width:min(420px, 100%);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.glass{ background:var(--card); backdrop-filter: blur(10px); }
.brand{ padding:18px 18px 8px 18px; display:flex; flex-direction:column; gap:6px; align-items:flex-start; }
.logo{
  width:46px; height:46px; border-radius:14px;
  background:rgba(87,166,255,.18);
  border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
}
.title{ font-size:22px; font-weight:800; color:#fff; letter-spacing:.2px; }
.sub{ font-size:13px; color:var(--muted); }

.form{ padding:10px 18px 18px 18px; display:flex; flex-direction:column; gap:10px; }
label{ font-size:12px; color:var(--muted); }
input{
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  color:#fff;
  outline:none;
}
button{
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(87,166,255,.35);
  background:rgba(87,166,255,.18);
  color:#fff;
  font-weight:700;
  cursor:pointer;
}
button:hover{ background:rgba(87,166,255,.24); }
.err{ height:16px; font-size:12px; color:var(--bad); }

/* ===== map ===== */
#map{ position:fixed; inset:0; }

.dock{
  position:fixed;
  z-index:900;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
  overflow:hidden;
}
.dock-h{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px var(--pad);
  border-bottom:1px solid var(--line);
}
.dock-title{ font-weight:800; color:#fff; font-size:14px; }
.dock-actions{ display:flex; gap:8px; align-items:center; }
.dock-b{ padding:var(--pad); }

.dock-left{ left:12px; top:12px; width:320px; max-height:calc(100vh - 24px); }
.dock-right{ right:12px; bottom:12px; width:260px; }

.collapsed{ display:none; }

.search{ display:flex; gap:8px; margin-bottom:10px; }
.search input{ flex:1; }
.ghost{ border-color:var(--line); background:rgba(255,255,255,.06); }
.ghost:hover{ background:rgba(255,255,255,.10); }

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

.list{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow:auto;
  max-height:calc(100vh - 220px);
  padding-right:4px;
}
.item{
  padding:10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.18);
  cursor:pointer;
}
.item:hover{ border-color:rgba(87,166,255,.35); }

.radio-card{
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(0,0,0,.18);
  padding:12px;
  margin-bottom:10px;
}
.r-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.r-name{ font-weight:800; color:#fff; }
.r-row{ display:flex; gap:10px; align-items:center; margin-top:10px; }

.btn{ flex:1; }
.sel{
  flex:1;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  color:#fff;
}

.pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  font-weight:800;
  font-size:12px;
  color:#fff;
  background:rgba(255,255,255,.08);
}
.pill.off{ background:rgba(255,93,93,.12); border-color:rgba(255,93,93,.25); }
.pill.rx{  background:rgba(53,208,127,.14); border-color:rgba(53,208,127,.25); }

.mini{
  width:34px; height:34px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-weight:800;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.mini:hover{ background:rgba(255,255,255,.10); }
.link{ display:flex; align-items:center; justify-content:center; }

.fab{
  position:fixed; z-index:950;
  width:44px; height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(18,24,33,.82);
  color:#fff;
  box-shadow:var(--shadow);
  cursor:pointer;
}
.fab-left{ left:12px; bottom:12px; }
.fab-right{ right:12px; top:12px; }

.toast{
  position:fixed; z-index:999;
  left:50%; bottom:18px; transform:translateX(-50%);
  background:rgba(0,0,0,.65);
  border:1px solid var(--line);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  display:none;
}

/* labels sopra marker */
.mr-label{
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
  padding:2px 6px;
  border-radius:10px;
  font-weight:800;
  font-size:12px;
}

/* mobile */
@media (max-width: 820px){
  .dock-left{ width:min(92vw, 420px); }
  .dock-right{ width:min(92vw, 360px); right:12px; bottom:12px; }
  .list{ max-height: 40vh; }
}
