@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #f4efe7;
  --bg-deep: #efe6d6;
  --panel: rgba(255, 255, 255, 0.72);
  --ink: #1a1c19;
  --muted: #5b5b57;
  --accent: #265bff;
  --green: #138a36;
  --red: #c4451d;
  --shadow: 0 20px 40px rgba(26, 28, 25, 0.15);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fef6e3 0%, var(--bg) 42%, #e9dcc4 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
}

body::before {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 30% 30%, rgba(38, 91, 255, 0.15), transparent 70%);
  top: -120px;
  left: -120px;
  filter: blur(2px);
}

body::after {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at 70% 30%, rgba(19, 138, 54, 0.15), transparent 70%);
  bottom: -140px;
  right: -80px;
  filter: blur(4px);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: grid;
  gap: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.title-group h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--muted);
}

.subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
}

.badge {
  background: linear-gradient(140deg, #f8f0de, #fff);
  border-radius: 999px;
  padding: 12px 20px;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.badge-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.badge-value {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.scan-form {
  display: grid;
  gap: 12px;
}

.scan-form label {
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.input-row input {
  flex: 1 1 320px;
  border: 2px solid rgba(26, 28, 25, 0.15);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: "JetBrains Mono", monospace;
  background: rgba(255, 255, 255, 0.9);
}

.input-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(38, 91, 255, 0.15);
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(26, 28, 25, 0.18);
}

.input-row button {
  background: var(--accent);
  color: #fff;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status-card {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(26, 28, 25, 0.08);
}

.status-card .status-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c2c2be;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.6);
}

.status-card.ok {
  background: rgba(19, 138, 54, 0.22);
  border-color: rgba(19, 138, 54, 0.5);
  box-shadow: 0 0 0 1px rgba(19, 138, 54, 0.25), 0 12px 24px rgba(19, 138, 54, 0.2);
  border-left: 6px solid rgba(19, 138, 54, 0.8);
}

.status-card.ok .status-dot {
  background: var(--green);
}

.status-card.bad {
  background: rgba(196, 69, 29, 0.22);
  border-color: rgba(196, 69, 29, 0.5);
  box-shadow: 0 0 0 1px rgba(196, 69, 29, 0.25), 0 12px 24px rgba(196, 69, 29, 0.2);
  border-left: 6px solid rgba(196, 69, 29, 0.8);
}

.status-card.bad .status-dot {
  background: var(--red);
}

.status-card.pulse {
  animation: pulse 0.5s ease;
}

.status-label {
  margin: 0 0 4px;
  font-weight: 600;
}

.status-detail {
  margin: 0;
  color: var(--muted);
}

.stats-panel {
  display: grid;
  gap: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  border: 1px solid rgba(26, 28, 25, 0.08);
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-value {
  margin: 6px 0 0;
  font-size: 1.6rem;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.option-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.option-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(26, 28, 25, 0.06);
  border-radius: 999px;
  border: 1px solid rgba(26, 28, 25, 0.08);
  font-size: 0.9rem;
}

.option-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.filter-btn {
  background: rgba(26, 28, 25, 0.08);
  color: var(--ink);
  border: 1px solid transparent;
}

.filter-btn.active {
  background: #fff;
  border-color: rgba(26, 28, 25, 0.18);
}

.export-btn {
  background: linear-gradient(120deg, #ffd27f, #ffba57);
  color: #382406;
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(26, 28, 25, 0.2);
  color: var(--ink);
}

.table-panel h2 {
  margin: 0;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(26, 28, 25, 0.1);
}

thead th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--muted);
}

.status-cell {
  font-weight: 600;
}

.row-green .status-cell {
  color: var(--green);
}

.row-red .status-cell {
  color: var(--red);
}

.row-green td {
  background: rgba(19, 138, 54, 0.08);
}

.row-green td:first-child {
  border-left: 4px solid rgba(19, 138, 54, 0.6);
}

.row-red td {
  background: rgba(196, 69, 29, 0.08);
}

.row-red td:first-child {
  border-left: 4px solid rgba(196, 69, 29, 0.6);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .export-btn,
  .filter-group,
  .ghost-btn {
    width: 100%;
    justify-content: center;
  }
}
