/* ===== CARD COMPONENT ===== */
.card {
  background: var(--pf-color-elev-1);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-md);
  box-shadow: var(--pf-shadow-card);
  padding: var(--pf-space-lg);
  transition: all var(--pf-med) var(--pf-ease);
}

.card.interactive {
  cursor: pointer;
}

.card.interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--pf-shadow-hover);
}

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

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

.card-flat {
  box-shadow: none;
  border: 1px solid var(--pf-border);
}

/* Legacy aliases for cards used across templates */
.card-default,
.screenshot-card-default {
  background: var(--pf-color-elev-1);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-md);
  box-shadow: var(--pf-shadow-card);
  padding: var(--pf-space-lg);
}

.card-default-lg {
  background: var(--pf-color-elev-1);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-card);
  padding: var(--pf-space-xl);
}

/* ===== BUTTON SYSTEM ===== */
/* Base button styles with legacy aliases for backward compatibility */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pf-space-sm);
  padding: var(--pf-space-sm) var(--pf-space-lg);
  border-radius: var(--pf-radius-md);
  font-weight: var(--pf-font-semibold);
  font-size: var(--pf-text-base);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  box-shadow: var(--pf-focus-ring);
}

/* Primary button */
.btn.primary,
.btn-primary {
  background: var(--pf-accent-button, var(--pf-accent));
  color: white;
  border-color: var(--pf-accent-button, var(--pf-accent));
}

.btn.primary:hover,
.btn-primary:hover {
  background: var(--pf-accent-button-hover, var(--pf-accent-hover));
  border-color: var(--pf-accent-button-hover, var(--pf-accent-hover));
  transform: none;
  box-shadow: none;
}

.btn.primary:active,
.btn-primary:active {
  transform: none;
}

/* ==== NO-MOTION OVERRIDES FOR GO-TO-BOTTOM CTA ==== */
/* Prevent hover/focus/active movement for specific CTA buttons */
.btn-primary.cta-nav,
.btn-primary.go-to-bottom {
  transition: none !important;
}

.btn-primary.cta-nav:hover,
.btn-primary.go-to-bottom:hover,
.btn-primary.cta-nav:active,
.btn-primary.go-to-bottom:active,
.btn-primary.cta-nav:focus-visible,
.btn-primary.go-to-bottom:focus-visible {
  transform: none !important;
  box-shadow: none !important;
}

/* Secondary button */
.btn.secondary,
.btn-secondary {
  background: var(--pf-color-elev-1);
  color: var(--pf-color-text);
  border-color: var(--pf-border);
}

.btn.secondary:hover,
.btn-secondary:hover {
  background: var(--pf-color-hover);
  border-color: var(--pf-border-strong);
  transform: none;
  box-shadow: none;
}

/* Link button */
.btn.link,
.btn-link {
  background: transparent;
  color: var(--pf-accent);
  border: none;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: var(--pf-space-xs) var(--pf-space-sm);
}

.btn.link:hover,
.btn-link:hover {
  color: var(--pf-accent-hover);
  text-decoration-thickness: 2px;
}

/* Ghost button */
.btn.ghost,
.btn-ghost {
  background: transparent;
  color: var(--pf-color-text);
  border-color: transparent;
}

.btn.ghost:hover,
.btn-ghost:hover {
  background: var(--pf-color-hover);
  border-color: var(--pf-border);
}

/* Button sizes */
.btn-sm {
  padding: var(--pf-space-xs) var(--pf-space-md);
  font-size: var(--pf-text-sm);
  border-radius: var(--pf-radius-sm);
}

.btn-lg {
  padding: var(--pf-space-md) var(--pf-space-xl);
  font-size: var(--pf-text-lg);
  border-radius: var(--pf-radius-lg);
}

/* Danger button */
.btn.danger,
.btn-danger {
  background: var(--pf-danger);
  color: white;
  border-color: var(--pf-danger);
}

.btn.danger:hover,
.btn-danger:hover {
  background: color-mix(in srgb, var(--pf-danger) 90%, black);
  border-color: color-mix(in srgb, var(--pf-danger) 90%, black);
  transform: none;
  box-shadow: none;
}

/* Success button */
.btn.success,
.btn-success {
  background: var(--pf-success);
  color: white;
  border-color: var(--pf-success);
}

.btn.success:hover,
.btn-success:hover {
  background: color-mix(in srgb, var(--pf-success) 90%, black);
  border-color: color-mix(in srgb, var(--pf-success) 90%, black);
  transform: none;
  box-shadow: none;
}

/* Button states */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}

/* Inline back link variant (header back action without pill) */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--pf-space-xs);
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--pf-color-text);
  text-decoration: none;
}

.back-link span {
  color: var(--pf-color-text-muted);
  font-weight: var(--pf-font-medium);
}

.back-link:hover,
.back-link:hover span {
  color: var(--pf-accent);
}

.btn.loading {
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  display: none;
}

.btn.primary.loading::after,
.btn-primary.loading::after {
  border-color: white;
  border-right-color: transparent;
}

/* remove button spinner animation globally */

/* ===== BADGE COMPONENT ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--pf-space-xs);
  padding: var(--pf-space-xs) var(--pf-space-sm);
  border-radius: 999px;
  background: var(--pf-color-hover);
  color: var(--pf-accent);
  border: 1px solid var(--pf-accent);
  font-size: var(--pf-text-sm);
  font-weight: var(--pf-font-semibold);
  white-space: nowrap;
}

.badge-sm {
  padding: 2px var(--pf-space-xs);
  font-size: var(--pf-text-xs);
}

.badge-lg {
  padding: var(--pf-space-sm) var(--pf-space-md);
  font-size: var(--pf-text-base);
}

/* Badge variants */
.badge.success {
  background: var(--pf-success-bg);
  color: var(--pf-success-text);
  border-color: var(--pf-success);
}

.badge.warning {
  background: var(--pf-warning-bg);
  color: var(--pf-warning-text);
  border-color: var(--pf-warning);
}

.badge.danger {
  background: var(--pf-danger-bg);
  color: var(--pf-danger-text);
  border-color: var(--pf-danger);
}

.badge.info {
  background: var(--pf-info-bg);
  color: var(--pf-info-text);
  border-color: var(--pf-info);
}

.badge.neutral {
  background: var(--pf-color-elev-2);
  color: var(--pf-color-text-muted);
  border-color: var(--pf-border);
}

/* Status badge variant - ALL CAPS status indicators (LATEST, MODIFIED, CRITICAL, etc.) */
.badge.status {
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-size: var(--pf-text-xs);
  font-weight: var(--pf-font-semibold);
}

/* Tag badge variant - sentence case for flows, categories, counts */
.badge.tag {
  text-transform: none;
  letter-spacing: normal;
  font-weight: var(--pf-font-medium);
}

/* ===== CHIP COMPONENT (Filter toggles) ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--pf-space-xs);
  padding: var(--pf-space-sm) var(--pf-space-md);
  border-radius: var(--pf-radius-md);
  background: var(--pf-color-elev-1);
  border: 1px solid var(--pf-border);
  color: var(--pf-color-text);
  font-size: var(--pf-text-sm);
  font-weight: var(--pf-font-medium);
  cursor: pointer;
  transition: all var(--pf-fast) var(--pf-ease);
  white-space: nowrap;
}

.chip:hover {
  background: var(--pf-color-hover);
  border-color: var(--pf-border-strong);
}

.chip:focus-visible {
  outline: none;
  box-shadow: var(--pf-focus-ring);
}

/* Filter chip variant - for filter groups (All/Modified/Added/Removed, etc.) */
.chip.filter {
  border-radius: var(--pf-radius-md);
}

.chip.filter.active,
.chip.filter[aria-pressed="true"] {
  background: color-mix(in srgb, var(--pf-accent) 12%, transparent);
  border-color: var(--pf-accent);
  color: var(--pf-accent);
}

.chip.filter.active:hover,
.chip.filter[aria-pressed="true"]:hover {
  background: color-mix(in srgb, var(--pf-accent) 18%, transparent);
}

/* Chip sizes */
.chip-sm {
  padding: var(--pf-space-xs) var(--pf-space-sm);
  font-size: var(--pf-text-xs);
}

/* ===== INPUT COMPONENT ===== */
.input {
  width: 100%;
  padding: var(--pf-space-sm) var(--pf-space-md);
  border: 1px solid var(--pf-border);
  background: var(--pf-color-elev-1);
  border-radius: var(--pf-radius-sm);
  font-size: var(--pf-text-base);
  color: var(--pf-color-text);
  transition: border-color var(--pf-fast) var(--pf-ease), box-shadow var(--pf-fast) var(--pf-ease);
}

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

.input:focus {
  border-color: var(--pf-accent);
  box-shadow: var(--pf-focus-ring);
}

.input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--pf-color-surface);
}

.input.error {
  border-color: var(--pf-danger);
}

.input.error:focus {
  box-shadow: 0 0 0 3px var(--pf-danger-bg);
}

/* Legacy alias for inputs used in templates */
.input-field {
  width: 100%;
  padding: var(--pf-space-sm) var(--pf-space-md);
  border: 1px solid var(--pf-border);
  background: var(--pf-color-elev-1);
  border-radius: var(--pf-radius-sm);
  font-size: var(--pf-text-base);
  color: var(--pf-color-text);
  transition: border-color var(--pf-fast) var(--pf-ease), box-shadow var(--pf-fast) var(--pf-ease);
}

/* Input sizes */
.input-sm {
  padding: var(--pf-space-xs) var(--pf-space-sm);
  font-size: var(--pf-text-sm);
}

.input-lg {
  padding: var(--pf-space-md) var(--pf-space-lg);
  font-size: var(--pf-text-lg);
}

/* Textarea */
.textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--pf-font-sans);
  line-height: var(--pf-leading-normal);
}

/* Select */
.select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--pf-space-sm) center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
}

/* ===== FORM COMPONENTS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--pf-space-xs);
}

.form-label {
  font-weight: var(--pf-font-medium);
  color: var(--pf-color-text);
  font-size: var(--pf-text-sm);
}

.form-label.required::after {
  content: " *";
  color: var(--pf-danger);
}

.form-help {
  font-size: var(--pf-text-sm);
  color: var(--pf-color-text-muted);
}

.form-error {
  font-size: var(--pf-text-sm);
  color: var(--pf-danger);
}

/* ===== TILES SYSTEM (for animations) ===== */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pf-space-md);
}

.tile {
  height: 96px;
  border-radius: var(--pf-radius-sm);
  background: var(--pf-color-elev-2);
  border: 1px solid var(--pf-border);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--pf-med) var(--pf-ease);
}

.tile.in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
.tile:nth-child(1) {
  transition-delay: 0ms;
}

.tile:nth-child(2) {
  transition-delay: 100ms;
}

.tile:nth-child(3) {
  transition-delay: 200ms;
}

.tile:nth-child(4) {
  transition-delay: 300ms;
}

.tile:nth-child(5) {
  transition-delay: 400ms;
}

.tile:nth-child(6) {
  transition-delay: 500ms;
}

/* ===== ALERT COMPONENT ===== */
.alert {
  padding: var(--pf-space-md);
  border-radius: var(--pf-radius-sm);
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--pf-space-sm);
}

.alert.info {
  background: var(--pf-info-bg);
  color: var(--pf-info-text);
  border-color: var(--pf-info);
}

.alert.success {
  background: var(--pf-success-bg);
  color: var(--pf-success-text);
  border-color: var(--pf-success);
}

.alert.warning {
  background: var(--pf-warning-bg);
  color: var(--pf-warning-text);
  border-color: var(--pf-warning);
}

.alert.danger {
  background: var(--pf-danger-bg);
  color: var(--pf-danger-text);
  border-color: var(--pf-danger);
}

/* ===== TOOLTIP COMPONENT ===== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: var(--pf-space-xs);
  padding: var(--pf-space-xs) var(--pf-space-sm);
  background: var(--pf-color-text);
  color: var(--pf-color-bg);
  font-size: var(--pf-text-sm);
  border-radius: var(--pf-radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--pf-fast) var(--pf-ease);
  z-index: 1000;
  pointer-events: none;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: var(--pf-color-text) transparent transparent transparent;
}

.tooltip:hover .tooltip-content,
.tooltip:focus .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* ===== MODAL COMPONENT ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pf-overlay-bg-light);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--pf-med) var(--pf-ease);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--pf-color-bg);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-hover);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.95) translateY(20px);
  transition: all var(--pf-med) var(--pf-ease);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: var(--pf-text-xl);
  font-weight: var(--pf-font-semibold);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--pf-text-xl);
  cursor: pointer;
  padding: var(--pf-space-xs);
  border-radius: var(--pf-radius-sm);
  color: var(--pf-color-text-muted);
  transition: all var(--pf-fast) var(--pf-ease);
}

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

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

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

/* ===== ENHANCED MOTION EFFECTS ===== */

/* Staggered tile animations */
.tiles.animate .tile {
  animation: tileSlideIn var(--pf-slow) var(--pf-ease) forwards;
}

.tiles.animate .tile:nth-child(1) {
  animation-delay: 0ms;
}

.tiles.animate .tile:nth-child(2) {
  animation-delay: 100ms;
}

.tiles.animate .tile:nth-child(3) {
  animation-delay: 200ms;
}

.tiles.animate .tile:nth-child(4) {
  animation-delay: 300ms;
}

.tiles.animate .tile:nth-child(5) {
  animation-delay: 400ms;
}

.tiles.animate .tile:nth-child(6) {
  animation-delay: 500ms;
}

.tiles.animate .tile:nth-child(7) {
  animation-delay: 600ms;
}

.tiles.animate .tile:nth-child(8) {
  animation-delay: 700ms;
}

.tiles.animate .tile:nth-child(9) {
  animation-delay: 800ms;
}

@keyframes tileSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Enhanced button interactions */
.btn.primary {
  position: relative;
  overflow: hidden;
}

.btn.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--pf-color-hover), transparent);
  transition: left var(--pf-slow) var(--pf-ease);
}

.btn.primary:hover::before {
  left: 100%;
}

/* Card hover enhancements */
.card.interactive {
  position: relative;
  overflow: hidden;
}

.card.interactive::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--pf-color-hover) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--pf-med) var(--pf-ease);
}

.card.interactive:hover::before {
  opacity: 1;
}

/* Pulse animation for loading states */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bounce animation for notifications */
@keyframes bounce {

  0%,
  20%,
  53%,
  80%,
  100% {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translate3d(0, 0, 0);
  }

  40%,
  43% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -30px, 0);
  }

  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -15px, 0);
  }

  90% {
    transform: translate3d(0, -4px, 0);
  }
}

.bounce {
  animation: bounce 1s;
}

/* Fade in animation for content */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp var(--pf-slow) var(--pf-ease) forwards;
}

/* Scale animation for modals */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.scale-in {
  animation: scaleIn var(--pf-med) var(--pf-ease) forwards;
}

/* Slide animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight var(--pf-med) var(--pf-ease) forwards;
}

.slide-in-left {
  animation: slideInLeft var(--pf-med) var(--pf-ease) forwards;
}

/* Enhanced focus states with motion */
.btn:focus-visible,
.input:focus-visible,
.card.interactive:focus-visible {
  transform: none;
  transition: none;
}

/* Reduced motion overrides */
@media (prefers-reduced-motion: reduce) {

  .tiles.animate .tile,
  .fade-in-up,
  .scale-in,
  .slide-in-right,
  .slide-in-left,
  .bounce,
  .pulse {
    animation: none;
  }

  .lift:hover,
  .btn:hover,
  .card:hover,
  .btn:focus-visible,
  .input:focus-visible,
  .card.interactive:focus-visible {
    transform: none;
  }

  .btn.primary::before,
  .card.interactive::before {
    display: none;
  }
}

/* ===== RESPONSIVE COMPONENT ADJUSTMENTS ===== */
@media (max-width: 640px) {
  .btn {
    padding: var(--pf-space-sm) var(--pf-space-md);
    font-size: var(--pf-text-sm);
  }

  .btn-lg {
    padding: var(--pf-space-sm) var(--pf-space-lg);
    font-size: var(--pf-text-base);
  }

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

  .tiles {
    grid-template-columns: 1fr;
  }

  .modal {
    margin: var(--pf-space-md);
    max-width: calc(100vw - 2rem);
  }
}

/* =
==== ICON SYSTEM ===== */
/* Standardized Lucide icon sizing and styling */

/* Base icon styling - applies to all Lucide icons */
[data-lucide] {
  width: var(--pf-icon-sm);
  height: var(--pf-icon-sm);
  stroke-width: 1.5;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Icon size variants */
.icon-xs [data-lucide],
[data-lucide].icon-xs {
  width: var(--pf-icon-xs);
  height: var(--pf-icon-xs);
}

.icon-sm [data-lucide],
[data-lucide].icon-sm {
  width: var(--pf-icon-sm);
  height: var(--pf-icon-sm);
}

.icon-md [data-lucide],
[data-lucide].icon-md {
  width: var(--pf-icon-md);
  height: var(--pf-icon-md);
}

.icon-lg [data-lucide],
[data-lucide].icon-lg {
  width: var(--pf-icon-lg);
  height: var(--pf-icon-lg);
}

.icon-xl [data-lucide],
[data-lucide].icon-xl {
  width: var(--pf-icon-xl);
  height: var(--pf-icon-xl);
}

.icon-2xl [data-lucide],
[data-lucide].icon-2xl {
  width: var(--pf-icon-2xl);
  height: var(--pf-icon-2xl);
}

/* Context-specific icon sizing */
/* Button icons */
.btn [data-lucide] {
  width: var(--pf-icon-sm);
  height: var(--pf-icon-sm);
}

.btn-sm [data-lucide] {
  width: var(--pf-icon-xs);
  height: var(--pf-icon-xs);
}

.btn-lg [data-lucide] {
  width: var(--pf-icon-md);
  height: var(--pf-icon-md);
}

/* Header and navigation icons */
.backlog-header [data-lucide],
.spec-header [data-lucide] {
  width: var(--pf-icon-sm);
  height: var(--pf-icon-sm);
}

/* Table and list icons */
.specs-table [data-lucide],
.backlog-card [data-lucide] {
  width: var(--pf-icon-sm);
  height: var(--pf-icon-sm);
}

/* Status and indicator icons */
.status-icon,
.readiness-icon {
  width: var(--pf-icon-sm);
  height: var(--pf-icon-sm);
}

/* Filter and toolbar icons */
.filter-icon,
.view-toggle-icon,
.sort-icon {
  width: var(--pf-icon-sm);
  height: var(--pf-icon-sm);
}

/* Search icons */
.search-icon {
  width: var(--pf-icon-sm);
  height: var(--pf-icon-sm);
}

/* Empty state and large display icons */
.empty-state-icon [data-lucide] {
  width: var(--pf-icon-2xl);
  height: var(--pf-icon-2xl);
}

/* Modal and dialog icons */
.modal-header [data-lucide] {
  width: var(--pf-icon-md);
  height: var(--pf-icon-md);
}

/* Toast notification icons */
.toast [data-lucide],
.notification [data-lucide] {
  width: var(--pf-icon-md);
  height: var(--pf-icon-md);
}

/* Loading and spinner icons */
.loading-spinner [data-lucide],
.spinner-icon {
  width: var(--pf-icon-md);
  height: var(--pf-icon-md);
}

/* Animated icons */
.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Icon color consistency */
[data-lucide] {
  color: currentColor;
}

/* Ensure icons inherit text color by default */
.text-muted [data-lucide] {
  color: var(--pf-color-text-muted);
}

.text-success [data-lucide] {
  color: var(--pf-success);
}

.text-warning [data-lucide] {
  color: var(--pf-warning);
}

.text-danger [data-lucide] {
  color: var(--pf-danger);
}

.text-info [data-lucide] {
  color: var(--pf-info);
}

/* ===== UNIFIED PAGE HEADER SYSTEM ===== */
/* Consistent header pattern for deliverables, specs, and detail pages */

.page-header {
  background: var(--pf-color-elev-1);
  border-bottom: 1px solid var(--pf-border);
  padding: var(--pf-space-lg) 0;
  margin-bottom: var(--pf-space-xl);
}

.page-header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--pf-space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pf-space-lg);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: var(--pf-space-md);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: var(--pf-space-sm);
}

.page-title {
  font-size: var(--pf-text-2xl);
  font-weight: var(--pf-font-bold);
  color: var(--pf-color-text);
  margin: 0;
}

.page-subtitle {
  color: var(--pf-color-text-muted);
  font-size: var(--pf-text-base);
  margin: var(--pf-space-xs) 0 0 0;
}

/* Back button consistent across pages */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--pf-space-xs);
  padding: var(--pf-space-sm) var(--pf-space-md);
  background: var(--pf-color-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-md);
  color: var(--pf-color-text);
  text-decoration: none;
  font-size: var(--pf-text-sm);
  font-weight: var(--pf-font-medium);
  transition: all var(--pf-fast) var(--pf-ease);
}

.back-button:hover {
  background: var(--pf-color-hover);
  border-color: var(--pf-accent);
  color: var(--pf-color-text);
  transform: translateX(-2px);
}

.back-button i {
  width: 1rem;
  height: 1rem;
}

/* ===== UNIFIED CARD SYSTEM ===== */
/* Consistent card pattern matching deliverables aesthetic */

.unified-card {
  background: var(--pf-color-elev-1);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-card);
  padding: var(--pf-space-xl);
  transition: all var(--pf-fast) var(--pf-ease);
  margin-bottom: var(--pf-space-lg);
}

.unified-card:hover {
  box-shadow: var(--pf-shadow-hover);
  transform: translateY(-1px);
}

.unified-card--interactive {
  cursor: pointer;
}

.unified-card--interactive:hover {
  border-color: var(--pf-accent);
}

.unified-card--priority {
  border-left: 4px solid var(--pf-accent);
}

.unified-card--subtle {
  background: var(--pf-color-surface);
  border-style: dashed;
  opacity: 0.9;
}

.unified-card--subtle:hover {
  opacity: 1;
  border-style: solid;
}

/* Card header */
.unified-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--pf-space-lg);
  padding-bottom: var(--pf-space-md);
  border-bottom: 1px solid var(--pf-border);
}

.unified-card-title {
  font-size: var(--pf-text-lg);
  font-weight: var(--pf-font-semibold);
  color: var(--pf-color-text);
  margin: 0;
}

.unified-card-actions {
  display: flex;
  align-items: center;
  gap: var(--pf-space-sm);
}

/* Card content */
.unified-card-content {
  line-height: var(--pf-leading-relaxed);
}

/* ===== UNIFIED BADGE SYSTEM ===== */
/* Consistent badges across all pages */

.unified-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--pf-space-xs);
  padding: var(--pf-space-xs) var(--pf-space-sm);
  border-radius: 999px;
  font-size: var(--pf-text-xs);
  font-weight: var(--pf-font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border: 1px solid;
  white-space: nowrap;
}

.unified-badge--status-draft {
  background: var(--pf-warning-bg);
  color: var(--pf-warning-text);
  border-color: var(--pf-warning);
}

.unified-badge--status-ready {
  background: var(--pf-success-bg);
  color: var(--pf-success-text);
  border-color: var(--pf-success);
}

.unified-badge--status-review {
  background: var(--pf-info-bg);
  color: var(--pf-info-text);
  border-color: var(--pf-info);
}

.unified-badge--type-added {
  background: var(--pf-success-bg);
  color: var(--pf-success-text);
  border-color: var(--pf-success);
}

.unified-badge--type-modified {
  background: var(--pf-warning-bg);
  color: var(--pf-warning-text);
  border-color: var(--pf-warning);
}

.unified-badge--type-removed {
  background: var(--pf-danger-bg);
  color: var(--pf-danger-text);
  border-color: var(--pf-danger);
}

.unified-badge--priority-p1 {
  background: var(--pf-danger-bg);
  color: var(--pf-danger-text);
  border-color: var(--pf-danger);
}

.unified-badge--priority-p2 {
  background: var(--pf-warning-bg);
  color: var(--pf-warning-text);
  border-color: var(--pf-warning);
}

.unified-badge--priority-p3 {
  background: var(--pf-success-bg);
  color: var(--pf-success-text);
  border-color: var(--pf-success);
}

.unified-badge--flow {
  background: var(--pf-info-bg);
  color: var(--pf-info-text);
  border-color: var(--pf-info);
  font-family: var(--pf-font-mono);
  text-transform: none;
  letter-spacing: normal;
}

/* ===== UNIFIED LAYOUT GRID ===== */
/* Consistent grid system for all pages */

.unified-grid {
  display: grid;
  gap: var(--pf-space-xl);
  margin-bottom: var(--pf-space-xl);
}

.unified-grid--2-col {
  grid-template-columns: 1fr 1fr;
}

.unified-grid--3-col {
  grid-template-columns: repeat(3, 1fr);
}

.unified-grid--sidebar {
  grid-template-columns: 1fr 300px;
}

.unified-grid--main-sidebar {
  grid-template-columns: 2fr 1fr;
}

/* Responsive grid */
@media (max-width: 768px) {

  .unified-grid--2-col,
  .unified-grid--3-col,
  .unified-grid--sidebar,
  .unified-grid--main-sidebar {
    grid-template-columns: 1fr;
  }
}

/* ===== UNIFIED FORM SYSTEM ===== */
/* Consistent form styling across pages */

.unified-form-group {
  margin-bottom: var(--pf-space-lg);
}

.unified-form-label {
  display: block;
  font-weight: var(--pf-font-medium);
  color: var(--pf-color-text);
  margin-bottom: var(--pf-space-xs);
  font-size: var(--pf-text-sm);
}

.unified-form-input {
  width: 100%;
  padding: var(--pf-space-md);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-md);
  background: var(--pf-color-elev-1);
  color: var(--pf-color-text);
  font-size: var(--pf-text-base);
  transition: all var(--pf-fast) var(--pf-ease);
}

.unified-form-input:focus {
  outline: none;
  border-color: var(--pf-accent);
  box-shadow: var(--pf-focus-ring);
}

.unified-form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--pf-font-sans);
  line-height: var(--pf-leading-normal);
}

.unified-form-help {
  font-size: var(--pf-text-sm);
  color: var(--pf-color-text-muted);
  margin-top: var(--pf-space-xs);
}