:root{
  --bg0:#061223;
  --bg1:#0B1B32;
  --card:#0A1526cc;
  --cardBorder:#ffffff10;
  --text:#cbd5e1;
  --textMuted:#93a4ba;
  --accent:#2ee7d0;
  --shadow: 0 30px 80px rgba(0,0,0,.35);
  --radius:18px;

  --online:#2ee7d0;
  --idle:#f59e0b;
  --dnd:#ef4444;
  --offline:#64748b;
  --gap:#334155;
}

*{ box-sizing:border-box; }
[hidden]{ display:none !important; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background: radial-gradient(1000px 500px at 50% -10%, #133a5a 0%, transparent 60%),
              linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 70%);
}

.bg{
  min-height:100%;
  padding:28px 22px 80px;
}

.top{
  max-width:1150px;
  margin:0 auto;
  padding: 8px 6px 26px;
}

.kicker{
  color:var(--accent);
  letter-spacing:.35em;
  font-size:13px;
  font-weight:600;
  text-transform:uppercase;
}

.topRow{
  display:flex;
  gap:18px;
  align-items:flex-end;
  justify-content:space-between;
  margin-top:14px;
  flex-wrap:wrap;
}

.title{
  margin:0;
  font-size:52px;
  line-height:1.05;
  letter-spacing:-0.02em;
  font-weight:700;
  color:#d9e2ef;
}

.sub{
  margin-top:10px;
  font-size:16px;
  color:var(--textMuted);
}

.topMeta{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  justify-content:flex-end;
  color:var(--textMuted);
  font-size:15px;
  padding-bottom:6px;
  align-items:center;
}
.topMeta .btn{
  padding: 8px 12px;
}
.metaItem{ white-space:nowrap; }

.container{
  max-width:1150px;
  margin:0 auto;
}

.loginWrap{
  min-height: calc(100vh - 160px);
  display:flex;
  align-items:center;
  justify-content:center;
}
@media (max-width: 640px){
  .loginWrap{ min-height: calc(100vh - 120px); }
}

.card{
  background: linear-gradient(180deg, rgba(8,16,28,.85), rgba(6,12,22,.75));
  border:1px solid var(--cardBorder);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
}

.loginCard{
  max-width:520px;
  width:100%;
  padding:22px;
}
.loginCard h2{ margin:0 0 6px; }
.muted{ color:var(--textMuted); margin:0 0 14px; }

.loginSupport{
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.08);
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
  color:var(--textMuted);
}
.loginSupport .supportTitle{
  font-weight:600;
  color:#dbe7f8;
}
.loginSupport a{
  color:var(--accent);
  text-decoration:none;
}
.loginSupport a:hover{
  text-decoration:underline;
}

.field label{
  display:block;
  font-size:12px;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--textMuted);
  margin-bottom:8px;
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
}

.input{
  width:100%;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 12px 12px;
  color: #e5eefc;
  outline:none;
}
.input:focus{
  border-color: rgba(46,231,208,.4);
  box-shadow: 0 0 0 3px rgba(46,231,208,.12);
}

.btn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color:#e5eefc;
  border-radius: 12px;
  padding: 12px 14px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{ background: rgba(255,255,255,.10); }
.btn.primary{
  background: rgba(46,231,208,.18);
  border-color: rgba(46,231,208,.32);
}
.btn.primary:hover{
  background: rgba(46,231,208,.25);
}
.btn.danger{
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.24);
}
.btn.danger:hover{ background: rgba(239,68,68,.20); }

.hint{
  margin-top:8px;
  color:var(--textMuted);
  font-size:13px;
}

.summaryText{
  padding: 12px 0 2px;
  color: var(--textMuted);
}

.timelineCard{
  margin-top:18px;
  padding:14px;
}

.timelineHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 6px 6px 12px;
}

.legend{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color:#dbe7f8;
  user-select:none;
}
.pill.online{ border-color: rgba(46,231,208,.35); }
.pill.idle{ border-color: rgba(245,158,11,.35); }
.pill.dnd{ border-color: rgba(239,68,68,.35); }
.pill.offline{ border-color: rgba(100,116,139,.35); }
.pill.gaps{ border-color: rgba(51,65,85,.55); }

.timelineWrap{
  position:relative;
  width:100%;
  height:280px;
  border-radius: 14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.18);
}
.panWrap{
  margin-top:12px;
  padding:0 8px;
}
.panRange{
  width:100%;
  appearance:none;
  height:8px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
}
.panRange::-webkit-slider-thumb{
  appearance:none;
  width:var(--thumb-w, 48px);
  height:14px;
  border-radius:999px;
  background: rgba(46,231,208,.9);
  border:1px solid rgba(46,231,208,.55);
  box-shadow: 0 8px 18px rgba(0,0,0,.4), 0 0 0 2px rgba(8,18,34,.8);
  cursor:grab;
}
.panRange:active::-webkit-slider-thumb{
  cursor:grabbing;
}
.panRange::-moz-range-thumb{
  width:var(--thumb-w, 48px);
  height:14px;
  border-radius:999px;
  background: rgba(46,231,208,.9);
  border:1px solid rgba(46,231,208,.55);
  box-shadow: 0 8px 18px rgba(0,0,0,.4), 0 0 0 2px rgba(8,18,34,.8);
  cursor:grab;
}
.panRange::-moz-range-track{
  height:8px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
}

.timelineSvg{
  width:100%;
  height:100%;
  display:block;
}

.timelineEmpty{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  color:var(--textMuted);
  background: rgba(3,8,15,.35);
  pointer-events:none;
}
.emptySpinner{
  width:36px;
  height:36px;
  border-radius:50%;
  border:2px solid rgba(46,231,208,.2);
  border-top-color: rgba(46,231,208,.7);
  animation: spin 0.9s linear infinite;
  box-shadow: 0 0 12px rgba(46,231,208,.25);
}
.emptyText{
  font-size:12px;
  letter-spacing:.22em;
  text-transform:uppercase;
}

.tooltip{
  position:absolute;
  pointer-events:none;
  min-width:220px;
  max-width:320px;
  padding:10px 12px;
  background: rgba(3,8,15,.92);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  color:#e5eefc;
  font-size:13px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.tooltip .tTitle{
  font-weight:700;
  margin-bottom:6px;
}
.tooltip .tLine{
  color: rgba(229,238,252,.85);
  margin:2px 0;
}
.tooltip .tMuted{ color: rgba(229,238,252,.68); }

.empty{
  padding:18px 10px 6px;
  color:var(--textMuted);
}

.error{
  margin-top:12px;
  padding:10px 12px;
  border-radius: 12px;
  background: rgba(239,68,68,.10);
  border:1px solid rgba(239,68,68,.22);
  color:#fecaca;
  font-size:13px;
}


.settingsCard{
  margin-top:18px;
  padding:14px;
}

.settingsHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding: 6px 6px 6px;
}

.settingsTitle{
  font-size:16px;
  font-weight:700;
  color:#d9e2ef;
}
.settingsSub{
  margin-top:4px;
  color:var(--textMuted);
  font-size:13px;
}

.settingsBody{
  padding: 10px 6px 6px;
}

.settingsGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
.settingsGrid.expanded{
  grid-template-columns: 1fr;
}
@media (max-width: 980px){
  .settingsGrid{ grid-template-columns:1fr; }
}

.settingsCol h3{
  margin: 6px 0 8px;
  font-size:15px;
  color:#d9e2ef;
}
.small{ font-size:13px; }

.formRow{
  display:grid;
  grid-template-columns: 1.8fr 1fr auto;
  gap:10px;
  align-items:center;
  margin: 10px 0 10px;
}
@media (max-width: 980px){
  .formRow{ grid-template-columns:1fr; }
}

.timelineControls{
  padding: 0 6px 12px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
}
.timelineControls .field{
  max-width: 320px;
  width:100%;
}
.zoomControls{
  display:flex;
  gap:8px;
  align-items:center;
}
.zoomBtn{
  width:32px;
  height:32px;
  padding:0;
  font-size:18px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  border:1px solid rgba(255,255,255,.28);
  background: rgba(8,18,34,.7);
  box-shadow: inset 0 0 0 1px rgba(46,231,208,.18), 0 8px 20px rgba(0,0,0,.35);
}
.zoomBtn:hover{
  border-color: rgba(46,231,208,.55);
  background: rgba(11,24,42,.8);
}

.liveBadge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(46,231,208,.35);
  background: rgba(46,231,208,.08);
  color:#dbe7f8;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.22em;
}
.liveDot{
  width:8px;
  height:8px;
  border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(46,231,208,.8);
  animation: livePulse 1.6s ease-out infinite;
}
@keyframes livePulse{
  0%{ box-shadow: 0 0 0 0 rgba(46,231,208,.8); }
  70%{ box-shadow: 0 0 0 8px rgba(46,231,208,0); }
  100%{ box-shadow: 0 0 0 0 rgba(46,231,208,0); }
}


.list{
  margin-top:10px;
  border:1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  overflow:hidden;
}

.listItem{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:10px 12px;
  background: rgba(255,255,255,.03);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.listItem:last-child{ border-bottom:none; }
.listItem.active{
  background: rgba(46,231,208,.08);
  box-shadow: inset 3px 0 0 rgba(46,231,208,.65);
}

.listMain{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.listTitle{
  font-weight:700;
  color:#e5eefc;
  font-size:13px;
}
.listSub{
  color:var(--textMuted);
  font-size:12px;
  word-break:break-word;
}

.listActions{
  display:flex;
  gap:8px;
}
.btn.sm{
  padding: 8px 10px;
  border-radius: 10px;
  font-size:12px;
}

.loadingOverlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(520px 240px at 50% 25%, rgba(46,231,208,.18), transparent 70%),
    radial-gradient(900px 500px at 50% 110%, rgba(15,23,42,.85), transparent 70%),
    rgba(3,8,15,.62);
  backdrop-filter: blur(4px);
  z-index:1000;
}
.loadingCard{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(9,18,32,.95), rgba(5,12,22,.92));
  border:1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 0 0 1px rgba(46,231,208,.05);
}
.spinner{
  position:relative;
  width:40px;
  height:40px;
}
.spinner::before{
  content:'';
  position:absolute;
  inset:0;
  border-radius:50%;
  border:2px solid rgba(46,231,208,.15);
  box-shadow: 0 0 14px rgba(46,231,208,.35);
}
.spinner::after{
  content:'';
  position:absolute;
  inset:6px;
  border-radius:50%;
  border:2px solid rgba(46,231,208,.75);
  border-top-color: rgba(46,231,208,.15);
  border-left-color: rgba(46,231,208,.15);
  animation: spin 0.85s linear infinite;
}
.loadingText{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.3em;
  color:#dbe7f8;
  white-space:nowrap;
}
@keyframes spin{
  to{ transform: rotate(360deg); }
}
