:root {
  /* Neutral near-black surfaces (VIZBO-style) */
  --bg-primary: #0b0c0e;
  --bg-secondary: #141518;
  --bg-card: #17191d;
  --bg-card-hover: #202328;
  --border-default: #2a2d33;
  /* Green primary accent */
  --border-accent: #22c55e;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-muted: #5f6368;
  --accent-blue: #22c55e;
  --accent-violet: #10b981;
  --accent-gradient: linear-gradient(135deg, #22c55e, #10b981);
  --priority-critical: #f85149;
  --priority-high: #f0883e;
  --priority-medium: #58a6ff;
  --priority-low: #3fb950;
  --type-feature: #bc8cff;
  --type-bug: #f85149;
  --type-issue: #f0883e;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-modal: 0 16px 48px rgba(0,0,0,0.5);
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  scroll-behavior: smooth;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Header */
.app-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background-color: rgba(20, 21, 24, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
  z-index: 100;
  flex-shrink: 0;
}

.header-left .app-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: center;
}

.search-bar {
  position: relative;
  width: 300px;
}

.search-bar input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-bar input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.search-bar::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.7;
}

.filter-group {
  display: flex;
  gap: 12px;
}

.filter-group select {
  padding: 8px 32px 8px 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--transition-fast);
}

.filter-group select:hover {
  border-color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Board */
.board-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* Single full-height row so each column is bounded to the viewport and
     scrolls internally instead of overflowing the board. */
  grid-template-rows: minmax(0, 1fr);
  gap: 20px;
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.kanban-column {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 0; /* allow the column to shrink so its body can scroll */
  border: 1px solid var(--border-default);
}

/* Per-column tints (subtle background wash + colored border/count badge) */
.kanban-column[data-status="in-progress"] {
  background-image: linear-gradient(rgba(88, 166, 255, 0.07), rgba(88, 166, 255, 0.07));
  border-color: rgba(88, 166, 255, 0.3);
}
.kanban-column[data-status="in-progress"] .column-count {
  background: rgba(88, 166, 255, 0.18);
  color: #58a6ff;
}

.kanban-column[data-status="review"] {
  background-image: linear-gradient(rgba(227, 179, 65, 0.07), rgba(227, 179, 65, 0.07));
  border-color: rgba(227, 179, 65, 0.3);
}
.kanban-column[data-status="review"] .column-count {
  background: rgba(227, 179, 65, 0.18);
  color: #e3b341;
}

.kanban-column[data-status="done"] {
  background-image: linear-gradient(rgba(63, 185, 80, 0.07), rgba(63, 185, 80, 0.07));
  border-color: rgba(63, 185, 80, 0.3);
}
.kanban-column[data-status="done"] .column-count {
  background: rgba(63, 185, 80, 0.18);
  color: #3fb950;
}

.column-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-default);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.column-count {
  background-color: var(--bg-card);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Floating "new ticket" button — bottom-left, overlaying the Backlog column */
.fab-new {
  position: fixed;
  left: 48px;
  bottom: 52px;
  z-index: 800;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(34, 197, 94, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.fab-new:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 28px rgba(34, 197, 94, 0.45);
}

.fab-new:active {
  transform: translateY(0) scale(0.98);
}

.column-body {
  padding: 16px 16px 72px; /* extra bottom 'air' so the last card clears the + button */
  flex: 1;
  min-height: 0; /* required so overflow-y actually scrolls within the column */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background var(--transition-fast);
}

.kanban-column.drag-over .column-body {
  background: rgba(34, 197, 94, 0.05);
  box-shadow: inset 0 0 0 2px var(--border-accent);
}

/* Cards */
.ticket-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  border-left: 4px solid var(--border-default);
  box-shadow: var(--shadow-card);
  cursor: grab;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cardSlideIn 0.3s ease-out;
}

.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--accent-blue);
}

.ticket-card:active {
  cursor: grabbing;
}

.ticket-card.dragging {
  opacity: 0.5;
  transform: scale(0.95) rotate(2deg);
}

/* Overdue cards (not Done) get a red tint */
.ticket-card.card-overdue {
  background-image: linear-gradient(rgba(248, 81, 73, 0.09), rgba(248, 81, 73, 0.09));
  border-left-color: var(--priority-critical);
}

/* Done cards are always green-tinted, even if they were overdue */
.ticket-card.card-done {
  background-image: linear-gradient(rgba(63, 185, 80, 0.09), rgba(63, 185, 80, 0.09));
  border-left-color: #3fb950;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.card-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.type-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.type-badge.type-feature {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--type-feature);
}

.type-badge.type-bug {
  background-color: rgba(248, 81, 73, 0.15);
  color: var(--type-bug);
}

.type-badge.type-issue {
  background-color: rgba(240, 136, 62, 0.15);
  color: var(--type-issue);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.card-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.5;
}

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.priority-critical .priority-dot { background-color: var(--priority-critical); box-shadow: 0 0 6px var(--priority-critical); }
.priority-high .priority-dot { background-color: var(--priority-high); }
.priority-medium .priority-dot { background-color: var(--priority-medium); }
.priority-low .priority-dot { background-color: var(--priority-low); }

.due-date {
  color: var(--text-secondary);
}

.due-date.overdue {
  color: var(--priority-critical);
  font-weight: 600;
}

.assignee-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid var(--border-default);
}

.attachment-count {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 9, 11, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-secondary);
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--border-default);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal.active,
.modal-overlay.active .modal {
  transform: scale(1);
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Modal Body */
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}

.modal-footer-right {
  display: flex;
  gap: 10px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.required {
  color: var(--priority-critical);
}

.form-error {
  font-size: 0.78rem;
  color: var(--priority-critical);
  margin-top: 4px;
  min-height: 1em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Inputs, selects, textareas inside forms — targeted broadly */
.form-group input[type="text"],
.form-group input[type="search"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: var(--priority-critical);
  box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Button Variants */
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--priority-critical);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-danger:hover {
  background: rgba(248, 81, 73, 0.25);
  border-color: var(--priority-critical);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(34, 197, 94, 0.05);
  color: var(--accent-blue);
}

.upload-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.upload-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.upload-link {
  color: var(--accent-blue);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 500;
}

.upload-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Attachment List */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  animation: cardSlideIn 0.2s ease-out;
}

.attachment-item.pending {
  border-style: dashed;
}

.attachment-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.attachment-file-icon {
  font-size: 1.3rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.attachment-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attachment-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.attachment-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.attachment-remove:hover {
  background: rgba(248, 81, 73, 0.15);
  color: var(--priority-critical);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.toast {
  background: rgba(23, 25, 29, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-default);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-hover);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s ease-out forwards;
  font-size: 0.9rem;
}

.toast.active {
  animation: toastSlideIn 0.3s ease-out forwards;
}

.toast.exiting {
  animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-success {
  border-left: 3px solid var(--priority-low);
}

.toast-error {
  border-left: 3px solid var(--priority-critical);
}

.toast-warning {
  border-left: 3px solid var(--priority-high);
}

.toast-info {
  border-left: 3px solid var(--accent-blue);
}

.toast-icon {
  flex-shrink: 0;
}

.toast-message {
  color: var(--text-primary);
}

/* Animations */
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.6); }
}

/* ─── Ticket Peek Panel (Notion-style) ─────────────────────────────────────── */
/* Slides in from the right, full height, does NOT dim/blur the board behind. */
.ticket-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 100vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-default);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.45);
  z-index: 900;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  will-change: transform;
}

.ticket-panel.active {
  transform: translateX(0);
}

/* Top bar with the collapse (close) button */
.panel-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}

.panel-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.panel-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.panel-close-icon {
  display: inline-block;
  transform: translateX(1px);
}

.panel-topbar-meta {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.panel-topbar-updated {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Scrollable body */
.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px 60px;
}

/* Big borderless title */
/* Title grows naturally with its content (and reflows with panel width), so
   the properties below always sit right under it. */
.panel-title {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 0;
  margin-bottom: 20px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.panel-title:focus {
  outline: none;
}

.panel-title:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

/* Properties block — compact stacked cards in a responsive grid */
.panel-props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.prop-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.prop-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prop-ico {
  font-size: 0.85rem;
}

.prop-dropdown {
  position: relative;
  min-width: 0;
}

/* The clickable value pill */
.prop-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.prop-trigger:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.prop-dropdown.open .prop-trigger {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.prop-trigger.is-empty .prop-trigger-label {
  color: var(--text-muted);
  font-weight: 500;
}

.prop-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prop-caret {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.7;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform var(--transition-fast);
}

.prop-dropdown.open .prop-caret {
  transform: rotate(180deg);
}

.prop-cal {
  flex-shrink: 0;
  opacity: 0.75;
  font-size: 0.85rem;
}

/* Popover option list */
.prop-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-hover);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
  animation: menuIn 120ms ease-out;
}

.prop-menu[hidden] {
  display: none;
}

.prop-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 7px 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.prop-option:hover {
  background: var(--bg-card-hover);
}

.prop-option.selected {
  background: rgba(34, 197, 94, 0.12);
}

.prop-option.selected::after {
  content: "✓";
  margin-left: auto;
  color: var(--accent-blue);
  font-weight: 700;
}

/* The native date input sits invisibly over its trigger for showPicker() */
.prop-date-input {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.panel-divider {
  height: 1px;
  background: var(--border-default);
  margin: 20px 0;
}

.panel-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Borderless, auto-growing rich description.
   It has no internal scroll — as content grows it expands and pushes the
   sections below it down, and the whole panel scrolls instead. */
.panel-description {
  width: 100%;
  min-height: 60px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.panel-description:hover {
  background: var(--bg-card-hover);
}

.panel-description:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-primary);
}

/* Placeholder for the empty contenteditable */
.panel-description:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

/* Highlight while dragging an image over the description */
.panel-description.drag-over {
  border-color: var(--accent-blue);
  border-style: dashed;
  background: rgba(34, 197, 94, 0.06);
}

/* Clickable links inside the description */
.panel-description .desc-link {
  color: var(--accent-blue);
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
}

.panel-description .desc-link:hover {
  color: var(--accent-violet);
}

/* Inline text-file chips embedded in the description */
.panel-description .desc-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: baseline;
  max-width: 100%;
  margin: 0 2px;
  padding: 2px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  user-select: none;
}

.panel-description .desc-file:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
}

.panel-description .desc-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

/* File preview window */
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(4px);
  padding: 40px;
}

.preview-overlay.active {
  display: flex;
}

.preview-card {
  width: 100%;
  max-width: 760px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  animation: cardSlideIn 0.25s ease-out;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}

.preview-title {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.preview-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.preview-body {
  margin: 0;
  padding: 20px;
  overflow: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Inline images embedded in the description */
.panel-description .desc-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  margin: 8px 0;
}

.panel-upload {
  padding: 18px;
}

.attachment-open {
  cursor: pointer;
}

.panel-footer {
  margin-top: 28px;
}

/* Resize handle on the left edge */
.panel-resizer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 8px;
  margin-left: -4px;
  cursor: ew-resize;
  z-index: 10;
  background: transparent;
  transition: background var(--transition-fast);
}

.panel-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  transition: background var(--transition-fast);
}

.panel-resizer:hover::after,
.ticket-panel.resizing .panel-resizer::after {
  background: var(--accent-blue);
}

/* Disable slide transition while dragging so resize feels instant */
.ticket-panel.resizing {
  transition: none;
  user-select: none;
}

/* Comments */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.comment-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0 8px;
}

.comment {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

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

.comment-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.comment-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.comment:hover .comment-delete {
  opacity: 1;
}

.comment-delete:hover {
  background: rgba(248, 81, 73, 0.15);
  color: var(--priority-critical);
}

/* Comment compose box */
.comment-compose {
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-compose-as {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.comment-author-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 4px 26px 4px 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.comment-author-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.comment-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 44px;
}

.comment-input:focus {
  outline: none;
}

.comment-input::placeholder {
  color: var(--text-muted);
}

.comment-compose-actions {
  display: flex;
  justify-content: flex-end;
}

/* ─── Login Screen ─────────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 600px at 70% -10%, rgba(16, 185, 129, 0.12), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(34, 197, 94, 0.12), transparent 55%),
    var(--bg-primary);
  padding: 24px;
}

.login-overlay.active {
  display: flex;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: cardSlideIn 0.35s ease-out;
}

.login-logo {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
}

.login-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.login-field label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.login-error {
  color: var(--priority-critical);
  font-size: 0.82rem;
  min-height: 1.1em;
  margin-bottom: 8px;
}

.login-btn {
  width: 100%;
  padding: 11px;
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Header user menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--border-default);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1200px) {
  .board-container {
    padding: 16px;
    gap: 16px;
  }
  .kanban-column {
    min-width: 260px;
  }
}

@media (max-width: 768px) {
  .board-container {
    display: flex;
    overflow-x: auto;
  }
  .header-center {
    display: none;
  }
  .modal {
    max-width: 95vw;
    margin: 0 8px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .ticket-panel {
    width: 100vw;
  }
  .panel-scroll {
    padding: 20px 20px 60px;
  }
}

