*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

::selection { background: #3b82f6; color: #fff; }
::-moz-selection { background: #3b82f6; color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 5px; border: 2px solid #0f172a; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Nav ---- */
nav {
  background: #1e293b;
  padding: 1rem 2rem;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
nav h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
nav h1::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: inline-block;
}
nav a { color: #f8fafc; text-decoration: none; }
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-right .btn-outline {
  color: #e2e8f0;
  border-color: #475569;
}
.nav-right .btn-outline:hover {
  background: #334155;
  border-color: #64748b;
}
#nav-user {
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 0.25rem 0.6rem;
  background: #0f172a;
  border-radius: 9999px;
  border: 1px solid #334155;
}

/* ---- Notifications ---- */
.notif-wrap {
  position: relative;
  display: inline-flex;
}
.notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #e2e8f0;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.notif-btn:hover {
  background: #334155;
  border-color: #64748b;
}
.notif-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  color: #fff;
  background: #ef4444;
  border-radius: 9999px;
  border: 2px solid #0f172a;
  box-sizing: content-box;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: 22rem;
  max-width: 90vw;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  overflow: hidden;
}
.notif-list {
  max-height: 22rem;
  overflow-y: auto;
}
.notif-item {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #1e293b;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.notif-item:hover {
  background: #273449;
}
.notif-item.unread {
  background: rgba(59, 130, 246, 0.08);
}
.notif-item.unread::before {
  content: '';
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: #3b82f6;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.notif-text {
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.35;
}
.notif-text strong { color: #f8fafc; }
.notif-meta {
  font-size: 0.72rem;
  color: #64748b;
}
.notif-empty {
  padding: 1.2rem 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}
.notif-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #334155;
  background: #0f172a;
}

/* ---- Layout ---- */
main { max-width: 1280px; margin: 0 auto; padding: 2rem; }

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.view-header h2 {
  flex: 1;
  color: #f8fafc;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 1px 2px rgba(59,130,246,0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.btn-outline {
  background: transparent;
  border: 1px solid #475569;
  color: #e2e8f0;
}
.btn-outline:hover { background: #1e293b; border-color: #64748b; }
.btn-outline.active { background: #1e293b; border-color: #3b82f6; color: #93c5fd; }
.btn-icon { background: none; font-size: 1.5rem; color: #94a3b8; padding: 0.25rem 0.5rem; line-height: 1; }
.btn-icon:hover { color: #f8fafc; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; border-radius: 0.375rem; }

:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.btn:focus-visible { outline-offset: 2px; }
form input:focus-visible,
form textarea:focus-visible,
form select:focus-visible { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

/* ---- Project cards ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.project-card:hover {
  border-color: #475569;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.project-card:hover::before { opacity: 1; }
.project-card h3 { margin-bottom: 0.4rem; font-size: 1.15rem; color: #f8fafc; font-weight: 600; }
.project-card p { color: #94a3b8; font-size: 0.875rem; margin-bottom: 1rem; line-height: 1.5; }
.project-card .meta { font-size: 0.8rem; color: #64748b; }
.project-card .card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ---- Board ---- */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.board-column {
  background: #131e36;
  border-radius: 0.75rem;
  padding: 1rem;
  min-height: 200px;
  border: 1px solid #2a3a55;
  transition: all 0.2s ease;
}
.board-column.drag-over {
  border-color: #3b82f6;
  background: #172554;
  outline: 2px dashed #3b82f6;
  outline-offset: -2px;
}
.issue-card.dragging { opacity: 0.4; }
.board-column h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.col-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wip-warn {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid #ef4444;
  border-radius: 0.3rem;
  font-size: 0.6rem;
  padding: 0.05rem 0.3rem;
  text-transform: uppercase;
}
.card-status-select {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.25rem;
  border: 1px solid #334155;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-family: inherit;
  background: #0f172a;
  color: #e2e8f0;
}
.issue-card.overdue-card {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3);
}

.col-count {
  margin-left: auto;
  background: #0f172a;
  color: #94a3b8;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.issue-card {
  background: #1e293b;
  border-radius: 0.5rem;
  padding: 0.85rem;
  margin-bottom: 0.6rem;
  border: 1px solid #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}
.issue-card:hover {
  border-color: #475569;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}
.issue-card h4 { font-size: 0.9rem; margin-bottom: 0.4rem; color: #f8fafc; font-weight: 500; line-height: 1.3; }
.issue-card .issue-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.75rem;
  color: #94a3b8;
}
.issue-card .issue-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.priority-high { border-left: 3px solid #ef4444; }
.priority-medium { border-left: 3px solid #f59e0b; }
.priority-low { border-left: 3px solid #22c55e; }

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-dot.priority-high { background: #ef4444; }
.priority-dot.priority-medium { background: #f59e0b; }
.priority-dot.priority-low { background: #22c55e; }

.assignee-tag {
  margin-left: auto;
  padding: 0.1rem 0.5rem;
  background: #0f172a;
  border-radius: 9999px;
  font-size: 0.7rem;
  color: #94a3b8;
  border: 1px solid #334155;
}
.due-chip {
  padding: 0.1rem 0.45rem;
  background: #1e293b;
  border-radius: 9999px;
  font-size: 0.7rem;
  color: #cbd5e1;
  border: 1px solid #334155;
}
.due-chip.overdue {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}
.overdue-text { color: #fca5a5; }

.status-pill, .priority-pill {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: capitalize;
}
.status-todo { background: #1e293b; color: #94a3b8; border: 1px solid #475569; }
.status-in_progress { background: #172554; color: #93c5fd; }
.status-done { background: #064e3b; color: #6ee7b7; }
.priority-pill.priority-high { background: #450a0a; color: #fca5a5; }
.priority-pill.priority-medium { background: #422006; color: #fdba74; }
.priority-pill.priority-low { background: #064e3b; color: #6ee7b7; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #1e293b;
  border-radius: 0.875rem;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #334155;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #334155;
}
.modal-header h3 { color: #f8fafc; font-weight: 600; font-size: 1.1rem; }
.modal-body { padding: 1.5rem; }

/* ---- Forms ---- */
form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  margin-top: 1.1rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
form label:first-child { margin-top: 0; }
form input[type="text"],
form input[type="password"],
form input[type="email"],
form textarea,
form select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #0f172a;
  color: #e2e8f0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
form textarea { resize: vertical; }
form button[type="submit"] { margin-top: 1.75rem; width: 100%; }

.hidden { display: none; }

/* ---- Empty states ---- */
.empty-state {
  text-align: center;
  color: #64748b;
  padding: 3rem 0;
  font-size: 0.9rem;
}
.empty-compact {
  padding: 1.25rem 0;
  font-size: 0.85rem;
}

/* ---- Sprint panel ---- */
.sprint-panel {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid #334155;
  animation: fadeIn 0.3s ease;
}
.labels-panel {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid #334155;
  animation: fadeIn 0.3s ease;
}
.labels-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.label-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1e293b;
}
.label-row:last-child { border-bottom: none; }
.label-row-name {
  flex: 1;
  font-size: 0.85rem;
  color: #e2e8f0;
}
.label-row-actions {
  display: flex;
  gap: 0.35rem;
}
.label-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 0, 0, 0.3);
  vertical-align: middle;
}
.label-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}
.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.label-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.label-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #e2e8f0;
  padding: 0.25rem 0.5rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  cursor: pointer;
}
.muted-small { font-size: 0.78rem; color: #64748b; }

/* ---- Discussion ---- */
.discussion-panel {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid #334155;
  animation: fadeIn 0.3s ease;
}
.discussion-header {
  margin-bottom: 1rem;
}
.discussion-header h3 { font-size: 1.05rem; color: #f8fafc; font-weight: 600; }
.discussion-new-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.discussion-new-form .mention-wrap { position: relative; }
.discussion-new-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  background: #0f172a;
  color: #e2e8f0;
}
.discussion-new-form .btn { align-self: flex-end; }
.thread {
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  background: #0f172a;
}
.thread-msg { padding-bottom: 0.5rem; }
.thread-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #f8fafc;
  font-weight: 700;
  line-height: 1.3;
}
.discussion-title-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  background: #0f172a;
  color: #f8fafc;
}
.discussion-title-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.msg-edit-title { margin-bottom: 0.5rem; }
.thread-replies {
  margin-left: 1.1rem;
  padding-left: 0.85rem;
  border-left: 2px solid #334155;
  margin-top: 0.5rem;
}
.thread-reply {
  padding: 0.5rem 0;
  border-bottom: 1px solid #1e293b;
}
.thread-reply:last-child { border-bottom: none; }
.reply-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.reply-form .mention-wrap { position: relative; }
.reply-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.6rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
  background: #0f172a;
  color: #e2e8f0;
}
.reply-form .btn { align-self: flex-end; }

/* ---- Blocked badge ---- */
.blocked-badge {
  display: inline-block;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid #ef4444;
  border-radius: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem;
  margin-top: 0.35rem;
}

/* ---- Archive panel ---- */
.archive-panel {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid #334155;
  animation: fadeIn 0.3s ease;
}
.archive-header { margin-bottom: 1rem; }
.archive-header h3 { font-size: 1.05rem; color: #f8fafc; font-weight: 600; }
.archive-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #1e293b;
}
.archive-row:last-child { border-bottom: none; }
.archive-title {
  flex: 1;
  font-size: 0.85rem;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-actions { display: flex; gap: 0.35rem; }

/* ---- Links ---- */
.link-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #1e293b;
}
.link-row:last-child { border-bottom: none; }
.link-relation {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: lowercase;
  font-style: italic;
  min-width: 5.5rem;
}
.link-target {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #3b82f6;
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
  overflow: hidden;
}
.link-target:hover { text-decoration: underline; }
.unlink {
  padding: 0 0.5rem;
  font-size: 1rem;
  line-height: 1;
}
.link-add {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.link-add .filter-select { flex: 1; min-width: 8rem; }

/* ---- Form rows ---- */
.form-row-2 { display: flex; gap: 0.75rem; }
.form-row-2 > div { flex: 1; }

/* ---- Time tracking ---- */
.time-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}
.time-summary strong { color: #f8fafc; }
.time-bar {
  flex: 1;
  min-width: 8rem;
  height: 0.5rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 9999px;
  overflow: hidden;
}
.time-bar-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.3s;
}
.time-bar-fill.over { background: #ef4444; }
.worklog-form {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.worklog-minutes { width: 5rem; }
.worklog-desc { flex: 1; min-width: 10rem; }
.worklog-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #1e293b;
  font-size: 0.82rem;
}
.worklog-row:last-child { border-bottom: none; }
.worklog-time { font-weight: 600; color: #f8fafc; min-width: 4rem; }
.worklog-desc { flex: 1; color: #e2e8f0; }
.worklog-meta { color: #64748b; font-size: 0.72rem; }
.worklog-delete { padding: 0 0.5rem; }

/* ---- Story points badge ---- */
.points-badge {
  background: #334155;
  color: #f8fafc;
  border-radius: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  margin-left: auto;
}

/* ---- Burndown report ---- */
.report-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}
.report-stats strong { color: #f8fafc; }
.burndown-chart {
  width: 100%;
  max-width: 560px;
  height: auto;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
}
.legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0.6rem 0 1rem;
}
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend-line { display: inline-block; width: 1.5rem; height: 2px; }
.legend-line.ideal { border-top: 2px dashed #64748b; }
.legend-line.actual { background: #3b82f6; }

/* ---- Attachments ---- */
.attachment-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.attachment-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #1e293b;
  font-size: 0.82rem;
}
.attachment-row:last-child { border-bottom: none; }
.attachment-name {
  color: #3b82f6;
  cursor: pointer;
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-name:hover { text-decoration: underline; }
.attachment-meta { color: #64748b; font-size: 0.72rem; }
.attachment-delete { padding: 0 0.5rem; }
.sprint-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.sprint-panel-header h3 { font-size: 1.05rem; color: #f8fafc; font-weight: 600; }
.sprint-list { display: flex; flex-direction: column; gap: 0.6rem; }
.sprint-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: #0f172a;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  gap: 0.5rem;
  transition: border-color 0.15s;
}
.sprint-card:hover { border-color: #475569; }
.sprint-card .sprint-info { flex: 1; }
.sprint-card .sprint-name { font-weight: 600; font-size: 0.9rem; color: #e2e8f0; display: flex; align-items: center; gap: 0.5rem; }
.sprint-card .sprint-goal { font-size: 0.8rem; color: #94a3b8; margin-top: 0.15rem; }
.sprint-card .sprint-meta { font-size: 0.75rem; color: #64748b; margin-top: 0.2rem; }
.sprint-card .sprint-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.sprint-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sprint-badge.active { background: #064e3b; color: #6ee7b7; }
.sprint-badge.completed { background: #1e293b; color: #94a3b8; border: 1px solid #475569; }
.sprint-badge.planning { background: #422006; color: #fdba74; }
#backlog-section { margin-top: 1.25rem; }
#backlog-section h3 { font-size: 0.8rem; margin-bottom: 0.6rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.backlog-issue {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  border-bottom: 1px solid #1e293b;
  transition: background 0.15s;
}
.backlog-issue:hover { background: #1e293b; }
.backlog-issue:last-child { border-bottom: none; }
.backlog-priority {
  margin-left: auto;
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ---- Issue type badges ---- */
.issue-type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.type-task { background: #172554; color: #93c5fd; }
.type-story { background: #064e3b; color: #6ee7b7; }
.type-bug { background: #450a0a; color: #fca5a5; }
.type-epic { background: #2e1065; color: #c4b5fd; }
.type-subtask { background: #1e293b; color: #94a3b8; border: 1px solid #475569; }

.issue-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.issue-card-header h4 { margin-bottom: 0; flex: 1; }

.epic-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.subtask-count {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

/* ---- Auth form ---- */
.auth-form {
  max-width: 400px;
  margin: 4rem auto;
  background: #1e293b;
  padding: 2.5rem;
  border-radius: 0.875rem;
  border: 1px solid #334155;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.auth-form h2 {
  margin-bottom: 1.5rem;
  color: #f8fafc;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Detail view ---- */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
.detail-section {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid #334155;
}
.detail-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 1rem;
  font-weight: 600;
}
.detail-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e2e8f0;
}
.detail-description p:first-child, .comment-body p:first-child { margin-top: 0; }
.detail-description p:last-child, .comment-body p:last-child { margin-bottom: 0; }
.detail-description p, .comment-body p { margin: 0.5rem 0; }
.detail-description h5, .comment-body h5 {
  font-size: 0.95rem;
  color: #f8fafc;
  margin: 0.6rem 0 0.3rem;
}
.detail-description ul, .comment-body ul {
  margin: 0.4rem 0;
  padding-left: 1.3rem;
}
.detail-description li, .comment-body li { margin: 0.15rem 0; }
.detail-description code, .comment-body code {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.3rem;
  padding: 0.05rem 0.3rem;
  font-size: 0.82em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f8fafc;
}
.detail-description pre, .comment-body pre {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  padding: 0.7rem 0.85rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}
.detail-description pre code, .comment-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
}
.detail-description a, .comment-body a {
  color: #3b82f6;
  text-decoration: none;
}
.detail-description a:hover, .comment-body a:hover { text-decoration: underline; }
.detail-description strong, .comment-body strong { color: #f8fafc; }
.detail-fields dt {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.85rem;
  font-weight: 600;
}
.detail-fields dt:first-child { margin-top: 0; }
.detail-fields dd {
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-top: 0.2rem;
}

/* ---- Sub-tasks ---- */
.subtask-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.subtask-row:hover {
  background: #1e293b;
  border-color: #334155;
}
.subtask-title {
  flex: 1;
  font-size: 0.85rem;
  color: #e2e8f0;
}
.subtask-priority {
  font-size: 0.72rem;
  color: #94a3b8;
}
.parent-link {
  color: #3b82f6;
  cursor: pointer;
  text-decoration: none;
}
.parent-link:hover { text-decoration: underline; }

/* ---- Comments ---- */
.comment {
  padding: 0.85rem 0;
  border-bottom: 1px solid #1e293b;
}
.comment:last-child { border-bottom: none; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}
.comment-author { font-weight: 600; color: #f8fafc; }
.comment-date { color: #64748b; }
.comment-actions {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
}
.comment-edit-area {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  background: #0f172a;
  color: #e2e8f0;
}
.comment-edit-area:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.comment-edit-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.comment-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e2e8f0;
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  background: #0f172a;
  color: #e2e8f0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.comment-form textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.comment-form .btn { align-self: flex-end; }

/* ---- Mentions ---- */
.mention-wrap {
  position: relative;
}
.mention-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: 0.25rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
  max-height: 10rem;
  overflow-y: auto;
  z-index: 50;
}
.mention-item {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  color: #e2e8f0;
  cursor: pointer;
}
.mention-item:hover,
.mention-item.active {
  background: #334155;
}
.mention {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  padding: 0.05rem 0.25rem;
  border-radius: 0.25rem;
  font-weight: 500;
}
.issue-link {
  color: #8b5cf6;
  text-decoration: none;
  font-weight: 500;
}
.issue-link:hover { text-decoration: underline; }

/* ---- GitHub connection panel ---- */
.github-connect {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}
.github-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.github-field label {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-weight: 600;
}
.github-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.7rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: #0f172a;
  color: #e2e8f0;
}
.github-field input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.github-field code {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.3rem;
  padding: 0 0.3rem;
  font-size: 0.78rem;
}
.github-field .btn { align-self: flex-start; }
.github-repo-link { color: #93c5fd; text-decoration: none; }
.github-repo-link:hover { text-decoration: underline; }
.github-warn { color: #fbbf24; }

/* ---- Workflow rows ---- */
.wf-row { align-items: center; gap: 0.6rem; }
.wf-row-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; }
.wf-name { color: #e2e8f0; text-decoration: none; }
.wf-name:hover { color: #93c5fd; text-decoration: underline; }
.wf-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; word-break: break-all; color: #94a3b8; text-decoration: none; }
.wf-path:hover { color: #cbd5e1; text-decoration: underline; }
.wf-status {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.wf-status-success { color: #22c55e; border-color: #166534; background: rgba(34, 197, 94, 0.1); }
.wf-status-failure { color: #f87171; border-color: #7f1d1d; background: rgba(248, 113, 113, 0.1); }
.wf-status-cancelled { color: #94a3b8; border-color: #334155; background: rgba(148, 163, 184, 0.1); }
.wf-status-in_progress, .wf-status-queued, .wf-status-pending, .wf-status-waiting { color: #fbbf24; border-color: #92400e; background: rgba(251, 191, 36, 0.1); }
.wf-status-none { color: #64748b; border: 1px dashed #334155; }
#github-workflows-wrap { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid #1e293b; }

/* ---- Activity log ---- */
.activity-item {
  font-size: 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #1e293b;
  color: #94a3b8;
  line-height: 1.4;
}
.activity-item:last-child { border-bottom: none; }
.activity-item .actor { font-weight: 600; color: #f8fafc; }
.activity-item .event-time { color: #64748b; font-size: 0.72rem; margin-left: 0.5rem; }

/* ---- Filter select ---- */
.filter-select {
  padding: 0.45rem 0.85rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: #0f172a;
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-input {
  padding: 0.45rem 0.75rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: #0f172a;
  color: #e2e8f0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
}
.board-filters .filter-input { flex: 1; min-width: 12rem; }

/* ---- Global search ---- */
.search-wrap {
  position: relative;
  display: inline-flex;
}
.search-input {
  padding: 0.35rem 0.7rem;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  font-family: inherit;
  background: #0f172a;
  color: #e2e8f0;
  width: 13rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: 24rem;
  max-width: 90vw;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  max-height: 22rem;
  overflow-y: auto;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #1e293b;
  cursor: pointer;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: #273449; }
.search-result-title {
  flex: 1;
  font-size: 0.85rem;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-project {
  font-size: 0.72rem;
  color: #64748b;
}
.search-empty {
  padding: 1rem 0.7rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}
.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ---- User cards ---- */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.user-card {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid #334155;
  transition: all 0.2s ease;
}
.user-card:hover { border-color: #475569; transform: translateY(-1px); }
.user-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.user-card-header h3 { font-size: 1.1rem; color: #f8fafc; font-weight: 600; }
.user-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}
.role-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.role-admin { background: #172554; color: #93c5fd; }
.role-member { background: #064e3b; color: #6ee7b7; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .board { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .user-grid { grid-template-columns: 1fr; }
  nav { padding: 0.85rem 1rem; }
  nav h1 { font-size: 1.15rem; }
  main { padding: 1rem; }
  .view-header { gap: 0.5rem; margin-bottom: 1.25rem; }
  .view-header h2 { font-size: 1.2rem; }
  .auth-form { margin: 2rem 1rem; padding: 1.75rem; }
}
