/* IDEA Base App Styles */

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-header h1 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-sm);
}

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

.login-header p {
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.login-body {
  margin-bottom: var(--space-xl);
}

.btn-full {
  width: 100%;
}

.login-note {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-md);
  margin-bottom: 0;
}

.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.btn-google:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: var(--space-md) 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider span {
  padding: 0 var(--space-md);
}

.login-footer {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-lg);
}

.login-footer a {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.login-switch {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
}

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

.login-switch a:hover {
  text-decoration: underline;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.ml-sm { margin-left: var(--space-sm); }
.ml-md { margin-left: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.text-center { text-align: center; }

/* App Layout */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.brand {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

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

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent);
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
}

.user-info span {
  font-size: var(--font-size-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-xl);
  transition: margin-left var(--transition-normal);
}

.view {
  max-width: 1200px;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.view-header h1 {
  font-size: var(--font-size-xl);
}

.view-actions {
  display: flex;
  gap: var(--space-sm);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
}

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

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

.breadcrumb span:last-child {
  color: var(--text);
}

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

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

.project-card p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-meta {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.project-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  margin-bottom: var(--space-lg);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Project Stats */
.project-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: var(--space-xs);
}

/* CI Status Indicator */
.ci-indicator {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: var(--space-xs);
  vertical-align: middle;
}

.ci-indicator.ci-success {
  background: var(--success);
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.4);
}

.ci-indicator.ci-failure {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(248, 81, 73, 0.4);
}

.ci-indicator.ci-pending {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(210, 153, 34, 0.4);
  animation: pulse-pending 1.5s ease-in-out infinite;
}

.ci-indicator.ci-neutral {
  background: var(--text-muted);
}

.ci-indicator.ci-no-ci {
  background: transparent;
  border: 2px dashed var(--text-muted);
}

@keyframes pulse-pending {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.stat-ci .stat-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.stat-ci .ci-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
}

/* Progress Bar */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.progress-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(248, 81, 73, 0.3);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: var(--radius-sm);
  transition: width var(--transition-normal);
  width: 0%;
}

.progress-bar-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

/* Project Card Progress Bar */
.project-card-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
}

.project-card-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(248, 81, 73, 0.3);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.project-card-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: var(--radius-sm);
  transition: width var(--transition-normal);
}

.project-card-progress-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* Task List */
.task-section {
  margin-bottom: var(--space-xl);
}

.task-section h3 {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-md);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.task-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.task-item:hover {
  border-color: var(--accent);
}

.task-item[draggable="true"] {
  cursor: grab;
}

.task-item[draggable="true"]:active {
  cursor: grabbing;
}

.task-item.dragging {
  opacity: 0.5;
  border-color: var(--accent);
  background: var(--bg);
}

/* Drop position indicators - show line where item will be inserted */
.task-item.drop-before {
  position: relative;
}

.task-item.drop-before::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent);
}

.task-item.drop-after {
  position: relative;
}

.task-item.drop-after::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent);
}

.task-drag-handle {
  color: var(--text-muted);
  font-size: 14px;
  cursor: grab;
  padding: 0 var(--space-xs);
  opacity: 0.4;
  transition: opacity var(--transition-fast);
  user-select: none;
}

.task-item:hover .task-drag-handle {
  opacity: 1;
}

.task-drag-handle:active {
  cursor: grabbing;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-item.done .task-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.task-item.done .task-checkbox::after {
  content: "✓";
  font-size: 12px;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

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

.task-title {
  font-weight: 500;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.task-github-link {
  display: inline-flex;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}

.task-github-link:hover {
  opacity: 1;
  color: var(--accent);
}

.task-meta {
  display: flex;
  gap: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.task-id {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  color: var(--text-muted);
  opacity: 0.7;
  font-size: 11px;
}

/* Task Assignees */
.task-assignees {
  display: flex;
  align-items: center;
  gap: -4px;
  margin-left: auto;
  padding-left: var(--space-sm);
}

.task-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: -6px;
  cursor: default;
  transition: transform 0.1s, border-color 0.15s;
}

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

.task-avatar:hover {
  transform: scale(1.1);
  z-index: 2;
}

.task-avatar.active {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  animation: pulse-active 2s infinite;
}

@keyframes pulse-active {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(63, 185, 80, 0);
  }
}

.task-item.has-active-worker {
  border-left: 3px solid var(--success);
}

.task-item.has-active-worker .task-status {
  color: var(--success);
}

/* GitHub Features Collapsible Section */
.github-features-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.github-features-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
  list-style: none;
}

.github-features-toggle::-webkit-details-marker {
  display: none;
}

.github-features-toggle:hover {
  color: var(--text);
}

.github-features-toggle .chevron-icon {
  transition: transform 0.2s ease;
}

.github-features-details[open] .chevron-icon {
  transform: rotate(90deg);
}

.github-features-list {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  border-top: 1px solid var(--border);
}

.github-feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

.github-feature-item svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.github-feature-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.github-feature-item strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.github-feature-item .text-muted {
  font-size: 12px;
}

.github-scope-note {
  font-style: italic;
}

.task-status {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.task-status.todo {
  background: rgba(139, 148, 158, 0.15);
  color: var(--text-muted);
}

.task-status.in_progress {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

.task-status.done {
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
}

/* Task Order Number */
.task-order {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* Completed Section */
.completed-section {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
}

.completed-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.completed-header:hover {
  color: var(--text);
}

.completed-chevron {
  font-size: 10px;
  transition: transform var(--transition-fast);
}

.completed-chevron.expanded {
  transform: rotate(90deg);
}

.completed-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  overflow: hidden;
  transition: max-height var(--transition-normal), opacity var(--transition-normal);
  max-height: 2000px;
  opacity: 1;
}

.completed-list.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Compact Task Item (for completed) */
.task-item.compact {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: 0;
  gap: var(--space-sm);
}

.task-item.compact:hover {
  background: var(--bg-card);
  border-color: transparent;
}

.task-item.compact .task-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.task-item.compact .task-title {
  margin-bottom: 0;
  font-weight: 400;
  font-size: var(--font-size-sm);
}

.task-item.compact .task-checkbox {
  width: 16px;
  height: 16px;
}

.task-item.compact .task-checkbox::after {
  font-size: 10px;
}

.task-time-compact {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Sub-project items in task list */
.task-item.subproject-item {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(88, 166, 255, 0.05) 100%);
  border-color: rgba(88, 166, 255, 0.3);
}

.task-item.subproject-item:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(88, 166, 255, 0.1) 100%);
}

.subproject-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.subproject-arrow {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  margin-left: auto;
  padding-left: var(--space-md);
}

.task-status.subproject {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

/* Sub-project progress bar in task list */
.subproject-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.subproject-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(248, 81, 73, 0.3);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.subproject-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: var(--radius-sm);
  transition: width var(--transition-normal);
}

.subproject-progress-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* Settings */
.settings-section {
  margin-bottom: var(--space-xl);
}

.settings-section h3 {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-md);
}

/* Profile Form */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.profile-avatar-section {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-sm);
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.profile-avatar-actions {
  flex: 1;
}

.profile-avatar-actions .form-group {
  margin-bottom: 0;
}

.form-actions {
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.form-input:disabled {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Secret display group (for webhook secrets, API keys, etc.) */
.secret-display-group {
  display: flex;
  gap: var(--space-xs);
}

.secret-display-group .form-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

.secret-display-group .btn-sm {
  flex-shrink: 0;
  padding: var(--space-sm);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

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

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

.modal-header h2 {
  font-size: var(--font-size-lg);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

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

.modal-content form {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-lg);
}

/* Drawer */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}

.drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

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

.drawer-header h2 {
  font-size: var(--font-size-lg);
  flex: 1;
}

.drawer-header #task-edit-title {
  flex: 1;
  font-size: var(--font-size-lg);
  margin-right: var(--space-md);
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.drawer-body {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
}

.drawer-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.task-section h4 {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
}

.time-tracking {
  display: flex;
  gap: var(--space-xl);
}

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

.time-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.time-value {
  font-size: var(--font-size-lg);
  font-family: var(--font-mono);
  color: var(--text);
}

/* Time entries list */
.time-entries-list {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xs);
}

.time-entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.time-entry-item:last-child {
  border-bottom: none;
}

.time-entry-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.time-entry-duration {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text);
}

.time-entry-duration.negative {
  color: var(--danger);
}

.time-entry-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.time-entry-notes {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-style: italic;
}

.time-entry-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.time-entry-delete:hover {
  color: var(--danger);
  background: rgba(248, 81, 73, 0.1);
}

/* Time Summary Modal */
.time-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.time-summary-stat {
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.time-summary-value {
  display: block;
  font-size: var(--font-size-2xl);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.time-summary-value.over-budget {
  color: var(--danger);
}

.time-summary-value.under-budget {
  color: var(--success);
}

.time-summary-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.time-summary-section {
  margin-bottom: var(--space-xl);
}

.time-summary-section h4 {
  margin-bottom: var(--space-md);
  color: var(--text);
}

.time-summary-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.time-summary-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

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

.time-summary-row.header {
  background: var(--bg-card);
  font-weight: 500;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
}

.time-summary-task-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-summary-task-title .status {
  font-size: var(--font-size-xs);
  margin-left: var(--space-sm);
}

.time-summary-cell {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  text-align: right;
  min-width: 60px;
}

.time-summary-entries {
  max-height: 300px;
  overflow-y: auto;
}

.time-summary-entry {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.time-summary-entry:last-child {
  border-bottom: none;
}

.time-summary-entry-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.time-summary-entry-info {
  flex: 1;
}

.time-summary-entry-task {
  font-size: var(--font-size-sm);
  color: var(--text);
}

.time-summary-entry-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.time-summary-entry-duration {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text);
}

.time-summary-entry-duration.negative {
  color: var(--danger);
}

/* GitHub Repo Section */
.github-repo-section {
  margin-bottom: var(--space-lg);
}

.github-repo-linked {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.github-repo-linked svg {
  color: var(--muted);
}

.github-repo-name {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}

.github-repo-name:hover {
  text-decoration: underline;
}

/* CI Settings Section */
.project-ci-settings {
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ci-settings-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.ci-settings-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.ci-checks-display {
  font-size: 0.875rem;
  color: var(--text);
}

.ci-checks-edit {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.ci-specific-checks {
  margin-top: var(--space-sm);
}

.ci-checks-actions {
  display: flex;
  gap: var(--space-sm);
}

/* GitHub Repo List in Modal */
.github-repo-list {
  max-height: 60vh;
  overflow-y: auto;
}

.github-repo-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.15s;
}

.github-repo-item:hover {
  background: rgba(88, 166, 255, 0.1);
}

.github-repo-item:last-child {
  border-bottom: none;
}

.github-repo-item-info {
  flex: 1;
  min-width: 0;
}

.github-repo-item-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.github-repo-item-desc {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: var(--space-xs);
}

.github-repo-item-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: var(--space-xs);
}

.github-repo-item-lang {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.github-repo-item-lang::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* GitHub Repo Grouping */
.github-repo-group {
  margin-bottom: var(--space-md);
}

.github-repo-group:last-child {
  margin-bottom: 0;
}

.github-repo-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.github-repo-owner-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.github-org-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 1px 4px;
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  border-radius: 3px;
  text-transform: uppercase;
}

.github-repo-linked {
  opacity: 0.6;
}

.github-repo-linked-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
  border-radius: 3px;
  margin-left: var(--space-sm);
}

.btn-xs {
  padding: 2px 6px;
  font-size: 0.75rem;
}

/* GitHub Issues Styles */
.github-issues-filters {
  display: flex;
  justify-content: flex-start;
}

.github-issues-list {
  max-height: 500px;
  overflow-y: auto;
}

.github-issue-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.github-issue-item:last-child {
  border-bottom: none;
}

.github-issue-item:hover {
  background: var(--bg-hover);
}

.github-issue-item.imported {
  opacity: 0.6;
  pointer-events: none;
}

.github-issue-icon {
  flex-shrink: 0;
  color: var(--success);
}

.github-issue-icon.closed {
  color: var(--danger);
}

.github-issue-content {
  flex: 1;
  min-width: 0;
}

.github-issue-title {
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.github-issue-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.75rem;
  color: var(--muted);
}

.github-issue-labels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.github-issue-label {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7rem;
  border-radius: 10px;
  font-weight: 500;
}

.github-issue-actions {
  flex-shrink: 0;
}

.github-issues-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  margin-top: var(--space-md);
}

.modal-lg .modal-content {
  max-width: 700px;
}

/* GitHub PR Link Styles */
.pr-link {
  color: var(--accent);
  text-decoration: none;
}

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

/* PR List for Find PRs modal */
.pr-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pr-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
}

.pr-item.open {
  border-left: 3px solid var(--accent);
}

.pr-item.closed {
  border-left: 3px solid var(--muted);
}

.pr-item.merged {
  border-left: 3px solid var(--success);
}

.pr-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.pr-number {
  font-weight: 600;
  color: var(--text);
}

.pr-match {
  margin-left: auto;
}

.pr-item-title {
  font-size: var(--font-sm);
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.pr-item-meta {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.pr-item-actions {
  display: flex;
  gap: var(--space-xs);
}

.time-input {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* Button Variants */
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: rgba(248, 81, 73, 0.1);
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
}

/* Generated Tasks Preview */
#generated-tasks-list {
  margin-top: var(--space-md);
}

.generated-task {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.generated-task h4 {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
}

.generated-task p {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin: 0;
}

.generated-task .task-estimate {
  display: inline-block;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  margin-top: var(--space-sm);
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.loading::after {
  content: "";
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Inline spinner (for use inside buttons, etc.) */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Mobile Header (visible only on mobile) */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 0 var(--space-md);
  align-items: center;
  justify-content: space-between;
}

.mobile-header .brand {
  font-size: var(--font-size-lg);
}

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.hamburger-btn:hover {
  background: var(--bg-hover);
}

.hamburger-btn svg {
  width: 24px;
  height: 24px;
}

/* Sidebar backdrop overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sidebar-backdrop.visible {
  display: block;
  opacity: 1;
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  /* Show mobile header */
  .mobile-header {
    display: flex;
  }

  /* Sidebar slides in from left */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 100;
  }

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

  /* Main content adjustments */
  .main-content {
    margin-left: 0;
    padding: var(--space-md);
    padding-top: calc(56px + var(--space-md)); /* Account for mobile header */
  }

  /* View header adjustments */
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .view-header h1 {
    font-size: var(--font-size-xl);
  }

  .view-header-actions {
    width: 100%;
  }

  .view-header-actions .btn {
    width: 100%;
  }

  /* Project stats grid */
  .project-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

  /* Form adjustments */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Dashboard layout */
  .dashboard-layout {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: 100%;
  }

  /* Projects grid */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Task list */
  .task-item {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .task-item-time,
  .task-item-expand {
    flex-shrink: 0;
  }

  /* Modals full width on mobile */
  .modal-content {
    width: calc(100% - var(--space-lg));
    max-width: none;
    max-height: calc(100vh - var(--space-lg));
    margin: var(--space-sm);
  }

  /* Settings sections */
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  /* Team member cards */
  .team-members-list {
    grid-template-columns: 1fr;
  }
}

/* Large Desktop: > 1440px */
@media (min-width: 1441px) {
  /* Wider sidebar */
  .sidebar {
    width: var(--sidebar-width-large);
  }

  .main-content {
    margin-left: var(--sidebar-width-large);
  }

  /* Wider views */
  .view {
    max-width: var(--content-max-width-large);
  }

  /* More columns for grids */
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .team-members-list {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Dashboard can be wider */
  .dashboard-main {
    max-width: 900px;
  }

  /* Larger stat cards */
  .project-stats {
    gap: var(--space-lg);
  }

  .stat-card {
    padding: var(--space-xl);
  }

  .stat-value {
    font-size: var(--font-size-3xl);
  }
}

/* ==========================================
   Onboarding Wizard
   ========================================== */

.wizard-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--bg);
}

.wizard-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 600px;
}

.wizard-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.wizard-header h1 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-lg);
}

.wizard-header .accent {
  color: var(--accent);
}

/* Progress indicator */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.progress-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.progress-step.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.progress-step.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.progress-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}

/* Wizard steps */
.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.wizard-content {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.wizard-content h2 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.wizard-subtitle {
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

/* Feature list on welcome */
.wizard-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: left;
  max-width: 300px;
  margin: 0 auto;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text);
}

.feature-item svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* Use case selection */
.use-case-options {
  display: grid;
  gap: var(--space-sm);
  text-align: left;
}

.use-case-option input {
  display: none;
}

.use-case-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.use-case-option input:checked + .use-case-card {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

.use-case-card:hover {
  border-color: var(--border-light);
}

.use-case-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.use-case-label {
  font-weight: 500;
  display: block;
}

.use-case-desc {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  display: block;
}

/* Billing toggle */
.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.billing-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.billing-label.active {
  color: var(--text);
  font-weight: 500;
}

.billing-save {
  background: var(--success);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  border-radius: 12px;
  transition: background-color 0.2s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s ease, left 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
  left: calc(100% - 21px);
}

/* Plan selection */
.plan-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  text-align: left;
}

.plan-option {
  position: relative;
}

.plan-option input {
  display: none;
}

.plan-card {
  padding: var(--space-lg);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%;
}

.plan-option input:checked + .plan-card {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

.plan-card:hover {
  border-color: var(--border-light);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.plan-header {
  margin-bottom: var(--space-md);
}

.plan-name {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-lg);
}

.plan-price {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--accent);
}

.plan-period {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--font-size-sm);
}

.plan-features li {
  padding: var(--space-xs) 0;
  color: var(--text-muted);
}

.plan-features li::before {
  content: '✓';
  color: var(--success);
  margin-right: var(--space-sm);
}

/* Wizard actions */
.wizard-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

/* Form input large */
.form-input-lg {
  font-size: var(--font-size-lg);
  padding: var(--space-md) var(--space-lg);
}

/* Button loading state */
.btn .btn-loading {
  display: none;
}

.btn.loading {
  /* Override base .loading styles for buttons */
  padding: var(--space-sm) var(--space-md);
}

.btn.loading::after {
  /* Hide the default loading spinner on buttons */
  display: none;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-loading .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Responsive wizard */
@media (max-width: 1024px) {
  .plan-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .plan-options {
    grid-template-columns: 1fr;
  }

  .billing-toggle {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .wizard-container {
    padding: var(--space-lg);
  }

  .wizard-progress {
    transform: scale(0.9);
  }
}

/* ============================================
   Admin Dashboard Styles
   ============================================ */

.role-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--accent);
  color: var(--bg);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge.operator {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.role-badge.admin {
  background: var(--warning);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.admin-section {
  margin-bottom: var(--space-xl);
}

.admin-section h3 {
  margin-bottom: var(--space-md);
  color: var(--text);
}

.admin-toolbar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.admin-toolbar .form-input,
.admin-toolbar .form-select {
  max-width: 300px;
}

.table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.admin-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.admin-table tr:hover {
  background: rgba(88, 166, 255, 0.05);
}

.admin-table .text-center {
  text-align: center;
}

.admin-table .actions {
  display: flex;
  gap: var(--space-xs);
}

.admin-table .btn-xs {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
}

.plan-distribution {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.plan-distribution .plan-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.plan-distribution .plan-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.plan-distribution .plan-dot.free {
  background: var(--text-muted);
}

.plan-distribution .plan-dot.pro {
  background: var(--accent);
}

.plan-distribution .plan-dot.team {
  background: var(--success);
}

.plan-distribution .plan-count {
  font-weight: 600;
  color: var(--text);
}

.plan-distribution .plan-label {
  color: var(--text-muted);
  text-transform: capitalize;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.pagination button {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.pagination button:hover:not(:disabled) {
  background: var(--bg-card);
  border-color: var(--accent);
}

.pagination button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Role select in table */
.role-select {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--font-size-xs);
  cursor: pointer;
}

.role-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Status badges in table */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.status-badge.active {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
}

.status-badge.cancelled {
  background: rgba(248, 81, 73, 0.2);
  color: var(--danger);
}

.status-badge.pending {
  background: rgba(210, 153, 34, 0.2);
  color: var(--warning);
}

/* Responsive admin */
@media (max-width: 768px) {
  .admin-toolbar {
    flex-direction: column;
  }

  .admin-toolbar .form-input,
  .admin-toolbar .form-select {
    max-width: none;
  }

  .admin-table {
    font-size: var(--font-size-xs);
  }

  .admin-table th,
  .admin-table td {
    padding: var(--space-xs) var(--space-sm);
  }
}

/* ============================================
   Billing Settings Styles
   ============================================ */

/* Plan badges */
.plan-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge.free {
  background: var(--border);
  color: var(--text-muted);
}

.plan-badge.solo_starter {
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent);
}

.plan-badge.solo_pro {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.plan-badge.team {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.status-badge.success {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
}

.status-badge.warning {
  background: rgba(210, 153, 34, 0.2);
  color: var(--warning);
}

.status-badge.danger {
  background: rgba(248, 81, 73, 0.2);
  color: var(--danger);
}

.status-badge.info {
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent);
}

/* Billing cycle badge */
.billing-cycle-badge {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-left: var(--space-sm);
}

/* Usage bar */
.usage-bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: var(--space-sm);
}

.usage-progress {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}

.usage-progress.warning {
  background: var(--warning);
}

.usage-progress.danger {
  background: var(--danger);
}

/* Billing actions */
.billing-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-danger-outline:hover {
  background: rgba(248, 81, 73, 0.1);
}

/* Upgrade banner */
.upgrade-banner {
  text-align: center;
  padding: var(--space-xl);
}

.upgrade-banner h4 {
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.upgrade-banner p {
  margin-bottom: var(--space-lg);
}

/* Change Plan Modal Grid */
.change-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.change-plan-grid .plan-card {
  cursor: pointer;
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  position: relative;
}

.change-plan-grid .plan-card:hover {
  border-color: var(--accent);
}

.change-plan-grid .plan-card.current {
  border-color: var(--text-muted);
  opacity: 0.7;
}

.change-plan-grid .plan-card.current::after {
  content: 'Current';
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.change-plan-grid input[type="radio"] {
  display: none;
}

.change-plan-grid input[type="radio"]:checked + .plan-card-content {
  border-color: var(--accent);
}

.change-plan-grid label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.05);
}

.plan-card-content h4 {
  margin-bottom: var(--space-sm);
}

.plan-badge-popular {
  position: absolute;
  top: -10px;
  right: var(--space-md);
  background: var(--accent);
  color: var(--bg);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
  font-size: var(--font-size-sm);
}

.plan-features li {
  padding: var(--space-xs) 0;
  color: var(--text-muted);
}

.plan-features li::before {
  content: '✓ ';
  color: var(--success);
}

/* Proration preview */
.proration-preview {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(88, 166, 255, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.proration-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.proration-amount {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--accent);
}

/* Cancel options */
.cancel-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s;
}

.radio-option:hover {
  border-color: var(--accent);
}

.radio-option input[type="radio"] {
  margin-top: var(--space-xs);
}

.radio-option input[type="radio"]:checked ~ .radio-content {
  color: var(--text);
}

.radio-content strong {
  display: block;
  margin-bottom: var(--space-xs);
}

.radio-content p {
  margin: 0;
}

/* Modal body and actions */
.modal-body {
  padding: var(--space-lg);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

/* Modal large */
.modal-lg .modal-content {
  max-width: 800px;
}

/* Responsive billing */
@media (max-width: 1024px) {
  .change-plan-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .change-plan-grid {
    grid-template-columns: 1fr;
  }

  .billing-actions {
    flex-direction: column;
  }

  .billing-actions .btn {
    width: 100%;
  }
}

/* Team Members */
.team-members-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.team-member {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.team-member:hover {
  background: rgba(255, 255, 255, 0.05);
}

.team-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.team-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-member-avatar span {
  color: white;
  font-weight: 600;
  font-size: var(--font-size-md);
}

.team-member-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.team-member-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-member-email {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-member-role {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.team-member-role.role-owner {
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent);
}

.team-member-role.role-admin {
  background: rgba(210, 153, 34, 0.2);
  color: var(--warning);
}

.team-member-role.role-member {
  background: rgba(139, 148, 158, 0.2);
  color: var(--text-muted);
}

/* Team Invitations */
.team-invitations-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.team-invitation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}

.team-invitation-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
}

.team-invitation-email {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-invitation-role {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.team-invitation-status {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.team-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Button variants for team */
.btn-ghost.btn-danger {
  color: var(--danger);
}

.btn-ghost.btn-danger:hover {
  background: rgba(248, 81, 73, 0.1);
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
}

/* Responsive team styles */
@media (max-width: 640px) {
  .team-member {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .team-member-info {
    flex: 1 1 calc(100% - 60px);
    order: 0;
  }

  .team-member-role {
    order: 2;
  }

  .team-invitation-info {
    flex-wrap: wrap;
  }
}

/* ============================================
   Customers Management Styles
   ============================================ */

/* Customers Grid */
.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

/* Customer Card */
.customer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.customer-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.customer-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xs);
}

.customer-company {
  font-size: var(--font-size-sm);
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.customer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.customer-contact a {
  color: var(--text-muted);
  text-decoration: none;
}

.customer-contact a:hover {
  color: var(--accent);
}

.customer-meta {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.customer-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Customer Detail View */
.customer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-xl);
}

.customer-header-info h1 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xs);
}

.customer-header-info .customer-company {
  font-size: var(--font-size-md);
  margin-bottom: 0;
}

.customer-header-actions {
  display: flex;
  gap: var(--space-sm);
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-xl);
}

.customer-info-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.customer-info-section h3 {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

.customer-info-row {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-md);
}

.customer-info-row:last-child {
  margin-bottom: 0;
}

.customer-info-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.customer-info-value {
  font-size: var(--font-size-sm);
  color: var(--text);
}

.customer-info-value a {
  color: var(--accent);
  text-decoration: none;
}

.customer-info-value a:hover {
  text-decoration: underline;
}

.customer-billing-rate {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--success);
}

.customer-projects-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.customer-projects-section h3 {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Project Card Enhancements */
.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.project-card-header h3 {
  margin-bottom: 0;
  flex: 1;
}

/* Project Info Bar (in detail view) */
.project-info-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.project-customer {
  display: inline-block;
  font-size: var(--font-size-xs);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.project-parent-badge {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  display: inline-block;
}

.project-hierarchy-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.subproject-count {
  color: var(--accent);
  font-weight: 500;
}

/* Form Row Improvements */
.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* Textarea auto-height */
.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Customer Notes */
.customer-notes {
  font-size: var(--font-size-sm);
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Responsive Customers */
@media (max-width: 1024px) {
  .customer-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .customers-grid {
    grid-template-columns: 1fr;
  }

  .customer-header {
    flex-direction: column;
    gap: var(--space-md);
  }

  .customer-header-actions {
    width: 100%;
  }

  .customer-header-actions .btn {
    flex: 1;
  }

  .form-row-3,
  .form-row-4 {
    grid-template-columns: 1fr;
  }
}

/* Markdown Content Styles */
.markdown-content {
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.markdown-content .md-list,
.markdown-content .md-checklist {
  margin: 0;
  padding-left: var(--space-md);
  list-style: none;
}

.markdown-content .md-list li {
  position: relative;
  padding-left: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.markdown-content .md-list li::before {
  content: "\2022";
  position: absolute;
  left: calc(-1 * var(--space-sm));
  color: var(--muted);
}

.markdown-content ol.md-list {
  counter-reset: md-counter;
}

.markdown-content ol.md-list li::before {
  counter-increment: md-counter;
  content: counter(md-counter) ".";
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.markdown-content .md-checklist {
  padding-left: 0;
}

.markdown-content .md-check-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.markdown-content .md-check-item.checked {
  color: var(--muted);
}

.markdown-content .md-check-item.checked span:last-child {
  text-decoration: line-through;
}

.markdown-content .md-checkbox {
  flex-shrink: 0;
  font-size: 1.1em;
  line-height: 1;
}

.markdown-content .md-check-item:not(.checked) .md-checkbox {
  color: var(--muted);
}

.markdown-content .md-check-item.checked .md-checkbox {
  color: var(--success);
}

.markdown-content .md-para {
  margin: 0 0 var(--space-xs) 0;
}

.markdown-content .md-para:last-child {
  margin-bottom: 0;
}

.markdown-content .md-header {
  margin: var(--space-sm) 0 var(--space-xs) 0;
  font-weight: 600;
}

.markdown-content h4.md-header {
  font-size: var(--font-size-sm);
}

.markdown-content h5.md-header {
  font-size: var(--font-size-xs);
}

.markdown-content h6.md-header {
  font-size: var(--font-size-xs);
  color: var(--muted);
}

.markdown-content .md-code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.markdown-content .md-code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  margin: var(--space-sm) 0;
  overflow-x: auto;
  position: relative;
}

.markdown-content .md-code-block code {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  line-height: 1.5;
  color: var(--text);
  white-space: pre;
  display: block;
}

.markdown-content .md-code-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: var(--space-xs);
  right: var(--space-sm);
  font-size: var(--font-size-xs);
  color: var(--muted);
  text-transform: lowercase;
}

.markdown-content strong {
  font-weight: 600;
  color: var(--text);
}

.markdown-content em {
  font-style: italic;
}

.markdown-content br {
  display: block;
  content: "";
  margin-top: var(--space-xs);
}

/* ========================================
   Dashboard Styles
   ======================================== */

/* Quick Actions Bar (Header) */
.quick-actions-bar {
  display: flex;
  gap: var(--space-sm);
  margin-left: auto;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-action-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--text);
}

.quick-action-btn svg {
  opacity: 0.7;
}

.quick-action-btn:hover svg {
  opacity: 1;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  gap: var(--space-lg);
}

.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  min-width: 0;
}

.dashboard-sidebar {
  width: 300px;
  flex-shrink: 0;
}

.dashboard-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.widget-header h3 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.widget-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.widget-badge {
  background: var(--accent);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.widget-link {
  font-size: var(--font-size-xs);
  color: var(--accent);
  text-decoration: none;
}

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

.widget-body {
  padding: var(--space-lg);
}

/* Utilization Widget (Sidebar) */
.widget-utilization {
  position: sticky;
  top: var(--space-lg);
}

.utilization-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto var(--space-lg);
}

.utilization-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.utilization-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.utilization-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.8s ease;
}

.utilization-progress.over-100 {
  stroke: var(--success);
}

.utilization-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.utilization-percent {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text);
}

.utilization-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.utilization-stats {
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
}

.stat-label {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.stat-value {
  font-weight: 600;
  font-size: var(--font-size-sm);
}

/* Weekly Chart Widget */
.weekly-chart {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
  height: 120px;
  padding-top: var(--space-md);
}

.chart-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.chart-bar-container {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 80%;
  max-width: 32px;
  background: var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 4px;
  transition: height 0.3s ease, background 0.2s;
}

.chart-bar.has-time {
  background: var(--accent);
}

.chart-bar.is-today {
  background: var(--success);
}

.chart-day-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.chart-day.is-today .chart-day-label {
  color: var(--success);
  font-weight: 600;
}

.chart-hours {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

/* Task List in Widgets */
.widget-body .task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 300px;
  overflow-y: auto;
}

.widget-task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.widget-task-item:hover {
  background: var(--bg-card-hover, rgba(255,255,255,0.05));
}

.widget-task-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.widget-task-status.in_progress {
  background: var(--warning);
}

.widget-task-status.todo {
  background: var(--text-muted);
}

.widget-task-status.done {
  background: var(--success);
}

.widget-task-content {
  flex: 1;
  min-width: 0;
}

.widget-task-title {
  font-size: var(--font-size-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.widget-task-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-task-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Empty Widget State */
.empty-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  color: var(--text-muted);
}

.empty-widget .empty-icon {
  margin-bottom: var(--space-sm);
  opacity: 0.5;
}

.empty-widget .empty-hint {
  font-size: var(--font-size-xs);
  margin-top: var(--space-xs);
  opacity: 0.7;
}

/* Project List in Widget */
.widget-body .project-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.widget-project-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  background: var(--bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.widget-project-item:hover {
  background: var(--bg-card-hover, rgba(255,255,255,0.05));
}

.widget-project-info {
  flex: 1;
  min-width: 0;
}

.widget-project-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-project-stats {
  display: flex;
  gap: var(--space-sm);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.project-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.project-stat-dot.todo {
  background: var(--text-muted);
}

.project-stat-dot.in-progress {
  background: var(--warning);
}

.project-stat-dot.done {
  background: var(--success);
}

/* Assigned Projects Widget - Sidebar Layout */
.assigned-projects-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.assigned-project-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.assigned-project-row:hover {
  background: var(--bg-card-hover, rgba(255,255,255,0.05));
}

.assigned-project-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.assigned-project-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.assigned-project-role {
  font-size: 10px;
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.assigned-project-stats {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.assigned-stat {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.assigned-project-progress {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
  margin-left: auto;
}

.mini-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
  max-width: 60px;
}

.mini-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.mini-progress-text {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-action:hover {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

.quick-action svg {
  opacity: 0.7;
}

.quick-action:hover svg {
  opacity: 1;
}

.quick-action span {
  font-size: var(--font-size-xs);
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
  .dashboard-sidebar {
    width: 260px;
  }
}

@media (max-width: 992px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: 100%;
    order: -1;
  }

  .widget-utilization {
    position: static;
  }

  .utilization-ring {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 768px) {
  .quick-actions-bar {
    flex-wrap: wrap;
  }

  .quick-action-btn span {
    display: none;
  }

  .quick-action-btn {
    padding: var(--space-xs);
  }
}

/* ============================================
   Project Team Management Styles
   ============================================ */

/* Team Section */
#project-team-section {
  margin-top: var(--space-xl);
}

#project-team-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

#project-team-section .section-header h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.team-count {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: normal;
}

/* Team Categories */
.team-category {
  margin-bottom: var(--space-xl);
}

.team-category-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.category-icon {
  font-size: var(--font-size-lg);
}

.category-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: normal;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Team Member Card for Project View */
.team-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.team-member-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transition: all 0.2s ease;
}

.team-member-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.team-member-card .team-member-avatar {
  width: 48px;
  height: 48px;
}

.team-member-card .team-member-avatar.ai {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.team-member-card .team-member-avatar.ai .ai-icon {
  width: 26px;
  height: 26px;
  color: white;
}

.team-member-card .team-member-avatar.contact {
  background: var(--warning);
}

.team-member-card .team-member-info {
  flex: 1;
  min-width: 0;
}

.team-member-card .team-member-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.team-member-name .ai-badge {
  font-size: 10px;
  padding: 1px 6px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  font-weight: 600;
}

.team-member-card .team-member-role {
  font-size: var(--font-size-sm);
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.team-member-details {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.team-member-details span {
  display: block;
  margin-top: 2px;
}

.team-member-actions {
  display: flex;
  gap: var(--space-xs);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.team-member-card:hover .team-member-actions {
  opacity: 1;
}

.team-member-actions button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.team-member-actions button:hover {
  background: var(--border);
  color: var(--text);
}

.team-member-actions button.danger:hover {
  background: var(--danger);
  color: white;
}

/* Team Member Activity Stats */
.team-member-activity {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.activity-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.activity-stat svg {
  opacity: 0.7;
}

.activity-last {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-style: italic;
  margin-left: auto;
}

/* Member Type Selector */
.member-type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.member-type-option {
  cursor: pointer;
}

.member-type-option input {
  display: none;
}

.member-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all 0.2s ease;
}

.member-type-option input:checked + .member-type-card {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

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

.member-type-icon {
  font-size: 28px;
  margin-bottom: var(--space-sm);
}

.member-type-label {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text);
  margin-bottom: 2px;
}

.member-type-desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Form Rows for Modal */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.form-col {
  display: flex;
  flex-direction: column;
}

/* Notification Options */
.notification-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* Form Help Text */
.form-help {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Empty Team State */
#project-team-section .empty-state {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

#project-team-section .empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

#project-team-section .empty-state h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

#project-team-section .empty-state p {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* Responsive Project Team */
@media (max-width: 768px) {
  .member-type-selector {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .team-members-grid {
    grid-template-columns: 1fr;
  }

  .team-member-actions {
    opacity: 1;
  }
}

/* ========================================
   Support / Tickets View
   ======================================== */

/* Tickets List */
.tickets-list {
  min-height: 200px;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ticket-row:hover {
  background: var(--bg-hover);
}

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

.ticket-row-main {
  flex: 1;
  min-width: 0;
}

.ticket-subject {
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.ticket-category {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.ticket-id {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.ticket-row-side {
  text-align: right;
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.ticket-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: capitalize;
}

.badge-primary {
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent);
}

.badge-secondary {
  background: rgba(139, 148, 158, 0.2);
  color: var(--text-muted);
}

.badge-success {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
}

.badge-warning {
  background: rgba(210, 153, 34, 0.2);
  color: var(--warning);
}

.badge-danger {
  background: rgba(248, 81, 73, 0.2);
  color: var(--danger);
}

.badge-info {
  background: rgba(88, 166, 255, 0.1);
  color: var(--info);
}

/* Ticket Detail View */
.ticket-detail-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-lg);
}

/* Ticket Info Panel */
.ticket-info-panel {
  padding: var(--space-lg);
  height: fit-content;
  position: sticky;
  top: var(--space-lg);
}

.ticket-meta .meta-row {
  margin-bottom: var(--space-md);
}

.ticket-meta .meta-row label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.ticket-dates {
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
  margin-top: var(--space-md);
}

.ticket-dates .date-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
}

.ticket-dates .date-row label {
  color: var(--text-muted);
}

/* Ticket GitHub Section */
.ticket-github-section {
  margin-top: var(--space-md);
}

.ticket-github-section .section-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: var(--space-md);
}

.ticket-github-section label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.github-issue-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--accent);
  text-decoration: none;
  font-size: var(--font-size-sm);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(88, 166, 255, 0.1);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.github-issue-link:hover {
  background: rgba(88, 166, 255, 0.2);
  text-decoration: none;
}

.github-issue-link svg {
  flex-shrink: 0;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  justify-content: center;
  margin-top: var(--space-sm);
}

.btn-github svg {
  flex-shrink: 0;
}

.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Ticket Conversation Panel */
.ticket-conversation-panel {
  min-width: 0;
}

.conversation-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.conversation-header h3 {
  font-size: var(--font-size-md);
  font-weight: 500;
  margin: 0;
}

.ticket-description {
  padding: var(--space-md);
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Comments */
.comments-list {
  max-height: 400px;
  overflow-y: auto;
}

.comment {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.comment:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 500;
  color: var(--text);
}

.comment-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.comment-body {
  padding-left: 44px;
  color: var(--text);
  line-height: 1.6;
}

/* Reply Form */
.reply-form {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.form-textarea {
  width: 100%;
  min-height: 100px;
  padding: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-sm);
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

/* Empty State (for support view) */
#support-view .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  text-align: center;
}

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Responsive Support View */
@media (max-width: 768px) {
  .ticket-detail-container {
    grid-template-columns: 1fr;
  }

  .ticket-info-panel {
    position: static;
  }

  .comment-body {
    padding-left: 0;
    margin-top: var(--space-sm);
  }
}

/* ==========================================================================
   Bug Tracking Styles
   ========================================================================== */

/* Bug section in ticket detail */
.ticket-bug-section {
  padding-top: var(--space-md);
}

.ticket-bug-section label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

/* Bug link button */
.bug-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

.bug-link:hover {
  background: rgba(248, 81, 73, 0.2);
  text-decoration: none;
}

.bug-link svg {
  width: 14px;
  height: 14px;
}

/* Bug button */
.btn-bug {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.btn-bug svg {
  width: 14px;
  height: 14px;
}

/* Extra small button */
.btn-xs {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
}

/* GitHub issue creation button */
.btn-github-create {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: #238636;
  border-color: #238636;
  color: white;
}

.btn-github-create:hover {
  background: #2ea043;
  border-color: #2ea043;
}

.btn-github-create svg {
  width: 14px;
  height: 14px;
}

/* Small GitHub link */
.github-link-small {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(35, 134, 54, 0.1);
  border: 1px solid #238636;
  border-radius: var(--radius);
  color: #3fb950;
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

.github-link-small:hover {
  background: rgba(35, 134, 54, 0.2);
  text-decoration: none;
}

.github-link-small svg {
  width: 14px;
  height: 14px;
}

/* Severity badges */
.severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.severity-blocker {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
  border: 1px solid #f85149;
}

.severity-critical {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
  border: 1px solid #d29922;
}

.severity-major {
  background: rgba(88, 166, 255, 0.2);
  color: #58a6ff;
  border: 1px solid #58a6ff;
}

.severity-minor {
  background: rgba(139, 148, 158, 0.2);
  color: #8b949e;
  border: 1px solid #8b949e;
}

/* Bug status badges */
.bug-status-new {
  background: rgba(88, 166, 255, 0.2);
  color: #58a6ff;
}

.bug-status-confirmed {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
}

.bug-status-in_progress {
  background: rgba(163, 113, 247, 0.2);
  color: #a371f7;
}

.bug-status-resolved {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
}

.bug-status-closed {
  background: rgba(139, 148, 158, 0.2);
  color: #8b949e;
}

/* Bug table actions */
.bug-actions {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

/* Text utility for no-wrap */
.text-nowrap {
  white-space: nowrap;
}

/* ==========================================
   Backlog Section
   ========================================== */

#backlog-section {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
}

#backlog-section.collapsed .backlog-list,
#backlog-section.collapsed #empty-backlog {
  display: none;
}

#backlog-header {
  cursor: pointer;
}

#backlog-header.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.backlog-count {
  font-size: var(--font-sm);
  color: var(--muted);
  font-weight: normal;
}

.backlog-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.backlog-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.backlog-item:hover {
  border-color: var(--accent);
}

.backlog-item-content {
  flex: 1;
  min-width: 0;
}

.backlog-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.backlog-item-title {
  font-weight: 500;
  color: var(--text);
}

.backlog-item-desc {
  margin-top: var(--space-xs);
  font-size: var(--font-sm);
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.backlog-priority {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.backlog-priority.priority-high {
  background: rgba(248, 81, 73, 0.2);
  color: var(--danger);
}

.backlog-priority.priority-medium {
  background: rgba(210, 153, 34, 0.2);
  color: var(--warning);
}

.backlog-priority.priority-low {
  background: rgba(139, 148, 158, 0.2);
  color: var(--muted);
}

.backlog-item-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#empty-backlog {
  padding: var(--space-md);
  text-align: center;
  color: var(--muted);
  font-size: var(--font-sm);
}

/* Tags System Styles */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  background-color: var(--tag-color, #6b7280);
  white-space: nowrap;
}

.tag .tag-remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 12px;
  font-weight: bold;
  margin-left: 2px;
}

.tag .tag-remove:hover {
  opacity: 1;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.8;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}

.project-detail-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-detail-tags .tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-tags-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 8px;
}

/* Tags in task drawer */
.task-tags-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

/* Tags modal */
.tags-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 40px;
}

.tag-select-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  color: #fff;
}

.tag-select-item:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.tag-select-item .tag-remove {
  opacity: 0.7;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.tag-select-item .tag-remove:hover {
  opacity: 1;
}

.tag-select-item .tag-add {
  opacity: 0.7;
  font-size: 12px;
  line-height: 1;
}

/* Tag category label */
.tag-category {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}
