:root{
  --bg: #0a0f14;
  --bg-panel: #10171f;
  --bg-card: #141d27;
  --border: #223040;
  --border-strong: #2e4258;
  --teal: #1fd8a4;
  --teal-dim: #0f6e56;
  --text: #e8edf2;
  --text-dim: #8b9bab;
  --text-faint: #566475;
  --amber: #f0a83c;
  --coral: #e2635e;
}
*{ box-sizing:border-box; }
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height:100vh;
}
.app{ max-width:920px; margin:0 auto; padding:0 20px 60px; }
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:22px 0; border-bottom:1px solid var(--border); margin-bottom:28px;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{ width:24px; height:24px; border-radius:50%; border:2px solid var(--teal); }
.brand-name{ font-weight:700; font-size:16px; }
.navlinks{ display:flex; gap:4px; }
.navlinks button{
  background:none; border:none; color:var(--text-dim); font-size:13px;
  padding:8px 14px; border-radius:7px; cursor:pointer; font-family:inherit;
}
.navlinks button.active{ background:var(--bg-card); color:var(--text); }
.navlinks button:hover{ color:var(--text); }

.login-wrap{
  min-height:70vh; display:flex; flex-direction:column;
  align-items:center; justify-content:center; text-align:center; gap:24px;
}
.login-title{ font-size:22px; font-weight:700; margin:0; }
.login-sub{ color:var(--text-dim); font-size:14px; margin:0; max-width:320px; }
.login-form{ display:flex; flex-direction:column; gap:10px; width:280px; }
input, textarea{
  background:var(--bg-panel); border:1px solid var(--border); color:var(--text);
  font-family:inherit; font-size:14px; padding:11px 14px; border-radius:8px; outline:none;
}
input:focus, textarea:focus{ border-color:var(--teal); }
.btn{
  font-family:inherit; font-size:14px; font-weight:600; padding:11px 16px;
  border-radius:8px; cursor:pointer; border:1px solid transparent;
}
.btn-primary{ background:var(--teal); color:#04241c; border:none; }
.btn-primary:hover{ background:#3fe4b8; }
.btn-primary:disabled{ opacity:0.6; cursor:not-allowed; }
.btn-ghost{ background:transparent; color:var(--text-dim); border:1px solid var(--border-strong); }
.error-msg{ color:var(--coral); font-size:13px; min-height:16px; }
.section-title{ font-size:18px; font-weight:700; margin:0 0 4px; }
.section-sub{ color:var(--text-dim); font-size:13px; margin:0 0 20px; }
.radar-card{
  background:var(--bg-card); border:1px solid var(--border); border-radius:12px;
  padding:18px 20px; display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;
}
.radar-card-name{ font-weight:600; font-size:15px; margin:0 0 4px; }
.radar-card-meta{ color:var(--text-faint); font-size:12px; }
.badge{ font-size:11px; padding:4px 10px; border-radius:20px; font-weight:600; background:rgba(31,216,164,0.12); color:var(--teal); }
.field{ margin-bottom:16px; }
label{ font-size:12.5px; color:var(--text-dim); display:block; margin-bottom:6px; }
.actions-row{ display:flex; gap:10px; margin-top:20px; }
.empty-state{ color:var(--text-dim); font-size:14px; padding:40px 0; text-align:center; }
.chip{
  display:inline-block; background:var(--bg-panel); border:1px solid var(--border);
  color:var(--text-dim); font-size:12px; padding:5px 11px; border-radius:20px; margin:0 6px 6px 0;
}
.preview-box{ background:var(--bg-panel); border:1px dashed var(--border-strong); border-radius:10px; padding:16px 18px; margin:16px 0; }
.preview-label{ font-size:11px; color:var(--text-faint); text-transform:uppercase; letter-spacing:0.05em; margin-bottom:10px; }

.user-area{
  position:relative;
  margin-left:10px;
  display:flex;
  align-items:center;
}
.user-btn{
  background:var(--bg-card);
  color:var(--text);
  border:1px solid var(--border);
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  font-size:13px;
  display:flex;
  align-items:center;
  gap:8px;
}
.user-btn:hover{ border-color:var(--border-strong); }
.user-btn-label{ max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  min-width:240px;
  background:var(--bg-panel);
  border:1px solid var(--border-strong);
  border-radius:12px;
  box-shadow:0 18px 40px rgba(0,0,0,0.35);
  padding:8px;
  display:none;
  z-index:50;
}
.user-menu.open{ display:block; }
.user-email{
  font-size:12px;
  color:var(--text-dim);
  padding:6px 10px 10px;
  border-bottom:1px solid var(--border);
  margin-bottom:6px;
  word-break:break-all;
}
.user-menu button{
  width:100%;
  text-align:left;
  background:none;
  border:none;
  color:var(--text);
  border-radius:8px;
  padding:10px 10px;
  cursor:pointer;
  font:inherit;
}
.user-menu button:hover{ background:var(--bg-card); }

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(2,8,11,0.78);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:20px;
}
.modal{
  width:min(460px, 100%);
  background:var(--bg-panel);
  border:1px solid var(--border-strong);
  border-radius:16px;
  box-shadow:0 20px 50px rgba(0,0,0,0.5);
  padding:20px;
}
.modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.modal-kicker{
  margin:0 0 4px;
  color:var(--text-faint);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.06em;
}
.modal h3{
  margin:0;
  font-size:20px;
}
.modal-close{
  background:none;
  border:1px solid var(--border);
  color:var(--text-dim);
  width:32px;
  height:32px;
  border-radius:8px;
  cursor:pointer;
  font-size:18px;
  line-height:1;
}
.modal-sub{
  margin:0 0 14px;
  color:var(--text-dim);
  font-size:14px;
}
.modal-warning{
  margin:0 0 14px;
  color:var(--amber);
  font-size:13px;
  background:rgba(240,168,60,0.08);
  border:1px solid rgba(240,168,60,0.2);
  border-radius:10px;
  padding:10px 12px;
}
.modal-form{ display:flex; flex-direction:column; gap:10px; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:16px; }
