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

:root {
  --bg: #f4f6f2;
  --ink: #182119;
  --surface: #ffffff;
  --accent: #0f6d53;
  --accent-strong: #0b4f3d;
  --warning: #9f2a2a;
  --muted: #5f6c60;
  --line: #dde6dc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 15%, #d9efe2 0, transparent 35%),
              radial-gradient(circle at 85% 0, #d7e4ff 0, transparent 25%),
              var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(24, 33, 25, 0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(24, 33, 25, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.1rem;
}

.brand p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), #4d9f6a);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
}

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

nav a,
.link-button {
  border: 0;
  background: none;
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.layout {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
  position: relative;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: 0 14px 34px rgba(24, 33, 25, 0.06);
  margin-bottom: 1rem;
}

.auth-card {
  max-width: 560px;
  margin: 3rem auto;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-cols .full {
  grid-column: 1 / -1;
}

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

input,
select,
textarea {
  border: 1px solid #c6d4c7;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: #fbfdf9;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #90d8ba;
  border-color: #7fc9aa;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}

.button {
  display: inline-block;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.6rem 0.95rem;
  text-decoration: none;
  color: var(--ink);
  background: white;
  cursor: pointer;
}

.button-primary {
  border-color: var(--accent);
  color: white;
  background: linear-gradient(120deg, var(--accent), #2c8c5a);
}

.flash-stack {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.flash {
  border-radius: 12px;
  padding: 0.8rem;
}

.flash.success {
  background: #e4f7ee;
  border: 1px solid #8bd5ab;
}

.flash.error {
  background: #fde9e9;
  border: 1px solid #e6a7a7;
}

.split {
  display: grid;
  gap: 1rem;
  grid-template-columns: 2fr 1fr;
}

.guide ul {
  margin: 0.8rem 0;
  padding-left: 1.15rem;
}

.guide li {
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.guide-note {
  margin-top: 1rem;
  border: 1px dashed #a1b9a8;
  padding: 0.8rem;
  border-radius: 12px;
  background: #f7fbf6;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0.4rem;
  text-align: left;
}

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

.actions-row {
  display: flex;
  gap: 0.65rem;
}

.danger {
  color: var(--warning);
}

.inline-form {
  display: inline;
}

.instruction-box {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  background: #f8fbf9;
  border-radius: 12px;
  padding: 0.9rem;
}

.empty-state {
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed #b6c7b7;
}

.helper {
  color: var(--muted);
}

.logs-layout {
  grid-template-columns: 1.2fr 1fr;
}

.log-box {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  background: #111814;
  color: #d6f0de;
  border-radius: 12px;
  padding: 0.9rem;
  min-height: 320px;
  max-height: 640px;
  overflow: auto;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }
}
