:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #b91c1c;
  --success: #166534;
  --warning: #92400e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: min(1100px, 94vw);
  margin: 0 auto;
}

.site-header {
  background: #0b2d2c;
  color: #fff;
  padding: 1rem 0;
  margin-bottom: 1.25rem;
}

.brand {
  margin: 0;
  font-size: 1.25rem;
}

.brand a {
  color: #fff;
  text-decoration: none;
}

.case-line {
  margin: 0.2rem 0 0;
  color: #cde6e4;
  font-size: 0.92rem;
}

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

.nav-list {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: #fff;
  text-decoration: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.narrow {
  max-width: 560px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.form-row input,
.form-row textarea,
.form-row select {
  border: 1px solid #cfd4dc;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}

.form-grid.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.full-width {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: start;
}

.button {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

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

.button-secondary {
  background: #374151;
}

.actions {
  display: flex;
  gap: 0.75rem;
}

.small-link,
.small-muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.message {
  padding: 0.7rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.message.error {
  background: #fee2e2;
  color: #7f1d1d;
}

.message.success {
  background: #dcfce7;
  color: #14532d;
}

.message.info {
  background: #dbeafe;
  color: #1e3a8a;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem;
  vertical-align: top;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
  color: #fff;
}

.badge-submitted {
  background: #2563eb;
}

.badge-review {
  background: #1d4ed8;
}

.badge-more-info {
  background: #b45309;
}

.badge-allowed {
  background: #15803d;
}

.badge-denied {
  background: #b91c1c;
}

.badge-closed {
  background: #374151;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1rem;
}

.timeline {
  margin: 0;
  padding-left: 1rem;
}

.thread {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.thread-message {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem;
}

.from-claimant {
  background: #f8fafc;
}

.from-receiver {
  background: #ecfeff;
}

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

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.actions-row {
  align-self: end;
}

.update-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.75rem;
}

.update-card.pinned {
  border-color: #c084fc;
  box-shadow: 0 0 0 1px #e9d5ff;
}

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

@media (max-width: 860px) {
  .header-row,
  .split-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid.two-col,
  .meta-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: auto;
  }

  .nav-list {
    flex-wrap: wrap;
  }
}
