:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --ink: #18221d;
  --muted: #627067;
  --panel: #ffffff;
  --line: #dbe2dc;
  --accent: #18705a;
  --accent-dark: #0d4d3e;
  --warn: #9a4f14;
  --danger: #b3261e;
  --shadow: 0 14px 38px rgba(29, 45, 37, 0.12);
}

* {
  box-sizing: border-box;
}

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

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

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

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

button.ghost {
  background: #e8eee9;
  color: var(--ink);
}

button.ghost:hover {
  background: #d6e0d9;
}

button.danger {
  background: #f3dfdc;
  color: var(--danger);
}

button.danger:hover {
  background: #eac8c3;
}

label,
legend {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

.topbar h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  margin: 4px 0 0;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.topbar-actions,
.section-heading,
.event-actions,
.unlock-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

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

.unlock-panel {
  max-width: 560px;
}

.unlock-form {
  display: grid;
  gap: 12px;
}

.unlock-row {
  align-items: stretch;
}

.unlock-row input {
  flex: 1;
}

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

.dashboard {
  display: grid;
  gap: 18px;
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  background: #102820;
  border-radius: 8px;
  color: #fff;
  min-height: 104px;
  padding: 18px;
}

.metric span {
  color: #c9d9d1;
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
  margin-top: 14px;
}

.content-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
}

.stack,
.event-form {
  display: grid;
  gap: 16px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 14px;
}

h2 {
  font-size: 1.2rem;
  margin: 0;
}

.date-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.2fr 0.8fr 1fr;
}

.checkline {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-weight: 650;
  gap: 8px;
}

.checkline input {
  min-height: auto;
  width: auto;
}

.active-line {
  color: var(--ink);
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.event-main {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.event-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 4px;
}

.event-meta,
.event-notes {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.badge {
  border-radius: 999px;
  background: #e7f0ec;
  color: var(--accent-dark);
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 9px;
  text-transform: capitalize;
}

.inactive {
  opacity: 0.58;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.toast {
  background: #102820;
  border-radius: 8px;
  bottom: 24px;
  color: #fff;
  left: 50%;
  max-width: min(460px, calc(100% - 32px));
  padding: 12px 14px;
  position: fixed;
  transform: translateX(-50%);
}

.hidden {
  display: none !important;
}

@media (max-width: 840px) {
  .topbar,
  .event-main {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .date-row {
    grid-template-columns: 1fr;
  }

  .unlock-row,
  .topbar-actions,
  .event-actions {
    flex-wrap: wrap;
  }

  .unlock-row button,
  .topbar-actions button,
  .event-actions button {
    flex: 1 1 140px;
  }
}
