:root {
  --bg: #f4f1ea;
  --panel: #fffdf9;
  --panel-2: #f8f4ec;
  --line: #ddd3c4;
  --text: #1f1d19;
  --muted: #6d665a;
  --accent: #0a7c66;
  --accent-2: #d96941;
  --danger: #b33939;
  --shadow: 0 18px 42px rgba(42, 34, 21, 0.08);
  --radius: 18px;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Space Grotesk", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 105, 65, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(10, 124, 102, 0.18), transparent 30%),
    var(--bg);
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.tagline,
.user-meta,
.helper {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 10px;
  margin: 24px 0 auto;
}

.nav-link {
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 14px;
  background: transparent;
}

.nav-link.is-active,
.nav-link:hover {
  background: var(--panel-2);
}

.main {
  padding: 28px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.page-header h1,
.issue-title {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 2vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.page-header p {
  margin: 0;
  color: var(--muted);
}

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

.card-title {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

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

.grid.two {
  grid-template-columns: 1.15fr 0.85fr;
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric strong {
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

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

.table-wrap {
  overflow: auto;
}

.table-wrap.is-reorderable tbody tr {
  cursor: move;
}

.table-wrap.is-reorderable tbody tr.is-dragging {
  opacity: 0.45;
}

.table-wrap.is-reorderable tbody tr.drop-target-top {
  box-shadow: inset 0 3px 0 var(--accent);
}

.table-wrap.is-reorderable tbody tr.drop-target-bottom {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.table-wrap.is-reorderable .drag-cell {
  width: 40px;
  color: var(--muted);
  font-size: 1.1rem;
}

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

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chip,
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.pill-code {
  font-family: var(--mono);
}

.stack {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.issue-id {
  font-family: var(--mono);
  font-size: 0.95rem;
}

.summary-link {
  text-decoration: none;
  font-weight: 700;
}

.message {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.message.event {
  background: #eef6f3;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

.empty-state h3 {
  margin-top: 0;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #f0c7bb;
  background: #fff1ec;
  color: #7e2f17;
  margin-bottom: 18px;
}

.split-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.client-swatch {
  display: inline-flex;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 980px) {
  .shell,
  .grid.two,
  .grid.three,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 20px;
  }
}
