/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Primary colors */
  --color-primary: #3e6b9c;
  --color-primary-hover: #2d5580;
  --color-primary-light: rgba(62, 107, 156, 0.08);
  --color-primary-focus: rgba(62, 107, 156, 0.2);

  /* Neutral colors */
  --color-bg-page: #f5f7fa;
  --color-bg-card: #ffffff;
  --color-bg-input: #ffffff;
  --color-bg-section: #fafbfc;
  --color-bg-hover: #f8f9fa;

  /* Border colors */
  --color-border: #e1e5eb;
  --color-border-light: #eef1f5;
  --color-border-input: #d1d5db;
  --color-border-focus: var(--color-primary);

  /* Text colors */
  --color-text-primary: #1a1f36;
  --color-text-secondary: #4a5568;
  --color-text-muted: #718096;
  --color-text-placeholder: #9ca3af;

  /* Status colors */
  --color-error: #c0524e;
  --color-success: #3a9a6e;
  --color-warning: #ffc107;

  /* Sprint utilization colors */
  --color-utilization-normal: #137333;
  --color-utilization-normal-bg: #e6f4ea;
  --color-utilization-high: #e37400;
  --color-utilization-high-bg: #fef3e0;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-focus: 0 0 0 3px var(--color-primary-focus);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ============================================
   Base Styles
   ============================================ */

/* Work Item Type icons in Select2 */
.wit-icon { border-radius: 2px; display: inline-block; }
.select2-container .wit-option { display: inline-flex; align-items: center; }

/* Inline hierarchy display: keep label and tree on the same line and use the same small font size */
.inline-hierarchy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem; /* small text */
}
.inline-hierarchy .hierarchy-tree {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0; /* override .hierarchy-tree default spacing when used inline */
}
.inline-hierarchy .hierarchy-item,
.inline-hierarchy .hierarchy-connector {
  display: inline-block;
  line-height: 1;
}

/* Ensure individual items align vertically in case other rules affect them */
.inline-hierarchy .hierarchy-item { vertical-align: middle; }

/* ============================================
   Select2 Dropdown Styling
   ============================================ */
.select2-container {
  max-width: 100%;
  flex: 1;
}

.select2-container:not(:first-child) {
  margin-left: 0.5rem;
}

/* Fix dropdown alignment for all Select2 dropdowns */
.select2-dropdown {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-left: 0 !important;
  left: 0 !important;
  margin-top: 4px;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Specific fix for dropdowns in flex containers */
.form-group.mb-3.d-flex .select2-container .select2-dropdown {
  transform: translateX(0) !important;
}

.select2-container--default .select2-selection--single {
  height: 40px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  background-color: var(--color-bg-input);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.select2-container--default .select2-selection--single:hover {
  border-color: var(--color-primary);
}

.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.5;
  padding-left: 0;
  padding-right: 24px;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--color-text-placeholder);
  font-size: 0.9375rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px;
  right: 0.75rem;
}

.select2-container--default .select2-results__option {
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: background-color var(--transition-fast);
}

.select2-container--default .select2-results__option--highlighted {
  background-color: var(--color-primary-light) !important;
  color: var(--color-text-primary) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--color-primary-light) !important;
  color: var(--color-text-primary) !important;
}

.select2-container--default .select2-results__option--selected {
  background-color: var(--color-bg-section);
}

.select2-search--dropdown .select2-search__field {
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  height: 40px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.select2-dropdown .select2-search {
  padding: var(--space-sm);
}

.select2-user-option {
  display: flex;
  align-items: center;
}

.select2-user-selection {
  display: flex;
  align-items: center;
}

.select2-user-image {
  border-radius: 50%;
  margin-right: 8px;
}

/* Task input icon styles */
.task-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  background: transparent;
  border: none;
}
.task-input-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
}

/* Selected Work Item Type icon (before deliverable-prefix) */
.selected-wit-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
}
.deliverable-wit-icon { margin-right: 6px; }

/* Assignee dropdown: stacked name + email */
.select2-user-option .select2-user-text { display:flex; flex-direction:column; line-height:1.1; }
.select2-user-option .select2-user-name { font-weight:500; }
.select2-user-option .select2-user-email { font-size:0.75rem; color:#666; }

/* Increase dropdown height to show more options */
.select2-dropdown .select2-results {
  max-height: 400px !important; /* Increased from default ~200px */
}

/* Ensure the dropdown shows more options for organization, project, and team dropdowns */
.select2-dropdown .select2-results__options {
  max-height: 400px !important; /* Increased from default ~200px */
  overflow-y: auto;
}

/* More specific selector to override Select2 defaults */
.select2-container--default .select2-results > .select2-results__options {
  max-height: 400px !important;
}

/* Alternative approach using the dropdown container */
.select2-dropdown[aria-hidden="false"] .select2-results__options {
  max-height: 400px !important;
}

/* Custom dropdown class for larger height */
.select2-dropdown-large .select2-results__options {
  max-height: 400px !important;
  overflow-y: auto;
}

.select2-dropdown-large .select2-results {
  max-height: 400px !important;
}

/* ============================================
   Layout & Typography
   ============================================ */
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--color-bg-page);
  color: var(--color-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hide app root until auth completes to avoid flicker (revealed via JS in onSuccessLogin) */
.app-root-hidden { display: none !important; }

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  z-index: -1;
}

.container {
  max-width: 80%;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl);
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  flex: 1;
}

h1 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

form {
  margin-top: var(--space-lg);
}

.form-group label {
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
}

.form-group > div {
  display: flex;
  gap: var(--space-md);
}

/* ============================================
   Form Controls
   ============================================ */
.form-control {
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  height: 40px;
  background-color: var(--color-bg-input);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:hover:not(:disabled) {
  border-color: var(--color-primary);
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.form-control::placeholder {
  color: var(--color-text-placeholder);
}

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

/* Helper text styling */
.form-text.text-muted {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  margin-bottom: var(--space-xs);
}

/* ============================================
   Cards & Sections
   ============================================ */
.deliverable-item {
  margin-bottom: var(--space-lg);
}

.user-image {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  background-color: var(--color-bg-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}

/* Section dividers */
hr {
  border: none;
  border-top: 1px solid #999;
  margin: var(--space-md) 0;
}

.delete-deliverable-btn {
  margin-top: 7px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.delete-deliverable-btn:hover {
  opacity: 1;
  color: var(--color-error);
}

.delete-deliverable-btn .fa-times {
  font-size: 16px;
}

.deliverable-title {
  padding-right: 40px;
}

.task-list {
  margin-bottom: var(--space-md);
  list-style-type: none;
  padding-left: var(--space-lg);
}

.task-item {
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) 0;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.task-item:hover {
  background-color: var(--color-bg-hover);
}

.delete-task-btn,
.delete-btn {
  margin-left: var(--space-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  border: none;
  background: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

.delete-task-btn:hover,
.delete-btn:hover {
  color: var(--color-error);
}

.delete-task-btn {
  padding: 0;
  align-self: center;
}

.delete-task-btn .fa-times {
  font-size: 16px;
}

.delete-task-container .delete-task-btn {
  visibility: hidden;
  opacity: 0;
  transition: visibility var(--transition-fast), opacity var(--transition-fast);
}

.task-item:hover .delete-task-btn {
  visibility: visible;
  opacity: 1;
}

.deliverable-item .input-group {
  display: flex;
  align-items: center;
}

.deliverable-item .input-group-append {
  margin-left: 10px;
  align-self: center;
}

.task-item .input-group {
  display: flex;
  align-items: center;
}

.task-item .input-group-append {
  margin-left: 10px;
  align-self: center;
}

.add-task-btn {
  margin-left: 15px;
  cursor: pointer;
}

.add-btn-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.add-btn-container .deliverable-estimate {
  flex-grow: 1;
  margin-right: 10px;
}

.is-invalid {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15) !important;
}

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

/* ============================================
   Buttons
   ============================================ */
.btn {
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary:focus {
  box-shadow: var(--shadow-focus), var(--shadow-sm);
}

.btn-secondary {
  background-color: var(--color-bg-card);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--color-bg-hover);
  border-color: var(--color-border);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:focus {
  box-shadow: var(--shadow-focus);
}

.form-group:not(:first-child) {
  margin-top: 10px;
}

.form-text + .form-group {
  margin-top: var(--space-xs);
}

#add-deliverable {
  float: right;
}

#user-name {
  font-weight: bold;
}

.task-item .form-control.task-title {
  width: 70%;
}

.task-item .form-control.task-estimate {
  width: 10%;
}

.dashed-line {
  border: 1px dashed rgba(100, 149, 201, 1);
}

.deliverable-item.transition {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.deliverable-item.active {
  opacity: 1;
  transform: translateY(0);
}

.drag-handle {
  cursor: grab;
  margin-right: var(--space-sm);
  color: var(--color-text-placeholder);
  transition: color var(--transition-fast);
}

.drag-handle:hover {
  color: var(--color-text-muted);
}

.drag-handle:active {
  cursor: grabbing;
  color: var(--color-primary);
}

.deliverable-prefix[disabled] {
  cursor: not-allowed;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-container {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: center;
}

.progress {
  width: 40%;
  height: 8px;
  border-radius: var(--radius-lg);
  background-color: var(--color-border-light);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--color-primary) 0%, #5a8bc7 100%);
  border-radius: var(--radius-lg);
  transition: width 0.3s ease;
}

/* ============================================
   Loading States
   ============================================ */
.loading-indicator {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  text-align: center;
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 8888;
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading-text {
  visibility: visible;
  opacity: 0;
  color: #ffffff;
  font-size: 0.9375rem;
  text-align: center;
  margin-top: var(--space-sm);
  background: rgba(0, 0, 0, 0.7);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  display: block;
  transition: opacity 0.4s ease-in-out;
  font-weight: 500;
}

.loading-text.show {
  opacity: 1;
}

/* Progress Card - shown during work item creation */
.progress-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-border);
  width: 380px;
  max-width: 90vw;
  z-index: 9999;
  overflow: hidden;
  animation: progressCardIn 0.3s ease;
}

@keyframes progressCardIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.progress-card-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: #fff;
  padding: var(--space-md) var(--space-lg);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.progress-card-header i {
  font-size: 18px;
  opacity: 0.9;
}

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

.progress-card-phase {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  text-align: center;
}

.progress-card-status {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
  min-height: 18px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 var(--space-xs);
}

.progress-card-counter {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-sm);
  min-height: 16px;
}

.progress-card-bar-container {
  height: 8px;
  background: var(--color-bg-section);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.progress-card-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary) 0%, #5a8bc7 100%);
  border-radius: var(--radius-lg);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-card-bar.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: progressShimmer 1.5s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-card-percent {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: var(--space-md);
  font-variant-numeric: tabular-nums;
}

/* Scrolling activity log */
.progress-card-log {
  max-height: 120px;
  overflow-y: auto;
  margin-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-sm);
}

.progress-card-log:empty {
  display: none;
}

.progress-card-log-entry {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 3px 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  animation: logEntryIn 0.2s ease;
}

.progress-card-log-entry i {
  color: var(--color-success);
  font-size: 11px;
  margin-top: 2px;
  flex-shrink: 0;
}

.progress-card-log-entry .log-entry-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

@keyframes logEntryIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-card-log::-webkit-scrollbar {
  width: 4px;
}

.progress-card-log::-webkit-scrollbar-track {
  background: transparent;
}

.progress-card-log::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.user-profile-image {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 5px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: border-color var(--transition-fast);
}

.user-profile-image:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.azure-logo {
  position: absolute;
  top: 15px;
  left: 20px;
  width: 35px;
  height: 35px;
  margin: 0;
  padding: 0;
  display: block;
}

/* ============================================
   Dropdowns
   ============================================ */
.dropdown-menu {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs) 0;
  animation: dropdownFadeOnly 0.15s ease-out;
}

@keyframes dropdownFadeOnly {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dropdown-menu .dropdown-item {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  color: var(--color-text-primary);
  transition: background-color var(--transition-fast);
}

.dropdown-menu .dropdown-item:hover {
  background-color: var(--color-primary-light);
  color: var(--color-text-primary);
}

.dropdown-menu .dropdown-item i {
  margin-right: var(--space-sm);
  width: 16px;
  text-align: center;
  color: var(--color-text-muted);
}

.dropdown-menu .dropdown-divider {
  border-color: var(--color-border-light);
  margin: var(--space-xs) 0;
}

.dropdown-menu.floating-menu {
  position: absolute;
  left: -90px;
  top: 120%;
  z-index: 1000;
}

/* Prefill templates dropdown - add scrollbar for long lists */
.preconfigured-templates-dropdown {
  max-height: 300px;
  overflow-y: auto;
}

.preconfigured-templates-dropdown .dropdown-item {
  padding: var(--space-sm) var(--space-md);
}

.drafts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 15%;
  height: 100%;
  padding: 20px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.drafts-container h3 {
  margin-bottom: 10px;
}

#drafts-list {
  list-style-type: none;
  padding: 0;
}

#drafts-list li {
  margin-bottom: 20px;
  cursor: pointer;
}

#drafts-list li:hover {
  text-decoration: underline;
}

.highlight-text {
  background-color: yellow;
}

.user-info {
  padding-right: 20px;
}

@media (max-width: 800px) {
  .azure-logo {
    display: none;
  }

  .user-info {
    display: none;
  }

  .drafts-container {
    display: none;
  }

  .header-titles {
    display: none;
  }
}

/* ============================================
   Header
   ============================================ */
header {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  width: 100%;
  padding: 14px 0;
  position: relative;
}

.header-content {
  flex-grow: 1;
  width: 100%;
  display: flex;
  align-items: center;
}

.header-titles {
  width: 100%;
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-titles h1,
.header-titles h2 {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.icon-grey {
  color: #999999;
}

.hierarchy-tree {
  display: flex;
  align-items: center;
  margin-top: 5px;
}

.hierarchy-item {
  padding: 0 10px;
}

.hierarchy-connector {
  padding: 0 5px;
  font-weight: normal;
  color: #888;
}

.icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

.description-toggle-btn {
  background: none;
  border: none;
  color: #6c757d;
  padding: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.description-toggle-btn:hover {
  color: #495057;
}

.description-caret {
  transition: transform 0.2s ease;
}

.description-caret.rotated {
  transform: rotate(180deg);
}

.description-section {
  width: 100%;
  margin-top: 8px;
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out, margin-top 0.25s ease-out;
}

.description-section.visible {
  max-height: 500px;
  opacity: 1;
  margin-top: 8px;
  transition: max-height 0.3s ease-in, opacity 0.2s ease-in, margin-top 0.25s ease-in;
}

.description-section.expanded {
  position: fixed;
  top: 10%;
  left: 5%;
  width: 90%;
  height: 80%;
  background: white;
  border: 2px solid #007bff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1050;
  padding: 0;
  margin: 0;
}

.description-section.expanded .rich-text-toolbar {
  border-radius: 8px 8px 0 0;
  margin: 0;
}

.description-section.expanded .rich-text-editor {
  height: calc(100% - 60px);
  border-radius: 0 0 8px 8px;
  margin: 0;
  max-height: none;
}

.deliverable-description,
.task-description {
  resize: vertical;
  min-height: 60px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  font-size: 16px;
  margin-left: 0;
  font-family: "Segoe UI", Arial, sans-serif;
}

/* Override for rich text editors */
.rich-text-editor.deliverable-description,
.rich-text-editor.task-description {
  width: 100% !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 0 0 0.375rem 0.375rem !important;
  border-top: none !important;
}

.deliverable-item .description-section .deliverable-description:not(.rich-text-editor) {
  width: calc(100% - 44px);
}

.task-item .description-section .task-description:not(.rich-text-editor) {
  width: calc(100% - 27px);
}

.deliverable-item .description-section {
  padding-right: 44px;
}

.task-item .description-section {
  padding-right: 27px;
  padding-left: 26px;
}

.deliverable-description:focus,
.task-description:focus {
  border-color: rgba(62, 107, 156, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(62, 107, 156, 0.25);
  outline: none;
}

/* ============================================
   Rich Text Editor
   ============================================ */
.rich-text-toolbar {
  background-color: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

/* Hide rich text toolbar when feature is disabled */
body.plain-text-mode .rich-text-toolbar {
  display: none !important;
}

/* Style description fields in plain text mode */
body.plain-text-mode .deliverable-description,
body.plain-text-mode .task-description {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  padding: 0.5rem;
  background-color: white;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
}

body.plain-text-mode .deliverable-description:focus,
body.plain-text-mode .task-description:focus {
  border-color: rgba(62, 107, 156, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(62, 107, 156, 0.25);
  outline: none;
}

.toolbar-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  background-color: var(--color-bg-hover);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.toolbar-btn:active,
.toolbar-btn.active {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.toolbar-separator {
  color: var(--color-border);
  margin: 0 var(--space-xs);
  font-weight: 300;
}

.rich-text-editor {
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  border: 1px solid var(--color-border) !important;
  border-top: none !important;
  position: relative;
  line-height: 1.6;
  font-family: inherit;
  font-size: 0.875rem;
  padding: var(--space-md);
  width: 100%;
  box-sizing: border-box;
  background-color: var(--color-bg-input);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.rich-text-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--color-text-placeholder);
  font-style: italic;
  pointer-events: none;
}

.rich-text-editor:focus {
  border-color: var(--color-primary) !important;
  box-shadow: var(--shadow-focus) !important;
  outline: none !important;
}

.rich-text-editor ul,
.rich-text-editor ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.rich-text-editor li {
  margin: 0.25em 0;
}

.rich-text-editor p {
  margin: 0.5em 0;
}

.rich-text-editor p:first-child {
  margin-top: 0;
}

.rich-text-editor p:last-child {
  margin-bottom: 0;
}

.rich-text-editor strong,
.rich-text-editor b {
  font-weight: bold;
}

.rich-text-editor em,
.rich-text-editor i {
  font-style: italic;
}

.rich-text-editor u {
  text-decoration: underline;
}

.rich-text-editor img {
  max-width: 500px;
  max-height: 400px;
  width: auto;
  height: auto;
  margin: 10px 5px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  object-fit: contain;
  display: inline-block;
  vertical-align: top;
  /* Prevent images from being too small */
  min-width: 50px;
  min-height: 50px;
  /* Allow text wrapping */
  float: none;
  clear: none;
  /* Make images selectable */
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.rich-text-editor img:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
  transition: all 0.2s ease;
}

.rich-text-editor img.selected {
  border: 2px solid #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
  outline: none;
}

/* For very small images, don't upscale them but ensure minimum readability */
.rich-text-editor img[width="auto"] {
  max-width: min(100%, 500px);
}

/* Responsive behavior for smaller screens */
@media (max-width: 600px) {
  .rich-text-editor img {
    max-width: 100%;
    max-height: 300px;
    display: block;
    margin: 10px auto;
  }
}

/* When editor is expanded, allow larger images */
.description-section.expanded .rich-text-editor img {
  max-width: 800px;
  max-height: 600px;
}

/* Improve paragraph spacing around images */
.rich-text-editor p {
  margin: 0.5em 0;
  line-height: 1.5;
}

.rich-text-editor p:has(img) {
  margin: 1em 0;
}

.rich-text-editor.drag-over {
  border-color: #007bff !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
  background-color: rgba(0, 123, 255, 0.05);
}

/* ===== First Run Guide (inline lightweight styles) ===== */
.frg-overlay {
  position: fixed;
  top: 0; left: 0; right:0; bottom:0;
  background: rgba(0,0,0,0.35);
  z-index: 2000;
  animation: frgFade .25s ease;
}
.frg-tooltip {
  position: absolute;
  max-width: 320px;
  background: linear-gradient(135deg,#ffffff 0%,#f5f9ff 100%);
  color: #111;
  border-radius: 8px;
  padding: 14px 16px 12px;
  box-shadow: 0 8px 22px -6px rgba(22,42,71,.25), 0 0 0 1px rgba(120,150,190,.15);
  border: 1px solid rgba(120,150,190,0.35);
  z-index: 2001;
  font-size: 14px;
  line-height: 1.4;
}
.frg-tooltip:before { content:""; position:absolute; top:0; left:0; right:0; height:4px; border-radius:8px 8px 0 0; background: linear-gradient(90deg, var(--color-primary), #2d5580, #4a7db8); background-size:200% 100%; animation: frgBar 4s linear infinite; }
.frg-tooltip h4 { margin: 2px 0 8px; font-size: 16px; font-weight: 600; letter-spacing:.25px; color: var(--color-text-primary); display:flex; align-items:center; gap:6px; }
.frg-tooltip h4:before { content:"\f05a"; font-family:"Font Awesome 5 Free"; font-weight:900; font-size:14px; color: var(--color-primary); opacity:.85; }
.frg-tooltip p { margin:0 0 4px; color: var(--color-text-secondary); font-size:13.5px; line-height:1.5; }
.frg-tooltip p + p { margin-top:6px; }
.frg-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.frg-btn { background: var(--color-primary); border: none; color: #fff; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; transition: background var(--transition-fast); }
.frg-btn:hover { background: var(--color-primary-hover); }
.frg-skip { margin-left: auto; background: transparent; border: none; color: var(--color-text-muted); font-size:12px; cursor: pointer; }
.frg-skip:hover { color: var(--color-text-primary); text-decoration: underline; }
.frg-highlight { position: relative; box-shadow: 0 0 0 3px rgba(62, 107, 156, 0.5), 0 0 0 6px rgba(255, 255, 255, 0.25); border-radius: var(--radius-sm); transition: box-shadow .2s ease; animation: frgPulse 1.6s ease-in-out infinite; }
@keyframes frgFade { from { opacity:0;} to { opacity:1;} }
@keyframes frgBar { 0% { background-position:0 0;} 100% { background-position:200% 0;} }
@keyframes frgPulse { 0% { box-shadow: 0 0 0 3px rgba(62, 107, 156, 0.5), 0 0 0 6px rgba(255, 255, 255, 0.25); } 50% { box-shadow: 0 0 0 5px rgba(62, 107, 156, 0.67), 0 0 0 10px rgba(255, 255, 255, 0.06); } 100% { box-shadow: 0 0 0 3px rgba(62, 107, 156, 0.5), 0 0 0 6px rgba(255, 255, 255, 0.25); } }

/* Assignee dropdown inline loading spinner */
.select2-assignee-loading { display:flex; align-items:center; gap:8px; font-size:0.85rem; color:#555; }
.select2-assignee-loading .spinner { width:16px; height:16px; border:2px solid #cfd3d7; border-top-color:#2563eb; border-radius:50%; animation: assigneeSpin .6s linear infinite; }
@keyframes assigneeSpin { to { transform: rotate(360deg); } }

/* Header separator between help icon and profile picture */
.header-separator { display:inline-block; width:1px; height:24px; background:rgba(255,255,255,0.2); margin:0 8px; }
@media (max-width:600px){ .header-separator { height:20px; } }

/* ============================================
   Existing Children Section
   ============================================ */
#existing-children-container {
}

#existing-children-section {
  margin-bottom: var(--space-md);
}

.existing-children-header-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
  margin-bottom: var(--space-md);
}

.existing-children-header-row h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.existing-children-header-row h3 img {
  width: 24px;
  height: 24px;
}

.existing-children-header-row:hover {
  color: var(--color-primary);
}

.existing-children-count {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.existing-children-refresh-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.existing-children-refresh-btn:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.existing-children-caret {
  margin-left: auto;
  transition: transform var(--transition-normal);
  font-size: 14px;
  color: var(--color-text-muted);
}

.existing-children-caret.rotated {
  transform: rotate(180deg);
}

.existing-children-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.existing-children-empty {
  text-align: center;
  padding: var(--space-md);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Child work item card */
.existing-child-item {
  border: 1px solid var(--color-border-light);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background: var(--color-bg-card);
}

.existing-child-item:hover {
  box-shadow: var(--shadow-sm);
}

.existing-child-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  cursor: default;
  min-height: 44px;
}

.existing-child-item.has-tasks .existing-child-header {
  cursor: pointer;
}

.existing-child-expand-caret {
  font-size: 12px;
  color: var(--color-text-muted);
  transition: transform var(--transition-normal);
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}

.existing-child-expand-caret.expanded {
  transform: rotate(90deg);
}

.existing-child-type-icon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.existing-child-id {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}

.existing-child-id:hover {
  text-decoration: underline;
}

.existing-child-type-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.existing-child-title,
.existing-task-title {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.existing-child-state {
  font-size: 0.8125rem;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-weight: 500;
  flex-shrink: 0;
}

.state-new { background-color: #e8f0fe; color: #1967d2; }
.state-active { background-color: #e6f4ea; color: #137333; }
.state-resolved { background-color: #fef3e0; color: #e37400; }
.state-closed { background-color: #f1f3f4; color: #5f6368; }

.existing-child-assignee {
  font-size: 0.8125rem;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.existing-child-task-count {
  font-size: 0.8125rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.existing-child-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.existing-child-header:hover .existing-child-actions,
.existing-task-row:hover .existing-child-actions {
  opacity: 1;
}

.existing-child-delete-btn {
  color: var(--color-text-muted);
  border: none;
  background: none;
  padding: 4px 8px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  cursor: pointer;
}

.existing-child-delete-btn:hover {
  background-color: rgba(192, 82, 78, 0.08);
}

.existing-child-delete-btn:hover { color: var(--color-error); }

/* Inline editable fields */
.ec-editable {
  cursor: pointer;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 1px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.ec-editable:hover {
  border-bottom-color: var(--color-primary);
  background-color: var(--color-primary-light);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Inline input (title, estimate) */
.ec-inline-input {
  font-size: inherit;
  font-family: inherit;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  outline: none;
  background: var(--color-bg-input);
  height: 32px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ec-inline-input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.ec-inline-estimate {
  width: 80px;
}

/* Inline select (state) */
.ec-inline-state-wrapper {
  flex-shrink: 0;
}

.ec-inline-select {
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  outline: none;
  background: var(--color-bg-input);
  height: 32px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ec-inline-select:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

/* Nested tasks */
.existing-child-tasks {
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-xs) 0;
  margin-left: 28px;
}

.existing-task-item {
  padding: 0 12px;
}

.existing-task-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  min-height: 38px;
  font-size: 0.875rem;
}

.existing-task-row:not(:last-child) {
  border-bottom: 1px solid var(--color-border-light);
}

.existing-task-estimate {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  font-weight: 500;
  flex-shrink: 0;
}

/* ============================================
   Modals
   ============================================ */
.modal-content {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  background-color: var(--color-bg-section);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-md) var(--space-lg);
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.modal-title i {
  color: var(--color-primary);
}

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

.modal-body h3 {
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

.modal-footer {
  background-color: var(--color-bg-section);
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-md) var(--space-lg);
  gap: var(--space-sm);
}

/* Success modal */
.success-modal-header {
  background-color: var(--color-success);
  border-bottom: none;
}

.success-modal-header .modal-title {
  color: #fff;
}

.success-modal-header .modal-title i {
  color: #fff;
}

.success-modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.success-body-content {
  text-align: center;
  padding: var(--space-sm) 0;
}

.success-icon-large {
  font-size: 48px;
  color: var(--color-success);
  margin-bottom: var(--space-md);
  line-height: 1;
}

.success-summary {
  font-size: 16px;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.success-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.success-view-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
}

.success-feedback {
  margin-top: var(--space-lg);
  font-size: 12px;
  color: var(--color-text-muted);
}

.success-feedback a {
  color: var(--color-primary);
}

/* Error modal */
.error-modal-header {
  background-color: var(--color-error);
  border-bottom: none;
}

.error-modal-header .modal-title {
  color: #fff;
}

.error-modal-header .modal-title i {
  color: #fff;
}

.error-modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.error-body-content {
  text-align: center;
  padding: var(--space-sm) 0;
}

.error-icon-large {
  font-size: 48px;
  color: var(--color-error);
  margin-bottom: var(--space-md);
  line-height: 1;
}

.error-message {
  font-size: 14px;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
  line-height: 1.5;
}

.error-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ============================================
   Links
   ============================================ */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.reset-link,
.add-template-link {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.reset-link:hover,
.add-template-link:hover {
  color: var(--color-primary);
}

/* ============================================
   Utility Classes
   ============================================ */
.highlight-text {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}

/* Feature name chip (shown after validating parent work item ID) */
.feature-name-chip {
  display: none;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-xs);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-utilization-normal);
  background-color: var(--color-utilization-normal-bg);
  border: 1px solid rgba(19, 115, 51, 0.2);
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: fit-content;
  transition: background-color var(--transition-fast);
}

.feature-name-chip:not(:empty) {
  display: inline-flex;
}

.feature-name-chip:hover {
  background-color: rgba(19, 115, 51, 0.15);
  text-decoration: none;
  color: var(--color-utilization-normal);
}

.feature-name-chip i.fa-check-circle {
  font-size: 0.6875rem;
}

.feature-name-chip i.fa-external-link-alt {
  font-size: 0.5625rem;
  opacity: 0.6;
  margin-left: 2px;
}

/* Total estimate display */
.total-estimate {
  color: #2d7d46 !important;
  font-weight: 600;
  font-size: 1rem;
  padding: var(--space-sm) 0;
}

/* ============================================
   Work Item Hierarchy Breadcrumb
   ============================================ */
.work-item-hierarchy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  background-color: var(--color-bg-section);
  border: 1px solid var(--color-border-light);
  border-radius: 20px;
  margin-bottom: var(--space-md);
}

.hierarchy-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.hierarchy-step i.fa-sitemap {
  font-size: 0.6875rem;
}

.hierarchy-step-active {
  color: var(--color-primary);
  font-weight: 600;
}

.hierarchy-icon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.hierarchy-arrow {
  font-size: 0.5rem;
  color: var(--color-text-placeholder);
}

/* ============================================
   Main Tab Navigation
   ============================================ */
.main-tabs {
  margin-bottom: var(--space-lg);
  border-bottom: 2px solid var(--color-border);
}

.main-tabs .nav-link {
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.main-tabs .nav-link:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-border);
}

.main-tabs .nav-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background-color: transparent;
}

.main-tabs .nav-link i {
  margin-right: 6px;
}

/* ============================================
   Completion Date Badge
   ============================================ */
.completion-date-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background-color: var(--color-bg-section);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  margin-left: var(--space-sm);
  white-space: nowrap;
  font-weight: 500;
}

/* Iteration badge (shown when deliverable is in a different sprint) */
.iteration-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  border: 1px solid rgba(62, 107, 156, 0.2);
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: var(--space-xs);
  white-space: nowrap;
  font-weight: 600;
}

/* Total end date display */
.total-end-date {
  font-weight: 500;
  color: var(--color-primary);
  font-size: 0.875rem;
}

/* ============================================
   Planning Summary Section
   ============================================ */
.planning-summary-section {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-bg-card);
  overflow: hidden;
}

.planning-summary-header {
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-bg-section);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast);
}

.planning-summary-header:hover {
  background-color: var(--color-bg-hover);
}

.planning-summary-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9375rem;
  font-weight: 600;
}

.planning-summary-header h3 i:first-child {
  color: var(--color-primary);
}

.planning-summary-caret {
  margin-left: auto;
  transition: transform var(--transition-normal);
  color: var(--color-text-muted);
}

.planning-summary-caret.rotated {
  transform: rotate(180deg);
}

.planning-summary-content {
  padding: var(--space-md);
}

.planning-summary-empty {
  padding: var(--space-md);
}

.planning-summary-body {
  animation: fadeInSummary 0.2s ease;
}

@keyframes fadeInSummary {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Sprint span indicator */
.sprint-span-indicator {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-bg-section);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.sprint-span-indicator i {
  margin-right: 4px;
}

/* ============================================
   Sprint Breakdown Cards
   ============================================ */
.sprint-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  background-color: var(--color-bg-card);
}

.sprint-card-beyond {
  border-left: 3px solid var(--color-error);
  background-color: #fef8f8;
}

.sprint-card-beyond .sprint-card-name i {
  color: var(--color-error);
  margin-right: 4px;
  font-size: 0.875rem;
}

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

.sprint-card-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
}

.sprint-card-dates {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.sprint-card-util {
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.sprint-card-util.utilization-normal {
  color: var(--color-utilization-normal);
  background-color: var(--color-utilization-normal-bg);
}

.sprint-card-util.utilization-high {
  color: var(--color-utilization-high);
  background-color: var(--color-utilization-high-bg);
}

.sprint-card-util.utilization-over {
  color: var(--color-error);
  background-color: var(--color-utilization-over-bg, #fce8e8);
}

/* Utilization bar */
.sprint-utilization-bar {
  height: 4px;
  background-color: var(--color-border-light);
  border-radius: 2px;
  margin-bottom: var(--space-xs);
  overflow: hidden;
}

.sprint-utilization-fill {
  height: 100%;
  border-radius: 2px;
  transition: width var(--transition-normal);
}

.sprint-utilization-fill.utilization-normal {
  background-color: var(--color-utilization-normal);
}

.sprint-utilization-fill.utilization-high {
  background-color: var(--color-utilization-high);
}

.sprint-utilization-fill.utilization-over {
  background-color: var(--color-error);
}

.sprint-card-summary {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

/* Sprint deliverable list */
.sprint-deliverable-list {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-xs);
}

.sprint-deliverable-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 0;
  font-size: 0.875rem;
}

.sprint-deliverable-title {
  flex: 1;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sprint-deliverable-days {
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.continuation-marker {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ============================================
   CSS Spinner (replaces GIF)
   ============================================ */
.css-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: cssSpinnerRotate 0.8s linear infinite;
  display: inline-block;
}

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

/* ============================================
   Button Loading State
   ============================================ */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-top: -9px;
  margin-left: -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

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

/* ============================================
   Skeleton Loading (shimmer on Select2)
   ============================================ */
.skeleton {
  position: relative;
  overflow: hidden;
  background-color: var(--color-bg-section) !important;
  border-color: var(--color-border-light) !important;
  color: transparent !important;
  pointer-events: none;
  border-radius: var(--radius-md);
}

.skeleton * {
  visibility: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: progressShimmer 1.5s ease-in-out infinite;
}

/* hr softening */
hr {
  border-top-color: var(--color-border-light);
}

