@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #fefefe;
  --fg: #111827;
  --white: #ffffff;
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --secondary: #48cae4;
  --accent: #f59e0b;
  --muted: #f3f4f6;
  --border: #e5e7eb;
  --danger: #dc2626;
  --sky-100: #dbeafe;
  --emerald-100: #d1fae5;
  --amber-100: #fef3c7;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-800: #991b1b;
  --emerald-700: #047857;
  --red-700: #b91c1c;
  --gray-700: #374151;
  --fg-soft: #e5e7eb;
  --white-20: rgba(255, 255, 255, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  color: var(--fg);
  background: var(--bg);
}

.page {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.page::before,
.page::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.page::before {
  width: 340px;
  height: 340px;
  top: -110px;
  right: -90px;
  background: var(--muted);
  border-radius: 8px;
  transform: rotate(24deg);
}

.page::after {
  width: 260px;
  height: 260px;
  bottom: -70px;
  left: -70px;
  background: var(--sky-100);
  border-radius: 999px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  position: relative;
  z-index: 2;
}

.narrow {
  max-width: 760px;
}

.hero-block {
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.hero-block::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -26px;
  width: 150px;
  height: 150px;
  background: var(--white-20);
  border-radius: 999px;
}

h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.subtitle {
  margin: 0.55rem 0 0;
  font-size: 1.03rem;
  font-weight: 500;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat {
  border-radius: 8px;
  padding: 1rem;
}

.stat:nth-child(1) {
  background: var(--sky-100);
}

.stat:nth-child(2) {
  background: var(--emerald-100);
}

.stat:nth-child(3) {
  background: var(--amber-100);
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
}

.stat-value {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card {
  background: var(--muted);
  border-radius: 8px;
  padding: 1rem;
  border: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.card:hover {
  transform: scale(1.02);
  background: var(--border);
}

.card-white {
  background: var(--white);
}

.card-white:hover {
  background: var(--white);
}

.card-emerald {
  background: var(--emerald-100);
}

.card-amber {
  background: var(--amber-100);
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.42rem;
  font-weight: 600;
}

input {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 0.78rem 0.82rem;
  font-size: 0.96rem;
  background: var(--muted);
  color: var(--fg);
}

input:focus {
  background: var(--white);
  outline: 0;
  border: 2px solid var(--primary);
  box-shadow: none;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  height: 56px;
  padding: 0 1.1rem;
  font-family: inherit;
  font-size: 0.94rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

button,
.btn.primary {
  background: var(--primary);
  color: var(--white);
}

button:hover,
.btn.primary:hover {
  background: var(--primary-strong);
  transform: scale(1.05);
}

.btn.ghost {
  border: 4px solid var(--primary);
  background: transparent;
  color: var(--primary);
}

.btn.ghost:hover {
  background: var(--primary);
  color: var(--white);
  transform: scale(1.05);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.checkbox-row input {
  width: auto;
  accent-color: var(--primary);
}

.error-banner {
  border-radius: 6px;
  border: 2px solid var(--red-500);
  background: var(--red-100);
  color: var(--red-800);
  padding: 0.75rem;
  font-weight: 600;
}

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

th {
  text-align: left;
  padding: 0 0.65rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

td {
  padding: 0.75rem 0.65rem;
  background: var(--white);
  font-size: 0.93rem;
}

tr td:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

tr td:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.ok {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.pill.off {
  background: var(--red-100);
  color: var(--red-700);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.inline {
  display: inline;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.link-btn {
  border: 0;
  color: var(--white);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  height: auto;
  letter-spacing: 0;
  text-transform: none;
  transform: none;
  font-size: 0.82rem;
  line-height: 1.2;
}

.link:hover {
  text-decoration: underline;
}

.link-btn:hover {
  transform: none;
  text-decoration: none;
  filter: brightness(0.95);
}

.test-github-btn {
  background: #1f883d;
}

.test-email-btn {
  background: #0b63b6;
}

.run-agent-btn {
  background: #b35a00;
}

.link.danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 0;
  height: auto;
  letter-spacing: 0;
  text-transform: none;
  transform: none;
}

.link.danger:hover {
  transform: none;
  background: transparent;
  text-decoration: underline;
}

.logs {
  margin: 0;
  background: var(--fg);
  color: var(--fg-soft);
  border-radius: 6px;
  padding: 0.95rem;
  white-space: pre-wrap;
  font-family: "SF Mono", "Menlo", monospace;
  max-height: 72vh;
  overflow: auto;
}

.hint {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
}

.notice-banner {
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.notice-banner.success {
  background: var(--emerald-100);
  border: 2px solid var(--emerald-700);
  color: var(--emerald-700);
}

.notice-banner.error {
  background: var(--red-100);
  border: 2px solid var(--red-700);
  color: var(--red-700);
}

@media (max-width: 860px) {
  .header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .page::before {
    width: 220px;
    height: 220px;
  }
}
