@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* =============================================================
   JIRA CLONE — Design System (Premium Overhaul)
   Single source of truth. No duplicates.
   ============================================================= */

/* ── Design tokens ──────────────────────────────────────────── */
:root {
  /* HSL Tailored Tokens (Light Theme) */
  --c-primary: hsl(255, 70%, 60%);
  --c-primary-h: hsl(255, 75%, 52%);
  --c-primary-container: hsl(255, 80%, 96%);
  --c-on-primary-container: hsl(255, 70%, 25%);
  --c-success: hsl(185, 85%, 45%);
  --c-danger: hsl(354, 70%, 54%);
  --c-warning: hsl(35, 90%, 50%);
  --c-purple: hsl(270, 75%, 60%);

  --text-hi: hsl(222, 47%, 12%);
  --text-med: hsl(215, 25%, 35%);
  --text-lo: hsl(215, 16%, 50%);

  --bd: hsla(215, 20%, 80%, 0.35);
  --border-glow: hsla(255, 70%, 60%, 0.15);
  --bg-page: hsl(210, 30%, 98%);
  --bg-surf: hsl(0, 0%, 100%);
  --bg-sunken: hsl(210, 20%, 94%);
  --bg-raised: hsl(210, 16%, 90%);
  --bg-glass: rgba(255, 255, 255, 0.7);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 100px;

  --nav-h: 64px;
  --sb-w: 280px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-drop: 0 20px 40px -15px rgba(25, 28, 50, 0.08), 0 1px 4px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 40px -10px hsla(255, 70%, 60%, 0.2);
}


/* ── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-hi);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

button {
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font);
}

input,
select,
textarea {
  font-family: var(--font);
}

/* ── Top Nav ────────────────────────────────────────────────── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg-surf);
  color: var(--text-hi);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 0;
  z-index: 300;
  border-bottom: 1px solid var(--bd);
  box-shadow: none;
}

/* Logo */
.header-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-hi) !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: opacity .15s;
}

.header-logo:hover {
  opacity: 0.85;
  text-decoration: none;
}

.header-logo-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-success));
  color: white !important;
  border-radius: var(--r-sm);
  box-shadow: 0 4px 10px rgba(103, 80, 164, 0.35);
  flex-shrink: 0;
}

.header-logo-icon {
  width: 18px;
  height: 18px;
  color: white !important;
  display: block;
}

/* Search + Create (center area) */
.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  min-width: 0;
  justify-content: center;
}

.search-bar {
  width: 100%;
  max-width: 480px;
  min-width: 140px;
  height: 40px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--bd);
  border-radius: var(--r-full);
  background: var(--bg-sunken);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
  color: var(--text-hi);
  font-size: 14px;
  outline: none;
  transition: background .15s, box-shadow .15s, border-color .15s;
}

.search-bar::placeholder {
  color: var(--text-lo);
}

.search-bar:focus {
  background-color: var(--bg-surf);
  color: var(--text-hi);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230b57d0' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

.search-bar:focus::placeholder {
  color: var(--text-lo);
}

/* Create button */
.create-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-h));
  color: #fff;
  border: 0;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: opacity .15s, transform .15s, box-shadow .15s;
}

.create-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* Right icon buttons */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 4px;
}

.notification-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-med);
  cursor: pointer;
  position: relative;
  transition: background .12s;
  outline: none;
}

.notification-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-hi);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--c-danger);
  color: #fff;
  border-radius: 50%;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.profile-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ff5630;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color .12s;
}

.profile-btn:hover {
  border-color: rgba(0, 0, 0, 0.1);
}

/* Hamburger (mobile) */
.hamburger-btn {
  display: none;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 0;
  color: var(--text-hi);
  cursor: pointer;
  border-radius: 50%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

.hamburger-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ── App Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
  overflow: hidden;
}

/* ── Sidebar (M3 Navigation Drawer Overhaul) ────────────────── */
.sidebar {
  width: var(--sb-w);
  min-width: var(--sb-w);
  background: var(--bg-surf);
  border-right: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  padding: 16px 0;
  transition: transform .22s cubic-bezier(0.2, 0, 0, 1), background-color 0.2s;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 16px 24px 6px;
}

.sidebar-nav-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.sidebar-nav-item {
  margin: 2px 12px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-med);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-full);
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sidebar-nav-link:hover {
  background: var(--bg-sunken);
  color: var(--text-hi);
}

.sidebar-nav-link.active {
  background: var(--c-primary-container);
  color: var(--c-on-primary-container);
  font-weight: 600;
}

.project-list {
  list-style: none;
  padding: 4px 0;
}

.project-list li {
  margin: 4px 12px;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-med);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--r-full);
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list li:hover {
  background: var(--bg-sunken);
  color: var(--text-hi);
}

.project-list li.active {
  background: var(--c-primary-container);
  color: var(--c-on-primary-container);
  font-weight: 600;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-lo);
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-hi);
}

html.dark .btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg-page);
}

#dynamic-content-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ── Dashboard Tabs ─────────────────────────────────────────── */
.dashboard-tabs {
  display: flex;
  align-items: center;
  background: var(--bg-surf);
  border-bottom: 1px solid var(--bd);
  padding: 12px 24px;
  flex-shrink: 0;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.dashboard-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-med);
  text-decoration: none;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
  border: 1px solid transparent;
}

.dashboard-tab:hover {
  background: var(--bg-sunken);
  color: var(--text-hi);
  text-decoration: none;
}

.dashboard-tab.active {
  background: var(--c-primary-container);
  color: var(--c-on-primary-container);
  font-weight: 600;
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

/* ── Filter Bar ─────────────────────────────────────────────── */
#filters-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-surf);
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
  flex-wrap: wrap;
}

#filters-container button,
#filters-container select,
#filters-container .btn-secondary {
  -webkit-appearance: none;
  appearance: none;
  height: 32px;
  padding: 0 16px;
  border: 1px solid var(--bd);
  border-radius: var(--r-full);
  background: var(--bg-surf);
  color: var(--text-med);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  outline: none;
}

#filters-container button:hover,
#filters-container select:hover {
  background: var(--bg-sunken);
  border-color: var(--text-lo);
  color: var(--text-hi);
}

#filters-container button.active {
  background: var(--c-primary-container);
  border-color: transparent;
  color: var(--c-on-primary-container);
  font-weight: 600;
}

/* ── Board ──────────────────────────────────────────────────── */
.board-container {
  display: flex;
  gap: 16px;
  padding: 20px;
  overflow-x: auto;
  align-items: flex-start;
  height: 100%;
  background: var(--bg-page);
}

.column {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--r-lg);
  width: 290px;
  min-width: 290px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--nav-h) - 120px);
  border: 1px solid var(--bd);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.column-header {
  padding: 16px 16px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-header-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-med);
  text-transform: uppercase;
  letter-spacing: .08em;
  flex: 1;
}

.wip-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-med);
  background: var(--bg-raised);
  border-radius: var(--r-full);
  padding: 2px 8px;
  border: 1px solid var(--bd);
}

.wip-badge.over {
  background: var(--c-danger);
  color: #fff;
  border-color: transparent;
}

.ticket-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px 10px;
  min-height: 80px;
}

/* ── Ticket Card ────────────────────────────────────────────── */
.ticket-card {
  background: var(--bg-surf);
  border-radius: var(--r-md);
  padding: 16px;
  border: 1px solid var(--bd);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.ticket-card.has-epic {
  padding-left: 18px;
}

.epic-color-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-top-left-radius: var(--r-md);
  border-bottom-left-radius: var(--r-md);
}

.epic-label-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.ticket-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-hi);
  margin-bottom: 10px;
  line-height: 1.4;
}

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

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

.sortable-ghost {
  opacity: .35;
  background: var(--c-primary-container);
  border: 2px dashed var(--c-primary);
  border-radius: var(--r-lg);
}

/* ── Board Assignee Avatar Filter ───────────────────────────── */
.board-avatars-group {
  display: flex;
  align-items: center;
  margin-right: 12px;
}

.board-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dfe1e6;
  color: var(--text-hi);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surf);
  cursor: pointer;
  user-select: none;
  transition: all .12s ease-in-out;
  margin-left: -8px;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}

.board-avatar:first-child {
  margin-left: 0;
}

.board-avatar:hover {
  transform: translateY(-2px);
  z-index: 10;
  box-shadow: var(--shadow-card);
}

.board-avatar.active {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(11, 87, 208, 0.3), 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  z-index: 10;
}

/* ── Assignee Avatar ────────────────────────────────────────── */
.assignee {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e1e3e1;
  color: var(--text-med);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Priority / Type Badges ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-full);
}

.badge-critical,
.badge-highest {
  background: #ffd2cc;
  color: #ae2a19;
}

.badge-high {
  background: #fee4d7;
  color: #c9341c;
}

.badge-medium {
  background: #fff7d6;
  color: #974f0c;
}

.badge-low {
  background: #e3fcef;
  color: #216e4e;
}

.badge-lowest {
  background: #f4f5f7;
  color: #5e6c84;
}

.due-badge {
  background: #f1f3f4;
  color: var(--text-lo);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-full);
}

.due-badge.overdue {
  background: #ffd2cc;
  color: #ae2a19;
}

.sp-badge {
  background: #e8def8;
  color: #4f378b;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.priority-badge {
  font-size: 12px;
  font-weight: 600;
}

/* ── Backlog ────────────────────────────────────────────────── */
.sprint-container {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  background: var(--bg-page);
}

.sprint-box {
  background: var(--bg-surf);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sprint-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--bd);
}

.sprint-header-bar h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-hi);
  margin: 0;
}

.sprint-meta {
  font-size: 12px;
  color: var(--text-lo);
  margin-left: 8px;
  font-weight: 400;
}

.sprint-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sprint-actions button {
  background: var(--bg-surf);
  border: 1px solid var(--bd);
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-med);
  cursor: pointer;
  transition: all .12s;
}

.sprint-actions button:hover {
  background: var(--bg-sunken);
  border-color: var(--text-lo);
}

.sprint-actions button.btn-primary {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

.sprint-actions button.btn-primary:hover {
  background: var(--c-primary-h);
}

.icon-btn {
  background: transparent !important;
  border: none !important;
  font-size: 14px;
  padding: 6px 8px !important;
  cursor: pointer;
  border-radius: var(--r-full);
  color: var(--text-lo);
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--text-hi);
}

.sprint-list {
  min-height: 60px;
  padding: 10px 14px 14px;
  transition: background .15s;
}

.sprint-list.drag-over {
  background: #d3e3fd;
  outline: 2px dashed var(--c-primary);
  outline-offset: -4px;
}

.sprint-list-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-lo);
  font-size: 13px;
  border: 2px dashed var(--bd);
  border-radius: var(--r-md);
  margin: 8px 0;
}

.backlog-ticket {
  background: var(--bg-surf);
  border: 1px solid var(--bd);
  padding: 10px 16px;
  margin-bottom: 6px;
  border-radius: var(--r-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  user-select: none;
  transition: box-shadow .15s, border-color .15s;
}

.backlog-ticket:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-card);
}

.backlog-ticket.dragging {
  opacity: .45;
}

.ticket-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.ticket-id {
  color: var(--text-lo);
  font-size: 12px;
  white-space: nowrap;
}

.ticket-title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--c-primary);
  color: #fff;
  border: 0;
  padding: 10px 24px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .12s, box-shadow .12s;
}

.btn-primary:hover {
  background: var(--c-primary-h);
  box-shadow: var(--shadow-card);
}

.btn-secondary {
  background: var(--bg-surf);
  color: var(--text-med);
  border: 1px solid var(--bd);
  padding: 9px 22px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-secondary:hover {
  background: var(--bg-sunken);
  border-color: var(--text-lo);
  color: var(--text-hi);
  text-decoration: none;
}

.btn-danger {
  background: var(--c-danger);
  color: #fff;
  border: 0;
  padding: 10px 24px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .12s, box-shadow .12s;
}

.btn-danger:hover {
  background: #8c1d18;
  box-shadow: var(--shadow-card);
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-med);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text-hi);
  background: var(--bg-surf);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 1px var(--c-primary);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: var(--bg-surf);
  border-radius: var(--r-xl);
  padding: 32px;
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-drop);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-hi);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-lo);
  padding: 6px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ── Auth Pages ─────────────────────────────────────────────── */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-page);
}

.auth-card {
  background: var(--bg-surf);
  padding: 48px 40px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-drop);
  width: 420px;
  max-width: 100%;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--c-primary);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-lo);
}

.auth-links a {
  color: var(--c-primary);
  font-weight: 600;
}

/* ── Notifications Pane ─────────────────────────────────────── */
.notifications-pane {
  position: fixed;
  top: calc(var(--nav-h) + 8px);
  right: 16px;
  width: 360px;
  background: var(--bg-surf);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-drop);
  z-index: 400;
  display: none;
  overflow: hidden;
}

.notifications-pane.show {
  display: block;
}

.notifications-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bd);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-hi);
}

.clear-btn {
  background: none;
  border: none;
  color: var(--c-primary);
  font-size: 13px;
  cursor: pointer;
}

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

.notifications-list {
  max-height: 340px;
  overflow-y: auto;
  list-style: none;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-sunken);
  font-size: 13px;
  cursor: pointer;
}

.notification-item:hover {
  background: var(--bg-sunken);
}

.notification-time {
  font-size: 11px;
  color: var(--text-lo);
  margin-top: 4px;
}

/* ── Ticket Detail ──────────────────────────────────────────── */
.ticket-detail-container {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 24px;
}

.ticket-status-badge {
  background: var(--bg-sunken);
  color: var(--text-med);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ticket-status-badge.in_progress {
  background: #deebff;
  color: var(--c-primary);
}

.ticket-status-badge.done {
  background: #e3fcef;
  color: var(--c-success);
}

.tabs-header {
  display: flex;
  border-bottom: 2px solid var(--bd);
  margin-bottom: 20px;
  margin-top: 24px;
}

.tab-btn {
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-lo);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.comment-box {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg-sunken);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.history-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-sunken);
  font-size: 13px;
}

.history-meta {
  color: var(--text-lo);
  font-size: 12px;
  margin-top: 3px;
}

/* ── Settings ───────────────────────────────────────────────── */
.settings-layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
}

.settings-sidebar {
  width: var(--sb-w);
  background: var(--bg-sunken);
  border-right: 1px solid var(--bd);
  padding-top: 16px;
  flex-shrink: 0;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 16px 8px;
}

.settings-nav {
  list-style: none;
}

.settings-nav li {
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text-med);
  cursor: pointer;
  border-right: 3px solid transparent;
}

.settings-nav li:hover {
  background: rgba(9, 30, 66, .06);
}

.settings-nav li.active {
  background: #deebff;
  color: var(--c-primary);
  font-weight: 600;
  border-right-color: var(--c-primary);
}

.settings-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-surf);
}

/* ── JQL Bar ────────────────────────────────────────────────── */
.jql-bar {
  width: 100%;
  margin-bottom: 16px;
  padding: 9px 12px;
  border: 2px solid var(--bd);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-sunken);
  color: var(--text-hi);
  transition: border-color .15s, background .15s;
}

.jql-bar:focus {
  background: var(--bg-surf);
  border-color: var(--c-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 82, 204, .18);
}

/* ── Search Dropdown ────────────────────────────────────────── */
.search-dropdown {
  position: fixed;
  top: calc(var(--nav-h) + 4px);
  background: var(--bg-surf);
  border: 1px solid var(--bd);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-drop);
  width: 420px;
  z-index: 400;
  display: none;
  overflow: hidden;
}

.search-dropdown.show {
  display: block;
}

.search-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-hi);
  border-bottom: 1px solid var(--bg-sunken);
}

.search-dropdown-item:hover {
  background: var(--bg-sunken);
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-result-type {
  font-size: 11px;
  color: var(--text-lo);
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Swimlane ───────────────────────────────────────────────── */
.board-container.swimlane-mode {
  display: block;
  overflow: auto;
  height: 100%;
  padding: 16px;
}

.swimlane-board {
  min-width: max-content;
}

.swimlane-col-headers {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-page);
  padding-bottom: 4px;
}

.swimlane-epic-header-spacer {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
}

.swimlane-status-header {
  flex: 1;
  min-width: 240px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 11px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #ebecf0;
  border-radius: var(--r-sm);
  margin: 0 4px;
}

.swimlane-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 4px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-surf);
  transition: all 0.15s ease;
}

.swimlane-row.collapsed {
  align-items: center;
}

.swimlane-row.collapsed .swimlane-cell {
  display: none;
}

.swimlane-epic-label {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid var(--bd);
  background: var(--bg-sunken);
  cursor: pointer;
  user-select: none;
}

.swimlane-chevron {
  display: inline-block;
  font-size: 9px;
  color: var(--text-lo);
  transition: transform 0.15s ease;
  margin-right: 6px;
}

.swimlane-row.collapsed .swimlane-chevron {
  transform: rotate(-90deg);
}

.sl-epic-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

.sl-mini-progress-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sl-mini-progress-bg {
  flex: 1;
  height: 4px;
  background: var(--bd);
  border-radius: 2px;
  overflow: hidden;
}

.sl-mini-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s;
}

.sl-mini-progress-label {
  font-size: 11px;
  color: var(--text-lo);
  white-space: nowrap;
}

.swimlane-cell {
  flex: 1;
  min-width: 240px;
  min-height: 80px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--bg-sunken);
}

.swimlane-cell:last-child {
  border-right: none;
}

/* ── Status/Priority drag ───────────────────────────────────── */
.status-item {
  cursor: grab;
  transition: background .2s;
}

.status-item:active {
  cursor: grabbing;
}

.drag-handle {
  color: #8993a4;
  margin-right: 12px;
  font-size: 16px;
  cursor: grab;
}

/* ── Sprint calendar ────────────────────────────────────────── */
.cal-day {
  min-height: 90px;
  border-right: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  padding: 6px;
  cursor: pointer;
  transition: background .1s;
}

.cal-day:hover {
  background: var(--bg-sunken);
}

.cal-day.today {
  background: #e9f2ff;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-lo);
  margin-bottom: 4px;
}

.cal-ticket-chip {
  font-size: 11px;
  background: #deebff;
  color: var(--c-primary);
  border-radius: 2px;
  padding: 1px 5px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cal-ticket-chip:hover {
  background: #b3d4ff;
}

/* ── Misc ───────────────────────────────────────────────────── */
.chevron {
  font-size: 10px;
  opacity: .7;
}

.empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-lo);
  font-size: 13px;
}

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

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bd);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}

.label-chip {
  background: #e9f2ff;
  color: var(--c-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

.type-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-med);
  background: var(--bg-sunken);
  padding: 2px 6px;
  border-radius: 2px;
}

.release-badge {
  background: #e3fcef;
  color: var(--c-success);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.time-bar-wrap {
  background: var(--bd);
  border-radius: 2px;
  height: 6px;
  overflow: hidden;
}

.time-bar-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: 2px;
}

#page-loading {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.add-card-btn {
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-lo);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.add-card-btn:hover {
  background: rgba(9, 30, 66, .08);
  color: var(--text-med);
}

.avatar-group {
  display: flex;
}

.avatar-group .assignee {
  border: 2px solid #fff;
  margin-left: -6px;
}

.avatar-group .assignee:first-child {
  margin-left: 0;
}

.editable-field {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  transition: background .1s;
}

.editable-field:hover {
  background: var(--bg-sunken);
}

.sprint-burndown-chart {
  width: 100%;
}

/* ── Mobile responsive sidebar overlay ─────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 30, 66, .5);
  z-index: 290;
}

.sidebar-overlay.show {
  display: block;
}

/* ── Dark Mode ──────────────────────────────────────────────── */
html.dark {
  /* HSL Tailored Tokens (Dark Theme) */
  --c-primary: hsl(255, 80%, 68%);
  --c-primary-h: hsl(255, 85%, 75%);
  --c-primary-container: hsla(255, 80%, 68%, 0.12);
  --c-on-primary-container: hsl(255, 80%, 90%);

  --bd: hsla(217, 30%, 80%, 0.08);
  --border-glow: hsla(255, 80%, 68%, 0.2);
  --bg-page: hsl(224, 71%, 4%);
  --bg-surf: hsl(222, 47%, 9%);
  --bg-sunken: hsl(222, 40%, 6%);
  --bg-raised: hsl(222, 35%, 12%);
  --bg-glass: rgba(10, 12, 30, 0.75);

  --text-hi: hsl(210, 40%, 98%);
  --text-med: hsl(217, 30%, 82%);
  --text-lo: hsl(215, 20%, 65%);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-drop: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 1px 5px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 50px -12px hsla(255, 80%, 68%, 0.3);
}

.ticket-status-badge {
  background: var(--bg-sunken);
  color: var(--text-med);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

.ticket-status-badge.in_progress {
  background: #d3e3fd;
  color: #041e49;
}

.ticket-status-badge.done {
  background: #e3fcef;
  color: #137333;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--bd);
  margin-bottom: 20px;
  margin-top: 24px;
}

.tab-btn {
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-lo);
  font-weight: 500;
  font-size: 13px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  transition: color .15s;
}

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

.tab-btn.active {
  color: var(--c-primary);
  font-weight: 600;
  border-bottom-color: var(--c-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.comment-box {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg-sunken);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-med);
}

.history-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-sunken);
  font-size: 13px;
}

.history-meta {
  color: var(--text-lo);
  font-size: 12px;
  margin-top: 4px;
}

/* ── Settings ───────────────────────────────────────────────── */
.settings-layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
}

.settings-sidebar {
  width: var(--sb-w);
  background: var(--bg-surf);
  border-right: 1px solid var(--bd);
  padding-top: 16px;
  flex-shrink: 0;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 16px 8px;
}

.settings-nav {
  list-style: none;
  padding: 4px 0;
}

.settings-nav li {
  margin: 4px 12px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-med);
  cursor: pointer;
  border-radius: var(--r-full);
  transition: background .15s, color .15s;
}

.settings-nav li:hover {
  background: var(--bg-sunken);
  color: var(--text-hi);
}

.settings-nav li.active {
  background: #d3e3fd;
  color: #041e49;
  font-weight: 600;
}

.settings-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-surf);
}

/* ── JQL Bar ────────────────────────────────────────────────── */
.jql-bar {
  width: 100%;
  margin-bottom: 20px;
  padding: 10px 14px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-sunken);
  color: var(--text-hi);
  transition: border-color .15s, background .15s, box-shadow .15s;
  outline: none;
}

.jql-bar:focus {
  background: var(--bg-surf);
  border-color: var(--c-primary);
  box-shadow: 0 0 0 1px var(--c-primary);
}

/* ── Search Dropdown ────────────────────────────────────────── */
.search-dropdown {
  position: fixed;
  top: calc(var(--nav-h) + 6px);
  background: var(--bg-surf);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-drop);
  width: 440px;
  z-index: 400;
  display: none;
  overflow: hidden;
}

.search-dropdown.show {
  display: block;
}

.search-dropdown-item {
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-hi);
  border-bottom: 1px solid var(--bg-sunken);
}

.search-dropdown-item:hover {
  background: var(--bg-sunken);
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-result-type {
  font-size: 11px;
  color: var(--text-lo);
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Swimlane ───────────────────────────────────────────────── */
.board-container.swimlane-mode {
  display: block;
  overflow: auto;
  height: 100%;
  padding: 20px;
}

.swimlane-board {
  min-width: max-content;
}

.swimlane-col-headers {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-page);
  padding-bottom: 6px;
}

.swimlane-epic-header-spacer {
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
}

.swimlane-status-header {
  flex: 1;
  min-width: 250px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 11px;
  color: var(--text-med);
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--bg-sunken);
  border-radius: var(--r-md);
  margin: 0 6px;
}

.swimlane-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 8px;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-surf);
  transition: all 0.15s ease;
}

.swimlane-row.collapsed {
  align-items: center;
}

.swimlane-row.collapsed .swimlane-cell {
  display: none;
}

.swimlane-epic-label {
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  border-right: 1px solid var(--bd);
  background: var(--bg-sunken);
  cursor: pointer;
  user-select: none;
}

.swimlane-chevron {
  display: inline-block;
  font-size: 10px;
  color: var(--text-lo);
  transition: transform 0.15s ease;
  margin-right: 8px;
}

.swimlane-row.collapsed .swimlane-chevron {
  transform: rotate(-90deg);
}

.sl-epic-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

.sl-mini-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sl-mini-progress-bg {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.sl-mini-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s;
}

.sl-mini-progress-label {
  font-size: 11px;
  color: var(--text-lo);
  white-space: nowrap;
}

.swimlane-cell {
  flex: 1;
  min-width: 250px;
  min-height: 90px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid var(--bg-sunken);
}

.swimlane-cell:last-child {
  border-right: none;
}

/* ── Status/Priority drag ───────────────────────────────────── */
.status-item {
  cursor: grab;
  transition: background .2s;
}

.status-item:active {
  cursor: grabbing;
}

.drag-handle {
  color: #8993a4;
  margin-right: 12px;
  font-size: 16px;
  cursor: grab;
}

/* ── Sprint calendar ────────────────────────────────────────── */
.cal-day {
  min-height: 100px;
  border-right: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  padding: 8px;
  cursor: pointer;
  transition: background .1s;
}

.cal-day:hover {
  background: var(--bg-sunken);
}

.cal-day.today {
  background: #d3e3fd;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-lo);
  margin-bottom: 6px;
}

.cal-ticket-chip {
  font-size: 11px;
  background: #e8f0fe;
  color: var(--c-primary);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.cal-ticket-chip:hover {
  background: #d3e3fd;
}

/* ── Misc ───────────────────────────────────────────────────── */
.chevron {
  font-size: 10px;
  opacity: .7;
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-lo);
  font-size: 13px;
}

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

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bd);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}

.label-chip {
  background: #d3e3fd;
  color: #041e49;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--r-full);
  display: inline-block;
}

.type-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-med);
  background: var(--bg-sunken);
  padding: 3px 8px;
  border-radius: var(--r-sm);
}

.release-badge {
  background: #e3fcef;
  color: #137333;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.time-bar-wrap {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.time-bar-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: 3px;
}

#page-loading {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.add-card-btn {
  width: calc(100% - 20px);
  margin: 0 10px 10px;
  padding: 8px 14px;
  background: none;
  border: none;
  border-radius: var(--r-full);
  color: var(--text-lo);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .12s;
}

.add-card-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-med);
}

.avatar-group {
  display: flex;
}

.avatar-group .assignee {
  border: 2px solid #fff;
  margin-left: -8px;
}

.avatar-group .assignee:first-child {
  margin-left: 0;
}

.editable-field {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: background .1s;
}

.editable-field:hover {
  background: var(--bg-sunken);
}

.sprint-burndown-chart {
  width: 100%;
}

/* ── Dark Mode ──────────────────────────────────────────────── */
html.dark body {
  background: var(--bg-page);
  color: var(--text-hi);
}

html.dark header {
  background: var(--bg-surf);
  border-bottom-color: var(--bd);
}

html.dark .header-logo {
  color: var(--text-hi);
}

html.dark .search-bar {
  background-color: hsl(220, 12%, 18%) !important;
  color: var(--text-hi) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ea7b3' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

html.dark .search-bar:focus {
  background-color: hsl(220, 12%, 22%) !important;
  color: var(--text-hi) !important;
  border-color: var(--c-primary) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239b82ff' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

html.dark .search-bar:-webkit-autofill,
html.dark .search-bar:-webkit-autofill:hover,
html.dark .search-bar:-webkit-autofill:focus,
html.dark .search-bar:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px hsl(220, 12%, 22%) inset !important;
  -webkit-text-fill-color: var(--text-hi) !important;
}

html.dark .create-btn {
  color: var(--bg-page);
}

html.dark .create-btn:hover {
  background: linear-gradient(135deg, var(--c-primary-h), var(--c-primary));
}

html.dark .notification-btn {
  color: var(--text-med);
}

html.dark .notification-btn:hover {
  background: rgba(255, 255, 255, .04);
  color: #fff;
}

html.dark .profile-btn:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

html.dark .project-list li.active {
  background: var(--c-primary-container);
  color: var(--c-on-primary-container);
}

html.dark .settings-nav li.active {
  background: var(--c-primary-container);
  color: var(--c-on-primary-container);
}

html.dark .cal-ticket-chip {
  background: var(--c-primary-container);
  color: var(--c-on-primary-container);
}

html.dark .cal-day.today {
  background: var(--c-primary-container);
}

html.dark .ticket-status-badge.in_progress {
  background: var(--c-primary-container);
  color: var(--c-on-primary-container);
}

html.dark .ticket-status-badge.done {
  background: hsla(185, 85%, 45%, 0.15);
  color: var(--c-success);
}

html.dark .ql-toolbar.ql-snow {
  background: var(--bg-sunken) !important;
  border-color: var(--bd) !important;
}

html.dark .ql-container {
  color: var(--text-hi);
}

html.dark .badge-critical,
html.dark .badge-highest {
  background: rgba(232, 28, 0, 0.15);
  color: #ff8c80;
}

html.dark .badge-high {
  background: rgba(224, 84, 0, 0.15);
  color: #ffaa80;
}

html.dark .badge-medium {
  background: rgba(201, 151, 0, 0.15);
  color: #ffeb80;
}

html.dark .badge-low {
  background: rgba(0, 185, 92, 0.15);
  color: #80ffbe;
}

html.dark .badge-lowest {
  background: rgba(120, 120, 120, 0.15);
  color: #d0d0d0;
}

html.dark .due-badge {
  background: var(--bg-raised);
  color: var(--text-lo);
}

html.dark .due-badge.overdue {
  background: rgba(232, 28, 0, 0.15);
  color: #ff8c80;
}

html.dark .sp-badge {
  background: rgba(144, 91, 236, 0.15);
  color: #d0bfff;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --sb-w: 240px;
  }

  .hamburger-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    z-index: 295;
    transform: translateX(-100%);
    box-shadow: 2px 0 8px rgba(9, 30, 66, .18);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .header-center {
    padding: 0 8px;
  }

  .search-bar {
    max-width: 220px;
  }

  .create-btn {
    padding: 0 10px;
    font-size: 13px;
  }

  .board-container {
    padding: 8px;
    gap: 8px;
  }

  .column {
    width: 240px;
    min-width: 240px;
  }

  .app-layout {
    height: calc(100vh - var(--nav-h));
  }
}

/* ---- Search Dropdown ---- */
.search-results {
  max-height: 350px;
  overflow-y: auto;
}

.search-result-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--bd);
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--bg-sunken);
}

.search-result-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-hi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-subtitle {
  font-size: 11px;
  color: var(--text-lo);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-type {
  font-size: 10px;
  font-weight: bold;
  color: var(--text-med);
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--bg-raised);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-med);
  font-size: 13px;
}

.quick-filter-btn {
  padding: 4px 10px;
  background: var(--bg-surf);
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--text-med);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-filter-btn:hover {
  background: var(--bg-sunken);
  color: var(--text-hi);
  border-color: var(--text-lo);
}

@media (max-width: 480px) {
  .search-bar {
    max-width: 140px;
    font-size: 13px;
  }

  .header-logo span {
    display: none;
  }

  .create-btn {
    display: none !important;
  }

  /* Hide old header create btn on mobile */
}

/* ── M3 Floating Action Button (FAB) ───────────────────────── */
.fab-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  height: 56px;
  padding: 0 24px;
  background: var(--c-primary-container);
  color: var(--c-on-primary-container);
  border: none;
  border-radius: 16px;
  /* M3 rounded corners for FAB */
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1), background-color 0.2s;
}

.fab-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 12px 4px rgba(0, 0, 0, 0.15), 0 2px 4px 1px rgba(0, 0, 0, 0.2);
}

.fab-icon {
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.fab-text {
  transition: opacity 0.2s;
}

@media (max-width: 768px) {
  .fab-btn {
    width: 56px;
    padding: 0;
    justify-content: center;
  }

  .fab-text {
    display: none;
  }
}

/* ── Premium Glassmorphism & Shadow Utilities ────────────────── */
.glass-header {
  background-color: var(--bg-glass) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bd) !important;
  box-shadow: var(--shadow-sm) !important;
}

.glass-card {
  background-color: var(--bg-glass) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bd) !important;
  box-shadow: var(--shadow-card) !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-drop), var(--shadow-glow) !important;
  border-color: var(--border-glow) !important;
}

.card-glow {
  box-shadow: var(--shadow-card), var(--shadow-glow) !important;
  border-color: var(--border-glow) !important;
}

/* ── Ticket Details Modal Dialog ── */
.ticket-dialog {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) scale(0.95) !important;
  margin: 0 !important;
  border: none !important;
  border-radius: var(--r-lg);
  width: 90% !important;
  max-width: 1100px !important;
  height: 85vh !important;
  max-height: 800px !important;
  padding: 0 !important;
  background: var(--bg-surf) !important;
  color: var(--text-hi) !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.25s;
  z-index: 9999;
}

.ticket-dialog[open] {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.ticket-dialog::backdrop {
  background: rgba(9, 30, 66, 0.54);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ticket-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--bd);
  background: var(--bg-sunken);
}

.ticket-dialog-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ticket-dialog-key {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: 0.02em;
}

.ticket-dialog-copy-btn {
  background: none;
  border: 1px solid var(--bd);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-med);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.ticket-dialog-copy-btn:hover {
  background: var(--bg-raised);
  color: var(--text-hi);
  border-color: var(--text-lo);
}

.ticket-dialog-copy-btn:active {
  transform: scale(0.95);
}

.ticket-dialog-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-lo);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.ticket-dialog-close-btn:hover {
  background: var(--bg-raised);
  color: var(--text-hi);
}

.ticket-dialog-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.ticket-dialog-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.ticket-dialog-spinner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-surf);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.25s ease;
}

.ticket-dialog-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #172b4d;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  z-index: 10005;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ticket-dialog-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}