:root {
  --fg: #1f2328;
  --muted: #656d76;
  --border: #d0d7de;
  --bg: #ffffff;
  --accent: #0969da;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: #f6f8fa;
  margin: 0;
  padding: 1.5rem;
  max-width: 1100px;
  margin-inline: auto;
}

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

h1 { font-size: 1.4rem; margin: 0; }

button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
}
button:hover { filter: brightness(0.95); }

#filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

select, input[type="search"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bg);
}
input[type="search"] { flex: 1; min-width: 180px; }

.count { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0; }
.message {
  background: #dafbe1;
  border: 1px solid #1a7f37;
  color: #1a7f37;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { background: #f6f8fa; font-weight: 600; }
/* Updated column (6th): keep dates on one line. */
th:nth-child(6), td:nth-child(6) { white-space: nowrap; }
th a { color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
th a:hover { color: var(--accent); }
th .arrow { color: var(--accent); font-size: 0.7rem; }
tr:last-child td { border-bottom: 0; }
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }
.empty { color: var(--muted); text-align: center; padding: 2rem; }

.state {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: capitalize;
  color: #fff;
}
.state-open { background: #1a7f37; }
.state-closed { background: #cf222e; }
.state-merged { background: #8250df; }
.state-draft { background: #656d76; }

.htmx-indicator { opacity: 0; color: var(--muted); font-size: 0.85rem; transition: opacity .2s; }
.htmx-request .htmx-indicator { opacity: 1; }

.login { display: grid; gap: 0.75rem; max-width: 320px; margin-top: 1rem; }
.login input { width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; }
.error { color: #cf222e; margin: 0; }
