/* =====================================================
   EXCELLIS QA — Ultra Modern Playful Premium Design
   LIGHT MODE
   ===================================================== */

/* Light theme is the default. Every surface, fill and shadow below is a token,
   so the dark block further down only has to restate the palette. */
:root {
  --bg: #F4F6FB;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-translucent: rgba(255, 255, 255, 0.85);
  --surface-hover: rgba(255, 255, 255, 0.7);
  --surface-edge: rgba(255, 255, 255, 0.7);
  --glass: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.95);
  /* Subtle fills and hairlines — inverted in dark mode. */
  --tint-rgb: 15, 23, 42;
  /* Shadows stay dark in both themes, just deeper on dark surfaces. */
  --shadow-rgb: 15, 23, 42;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --primary: #FF6B35;
  --primary-glow: rgba(255, 107, 53, 0.25);
  --accent: #FF3D81;
  --success: #00B894;
  --warning: #F59E0B;
  --danger: #FF3D81;
  --purple: #7B61FF;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 8px 30px rgba(var(--shadow-rgb), 0.08);
  --shadow-sm: 0 2px 12px rgba(var(--shadow-rgb), 0.06);
  --font: 'Outfit', system-ui, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  /* Readable ink for the tinted semantic chips (badges, pills, priorities). */
  --on-danger: #E11D74;
  --on-primary-ink: #E85A20;
  --on-warning: #D97706;
  --on-warning-deep: #B45309;
  --on-success: #00866B;
  --on-info: #1D4ED8;
  --on-purple: #5B3FD6;
  --on-neutral: #64748B;
  --flash-bg: #0F172A;
  --flash-fg: #FFFFFF;
  --orb-opacity: 0.22;
  color-scheme: light;
}

/* Dark theme. Applied by [data-theme="dark"] on <html>, which the inline
   bootstrap script in the layout sets before first paint so the page never
   flashes light. */
:root[data-theme="dark"] {
  --bg: #0B1120;
  --bg-elevated: #151C2C;
  --surface: #1A2233;
  --surface-translucent: rgba(26, 34, 51, 0.85);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-edge: rgba(255, 255, 255, 0.06);
  --glass: rgba(21, 28, 44, 0.75);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-hover: rgba(30, 40, 60, 0.95);
  --tint-rgb: 226, 232, 240;
  --shadow-rgb: 0, 0, 0;
  --text: #E7ECF5;
  --text-secondary: #A8B3C7;
  --text-muted: #6B7A92;
  --primary: #FF7A46;
  --primary-glow: rgba(255, 122, 70, 0.3);
  --accent: #FF5591;
  --success: #12C9A5;
  --warning: #FBBF24;
  --danger: #FF5591;
  --purple: #9179FF;
  --shadow: 0 10px 34px rgba(var(--shadow-rgb), 0.45);
  --shadow-sm: 0 2px 12px rgba(var(--shadow-rgb), 0.35);
  /* Same chips, lightened so they read on dark fills. */
  --on-danger: #FF8FB8;
  --on-primary-ink: #FFA478;
  --on-warning: #FCD34D;
  --on-warning-deep: #FBBF24;
  --on-success: #5EE9C8;
  --on-info: #93B4FF;
  --on-purple: #BCA9FF;
  --on-neutral: #9AA8BE;
  --flash-bg: #E7ECF5;
  --flash-fg: #0B1120;
  --orb-opacity: 0.16;
  color-scheme: dark;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Ambient Orbs - softer for light mode */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: var(--orb-opacity);
  pointer-events: none;
  z-index: 0;
}
.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #FF6B35 0%, transparent 70%);
  top: -180px;
  left: -120px;
}
.orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #7B61FF 0%, transparent 70%);
  bottom: -120px;
  right: -100px;
}
.orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #FF3D81 0%, transparent 70%);
  top: 40%;
  left: 50%;
  opacity: 0.14;
}

/* App Layout */
.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar — a panel that floats above the page rather than a wall attached
   to its edge: inset on all sides, rounded, and lifted with layered shadow. */
.sidebar {
  width: 258px;
  flex-shrink: 0;
  margin: 14px 0 14px 14px;
  padding: 20px 14px;
  background: var(--surface-translucent);
  backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--surface-edge);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  box-shadow:
    0 1px 1px rgba(var(--shadow-rgb), 0.04),
    0 6px 14px rgba(var(--shadow-rgb), 0.05),
    0 18px 40px rgba(var(--shadow-rgb), 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  z-index: 2;
}
/* A warm rim along the inner edge, echoing the brand gradient. */
.sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 107, 53, 0.06), transparent 42%);
}
.sidebar > * { position: relative; z-index: 1; }

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 2px 6px 20px;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.logo:hover { transform: translateY(-1px); }

.logo-img {
  display: block;
  width: 118px;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 4px 10px rgba(255, 107, 53, 0.35));
}
.logo-mark svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
  width: 100%;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(var(--tint-rgb), 0.05);
  color: var(--text);
  transform: translateX(2px);
}

/* The active item lifts off the sidebar the way the sidebar lifts off the
   page — same layered-shadow idea, one level in. */
.nav-item.active {
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  color: #FFFFFF;
  font-weight: 700;
  transform: translateX(2px);
  box-shadow:
    0 1px 2px rgba(255, 61, 129, 0.24),
    0 6px 16px rgba(255, 107, 53, 0.30);
}
.nav-item.active .nav-icon { transform: scale(1.06); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
  transform: translateY(-50%);
}

.nav-icon {
  font-size: 1.12rem;
  width: 24px;
  text-align: center;
  transition: transform 0.18s ease;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  background: linear-gradient(135deg, #00B894, #00D2A0);
  color: #FFFFFF;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

.nav-count {
  margin-left: auto;
  font-size: 0.72rem;
  background: rgba(var(--tint-rgb), 0.07);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.nav-count.danger {
  background: rgba(255, 61, 129, 0.12);
  color: var(--on-danger);
}

.nav-item.active .nav-count,
.nav-item.active .nav-count.danger {
  background: rgba(255, 255, 255, 0.26);
  color: #FFFFFF;
}
.nav-item.active .nav-badge { background: rgba(255, 255, 255, 0.26); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(var(--tint-rgb), 0.045);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.user-card:hover {
  background: var(--surface);
  border-color: var(--glass-border);
  transform: translateY(-1px);
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.04),
    0 6px 16px rgba(var(--shadow-rgb), 0.07);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
  border-radius: 8px;
}

.user-info {
  display: flex;
  flex-direction: column;
}
.user-info strong {
  font-size: 0.9rem;
}
.user-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.xp-bar {
  height: 8px;
  background: rgba(var(--tint-rgb), 0.08);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF6B35, #FF3D81);
  border-radius: 20px;
  transition: width 0.6s ease;
}

.xp-text {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* Main */
.main {
  flex: 1;
  min-width: 0;
  padding: 22px 28px 44px;
  overflow-y: auto;
  max-height: 100vh;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 16px;
  flex: 1;
  max-width: 480px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: rgba(255, 107, 53, 0.45);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  flex: 1;
}

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

.search-box kbd {
  font-size: 0.7rem;
  background: rgba(var(--tint-rgb), 0.06);
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font);
}

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

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
  background: var(--surface);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--shadow-rgb), 0.1);
}

.notif-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 0 2px #FFFFFF;
}

.streak {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 61, 129, 0.07));
  border: 1px solid rgba(255, 107, 53, 0.2);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.streak strong {
  font-size: 1.1rem;
}

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

/* Sections */
.section {
  animation: fadeIn 0.35s ease;
}

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

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 20px;
}

.section-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 12px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px var(--primary-glow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--primary-glow);
}

.btn-primary.full {
  width: 100%;
  justify-content: center;
  padding: 14px;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 11px 18px;
  border-radius: 12px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(var(--shadow-rgb), 0.1);
}

.btn-secondary.sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-ghost.sm {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.btn-open {
  background: transparent;
  border: none;
  color: var(--primary);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-open:hover {
  color: #FF9F1C;
}

/* Glass Panel */
.glass {
  background: var(--surface-translucent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--surface-edge);
  box-shadow: var(--shadow);
}

.stat-card.danger-glow {
  box-shadow: 0 0 30px rgba(255, 61, 129, 0.1);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 2px 0;
}

.stat-unit {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.mini-progress {
  height: 4px;
  background: rgba(var(--tint-rgb), 0.08);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #00B894, #00D2A0);
  border-radius: 4px;
}

.pulse-dot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 129, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(255, 61, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 61, 129, 0); }
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.panel {
  padding: 22px;
}

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

.panel-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.badge {
  font-size: 0.75rem;
  background: rgba(var(--tint-rgb), 0.06);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.badge.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--on-warning);
}

/* Project Health */
.project-health-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(var(--tint-rgb), 0.025);
  transition: background 0.2s;
}

.health-item:hover {
  background: rgba(var(--tint-rgb), 0.05);
}

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

.project-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.project-avatar.lg {
  width: 52px;
  height: 52px;
  font-size: 1.3rem;
  border-radius: 16px;
}

.project-avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
  border-radius: 9px;
}

.health-left strong {
  display: block;
  font-size: 0.95rem;
}

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

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

.progress-bar {
  width: 80px;
  height: 6px;
  background: rgba(var(--tint-rgb), 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar.lg {
  width: 100%;
  height: 8px;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00B894, #00D2A0);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.progress-fill.warning {
  background: linear-gradient(90deg, #FFB800, #FF6B35);
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 32px;
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pill.blocked {
  background: rgba(255, 61, 129, 0.12);
  color: var(--on-danger);
}

.status-pill.assigned {
  background: rgba(255, 107, 53, 0.12);
  color: var(--on-primary-ink);
}

/* Workflow */
.workflow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 4px;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 70px;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #FFFFFF;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

/* Stage colors (workflow has step / line / step / …) */
.workflow > .workflow-step:nth-child(1) .step-num {
  background: linear-gradient(135deg, #00B894, #00D2A0);
}
.workflow > .workflow-step:nth-child(3) .step-num {
  background: linear-gradient(135deg, #0984E3, #74B9FF);
}
.workflow > .workflow-step:nth-child(5) .step-num {
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
}
.workflow > .workflow-step:nth-child(7) .step-num {
  background: linear-gradient(135deg, #FF9F1C, #FFB347);
}
.workflow > .workflow-step:nth-child(9) .step-num {
  background: linear-gradient(135deg, #7B61FF, #A78BFA);
}
.workflow > .workflow-step:nth-child(11) .step-num {
  background: linear-gradient(135deg, #00C9A7, #14A06F);
}

.workflow-step.active .step-num {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  color: #FFFFFF;
}

.step-label {
  font-size: 0.7rem;
  line-height: 1.25;
  min-height: calc(1.25em * 2);
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

.workflow-line {
  flex: 0.5;
  height: 2px;
  background: var(--glass-border);
  margin-top: 17px; /* center with 36px step circles */
  align-self: flex-start;
}

.workflow-tip {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 107, 53, 0.06);
  border: 1px solid rgba(255, 107, 53, 0.14);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.workflow-tip span {
  font-size: 1.2rem;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  padding: 22px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--surface-edge);
}

.project-card.featured {
  border-color: rgba(255, 107, 53, 0.28);
  box-shadow: 0 0 40px rgba(255, 107, 53, 0.08);
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.project-meta {
  flex: 1;
}

.project-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.project-meta h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2px 0;
}

.project-type {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.project-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 4px;
}

.p-stat {
  display: flex;
  flex-direction: column;
}

.p-stat span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.p-stat strong {
  font-size: 1rem;
  font-weight: 700;
}

.p-stat strong.danger {
  color: var(--on-danger);
}

.project-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.avatar-stack {
  display: flex;
}

.avatar-stack .avatar {
  margin-left: -8px;
  border: 2px solid #FFFFFF;
}

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

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 500px;
}

.kanban-col {
  background: var(--surface-hover);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  box-shadow: var(--shadow-sm);
}

.kanban-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
}

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

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

.dot.open { background: #64748B; }
.dot.progress { background: #FFB800; }
.dot.retest { background: #7B61FF; }
.dot.closed { background: #00C9A7; }

.count {
  margin-left: auto;
  font-size: 0.75rem;
  background: rgba(var(--tint-rgb), 0.06);
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--text-muted);
}

.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
}

.bug-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  cursor: grab;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(var(--shadow-rgb), 0.04);
}

.bug-card:hover {
  border-color: rgba(255, 107, 53, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.1);
}

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

.bug-card.closed {
  opacity: 0.7;
}

.bug-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bug-id {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.priority {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.priority.critical {
  background: rgba(255, 61, 129, 0.12);
  color: var(--on-danger);
}

.priority.high {
  background: rgba(255, 107, 53, 0.12);
  color: var(--on-primary-ink);
}

.priority.medium {
  background: rgba(245, 158, 11, 0.12);
  color: var(--on-warning);
}

.priority.low {
  background: rgba(100, 116, 139, 0.12);
  color: var(--on-neutral);
}

.bug-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.4;
}

.bug-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-tag {
  font-size: 0.7rem;
  background: rgba(var(--tint-rgb), 0.06);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-secondary);
}

/* Reports */
.reports-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 20px;
}

.generate-panel h3 {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

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

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

.select {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  box-shadow: var(--shadow-sm);
}

.select:focus {
  border-color: rgba(255, 107, 53, 0.5);
}

.select.full {
  width: 100%;
}

.textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-shadow: var(--shadow-sm);
}

.textarea:focus {
  border-color: rgba(255, 107, 53, 0.5);
}

.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.upload-zone:hover {
  border-color: rgba(255, 107, 53, 0.4);
  background: rgba(255, 107, 53, 0.04);
}

.upload-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.upload-zone p {
  font-weight: 500;
  margin-bottom: 4px;
}

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

.report-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(var(--tint-rgb), 0.025);
  transition: background 0.2s;
}

.report-item:hover {
  background: rgba(var(--tint-rgb), 0.05);
}

.report-icon {
  width: 42px;
  height: 42px;
  background: rgba(var(--tint-rgb), 0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.report-info {
  flex: 1;
}

.report-info strong {
  display: block;
  font-size: 0.9rem;
}

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

/* Sign-Off */
.eligibility-table {
  display: flex;
  flex-direction: column;
}

.elig-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.9fr 1fr 0.9fr 0.8fr;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid var(--glass-border);
  gap: 8px;
}

.elig-row.header {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 10px;
}

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

.elig-project {
  display: flex;
  align-items: center;
  gap: 10px;
}

.elig-project strong {
  display: block;
  font-size: 0.9rem;
}

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

.elig-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.elig-value.danger {
  color: var(--on-danger);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 360px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .reports-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 72px;
    padding: 16px 8px;
  }
  .sidebar .logo {
    justify-content: center;
    padding: 2px 0 16px;
  }
  .sidebar .logo-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    object-position: center top;
    border-radius: 10px;
  }
  .logo-text,
  .nav-item span:not(.nav-icon),
  .nav-badge,
  .nav-count,
  .user-info,
  .xp-text {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 14px;
  }
  .user-card {
    justify-content: center;
  }
  .main {
    padding: 16px;
  }
  .elig-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .elig-row.header {
    display: none;
  }
}

/* =====================================================
   APPLICATION LAYER — Laravel screens on the v2 system
   ===================================================== */

a { color: inherit; text-decoration: none; }
a.link { color: var(--primary); font-weight: 600; }
a.link:hover { color: var(--on-primary-ink); }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.w-100 { width: 100%; }
.text-right { text-align: right; }

/* Sidebar nav as real links */
.nav-item { text-decoration: none; }
.nav-item.sub {
  font-size: 0.88rem;
  padding: 9px 14px 9px 22px;
  color: var(--text-muted);
}
.nav-section-label {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 18px 13px 7px;
  display: flex;
  align-items: center;
  gap: 9px;
}
/* A hairline that trails the label, so sections read as separated without
   drawing a full divider across the panel. */
.nav-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* Mobile sidebar */
.sidebar-toggle { display: none; }
.sidebar-scrim { display: none; }

/* Topbar profile */
.profile { position: relative; }
.profile-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.profile-toggle:hover { box-shadow: 0 4px 14px rgba(var(--shadow-rgb), 0.1); }
.profile-toggle .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 0.72rem; }
.profile-caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
}
.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 60;
}
.profile-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--glass-border); margin-bottom: 6px; }
.profile-menu-head strong { display: block; font-size: 0.9rem; }
.profile-menu-head small { color: var(--text-muted); font-size: 0.75rem; }
.profile-menu a,
.profile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}
.profile-menu a:hover,
.profile-menu button:hover { background: rgba(var(--tint-rgb), 0.05); color: var(--text); }
.profile-menu form { margin: 0; }
.profile-menu form button { color: var(--on-danger); }

/* Stat ring (used by dashboard stat cards) */
.stat-ring { width: 44px; height: 44px; flex-shrink: 0; }
.stat-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.stat-ring path { fill: none; stroke-width: 3; }
.stat-ring .ring-bg { stroke: rgba(var(--tint-rgb), 0.08); }
.stat-ring .ring-fill { stroke: url(#ringGrad); stroke: #FF6B35; stroke-linecap: round; }

/* Cards / panels */
.card {
  background: var(--surface-translucent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card > h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; }
.card > h3 small { font-weight: 500; font-size: 0.78rem; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.panel-title h3 { font-size: 1.05rem; font-weight: 600; }

/* Grids */
.grid { display: grid; gap: 20px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-side { grid-template-columns: 1fr 1.3fr; align-items: start; }

/* Breadcrumb */
.crumbs { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--primary); }

/* Buttons — .btn family maps onto the v2 button system */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 11px 18px;
  border-radius: 12px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(var(--shadow-rgb), 0.1); }
.btn.btn-primary {
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--primary-glow); }
.btn.btn-danger {
  background: rgba(255, 61, 129, 0.1);
  color: var(--on-danger);
  border-color: rgba(255, 61, 129, 0.24);
}
.btn.btn-soft {
  background: rgba(0, 184, 148, 0.1);
  color: var(--on-success);
  border-color: rgba(0, 184, 148, 0.24);
}
.btn.btn-light { background: var(--surface); color: var(--text-secondary); }
.btn.btn-sm { padding: 7px 13px; font-size: 0.8rem; border-radius: 9px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-primary, .btn-secondary, .btn-ghost, .btn-open { text-decoration: none; }
a.btn-primary, a.btn-secondary { display: inline-flex; }
.inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* Forms */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="date"], input[type="number"], input:not([type]), select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input[disabled], select[disabled], textarea[disabled] { background: rgba(var(--tint-rgb), 0.04); color: var(--text-muted); }
select { cursor: pointer; }
input[type="checkbox"] { width: auto; box-shadow: none; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-side { grid-template-columns: 1fr; }
.form-span-2 { grid-column: span 2; }
.field-error { color: var(--on-danger); font-size: 0.78rem; margin-top: 5px; font-weight: 600; }
.field-hint { display: block; color: var(--text-muted); font-size: 0.75rem; margin-top: 5px; }

.multi-check {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  background: rgba(var(--tint-rgb), 0.025);
  border-radius: 12px;
  padding: 12px;
}
.multi-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
}
.checkbox-inline { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}
.filter-bar .btn { height: 41px; }

/* File upload */
.file-upload input[type="file"] { position: absolute; opacity: 0; width: 0; height: 0; }
.file-upload-label {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px dashed var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0;
}
.file-upload-label:hover { border-color: rgba(255, 107, 53, 0.45); background: rgba(255, 107, 53, 0.04); }
.file-upload-icon { font-size: 1.3rem; }
.file-upload-text strong { display: block; font-size: 0.9rem; color: var(--text); }
.file-upload-text small { color: var(--text-muted); font-size: 0.75rem; }
.file-upload-list { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.file-upload-list li,
.file-upload-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(var(--tint-rgb), 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 6px 8px 6px 10px;
}
.file-upload-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-upload-item-remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.file-upload-item-remove:hover {
  background: rgba(255, 61, 129, 0.12);
  color: var(--danger);
}
.evidence-url-row { display: flex; gap: 8px; margin-bottom: 8px; }

/* Alerts */
.alert {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.alert-success { background: rgba(0, 184, 148, 0.1); border-color: rgba(0, 184, 148, 0.25); color: #00775F; }
.alert-danger { background: rgba(255, 61, 129, 0.09); border-color: rgba(255, 61, 129, 0.25); color: #C5115F; }
.alert ul { margin: 8px 0 0 18px; }

/* Badges */
.badge.b-green { background: rgba(0, 184, 148, 0.12); color: var(--on-success); }
.badge.b-red { background: rgba(255, 61, 129, 0.12); color: var(--on-danger); }
.badge.b-yellow { background: rgba(245, 158, 11, 0.14); color: var(--on-warning-deep); }
.badge.b-blue { background: rgba(59, 130, 246, 0.12); color: var(--on-info); }
.badge.b-purple { background: rgba(123, 97, 255, 0.12); color: var(--on-purple); }
.badge.b-gray { background: rgba(var(--tint-rgb), 0.06); color: var(--text-secondary); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
tbody td { padding: 13px 12px; border-bottom: 1px solid rgba(var(--tint-rgb), 0.05); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(var(--tint-rgb), 0.025); }
tbody td small { color: var(--text-muted); }
.cell-empty { text-align: center; padding: 32px !important; color: var(--text-muted); }

/* Progress (v1 markup compatibility) */
.progress { width: 90px; height: 6px; background: rgba(var(--tint-rgb), 0.08); border-radius: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #00B894, #00D2A0); border-radius: 6px; }

/* Pagination (Bootstrap 5 markup from Laravel) */
.pagination { display: flex; gap: 6px; list-style: none; padding: 18px 0 0; flex-wrap: wrap; }
.page-item .page-link {
  display: block;
  padding: 7px 12px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.page-item.active .page-link { background: linear-gradient(135deg, #FF6B35, #FF3D81); color: #FFFFFF; border-color: transparent; }
.page-item.disabled .page-link { opacity: 0.45; }
nav[role="navigation"] p, .pagination-info { font-size: 0.8rem; color: var(--text-muted); }

/* Tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 18px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 4px 18px var(--primary-glow);
}

/* Info rows */
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(var(--tint-rgb), 0.05);
  font-size: 0.88rem;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--text-muted); }
.info-row strong { text-align: right; word-break: break-word; }

/* Checklist */
.check-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.check-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.check-nav { position: sticky; top: 16px; }
.check-nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.check-nav button:hover { background: rgba(var(--tint-rgb), 0.04); color: var(--text); }
.check-nav button.active {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 61, 129, 0.08));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.22);
}
.check-section { display: none; }
.check-section.active { display: block; animation: fadeIn 0.3s ease; }
.check-group-head { margin-bottom: 16px; }
.check-progress-line { height: 6px; background: rgba(var(--tint-rgb), 0.08); border-radius: 6px; overflow: hidden; margin: 10px 0 6px; max-width: 320px; }
.check-progress-line span { display: block; height: 100%; background: linear-gradient(90deg, #00B894, #00D2A0); }
.check-item {
  display: grid;
  grid-template-columns: 1.6fr 130px 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px 12px;
  border-radius: 12px;
  border-left: 3px solid transparent;
  background: rgba(var(--tint-rgb), 0.02);
  margin-bottom: 10px;
}
.check-item.passed { border-left-color: #00B894; }
.check-item.failed { border-left-color: #FF3D81; }
.check-item select, .check-item input { box-shadow: none; padding: 8px 10px; font-size: 0.82rem; }
.check-title strong { display: block; font-size: 0.88rem; font-weight: 600; }
.check-title small { color: var(--text-muted); font-size: 0.73rem; }
.check-actions { display: flex; gap: 6px; }

/* Bug detail */
.bug-show-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.bug-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bug-submeta { color: var(--text-muted); font-size: 0.82rem; }
.bug-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.bug-meta-item {
  background: rgba(var(--tint-rgb), 0.025);
  border-radius: 12px;
  padding: 12px;
}
.bug-meta-item span { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.bug-meta-item strong { font-size: 0.9rem; }
.bug-section { margin-bottom: 18px; }
.bug-section h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }
.bug-section-split { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.bug-prose {
  background: rgba(var(--tint-rgb), 0.025);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.bug-prose-actual { background: rgba(255, 61, 129, 0.06); }

.evidence-box { background: rgba(var(--tint-rgb), 0.025); border-radius: 12px; padding: 14px; }
.evidence-image { width: 100%; border-radius: 10px; display: block; }
.evidence-file { display: flex; align-items: center; gap: 12px; }
.evidence-file > div:nth-child(2) { flex: 1; min-width: 0; }
.evidence-file strong { display: block; font-size: 0.88rem; }
.evidence-file small { color: var(--text-muted); font-size: 0.75rem; }
.evidence-file-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  flex-shrink: 0;
}
.evidence-url-text { word-break: break-all; }
.evidence-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.evidence-tile { border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.evidence-tile-preview { display: block; height: 130px; background: rgba(var(--tint-rgb), 0.04); }
.evidence-tile-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evidence-tile-pdf { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); }
.evidence-tile-meta { padding: 10px; }
.evidence-tile-meta strong { display: block; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-tile-meta small { color: var(--text-muted); font-size: 0.72rem; }
.evidence-tile-actions { display: flex; gap: 6px; margin-top: 8px; }

.history-item { padding: 14px 0; border-bottom: 1px solid rgba(var(--tint-rgb), 0.06); }
.history-item:last-child { border-bottom: none; }
.history-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.history-item-head strong { font-size: 0.88rem; }
.history-item-head small { color: var(--text-muted); font-size: 0.72rem; }
.history-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(123, 97, 255, 0.12);
  color: var(--on-purple);
  padding: 3px 9px;
  border-radius: 20px;
  margin: 6px 0;
}
.history-comment { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.55; }
.history-comment p { margin-bottom: 6px; }

.wysiwyg-editor { background: var(--surface); border: 1px solid var(--glass-border); border-radius: 10px; overflow: hidden; }
.wysiwyg-editor.is-invalid { border-color: #FF3D81; }
.wysiwyg-editor.ql-focused { border-color: rgba(255, 107, 53, 0.5); }
.wysiwyg-editor .ql-toolbar.ql-snow, .wysiwyg-editor .ql-container.ql-snow { border: none; font-family: var(--font); }
.wysiwyg-editor .ql-toolbar.ql-snow { border-bottom: 1px solid var(--glass-border); }
.wysiwyg-editor .ql-editor { min-height: 110px; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.settings-side-note { color: var(--text-muted); font-size: 0.78rem; line-height: 1.5; margin-bottom: 14px; }
.setting-rule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(var(--tint-rgb), 0.06);
}
.setting-rule:last-of-type { border-bottom: none; }
.setting-rule h4 { font-size: 0.88rem; font-weight: 600; }
.setting-rule p { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.switch {
  width: 46px; height: 26px;
  border-radius: 20px;
  background: rgba(var(--tint-rgb), 0.14);
  border: none;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.switch span {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(var(--shadow-rgb), 0.2);
  transition: transform 0.2s;
}
.switch.on { background: linear-gradient(135deg, #FF6B35, #FF3D81); }
.switch.on span { transform: translateX(20px); }

.status-list { display: flex; flex-direction: column; gap: 10px; }
.status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(var(--tint-rgb), 0.025);
  border-radius: 12px;
  padding: 10px;
}
.status-edit { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 200px; }
.status-edit input[name="name"] { flex: 1; }
.status-edit input[type="number"] { width: 68px; }
.status-row-actions { display: flex; gap: 6px; align-items: center; }
.status-row-actions form { margin: 0; }

.settings-main-head { margin-bottom: 16px; }
.type-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.type-tab {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.type-tab small { display: block; font-weight: 500; font-size: 0.7rem; color: var(--text-muted); }
.type-tab.active { background: linear-gradient(135deg, #FF6B35, #FF3D81); color: #FFFFFF; border-color: transparent; }
.type-tab.active small { color: rgba(255, 255, 255, 0.8); }
.type-tab.is-inactive { opacity: 0.55; }
.type-panel-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  padding: 16px;
  background: rgba(var(--tint-rgb), 0.025);
  border-radius: 12px;
  margin-bottom: 18px;
}
.settings-accordion { border: 1px solid var(--glass-border); border-radius: 12px; margin-bottom: 10px; background: var(--surface); }
.settings-accordion > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.settings-accordion > summary::-webkit-details-marker { display: none; }
.settings-accordion-title { font-weight: 600; font-size: 0.92rem; }
.settings-accordion-body { padding: 0 16px 16px; }
.category-toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.category-toolbar form { margin: 0; }
.checklist-table { display: flex; flex-direction: column; gap: 8px; }
.checklist-table-head, .checklist-table-row {
  display: grid;
  grid-template-columns: 1fr 130px 110px auto;
  gap: 8px;
  align-items: center;
}
.checklist-table-head {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0 4px 4px;
}
.checklist-table-row { background: rgba(var(--tint-rgb), 0.025); border-radius: 10px; padding: 8px; }
.checklist-empty { padding: 12px 4px; }
.row-actions { display: flex; gap: 6px; }
.add-item-bar {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--glass-border);
}

/* Profile */
.profile-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.profile-summary { text-align: center; }
.profile-avatar-lg {
  width: 84px; height: 84px;
  border-radius: 24px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700;
  box-shadow: 0 8px 26px var(--primary-glow);
}
.profile-summary h2 { font-family: var(--font-display); font-size: 1.3rem; }
.profile-meta { margin-top: 20px; text-align: left; }
.profile-meta > div {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(var(--tint-rgb), 0.05);
  font-size: 0.85rem;
}
.profile-meta > div:last-child { border-bottom: none; }
.profile-meta span { color: var(--text-muted); }

/* Login */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; position: relative; z-index: 1; }
.login-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  width: min(1040px, 100%);
  background: var(--surface-translucent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(var(--shadow-rgb), 0.12);
  overflow: hidden;
}
.login-hero {
  padding: 48px 44px;
  background: linear-gradient(150deg, rgba(255, 107, 53, 0.12), rgba(123, 97, 255, 0.1));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-hero .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; padding: 0; }
.login-hero .logo-img { width: 180px; border-radius: 12px; }
.login-hero h1 { font-family: var(--font-display); font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; }
.login-hero p { color: var(--text-secondary); margin-top: 14px; font-size: 0.95rem; }
.login-points { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.login-points div { display: flex; gap: 10px; align-items: center; font-size: 0.88rem; color: var(--text-secondary); }
.login-card { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { font-family: var(--font-display); font-size: 1.6rem; }
.login-card > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 22px; }

/* Report print view */
.report-doc { max-width: 900px; }
.report-doc h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 14px 0 6px; }
.report-doc h3 { font-size: 1rem; margin: 22px 0 8px; }
.report-doc .logo { height: 40px; }
@media print {
  .sidebar, .topbar, .section-header .header-actions, .footer, .bg-orb { display: none !important; }
  .main { padding: 0; max-height: none; }
  .card, .panel { box-shadow: none; border: 1px solid #ddd; background: #fff; }
  body { background: #fff; }
}

.footer { margin-top: 36px; text-align: center; font-size: 0.78rem; color: var(--text-muted); }

/* Responsive overrides for the application layer */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .check-summary { grid-template-columns: repeat(3, 1fr); }
  .bug-show-layout, .settings-layout, .profile-layout, .grid-side { grid-template-columns: 1fr; }
  .bug-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .check-layout { grid-template-columns: 1fr; }
  .check-nav { position: static; }
}

@media (max-width: 900px) {
  .app { position: relative; }
  .sidebar {
    position: fixed;
    top: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 80;
    width: 258px;
    height: auto;
    margin: 0;
    padding: 20px 14px;
    transform: translateX(calc(-100% - 16px));
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:
      0 8px 20px rgba(var(--shadow-rgb), 0.10),
      0 24px 60px rgba(var(--shadow-rgb), 0.20);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar .logo-text,
  .sidebar .nav-item span:not(.nav-icon),
  .sidebar .nav-badge,
  .sidebar .nav-count,
  .sidebar .user-info,
  .sidebar .xp-text { display: initial; }
  .sidebar .logo-img {
    width: 118px;
    height: auto;
    object-fit: contain;
    object-position: center;
  }
  .sidebar .nav-item { justify-content: flex-start; padding: 12px 14px; }
  .sidebar .user-card { justify-content: flex-start; }
  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(var(--tint-rgb), 0.35);
    z-index: 70;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
  }
  .grid-2, .grid-3, .grid-4, .form-grid, .bug-section-split,
  .check-summary, .stats-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: span 1; }
  .check-item { grid-template-columns: 1fr; }
  .bug-meta-grid { grid-template-columns: 1fr; }
  .checklist-table-head { display: none; }
  .checklist-table-row, .add-item-bar { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 32px 24px; }
  .login-card { padding: 32px 24px; }
  .section-header { flex-direction: column; }
  .search-box { max-width: none; }
  .search-box kbd { display: none; }
}

/* v1 markup fallback safety (any view not yet ported to v2) */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { color: var(--text-secondary); margin-top: 4px; font-size: 0.93rem; }
.card.stat span { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.card.stat h2 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; margin: 2px 0; }
.card.stat p { font-size: 0.75rem; color: var(--text-secondary); }
.card.stat.red h2 { color: var(--on-danger); }
.card.stat.green h2 { color: var(--on-success); }
.card.stat.orange h2 { color: var(--on-warning); }
.kpi-link { display: block; }
.kpi-action { display: block; margin-top: 10px; font-size: 0.78rem; color: var(--primary); font-weight: 600; }

/* Bug board — seven columns, horizontally scrollable at any width */
.board-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.board-bar-info { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }
.board-nav { display: flex; gap: 8px; margin-left: auto; }
.board-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.board-nav-btn:hover:not(:disabled) {
  color: var(--primary);
  border-color: rgba(255, 107, 53, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--shadow-rgb), 0.1);
}
.board-nav-btn:disabled { opacity: 0.35; cursor: default; }

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(340px, 1fr);
  grid-template-columns: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding-bottom: 10px;
  scrollbar-width: thin;
}
.kanban::-webkit-scrollbar { height: 8px; }
.kanban::-webkit-scrollbar-thumb { background: rgba(var(--tint-rgb), 0.18); border-radius: 8px; }
.kanban::-webkit-scrollbar-track { background: transparent; }
.kanban-col { min-width: 340px; scroll-snap-align: start; }
.kanban-header { position: sticky; top: 0; z-index: 2; background: var(--surface-translucent); backdrop-filter: blur(8px); border-radius: var(--radius) var(--radius) 0 0; }
.bug-card { position: relative; }
.bug-card[draggable="true"] { cursor: grab; }
.bug-card[draggable="true"]:active { cursor: grabbing; }
.bug-card[data-locked] { cursor: not-allowed; opacity: 0.75; }
.bug-card .bug-id, .bug-card .bug-title { display: block; text-decoration: none; }
.bug-card .bug-title:hover { color: var(--primary); }
.bug-card.is-saving { opacity: 0.55; pointer-events: none; }
.kanban-cards.is-over { background: rgba(255, 107, 53, 0.07); box-shadow: inset 0 0 0 2px rgba(255, 107, 53, 0.28); border-radius: 12px; }
.kanban-empty {
  display: none;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px dashed var(--glass-border);
  border-radius: 10px;
  padding: 14px 8px;
}
.kanban-cards.is-empty .kanban-empty { display: block; }
.dot.assigned { background: #FF9F1C; }
.dot.retesting { background: #3B82F6; }
.dot.reopened { background: #E11D74; }
.board-hint { margin-top: 14px; font-size: 0.82rem; color: var(--text-muted); }

/* Toast — top-right, above drawer/confirm (body-level, outside .app). */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 140;
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(var(--shadow-rgb), 0.28);
  animation: fadeIn 0.25s ease;
  max-width: min(420px, calc(100vw - 40px));
}
.toast.is-error { background: #C5115F; }
.panel.mt, .panel.mb { margin-top: 20px; }
.panel.mb { margin-top: 0; margin-bottom: 20px; }
.dashboard-grid.mb { margin-bottom: 20px; }
.stat-card.glass { text-decoration: none; }
a.health-item, a.report-item { text-decoration: none; }

/* Pills and dots must keep their size next to long labels
   ("In Progress", "Ready for Retest" squashed the column dot into an oval). */
.col-title { gap: 8px; min-width: 0; }
.col-title .dot { flex: 0 0 10px; width: 10px; height: 10px; }
.col-title .count { flex-shrink: 0; margin-left: auto; }
.dot { flex-shrink: 0; }
.priority, .status-pill, .badge, .nav-badge, .nav-count, .count, .project-tag {
  flex-shrink: 0;
  white-space: nowrap;
}
.bug-top { gap: 8px; }
.bug-top .bug-id { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bug-meta { gap: 8px; min-width: 0; }
.bug-meta .project-tag { overflow: hidden; text-overflow: ellipsis; }
.health-right .status-pill, .health-right .progress-bar { flex-shrink: 0; }

/* Status filter narrows the board to one column — don't stretch it edge to edge */
.kanban.is-filtered { grid-auto-columns: minmax(340px, 460px); justify-content: start; }

/* Bug board: compact title + one-line filter toolbar, so the columns get the height */
.board-page .section-header { margin-bottom: 14px; align-items: center; }
.board-page .section-header h1 { font-size: 1.5rem; }
.board-page .subtitle { font-size: 0.84rem; margin-top: 2px; }

.board-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.board-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.board-filters select {
  width: auto;
  min-width: 132px;
  padding: 7px 10px;
  font-size: 0.83rem;
  border-radius: 9px;
}
.board-toolbar .board-bar-info { margin-left: auto; }
.board-toolbar .board-nav { margin-left: 0; }
.board-nav-btn { width: 34px; height: 34px; font-size: 1.2rem; }

/* Shorter chrome above the board means taller columns */
.board-page .kanban-col { max-height: calc(100vh - 190px); }

@media (max-width: 900px) {
  .board-toolbar .board-bar-info { margin-left: 0; width: 100%; }
  .board-filters select { flex: 1 1 140px; min-width: 0; }
}

/* Board fills the viewport: columns are equal full height, cards scroll inside */
.board-page .kanban {
  height: calc(100dvh - 250px);   /* JS refines this to the exact fit */
  min-height: 340px;
  align-items: stretch;
  margin-bottom: 0;
}
.board-page .kanban-col {
  height: 100%;
  max-height: none;
  min-height: 0;
}
.board-page .kanban-cards {
  flex: 1 1 auto;
  min-height: 0;              /* required, or the flex child refuses to scroll */
  overflow-y: auto;
  scrollbar-width: thin;
}
.board-page .kanban-cards::-webkit-scrollbar { width: 6px; }
.board-page .kanban-cards::-webkit-scrollbar-thumb { background: rgba(var(--tint-rgb), 0.16); border-radius: 6px; }
.board-page .board-hint { margin-top: 10px; margin-bottom: 0; }
.board-page .footer { margin-top: 12px; }

/* ---- Project form sections ------------------------------------------- */
.form-section { margin-bottom: 26px; }
.form-section + .form-section { padding-top: 24px; border-top: 1px solid var(--glass-border); }
.form-section-head { margin-bottom: 16px; }
.form-section-head h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-head p { color: var(--text-muted); font-size: 0.8rem; margin-top: 3px; }
label .req { color: var(--primary); font-weight: 700; }
.badge-optional {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(var(--tint-rgb), 0.06);
  border-radius: 999px;
  padding: 3px 9px;
}

.form-optional {
  background: rgba(var(--tint-rgb), 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.form-optional > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.form-optional > summary::-webkit-details-marker { display: none; }
.form-optional > summary .form-section-head { margin-bottom: 0; }
.form-optional .optional-chevron { color: var(--text-muted); transition: transform 0.2s; font-size: 0.9rem; }
.form-optional[open] .optional-chevron { transform: rotate(180deg); }
.form-optional[open] > summary { margin-bottom: 18px; }

/* ---- Member multi-select --------------------------------------------- */
.member-select { position: relative; }
.member-select-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.member-select.is-open .member-select-control,
.member-select-control:focus-within {
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.member-chips { display: contents; }
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 107, 53, 0.09);
  border: 1px solid rgba(255, 107, 53, 0.22);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 6px 4px 5px;
  font-size: 0.82rem;
  font-weight: 500;
  max-width: 100%;
}
.member-chip .avatar.sm { width: 22px; height: 22px; font-size: 0.6rem; }
.member-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-chip button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 3px;
  border-radius: 50%;
}
.member-chip button:hover { color: var(--danger); }
.member-search {
  flex: 1 1 150px;
  min-width: 120px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 2px !important;
  font-size: 0.88rem;
  width: auto !important;
}
.member-search:focus { box-shadow: none !important; }

.member-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  margin-top: 6px;
  max-height: 268px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.member-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
/* display:flex above beats the bare [hidden] UA rule — force hide scoped-out people */
.member-option[hidden],
.member-option.hidden {
  display: none !important;
}
.member-option:hover, .member-option.is-active { background: rgba(255, 107, 53, 0.07); }
.member-option input[type="checkbox"] { display: none; }
.member-option .member-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.member-option .member-meta strong { font-size: 0.88rem; color: var(--text); font-weight: 600; }
.member-option .member-meta small { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-option .member-tick { color: var(--primary); font-weight: 700; opacity: 0; }
.member-option.is-selected .member-tick { opacity: 1; }
.member-empty { padding: 12px 10px; font-size: 0.82rem; }
.member-placeholder { color: var(--text-muted); font-size: 0.85rem; padding: 4px 2px; }

@media (max-width: 720px) {
  .form-optional { padding: 14px; }
}

/* ---- Right-side detail drawer ----------------------------------------- */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(var(--tint-rgb), 0.32);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-scrim.is-open { opacity: 1; }

/* ---- Confirm modal ---------------------------------------------------- */
.confirm-scrim {
  position: fixed;
  inset: 0;
  background: rgba(var(--shadow-rgb), 0.42);
  backdrop-filter: blur(4px);
  z-index: 120;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.confirm-scrim.is-open { opacity: 1; }
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.confirm-modal.is-open { pointer-events: auto; }
.confirm-modal[hidden], .confirm-scrim[hidden] { display: none !important; }
.confirm-modal-card {
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--surface-edge);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow:
    0 8px 24px rgba(var(--shadow-rgb), 0.12),
    0 28px 64px rgba(var(--shadow-rgb), 0.18);
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
.confirm-modal.is-open .confirm-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.confirm-modal-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.confirm-modal-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.drawer {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(780px, calc(100vw - 28px));
  background: var(--bg-elevated);
  border: 1px solid var(--surface-edge);
  border-radius: 22px;
  /* Layered, warm-tinted shadow so the panel reads as lifted off the page. */
  box-shadow:
    0 1px 1px rgba(var(--shadow-rgb), 0.04),
    0 8px 16px rgba(var(--shadow-rgb), 0.06),
    0 24px 48px rgba(var(--shadow-rgb), 0.12),
    0 48px 96px rgba(var(--shadow-rgb), 0.14),
    -1px 0 0 rgba(255, 107, 53, 0.08);
  z-index: 91;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 24px)) scale(0.97);
  opacity: 0;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}
.drawer.is-open { transform: translateX(0) scale(1); opacity: 1; }
.drawer-inner { display: flex; flex-direction: column; min-height: 0; flex: 1; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--glass-border);
}
.drawer-eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 5px;
}
.drawer-head h3 { font-size: 1.1rem; font-weight: 700; line-height: 1.35; }
.drawer-sub { color: var(--text-muted); font-size: 0.8rem; margin-top: 4px; }
.drawer-close {
  border: 0;
  background: rgba(var(--tint-rgb), 0.05);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.drawer-close:hover { background: rgba(255, 61, 129, 0.12); color: var(--danger); }

.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.drawer-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.drawer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.drawer-stats div {
  background: rgba(var(--tint-rgb), 0.03);
  border-radius: 12px;
  padding: 10px 12px;
}
.drawer-stats span { display: block; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.drawer-stats strong { font-family: var(--font-display); font-size: 1.15rem; }
.drawer-stats strong.danger { color: var(--danger); }

.drawer-section { margin-top: 22px; }
.drawer-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.drawer-section h4 .count {
  background: rgba(var(--tint-rgb), 0.06);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.68rem;
}
.drawer-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.drawer-text { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6; word-break: break-word; }
.drawer-text.pre { white-space: pre-wrap; }
.info-row.stacked { display: block; }
.info-row.stacked p { margin-top: 6px; font-size: 0.84rem; color: var(--text-secondary); white-space: pre-wrap; }

.drawer-person { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.drawer-person .member-meta { display: flex; flex-direction: column; }
.drawer-person .member-meta strong { font-size: 0.87rem; }
.drawer-person .member-meta small { font-size: 0.72rem; color: var(--text-muted); }

.drawer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 7px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.18s, transform 0.18s;
}
.drawer-row:hover { border-color: rgba(255, 107, 53, 0.45); transform: translateX(-2px); }
.drawer-row-id { font-family: var(--font-display); font-size: 0.74rem; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.drawer-row-title { flex: 1; font-size: 0.83rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drawer-evidence { display: flex; flex-wrap: wrap; gap: 7px; }
.drawer-chip {
  font-size: 0.76rem;
  background: rgba(var(--tint-rgb), 0.04);
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--text-secondary);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-chip:hover { background: rgba(255, 107, 53, 0.1); color: var(--text); }

.drawer-comment { border-left: 2px solid var(--glass-border); padding: 0 0 12px 12px; margin-bottom: 4px; }
.drawer-comment-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.drawer-comment-head strong { font-size: 0.82rem; }
.drawer-comment-head small { font-size: 0.7rem; color: var(--text-muted); }

.drawer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid var(--glass-border);
  background: rgba(var(--tint-rgb), 0.015);
}
.drawer-delete-form { margin-left: auto; }
.drawer-loading[hidden] { display: none; }
.drawer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface-translucent);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 107, 53, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.is-drawer-open { cursor: pointer; }

@media (max-width: 720px) {
  .drawer { width: 100vw; }
  .drawer-split, .drawer-stats, .drawer-form-grid { grid-template-columns: 1fr; }
}
.bug-card.is-drawer-open .bug-title:hover { color: var(--primary); }
.project-card.is-drawer-open:hover { border-color: rgba(255, 107, 53, 0.35); }
.project-card.is-drawer-open:focus-visible,
.bug-card.is-drawer-open:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
tr.is-drawer-open { cursor: pointer; }
tr.is-drawer-open:hover { background: rgba(255, 107, 53, 0.04); }

/* ---- Drawer form and file grid ----------------------------------------- */
.drawer-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drawer-update {
  background: rgba(var(--tint-rgb), 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.drawer-form-row { margin-bottom: 16px; }
.drawer-form-row > label { font-size: 0.78rem; }
.drawer-form-row textarea { min-height: 110px; }
.drawer-form-error {
  background: rgba(255, 61, 129, 0.08);
  border: 1px solid rgba(255, 61, 129, 0.25);
  color: var(--on-danger);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.drawer-form-error[hidden] { display: none; }
.drawer-form .btn.w-100 { width: 100%; justify-content: center; }
.drawer-form.is-saving { opacity: 0.6; pointer-events: none; }

.drawer-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.drawer-file {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px;
  text-decoration: none;
  background: var(--surface);
  transition: border-color 0.18s;
  overflow: hidden;
}
.drawer-file:hover { border-color: rgba(255, 107, 53, 0.45); }
.drawer-file img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}
.drawer-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 82px;
  border-radius: 7px;
  background: rgba(var(--tint-rgb), 0.05);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}
.drawer-file-name {
  font-size: 0.74rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-file-size { font-size: 0.68rem; color: var(--text-muted); }

.drawer-comment .drawer-files { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

/* ---- Drawer: inline editable fields (Asana-style) ---------------------- */
.drawer-head-main { min-width: 0; }
.drawer-fields {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 4px;
  transition: opacity 0.2s;
}
.drawer-fields.is-saving { opacity: 0.55; pointer-events: none; }
.field-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 40px;
  padding: 3px 0;
}
.field-key {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.field-val { font-size: 0.87rem; color: var(--text); min-width: 0; }
.field-people { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--tint-rgb), 0.04);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  font-size: 0.82rem;
  font-weight: 500;
}
.person-chip .avatar.sm { width: 22px; height: 22px; font-size: 0.6rem; }

.inline-select {
  width: auto !important;
  min-width: 168px;
  font-weight: 600;
  font-size: 0.84rem !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  border-color: transparent !important;
  background: rgba(var(--tint-rgb), 0.05) !important;
  box-shadow: none !important;
}
.inline-select:hover { background: rgba(var(--tint-rgb), 0.08) !important; }
.inline-select.status-open, .inline-select.status-reopened { background: rgba(255, 61, 129, 0.12) !important; color: var(--on-danger); }
.inline-select.status-assigned, .inline-select.status-in-progress { background: rgba(59, 130, 246, 0.12) !important; color: var(--on-info); }
.inline-select.status-ready-for-retest, .inline-select.status-retesting { background: rgba(245, 158, 11, 0.16) !important; color: var(--on-warning-deep); }
.inline-select.status-closed { background: rgba(0, 184, 148, 0.14) !important; color: var(--on-success); }

.member-select.is-quick .member-select-control {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  min-height: 36px;
  padding: 3px 4px;
}
.member-select.is-quick:hover .member-select-control { background: rgba(var(--tint-rgb), 0.04); }
.member-select.is-quick .member-select-control:focus-within { background: var(--surface); border-color: rgba(255, 107, 53, 0.5); }

/* ---- Drawer: comment composer ---------------------------------------- */
.drawer-composer {
  background: rgba(var(--tint-rgb), 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.drawer-composer form.is-saving { opacity: 0.6; pointer-events: none; }
.composer-top { display: flex; gap: 10px; align-items: flex-start; }
.composer-top textarea {
  min-height: 62px;
  border-radius: 12px;
  font-size: 0.87rem;
  box-shadow: none;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-left: 38px;
  flex-wrap: wrap;
}
.composer-file { position: relative; }
.composer-attach {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 11px;
  border-radius: 9px;
  background: rgba(var(--tint-rgb), 0.04);
  display: inline-block;
}
.composer-attach:hover { background: rgba(255, 107, 53, 0.1); color: var(--text); }

.composer-attach.is-attach-focus,
.file-upload-label.is-attach-focus,
.file-upload.is-attach-focus {
  outline: 2px solid rgba(255, 107, 53, 0.85);
  outline-offset: 2px;
  border-color: rgba(255, 107, 53, 0.55);
  background: rgba(255, 107, 53, 0.12);
  color: var(--text);
  transition: outline-color 0.2s, background 0.2s, border-color 0.2s;
}
.composer-file .file-upload-list { margin-top: 8px; }

/* ---- Drawer: activity + depth ---------------------------------------- */
.drawer-activity .drawer-comment {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-left: 3px solid rgba(255, 107, 53, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.drawer-section .drawer-files .drawer-file { box-shadow: var(--shadow-sm); }
.drawer-body > .drawer-section > h4 { margin-top: 2px; }

.drawer-flash {
  position: absolute;
  top: 18px;
  right: 54px;
  left: auto;
  bottom: auto;
  transform: translateY(-6px);
  background: var(--flash-bg);
  color: var(--flash-fg);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(var(--shadow-rgb), 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 5;
  max-width: calc(100% - 100px);
  text-align: center;
}
.drawer-flash.is-on { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; gap: 4px; align-items: start; }
  .composer-foot { padding-left: 0; }
}

/* ---- Drawer: create form --------------------------------------------- */
.drawer-create { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.drawer-create.is-saving { opacity: 0.6; pointer-events: none; }
.drawer-create .drawer-form-row textarea { min-height: 92px; }

/* ---- Depth pass: layered shadows on interactive surfaces --------------- */
.project-card {
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.03),
    0 4px 12px rgba(var(--shadow-rgb), 0.05);
}
.project-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 2px 4px rgba(var(--shadow-rgb), 0.04),
    0 10px 22px rgba(var(--shadow-rgb), 0.09),
    0 24px 48px rgba(var(--shadow-rgb), 0.10);
  border-color: rgba(255, 107, 53, 0.28);
}
.bug-card:hover {
  box-shadow:
    0 2px 4px rgba(var(--shadow-rgb), 0.04),
    0 10px 22px rgba(var(--shadow-rgb), 0.10);
}
.bug-card.dragging {
  box-shadow:
    0 12px 28px rgba(var(--shadow-rgb), 0.16),
    0 28px 56px rgba(var(--shadow-rgb), 0.14);
}
.panel.glass, .card.stat {
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.03),
    0 6px 18px rgba(var(--shadow-rgb), 0.05);
}
.drawer-scrim { background: rgba(var(--shadow-rgb), 0.38); backdrop-filter: blur(3px); }

/* ---- Drawer: evidence management in the edit panel --------------------- */
.drawer-file { position: relative; }
.drawer-file > a { text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.drawer-file-remove {
  margin-top: 6px;
  border: 0;
  width: 100%;
  background: rgba(255, 61, 129, 0.08);
  color: var(--on-danger);
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 0;
  border-radius: 7px;
  cursor: pointer;
}
.drawer-file-remove:hover { background: rgba(255, 61, 129, 0.16); }
.drawer-file-remove[disabled] { opacity: 0.5; cursor: default; }
.drawer-create .evidence-url-row { display: flex; gap: 8px; margin-bottom: 8px; }
.drawer-create .evidence-url-row input { flex: 1; }

/* ---- Project workspace tabs ------------------------------------------- */
.tabs-pill {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  gap: 4px;
  padding: 5px;
  margin-bottom: 22px;
  background: rgba(var(--tint-rgb), 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: inset 0 2px 4px rgba(var(--shadow-rgb), 0.05);
  /* Wraps instead of scrolling: no scrollbar parked in the track on systems
     set to always show them, and the active pill's glow is never clipped. */
  flex-wrap: wrap;
}
.tabs-pill .tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-weight: 600;
}
.tabs-pill .tab:hover { background: var(--surface-hover); color: var(--text); }

/* The active tab carries the brand gradient — nothing else on the page does,
   so there is never a question about which one is selected. */
.tabs-pill .tab.active {
  background: linear-gradient(135deg, #FF6B35, #FF3D81);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow:
    0 2px 6px rgba(255, 61, 129, 0.28),
    0 8px 20px rgba(255, 107, 53, 0.32);
  transform: translateY(-1px);
}
.tabs-pill .tab.active:hover { color: #FFFFFF; }

.tab-count {
  background: rgba(var(--tint-rgb), 0.08);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
}
.tabs-pill .tab.active .tab-count { background: rgba(255, 255, 255, 0.26); color: #FFFFFF; }

/* Marker sits inside the pill, so the scroll container never clips it. */
.tabs-pill .tab.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--surface-translucent);
  transform: translateX(-50%);
}

.tab-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab-panel-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}
.tab-panel-head p { color: var(--text-muted); font-size: 0.82rem; margin-top: 3px; }

a.project-card.is-link-card { text-decoration: none; color: inherit; display: block; }

/* ---- Notes ------------------------------------------------------------ */
.notes-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.note-composer { position: sticky; top: 16px; }
.notes-feed { display: flex; flex-direction: column; gap: 12px; }
.note-card {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.03),
    0 6px 16px rgba(var(--shadow-rgb), 0.05);
  transition: box-shadow 0.2s, transform 0.2s;
}
.note-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(var(--shadow-rgb), 0.04),
    0 12px 28px rgba(var(--shadow-rgb), 0.09);
}
.note-card.is-pinned {
  border-color: rgba(255, 107, 53, 0.3);
  background: linear-gradient(180deg, rgba(255, 107, 53, 0.05), transparent 60px), var(--bg-elevated);
}
.note-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.note-by { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.note-by strong { font-size: 0.88rem; }
.note-by small { font-size: 0.72rem; color: var(--text-muted); }
.note-pin { font-size: 0.9rem; }
.note-actions { margin: 0; }
.note-delete {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 7px;
}
.note-delete:hover { background: rgba(255, 61, 129, 0.1); color: var(--danger); }
.note-title { font-size: 0.98rem; font-weight: 700; margin-bottom: 6px; }
.note-body { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; word-break: break-word; }

/* ---- Files & documents ------------------------------------------------ */
.doc-upload { margin-bottom: 18px; }
.doc-upload-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.doc-upload-row input { flex: 1; min-width: 200px; }
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}
.doc-card {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.03),
    0 5px 14px rgba(var(--shadow-rgb), 0.05);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.doc-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 53, 0.32);
  box-shadow:
    0 2px 4px rgba(var(--shadow-rgb), 0.04),
    0 14px 30px rgba(var(--shadow-rgb), 0.10);
}
.doc-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 112px;
  text-decoration: none;
  background: rgba(var(--tint-rgb), 0.04);
}
.doc-preview img { width: 100%; height: 100%; object-fit: cover; }
.doc-ext {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.kind-pdf .doc-preview { background: rgba(255, 61, 129, 0.1); }
.kind-pdf .doc-ext { color: var(--on-danger); }
.kind-doc .doc-preview { background: rgba(59, 130, 246, 0.1); }
.kind-doc .doc-ext { color: var(--on-info); }
.kind-sheet .doc-preview { background: rgba(0, 184, 148, 0.12); }
.kind-sheet .doc-ext { color: var(--on-success); }
.kind-deck .doc-preview { background: rgba(245, 158, 11, 0.14); }
.kind-deck .doc-ext { color: var(--on-warning-deep); }
.kind-archive .doc-preview { background: rgba(123, 97, 255, 0.12); }
.kind-archive .doc-ext { color: var(--on-purple); }

.doc-meta { padding: 11px 13px 8px; display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.doc-meta strong {
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-desc { font-size: 0.76rem; color: var(--text-secondary); }
.doc-meta small { font-size: 0.7rem; color: var(--text-muted); }
.doc-actions {
  display: flex;
  gap: 6px;
  padding: 0 13px 12px;
  align-items: center;
}
.doc-actions form { margin: 0; }

@media (max-width: 900px) {
  .notes-layout { grid-template-columns: 1fr; }
  .note-composer { position: static; }
}

/* ---- Project workspace hero ------------------------------------------- */
.project-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  margin: 6px 0 22px;
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.03),
    0 8px 24px rgba(var(--shadow-rgb), 0.07);
}
.project-hero-avatar {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(var(--shadow-rgb), 0.18);
}
.project-hero-main { min-width: 0; }
.project-hero-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-hero-title h1 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
}
.project-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 0.81rem;
  color: var(--text-secondary);
}
.project-hero-meta span, .project-hero-meta a { display: inline-flex; align-items: center; gap: 5px; }
.project-hero-meta .is-overdue { color: var(--danger); font-weight: 700; }
.project-hero-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.project-hero-progress { flex: 1; min-width: 200px; }
.project-hero-progress .progress-bar { margin-bottom: 5px; }
.project-hero-progress small { font-size: 0.74rem; color: var(--text-muted); }
.project-hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.project-hero-actions form { margin: 0; }

@media (max-width: 860px) {
  .project-hero { grid-template-columns: auto 1fr; }
  .project-hero-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .project-hero { grid-template-columns: 1fr; text-align: left; }
  .project-hero-avatar { width: 54px; height: 54px; font-size: 1.5rem; border-radius: 16px; }
  .project-hero-title h1 { font-size: 1.25rem; }
}

/* ---- Board / list view toggle ----------------------------------------- */
.view-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  background: rgba(var(--tint-rgb), 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 3px rgba(var(--shadow-rgb), 0.05);
}
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.view-toggle-btn:hover { background: var(--surface-translucent); color: var(--text); }
.view-toggle-btn.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.07),
    0 4px 10px rgba(var(--shadow-rgb), 0.08);
}
.view-toggle-icon { font-size: 0.9rem; line-height: 1; }

/* A board embedded in the project workspace scrolls sideways on its own
   rather than stretching to the viewport like the standalone board page. */
.project-board-wrap { overflow-x: auto; padding-bottom: 6px; }
.project-board-wrap .kanban {
  min-height: 440px;
  align-items: stretch;
}
.project-board-wrap .kanban-col {
  min-height: 440px;
  max-height: 560px;
}
.project-board-wrap .kanban-cards {
  flex: 1 1 auto;
  min-height: 360px;
  overflow-y: auto;
  max-height: 480px;
}

/* ---- Bug list table --------------------------------------------------- */
.bug-list-table .list-code {
  display: block;
  font-family: var(--font-display);
  font-size: 0.76rem;
  color: var(--primary);
  font-weight: 700;
}
.bug-list-table .list-title {
  display: block;
  font-size: 0.86rem;
  color: var(--text);
  margin-top: 2px;
}
.bug-list-table td { vertical-align: middle; }
.bug-list-table .avatar-stack { justify-content: flex-start; }

@media (max-width: 640px) {
  .view-toggle-btn { padding: 7px 11px; }
}

/* ---- Notification bell ------------------------------------------------- */
.notify { position: relative; }
.notify-bell { position: relative; }
.notify-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #FFFFFF;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-elevated);
}
.notify-count[hidden] { display: none; }
.notify-bell.has-unread { animation: bellNudge 1.6s ease 1; }
@keyframes bellNudge {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(-6deg); }
  60% { transform: rotate(4deg); }
}

.notify-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 32px));
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow:
    0 2px 6px rgba(var(--shadow-rgb), 0.06),
    0 18px 44px rgba(var(--shadow-rgb), 0.16);
  z-index: 80;
  overflow: hidden;
}
.notify-menu[hidden] { display: none; }
.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--glass-border);
}
.notify-head strong { font-size: 0.9rem; }
.notify-mark {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.notify-mark:hover { text-decoration: underline; }
.notify-list { max-height: 380px; overflow-y: auto; }
.notify-item {
  display: flex;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(var(--tint-rgb), 0.05);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.notify-item:hover { background: rgba(255, 107, 53, 0.05); }
.notify-item.is-unread { background: rgba(255, 107, 53, 0.06); }
.notify-item.is-unread strong::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-left: 6px;
  vertical-align: middle;
}
.notify-icon { font-size: 1.05rem; line-height: 1.3; flex-shrink: 0; }
.notify-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notify-body strong { font-size: 0.85rem; }
.notify-msg { font-size: 0.79rem; color: var(--text-secondary); line-height: 1.45; }
.notify-body small { font-size: 0.7rem; color: var(--text-muted); }
.notify-empty { padding: 26px 16px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }
.notify-foot { padding: 10px 16px; border-top: 1px solid var(--glass-border); background: rgba(var(--tint-rgb), 0.02); }
.push-toggle {
  width: 100%;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.push-toggle:hover { border-color: rgba(255, 107, 53, 0.4); color: var(--text); }
.push-toggle.is-on { background: rgba(0, 184, 148, 0.1); border-color: rgba(0, 184, 148, 0.35); color: var(--on-success); }
.push-toggle[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---- Live toasts ------------------------------------------------------- */
.live-toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
}
.live-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--primary);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow:
    0 2px 6px rgba(var(--shadow-rgb), 0.06),
    0 16px 36px rgba(var(--shadow-rgb), 0.16);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.live-toast.is-on { opacity: 1; transform: translateY(0) scale(1); }
.live-toast.is-clickable { cursor: pointer; }
.live-toast.is-clickable:hover { border-left-color: var(--accent); }
.live-toast-icon { font-size: 1.05rem; line-height: 1.3; }
.live-toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.live-toast-body strong { font-size: 0.85rem; }
.live-toast-body span { font-size: 0.79rem; color: var(--text-secondary); line-height: 1.45; }
.live-toast-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.live-toast-close:hover { color: var(--danger); }

/* A region that just changed underneath the reader gets a brief wash. */
.live-updated { animation: liveFlash 1.2s ease; }
@keyframes liveFlash {
  0% { background-color: rgba(255, 107, 53, 0.10); }
  100% { background-color: transparent; }
}

@media (max-width: 560px) {
  .live-toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* ---- Theme toggle ------------------------------------------------------ */
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle .theme-icon {
  display: block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
/* Only the icon for the theme you would switch *to* is shown. */
:root:not([data-theme="dark"]) .theme-toggle .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
.theme-toggle:hover .theme-icon { transform: rotate(-18deg) scale(1.08); }

/* ---- Dark-theme corrections ------------------------------------------- */
:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(255, 107, 53, 0.10), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(123, 97, 255, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Inputs need a surface of their own — the page ground is too dark to sit on. */
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="email"],
:root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] input[type="url"],
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input:not([type]),
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: rgba(var(--tint-rgb), 0.05);
  border-color: var(--glass-border);
  color: var(--text);
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: var(--text-muted); }
:root[data-theme="dark"] input[disabled],
:root[data-theme="dark"] select[disabled],
:root[data-theme="dark"] textarea[disabled] { background: rgba(var(--tint-rgb), 0.03); color: var(--text-muted); }
/* The native date/time picker glyph is black by default. */
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.6); }

:root[data-theme="dark"] .btn.btn-light { background: rgba(var(--tint-rgb), 0.07); color: var(--text-secondary); }
:root[data-theme="dark"] .btn.btn-light:hover { background: rgba(var(--tint-rgb), 0.12); color: var(--text); }
:root[data-theme="dark"] .tabs-pill .tab.active { color: #FFFFFF; }
:root[data-theme="dark"] .view-toggle-btn.active { background: var(--surface); }
:root[data-theme="dark"] .drawer { border-color: var(--glass-border); }
:root[data-theme="dark"] .drawer-loading { background: rgba(21, 28, 44, 0.82); }
:root[data-theme="dark"] .drawer-scrim { background: rgba(0, 0, 0, 0.55); }
:root[data-theme="dark"] .confirm-scrim { background: rgba(0, 0, 0, 0.6); }
:root[data-theme="dark"] .notify-count { box-shadow: 0 0 0 2px var(--bg-elevated); }
:root[data-theme="dark"] .push-toggle { background: rgba(var(--tint-rgb), 0.05); }
:root[data-theme="dark"] .push-toggle.is-on { background: rgba(18, 201, 165, 0.14); border-color: rgba(18, 201, 165, 0.4); color: var(--on-success); }
:root[data-theme="dark"] .doc-preview { background: rgba(var(--tint-rgb), 0.06); }
:root[data-theme="dark"] .kind-pdf .doc-preview { background: rgba(255, 85, 145, 0.14); }
:root[data-theme="dark"] .kind-doc .doc-preview { background: rgba(147, 180, 255, 0.14); }
:root[data-theme="dark"] .kind-sheet .doc-preview { background: rgba(18, 201, 165, 0.14); }
:root[data-theme="dark"] .kind-deck .doc-preview { background: rgba(251, 191, 36, 0.16); }
:root[data-theme="dark"] .kind-archive .doc-preview { background: rgba(145, 121, 255, 0.14); }
:root[data-theme="dark"] .note-card.is-pinned {
  background: linear-gradient(180deg, rgba(255, 122, 70, 0.10), transparent 60px), var(--surface);
}
:root[data-theme="dark"] .live-updated { animation: liveFlashDark 1.2s ease; }
@keyframes liveFlashDark {
  0% { background-color: rgba(255, 122, 70, 0.16); }
  100% { background-color: transparent; }
}
:root[data-theme="dark"] img:not([src$=".svg"]) { filter: brightness(0.94); }
:root[data-theme="dark"] .drawer-file img,
:root[data-theme="dark"] .doc-preview img { filter: none; }

/* Print always uses the light palette. */
@media print {
  :root[data-theme="dark"] { color-scheme: light; }
}
.theme-toggle-floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  background: var(--surface-translucent);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

/* ---- Bug scope filter -------------------------------------------------- */
.scope-toggle .view-toggle-btn { gap: 7px; }
.scope-count {
  background: rgba(var(--tint-rgb), 0.09);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 700;
}
.view-toggle-btn.active .scope-count { background: rgba(255, 107, 53, 0.16); color: var(--primary); }
/* A faint marker on cards that are your own when viewing everything. */
.bug-card.is-mine { border-left: 3px solid rgba(255, 107, 53, 0.55); }
.empty-state .btn { margin-top: 12px; }

/* ---- Members tab ------------------------------------------------------- */
.members-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.member-add { position: sticky; top: 16px; }
.members-list { display: flex; flex-direction: column; gap: 18px; }
.member-group h4 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.member-group h4 .count {
  background: rgba(var(--tint-rgb), 0.07);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.68rem;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.03),
    0 4px 12px rgba(var(--shadow-rgb), 0.04);
  transition: border-color 0.18s, transform 0.18s;
}
.member-row:hover { border-color: rgba(255, 107, 53, 0.3); transform: translateY(-1px); }
.member-row-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.member-row-meta strong { font-size: 0.9rem; }
.member-row-meta small { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row-stats { flex-shrink: 0; }
.member-row-action { margin: 0; flex-shrink: 0; }

@media (max-width: 900px) {
  .members-layout { grid-template-columns: 1fr; }
  .member-add { position: static; }
  .member-row { flex-wrap: wrap; }
  .member-row-meta { flex-basis: 60%; }
}

/* ---- Rich text editor -------------------------------------------------- */
.rich-editor { --rich-min-height: 130px; }
/* Before the script runs the textarea is the editor; after, it is the field. */
.rich-editor.is-enhanced .rich-editor-input { display: none; }
.rich-editor:not(.is-enhanced) .rich-editor-mount { display: none; }
.rich-editor.is-enhanced {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rich-editor.is-focused {
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.rich-editor.is-invalid { border-color: var(--danger); }
.rich-editor .ql-toolbar.ql-snow,
.rich-editor .ql-container.ql-snow { border: 0; font-family: var(--font); }
.rich-editor .ql-toolbar.ql-snow {
  border-bottom: 1px solid var(--glass-border);
  background: rgba(var(--tint-rgb), 0.03);
  padding: 6px 8px;
}
.rich-editor .ql-container.ql-snow { font-size: 0.88rem; }
.rich-editor .ql-editor {
  min-height: var(--rich-min-height);
  color: var(--text);
  line-height: 1.6;
  padding: 12px 14px;
}
.rich-editor .ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; left: 14px; right: 14px; }
.rich-editor .ql-editor ul, .rich-editor .ql-editor ol { padding-left: 1.2em; }
.rich-editor .ql-snow .ql-stroke { stroke: var(--text-secondary); }
.rich-editor .ql-snow .ql-fill { fill: var(--text-secondary); }
.rich-editor .ql-snow .ql-picker { color: var(--text-secondary); }
.rich-editor .ql-snow button:hover .ql-stroke,
.rich-editor .ql-snow button.ql-active .ql-stroke { stroke: var(--primary); }
.rich-editor .ql-snow button:hover .ql-fill,
.rich-editor .ql-snow button.ql-active .ql-fill { fill: var(--primary); }
.rich-editor .ql-snow .ql-editor blockquote {
  border-left: 3px solid var(--glass-border);
  padding-left: 12px;
  color: var(--text-secondary);
}
.rich-editor .ql-snow .ql-editor pre.ql-syntax,
.rich-editor .ql-snow .ql-editor code {
  background: rgba(var(--tint-rgb), 0.06);
  color: var(--text);
  border-radius: 6px;
}
.composer-top .rich-editor { flex: 1; min-width: 0; }

/* Rendered rich content (bug description, comments, notes). */
.rich-content ul, .rich-content ol { padding-left: 1.25em; margin: 6px 0; }
.rich-content li { margin: 3px 0; }
.rich-content p { margin: 6px 0; }
.rich-content p:first-child { margin-top: 0; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content blockquote {
  border-left: 3px solid var(--glass-border);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-secondary);
}
.rich-content pre, .rich-content code {
  background: rgba(var(--tint-rgb), 0.06);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.86em;
}
.rich-content pre { padding: 10px 12px; overflow-x: auto; }
.rich-content a { color: var(--primary); }
.drawer-text.rich-content ul, .drawer-text.rich-content ol { padding-left: 1.2em; }

/* Quill ships light-mode chrome; retint it for the dark palette. */
:root[data-theme="dark"] .rich-editor .ql-toolbar.ql-snow { background: rgba(var(--tint-rgb), 0.04); }
:root[data-theme="dark"] .rich-editor .ql-snow .ql-picker-options {
  background: var(--bg-elevated);
  border-color: var(--glass-border);
}
:root[data-theme="dark"] .rich-editor .ql-snow .ql-tooltip {
  background: var(--bg-elevated);
  border-color: var(--glass-border);
  color: var(--text);
  box-shadow: var(--shadow);
}
:root[data-theme="dark"] .rich-editor .ql-snow .ql-tooltip input[type="text"] {
  background: rgba(var(--tint-rgb), 0.06);
  border-color: var(--glass-border);
  color: var(--text);
}

/* ---- Sidebar: dark theme ---------------------------------------------- */
:root[data-theme="dark"] .sidebar {
  background: rgba(23, 31, 48, 0.82);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 24px 56px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
:root[data-theme="dark"] .sidebar::after {
  background: linear-gradient(160deg, rgba(255, 122, 70, 0.09), transparent 42%);
}
:root[data-theme="dark"] .nav-item:hover { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .user-card:hover { background: rgba(255, 255, 255, 0.05); }

/* ---- Sidebar: shared polish -------------------------------------------- */
.sidebar .avatar { box-shadow: 0 4px 10px rgba(var(--shadow-rgb), 0.18); }
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-info strong {
  font-size: 0.86rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-info span { font-size: 0.72rem; color: var(--text-muted); }

/* Slim the panel down before it has to collapse entirely. */
@media (max-width: 1180px) and (min-width: 901px) {
  .sidebar { width: 232px; padding: 18px 12px; }
  .nav-item { font-size: 0.88rem; padding: 10px 12px; gap: 10px; }
  .main { padding: 22px 20px 44px; }
}
