.stat {
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 16px 19px;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 7px;
}
.stat-number {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -1px;
}
.stat small {
  margin-left: 9px;
  font-size: 10px;
}
.column {
  background: #edf1f6;
  padding: 13px 10px;
  border-radius: 9px;
  min-height: 290px;
}
.column.drag-over {
  outline: 2px dashed #5c84ee;
  outline-offset: -2px;
}
.column-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 3px 12px;
}
.column-heading h2 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.column-heading .count {
  background: #dde4ed;
  color: #617389;
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 6px;
}
.column-heading .add {
  margin-left: auto;
  padding: 0 6px;
  color: #8796a8;
  font-size: 19px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #98a7bb;
}
.status-dot.in_progress {
  background: #5c86fa;
}
.status-dot.review {
  background: #b58ad9;
}
.status-dot.done {
  background: #55ad90;
}
.ticket-card {
  background: white;
  border: 1px solid #e3e8ef;
  border-radius: 7px;
  padding: 14px;
  margin-bottom: 9px;
  box-shadow: 0 2px 3px #20334803;
  cursor: grab;
}
.ticket-card:hover {
  border-color: #adbee7;
  box-shadow: 0 3px 10px #234b7310;
}
.ticket-card.dragging {
  opacity: 0.45;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.issue-key {
  font-size: 10px;
  color: #7a899c;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.ticket-title {
  padding: 0;
  text-align: left;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.65;
  width: 100%;
  overflow-wrap: anywhere;
}
.card-parent {
  font-size: 10px;
  margin-top: 8px;
  color: #8b97a7;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}
.type-badge,
.priority {
  font-size: 9px;
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
}
.type-badge {
  background: #edf3fc;
  color: #4370ac;
}
.type-badge.epic {
  background: #eee8fa;
  color: #815ab8;
}
.type-badge.story {
  background: #e8f5ed;
  color: #41845d;
}
.type-badge.subtask {
  background: #e8f5f5;
  color: #358186;
}
.priority.P0 {
  background: #fff0ed;
  color: #c26b54;
}
.priority.P1 {
  background: #fff6e3;
  color: #a58136;
}
.priority.P2 {
  background: #eef2f7;
  color: #798698;
}
.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  background: #e7ebf2;
  color: #8290a2;
}
.avatar.vy {
  background: #e6eafd;
  color: #667cc4;
}
.avatar.thang {
  background: #fcedde;
  color: #ae8457;
}
.avatar.phat {
  background: #dff3eb;
  color: #448f75;
}
.empty {
  padding: 28px 15px;
  text-align: center;
  color: #8a97a9;
  font-size: 12px;
}
.issue-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  font-size: 12px;
}
.issue-table th {
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  background: #f8fafc;
  padding: 13px;
}
.issue-table td {
  padding: 12px 13px;
  border-top: 1px solid var(--line);
}
.issue-table .ticket-title {
  min-width: 240px;
}
.issue-table .person-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.issue-table .parent-cell {
  max-width: 150px;
}
.status-select {
  min-width: 125px;
  font-size: 11px;
  padding: 7px 9px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--navy);
  color: white;
  padding: 12px 22px;
  border-radius: 9px;
  box-shadow: 0 5px 30px #10253633;
  max-width: min(600px, 90vw);
  font-size: 13px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 20px 70px #172d4133;
  max-height: 90vh;
  width: min(680px, 94vw);
}
dialog::backdrop {
  background: #132c436b;
}
.detail-dialog {
  width: min(920px, 96vw);
}
.password-dialog {
  width: min(440px, 94vw);
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.dialog-header .eyebrow {
  margin-bottom: 4px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 17px 25px;
  border-top: 1px solid var(--line);
}
.form-body {
  display: grid;
  gap: 17px;
  padding: 22px 25px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
}
.detail-main {
  padding: 25px;
  min-width: 0;
}
.detail-main h2 {
  overflow-wrap: anywhere;
  margin: 10px 0 24px;
}
.detail-main h3 {
  margin: 22px 0 12px;
}
.description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #576a7d;
  font-size: 13px;
  line-height: 1.8;
}
.detail-sidebar {
  background: #f8fafc;
  border-left: 1px solid var(--line);
  padding: 25px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.detail-sidebar small {
  display: block;
  margin-bottom: 5px;
}
.detail-sidebar strong {
  font-size: 12px;
}
.child-item {
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.child-item .ticket-title {
  font-size: 12px;
}
.comment {
  border-top: 1px solid var(--line);
  padding: 15px 0;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 12px;
}
.comment-meta time {
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
}
.comment p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.comment-form button {
  justify-self: end;
}
.detail-actions {
  display: flex;
  gap: 8px;
}
@media (max-width: 700px) {
  .detail-body {
    grid-template-columns: 1fr;
  }
  .detail-sidebar {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .dialog-header,
  .detail-main,
  .form-body {
    padding: 18px;
  }
  .dialog-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .detail-actions {
    margin-left: auto;
  }
  .form-grid {
    gap: 12px;
  }
}

/* Keep long backlogs within the viewport; each column scrolls independently. */
.column {
  max-height: max(330px, calc(100vh - 440px));
  overflow-y: auto;
}

.column-heading {
  position: sticky;
  top: -13px;
  z-index: 1;
  padding-top: 10px;
  background: #edf1f6;
}

#detail-error:empty {
  display: none;
}

.assignee-select {
  min-width: 120px;
  padding: 7px 9px;
  font-size: 11px;
}

.sprint-select {
  min-width: 145px;
  padding: 7px 9px;
  font-size: 11px;
}

.issue-table {
  min-width: 990px;
}

.delete-dialog {
  width: min(480px, 94vw);
}

.danger {
  background: #bc3547;
  color: white;
  font-weight: 600;
}

.danger:hover {
  background: #a52639;
}

.danger-text {
  color: #b73445;
  padding: 7px 10px;
}

.danger-text:hover {
  background: #fff0f1;
}

#delete-ticket-label {
  overflow-wrap: anywhere;
}

.issue-table {
  min-width: 1060px;
}

/* Ticket links and full-page details share the existing detail component. */
a.ticket-link {
  color: #315dec;
  white-space: nowrap;
}

a.ticket-link:hover {
  text-decoration: underline;
}

.ticket-page {
  padding: 24px 0 40px;
}

.ticket-page-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  font-size: 12px;
}

.ticket-page-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.ticket-page .detail-body {
  grid-template-columns: minmax(0, 1fr) 250px;
}

.detail-main .detail-title {
  margin: 12px 0 26px;
  overflow-wrap: anywhere;
}

.ticket-page .detail-main {
  padding: 30px;
}

.ticket-page .detail-sidebar {
  padding: 30px 24px;
}

.ticket-not-found {
  display: grid;
  gap: 20px;
  padding: 40px;
}

.detail-actions {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .ticket-page .detail-body {
    grid-template-columns: 1fr;
  }

  .ticket-page .detail-main,
  .ticket-page .detail-sidebar {
    padding: 20px;
  }

  .ticket-page .detail-title {
    font-size: 24px;
  }

  .ticket-page .dialog-header {
    flex-wrap: wrap;
  }
}
