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

:root {
  color-scheme: light;
  font-family: "Work Sans", "Segoe UI", sans-serif;
  --cn-bg: #f7f6ef;
  --cn-bg-highlight: #f9f0d2;
  --cn-bg-accent: #e7f3ef;
  --cn-card: #ffffff;
  --cn-border: #d7d1bd;
  --cn-text: #1f2e25;
  --cn-muted: #506258;
  --cn-primary: #278558;
  --cn-primary-dark: #1f6a46;
  --cn-secondary: #0c3d5d;
  --cn-link: #1779ba;
  --cn-danger: #9f0a12;
  --cn-success: #38a571;
  --cn-warning-bg: #f8e3af;
  --cn-warning-text: #5e4b15;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, var(--cn-bg-highlight), transparent 38%),
    radial-gradient(circle at 100% 0%, var(--cn-bg-accent), transparent 42%), var(--cn-bg);
  color: var(--cn-text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page {
  max-width: 920px;
  margin: 3rem auto;
  padding: 0 1rem 2rem;
  display: grid;
  gap: 1rem;
}

.card.header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.card {
  background: var(--cn-card);
  border: 1px solid var(--cn-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(12, 61, 93, 0.08);
}

.narrow-panel {
  max-width: 560px;
  margin: 0 auto;
}

.hero {
  display: grid;
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
}

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

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cn-primary);
  font-weight: 700;
}

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

.compact-actions {
  margin-top: 0.5rem;
}

.button-link,
button {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
  border: 0;
  border-radius: 8px;
  background: var(--cn-primary);
  color: white;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease;
}

.button-link.primary,
button:not(.secondary-button):not(.danger-button) {
  background: var(--cn-primary);
}

button:hover,
.button-link:hover {
  background: var(--cn-primary-dark);
  transform: translateY(-1px);
}

.button-link.secondary,
.secondary-button {
  background: #e3ede8;
  color: var(--cn-text);
  border: 1px solid #c6e1d3;
}

.button-link.muted-link {
  background: #ebe1c1;
  color: var(--cn-secondary);
  border: 1px solid #d6cda9;
}

.danger-button {
  background: var(--cn-danger);
}

.flash {
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  font-weight: 600;
}

.flash.error {
  background: #fce7e8;
  color: #721c24;
  border: 1px solid #f5c2c7;
}

.flash.success {
  background: #e7f3ef;
  color: #174f34;
  border: 1px solid #c6e1d3;
}

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

.list-stack {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.record-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--cn-border);
  border-radius: 12px;
  background: var(--cn-card);
}

.submission-row {
  align-items: flex-start;
}

.submission-payload {
  margin: 0;
  padding: 0.7rem;
  border: 1px solid var(--cn-border);
  border-radius: 10px;
  background: #f7f6ef;
  min-width: 260px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #364940;
  font-size: 0.9rem;
}

.submission-content {
  display: grid;
  gap: 0.7rem;
  min-width: 320px;
}

.submission-attachments h4 {
  margin: 0;
  font-size: 0.95rem;
}

.submission-attachments ul {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
}

.submission-attachments li + li {
  margin-top: 0.3rem;
}

.attachment-link {
  color: var(--cn-link);
  font-weight: 600;
}

.record-details {
  display: grid;
  justify-items: end;
  gap: 0.6rem;
}

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

.form-shell {
  display: grid;
  gap: 0rem;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.badge {
  display: inline-flex;
  background: #e7f3ef;
  color: var(--cn-primary-dark);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.lead {
  color: var(--cn-muted);
  line-height: 1.6;
}

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

.field-group {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: #2f4238;
}

.field-group.inline-field {
  grid-auto-flow: column;
  justify-content: start;
}

.field-group input[type="checkbox"],
.field-group input[type="radio"] {
  width: auto;
}

.yaml-editor-shell {
  display: grid;
  gap: 0.6rem;
}

.yaml-editor-source {
  display: none;
}

.yaml-editor-react-root .cm-editor {
  border: 1px solid var(--cn-border);
  border-radius: 8px;
  overflow: hidden;
}

.yaml-editor-react-root .cm-scroller {
  min-height: 360px;
  max-height: 720px;
  cursor: text;
}

.yaml-editor-react-root .cm-content,
.yaml-editor-react-root .cm-line {
  cursor: text;
}

.yaml-lint-summary {
  border: 1px solid #e6d299;
  border-radius: 8px;
  background: var(--cn-warning-bg);
  color: var(--cn-warning-text);
  padding: 0.6rem 0.75rem;
  font-size: 0.92rem;
  line-height: 1.45;
  margin-top: 1.3rem;
}

.yaml-lint-summary.ok {
  border-color: #c6e1d3;
  background: #e7f3ef;
  color: #174f34;
}

.yaml-lint-summary p {
  margin: 0;
}

.yaml-lint-summary ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.yaml-lint-summary li + li {
  margin-top: 0.3rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--cn-border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  background: var(--cn-card);
  color: var(--cn-text);
}

textarea {
  resize: vertical;
  min-height: 160px;
}

.sub-panel {
  margin-top: 1rem;
  border-top: 1px solid var(--cn-border);
  padding-top: 1rem;
}

.inline-form {
  display: inline-block;
}

.success-panel {
  text-align: center;
}

.required-indicator {
  color: red;
}
