:root {
  --bg: #08141a;
  --panel: #10232b;
  --panel-2: #15323d;
  --text: #ecf4f1;
  --muted: #a8c0bc;
  --accent: #2ad8b4;
  --accent-2: #ffb864;
  --danger: #f76a6a;
  --shadow: rgba(8, 20, 26, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, #194656 0%, transparent 35%),
    radial-gradient(circle at 80% 10%, #4a2f20 0%, transparent 30%),
    linear-gradient(150deg, #071116 0%, #0b1e27 45%, #08141a 100%);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.28;
  pointer-events: none;
}

.bg-orb-1 {
  width: 240px;
  height: 240px;
  top: -40px;
  right: -60px;
  background: #26c7aa;
  animation: float 7s ease-in-out infinite;
}

.bg-orb-2 {
  width: 320px;
  height: 320px;
  bottom: -120px;
  left: -90px;
  background: #ff9f4f;
  animation: float 9s ease-in-out infinite;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 20, 26, 0.72);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  color: var(--muted);
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
}

.hero {
  background: linear-gradient(125deg, rgba(16, 35, 43, 0.95), rgba(21, 50, 61, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 0 20px 45px var(--shadow);
  animation: fade-up 400ms ease;
}

.kicker {
  color: var(--accent);
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 0.5rem;
  line-height: 1.1;
}

h2 {
  margin: 0 0 0.75rem;
}

h3 {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.subtext {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.subtext.small {
  margin-bottom: 0.8rem;
  font-size: 0.92rem;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 35, 43, 0.94), rgba(11, 29, 36, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 16px 40px var(--shadow);
  animation: fade-up 550ms ease;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.status-badge {
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  font-size: 0.78rem;
  border: 1px solid transparent;
}

.status-idle {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.2);
}

.status-ok {
  color: #a5ffe8;
  border-color: #2ad8b4;
}

.status-error {
  color: #ffd4d4;
  border-color: var(--danger);
}

.controls-grid {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

input,
select,
button {
  font-family: inherit;
  font-size: 0.95rem;
}

input,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 20, 26, 0.55);
  color: var(--text);
  padding: 0.65rem 0.78rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 216, 180, 0.2);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.button-row.compact {
  margin: 0;
}

.btn {
  border: 1px solid rgba(42, 216, 180, 0.7);
  background: linear-gradient(120deg, rgba(42, 216, 180, 0.22), rgba(35, 150, 128, 0.25));
  color: var(--text);
  padding: 0.56rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.metric-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric-card {
  background: linear-gradient(150deg, rgba(21, 50, 61, 0.65), rgba(11, 26, 32, 0.8));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.8rem;
}

.metric-card p {
  margin: 0;
  font-weight: 500;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  word-break: break-all;
}

.search-row {
  display: grid;
  gap: 0.6rem;
}

.code-block {
  margin: 0.8rem 0 0;
  padding: 0.8rem;
  border-radius: 12px;
  background: #08161c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ccede5;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.4;
  max-height: 300px;
  overflow: auto;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

td:nth-child(2) {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.log {
  background: #071217;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  min-height: 120px;
  max-height: 280px;
  overflow: auto;
  padding: 0.68rem;
  display: grid;
  gap: 0.35rem;
}

.log-line {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: #c3e3db;
  padding-bottom: 0.3rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.log-line.warn {
  color: #ffd8a8;
}

.log-line.error {
  color: #ffb9b9;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  padding: 0.9rem 0 1.4rem;
}

code {
  font-family: "IBM Plex Mono", monospace;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.08rem 0.28rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(12px);
  }
}

@media (min-width: 880px) {
  .controls-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-row {
    grid-template-columns: 210px 1fr auto;
  }
}
