:root {
  --ink: #1d2733;
  --ink-soft: #5a6573;
  --paper: #f7f6f3;
  --card: #ffffff;
  --line: #e2e0da;
  --accent: #1f6f5c;
  --accent-dark: #154e41;
  --new: #6b7280;
  --assigned: #b45309;
  --accepted: #15803d;
  --booked: #3730a3;
  --rejected: #9f1239;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  color: var(--ink);
}

h1 { font-size: 1.6rem; margin: 0.4em 0 0.6em; }
h2 { font-size: 1.15rem; margin: 0 0 0.7em; }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--ink);
  color: #fff;
}
.topbar .brand { color: #fff; font-weight: 600; font-family: Georgia, serif; }
.topbar .who { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; opacity: 0.92; }
.topbar a { color: #fff; }

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}

.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-form {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 380px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 0.95rem;
}

input, select, textarea {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}

textarea { width: 100%; resize: vertical; }

button {
  cursor: pointer;
  border-radius: 4px;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: #eef6f3; }

.btn-danger {
  background: #fff;
  color: var(--rejected);
  border: 1px solid var(--rejected);
}
.btn-danger:hover { background: #fdeef1; }

.link-btn {
  background: none;
  border: none;
  color: #fff;
  text-decoration: underline;
  padding: 0;
  font-size: 0.9rem;
}

.inline { display: inline; }
.row-actions form { display: inline-block; margin-right: 0.5rem; }
.inline-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0;
  flex-wrap: wrap;
}

.amount { font-family: "SF Mono", "Consolas", "Menlo", monospace; }

table.list {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
table.list th, table.list td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
}
table.list th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: #fbfaf8;
}
table.list tr:last-child td { border-bottom: none; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.7rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.tile-count {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--accent-dark);
}
.tile-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  vertical-align: middle;
}
.badge-new { background: #eceef0; color: var(--new); }
.badge-assigned { background: #fef3e2; color: var(--assigned); }
.badge-accepted { background: #e7f5ec; color: var(--accepted); }
.badge-booked { background: #eef0fb; color: var(--booked); }
.badge-rejected { background: #fde8ec; color: var(--rejected); }

dl.fields {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.45rem 1rem;
  margin: 0 0 1rem;
}
dl.fields dt { color: var(--ink-soft); font-size: 0.9rem; }
dl.fields dd { margin: 0; }

.comments { list-style: none; padding: 0; margin: 0 0 1rem; }
.comments li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.comments li p { margin: 0.2rem 0 0; }

.timeline { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.timeline li { padding: 0.3rem 0; }

.muted { color: var(--ink-soft); font-size: 0.85rem; }
.empty { color: var(--ink-soft); }
.error { color: var(--danger); font-size: 0.9rem; }
.ok { color: var(--accepted); font-weight: 600; }
.ended { color: var(--rejected); font-weight: 600; }

.reject-form textarea { min-width: 260px; max-width: 360px; }
