:root {
  --bg: #edf1f4;
  --bg-accent: #d9e3ea;
  --surface: #f7f9fb;
  --ink: #152029;
  --muted: #5b6b78;
  --line: #c5d0d8;
  --accent: #0f6e56;
  --accent-soft: #d7efe7;
  --warn: #8a4b12;
  --warn-soft: #f3e2cf;
  --open: #0b5fff;
  --investigating: #a15c00;
  --resolved: #0f6e56;
  --shadow: 0 10px 30px rgba(21, 32, 41, 0.08);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d7e8f2 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
}

.page {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

h1, h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h2 { font-size: 1.05rem; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.muted { color: var(--muted); font-size: 0.85rem; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

.kpi.warn {
  background: var(--warn-soft);
  border-color: #e0c39a;
}

.kpi-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.kpi strong {
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  align-self: end;
  padding-bottom: 0.45rem;
}

input, select, button {
  font: inherit;
}

input, select {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.45rem 0.55rem;
  min-height: 2.25rem;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  min-height: 2.25rem;
}

.btn:hover { border-color: #9aadb9; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.05); }

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.chip {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid #b7d9cd;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.chip strong { font-family: var(--mono); font-size: 0.8rem; }

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

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

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

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

th.th-filter {
  min-width: 9.5rem;
  vertical-align: bottom;
}

th.th-filter span {
  display: block;
  margin-bottom: 0.35rem;
}

th.th-filter select {
  width: 100%;
  min-height: 2rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

tbody tr {
  cursor: pointer;
}
tbody tr:hover { background: #eef5f8; }

.mono { font-family: var(--mono); font-size: 0.82rem; }
.empty { color: var(--muted); padding: 1rem 0.5rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}
.badge.open { color: var(--open); background: #e7efff; border-color: #c5d7ff; }
.badge.investigating { color: var(--investigating); background: #fff1df; border-color: #f0d2a8; }
.badge.resolved { color: var(--resolved); background: var(--accent-soft); border-color: #b7d9cd; }

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

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100%;
  background: #fbfcfd;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(21, 32, 41, 0.12);
  z-index: 20;
  overflow: auto;
  padding: 1.1rem 1.2rem 2rem;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 32, 41, 0.28);
  z-index: 15;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.drawer-body {
  display: grid;
  gap: 1rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
}

.meta-item span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.meta-item strong {
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-word;
}

.timeline, .rev-list, .comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.timeline li, .rev-list li, .comment-list li {
  border-left: 2px solid var(--line);
  padding: 0.15rem 0 0.15rem 0.7rem;
}

.excerpt {
  white-space: pre-wrap;
  background: #eef3f6;
  border: 1px solid var(--line);
  padding: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
  max-height: 220px;
  overflow: auto;
}

@media (max-width: 720px) {
  .top { flex-direction: column; align-items: start; }
  .meta-grid { grid-template-columns: 1fr; }
}
