:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #d9e0e7;
  --field: #f9fafb;
  --primary: #15803d;
  --primary-hover: #166534;
  --danger: #b91c1c;
  --ok-bg: #ecfdf3;
  --ok-text: #166534;
  --err-bg: #fef2f2;
  --err-text: #991b1b;
}

* {
  box-sizing: border-box;
}

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

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding: 32px;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  outline: none;
}

input,
select {
  height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 150px;
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

.wide,
.message,
.actions {
  grid-column: 1 / -1;
}

.message {
  display: none;
  padding: 14px 16px;
  border-radius: 6px;
  font-weight: 700;
}

.message.ok {
  display: block;
  background: var(--ok-bg);
  color: var(--ok-text);
}

.message.error {
  display: block;
  background: var(--err-bg);
  color: var(--err-text);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 10px;
}

button {
  min-width: 138px;
  height: 48px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-hover);
}

.secondary {
  background: #e5e7eb;
  color: #374151;
}

@media (max-width: 760px) {
  .page {
    width: 100%;
    padding: 0;
  }

  .panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .header,
  .form {
    padding: 22px;
  }

  .form {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column-reverse;
  }

  button {
    width: 100%;
  }
}
