:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --text: #1e2428;
  --muted: #667078;
  --line: #d9dedc;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 18px 50px rgba(30, 36, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button.secondary {
  background: #263238;
}

button.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 260px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 48px);
  place-items: center;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.form-panel {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.template-meta {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
}

.status[data-type="error"] {
  color: var(--danger);
}

.status[data-type="success"] {
  color: var(--success);
}

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

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

pre {
  min-height: 480px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 16px;
  line-height: 1.65;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

.logs-panel {
  margin-top: 18px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf7f2;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.pill[data-status="failed"] {
  background: #fff1f0;
  color: var(--danger);
}

@media (max-width: 920px) {
  main {
    padding: 16px;
  }

  .workspace,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  pre {
    min-height: 320px;
  }
}
