:root{
  --bg:#06121a;
  --panel:#0b1b26;
  --panel2:#0e2230;
  --text:#e8f1f7;
  --muted:#9cb5c6;
  --line:#163244;
  --accent:#31d07f;
  --accent2:#39a9ff;
  --danger:#ff5d5d;
  --warn:#ffcc66;
  --ok:#31d07f;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:var(--sans);
  background: radial-gradient(1000px 600px at 20% 0%, rgba(57,169,255,.14), transparent 60%),
              radial-gradient(1000px 600px at 80% 0%, rgba(49,208,127,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(6,18,26,.75);
  backdrop-filter: blur(10px);
}
.brand{display:flex; gap:12px; align-items:center}
.title{font-size:18px; font-weight:700; letter-spacing:.2px}
.subtitle{font-size:12px; color:var(--muted)}
.dot{
  width:12px; height:12px; border-radius:999px;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255,93,93,.15);
}
.actions{display:flex; gap:10px; align-items:center}
.input{
  background: rgba(255,255,255,.04);
  border:1px solid var(--line);
  padding:10px 12px;
  border-radius:12px;
  color:var(--text);
  outline:none;
  min-width:260px;
}
.input:focus{border-color: rgba(57,169,255,.65); box-shadow:0 0 0 3px rgba(57,169,255,.12)}
.btn{
  background: linear-gradient(135deg, rgba(57,169,255,.95), rgba(49,208,127,.95));
  border:0;
  color:#06121a;
  padding:10px 12px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
}
.btn:hover{filter:brightness(1.05)}
.btnSecondary{
  background: rgba(255,255,255,.06);
  color:var(--text);
  border:1px solid var(--line);
}
.layout{
  display:grid;
  grid-template-columns: 1.15fr 1.85fr;
  gap:14px;
  padding:14px;
  height: calc(100vh - 64px);
}
.panel{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.panelHeader{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  background: rgba(11,27,38,.7);
  border-bottom:1px solid var(--line);
}
.panelTitle{font-weight:800}
.panelMeta{font-size:12px; color:var(--muted)}
.tableWrap{overflow:auto; flex:1}
.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
th, td{
  padding:10px 12px;
  border-bottom:1px solid rgba(22,50,68,.7);
  vertical-align:middle;
  white-space:nowrap;
}
th{
  position:sticky; top:0;
  background: rgba(14,34,48,.95);
  text-align:left;
  font-size:12px;
  color: var(--muted);
  letter-spacing:.2px;
}
tr:hover td{background: rgba(57,169,255,.06)}
tr.selected td{background: rgba(49,208,127,.10)}
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 9px;
  border-radius:999px;
  font-size:12px;
  border:1px solid rgba(22,50,68,.9);
}
.badge.ok{background: rgba(49,208,127,.10); color: var(--ok)}
.badge.bad{background: rgba(255,93,93,.10); color: var(--danger)}
.badge.warn{background: rgba(255,204,102,.10); color: var(--warn)}
.small{font-size:12px; color:var(--muted)}
.tabs{
  display:flex;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  background: rgba(11,27,38,.55);
}
.tab{
  background: rgba(255,255,255,.05);
  border:1px solid var(--line);
  color:var(--text);
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.tab.active{
  background: rgba(49,208,127,.14);
  border-color: rgba(49,208,127,.35);
}
.tabBody{display:none; padding:12px; overflow:auto; flex:1; min-height:0}
.tabBody.active{display:block}
.json{
  font-family: var(--mono);
  font-size:12px;
  line-height:1.45;
  margin:0;
  padding:12px;
  border-radius: 14px;
  border:1px solid rgba(22,50,68,.9);
  background: rgba(0,0,0,.25);
  white-space:pre-wrap;
  word-break:break-word;
}
.fields{display:flex; flex-direction:column; gap:10px}
.fieldsHeader{display:flex; justify-content:space-between; align-items:center}
.fieldsList{
  border:1px solid rgba(22,50,68,.9);
  background: rgba(0,0,0,.20);
  border-radius:14px;
  padding:10px;
  max-height: calc(100vh - 220px);
  overflow:auto;
  font-family: var(--mono);
  font-size:12px;
}
.fieldItem{
  padding:6px 8px;
  border-bottom:1px dashed rgba(22,50,68,.7);
}
.fieldItem:last-child{border-bottom:0}
.events{
  border:1px solid rgba(22,50,68,.9);
  background: rgba(0,0,0,.20);
  border-radius:14px;
  padding:10px;
  max-height: calc(100vh - 220px);
  overflow:auto;
  font-family: var(--mono);
  font-size:12px;
}
.event{
  padding:8px 10px;
  border:1px solid rgba(22,50,68,.8);
  border-radius:12px;
  margin-bottom:8px;
  background: rgba(255,255,255,.02);
}
.event .t{color:var(--muted); font-size:11px}
.event .k{font-weight:800}
.modalBack{
  position:fixed; inset:0;
  background: rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:50;
}
.modal{
  width:min(520px, 92vw);
  background: rgba(11,27,38,.95);
  border:1px solid rgba(22,50,68,.9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding:16px;
}
.modalTitle{font-weight:900; font-size:16px}
.modalSub{margin-top:6px; color:var(--muted); font-size:13px}
.modalBtns{display:flex; gap:10px; justify-content:flex-end; margin-top:12px}
.modalHint{margin-top:10px; color:var(--muted); font-size:12px}
code{font-family:var(--mono); font-size:12px}
@media (max-width: 980px){
  .layout{grid-template-columns:1fr; height:auto}
  .input{min-width:160px}
}
