:root{
  --bg: #fbfaf8;
  --card: #ffffff;
  --muted: #7b8794;
  --text: #0f172a;
  --border: rgba(15, 23, 42, .08);
  --shadow: 0 8px 20px rgba(15, 23, 42, .06);
  --radius: 14px;

  --orange: #f2994a;
  --orange-strong: #e67e22;

  --green: #22c55e;
  --red: #e11d48;
  --blue: #38bdf8;
  --purple: #a855f7;
  --grayPill: #eef2f7;

  --ring: rgba(242,153,74,.45);
  --themeEase: 160ms ease;
}

/* ===== DARK THEME OVERRIDES (black + orange) ===== */
html[data-theme="dark"]{
  --bg: #070a0f;
  --card: #0b1220;
  --muted: rgba(226,232,240,.70);
  --text: #e7eefc;
  --border: rgba(148,163,184,.16);
  --shadow: 0 14px 28px rgba(0,0,0,.45);

  --orange: #ff9a3e;
  --orange-strong: #ff7a18;

  --grayPill: rgba(148,163,184,.12);
  --ring: rgba(255,122,24,.45);
}

*{ box-sizing: border-box; }
html { scroll-behavior: smooth; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--themeEase), color var(--themeEase);
}

.wrap{
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 18px 28px;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;

  padding: 14px 8px;
  margin: 0 -8px;
  border-radius: 0 0 16px 16px;

  background: rgba(255,255,255,.70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-bottom: 1px solid rgba(15, 23, 42, .06);
  transition: padding .18s ease, box-shadow .18s ease, background .18s ease, border-color var(--themeEase);
}

html[data-theme="dark"] .topbar{
  background: rgba(10,14,22,.72);
  border-bottom-color: rgba(148,163,184,.14);
}

.topbar.scrolled{
  padding: 10px 8px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}
html[data-theme="dark"] .topbar.scrolled{
  background: rgba(12,16,26,.82);
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}

.brand{
  display:flex;
  align-items:flex-start;
  gap: 12px;
  min-width: 340px;
}

.brandIcon{ overflow: hidden; }
.brandLogo{
  height: 25px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(15,23,42,.12));
  transition: filter var(--themeEase);
}
html[data-theme="dark"] .brandLogo{
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.65));
}

.brandTitle{
  display:flex;
  flex-direction:column;
  gap: 4px;
  line-height: 1.05;
  padding-top: 2px;
}

.brandTitle h1{
  margin:0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1px;
  transition: font-size .18s ease;
  white-space: nowrap;
}
.topbar.scrolled .brandTitle h1{ font-size: 15px; }

.brandTitle h1 .plugin{
  color: var(--orange-strong);
  font-weight: 800;
}

.brandTitle p{
  margin:0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  transition: opacity .18s ease, transform .18s ease, color var(--themeEase);
  white-space: nowrap;
}
.topbar.scrolled .brandTitle p{
  opacity: .95;
  transform: translateY(-1px);
}

.live{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  user-select:none;
  white-space: nowrap;
  transition: color var(--themeEase);
}
.dot{
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(34,197,94,.12);
}

.topActions{
  display:flex;
  align-items:center;
  gap: 15px;
}

.themeBtn{
  border: 1px solid var(--border);
  background: rgba(246,247,251,.92);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
  color: #334155;
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  user-select:none;
  transition: background var(--themeEase), border-color var(--themeEase), color var(--themeEase), transform 90ms ease;
  outline: none;
}
.themeBtn:hover{ background: rgba(238,242,247,.95); }
.themeBtn:active{ transform: scale(.98); }
.themeBtn:focus-visible{
  box-shadow: 0 0 0 4px var(--ring);
  border-color: rgba(242,153,74,.35);
}

html[data-theme="dark"] .themeBtn{
  background: rgba(255,255,255,.04);
  color: rgba(226,232,240,.92);
  border-color: rgba(148,163,184,.18);
}
html[data-theme="dark"] .themeBtn:hover{
  background: rgba(255,255,255,.07);
}

.kpis{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background var(--themeEase), border-color var(--themeEase), box-shadow var(--themeEase);
}
.kpi{
  padding: 16px 16px 14px;
  position: relative;
  min-height: 88px;
}
.kpi .label{
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .2px;
  transition: color var(--themeEase);
}
.kpi .value{
  margin-top: 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.kpi .sub{
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  transition: color var(--themeEase);
}
.kpi .icon{
  position:absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  display:grid;
  place-items:center;
  opacity: .95;
}

.ic-orange{ color: var(--orange-strong); }
.ic-green{ color: var(--green); }
.ic-red{ color: var(--red); }
.ic-blue{ color: #06b6d4; }
.ic-purple{ color: var(--purple); }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.panel{
  padding: 14px 16px 12px;
  min-height: 260px;
}
.panelHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}
.panelTitle{
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: .4px;
  transition: color var(--themeEase);
}
html[data-theme="dark"] .panelTitle{ color: rgba(226,232,240,.70); }

.canvasWrap{
  height: 210px;
  padding: 8px 6px 0;
}

.tableCard{
  margin-top: 16px;
  padding: 12px 14px 14px;
}
.tableTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 4px 4px 10px;
}
.tableTitle{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: .4px;
  color: #64748b;
  font-size: 12px;
  transition: color var(--themeEase);
}
html[data-theme="dark"] .tableTitle{ color: rgba(226,232,240,.70); }

.countPill{
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(242,153,74,.2);
  color: var(--orange-strong);
  border: 1px solid rgba(242,153,74,.22);
}

.controls{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.search{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f6f7fb;
  min-width: 280px;
  transition: background var(--themeEase), border-color var(--themeEase);
}
html[data-theme="dark"] .search{
  background: rgba(255,255,255,.04);
}
.search input{
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  transition: color var(--themeEase);
}
html[data-theme="dark"] .search input{
  color: rgba(226,232,240,.92);
}
html[data-theme="dark"] .search input::placeholder{
  color: rgba(148,163,184,.85);
}

select{
  border: 1px solid var(--border);
  background: #f6f7fb;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  outline: none;
  cursor: pointer;
  transition: background var(--themeEase), border-color var(--themeEase), color var(--themeEase);
}
html[data-theme="dark"] select{
  background: rgba(255,255,255,.04);
  color: rgba(226,232,240,.92);
}

.btn{
  border: 1px solid var(--border);
  background: #f6f7fb;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  transition: background var(--themeEase), border-color var(--themeEase), color var(--themeEase);
  text-decoration: none;
}
.btn:hover{ background: #eef2f7; }
html[data-theme="dark"] .btn{
  background: rgba(255,255,255,.04);
  color: rgba(226,232,240,.92);
}
html[data-theme="dark"] .btn:hover{
  background: rgba(255,255,255,.07);
}

table{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
}
thead th{
  text-align:left;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 800;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: .2px;
  white-space: nowrap;
  transition: color var(--themeEase), border-color var(--themeEase);
}
html[data-theme="dark"] thead th{
  color: rgba(148,163,184,.92);
}
tbody td{
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15,23,42,.06);
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  vertical-align: middle;
  transition: color var(--themeEase), border-color var(--themeEase), background var(--themeEase);
}
html[data-theme="dark"] tbody td{
  color: rgba(226,232,240,.92);
  border-bottom-color: rgba(148,163,184,.10);
}
tbody tr:hover{ background: rgba(242,153,74,.06); }
html[data-theme="dark"] tbody tr:hover{ background: rgba(255,122,24,.08); }

.nameCell{ font-weight: 800; color: #0f172a; transition: color var(--themeEase); }
html[data-theme="dark"] .nameCell{ color: rgba(226,232,240,.95); }

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill.oracle{
  background: rgba(56,189,248,.18);
  color: #0284c7;
  border-color: rgba(56,189,248,.25);
}
.pill.validator{
  background: rgba(168,85,247,.18);
  color: #7c3aed;
  border-color: rgba(168,85,247,.25);
}

.status{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.sDot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.s-active{ color: #16a34a; }
.s-active .sDot{ background: var(--green); box-shadow: 0 0 0 6px rgba(34,197,94,.12); }
.s-inactive{ color: #be123c; }
.s-inactive .sDot{ background: var(--red); box-shadow: 0 0 0 6px rgba(225,29,72,.10); }

.tableBottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 6px 2px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  transition: color var(--themeEase);
}
html[data-theme="dark"] .tableBottom{
  color: rgba(148,163,184,.92);
}

.pager{
  display:flex;
  align-items:center;
  gap: 10px;
  user-select:none;
}
.pageBtn{
  width: 30px; height: 30px;
  border-radius: 10px;
  display:grid;
  place-items:center;
  border: 1px solid var(--border);
  background: #f6f7fb;
  cursor:pointer;
  font-weight: 900;
  color: #475569;
  transition: background var(--themeEase), border-color var(--themeEase), color var(--themeEase);
}
html[data-theme="dark"] .pageBtn{
  background: rgba(255,255,255,.04);
  color: rgba(226,232,240,.88);
}

.pageNum{
  width: 28px; height: 28px;
  border-radius: 10px;
  display:grid;
  place-items:center;
  cursor:pointer;
  font-weight: 900;
  color: #64748b;
  transition: background var(--themeEase), color var(--themeEase);
}
html[data-theme="dark"] .pageNum{ color: rgba(148,163,184,.92); }

.pageNum.active{
  background: var(--orange-strong);
  color: white;
  box-shadow: 0 10px 18px rgba(230,126,34,.25);
}
html[data-theme="dark"] .pageNum.active{
  box-shadow: 0 18px 30px rgba(0,0,0,.45);
}

.mini{
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  display:flex;
  align-items:center;
  gap: 8px;
  white-space: nowrap;
  transition: color var(--themeEase);
}
html[data-theme="dark"] .mini{ color: rgba(148,163,184,.92); }

.pingDot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 6px rgba(148,163,184,.12);
}
.pingUp{ background: var(--green) !important; box-shadow: 0 0 0 6px rgba(34,197,94,.12) !important; }
.pingDown{ background: var(--red) !important; box-shadow: 0 0 0 6px rgba(225,29,72,.10) !important; }

/* Bookmark UI */
.bmBtn{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.10);
  background: #f6f7fb;
  cursor: pointer;
  display:grid;
  place-items:center;
  font-weight: 900;
  color: #94a3b8;
  transition: transform .08s ease, background .12s ease, color .12s ease, border-color .12s ease;
  user-select:none;
}
html[data-theme="dark"] .bmBtn{
  background: rgba(255,255,255,.04);
  border-color: rgba(148,163,184,.16);
  color: rgba(148,163,184,.95);
}
.bmBtn:hover{
  background: rgba(242,153,74,.10);
  border-color: rgba(242,153,74,.25);
  color: var(--orange-strong);
}
.bmBtn:active{ transform: scale(.96); }
.bmBtn.on{
  background: rgba(242,153,74,.18);
  border-color: rgba(242,153,74,.28);
  color: var(--orange-strong);
}

@media (max-width: 1200px){
  .kpis{ grid-template-columns: repeat(3, 1fr); }
  .grid2{ grid-template-columns: 1fr; }
  .brandTitle h1, .brandTitle p{ white-space: normal; }
}

@media (max-width: 680px){
  .wrap{ padding: 10px 12px 22px; }
  .topbar{ padding: 10px 6px; margin: 0 -6px; border-radius: 0 0 14px 14px; }
  .brand{ min-width: 0; }
  .brandTitle h1{ font-size: 14px; }
  .brandTitle p{ font-size: 10px; }
  .live{ font-size: 11px; gap: 7px; }
  .kpis{ grid-template-columns: repeat(2, 1fr); }
  .search{ min-width: 220px; width: 100%; }
  .controls{ width: 100%; justify-content: flex-start; }
  .tableTop{ flex-direction: column; align-items: flex-start; }
  .tableBottom{ flex-direction: column; align-items: flex-start; }
}

.svg{ width: 20px; height: 20px; }
.svg.small{ width: 18px; height: 18px; }
/* ===== Top Nav ===== */
.topNav{
  display:flex;
  align-items:center;
  gap: 18px;
  padding: 0 8px;
  flex: 1;
  justify-content: center;
}

.navLink{
  position: relative;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(51,65,85,.92);
  text-decoration: none;
  border-radius: 10px;
  transition: color var(--themeEase), background var(--themeEase);
  white-space: nowrap;
}

html[data-theme="dark"] .navLink{
  color: rgba(226,232,240,.92);
}

.navLink:hover{
  background: rgba(242,153,74,.10);
}

html[data-theme="dark"] .navLink:hover{
  background: rgba(255,122,24,.10);
}

/* underline */
.navLink::after{
  content:"";
  position:absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transform: scaleX(.25);
  opacity: 0;
  transition: transform var(--themeEase), opacity var(--themeEase), background var(--themeEase);
}

.navLink.is-active{
  color: var(--orange-strong);
}

.navLink.is-active::after{
  background: var(--orange-strong);
  transform: scaleX(1);
  opacity: 1;
}

/* Small tweak on mobile: nav scrolls horizontally */
@media (max-width: 680px){
  .topNav{
    justify-content: flex-start;
    overflow:auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topNav::-webkit-scrollbar{ display:none; }
}
