:root {
  --red: #e44a4a;
  --yellow: #efb949;
  --green: #34b369;
  --red-soft: #fdecec;
  --yellow-soft: #fdf6e0;
  --green-soft: #e8f5ee;
  --ink: #14181f;
  --ink-2: #2b313b;
  --muted: #6b7280;
  --muted-2: #9aa1ad;
  --rule: #e6e8ec;
  --rule-2: #eef0f3;
  --bg: #f4f6f8;
  --card: #ffffff;
  --slate: #4b5563;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px 10px;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  flex: 0 0 auto;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.btn-pill:hover { background: #f9fafb; }

.btn-pill .ico {
  width: 16px;
  height: 16px;
  color: var(--slate);
}

.btn-pill .chev { width: 14px; height: 14px; }

/* ---------- team filter (in topbar) ---------- */

.team-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
  justify-content: center;
}

.team-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-2);
  user-select: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.team-toggle::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1.5px solid #c8ccd2;
  background: transparent;
}

.team-toggle[aria-pressed="true"] {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #1e293b;
}

.team-toggle[aria-pressed="true"]::before {
  background: #1f2937;
  border-color: #1f2937;
  box-shadow: inset 0 0 0 2px white;
}

.team-toggle:hover { background: #f9fafb; }

/* ---------- overview row ---------- */

.overview-grid {
  margin: 4px 24px 16px;
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 12px;
}

.card-title {
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* chart card */
.chart-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 12px 6px;
}

.chart {
  display: block;
  width: 100%;
  height: 70px;
  margin-top: 4px;
}

.chart-axis {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}

.chart-axis span {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* stat cards */
.stat-card {
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 1px;
  align-items: center;
  padding: 8px 12px;
  min-width: 0;
}

.stat-icon {
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg { width: 13px; height: 13px; }

.stat-icon-green  { background: var(--green); }
.stat-icon-yellow { background: var(--yellow); }
.stat-icon-red    { background: var(--red); }
.stat-icon-total  { background: #6b7280; }

.stat-num {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.1;
}

.stat-pct {
  display: none;
}

/* ---------- table ---------- */

main {
  padding: 0 24px 48px;
}

.table-wrap {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}

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

table.rows th,
table.rows td {
  padding: 12px 16px;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid var(--rule-2);
}

table.rows tr:last-child td { border-bottom: none; }

table.rows thead th {
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: #fbfbfc;
  padding: 12px 16px;
  position: sticky;
  top: 0;
}

table.rows thead th.sortable {
  cursor: pointer;
}

table.rows thead th .sort-ico {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -1px;
  color: var(--muted-2);
}

/* per-row tint */
table.rows tr.red    td { background: var(--red-soft); }
table.rows tr.yellow td { background: var(--yellow-soft); }
table.rows tr.green  td { background: var(--green-soft); }

/* left-edge color stripe on the first cell */
table.rows td.company {
  position: relative;
  font-weight: 600;
  white-space: nowrap;
  padding-left: 22px;
  width: 17%;
}

table.rows td.company::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
table.rows tr.red    td.company::before { background: var(--red); }
table.rows tr.yellow td.company::before { background: var(--yellow); }
table.rows tr.green  td.company::before { background: var(--green); }

.company-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
  letter-spacing: -0.2px;
}

td.issue   { width: 18%; }
td.comment { width: 30%; color: var(--ink-2); }
td.action  { width: 22%; }
td.team    { width: 9%; white-space: nowrap; }

.team-chip {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
}

.team-stack {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

td.empty {
  color: var(--muted-2);
}

.bullet-list {
  margin: 0;
  padding: 0 0 0 16px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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