:root {
  --ink: #17211b;
  --muted: #68736c;
  --paper: #f3f1e9;
  --panel: #fffef9;
  --line: #d9d8cf;
  --accent: #205b43;
  --accent-ink: #f8fff9;
  --danger: #8f2d2d;
  --shadow: 0 18px 60px rgb(23 33 27 / 8%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 18ch;
  margin-bottom: 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 10vw, 4.75rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgb(243 241 233 / 92%);
}

.topbar > div {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  text-decoration: none;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.shell {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: 2rem 1rem 5rem;
}

.shell--narrow { width: min(100%, 48rem); }

.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 1rem 0 2rem;
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede { max-width: 44rem; color: var(--muted); font-size: 1.05rem; }

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

.company-grid, .dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.company-card h2 { min-height: 2.8rem; }

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.metrics div {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.metrics dt { color: var(--muted); font-size: 0.72rem; }
.metrics dd { margin: 0.25rem 0 0; font-weight: 700; }
.metrics--wide { margin-bottom: 0; }

.button {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button--quiet { background: transparent; color: var(--accent); }
.button--danger { border-color: var(--danger); background: var(--danger); }
.text-link { color: var(--accent); font-size: 0.88rem; font-weight: 700; }

.record-list, .event-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.record-list span, .event-list span { color: var(--muted); font-size: 0.8rem; }
.record-title { font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.event-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.event-list div { display: flex; flex-direction: column; }

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

.empty-state { margin: 1rem 0 0; color: var(--muted); }
.stack { display: grid; gap: 1.25rem; }

.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.82rem; font-weight: 700; }

input, select, textarea {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #b9bcb4;
  border-radius: 0.65rem;
  background: white;
  color: var(--ink);
  font: inherit;
}

textarea { resize: vertical; }

.button-row, .inline-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-errors, .refusal { border-color: #cfaaaa; }
.form-errors { padding: 0.8rem; border-radius: 0.5rem; background: #fff4f2; }
.form-errors ul { margin-bottom: 0; }
.next-action { padding: 0.8rem; border-left: 3px solid var(--accent); background: #f0f6f1; }

.flash {
  width: min(calc(100% - 2rem), 46rem);
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  border: 1px solid #a5c8b7;
  border-radius: 0.7rem;
  background: #eaf6ee;
}

@media (min-width: 48rem) {
  .shell { padding: 4rem 2rem 7rem; }
  .topbar { padding-inline: 2rem; }
  .page-header { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .company-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1.1fr 0.9fr; }
  .button-row, .inline-form { flex-direction: row; align-items: center; }
}
