* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #070b1a;
  --bg2: #0b1024;
  --panel: rgba(16, 24, 52, 0.75);
  --panel2: rgba(12, 19, 44, 0.9);
  --border: rgba(80, 110, 200, 0.22);
  --blue: #4f8cff;
  --cyan: #22d3ee;
  --purple: #8b5cf6;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;
  --text: #eef3ff;
  --muted: #8b98b8;
  --gold1: #f7cf5c;
  --gold2: #b8860b;
}

html, body {
  height: 100%;
  background:
    radial-gradient(circle at 15% 20%, rgba(79, 140, 255, 0.13), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(139, 92, 246, 0.12), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(34, 211, 238, 0.08), transparent 40%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg2) 50%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(80, 110, 200, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 110, 200, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
}

.app { display: flex; min-height: 100vh; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, rgba(7, 12, 30, 0.97), rgba(4, 8, 22, 0.97));
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 20px rgba(247, 207, 92, 0.35);
}

.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Animated coin */
.coin {
  width: 38px;
  height: 38px;
  position: relative;
  transform-style: preserve-3d;
  animation: coinSpin 4s linear infinite;
}
.coin.small { width: 28px; height: 28px; }
.coin .face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold1), var(--gold2) 70%);
  border: 2px solid #8a5a16;
  color: #2a1e00;
  font-weight: 900;
  font-size: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.2),
    0 0 18px rgba(247, 207, 92, 0.5);
}
.coin.small .face { font-size: 13px; }
.coin .front { transform: rotateY(0deg); }
.coin .back { transform: rotateY(180deg); }
@keyframes coinSpin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #a8b3cf;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}
.nav-btn:hover {
  background: rgba(79, 140, 255, 0.08);
  color: #fff;
  border-color: rgba(79, 140, 255, 0.2);
}
.nav-btn.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(79, 140, 255, 0.25), rgba(139, 92, 246, 0.16));
  border-color: rgba(79, 140, 255, 0.35);
  box-shadow: inset 3px 0 0 var(--blue);
  font-weight: 600;
}

.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); }
.footer-coin { display: flex; align-items: center; gap: 10px; }
.footer-title { font-weight: 700; font-size: 13px; color: #fff; }
.footer-sub { font-size: 10.5px; color: var(--muted); }

/* ============ MAIN ============ */
.main { flex: 1; padding: 20px 26px 40px; max-width: 1400px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(10, 16, 38, 0.7);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  margin-bottom: 24px;
}
.search-top {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-top input {
  width: 100%;
  background: rgba(4, 9, 22, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 40px 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}
.search-top input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1); }
.search-icon {
  position: absolute;
  right: 14px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(79, 140, 255, 0.06);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green  { background: var(--green);  box-shadow: 0 0 8px var(--green); }
.dot.cyan   { background: var(--cyan);   box-shadow: 0 0 8px var(--cyan); }
.dot.yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.dot.red    { background: var(--red);    box-shadow: 0 0 8px var(--red); }

/* Pages */
.page { display: none; animation: fadein 0.25s ease; }
.page.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 26px; font-weight: 800; margin-bottom: 4px; color: #fff; }
.page-sub { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: linear-gradient(145deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.stat-card:hover { border-color: rgba(79, 140, 255, 0.4); transform: translateY(-2px); }
.stat-icon {
  font-size: 22px;
  color: var(--blue);
  margin-bottom: 8px;
  text-shadow: 0 0 14px rgba(79, 140, 255, 0.5);
}
.stat-label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.stat-value { font-size: 24px; font-weight: 800; color: #fff; margin-top: 6px; letter-spacing: 0.02em; }

/* Two column */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Card */
.card {
  background: linear-gradient(145deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.03em;
}

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  padding: 9px 8px;
  color: #91a8d9;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 9px 8px;
  color: #dce4fa;
  border-bottom: 1px solid rgba(80, 110, 200, 0.08);
  font-variant-numeric: tabular-nums;
}
.table tr:last-child td { border-bottom: 0; }
.table code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--cyan);
}

.muted { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* Ring */
.ring-wrap { position: relative; width: 160px; height: 160px; margin: 10px auto 16px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(80, 110, 200, 0.15); stroke-width: 8; }
.ring-fg {
  fill: none;
  stroke: url(#grad);
  stroke: var(--green);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.6));
  transition: stroke-dashoffset 0.6s ease;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-value { font-size: 26px; font-weight: 800; color: #fff; }
.ring-label { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.ring-legend {
  display: flex;
  justify-content: space-around;
  font-size: 12px;
  color: var(--muted);
  padding-top: 8px;
}
.ring-legend b { color: #fff; margin-left: 4px; }

/* Alerts list */
.alerts-list { max-height: 260px; overflow-y: auto; }
.alert-item {
  padding: 10px 12px;
  border-left: 3px solid var(--border);
  background: rgba(4, 9, 22, 0.4);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.alert-item.offline { border-left-color: var(--red); }
.alert-item.online  { border-left-color: var(--green); }
.alert-item.behind  { border-left-color: var(--yellow); }
.alert-item.synced  { border-left-color: var(--cyan); }
.alert-item .alert-time { color: var(--muted); font-size: 10.5px; }
.alert-item .alert-type { font-weight: 700; margin: 0 6px; }
.alert-item .alert-msg { color: #dce4fa; }

/* Trend */
.trend { padding: 8px 0; }
.trend-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(80, 110, 200, 0.08);
  font-size: 12.5px;
}
.trend-row:last-child { border-bottom: 0; }
.trend-row .t-time { color: var(--muted); }
.trend-row .t-val { color: var(--cyan); font-weight: 600; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #05081a; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(#4f8cff, #8b5cf6);
  border-radius: 20px;
}

/* Responsive */
@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 14px; }
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------------- Validation button & result ---------------- */
.btn-primary {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #4f8cff, #8b5cf6);
  box-shadow: 0 8px 22px rgba(79, 140, 255, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.verify-result { padding: 4px 0; }

.validation-card {
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: rgba(4, 9, 22, 0.55);
  font-size: 13.5px;
  line-height: 1.7;
  color: #dce4fa;
}
.validation-card code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--cyan);
  word-break: break-all;
}
.validation-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}
.validation-ok {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(145deg,
    rgba(12, 40, 22, 0.65),
    rgba(6, 20, 12, 0.75));
}
.validation-ok .validation-title { color: var(--green); }
.validation-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(145deg,
    rgba(55, 12, 24, 0.65),
    rgba(20, 8, 18, 0.75));
}
.validation-error .validation-title { color: var(--red); }

/* ---------------- Nodes page ---------------- */
.nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.node-card {
  background: linear-gradient(145deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.node-card:hover {
  border-color: rgba(79, 140, 255, 0.4);
  transform: translateY(-2px);
}
.node-card.online  { border-left: 3px solid var(--green); }
.node-card.offline { border-left: 3px solid var(--red); }

.node-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.node-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.03em;
}

.node-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(79, 140, 255, 0.06);
  border: 1px solid var(--border);
}
.node-status.online  { color: var(--green); border-color: rgba(34, 197, 94, 0.35); }
.node-status.offline { color: var(--red);   border-color: rgba(239, 68, 68, 0.35); }

.node-big {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 20px rgba(79, 140, 255, 0.25);
}
.node-big-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  margin-bottom: 14px;
}

.node-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  font-size: 12.5px;
  color: #dce4fa;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.node-meta .muted {
  display: block;
  font-size: 10.5px;
  margin-bottom: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.node-meta b { color: #fff; }

.node-hash {
  padding-top: 10px;
  font-size: 12px;
}
.node-hash .muted {
  display: block;
  font-size: 10.5px;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.node-hash code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--cyan);
  word-break: break-all;
}

/* Small status dot inside tables */
.node-status .dot,
.table .dot {
  width: 7px;
  height: 7px;
}

/* ---------------- Search page ---------------- */
.search-grid-ui {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.search-card {
  background: linear-gradient(145deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.15s;
}
.search-card:hover {
  border-color: rgba(79, 140, 255, 0.4);
  transform: translateY(-2px);
}
.search-card .search-icon {
  font-size: 26px;
  margin-bottom: 8px;
  color: var(--blue);
  text-shadow: 0 0 16px rgba(79, 140, 255, 0.45);
  position: static;
  display: inline-block;
  pointer-events: auto;
}
.search-card h2 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.search-card .muted {
  font-size: 12.5px;
  margin-bottom: 14px;
  padding: 0;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-form input {
  background: rgba(4, 9, 22, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.search-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}
.search-form button {
  padding: 10px 16px;
  font-size: 13px;
}

.search-result-area {
  margin-top: 8px;
}

/* Wallet result */
.wallet-box {
  background: rgba(4, 9, 22, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.wallet-box .muted {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0;
  margin-bottom: 4px;
}
.wallet-box .address-full {
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--cyan);
  word-break: break-all;
  display: block;
  margin-bottom: 12px;
}
.wallet-balance {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 18px rgba(79, 140, 255, 0.3);
  line-height: 1.1;
}

/* Block / Tx details */
.block-details {
  background: rgba(4, 9, 22, 0.45);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.8;
  color: #dce4fa;
}
.block-details p {
  margin: 4px 0;
}
.block-details code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--cyan);
  word-break: break-all;
}
.block-details .address-full {
  display: block;
  margin-top: 4px;
}

/* Table wrapper (safe horizontal scroll) */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
}
.table-wrap table {
  min-width: 600px;
}

/* ---------------- Network page ---------------- */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.intel-item {
  background: rgba(4, 9, 22, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  transition: border-color 0.2s, transform 0.15s;
}
.intel-item:hover {
  border-color: rgba(79, 140, 255, 0.4);
  transform: translateY(-2px);
}
.intel-item.ok   { border-color: rgba(34, 197, 94, 0.4);  background: linear-gradient(145deg, rgba(12, 40, 22, 0.55), rgba(6, 20, 12, 0.65)); }
.intel-item.warn { border-color: rgba(250, 204, 21, 0.4); background: linear-gradient(145deg, rgba(45, 38, 10, 0.55), rgba(22, 18, 6, 0.65)); }

.intel-label {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.intel-value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 14px rgba(79, 140, 255, 0.3);
  line-height: 1.15;
}

.intel-item.ok   .intel-value { color: var(--green); }
.intel-item.warn .intel-value { color: var(--yellow); }

/* ---------------- Welcome voice button ---------------- */
.voice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.22), rgba(139, 92, 246, 0.16));
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 0 0 rgba(79, 140, 255, 0);
}
.voice-btn:hover {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.35), rgba(139, 92, 246, 0.25));
  border-color: rgba(79, 140, 255, 0.55);
  box-shadow: 0 0 18px rgba(79, 140, 255, 0.35);
  transform: translateY(-1px);
}
.voice-btn:active {
  transform: scale(0.94);
}
