:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #20232a;
  --muted: #68707d;
  --border: #dde2ea;
  --accent: #4f46e5;
  --accent-contrast: #ffffff;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(30, 41, 59, 0.08);
}

* { box-sizing: border-box; }

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

button,
input {
  font: inherit;
}

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

.page-header {
  margin-bottom: 24px;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.intro {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 20px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card h2 {
  margin-bottom: 4px;
  font-size: 1.8rem;
}

.icon {
  font-size: 1.7rem;
}

.muted {
  color: var(--muted);
  margin-bottom: 0;
}

.panel {
  padding: 24px;
  margin-bottom: 24px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.entry-form {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.entry-form h3 {
  margin-bottom: 16px;
}

.entry-form label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}

.entry-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.entry-form input:focus-visible,
.entry-form button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.25);
  outline-offset: 2px;
}

.entry-form button {
  width: 100%;
  margin-top: 16px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  cursor: pointer;
}

.entry-form button:hover {
  filter: brightness(0.96);
}

.form-message {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.history-columns h3 {
  margin-bottom: 10px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item,
.empty-state {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-item strong {
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
}

@media (max-width: 820px) {
  .grid,
  .forms-grid,
  .history-columns {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .card {
    padding: 16px;
  }
}
