:root {
  font-family: "Inter", "Poppins", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #050505;
  color: #f8fafc;
}

a {
  color: inherit;
  text-decoration: none;
}
* {
  box-sizing: border-box;
}

:root {
  --bg: #030303;
  --stars: radial-gradient(1px 1px at 20% 30%, #ffffff44, transparent 40%), radial-gradient(1px 1px at 80% 70%, #ffffff55, transparent 40%),
    radial-gradient(1px 1px at 50% 10%, #ffffff33, transparent 40%), radial-gradient(2px 2px at 10% 80%, #ffffff22, transparent 45%);
  --panel: rgba(12, 12, 16, 0.8);
  --panel-muted: rgba(18, 18, 22, 0.85);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --border: rgba(255, 255, 255, 0.08);
  --input: rgba(255, 255, 255, 0.04);
  --tile: rgba(255, 255, 255, 0.04);
  --chip-bg: rgba(255, 255, 255, 0.08);
  --accent: linear-gradient(135deg, #7dd3fc, #60a5fa, #a855f7);
}

body.theme-light {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-muted: #e2e8f0;
  --text: #0f172a;
  --muted: #334155;
  --border: rgba(15, 23, 42, 0.1);
  --input: #e2e8f0;
  --tile: #eef2f7;
  --chip-bg: #e2e8f0;
  --accent: linear-gradient(135deg, #1e3a8a, #2563eb, #7c3aed);
}

body {
  margin: 0;
  font-family: "Inter", "Poppins", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  background-image: var(--stars);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.app {
  padding: 32px 28px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.brand-text h1 {
  font-size: clamp(1.6rem, 2vw, 2rem);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.brand-text p {
  margin: 0;
  color: var(--muted);
}

h1 {
  font-size: 34px;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0;
  font-size: 20px;
}

p {
  margin: 0;
  color: var(--muted);
}

.token-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

input {
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
}

input::placeholder {
  color: var(--muted);
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}

button:active {
  transform: translateY(0);
  opacity: 0.9;
}

.toggle {
  align-self: stretch;
  justify-self: end;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.tile {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--tile);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.tile.ok {
  border-color: #22c55e66;
}
.tile.warn {
  border-color: #facc1566;
}
.tile.critical {
  border-color: #ef444466;
}

.tile-title {
  font-size: 13px;
  color: var(--muted);
}

.tile-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  color: var(--text);
  font-weight: 700;
}

.empty {
  color: var(--muted);
  padding: 8px 0;
}

.error {
  background: #ef444433;
  color: #fecdd3;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid #ef444460;
}

.error-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.config-panel {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  background: #1e1e2f;
  padding: 0.75rem;
  border-radius: 8px;
}

.config-panel label {
  display: flex;
  flex-direction: column;
  color: #ccc;
  font-size: 0.9rem;
}

.config-panel input {
  margin-top: 0.25rem;
  padding: 0.4rem 0.6rem;
  background: #12121c;
  border: 1px solid #333;
  border-radius: 4px;
  color: #eee;
}

.config-panel button {
  padding: 0.5rem 0.9rem;
  background: #2d8cf0;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.config-panel button:hover {
  background: #2173c8;
}
.events-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-row {
  display: grid;
  grid-template-columns: 140px 120px 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 8px;
}

.event-time {
  color: var(--muted);
  font-size: 13px;
}

.event-type {
  font-weight: 600;
}

.event-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.pill.warn {
  border-color: #f97316;
  color: #fbbf24;
}
