/* ═══════════════════════════════════════════════════════════
   Components — Issue rows, pills, avatars, buttons, inputs,
                board cards, panel fields, loading, etc.
   ═══════════════════════════════════════════════════════════ */

/* ─── Issue Row (list view) ─── */

.issue-row {
  display: flex;
  align-items: center;
  height: var(--row-height);
  padding: 0 12px;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-in-out);
  position: relative;
}

.issue-row:hover {
  background: var(--bg-2);
}

.issue-row.selected {
  background: rgba(94, 106, 210, 0.06);
}

.issue-row.selected::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-primary);
}

/* ─── Row Checkbox ─── */

.ir-checkbox {
  width: 20px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.issue-row:hover .ir-checkbox {
  opacity: 1;
}

.row-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.row-check:hover {
  border-color: var(--accent-primary);
  background: rgba(94, 106, 210, 0.1);
}

.row-check.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.row-check.checked::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
}

/* ir-priority */

.ir-priority {
  width: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ir-id */

.ir-id {
  width: 68px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-in-out);
}

.issue-row:hover .ir-id {
  color: var(--text-secondary);
}

/* ir-status */

.ir-status {
  width: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.ir-status svg {
  display: inline;
  flex-shrink: 0;
}

/* ir-title */

.ir-title {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ir-assignee */

.ir-assignee {
  width: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ir-phase */

.ir-phase {
  width: 85px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* ir-labels */

.ir-labels {
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  overflow: hidden;
}

/* ir-estimate */

.ir-estimate {
  width: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ─── Status Pill (kept for board cards + legacy) ─── */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.692rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.4;
}

.status-backlog {
  background: rgba(94, 94, 106, 0.2);
  color: #9b9ba4;
}

.status-todo {
  background: rgba(155, 155, 164, 0.15);
  color: #9b9ba4;
}

.status-in_progress {
  background: rgba(242, 201, 76, 0.12);
  color: var(--status-in-progress);
}

.status-draft {
  background: rgba(229, 163, 61, 0.12);
  color: var(--status-draft);
}

.status-in_review {
  background: rgba(94, 106, 210, 0.12);
  color: var(--status-in-review);
}

.status-done {
  background: rgba(76, 183, 130, 0.12);
  color: var(--status-done);
}

.status-cancelled {
  background: rgba(94, 94, 106, 0.15);
  color: #9b9ba4;
  text-decoration: line-through;
}

/* ─── Priority Dot ─── */

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* ─── Label Dot ─── */

.label-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* ─── Label Dot Large (panel checkboxes) ─── */

.label-dot-lg {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* ─── Phase Tag (list view) ─── */

.phase-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.692rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Phase dot (sidebar / timeline / dashboard) */

.phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Phase tag small (board cards) */

.phase-tag-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.615rem;
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ─── Estimate Badge ─── */

.est-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-xs);
  font-size: 0.692rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
}

.est-badge-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: var(--radius-xs);
  font-size: 0.615rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
}

/* ─── Avatars ─── */

/* Avatar tiny: 20px, used inline in rows, board cards, panel */

.avatar-tiny {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.615rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

.avatar-rene {
  background: rgba(196, 151, 90, 0.18);
  color: var(--accent-gold);
  border: 1px solid rgba(196, 151, 90, 0.25);
}

.avatar-farez {
  background: rgba(94, 106, 210, 0.18);
  color: var(--accent-blue);
  border: 1px solid rgba(94, 106, 210, 0.25);
}

.avatar-both {
  background: rgba(179, 107, 212, 0.18);
  color: var(--accent-purple);
  border: 1px solid rgba(179, 107, 212, 0.25);
}

.avatar-none {
  background: var(--bg-3);
  color: var(--text-tertiary);
  border: 1px dashed var(--border-default);
}

/* Avatar small: 22px, used in sidebar user switch */

.avatar-small {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.615rem;
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

/* ─── Buttons ─── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 0.846rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  white-space: nowrap;
  user-select: none;
}

.btn-primary svg {
  display: inline;
  flex-shrink: 0;
}

.btn-primary:hover {
  background: #4f5bc4;
  box-shadow: 0 2px 8px rgba(94, 106, 210, 0.25);
}

.btn-primary:active {
  background: #454fb0;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 0.846rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  white-space: nowrap;
  user-select: none;
}

.btn-ghost svg {
  display: inline;
  flex-shrink: 0;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-2);
  border-color: var(--border-default);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 0.846rem;
  font-weight: 500;
  color: var(--accent-red);
  background: rgba(212, 82, 82, 0.1);
  border: 1px solid rgba(212, 82, 82, 0.2);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  white-space: nowrap;
}

.btn-danger svg {
  display: inline;
  flex-shrink: 0;
}

.btn-danger:hover {
  background: rgba(212, 82, 82, 0.18);
  border-color: rgba(212, 82, 82, 0.3);
}

.btn-small {
  height: 26px;
  padding: 0 8px;
  font-size: 0.769rem;
}

/* ─── Filter Chip ─── */

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  height: 24px;
  border-radius: var(--radius-sm);
  font-size: 0.769rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  white-space: nowrap;
}

.filter-chip svg {
  display: inline;
  flex-shrink: 0;
}

.filter-chip:hover {
  border-color: var(--border-default);
  background: var(--bg-3);
}

.filter-chip.active {
  border-color: rgba(94, 106, 210, 0.3);
  background: rgba(94, 106, 210, 0.08);
  color: var(--accent-primary);
}

/* Filter pill (active filter tags) */

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(94, 106, 210, 0.1);
  border: 1px solid rgba(94, 106, 210, 0.2);
  border-radius: 20px;
  font-size: 0.692rem;
  color: var(--accent-primary);
  white-space: nowrap;
}

.filter-pill button {
  color: var(--accent-primary);
  font-size: 0.846rem;
  padding: 0 2px;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity var(--duration-fast);
}

.filter-pill button:hover {
  opacity: 1;
}

/* Filter option (in filter dropdown) */

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.846rem;
  color: var(--text-secondary);
  transition: background var(--duration-fast);
}

.filter-option:hover {
  background: var(--bg-3);
}

.filter-option.active {
  color: var(--text-primary);
}

.filter-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.filter-option input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.filter-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bg-0);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.filter-opt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-opt-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.692rem;
  color: var(--text-tertiary);
}

/* ─── Board Card ─── */

.board-card {
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
}

.board-card:hover {
  background: var(--bg-2);
  border-color: var(--border-default);
  border-left-color: inherit;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.board-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bc-id {
  font-family: var(--font-mono);
  font-size: 0.692rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.bc-title {
  font-size: 0.846rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Panel Content Styles ─── */

.panel-title {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-sans);
  padding: 4px 0 12px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast);
}

.panel-title:focus {
  border-bottom-color: var(--accent-primary);
}

.panel-title::placeholder {
  color: var(--text-ghost);
}

.panel-description-wrap {
  margin-bottom: 16px;
}

.panel-section-label {
  font-size: 0.692rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.panel-description {
  width: 100%;
  min-height: 80px;
  padding: 8px 0;
  background: transparent;
  font-size: 0.846rem;
  color: var(--text-primary);
  resize: vertical;
  line-height: 1.6;
  border: none;
  border-bottom: 1px solid transparent;
  font-family: var(--font-sans);
  transition: border-color var(--duration-fast);
}

.panel-description:focus {
  border-bottom-color: var(--border-default);
}

.panel-description::placeholder {
  color: var(--text-ghost);
}

.panel-description-preview {
  font-size: 0.846rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.panel-description-preview p {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.panel-description-preview code {
  font-family: var(--font-mono);
  font-size: 0.769rem;
  background: var(--bg-3);
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.panel-section {
  margin-bottom: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.panel-sub-issues {
  margin-bottom: 8px;
}

.panel-deps {
  margin-bottom: 8px;
}

/* Comments */

.panel-comments {
  margin-bottom: 8px;
}

.no-comments,
.no-activity {
  font-size: 0.769rem;
  color: var(--text-tertiary);
  padding: 8px 0;
}

.comment {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.comment:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 0.769rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.692rem;
  color: var(--text-tertiary);
  margin-left: auto;
}

.comment-body {
  font-size: 0.846rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.comment-body p {
  color: inherit;
}

/* Comment input */

.panel-comment-input {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 8px;
}

.comment-textarea {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 0.846rem;
  color: var(--text-primary);
  resize: none;
  font-family: var(--font-sans);
  line-height: 1.4;
  transition: border-color var(--duration-fast);
}

.comment-textarea:focus {
  border-color: var(--accent-primary);
}

.comment-textarea::placeholder {
  color: var(--text-ghost);
}

/* Activity */

.panel-activity {
  margin-bottom: 8px;
}

.activity-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.769rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-actor {
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

.activity-action {
  flex: 1;
  min-width: 0;
}

.activity-action b {
  color: var(--text-primary);
  font-weight: 500;
}

.activity-date {
  font-size: 0.692rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ─── Panel Properties ─── */

.prop-group {
  margin-bottom: 12px;
}

.prop-label {
  display: block;
  font-size: 0.692rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.prop-select {
  width: 100%;
  height: 28px;
  padding: 0 24px 0 8px;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.769rem;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%235e5e6a' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: all var(--duration-fast) var(--ease-in-out);
}

.prop-select:hover {
  border-color: var(--border-default);
}

.prop-select:focus {
  border-color: var(--accent-primary);
}

.prop-select option {
  background: var(--bg-2);
  color: var(--text-primary);
}

.prop-value-text {
  font-size: 0.769rem;
  color: var(--text-secondary);
}

.prop-date {
  font-family: var(--font-mono);
  font-size: 0.692rem;
  color: var(--text-tertiary);
}

.prop-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 12px 0;
}

/* Label checkboxes in panel */

.prop-labels {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.label-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: var(--radius-xs);
  font-size: 0.769rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.label-checkbox:hover {
  background: var(--bg-2);
}

.label-checkbox.active {
  color: var(--text-primary);
}

.label-checkbox input[type="checkbox"] {
  display: none;
}

/* Estimate buttons in panel */

.prop-estimate-btns {
  display: flex;
  gap: 4px;
}

.est-btn {
  width: 28px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.769rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
}

.est-btn:hover {
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.est-btn.active {
  background: rgba(94, 106, 210, 0.12);
  border-color: rgba(94, 106, 210, 0.3);
  color: var(--accent-primary);
}

/* ─── Loading Spinner ─── */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
}

.loading-state span {
  font-size: 0.846rem;
  color: var(--text-tertiary);
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
