@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface2: #f0f1f3;
  --border: #e2e4e9;
  --border-light: #cbd0d8;
  --text: #111827;
  --text-muted: #6b7280;
  --text-dim: #4b5563;
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --pending: #d97706;
  --pending-bg: rgba(217, 119, 6, 0.1);
  --pass: #059669;
  --pass-bg: rgba(5, 150, 105, 0.1);
  --fix: #dc2626;
  --fix-bg: rgba(220, 38, 38, 0.08);
  --radius: 6px;
  --radius-lg: 10px;
}

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

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 8px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 20px;
  color: var(--text-dim);
  font-size: 13.5px;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.nav-item:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }

.nav-item svg { width: 15px; height: 15px; opacity: 0.7; flex-shrink: 0; }
.nav-item.active svg { opacity: 1; }

.sidebar-bottom {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.content { padding: 24px 28px; }

/* ── Stats Cards ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.stat-card .value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  margin-top: 4px;
}

.stat-card.total .value { color: var(--text); }
.stat-card.pending .value { color: var(--pending); }
.stat-card.pass .value { color: var(--pass); }
.stat-card.fix .value { color: var(--fix); }

/* ── Filters ── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
  height: 34px;
  font-size: 13px;
  padding: 0 10px;
}

.filter-bar .search-input { min-width: 200px; flex: 1; max-width: 300px; }

.btn-reset {
  height: 34px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-reset:hover { border-color: var(--border-light); color: var(--text); }

/* ── Issue Table ── */
.issue-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.issue-table {
  width: 100%;
  border-collapse: collapse;
}

.issue-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  font-weight: 500;
}

.issue-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.issue-table tr:last-child td { border-bottom: none; }

.issue-table tbody tr { transition: background 0.1s; }
.issue-table tbody tr:hover { background: var(--surface2); }

.issue-title-link {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
}
.issue-title-link:hover { color: var(--accent); text-decoration: none; }

.issue-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Status Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: 'IBM Plex Mono', monospace;
  gap: 5px;
  white-space: nowrap;
}

.badge-pending { background: var(--pending-bg); color: var(--pending); }
.badge-pass    { background: var(--pass-bg);    color: var(--pass);    }
.badge-fix     { background: var(--fix-bg);     color: var(--fix);     }

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Quick status selector */
.quick-status {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 20px 3px 9px;
  border-radius: 100px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

.quick-status.s-pending { background-color: var(--pending-bg); color: var(--pending); }
.quick-status.s-pass    { background-color: var(--pass-bg);    color: var(--pass);    }
.quick-status.s-fix     { background-color: var(--fix-bg);     color: var(--fix);     }
.quick-status option    { background: var(--surface); color: var(--text); }

.quick-status-task {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 20px 3px 9px;
  border-radius: 100px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}
.quick-status-task.s-todo        { background-color: var(--surface2);     color: var(--text-muted); }
.quick-status-task.s-in_progress { background-color: rgba(37,99,235,0.1); color: var(--accent);     }
.quick-status-task.s-in_review   { background-color: rgba(202,138,4,0.1); color: #ca8a04;           }
.quick-status-task.s-done        { background-color: var(--pass-bg);      color: var(--pass);       }
.quick-status-task option        { background: var(--surface); color: var(--text); }

/* ── Action Buttons ── */
.actions { display: flex; gap: 6px; align-items: center; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; background: var(--accent-dim); }
.btn-icon.danger:hover { border-color: var(--fix); color: var(--fix); background: var(--fix-bg); }
.btn-icon svg { width: 13px; height: 13px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1;
}

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #3d7de8; text-decoration: none; color: #fff; }

.btn-secondary { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-light); text-decoration: none; }

.btn-danger { background: var(--fix-bg); color: var(--fix); border-color: var(--fix); }
.btn-danger:hover { background: var(--fix); color: #fff; text-decoration: none; }

.btn svg { width: 14px; height: 14px; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }

/* ── Forms ── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 680px;
}

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

.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 12px;
  transition: border-color 0.15s;
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: var(--bg);
}

.form-textarea { resize: vertical; font-family: 'IBM Plex Mono', monospace; font-size: 13px; line-height: 1.6; }

.form-select option { background: var(--surface); }

.form-hint { font-size: 11.5px; color: var(--text-muted); }

.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ── Section Titles ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* ── Sprint Table ── */
.sprint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sprint-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.sprint-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sprint-table tr:last-child td { border-bottom: none; }

.progress-bar-wrap {
  background: var(--surface2);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  min-width: 80px;
  display: flex;
}

.progress-seg { height: 100%; transition: width 0.3s; }
.seg-pending { background: var(--pending); }
.seg-pass    { background: var(--pass); }
.seg-fix     { background: var(--fix); }

/* ── Area badges in table ── */
.area-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  background: var(--surface2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
}

.login-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--text);
}

.login-logo span { color: var(--accent); }

.error-list {
  background: var(--fix-bg);
  border: 1px solid var(--fix);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  color: var(--fix);
  font-size: 13px;
  list-style: none;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}

.empty-state svg { opacity: 0.2; margin-bottom: 14px; }
.empty-state p { font-size: 14px; }

/* ── Detail view ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.detail-block.full { grid-column: 1 / -1; }
.detail-block .db-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.detail-block .db-value { font-size: 13.5px; color: var(--text); line-height: 1.6; white-space: pre-wrap; }
.detail-block .db-value.mono { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }

.meta-rows {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.meta-row {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.meta-row:last-child { border-bottom: none; }
.meta-row dt {
  font-size: 11.5px;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
}
.meta-row dt::after { content: ':'; margin-right: 8px; }
.meta-row dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}
.meta-row dd.mono { font-family: 'IBM Plex Mono', monospace; }

/* meta-row with inline edit button in dt */
.meta-row.has-edit { align-items: flex-start; }
.meta-row.has-edit dt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}
.meta-row.has-edit dt::after { content: ''; margin: 0; }

/* compact inline assignee picker in detail view */
.assignee-inline-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 6px;
}
.assignee-inline-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.assignee-inline-search {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
.assignee-inline-search::placeholder { color: var(--text-muted); }
.assignee-inline-list { max-height: 200px; overflow-y: auto; }

/* ── Attachments ──────────────────────────────────────────────────── */
.attachment-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.attachment-upload-zone:hover,
.attachment-upload-zone.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.attachment-upload-zone input[type="file"] { display: none; }
.attachment-upload-label {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.attachment-upload-label strong { color: var(--text); font-weight: 500; }
.attachment-upload-hint { font-size: 11.5px; }
.attachment-browse-btn {
  color: var(--accent);
  font-weight: 500;
  pointer-events: auto;
  cursor: pointer;
}
.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.attachment-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  position: relative;
}
.attachment-card:hover .attachment-delete { opacity: 1; }
.attachment-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.attachment-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 26px;
  font-weight: 300;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.attachment-info { padding: 6px 8px 8px; }
.attachment-filename {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
  line-height: 1.3;
}
.attachment-filename a { color: inherit; text-decoration: none; }
.attachment-filename a:hover { color: var(--accent); }
.attachment-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.attachment-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  padding: 0;
  line-height: 1;
}
.attachment-delete:hover { background: var(--fix); opacity: 1 !important; }
.attachment-counter { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }

/* ── Link preview cards ───────────────────────────────────────────── */
.link-previews { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.link-preview-card {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface2);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  max-width: 500px;
  transition: opacity .15s;
}
.link-preview-card:hover { opacity: .85; }
.lp-content {
  flex: 1;
  padding: 9px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lp-domain  { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-title   { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-description {
  font-size: 12px; color: var(--text-muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lp-image { width: 80px; object-fit: cover; flex-shrink: 0; background: var(--surface); }
.lp-skeleton {
  height: 52px; max-width: 500px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: lp-shimmer 1.4s infinite;
}
@keyframes lp-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Mobile wall ─────────────────────────────────────────────────── */
.mobile-wall {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--surface, #0f1117);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}
.mobile-wall-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
}
.mobile-wall-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #e2e8f0);
  margin-bottom: 10px;
}
.mobile-wall-msg {
  font-size: 14px;
  color: var(--text-muted, #64748b);
  line-height: 1.6;
}
@media (max-width: 768px) {
  .mobile-wall { display: flex; }
  .layout { display: none !important; }
}

/* ── Project status badges ───────────────────────────────────────── */
.project-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.project-status-badge.status-ongoing     { background: color-mix(in srgb, var(--pass) 15%, transparent); color: #16a34a; }
.project-status-badge.status-ended       { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-muted); }
.project-status-badge.status-maintenance { background: color-mix(in srgb, #f59e0b 14%, transparent); color: #d97706; }

/* ── Confirm delete ── */
.confirm-card {
  background: var(--surface);
  border: 1px solid var(--fix);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
}

.confirm-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.confirm-body  { color: var(--text-dim); margin-bottom: 20px; font-size: 13.5px; }

/* ── Toasts ── */
.toast-wrap {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  animation: slideUp 0.2s ease;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-row-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-block.full { grid-column: 1; }
}

/* ── Severity badges ── */
.badge-sev-critical { background: rgba(220,38,38,0.12);  color: #dc2626; }
.badge-sev-high     { background: rgba(234,88,12,0.12);  color: #ea580c; }
.badge-sev-medium   { background: rgba(202,138,4,0.12);  color: #ca8a04; }
.badge-sev-low      { background: rgba(22,163,74,0.12);  color: #16a34a; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  flex-wrap: nowrap;
  gap: 16px;
}

.page-info {
  font-size: 12.5px;
  color: var(--text-muted);
}

.page-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.15s;
}

.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.page-btn.disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── Kanban Board ── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}

.kanban-col {
  background: var(--surface2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.kanban-col-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 100px;
  padding: 1px 7px;
}

.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}

.kanban-card.overdue {
  border-left: 3px solid var(--fix);
}

.kanban-card-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 7px;
  text-decoration: none;
}

.kanban-card-title:hover { color: var(--accent); text-decoration: none; }

.kanban-card-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.kanban-due {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-due.due-overdue { color: var(--fix); }

.kanban-empty {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 20px 0;
  opacity: 0.5;
}

/* ── Avatar chip ── */
.avatar-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  font-family: 'IBM Plex Sans', sans-serif;
}

/* ── Task status badges ── */
.badge-task-todo        { background: var(--surface2); color: var(--text-muted); }
.badge-task-in_progress { background: rgba(37,99,235,0.1); color: var(--accent); }
.badge-task-in_review   { background: rgba(202,138,4,0.1); color: #ca8a04; }
.badge-task-done        { background: var(--pass-bg); color: var(--pass); }

/* ── Alert messages ── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  border: 1px solid var(--border);
}
.alert-success { background: var(--pass-bg); border-color: var(--pass); color: var(--pass); }
.alert-error   { background: var(--fix-bg);  border-color: var(--fix);  color: var(--fix); }

/* ── Responsive kanban ── */
@media (max-width: 1100px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .kanban-board { grid-template-columns: 1fr; }
}
/* ── Drag & drop ── */
.drag-ghost {
  opacity: 0.4;
  background: var(--accent-dim);
  border: 2px dashed var(--accent);
}
.drag-chosen {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
  transform: rotate(1.5deg);
}
.kanban-cards.sortable-drag-over {
  background: var(--accent-dim);
  border-radius: var(--radius);
}

/* ── Linked issue card ── */
.linked-issue-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface2);
  margin-top: 4px;
}
.linked-issue-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.linked-issue-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.linked-issue-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.linked-issue-steps {
  margin-top: 10px;
}
.linked-issue-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0;
}
.linked-issue-toggle:hover { color: var(--text); }
.linked-issue-toggle svg { transition: transform .2s; }
.linked-issue-steps-body {
  margin-top: 8px;
  font-size: 12.5px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Comments ── */
.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.comment-time {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}
.comment-body {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
  padding-left: 34px;
}
.comment-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.comment-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius);
}
.comment-action-btn:hover { color: var(--text); background: var(--surface2); }
.comment-action-delete:hover { color: var(--fix); }
.comment-edit-form {
  display: none;
  margin-top: 8px;
  padding-left: 34px;
}

/* ── Assignee Picker ── */
.assignee-picker { position: relative; }

.assignee-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  text-align: left;
  transition: border-color 0.15s;
  min-height: 38px;
}
.assignee-trigger:hover,
.assignee-trigger:focus { border-color: var(--accent); outline: none; }

.assignee-trigger-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}

.assignee-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  z-index: 200;
  display: none;
}
.assignee-dropdown.open { display: block; }

.assignee-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}
.assignee-search {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
.assignee-search::placeholder { color: var(--text-muted); }

.assignee-list-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 12px 2px;
  font-weight: 500;
}
.assignee-list {
  max-height: 230px;
  overflow-y: auto;
  padding: 4px 0 6px;
}

.assignee-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
  border-radius: 0;
}
.assignee-option:hover { background: var(--surface2); }
.assignee-option.selected { background: var(--accent-dim); }
.assignee-option input[type="checkbox"] { display: none; }

.ao-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.ao-name { flex: 1; font-size: 13.5px; color: var(--text); }
.ao-check {
  width: 15px;
  height: 15px;
  color: var(--accent);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.1s;
}
.assignee-option.selected .ao-check { opacity: 1; }

/* ── Activity log ── */
.activity-log {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.activity-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}
.activity-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  position: relative;
  top: -1px;
}
.activity-action {
  color: var(--text-muted);
  flex: 1;
}
.activity-actor {
  font-weight: 600;
  color: var(--text);
}
.activity-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}
