:root {
  color-scheme: light;
  --bg: #f3efe3;
  --panel: #fffdf8;
  --ink: #1f2933;
  --muted: #64748b;
  --line: #ded7c8;
  --accent: #23533d;
  --accent-2: #9a4f13;
  --shadow: 0 24px 70px rgba(31, 41, 51, .11);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(35, 83, 61, .14), transparent 34rem),
    linear-gradient(135deg, #f7f2e6, var(--bg));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main { min-height: 100vh; }

h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(2.5rem, 8vw, 6rem);
  line-height: .86;
  letter-spacing: -.07em;
}

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

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

button, input, select { font: inherit; }

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, .74);
  color: var(--ink);
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 560px);
  display: grid;
  gap: 20px;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 253, 248, .9);
  box-shadow: var(--shadow);
}

.eyebrow {
  color: var(--accent-2);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

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

label { color: var(--ink); font-weight: 700; }

.login-row { display: flex; gap: 8px; }

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

.error { color: #9f1239; font-weight: 700; }

.app {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 34px 18px 60px;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.lede { margin-top: 18px; max-width: 820px; font-size: 1.08rem; }

.meta, .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 253, 248, .7);
  color: var(--muted);
  font-size: .9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 13px;
  margin-top: 22px;
}

.card, .issue {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 14px 44px rgba(31, 41, 51, .07);
}

.card { border-radius: 20px; padding: 16px; }

.metric { font-size: 2rem; font-weight: 850; letter-spacing: -.05em; }

.label { margin-top: 4px; color: var(--muted); font-size: .9rem; }

.toolbar input { flex: 1 1 320px; }
.toolbar select { flex: 0 1 180px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(230px, 300px) 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.issue-menu {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 13px;
  background: rgba(255, 253, 248, .76);
  color: var(--ink);
  text-align: left;
}

.menu-item.active {
  border-color: rgba(35, 83, 61, .45);
  background: var(--accent);
  color: #fff;
}

.menu-item span { line-height: 1.25; }

.menu-item strong {
  flex: 0 0 auto;
  min-width: 2.2rem;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(31, 41, 51, .08);
  text-align: center;
}

.menu-item.active strong { background: rgba(255, 255, 255, .2); }

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

.issue { border-radius: 24px; overflow: hidden; }

.issue-head {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.issue-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.count { color: var(--accent-2); font-weight: 850; }

.action { color: var(--accent); font-weight: 700; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }

th, td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #ece5d8;
}

th {
  color: var(--muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #fbf8ef;
}

td.context { min-width: 270px; color: var(--muted); }

.empty, .loading { padding: 18px; color: var(--muted); }

@media (max-width: 720px) {
  .app { padding: 24px 12px 42px; }
  header { display: grid; }
  .login-row { display: grid; }
  .toolbar select { flex-basis: 100%; }
  .workspace { grid-template-columns: 1fr; }
  .issue-menu {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  th, td { padding: 9px 10px; }
}
