/* ============================================================
   Neutara Project Management — styles.css
   A Jira-like SPA with dark (default) and light modes.
   Brand color: #174F96
   ============================================================ */

/* ------------------------------------------------------------
   CSS VARIABLES — Dark Mode (default)
   ------------------------------------------------------------ */
:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1c2333;
  --bg4: #242d3d;
  --border: #30394a;
  --text: #e6edf3;
  --text2: #8b949e;
  --text3: #545d68;
  --accent: #4d90e0;
  --accent2: #6ba5eb;
  --accent-bg: rgba(77, 144, 224, 0.12);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --purple: #818cf8;
  --sidebar-w: 260px;
  --topbar-h: 52px;
  --drawer-w: 720px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------
   CSS VARIABLES — Light Mode
   ------------------------------------------------------------ */
body.light {
  --bg: #f0f2f5;
  --bg2: #ffffff;
  --bg3: #f7f8fa;
  --bg4: #e8ecf0;
  --border: #d0d7de;
  --text: #1f2328;
  --text2: #57606a;
  --text3: #8b949e;
  --accent: #174F96;
  --accent2: #1560b0;
  --accent-bg: rgba(23, 79, 150, 0.08);
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0369a1;
  --purple: #4f46e5;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------
   RESET & BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* transition only on theme toggle elements, not all (*) for performance */

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

button {
  cursor: pointer;
  font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

body.light ::-webkit-scrollbar-thumb {
  background: #d0d7de;
}

/* Selection */
::selection {
  background: var(--accent);
  color: #ffffff;
}

/* ------------------------------------------------------------
   SIDEBAR
   ------------------------------------------------------------ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 100;
  transition: width 0.2s ease;
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-img {
  height: 28px;
  object-fit: contain;
}

.sidebar-logo-fallback {
  height: 28px;
  object-fit: contain;
}

.workspace-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-create-btn {
  width: calc(100% - 24px);
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin: 8px 12px;
  transition: filter 0.15s;
}

.sidebar-create-btn:hover {
  filter: brightness(1.1);
}

.sidebar-search {
  margin: 4px 12px;
}

.sidebar-search input {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

.sidebar-search input:focus {
  border-color: var(--accent);
  outline: none;
}

.sidebar-section {
  padding: 4px 0;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  padding: 8px 16px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-label button {
  font-size: 10px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  margin: 1px 8px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--bg3);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 12px;
}

.space-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  margin: 1px 8px;
  transition: all 0.15s ease;
}

.space-item:hover {
  background: var(--bg3);
  color: var(--text);
}

.space-item.active {
  background: var(--accent-bg);
  color: var(--accent);
}

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

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-footer select {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

/* ------------------------------------------------------------
   SIDEBAR — Light Mode Overrides
   ------------------------------------------------------------ */
body.light .sidebar {
  background: #174F96;
  border-right-color: #133f7a;
}

body.light .sidebar-header {
  background: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.light .workspace-name {
  color: #174F96;
}

body.light .sidebar-label {
  color: rgba(255, 255, 255, 0.5);
}

body.light .sidebar-label button {
  color: rgba(255, 255, 255, 0.6);
}

body.light .nav-item {
  color: rgba(255, 255, 255, 0.7);
}

body.light .nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.light .nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body.light .sidebar-create-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

body.light .sidebar-create-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

body.light .sidebar-search input {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

body.light .sidebar-search input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

body.light .sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.15);
}

body.light .sidebar-footer select {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

body.light .space-item {
  color: rgba(255, 255, 255, 0.75);
}

body.light .space-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.light .space-item.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

body.light .nav-divider {
  background: rgba(255, 255, 255, 0.15);
}

/* ------------------------------------------------------------
   MAIN WRAP
   ------------------------------------------------------------ */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ------------------------------------------------------------
   TOPBAR
   ------------------------------------------------------------ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

body.light .topbar {
  background: #ffffff;
  border-bottom-color: #d0d7de;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.breadcrumb-link {
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s, text-decoration 0.15s;
}

.breadcrumb-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--text3);
  font-weight: 400;
  margin: 0 2px;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 16px;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg3);
  color: var(--text);
}

.notif-btn {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 16px;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  background: var(--bg3);
  color: var(--text);
}

/* ------------------------------------------------------------
   SPACE HEADER
   ------------------------------------------------------------ */
.space-header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

body.light .space-header {
  background: #ffffff;
}

.space-header-icon {
  font-size: 24px;
}

.space-header-name {
  font-size: 18px;
  font-weight: 700;
}

.space-header-key {
  font-size: 11px;
  background: var(--bg4);
  color: var(--text2);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.space-members-row {
  display: flex;
  margin-left: auto;
}

.space-members-row .avatar {
  margin-left: -4px;
}

.space-members-row .avatar:first-child {
  margin-left: 0;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-xs {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.star-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 16px;
  transition: all 0.15s ease;
}

.star-btn:hover {
  background: var(--bg3);
}

.star-btn.starred {
  color: var(--warning);
}

/* ------------------------------------------------------------
   VIEWS CONTAINER
   ------------------------------------------------------------ */
.views-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.view {
  width: 100%;
  max-width: 100%;
  position: relative;
}

/* ------------------------------------------------------------
   VIEW TITLES & TOOLBAR
   ------------------------------------------------------------ */
.view-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

.view-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

body.light .card {
  background: #ffffff;
  border-color: #d0d7de;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

body.light .stat-card {
  background: #ffffff;
  border-color: #d0d7de;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
}

.stat-card .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text2);
  letter-spacing: 0.04em;
  font-weight: 600;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text3);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

/* ------------------------------------------------------------
   SPACE CARDS (grid)
   ------------------------------------------------------------ */
.space-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.space-card:hover {
  border-color: var(--accent);
}

body.light .space-card {
  background: #ffffff;
  border-color: #d0d7de;
}

.space-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.space-card-icon {
  font-size: 28px;
}

.space-card-name {
  font-size: 15px;
  font-weight: 700;
}

.space-card-key {
  font-size: 10px;
  background: var(--bg4);
  color: var(--text2);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.space-card-desc {
  font-size: 12px;
  color: var(--text2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.space-card-meta {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text3);
}

.spaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ------------------------------------------------------------
   ISSUE CARDS (sprint board)
   ------------------------------------------------------------ */
.issue-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.issue-card:hover {
  border-color: var(--accent);
}

body.light .issue-card {
  background: #ffffff;
  border-color: #d0d7de;
}

.issue-card .issue-key {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

/* Board card (alias + sub-elements) */
.board-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; cursor: pointer; margin-bottom: 6px; transition: border-color .15s, background .15s; }
.board-card:hover { border-color: var(--accent); }
body.light .board-card { background: #ffffff; border-color: #d0d7de; }
body.light .board-card:hover { border-color: var(--accent); }
.board-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.board-card-header .issue-key { font-size: 11px; font-weight: 600; color: var(--accent); }
.board-card-title { font-size: 13px; font-weight: 500; margin-bottom: 8px; line-height: 1.4; }
.board-card-footer { display: flex; align-items: center; justify-content: space-between; }
.badge-points { font-size: 10px; background: var(--bg4); color: var(--text2); padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.badge-count { font-size: 11px; background: var(--bg4); color: var(--text2); padding: 1px 8px; border-radius: 10px; }

.issue-card .issue-title {
  font-size: 13px;
  font-weight: 500;
  margin: 4px 0;
}

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

.issue-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------------------------------------
   BACKLOG
   ------------------------------------------------------------ */
.sprint-lane {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

body.light .sprint-lane {
  background: #ffffff;
  border-color: #d0d7de;
}

.sprint-lane-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  cursor: pointer;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.sprint-lane-header:hover {
  background: var(--bg4);
}

.sprint-meta {
  font-size: 12px;
  color: var(--text2);
  font-weight: 400;
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.sprint-lane-body {
  padding: 4px;
}

/* Backlog lanes (sprint sections in backlog) */
.backlog-lane { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden; }
body.light .backlog-lane { background: #ffffff; border-color: #d0d7de; }
.backlog-lane-header { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; background: var(--bg3); cursor: pointer; border-bottom: 1px solid var(--border); }
body.light .backlog-lane-header { background: #f7f8fa; }
.backlog-lane-header:hover { background: var(--bg4); }
.lane-header-left { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.lane-header-actions { display: flex; align-items: center; gap: 4px; }
.sprint-dates { font-size: 12px; color: var(--text3); font-weight: 400; white-space: nowrap; }
.lane-toggle { font-size: 12px; width: 16px; cursor: pointer; }
.backlog-lane-body { }
.backlog-lane-body.collapsed { display: none; }
.backlog-add-row { padding: 6px 14px; }

.backlog-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.15s ease;
  gap: 8px;
}

.backlog-row:hover {
  background: var(--bg3);
}

.backlog-row:last-child {
  border-bottom: none;
}

.issue-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  min-width: 56px;
}

.issue-title-text {
  font-size: 13px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   BOARD (sprint board columns)
   ------------------------------------------------------------ */
.board-columns {
  display: flex;
  gap: 12px;
  min-height: 400px;
}

.board-col {
  flex: 1;
  background: var(--bg3);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-width: 240px;
}

body.light .board-col {
  background: #f7f8fa;
}

.board-col-header {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.board-col-body {
  flex: 1;
  padding: 6px;
  overflow-y: auto;
  min-height: 100px;
}

.col-count {
  font-size: 11px;
  background: var(--bg4);
  color: var(--text2);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* ------------------------------------------------------------
   TIMELINE
   ------------------------------------------------------------ */
.timeline-container {
  overflow-x: auto;
  position: relative;
}

.timeline-header {
  display: flex;
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 5;
  border-bottom: 1px solid var(--border);
}

.timeline-cell {
  min-width: 40px;
  height: 32px;
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 10px;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
  position: relative;
}

.timeline-row-label {
  width: 200px;
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 12px;
  border-right: 1px solid var(--border);
}

.timeline-bar {
  height: 24px;
  border-radius: 4px;
  position: absolute;
  cursor: pointer;
  font-size: 11px;
  color: #ffffff;
  padding: 0 8px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.timeline-bar.overdue {
  border: 2px solid var(--danger);
}

/* ------------------------------------------------------------
   CALENDAR
   ------------------------------------------------------------ */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
}

.calendar-day {
  background: var(--bg2);
  min-height: 100px;
  padding: 4px;
}

.calendar-day-header {
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  padding: 4px;
  text-align: right;
}

.calendar-day.today {
  background: var(--accent-bg);
}

.calendar-day.other-month {
  opacity: 0.4;
}

.calendar-item {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--bg3);
  border-left: 3px solid var(--accent);
}

.calendar-weekday {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px;
  text-align: center;
  color: var(--text2);
  background: var(--bg3);
}

/* ------------------------------------------------------------
   ALL WORK TABLE
   ------------------------------------------------------------ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 8px 12px;
  text-align: left;
  background: var(--bg3);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text2);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table th:hover {
  background: var(--bg4);
}

body.light .data-table th {
  background: #f7f8fa;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg3);
}

.data-table .selected td {
  background: var(--accent-bg);
}

/* ------------------------------------------------------------
   FILTERS
   ------------------------------------------------------------ */
.filter-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.filter-card:hover {
  border-color: var(--accent);
}

.filter-card-name {
  font-weight: 600;
}

.filter-card-meta {
  font-size: 11px;
  color: var(--text3);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--bg3);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.filter-chip .remove {
  cursor: pointer;
  color: var(--text3);
  transition: color 0.15s ease;
}

.filter-chip .remove:hover {
  color: var(--danger);
}

.filter-builder {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

/* ------------------------------------------------------------
   REPORTS
   ------------------------------------------------------------ */
.report-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

body.light .report-card {
  background: #ffffff;
  border-color: #d0d7de;
}

.report-chart {
  padding: 16px 0;
}

/* Burndown chart */
.rpt-bd-wrap { display:flex; gap:4px; align-items:flex-end; padding:8px 0 4px; overflow-x:auto; }
.rpt-bd-day { display:flex; flex-direction:column; align-items:center; flex-shrink:0; width:32px; }
.rpt-bd-bar { background:#174F96; width:20px; border-radius:3px 3px 0 0; min-height:2px; }
.rpt-bd-ideal-dot { position:absolute; left:50%; transform:translateX(-50%); width:6px; height:6px; background:#ef4444; border-radius:50%; }
.rpt-bd-label { font-size:9px; color:var(--text2); margin-top:3px; white-space:nowrap; }

/* Control chart */
.rpt-ct-row { display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid var(--border); }
.rpt-ct-key { font-size:11px; color:var(--text2); width:72px; flex-shrink:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rpt-ct-track { flex:1; height:14px; background:var(--bg2); border-radius:3px; overflow:hidden; }
.rpt-ct-fill { height:100%; border-radius:3px; }
.rpt-ct-days { font-size:11px; color:var(--text2); width:40px; text-align:right; flex-shrink:0; }

/* Velocity bars — vertical */
.velocity-bars { display:flex; gap:16px; align-items:flex-end; height:160px; padding:8px 0; }
.velocity-bar-group { display:flex; flex-direction:column; align-items:center; gap:4px; flex:1; min-width:48px; height:100%; justify-content:flex-end; }
.velocity-bar { width:100%; border-radius:4px 4px 0 0; min-height:4px; }
.velocity-label { font-size:10px; color:var(--text2); text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:80px; }
.velocity-value { font-size:11px; font-weight:600; color:var(--text); }

.chart-bar {
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-width: 24px;
  transition: height 0.3s ease;
  position: relative;
}

.chart-bar:hover {
  opacity: 0.85;
}

.chart-bar-label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.donut-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
}

/* ------------------------------------------------------------
   ISSUE DRAWER (Jira-style)
   ------------------------------------------------------------ */
.issue-drawer { position: fixed; inset: 0; z-index: 200; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200; }
.drawer-panel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--drawer-w); max-width: 92vw; background: var(--bg2); z-index: 201; display: flex; flex-direction: column; box-shadow: -6px 0 30px rgba(0,0,0,.25); animation: slideIn .2s ease-out; }
body.light .drawer-panel { background: #ffffff; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ---- Full-page issue mode (opened via ?issue=ID in new tab) ---- */
body.issue-page .sidebar { display: flex !important; width: 260px !important; min-width: 260px !important; overflow-y: auto !important; }
body.issue-page .sidebar.collapsed { width: 260px !important; min-width: 260px !important; overflow: visible !important; }
body.issue-page .main-wrap { display: none !important; }
body.issue-page .issue-drawer {
  position: static !important;
  flex: 1;
  height: 100vh;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
}
body.issue-page .drawer-overlay { display: none !important; }
body.issue-page .drawer-panel {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100vh;
  box-shadow: none;
  animation: none;
  border-radius: 0;
  flex: 1;
}
body.issue-page .drawer-main { max-width: 760px; margin: 0 auto; padding: 32px 40px; }
body.issue-page .drawer-sidebar { width: 320px; flex-shrink: 0; }
body.issue-page .drawer-close-btn { display: none !important; }
body.issue-page .drawer-topbar {
  padding: 14px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 10;
}
body.light.issue-page .drawer-topbar { background: #fff; }

/* Top bar */
.drawer-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-topbar-left { display: flex; align-items: center; gap: 10px; }
.drawer-topbar-right { display: flex; align-items: center; gap: 4px; }
.drawer-issue-key { font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer; }
.drawer-issue-key:hover { text-decoration: underline; }
.drawer-type-badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.drawer-close-btn { font-size: 18px; }

/* Body layout */
.drawer-body { flex: 1; display: flex; overflow: hidden; }
.drawer-main { flex: 1; padding: 20px 24px; overflow-y: auto; }
.drawer-sidebar { width: 300px; padding: 16px 20px; overflow-y: auto; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--bg3); }
body.light .drawer-sidebar { background: #f7f8fa; }

/* Title */
.drawer-title { font-size: 20px; font-weight: 700; line-height: 1.3; margin-bottom: 20px; outline: none; border-bottom: 2px solid transparent; padding-bottom: 4px; }
.drawer-title:focus { border-bottom-color: var(--accent); }
.drawer-title:empty::before { content: 'Add a title...'; color: var(--text3); }

/* Collapsible Sections */
.drawer-section { margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.drawer-section:last-child { border-bottom: none; }
.drawer-section-header { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 0; margin-bottom: 10px; user-select: none; }
.drawer-section-header:hover { color: var(--accent); }
.drawer-section-toggle { font-size: 12px; color: var(--text3); width: 14px; transition: transform .15s; }
.drawer-section.collapsed .drawer-section-toggle { transform: rotate(-90deg); }
.drawer-section.collapsed .drawer-section-body { display: none; }
.drawer-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text2); }

/* Description */
.drawer-detail-row { margin-bottom: 12px; }
.drawer-detail-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.drawer-desc { min-height: 40px; max-height: 300px; overflow-y: auto; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius); font-size: 14px; line-height: 1.7; color: var(--text); outline: none; background: transparent; white-space: pre-wrap; }
.drawer-desc:hover { background: var(--bg3); }
.drawer-desc:focus { border-color: var(--accent); background: var(--bg3); min-height: 80px; max-height: 400px; }
.drawer-desc:empty::before { content: attr(data-placeholder); color: var(--text3); font-style: italic; }

/* Subtask rows */
.subtask-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.subtask-row:hover { background: var(--bg3); }
.subtask-key { font-weight: 600; color: var(--accent); font-size: 12px; }
.subtask-title { flex: 1; }

/* Activity section */
.drawer-activity-tabs { display: flex; gap: 0; margin-bottom: 14px; border-bottom: 2px solid var(--border); }
.drawer-atab { padding: 6px 14px; font-size: 12px; font-weight: 700; color: var(--text2); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.drawer-atab:hover { color: var(--text); }
.drawer-atab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Comment input box */
.drawer-comment-box { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; }
.drawer-comment-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.drawer-comment-form { flex: 1; }
.drawer-comment-form textarea { width: 100%; min-height: 60px; resize: vertical; }
.drawer-comment-actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.comment-attach-btn { cursor: pointer; }
.comment-file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.comment-file-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 3px 8px; font-size: 12px; color: var(--text2); }
.comment-file-tag .comment-file-size { color: var(--text3); }
.comment-file-tag button { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 15px; line-height: 1; padding: 0 0 0 4px; }
.comment-file-tag button:hover { color: var(--red); }

/* Activity tabs */
.drawer-activity-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
/* Hide comment box on History and Work log tabs */
#activitySectionBody[data-active-tab="history"] #drawerCommentBox,
#activitySectionBody[data-active-tab="worklog"] #drawerCommentBox { display: none !important; }
.drawer-atab { background: none; border: none; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; transition: color .15s; }
.drawer-atab:hover { color: var(--text); }
.drawer-atab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Activity / Comment list */
.drawer-activity-list { display: flex; flex-direction: column; }
.drawer-comment-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.drawer-comment-item:last-child { border-bottom: none; }
.drawer-comment-avatar-sm { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.drawer-comment-content { flex: 1; }
.drawer-comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.drawer-comment-author { font-size: 13px; font-weight: 700; color: var(--text); }
.drawer-comment-date { font-size: 11px; color: var(--text3); }
.drawer-comment-body { font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.drawer-comment-footer { display: flex; gap: 12px; margin-top: 6px; }
.drawer-comment-footer button { background: none; border: none; font-size: 12px; color: var(--text3); cursor: pointer; padding: 2px 4px; }
.drawer-comment-footer button:hover { color: var(--accent); }

/* ── Drawer Sidebar (Jira-style fields table) ──────────── */
.drawer-sidebar-section { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.drawer-sidebar-section:last-child { border-bottom: none; }
.drawer-sidebar-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); margin-bottom: 10px; cursor: pointer; }
.drawer-sidebar-heading:hover { color: var(--text2); }

.drawer-fields-table { width: 100%; border-collapse: collapse; }
.drawer-fields-table td { padding: 6px 0; vertical-align: middle; font-size: 13px; }
.drawer-fields-table td.dfl { width: 110px; font-weight: 600; color: var(--text2); white-space: nowrap; padding-right: 12px; }
.drawer-fields-table td.dfv { color: var(--text); }

.drawer-select { width: 100%; padding: 5px 8px; background: var(--bg2); border: 1px solid transparent; border-radius: var(--radius); color: var(--text); font-size: 12px; cursor: pointer; }
.drawer-select:hover { border-color: var(--border); background: var(--bg3); }
.drawer-select:focus { border-color: var(--accent); outline: none; }
body.light .drawer-select { background: #ffffff; }
body.light .drawer-select:hover { background: #f0f2f5; }

.drawer-input { width: 100%; padding: 5px 8px; background: var(--bg2); border: 1px solid transparent; border-radius: var(--radius); color: var(--text); font-size: 12px; }
.drawer-input:hover { border-color: var(--border); background: var(--bg3); }
.drawer-input:focus { border-color: var(--accent); outline: none; }
body.light .drawer-input { background: #ffffff; }

.drawer-field-value { font-size: 13px; color: var(--text); font-weight: 500; }

/* Meta (created/updated) */
.drawer-meta-section { padding-top: 8px; }
.drawer-meta-row { font-size: 11px; color: var(--text3); margin-bottom: 4px; display: flex; justify-content: space-between; }
.drawer-meta-row span { font-weight: 600; color: var(--text2); }

.drawer-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text3);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.drawer-field select,
.drawer-field input {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

/* ------------------------------------------------------------
   BADGES — Status
   ------------------------------------------------------------ */
.status-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.status-badge.todo {
  background: var(--bg3);
  color: var(--text2);
}

.status-badge.in-progress {
  background: var(--accent-bg);
  color: var(--accent);
}

.status-badge.in-review {
  background: rgba(129, 140, 248, 0.12);
  color: var(--purple);
}

.status-badge.done {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

/* ------------------------------------------------------------
   BADGES — Priority
   ------------------------------------------------------------ */
.priority-badge {
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.priority-badge.highest {
  color: #ef4444;
}

.priority-badge.high {
  color: #f97316;
}

.priority-badge.medium {
  color: #f59e0b;
}

.priority-badge.low {
  color: #10b981;
}

.priority-badge.lowest {
  color: #6b7280;
}

/* ------------------------------------------------------------
   BADGES — Type
   ------------------------------------------------------------ */
.type-badge {
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.type-badge.epic {
  color: #818cf8;
}

.type-badge.story {
  color: #10b981;
}

.type-badge.task {
  color: #4d90e0;
}

.type-badge.bug {
  color: #ef4444;
}

.type-badge.subtask {
  color: #8b949e;
}

/* ------------------------------------------------------------
   BADGES — Sprint
   ------------------------------------------------------------ */
.sprint-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.sprint-badge.planning {
  background: var(--bg3);
  color: var(--text2);
}

.sprint-badge.active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.sprint-badge.completed {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ------------------------------------------------------------
   BADGES — Points
   ------------------------------------------------------------ */
.points-badge {
  font-size: 10px;
  background: var(--bg4);
  color: var(--text2);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
}

/* ------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------ */
.btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg4);
}

body.light .btn-secondary {
  background: #f7f8fa;
  color: #1f2328;
  border-color: #d0d7de;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: transparent;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg3);
  color: var(--text);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  font-family: inherit;
}

.btn-link:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------
   ATTACHMENT UPLOAD
   ------------------------------------------------------------ */
.attachment-upload-label { display: flex; align-items: center; cursor: pointer; }
.attachment-upload-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border: 1px dashed var(--border); border-radius: var(--radius); font-size: 13px; color: var(--text2); background: var(--bg2); cursor: pointer; transition: border-color .15s, background .15s; }
.attachment-upload-label:hover .attachment-upload-btn { border-color: var(--accent); background: var(--bg3); color: var(--accent); }

/* ------------------------------------------------------------
   FORM ELEMENTS
   ------------------------------------------------------------ */
input,
select,
textarea {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 12px;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-bg);
}

body.light input,
body.light select,
body.light textarea {
  background: #ffffff;
  color: #1f2328;
  border-color: #d0d7de;
}

body.light select option {
  background: #ffffff;
  color: #1f2328;
}

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

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

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > * {
  flex: 1;
}

/* ------------------------------------------------------------
   MODALS
   ------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 90vw;
  max-height: 85vh;
  overflow: auto;
  box-shadow: var(--shadow);
  animation: fadeIn 0.15s ease-out;
}

body.light .modal-dialog {
  background: #ffffff;
  border-color: #d0d7de;
}

.modal-dialog.modal-lg {
  width: 700px;
}

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

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 18px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--bg3);
  color: var(--text);
}

/* ------------------------------------------------------------
   TOAST
   ------------------------------------------------------------ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  max-width: 360px;
}

.toast-icon { font-size: 14px; flex-shrink: 0; }
.toast-msg { flex: 1; }

.toast-success { background: #059669; color: #fff; }
.toast-error   { background: #dc2626; color: #fff; }
.toast-info    { background: var(--accent); color: #fff; }
.toast-warning { background: #d97706; color: #fff; }

.toast-fade { opacity: 0; transition: opacity 0.5s ease; }

/* Popup Alert (prominent banner) */
.popup-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  animation: slideUp 0.3s ease-out;
  min-width: 300px;
  max-width: 400px;
  position: relative;
  border-left: 4px solid;
}

.popup-alert-success { background: #0f1f14; border-color: #22c55e; }
.popup-alert-error   { background: #1f0f0f; border-color: #ef4444; }
.popup-alert-warning { background: #1f1a0f; border-color: #f59e0b; }
.popup-alert-info    { background: #0f1626; border-color: #4d90e0; }

.popup-alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.popup-alert-body { flex: 1; min-width: 0; }
.popup-alert-title { font-weight: 700; font-size: 13px; color: #fff; margin-bottom: 3px; }
.popup-alert-msg { font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.4; }
.popup-alert-close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px; }
.popup-alert-close:hover { color: #fff; background: rgba(255,255,255,0.1); }
.popup-fade { opacity: 0; transition: opacity 0.5s ease; }

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* ------------------------------------------------------------
   DRAG & DROP
   ------------------------------------------------------------ */
.dragging {
  opacity: 0.5;
}

.drag-over {
  border: 2px dashed var(--accent);
  background: var(--accent-bg);
}

/* ------------------------------------------------------------
   LOADING — Spinner
   ------------------------------------------------------------ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ------------------------------------------------------------
   LOADING — Skeleton
   ------------------------------------------------------------ */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  height: 16px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* ------------------------------------------------------------
   LOADING OVERLAY
   ------------------------------------------------------------ */
.overlay-loading, .loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  flex-direction: column;
  gap: 16px;
}

.loading-box {
  text-align: center;
}

.loading-box h2 {
  font-size: 20px;
  margin: 16px 0 8px;
}

/* ------------------------------------------------------------
   EMPTY STATES
   ------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text2);
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

/* ------------------------------------------------------------
   COMMENTS
   ------------------------------------------------------------ */
.comment {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.comment-body {
  flex: 1;
}

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

.comment-author {
  font-weight: 600;
  font-size: 12px;
}

.comment-date {
  font-size: 11px;
  color: var(--text3);
}

.comment-text {
  font-size: 13px;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   ACTIVITY
   ------------------------------------------------------------ */
.activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text2);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

/* ------------------------------------------------------------
   TABS
   ------------------------------------------------------------ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ------------------------------------------------------------
   UTILITY CLASSES
   ------------------------------------------------------------ */
.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.gap-4 {
  gap: 4px;
}

.gap-6 {
  gap: 6px;
}

.gap-8 {
  gap: 8px;
}

.gap-10 {
  gap: 10px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.justify-between {
  justify-content: space-between;
}

.mb-4 {
  margin-bottom: 4px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.ml-auto {
  margin-left: auto;
}

.text-sm {
  font-size: 12px;
}

.text-xs {
  font-size: 11px;
}

.text-muted {
  color: var(--text2);
}

.sidebar-empty {
  color: #ffffff !important;
  font-size: 12px;
  padding: 4px 8px;
  margin: 0;
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.font-bold {
  font-weight: 700;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden, [hidden] {
  display: none !important;
}

.w-full {
  width: 100%;
}

.cursor-pointer {
  cursor: pointer;
}

/* ── HTML/CSS class aliases ─────────────────────────── */
.loading-content, .loading-box { text-align: center; }
.loading-title { font-size: 20px; margin: 16px 0 8px; font-weight: 700; }
.loading-msg { font-size: 13px; color: var(--text2); }
.error-overlay { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 500; }
.error-content { text-align: center; max-width: 400px; }
.error-icon { font-size: 48px; margin-bottom: 12px; }
.error-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.error-msg { font-size: 13px; color: var(--text2); margin-bottom: 16px; }
.app-container { display: flex; width: 100%; height: 100vh; overflow: hidden; }

/* ── Misc view styles ──────────────────────────────── */
.views-container { flex: 1; overflow-y: auto; padding: 20px; }
.view-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* ── Work Log Report ───────────────────────────────────── */
.wlr-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.wlr-filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.wlr-filter-group { display: flex; flex-direction: column; gap: 4px; }
.wlr-filter-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.wlr-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.wlr-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.wlr-card-icon { font-size: 24px; line-height: 1; }
.wlr-card-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.wlr-card-label { font-size: 12px; color: var(--text3); margin-top: 2px; }
.wlr-groupby-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.wlr-groupby-label { font-size: 12px; color: var(--text3); font-weight: 600; margin-right: 4px; }
.wlr-gb-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg2); color: var(--text2); font-size: 12px; cursor: pointer; transition: all .15s; }
.wlr-gb-btn:hover { border-color: var(--accent); color: var(--accent); }
.wlr-gb-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.wlr-content { }
.wlr-group { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.wlr-group-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg2); cursor: pointer; user-select: none; }
.wlr-group-header:hover { background: var(--bg3); }
.wlr-group-title { font-weight: 600; font-size: 14px; flex: 1; }
.wlr-group-meta { font-size: 12px; color: var(--text3); white-space: nowrap; }
.wlr-group-arrow { font-size: 11px; color: var(--text3); transition: transform .2s; }
.wlr-group.collapsed .wlr-group-arrow { transform: rotate(-90deg); }
.wlr-group.collapsed .wlr-group-body { display: none; }
.wlr-table { margin: 0; border-radius: 0; border: none; }
.wlr-table thead th { background: var(--bg3); }
@media (max-width: 900px) { .wlr-summary { grid-template-columns: repeat(2,1fr); } }

/* ── Pivot Table ────────────────────────────────────────── */
.wlr-pivot-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.wlr-pivot-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 12px; }
.wlr-pivot-table thead { position: sticky; top: 0; z-index: 2; }
.wlr-pivot-th { background: var(--bg3); color: var(--text2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; text-align: center; }
.wlr-pivot-label-col { position: sticky; left: 0; z-index: 3; text-align: left !important; min-width: 220px; max-width: 300px; }
.wlr-pivot-th.wlr-pivot-label-col { z-index: 4; }
.wlr-pivot-date-col { min-width: 72px; }
.wlr-pivot-total-col { min-width: 80px; background: var(--bg3); border-left: 2px solid var(--border); }
.wlr-pivot-td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: center; white-space: nowrap; }
.wlr-pivot-td.wlr-pivot-label-col { background: var(--bg2); text-align: left; border-right: 1px solid var(--border); }
.wlr-pivot-empty { color: var(--text3); font-size: 11px; }
.wlr-pivot-user-row .wlr-pivot-label-col { background: var(--bg3); }
.wlr-pivot-user-row td { border-top: 2px solid var(--border); }
.wlr-pivot-user-label { font-weight: 700; font-size: 13px; color: var(--text); }
.wlr-pivot-issue-label { padding-left: 24px !important; }
.wlr-pivot-issue-key { font-weight: 700; color: var(--accent); cursor: pointer; margin-right: 4px; font-size: 11px; }
.wlr-pivot-issue-key:hover { text-decoration: underline; }
.wlr-pivot-issue-title { color: var(--text2); font-size: 11px; }
.wlr-pivot-total-cell { font-weight: 700; background: var(--bg3); border-left: 2px solid var(--border); color: var(--accent); }
.wlr-pivot-footer-row td { border-top: 2px solid var(--border); background: var(--bg3); font-weight: 700; }
.wlr-pivot-footer-label { color: var(--text2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.wlr-pivot-grand-total { font-size: 14px; color: var(--accent); }
@media (max-width: 768px) { .wlr-pivot-label-col { min-width: 150px; max-width: 180px; } .wlr-pivot-issue-label { padding-left: 14px !important; } }

/* ── Timesheet flat table ───────────────────────────────── */
.wlr-sheet-summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; flex-wrap: wrap; font-size: 13px; }
.wlr-sheet-sep { color: var(--text3); }
.wlr-sheet-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.wlr-sheet-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wlr-sheet-th { background: var(--bg3); color: var(--text2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.wlr-sheet-th:hover { background: color-mix(in srgb, var(--accent) 8%, var(--bg3)); }
.wlr-sheet-num { text-align: center; }
.wlr-sheet-td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.wlr-sheet-row:hover td { background: var(--bg3); }
.wlr-sheet-row:nth-child(even) td { background: color-mix(in srgb, var(--bg3) 30%, transparent); }
.wlr-sheet-row:nth-child(even):hover td { background: var(--bg3); }
.wlr-sheet-total td { background: var(--bg3); border-top: 2px solid var(--border); }

/* ── Pivot info bar (Values zone drives output) ─────────── */
.wlr-pivot-info-bar { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 12px; color: var(--text2); background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.wlr-pivot-info-hint { color: var(--text3); font-size: 11px; margin-left: 6px; }
.wlr-pivot-info-warn { color: #e6a000; border-color: #e6a000; background: rgba(230,160,0,.08); }

/* ── Timesheet dual-section headers ────────────────────── */
.wlr-ts-section-hdr { padding: 10px 0 8px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.wlr-ts-section-title { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.wlr-ts-divider { display: flex; align-items: center; margin: 28px 0 14px; gap: 12px; }
.wlr-ts-divider::before, .wlr-ts-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.wlr-ts-divider-label { font-size: 13px; font-weight: 700; color: var(--text2); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.wlr-pivot-cell-both { vertical-align: middle; line-height: 1.3; padding: 4px 8px !important; }

/* ── Pivot Field List Panel ─────────────────────────────── */
.wlr-pp-overlay { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; display: flex; justify-content: flex-end; z-index: 500; pointer-events: none; }
.wlr-pp-dialog { pointer-events: all; width: 620px; max-width: 95vw; background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: -4px 0 24px rgba(0,0,0,.18); display: flex; flex-direction: column; height: fit-content; max-height: 90vh; margin: 12px 12px 12px 0; }
.wlr-pp-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg2); border-radius: var(--radius) var(--radius) 0 0; }
.wlr-pp-title { font-weight: 700; font-size: 14px; }
.wlr-pp-body { display: flex; flex: 1; overflow: hidden; min-height: 320px; }
.wlr-pp-left { width: 220px; min-width: 180px; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.wlr-pp-left-hdr { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); background: var(--bg3); }
.wlr-pivot-collapse-btn { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 700; border-radius: 3px; margin-right: 4px; user-select: none; }
.wlr-pivot-collapse-btn:hover { background: var(--accent-bg); }
.wlr-pp-field-list { overflow-y: auto; flex: 1; padding: 4px 0; }
.wlr-pp-field-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: grab; font-size: 13px; transition: background .12s; }
.wlr-pp-field-item:hover { background: var(--bg3); }
.wlr-pp-drag-handle { color: var(--text3); font-size: 14px; cursor: grab; }
.wlr-pp-field-label { flex: 1; color: var(--text2); }
.wlr-pp-field-used { color: var(--text); font-weight: 600; }
.wlr-pp-zones { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 0; overflow: hidden; }
.wlr-pp-zone { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; min-height: 120px; }
.wlr-pp-zone:nth-child(2n) { border-right: none; }
.wlr-pp-zone:nth-child(n+3) { border-bottom: none; }
.wlr-pp-zone-hdr { padding: 7px 10px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--bg2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.wlr-pp-zone-body { flex: 1; padding: 6px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.wlr-zone-placeholder { color: var(--text3); font-size: 12px; font-style: italic; margin: auto; text-align: center; padding: 8px; }
.wlr-zone-chip { display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; font-size: 12px; cursor: grab; user-select: none; }
.wlr-zone-chip-label { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wlr-zone-chip-arrow { color: var(--text3); font-size: 10px; }
.wlr-zone-chip-remove { color: var(--text3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.wlr-zone-chip-remove:hover { color: var(--danger); }
.wlr-zone-dragover { background: color-mix(in srgb, var(--accent) 8%, var(--bg2)) !important; outline: 2px dashed var(--accent); outline-offset: -2px; }
.wlr-pp-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg2); border-radius: 0 0 var(--radius) var(--radius); }
.wlr-pp-defer { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); cursor: pointer; }
.view-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; justify-content: space-between; }
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.home-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.home-column h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.home-spaces-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.card-list { display: flex; flex-direction: column; gap: 4px; }
.placeholder-text { color: var(--text2); font-size: 13px; }
.widgets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 24px; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Widget cards */
.widget-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.widget-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.widget-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border); }
.widget-list-item:last-child { border-bottom: none; }
.widget-list-item:hover { background: var(--bg3); }
.widget-list-item .issue-key { min-width: 56px; font-weight: 700; color: var(--accent); font-size: 12px; }
.widget-list-item .text-muted { margin-left: auto; font-size: 11px; white-space: nowrap; }
body.light .widget-card { background: #ffffff; border-color: #d0d7de; }

/* Subtask & Link items */
.subtask-progress { margin-bottom: 8px; }
.link-group { margin-bottom: 10px; }
.link-item:hover { border-color: var(--accent) !important; }
.link-search-item:hover { background: var(--bg4); }
body.light .link-item { background: #f7f8fa !important; }
body.light #linkDialogInline { background: #ffffff; }

/* Subtask indicators in backlog and board */
.backlog-row-subtask { padding-left: 28px !important; }
.backlog-row-subtask .issue-key { font-size: 10px; }
.board-card-subtask { border-left: 3px solid var(--purple) !important; }
.subtask-parent-ref {
  font-size: 10px;
  color: var(--text3);
  font-weight: 600;
  white-space: nowrap;
}

/* Parent breadcrumb for subtasks */
.drawer-parent-crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 2px;
  padding-bottom: 4px;
}
.drawer-crumb-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}
.drawer-crumb-link:hover { text-decoration: underline; }
.drawer-crumb-sep { color: var(--text3); margin: 0 2px; }
.drawer-crumb-icon { font-size: 13px; }
.drawer-topbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* Chart cards */
.chart-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.chart-title { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
body.light .chart-card { background: #ffffff; border-color: #d0d7de; }

/* Bar chart rows */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-label { font-size: 13px; font-weight: 600; min-width: 90px; color: var(--text); }
.bar-track { flex: 1; height: 24px; background: var(--bg3); border-radius: 4px; overflow: hidden; min-width: 100px; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; min-width: 2px; }
.bar-value { font-size: 13px; font-weight: 700; min-width: 30px; text-align: right; color: var(--text); }

/* Progress bar */
.progress-bar { height: 10px; background: var(--bg3); border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--success); border-radius: 5px; transition: width 0.3s ease; }
.table-container { overflow-x: auto; }
.filters-list { display: flex; flex-direction: column; gap: 8px; }
.backlog-content { display: flex; flex-direction: column; gap: 12px; }
.sprint-header { padding: 12px 0; }
.report-content { min-height: 300px; }
.calendar-header-label { font-size: 16px; font-weight: 700; min-width: 160px; text-align: center; }
.calendar-nav-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text); cursor: pointer; padding: 4px 10px; border-radius: var(--radius); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); cursor: pointer; padding: 6px 14px; border-radius: var(--radius); font-size: 12px; font-weight: 600; }
.btn-outline:hover { background: var(--bg3); }
.input-sm { padding: 5px 8px; font-size: 12px; max-width: 200px; }
.input-color { width: 60px; padding: 2px; height: 34px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; display: inline-flex; align-items: center; }
.badge-muted { background: var(--bg4); color: var(--text2); }
.badge-key { background: var(--accent-bg); color: var(--accent); font-weight: 700; }
.badge-type { }
.avatar-group { display: flex; margin-left: 8px; }
.avatar-group .avatar { margin-left: -4px; border: 2px solid var(--bg2); }
.space-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.space-header-left { display: flex; align-items: center; gap: 10px; }
.space-header-center { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.space-header-right { display: flex; align-items: center; gap: 8px; }
.space-icon { font-size: 24px; }
.space-name-title { font-size: 18px; font-weight: 700; }
body.light .space-header { background: #ffffff; border-bottom-color: #d0d7de; }
.sidebar-workspace-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.light .sidebar-workspace-name { color: #174F96; }
.sidebar-create-btn { width: calc(100% - 24px); margin: 8px 12px; }
.sidebar-search { margin: 4px 12px; }
.sidebar-search input { width: 100%; }
.sidebar-section-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 4px; }
.sidebar-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3); }
.sidebar-section-content { }
.sidebar-user-select { width: calc(100% - 40px); }
.sidebar-footer { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--border); margin-top: auto; }
body.light .sidebar-footer { border-top-color: rgba(255,255,255,0.15); }
body.light .sidebar-footer select { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.15); }
body.light .sidebar-section-label { color: rgba(255,255,255,0.5); }
body.light .sidebar-section-header .btn-icon { color: rgba(255,255,255,0.6); }
.sidebar-section-header .btn-icon:hover { background: rgba(255,255,255,0.12) !important; color: rgba(255,255,255,0.85) !important; }
.sidebar-collapse-toggle { font-size: 10px; }
.space-item { display: flex; align-items: center; gap: 8px; padding: 6px 16px; color: var(--text2); cursor: pointer; font-size: 13px; border-radius: 6px; margin: 1px 8px; transition: all .15s; }
.space-item:hover { background: var(--bg3); color: var(--text); }
.space-item.active { background: var(--accent-bg); color: var(--accent); }
body.light .space-item { color: rgba(255,255,255,0.75); }
body.light .space-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
body.light .space-item.active { background: rgba(255,255,255,0.2); color: #fff; }
.space-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.space-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-item-menu-btn { opacity: 0; margin-left: auto; flex-shrink: 0; width: 22px; height: 22px; font-size: 14px; border: none; background: transparent; color: var(--text2); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.space-item:hover .space-item-menu-btn { opacity: 1; }
.space-item-menu-btn:hover { background: var(--bg4); color: var(--text); }
body.light .space-item-menu-btn { color: rgba(255,255,255,0.5); }
body.light .space-item-menu-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.space-context-menu { position: fixed; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); min-width: 200px; z-index: 300; padding: 4px 0; }
.space-context-menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--text); }
.space-context-menu-item:hover { background: var(--bg3); }
.space-context-menu-item.danger { color: var(--danger); }
.space-context-menu-item.danger:hover { background: rgba(239,68,68,0.1); }
body.light .space-context-menu { background: #ffffff; border-color: #d0d7de; }
body.light .space-context-menu-item { color: #1f2328; }
body.light .space-context-menu-item:hover { background: #f7f8fa; }
body.light .space-context-menu-item.danger { color: #dc2626; }

/* Data table for People and Custom Fields */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text3); padding: 8px 12px; border-bottom: 2px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg3); }
body.light .data-table th { border-bottom-color: #d0d7de; }
body.light .data-table td { border-bottom-color: #eaeef2; }
body.light .data-table tr:hover td { background: #f7f8fa; }
.drawer-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text3); letter-spacing: 0.04em; margin-bottom: 4px; }
.drawer-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; outline: none; min-height: 28px; }
.drawer-title:focus { border-bottom: 2px solid var(--accent); }
.drawer-desc { min-height: 60px; padding: 8px; border-radius: var(--radius); border: 1px solid transparent; font-size: 13px; line-height: 1.6; outline: none; }
.drawer-desc:focus { border-color: var(--accent); background: var(--bg3); }
.drawer-desc:empty::before { content: attr(data-placeholder); color: var(--text3); }
.drawer-field-group { margin-bottom: 16px; }
.drawer-subtasks { }
.drawer-activity-section { margin-top: 20px; }
.drawer-comment-input { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.drawer-value { font-size: 13px; color: var(--text); }
.drawer-custom-fields { }
.drawer-meta { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.drawer-meta-item { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--text2); margin-bottom: 4px; }
.form-check { display: flex; align-items: center; gap: 6px; }
.form-check label { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 14px; height: 14px; }
.filter-conditions { margin-bottom: 8px; }
.modal-dialog-lg { width: 640px; }
.modal-dialog-sm { width: 380px; }
.topbar-notif-btn { position: relative; }
.activity-feed { display: flex; flex-direction: column; }

/* ------------------------------------------------------------
   SETTINGS SUB-TABS
   ------------------------------------------------------------ */
.settings-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.settings-tabs .tab-btn { background: transparent; border: none; padding: 10px 20px; font-size: 13px; font-weight: 600; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.settings-tabs .tab-btn:hover { color: var(--text); background: var(--bg3); }
.settings-tabs .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
body.light .settings-tabs { border-bottom-color: #d0d7de; }
body.light .settings-tabs .tab-btn { color: #57606a; }
body.light .settings-tabs .tab-btn:hover { color: #1f2328; background: #f7f8fa; }
body.light .settings-tabs .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.settings-section { max-width: 640px; }
.settings-section h3 { margin-bottom: 16px; font-size: 16px; }
.settings-section p { margin-bottom: 8px; font-size: 13px; color: var(--text); }
.settings-section p strong { color: var(--text2); min-width: 100px; display: inline-block; }
.settings-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ------------------------------------------------------------
   ADMIN SETTINGS LAYOUT (Jira-style)
   ------------------------------------------------------------ */
.admin-settings-layout { display: flex; height: 100%; min-height: calc(100vh - 56px); }
.admin-settings-nav { width: 220px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 24px 0; overflow-y: auto; }
.admin-settings-nav-title { font-size: 18px; font-weight: 700; color: var(--text); padding: 0 20px 20px; }
.admin-nav-group { margin-bottom: 20px; }
.admin-nav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); padding: 4px 20px 6px; }
.admin-nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 20px; font-size: 13px; color: var(--text2); cursor: pointer; text-decoration: none; border-left: 3px solid transparent; transition: all .12s; }
.admin-nav-item:hover { background: var(--bg3); color: var(--text); }
.admin-nav-item.active { background: var(--accent-bg); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
body.light .admin-settings-nav { border-right-color: #d0d7de; }
body.light .admin-nav-item { color: #57606a; }
body.light .admin-nav-item:hover { background: #f7f8fa; color: #1f2328; }
body.light .admin-nav-item.active { background: rgba(23,79,150,0.08); color: #174F96; border-left-color: #174F96; }

.admin-settings-content { flex: 1; padding: 32px 40px; overflow-y: auto; max-width: 900px; }
.admin-section-header { margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.admin-section-header h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.admin-section-header p { font-size: 13px; color: var(--text2); margin: 0; }
body.light .admin-section-header { border-bottom-color: #d0d7de; }

.admin-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.admin-card h3 { font-size: 14px; font-weight: 700; margin: 0 0 16px; color: var(--text); }
body.light .admin-card { background: #ffffff; border-color: #d0d7de; }

.admin-field-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.admin-field-row:last-child { border-bottom: none; padding-bottom: 0; }
.admin-field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-field-desc { font-size: 12px; color: var(--text3); margin-top: 2px; }
body.light .admin-field-row { border-bottom-color: #eaeef2; }
body.light .admin-field-label { color: #1f2328; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-stat-card { background: var(--bg3); border-radius: 8px; padding: 16px; text-align: center; }
.admin-stat-num { font-size: 28px; font-weight: 800; color: var(--accent); }
.admin-stat-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
body.light .admin-stat-card { background: #f7f8fa; }

.perm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.perm-table th { text-align: left; padding: 8px 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text3); border-bottom: 2px solid var(--border); }
.perm-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.perm-table tr:last-child td { border-bottom: none; }
.perm-check { color: #10b981; font-size: 16px; text-align: center; }
.perm-cross { color: var(--text3); font-size: 16px; text-align: center; }
body.light .perm-table th, body.light .perm-table td { border-color: #eaeef2; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--bg4); border-radius: 22px; cursor: pointer; transition: .2s; }
.toggle-slider:before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ------------------------------------------------------------
   SIDEBAR USER FOOTER (replaces user selector)
   ------------------------------------------------------------ */
.sidebar-user-footer { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
.user-footer-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-footer-text { min-width: 0; flex: 1; }
.user-footer-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-footer-role { font-size: 11px; color: var(--text3); }
.user-footer-actions { display: flex; gap: 4px; flex-shrink: 0; }
.user-avatar-sm { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
body.light .user-footer-name { color: rgba(255,255,255,0.95); }
body.light .user-footer-role { color: rgba(255,255,255,0.55); }
body.light .user-footer-actions .btn-icon { color: rgba(255,255,255,0.7); }
body.light .user-footer-actions .btn-icon:hover { color: #fff; background: rgba(255,255,255,0.15); }

/* Badge success */
.badge-success { background: rgba(16,185,129,0.15); color: #10b981; }

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --drawer-w: 100vw;
  }

  .sidebar {
    width: 0;
    overflow: hidden;
  }

  .board-columns {
    flex-wrap: wrap;
  }

  .board-col {
    min-width: 100%;
  }

  .form-row {
    flex-direction: column;
  }

  .drawer-body {
    flex-direction: column;
  }

  .drawer-main {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .drawer-sidebar {
    width: 100%;
  }
}

/* ── All Work: Jira-style Multi-Select Filters ─────────────────────── */
.aw-filter-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}

.aw-ms-wrap { position: relative; }

.aw-ms-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg2);
  color: var(--text1); cursor: pointer; font-size: 13px;
  white-space: nowrap; transition: border-color .15s, background .15s;
}
.aw-ms-btn:hover { border-color: var(--accent); background: var(--bg3); }
.aw-ms-btn.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg2)); }
.aw-ms-arrow { font-size: 10px; margin-left: 2px; color: var(--text3); }
.aw-ms-count {
  background: var(--accent); color: #fff;
  border-radius: 10px; padding: 1px 6px;
  font-size: 11px; font-weight: 600; min-width: 18px; text-align: center;
}

.aw-ms-panel {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 200px; max-height: 280px; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,.18);
  z-index: 9000; padding: 4px 0;
}
body.light .aw-ms-panel { box-shadow: 0 4px 20px rgba(0,0,0,.10); }

.aw-ms-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer; font-size: 13px;
  user-select: none; white-space: nowrap;
}
.aw-ms-option:hover { background: var(--bg3); }
.aw-ms-option input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); flex-shrink: 0; width: 14px; height: 14px; }

/* Date filter dropdown panel */
.aw-date-panel { min-width: 290px !important; overflow: visible !important; max-height: none !important; }
.aw-date-range { display: flex; align-items: center; gap: 6px; padding: 10px 12px; flex-wrap: wrap; }
.aw-date-range-label { font-size: 12px; color: var(--text3); font-weight: 500; white-space: nowrap; }
.aw-date-range-sep { color: var(--text3); }
.aw-date-range .input { width: 128px; font-size: 12px; padding: 4px 6px; }

/* ── Bulk Action Bar ─────────────────────────────────────── */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; background: color-mix(in srgb, var(--accent) 10%, var(--bg2));
  border-bottom: 2px solid var(--accent); animation: slideDown .15s ease-out;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.bulk-count { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.bulk-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bulk-actions .input { font-size: 12px; padding: 4px 8px; }
.bulk-deselect { margin-left: auto; color: var(--text3); background: none; border: none; font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: var(--radius); }
.bulk-deselect:hover { background: var(--bg3); color: var(--text1); }
.btn-ghost { background: none; border: 1px solid var(--border); }

/* Custom field inputs in issue drawer */
.drawer-cf-input .input { width: 100%; }
.cf-multiselect { display: flex; flex-direction: column; gap: 4px; padding: 2px 0; }
.cf-ms-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; padding: 2px 0; }
.cf-ms-opt input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   PRODUCT ROADMAP
   ═══════════════════════════════════════════════════════════ */
.prm-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--bg2); }
.prm-content { flex: 1; overflow: auto; padding: 16px 20px; }

/* Fullscreen mode */
.prm-fullscreen { position:fixed !important; inset:0; z-index:9990; display:flex; flex-direction:column; background:var(--bg); overflow:hidden; }
.prm-fullscreen .prm-header { flex-shrink:0; }
.prm-fullscreen .prm-content { flex:1; overflow:auto; }

/* Bar hover tooltip */
.prm-bar-tip { display:none; position:fixed; z-index:9999; background:var(--bg); border:1px solid var(--border); border-radius:10px; box-shadow:0 8px 32px rgba(0,0,0,.25); padding:14px 16px; width:280px; pointer-events:none; transition:none; }
.prm-tip-title { font-size:14px; font-weight:700; color:var(--text); margin-bottom:8px; line-height:1.4; word-break:break-word; }
.prm-tip-row { display:flex; align-items:center; gap:6px; margin-bottom:8px; flex-wrap:wrap; }
.prm-tip-chip { font-size:10px; font-weight:600; color:#fff; padding:2px 9px; border-radius:10px; text-transform:capitalize; }
.prm-tip-pri { font-size:10px; color:var(--text2); padding:2px 7px; border:1px solid var(--border); border-radius:10px; text-transform:capitalize; }
.prm-tip-desc { font-size:12px; color:var(--text2); line-height:1.55; margin-bottom:8px; max-height:80px; overflow:hidden; white-space:pre-wrap; }
.prm-tip-dates { font-size:11px; color:var(--text2); margin-bottom:4px; }
.prm-tip-who { font-size:11px; color:var(--text2); margin-bottom:6px; }
.prm-tip-hint { font-size:10px; color:var(--accent,#4d90e0); font-style:italic; margin-top:6px; border-top:1px solid var(--border); padding-top:6px; }
/* Arrow pointing down (tooltip above bar) */
.prm-tip-arrow { position:absolute; left:50%; transform:translateX(-50%); width:0; height:0; }
.prm-tip-arrow-dn { bottom:-8px; border-left:8px solid transparent; border-right:8px solid transparent; border-top:8px solid var(--border); }
.prm-tip-arrow-dn::after { content:''; position:absolute; left:-7px; top:-9px; border-left:7px solid transparent; border-right:7px solid transparent; border-top:7px solid var(--bg); }
/* Arrow pointing up (tooltip below bar) */
.prm-tip-arrow-up { top:-8px; border-left:8px solid transparent; border-right:8px solid transparent; border-bottom:8px solid var(--border); }
.prm-tip-arrow-up::after { content:''; position:absolute; left:-7px; top:1px; border-left:7px solid transparent; border-right:7px solid transparent; border-bottom:7px solid var(--bg); }
.prm-view-toggle { display: flex; gap: 4px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.prm-vt-btn { padding: 4px 12px; border: none; border-radius: calc(var(--radius) - 2px); background: none; color: var(--text2); font-size: 12px; cursor: pointer; transition: all .15s; }
.prm-vt-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.prm-badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; color: #fff; text-transform: capitalize; }
.prm-issue-key { font-weight: 700; color: var(--accent); font-size: 11px; }
.prm-status-dot { font-size: 10px; }
.prm-type-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: capitalize; background: var(--bg3); color: var(--text2); }
.prm-type-epic   { background: rgba(155,89,182,.15); color: #9b59b6; }
.prm-type-story  { background: rgba(52,152,219,.15);  color: #3498db; }
.prm-type-task   { background: rgba(46,204,113,.15);  color: #27ae60; }
.prm-type-bug    { background: rgba(231,76,60,.15);   color: #c0392b; }

/* List view */
.prm-list { display: flex; flex-direction: column; gap: 16px; }
.prm-list-group { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.prm-list-group-hdr { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 700; font-size: 13px; background: var(--bg3); border-bottom: 1px solid var(--border); cursor: pointer; }
.prm-list-count { font-size: 11px; color: var(--text3); font-weight: 400; }
.prm-list-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.prm-list-table th { padding: 7px 12px; background: var(--bg2); color: var(--text3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.prm-list-row { cursor: pointer; transition: background .1s; }
.prm-list-row:hover { background: var(--bg3); }
.prm-list-row td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.prm-list-row:last-child td { border-bottom: none; }
.prm-issue-title { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Timeline / Gantt view */
.prm-timeline-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); }
.prm-tl-header { display: flex; border-bottom: 2px solid var(--border); background: var(--bg3); position: sticky; top: 0; z-index: 5; }
.prm-tl-col-hdr { flex: 1; min-width: 80px; padding: 8px 6px; font-size: 11px; font-weight: 700; color: var(--text3); text-align: center; border-right: 1px solid var(--border); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.prm-tl-today-col { color: var(--accent); background: rgba(77,144,224,.06); }
.prm-tl-body { position: relative; }
.prm-tl-group-row { display: flex; background: var(--bg3); border-bottom: 1px solid var(--border); }
.prm-tl-group-label { font-weight: 700; font-size: 12px; padding: 8px 12px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.prm-tl-issue-row { display: flex; align-items: center; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.prm-tl-issue-row:hover { background: var(--bg3); }
.prm-tl-label { flex-shrink: 0; padding: 6px 10px; font-size: 12px; display: flex; align-items: center; gap: 5px; overflow: hidden; border-right: 1px solid var(--border); background: var(--bg2); }
.prm-tl-issue-title { color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.prm-tl-bar-track { flex: 1; position: relative; height: 32px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100%/var(--prm-cols, 7) - 1px), var(--border) calc(100%/var(--prm-cols,7) - 1px), var(--border) calc(100%/var(--prm-cols,7))); }
.prm-tl-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 18px; border-radius: 4px; opacity: .85; transition: opacity .15s; min-width: 4px; }
.prm-tl-bar:hover { opacity: 1; }
.prm-tl-no-date { position: absolute; left: 50%; transform: translateX(-50%); top: 50%; margin-top: -8px; font-size: 10px; color: var(--text3); white-space: nowrap; }
.prm-tl-today-marker { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger, #e74c3c); opacity: .7; pointer-events: none; z-index: 4; }
.prm-type-icon { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--text3); flex-shrink: 0; }
.prm-type-icon.prm-type-epic   { background: #9b59b6; border-radius: 50%; }
.prm-type-icon.prm-type-bug    { background: #e74c3c; }
.prm-type-icon.prm-type-story  { background: #3498db; }

/* ── PRM additional ─────────────────────────────────────── */
.prm-color-dot { display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0; }
.prm-status-chip { display:inline-block;padding:2px 8px;border-radius:10px;font-size:10px;font-weight:700;color:#fff; }
.prm-item-title { cursor:pointer;display:flex;align-items:center;gap:6px;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.prm-item-title:hover { color:var(--accent); }
.prm-del-btn { opacity:.4;font-size:13px; }
.prm-del-btn:hover { opacity:1; }
.prm-empty { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:60px 20px;color:var(--text3); }

/* Board view */
.prm-board { display:grid;grid-template-columns:repeat(4,1fr);gap:16px;padding:4px;align-items:start; }
@media(max-width:900px) { .prm-board { grid-template-columns:repeat(2,1fr); } }
.prm-board { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; align-items:start; }
.prm-board-col { background:var(--bg3); border-radius:10px; border:1px solid var(--border); display:flex; flex-direction:column; }
.prm-board-col-hdr { padding:12px 14px 10px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; border-radius:10px 10px 0 0; }
.prm-board-col-count { font-size:10px; font-weight:700; color:#fff; padding:1px 7px; border-radius:10px; }
.prm-board-col-body { padding:4px; flex:1; }
.prm-board-empty { padding:20px; text-align:center; font-size:12px; color:var(--text3); font-style:italic; }
.prm-board-card { margin:6px 4px; background:var(--bg2); border:1px solid var(--border); border-radius:8px; cursor:pointer; transition:box-shadow .15s,transform .1s; overflow:hidden; display:flex; }
.prm-board-card:hover { box-shadow:0 4px 14px rgba(0,0,0,.14); transform:translateY(-1px); }
.prm-bc-color-bar { width:4px; flex-shrink:0; }
.prm-bc-body { padding:10px 12px; flex:1; min-width:0; }
.prm-bc-title { font-size:12px; font-weight:700; color:var(--text); line-height:1.4; margin-bottom:4px; }
.prm-bc-desc { font-size:11px; color:var(--text2); line-height:1.5; margin-bottom:6px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.prm-bc-footer { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:4px; }
.prm-bc-space { font-size:10px; color:var(--text3); background:var(--bg3); padding:1px 6px; border-radius:6px; }
.prm-bc-avatar { font-size:9px; font-weight:700; color:#fff; background:var(--accent); border-radius:50%; width:20px; height:20px; display:flex; align-items:center; justify-content:center; margin-left:auto; flex-shrink:0; }
.prm-bc-dates { font-size:10px; color:var(--text3); margin-top:4px; }
.prm-board-add { width:calc(100% - 12px); margin:4px 6px 8px; padding:7px; border:1px dashed var(--border); border-radius:8px; background:none; color:var(--text3); cursor:pointer; font-size:12px; text-align:center; transition:all .15s; }
.prm-board-add:hover { border-color:var(--accent); color:var(--accent); background:rgba(77,144,224,.05); }

/* Timeline enhancements */
.prm-tl-bar-label { font-size:10px;color:#fff;padding:0 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:18px; }
.prm-tl-today-label { position:absolute;top:-18px;left:50%;transform:translateX(-50%);font-size:10px;color:var(--danger,#e74c3c);font-weight:700;white-space:nowrap; }

/* ── Swim-lane Gantt (Roadmunk-style) ─────────────────────── */
.prm-swimlane-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg2); }
.prm-sl-scroll { min-width:700px; }
.prm-sl-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.prm-sl-table th,.prm-sl-table td { border:1px solid var(--border); }

/* Header rows */
.prm-sl-yr-row th { background:var(--bg3); padding:5px 8px; font-size:12px; font-weight:800; color:var(--text); text-align:center; }
.prm-sl-corner-top { width:192px; background:var(--bg3) !important; }
.prm-sl-year-th { background:var(--accent) !important; color:#fff !important; letter-spacing:.04em; }

.prm-sl-qtr-row th { background:var(--bg3); padding:6px 8px; font-size:11px; font-weight:700; color:var(--text2); text-align:center; white-space:nowrap; }
.prm-sl-hdr-group { width:52px; min-width:52px; color:var(--text3) !important; font-size:10px !important; }
.prm-sl-hdr-cat { width:140px; min-width:140px; text-align:left !important; padding-left:12px !important; color:var(--text3) !important; font-size:10px !important; }
.prm-sl-hdr-q { min-width:210px; text-transform:uppercase; letter-spacing:.05em; }
.prm-sl-q-active { color:var(--accent) !important; background:rgba(77,144,224,.07) !important; }

/* Month header row */
.prm-sl-mo-row th { background:var(--bg2); padding:4px 2px; font-size:10px; font-weight:600; color:var(--text2); text-align:center; border-bottom:2px solid var(--border); white-space:nowrap; }
.prm-sl-hdr-mo { min-width:70px; width:70px; }
.prm-sl-mo-active { color:var(--accent,#4d90e0) !important; font-weight:800 !important; background:rgba(77,144,224,.06) !important; }

/* Body rows */
.prm-sl-body-row { background:var(--bg2); }
.prm-sl-body-row:hover { background:var(--bg3); }

/* Group cell — colored left column */
.prm-sl-group-td { vertical-align:middle; padding:8px 4px; width:52px; min-width:52px; max-width:52px; }
.prm-sl-group-txt { display:block; writing-mode:vertical-rl; text-orientation:mixed; transform:rotate(180deg); font-size:10px; font-weight:800; color:var(--text); letter-spacing:.1em; white-space:nowrap; text-align:center; line-height:1; padding:6px 0; }

/* Category cell */
.prm-sl-cat-td { width:160px; min-width:160px; max-width:160px; padding:0; font-size:12px; font-weight:600; color:var(--text2); vertical-align:top; }
.prm-sl-cat-inner { padding:6px 10px; display:flex; flex-direction:column; justify-content:flex-start; }
.prm-sl-cat-label { font-size:11px; font-weight:600; color:var(--text); padding:4px 0 2px; display:flex; align-items:center; gap:4px; }
.prm-sl-cat-label .prm-sl-color-hint { opacity:0; transition:opacity .15s; }
.prm-sl-cat-label:hover .prm-sl-color-hint { opacity:.8; }
.prm-sl-item-dot { display:flex; align-items:center; justify-content:flex-end; height:30px; cursor:pointer; }
.prm-sl-dot-icon { opacity:0; font-size:11px; color:var(--accent,#4d90e0); padding:2px 4px; border-radius:3px; transition:opacity .15s; }
.prm-sl-item-dot:hover .prm-sl-dot-icon { opacity:1; background:rgba(77,144,224,.12); }
.prm-edit-btn { opacity:.5; background:none; border:none; font-size:13px; cursor:pointer; padding:2px 5px; border-radius:3px; transition:opacity .15s; }
.prm-edit-btn:hover { opacity:1; background:var(--bg3); }

/* Timeline cell */
.prm-sl-tl-td { position:relative; padding:0; vertical-align:top; min-width:130px; }
.prm-sl-tl-active { background:rgba(77,144,224,.04) !important; }
.prm-sl-lane { position:relative; width:100%; }

/* Single spanning timeline cell */
.prm-sl-tl-all { position:relative; padding:0; vertical-align:top; }
.prm-sl-cur-mo-bg { position:absolute; top:0; bottom:0; background:rgba(77,144,224,.06); pointer-events:none; z-index:0; }
.prm-sl-mo-div { position:absolute; top:0; bottom:0; width:1px; background:var(--border); opacity:.6; pointer-events:none; z-index:0; }

/* Bars */
/* Bar wrapper (holds bar + optional external label) */
.prm-sl-bar-wrap { position:absolute; display:flex; align-items:center; pointer-events:none; z-index:2; }
.prm-sl-bar-wrap:hover { z-index:10; }
.prm-sl-bar { height:20px; border-radius:4px; cursor:pointer; opacity:.88; transition:opacity .15s,box-shadow .15s; min-width:4px; pointer-events:all; flex-shrink:0; }
.prm-sl-bar:hover { opacity:1; box-shadow:0 2px 10px rgba(0,0,0,.25); }
/* Label always shown to the right of the bar */
.prm-sl-bar-ext-lbl { font-size:11px; font-weight:600; color:var(--text); white-space:nowrap; padding-left:6px; pointer-events:none; overflow:hidden; text-overflow:ellipsis; max-width:200px; }

/* Milestone diamond */
.prm-sl-milestone { position:absolute; font-size:16px; transform:translateX(-50%); cursor:pointer; z-index:2; line-height:1; }
.prm-sl-milestone:hover { transform:translateX(-50%) scale(1.3); }

/* Today line */
.prm-sl-today { position:absolute; top:0; bottom:0; width:2px; background:var(--danger,#e74c3c); opacity:.75; z-index:3; pointer-events:none; }

/* Group color hint icon */
.prm-sl-color-hint { display:block; font-size:12px; text-align:center; margin-top:4px; opacity:0; transition:opacity .15s; cursor:pointer; }
.prm-sl-group-td:hover .prm-sl-color-hint { opacity:.8; }


/* Color picker popup */
.prm-color-popup { position:absolute; z-index:9999; background:var(--bg); border:1px solid var(--border); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.18); padding:12px; width:232px; }
.prm-color-popup-title { font-size:11px; font-weight:700; color:var(--text2); margin-bottom:8px; text-transform:uppercase; letter-spacing:.05em; }
.prm-color-swatches { display:flex; flex-wrap:wrap; gap:5px; }
.prm-color-sw { display:inline-block; width:24px; height:24px; border-radius:4px; cursor:pointer; border:2px solid transparent; transition:transform .1s,border-color .1s; }
.prm-color-sw:hover { transform:scale(1.2); }
.prm-color-sw.active { border-color:#fff; box-shadow:0 0 0 2px var(--accent,#4d90e0); }
