/* ── Jira Tickets index ── */

/* Back link */

.jt-back {
  font-size: var(--text-paragraph-sm);
  color: var(--dp-text-secondary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 20px;
}

.jt-back:hover { color: var(--dp-text-primary); }

/* Table wrapper */

.jt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--dp-border);
  border-radius: 8px;
}

.jt-table {
  border-collapse: collapse;
  font-size: var(--text-paragraph-xs);
  width: 100%;
}

/* Header cells */

.jt-th {
  padding: 10px 12px;
  background: var(--dp-surface);
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid var(--dp-border);
  border-right: 1px solid var(--dp-table-header-divider);
  color: var(--dp-text-secondary);
  font-size: var(--text-label-xs);
  vertical-align: middle;
}

.jt-th:last-child { border-right: none; }

/* Group label row */

.jt-group-label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: var(--text-label-xs);
  font-weight: 500;
  padding: 8px 12px;
}

.jt-group-priority {
  color: var(--dp-yellow);
  border-bottom: 2px solid color-mix(in srgb, var(--dp-yellow) 50%, transparent);
  background: color-mix(in srgb, var(--dp-yellow) 4%, transparent);
}

.jt-group-priority-level {
  color: var(--dp-orange);
  border-bottom: 2px solid color-mix(in srgb, var(--dp-orange) 50%, transparent);
  background: color-mix(in srgb, var(--dp-orange) 4%, transparent);
}

.jt-group-status {
  color: var(--dp-green);
  border-bottom: 2px solid color-mix(in srgb, var(--dp-green) 50%, transparent);
  background: color-mix(in srgb, var(--dp-green) 4%, transparent);
}

/* Priority sub-header colors */

.jt-th.jt-priority-highest { color: var(--dp-red); }
.jt-th.jt-priority-high    { color: var(--dp-orange); }
.jt-th.jt-priority-medium  { color: var(--dp-yellow); }
.jt-th.jt-priority-low     { color: var(--dp-green); }
.jt-th.jt-priority-lowest  { color: var(--dp-text-muted); }

/* Status sub-headers: rotated vertical text to keep columns narrow */

.jt-th-status {
  height: 110px;
  vertical-align: bottom;
  padding: 0 6px 10px;
}

.jt-status-label {
  display: block;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: var(--text-label-xs);
  font-weight: 500;
}

/* Sticky columns */

.jt-th-sticky,
.jt-td-sticky {
  position: sticky;
  z-index: 1;
}

.jt-th-sticky { z-index: 2; }

.jt-th-project,
.jt-td-project {
  left: 0;
  min-width: 120px;
  text-align: left;
  border-right: 1px solid var(--dp-border);
  background: var(--dp-surface);
}

.jt-th-count,
.jt-td-count {
  left: 120px;
  min-width: 64px;
  border-right: 2px solid var(--dp-border);
  background: var(--dp-surface);
}

/* Body rows */

.jt-td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--dp-table-row-border);
  border-right: 1px solid var(--dp-table-row-border);
  text-align: center;
  color: var(--dp-text-primary);
}

.jt-td:last-child { border-right: none; }

.jt-row:last-child .jt-td { border-bottom: none; }

.jt-row:hover .jt-td { background: var(--dp-row-hover-bg); }

.jt-row:hover .jt-td-sticky { background: var(--dp-row-hover-bg); }

.jt-td-project { text-align: left; }

.jt-project-link {
  color: var(--dp-link);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-label-sm);
}

.jt-project-link:hover { color: var(--dp-accent); }

.jt-td-count {
  font-size: var(--text-heading-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.jt-td-num {
  font-size: var(--text-paragraph-xs);
  font-variant-numeric: tabular-nums;
}

.jt-td-empty { color: var(--dp-text-muted); }

/* Group separator — left border on the first cell of each group */

.jt-group-start {
  border-left: 2px solid var(--dp-border);
}

/* Priority cell colors */

.jt-priority-cell.jt-priority-highest { color: var(--dp-red); }
.jt-priority-cell.jt-priority-high    { color: var(--dp-orange); }
.jt-priority-cell.jt-priority-medium  { color: var(--dp-yellow); }
.jt-priority-cell.jt-priority-low     { color: var(--dp-green); }
.jt-priority-cell.jt-priority-lowest  { color: var(--dp-text-muted); }

/* Rotten bugs column */

.jt-th-rotten { color: var(--dp-red); }

.jt-rotten-green  { color: var(--dp-green); }
.jt-rotten-yellow { color: var(--dp-yellow); font-weight: 600; }
.jt-rotten-red    { color: var(--dp-red); font-weight: 700; }

/* Rotten bugs badge on per-project drill-down */

.jt-rotten-badge {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 0 16px;
  border-radius: 6px;
  font-size: var(--text-label-xs);
  font-weight: 500;
  background: color-mix(in srgb, var(--dp-red) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--dp-red) 30%, transparent);
}

.jt-rotten-badge.jt-rotten-yellow {
  background: color-mix(in srgb, var(--dp-yellow) 8%, transparent);
  border-color: color-mix(in srgb, var(--dp-yellow) 30%, transparent);
}
