/* Flowboard — shared app styles */

/* ── Layout ─────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
  min-height: 100%;
  background: var(--bg-app);
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-sidebar);
  color: var(--ink-on-dark);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* Pinned footer for the sidebar — version chip lives here. mt:auto pushes
   it to the bottom regardless of how many sections exist above. */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 4px 4px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sb-version {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  color: rgba(255,255,255,.78);
  font: inherit; font-size: 12px;
  cursor: pointer;
  position: relative;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.sb-version:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.20);
  color: white;
}
.sb-version-tag {
  font-family: ui-monospace, monospace; font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
}
.sb-version-label { font-weight: 500; }
.sb-version-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--brand, #a25ddc);
  margin-left: auto;
  box-shadow: 0 0 0 0 rgba(162,93,220,.55);
  animation: sbVerDot 1.6s ease-out infinite;
}
.sb-version.is-unseen { color: white; border-color: rgba(162,93,220,.45); background: rgba(162,93,220,.08); }
.sb-version.is-unseen:hover { background: rgba(162,93,220,.16); }
@keyframes sbVerDot {
  0%   { box-shadow: 0 0 0 0   rgba(162,93,220,.45); }
  70%  { box-shadow: 0 0 0 10px rgba(162,93,220,0); }
  100% { box-shadow: 0 0 0 0   rgba(162,93,220,0); }
}

/* What's-new modal — built on the existing .modal-* design tokens. */
.whatsnew-modal {
  width: min(680px, 92vw);
  max-height: 88vh;
  display: flex; flex-direction: column;
}
.whatsnew-body {
  display: flex; flex-direction: column; gap: 18px;
  padding: 16px 20px; overflow-y: auto;
  flex: 1; min-height: 0;
}
.whatsnew-loading {
  text-align: center; color: var(--ink-muted); padding: 32px 12px;
}
.whatsnew-error {
  background: rgba(228,68,92,.08);
  color: #b41f37;
  border: 1px solid rgba(228,68,92,.28);
  padding: 8px 12px; border-radius: var(--r-md);
  font-size: 13px;
}
.whatsnew-tag {
  font-family: ui-monospace, monospace; font-size: 11px; font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 7px; border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--brand);
}
.whatsnew-release {
  border: 1px solid var(--border-row);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  background: var(--bg-surface);
}
.whatsnew-release-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.whatsnew-release-title {
  margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--ink-strong);
}
.whatsnew-release-date {
  font-size: 12px; color: var(--ink-muted);
}
.whatsnew-empty {
  font-size: 13px; color: var(--ink-muted);
  font-style: italic;
}
.whatsnew-section { margin-top: 8px; }
.whatsnew-section-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: inline-block;
  padding: 2px 7px; border-radius: 4px;
}
.whatsnew-section.is-added   .whatsnew-section-label { color: #00853d; background: rgba(0,200,117,.10); }
.whatsnew-section.is-changed .whatsnew-section-label { color: #1877f2; background: rgba(24,119,242,.10); }
.whatsnew-section.is-fixed   .whatsnew-section-label { color: #b66f00; background: rgba(253,171,61,.12); }
.whatsnew-list {
  margin: 4px 0 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--ink-body); line-height: 1.45;
}
.whatsnew-list li::marker { color: var(--ink-faint); }
.whatsnew-list code {
  font-family: ui-monospace, monospace; font-size: 11.5px;
  background: var(--bg-subtle); padding: 1px 5px; border-radius: 3px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-logo {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
  letter-spacing: -0.02em;
}
.sidebar-logo img { width: 32px; height: 32px; display: block; }
.sidebar-brand-name {
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
}
.sidebar-brand-plan {
  font-size: 11px; color: var(--ink-on-dark-muted); margin-top: 1px;
}
.sidebar-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-on-dark-muted); padding: 10px 8px 4px; font-weight: 600;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--r-sm);
  color: var(--ink-on-dark); font-size: 13.5px; cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.sidebar-item:hover { background: var(--bg-sidebar-hover); }
.sidebar-item.is-active { background: var(--bg-sidebar-active); }
.sidebar-item .sb-icon {
  width: 16px; height: 16px; color: var(--ink-on-dark-muted); flex: none;
}
.sidebar-item.is-active .sb-icon { color: white; }
.sidebar-item .sb-caret {
  width: 14px; height: 14px; margin-left: auto; transition: transform 0.15s;
  color: var(--ink-on-dark-muted);
}
.sidebar-item.is-expanded .sb-caret { transform: rotate(90deg); }
/* Sub-items under an expanded sidebar group (People submenu, etc.).
   Indented + slightly muted so the parent row stays the focal point. */
.sidebar-subitem {
  margin-left: 14px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  color: var(--ink-on-dark-muted, #9aa0ae);
}
.sidebar-subitem.is-active {
  color: white;
  border-left-color: rgba(255,255,255,.35);
}
.sidebar-subitem .sb-icon { width: 14px; height: 14px; opacity: .8; }
.sidebar-subitem.is-active .sb-icon { opacity: 1; }
.sidebar-subsection-head {
  margin: 10px 0 4px 14px;
  padding: 4px 8px 2px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-on-dark-muted, #9aa0ae);
  opacity: .7;
}
.sidebar-children {
  margin: 2px 0 6px 14px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-child {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink-on-dark); cursor: pointer;
}
.sidebar-child:hover { background: var(--bg-sidebar-hover); }
.sidebar-child.is-active { background: var(--brand); color: white; }
.sidebar-child-dot {
  width: 8px; height: 8px; border-radius: 2px; flex: none;
}
.sidebar-project-count {
  margin-left: auto; font-size: 11px; color: var(--ink-on-dark-muted);
  padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-weight: 600; line-height: 16px;
}
.sidebar-child.is-active .sidebar-project-count {
  background: rgba(255,255,255,.22); color: white;
}
.sidebar-project-count.has-overdue {
  background: rgba(226,68,92,.22);
  color: #ffb1bd;
}
.sidebar-child.is-active .sidebar-project-count.has-overdue {
  background: rgba(255,255,255,.32); color: #ffe1e6;
}

/* ── Main area ─────────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.topbar {
  height: 56px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-muted);
}
.breadcrumb b { color: var(--ink-strong); font-weight: 600; }
.breadcrumb svg { width: 12px; height: 12px; color: var(--ink-faint); }

.topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-subtle); border: 1px solid transparent;
  padding: 7px 12px; border-radius: var(--r-md);
  width: 260px; font-size: 13px; color: var(--ink-muted);
}
.topbar-search:hover { border-color: var(--border); }
.topbar-search svg { width: 14px; height: 14px; }

.topbar-actions {
  display: flex; align-items: center; gap: 6px;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-muted);
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--ink-strong); }
.icon-btn svg { width: 16px; height: 16px; }

/* ── Project header ─────────────────────────────────────── */
.project-header {
  padding: 20px 24px 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.project-title-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.project-title {
  font-size: 22px; font-weight: 700; color: var(--ink-strong);
  letter-spacing: -0.02em;
}
.project-fav { color: var(--ink-faint); cursor: pointer; }
.project-fav:hover { color: #fdab3d; }
.project-people {
  display: flex; margin-left: auto; align-items: center; gap: 14px;
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid white; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.btn-invite {
  background: var(--brand); color: white; border: none;
  padding: 7px 14px; border-radius: var(--r-md); font-weight: 600;
  font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.btn-invite:hover { background: var(--brand-dark); }

/* Admin-only red trash button next to Invite — shown only when the
   current user can delete the project. Visually understated at rest;
   reveals intent on hover. */
.btn-project-delete {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  margin-left: 4px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--ink-faint);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn-project-delete:hover {
  color: #c0223a;
  background: rgba(228, 68, 92, .08);
  border-color: rgba(228, 68, 92, .28);
}

/* ── Bulk action bar (sticky bottom-center) ─────────────────────── */
.bulk-bar {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  background: #0f1729;
  color: white;
  border-radius: 999px;
  box-shadow: 0 18px 48px rgba(0,0,0,.32), 0 2px 6px rgba(0,0,0,.2);
  animation: bulkBarPop .18s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes bulkBarPop {
  from { opacity: 0; transform: translate(-50%, 12px) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, 0)    scale(1);   }
}
.bulk-bar-count {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
}
.bulk-bar-count-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--brand, #a25ddc);
  color: white;
  font-weight: 800; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.bulk-bar-count-label { color: rgba(255,255,255,.72); }
.bulk-bar-divider {
  width: 1px; height: 22px;
  background: rgba(255,255,255,.12);
  margin: 0 2px;
}
.bulk-bar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255,255,255,.86);
  font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.bulk-bar-btn:hover {
  background: rgba(255,255,255,.10);
  color: white;
}
.bulk-bar-btn-danger { color: #ff8a9c; }
.bulk-bar-btn-danger:hover {
  background: rgba(228,68,92,.18);
  color: #ff5870;
}
.bulk-bar-btn-ghost {
  color: rgba(255,255,255,.55);
  font-weight: 500;
}
.bulk-bar-btn-ghost:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
}

/* On narrow viewports, stack the bar to two rows so all actions stay reachable */
@media (max-width: 720px) {
  .bulk-bar { flex-wrap: wrap; max-width: 92vw; border-radius: 14px; }
  .bulk-bar-divider:nth-of-type(2) { display: none; }
}

/* ── Connection chip in the topbar ──────────────────────────────── */
.conn-chip {
  display: inline-flex; align-items: center; gap: 6px;
  position: relative;
  padding: 5px 10px;
  margin-right: 6px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .12s ease;
  user-select: none;
}
.conn-chip:hover { filter: brightness(1.04); }
.conn-chip.is-online       { background: rgba(0,200,117,.10); color: #00853d; border-color: rgba(0,200,117,.30); }
.conn-chip.is-reconnecting { background: rgba(253,171,61,.12); color: #b66f00; border-color: rgba(253,171,61,.36); }
.conn-chip.is-offline      { background: rgba(228,68,92,.10); color: #b41f37; border-color: rgba(228,68,92,.32); }
.conn-chip-dot {
  width: 8px; height: 8px; border-radius: 999px;
  flex-shrink: 0;
}
.conn-chip.is-online       .conn-chip-dot { background: #00c875; box-shadow: 0 0 0 0 rgba(0,200,117,.45); }
.conn-chip.is-reconnecting .conn-chip-dot { background: #fdab3d; animation: connPulse 1.4s ease-out infinite; }
.conn-chip.is-offline      .conn-chip-dot { background: #e2445c; }
@keyframes connPulse {
  0%   { box-shadow: 0 0 0 0  rgba(253,171,61,.5); }
  70%  { box-shadow: 0 0 0 10px rgba(253,171,61,0); }
  100% { box-shadow: 0 0 0 0  rgba(253,171,61,0); }
}

/* Popover content */
.conn-popover {
  width: min(360px, 88vw);
  display: flex; flex-direction: column;
}
.conn-popover-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-row);
  background: var(--bg-subtle);
}
.conn-popover-title {
  font-size: 13px; font-weight: 700; color: var(--ink-strong);
  margin-bottom: 2px;
}
.conn-popover-sub {
  font-size: 11.5px; color: var(--ink-muted); line-height: 1.4;
}
.conn-popover-section {
  padding: 8px 14px 4px;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-muted);
}
.conn-popover-list {
  max-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.conn-popover-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px dashed var(--border-row);
}
.conn-popover-item:last-child { border-bottom: none; }
.conn-popover-item-main { flex: 1; min-width: 0; }
.conn-popover-item-label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conn-popover-item-sub {
  font-size: 11px; color: var(--ink-muted); margin-top: 2px;
}
.conn-popover-discard {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: 1px solid transparent; background: transparent;
  border-radius: 4px; color: var(--ink-faint);
  font-size: 12px; cursor: pointer;
}
.conn-popover-discard:hover {
  color: #c0223a; background: #fff0f3; border-color: #f5c0cc;
}
.conn-popover-actions {
  padding: 10px 14px;
  border-top: 1px solid var(--border-row);
  display: flex; gap: 8px;
}
.conn-popover-clear {
  color: #c0223a; border-color: #f5c0cc;
}
.conn-popover-clear:hover {
  background: #fff0f3; border-color: #e2445c;
}

/* Tabs row */
.project-tabs {
  display: flex; align-items: center; gap: 2px;
}
.project-tab {
  padding: 10px 14px; font-size: 13.5px; font-weight: 500;
  color: var(--ink-muted); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  display: flex; align-items: center; gap: 6px;
  transition: color 0.1s;
}
.project-tab:hover { color: var(--ink-strong); }
.project-tab.is-active {
  color: var(--brand); border-bottom-color: var(--brand); font-weight: 600;
}
.project-tab svg { width: 14px; height: 14px; }
.tab-badge {
  background: var(--bg-subtle); color: var(--ink-muted);
  border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600;
}
.project-tab.is-active .tab-badge { background: var(--brand-soft); color: var(--brand); }

/* ── Toolbar above table ────────────────────────────────── */
.board-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}
.board-toolbar::-webkit-scrollbar { height: 6px; }
.board-toolbar::-webkit-scrollbar-thumb { background: var(--border-strong, #d0d4dc); border-radius: 999px; }
.board-toolbar::-webkit-scrollbar-track { background: transparent; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent;
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-body);
  transition: background 0.1s, border-color 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
  min-height: 32px;
}
.btn:hover { background: var(--bg-subtle); }
.btn svg { width: 14px; height: 14px; }
.btn-primary {
  background: var(--brand); color: white;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-split {
  padding-right: 4px; gap: 0;
}
.btn-split .btn-main {
  padding: 6px 10px 6px 12px;
}
.btn-split .btn-caret {
  padding: 6px 8px; border-left: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center;
}

.toolbar-divider {
  width: 1px; height: 20px; background: var(--border); margin: 0 4px;
  flex-shrink: 0;
}
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Active toolbar button — lit up when a popover is open or filters are engaged */
.btn.btn-active {
  background: #eef3ff;
  color: #0060b9;
  border-color: #d5e3fb;
}
.btn.btn-active:hover { background: #e2ecfd; }
.btn-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 5px;
  border-radius: 999px; background: var(--brand); color: white;
  font-size: 10px; font-weight: 700; margin-left: 2px;
}
.btn.btn-link-reset {
  color: var(--ink-muted);
  font-size: 12px;
}
.btn.btn-link-reset:hover { color: #e2445c; background: #fef0f2; }

.btn.btn-mine {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600;
}
.btn.btn-mine.is-on {
  background: rgba(162, 93, 220, 0.10);
  color: var(--brand, #a25ddc);
  border-color: rgba(162, 93, 220, 0.35);
  box-shadow: inset 0 0 0 1px rgba(162, 93, 220, 0.15);
}
.btn.btn-mine.is-on:hover {
  background: rgba(162, 93, 220, 0.16);
  border-color: rgba(162, 93, 220, 0.5);
}
.btn.btn-mine.is-on svg { color: var(--brand, #a25ddc); }

.topbar-search.is-active {
  border-color: var(--brand);
  background: white;
  color: var(--ink-body);
}
.topbar-search.is-active svg { color: var(--brand); }
.topbar-search input::placeholder { color: var(--ink-faint); }

.view-switcher { display: flex; gap: 2px; }
.view-btn {
  padding: 6px 10px; border-radius: var(--r-md); border: none; background: transparent;
  color: var(--ink-muted); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
.view-btn:hover { background: var(--bg-subtle); }
.view-btn.is-active { background: var(--bg-subtle); color: var(--ink-strong); font-weight: 600; }
.view-btn svg { width: 14px; height: 14px; }

/* ── Avatars ────────────────────────────────────────────── */
.avatar {
  width: 24px; height: 24px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 10.5px; font-weight: 600;
  flex: none; user-select: none;
  overflow: hidden;
}
.avatar-sm { width: 20px; height: 20px; font-size: 9px; }
.avatar-md { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 32px; height: 32px; font-size: 12px; }
.avatar-xl { width: 48px; height: 48px; font-size: 18px; }
.avatar img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  border-radius: inherit;
}
.avatar-has-img { background: transparent !important; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--ink); border-radius: 6px;
  padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--surface-2); }

/* ── Pills ──────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 70px; padding: 4px 10px; border-radius: var(--r-xs);
  font-size: 12px; font-weight: 600; color: white;
  letter-spacing: 0.01em; white-space: nowrap; cursor: pointer;
  transition: filter 0.1s;
}
.pill:hover { filter: brightness(1.06); }
.pill-cell {
  width: 100%; height: 100%;
  min-width: 0; padding: 6px 10px; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
}
.pill-sm { font-size: 11px; padding: 3px 8px; min-width: 0; }

.pill-backlog { background: var(--status-backlog); color: #3d3d3d; }
.pill-todo { background: var(--status-todo); }
.pill-progress { background: var(--status-progress); }
.pill-review { background: var(--status-review); }
.pill-qa { background: #a25ddc; }
.pill-done { background: var(--status-done); }
.pill-blocked { background: var(--status-blocked); }
.pill-reopened { background: #e2445c; }

.pill-prio-critical { background: var(--prio-critical); }
.pill-prio-high { background: var(--prio-high); }
.pill-prio-medium { background: var(--prio-medium); }
.pill-prio-low { background: var(--prio-low); }
.pill-prio-none { background: var(--prio-none); color: #3d3d3d; }

/* ── Done celebration ───────────────────────────────────── */
.pill.is-celebrate {
  position: relative;
  animation: fb-done-bounce 0.85s cubic-bezier(.25,1.6,.4,1) both;
  box-shadow:
    0 0 0 3px rgba(0, 200, 117, 0.18),
    0 6px 18px rgba(0, 200, 117, 0.32);
  z-index: 2;
}
@keyframes fb-done-bounce {
  0%   { transform: scale(1);    filter: brightness(1); }
  18%  { transform: scale(1.18) rotate(-3deg); filter: brightness(1.18) saturate(1.2); }
  35%  { transform: scale(0.94) rotate(2deg);  filter: brightness(1.1)  saturate(1.1); }
  55%  { transform: scale(1.08) rotate(-1deg); filter: brightness(1.12); }
  75%  { transform: scale(0.98); filter: brightness(1.05); }
  100% { transform: scale(1);    filter: brightness(1); }
}

/* Confetti spark — six tiny dots fly out + fade */
.celebrate-spark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.celebrate-spark > span {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: fb-spark-fly 0.85s ease-out forwards;
}
.celebrate-spark > span:nth-child(1) { background: #00c875; --tx:  22px; --ty: -18px; animation-delay: 0.04s; }
.celebrate-spark > span:nth-child(2) { background: #ffcb00; --tx:  28px; --ty:   6px; animation-delay: 0.00s; }
.celebrate-spark > span:nth-child(3) { background: #a25ddc; --tx:   6px; --ty: -26px; animation-delay: 0.08s; }
.celebrate-spark > span:nth-child(4) { background: #fb8b1d; --tx: -22px; --ty: -16px; animation-delay: 0.05s; }
.celebrate-spark > span:nth-child(5) { background: #00b8e0; --tx: -26px; --ty:   8px; animation-delay: 0.02s; }
.celebrate-spark > span:nth-child(6) { background: #e2445c; --tx:  -8px; --ty: -28px; animation-delay: 0.10s; }
@keyframes fb-spark-fly {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.1); }
}

/* Celebration on the popover line itself when picking "Done" */
.popover-item { position: relative; }
.popover-item.is-celebrating {
  background: linear-gradient(90deg, rgba(0,200,117,0.18), rgba(0,200,117,0.06));
  animation: fb-line-celebrate 0.52s ease-out;
}
@keyframes fb-line-celebrate {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.04); box-shadow: 0 0 0 2px rgba(0,200,117,0.45); }
  60%  { transform: scale(0.99); }
  100% { transform: scale(1); box-shadow: none; }
}
.popover-spark {
  position: absolute;
  top: 50%; right: 18px;
  width: 0; height: 0;
  pointer-events: none;
  opacity: 0;
}
.popover-item.is-celebrating .popover-spark { opacity: 1; }
.popover-spark > span {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.popover-item.is-celebrating .popover-spark > span {
  animation: fb-spark-fly 0.55s ease-out forwards;
}
.popover-spark > span:nth-child(1) { background: #00c875; --tx:  18px; --ty: -14px; animation-delay: 0.04s; }
.popover-spark > span:nth-child(2) { background: #ffcb00; --tx:  22px; --ty:   4px; animation-delay: 0.00s; }
.popover-spark > span:nth-child(3) { background: #a25ddc; --tx:   4px; --ty: -20px; animation-delay: 0.08s; }
.popover-spark > span:nth-child(4) { background: #fb8b1d; --tx: -18px; --ty: -12px; animation-delay: 0.05s; }
.popover-spark > span:nth-child(5) { background: #00b8e0; --tx: -22px; --ty:   6px; animation-delay: 0.02s; }
.popover-spark > span:nth-child(6) { background: #e2445c; --tx:  -6px; --ty: -22px; animation-delay: 0.10s; }

/* ── Context popovers ───────────────────────────────────── */
.popover {
  position: absolute; z-index: 10100;
  /* Why 10100? The Popover component portals to document.body, so it
     lives at the document's root stacking context. Modals stack at
     10000–10080 (modal-backdrop=10000, avatar-modal=10050, delete
     project=10080). At z-index: 60, popovers spawned from a picker
     INSIDE a modal would render behind the modal's own backdrop /
     content — invisible to the user. 10100 keeps every dropdown +
     calendar + assignee picker reliably above whichever modal is
     active. Toasts (10001) still float above page chrome but below
     a popover that's actively interactive — which is the right
     priority. */
  background: white; border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 160px;
}
.popover-item {
  padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer;
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.popover-item:hover { background: var(--bg-subtle); }
.popover-swatch { width: 14px; height: 14px; border-radius: 3px; flex: none; }

/* ── Drawer ─────────────────────────────────────────────── */
.drawer-backdrop {
  position: absolute; inset: 0; background: rgba(16, 22, 40, 0.3);
  z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.18s;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: absolute; top: 0; right: 0; height: 100%;
  /* On big screens the drawer widens so the Details grid can pair
     fields two-up (see .drawer-grid @media in drawer.jsx). Falls back
     to 520px on narrower windows / mobile. */
  width: 720px; max-width: 92%; background: white;
  box-shadow: var(--shadow-drawer); transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(.2,.7,.3,1);
  z-index: 50; display: flex; flex-direction: column;
}
@media (max-width: 1100px) { .drawer { width: 520px; } }
.drawer.is-open { transform: translateX(0); }
