/* Atlas Dashboard Styles - Material Design 3 */
:root {
  /* Material Design Color Palette */
  --md-primary: #1976d2;
  --md-primary-variant: #004ba0;
  --md-primary-light: #63a4ff;
  --md-secondary: #26a69a;
  --md-secondary-variant: #00766c;
  --md-secondary-light: #64d8cb;
  
  /* Semantic Colors */
  --md-success: #43a047;
  --md-warning: #fb8c00;
  --md-error: #e53935;
  --md-info: #1e88e5;
  
  /* Surface Colors */
  --md-background: #fafafa;
  --md-surface: #ffffff;
  --md-surface-variant: #f5f5f5;
  
  /* Text Colors */
  --md-on-primary: #ffffff;
  --md-on-secondary: #ffffff;
  --md-on-surface: #212121;
  --md-on-surface-variant: #757575;
  --md-text-primary: rgba(0, 0, 0, 0.87);
  --md-text-secondary: rgba(0, 0, 0, 0.60);
  --md-text-disabled: rgba(0, 0, 0, 0.38);
  
  /* State Colors */
  --md-hover-overlay: rgba(0, 0, 0, 0.04);
  --md-focus-overlay: rgba(0, 0, 0, 0.12);
  --md-pressed-overlay: rgba(0, 0, 0, 0.16);
  --md-dragged-overlay: rgba(0, 0, 0, 0.08);
  
  /* Borders */
  --md-divider: rgba(0, 0, 0, 0.12);
  --md-outline: rgba(0, 0, 0, 0.23);
  
  /* Material Design Elevation Shadows */
  --md-elevation-0: none;
  --md-elevation-1: 0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);
  --md-elevation-2: 0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12);
  --md-elevation-3: 0px 3px 3px -2px rgba(0,0,0,0.2), 0px 3px 4px 0px rgba(0,0,0,0.14), 0px 1px 8px 0px rgba(0,0,0,0.12);
  --md-elevation-4: 0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12);
  --md-elevation-6: 0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12);
  --md-elevation-8: 0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12);
  --md-elevation-12: 0px 7px 8px -4px rgba(0,0,0,0.2), 0px 12px 17px 2px rgba(0,0,0,0.14), 0px 5px 22px 4px rgba(0,0,0,0.12);
  --md-elevation-16: 0px 8px 10px -5px rgba(0,0,0,0.2), 0px 16px 24px 2px rgba(0,0,0,0.14), 0px 6px 30px 5px rgba(0,0,0,0.12);
  --md-elevation-24: 0px 11px 15px -7px rgba(0,0,0,0.2), 0px 24px 38px 3px rgba(0,0,0,0.14), 0px 9px 46px 8px rgba(0,0,0,0.12);
  
  /* Typography Scale */
  --md-headline-1: 96px;
  --md-headline-2: 60px;
  --md-headline-3: 48px;
  --md-headline-4: 34px;
  --md-headline-5: 24px;
  --md-headline-6: 20px;
  --md-subtitle-1: 16px;
  --md-subtitle-2: 14px;
  --md-body-1: 16px;
  --md-body-2: 14px;
  --md-button: 14px;
  --md-caption: 12px;
  --md-overline: 10px;
  
  /* Spacing (8dp grid) */
  --md-spacing-1: 8px;
  --md-spacing-2: 16px;
  --md-spacing-3: 24px;
  --md-spacing-4: 32px;
  --md-spacing-5: 40px;
  --md-spacing-6: 48px;
  --md-spacing-7: 56px;
  --md-spacing-8: 64px;
  
  /* Border Radius */
  --md-radius-small: 4px;
  --md-radius-medium: 8px;
  --md-radius-large: 16px;
  --md-radius-extra-large: 28px;
  
  /* Transitions */
  --md-transition-standard: 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --md-transition-emphasized: 500ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --md-transition-fade: 150ms cubic-bezier(0.4, 0.0, 0.2, 1);
  
  /* Priority Colors for Story Cards */
  --priority-critical: #b71c1c;
  --priority-high: #e53935;
  --priority-medium: #fb8c00;
  --priority-low: #43a047;
}

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

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--md-background);
  color: var(--md-text-primary);
  line-height: 1.5;
  font-size: var(--md-body-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.dashboard-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.dashboard-header {
  background: var(--md-surface);
  border-bottom: 1px solid var(--md-divider);
  padding: var(--md-spacing-2) var(--md-spacing-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--md-elevation-2);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-4);
}

.header-left h1 {
  font-size: var(--md-headline-6);
  font-weight: 500;
  color: var(--md-primary);
  display: flex;
  align-items: center;
  gap: var(--md-spacing-1);
  letter-spacing: 0.15px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-1);
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
  padding: 4px 12px;
  border-radius: 16px;
  background: var(--md-surface-variant);
  transition: all var(--md-transition-fade);
}

.connection-status.connected {
  color: var(--md-success);
  background: rgba(67, 160, 71, 0.1);
}

.connection-status.disconnected {
  color: var(--md-error);
  background: rgba(229, 57, 53, 0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.last-updated {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.refresh-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: var(--background-color);
  border-color: var(--primary-color);
}

/* Navigation */
.dashboard-nav {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  gap: 1rem;
}

.nav-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn:hover {
  color: var(--primary-color);
}

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

/* Main Content */
.dashboard-main {
  flex: 1;
  padding: 2rem;
}

.dashboard-section {
  display: none;
}

.dashboard-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.section-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-controls select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--surface-color);
}

/* System Health */
.system-health {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
}

.system-health.healthy {
  background: #dcfce7;
  color: var(--success-color);
}

.system-health.warning {
  background: #fef3c7;
  color: var(--warning-color);
}

.system-health.error {
  background: #fee2e2;
  color: var(--error-color);
}

/* Overview Grid */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.metric-header h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.metric-header i {
  font-size: 1.25rem;
  color: var(--primary-color);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.metric-trend {
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.metric-trend.positive {
  color: var(--success-color);
}

.metric-trend.negative {
  color: var(--error-color);
}

/* Activity Feed */
.activity-section {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.activity-section h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.activity-feed {
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.activity-item.loading {
  justify-content: center;
  color: var(--text-secondary);
}

/* Performance Grid */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-container {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.chart-container h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.chart-container canvas {
  max-height: 300px;
}

/* Alerts */
.alerts-section {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.alerts-section h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-item {
  padding: 1rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-item.loading {
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.alert-item.low {
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  color: #0c4a6e;
}

.alert-item.medium {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.alert-item.high {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.alert-item.critical {
  background: #fdf2f8;
  border: 1px solid #ec4899;
  color: #831843;
}

/* Agile Board */
.sprint-info {
  background: linear-gradient(135deg, var(--md-surface) 0%, rgba(25, 118, 210, 0.03) 100%);
  border-radius: var(--md-radius-large);
  padding: var(--md-spacing-3);
  margin-bottom: var(--md-spacing-4);
  box-shadow: var(--md-elevation-2);
  position: relative;
  overflow: hidden;
  transition: all var(--md-transition-standard);
}

.sprint-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--md-primary) 0%, var(--md-secondary) 100%);
}

.sprint-info:hover {
  box-shadow: var(--md-elevation-4);
  transform: translateY(-2px);
}

.sprint-details {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-2);
}

.sprint-details.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--md-spacing-1);
  color: var(--md-text-secondary);
  padding: var(--md-spacing-4);
}

.sprint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--md-spacing-2);
}

.sprint-header h3 {
  font-size: var(--md-headline-5);
  font-weight: 500;
  color: var(--md-text-primary);
  margin: 0;
}

.sprint-status {
  padding: 6px 16px;
  border-radius: var(--md-radius-extra-large);
  font-size: var(--md-caption);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sprint-status.active {
  background: rgba(67, 160, 71, 0.1);
  color: var(--md-success);
}

.sprint-status.completed {
  background: rgba(117, 117, 117, 0.1);
  color: var(--md-text-disabled);
}

.sprint-status.planning {
  background: rgba(30, 136, 229, 0.1);
  color: var(--md-info);
}

.sprint-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--md-spacing-2);
  margin-bottom: var(--md-spacing-3);
}

.sprint-meta span {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-1);
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
}

.sprint-meta strong {
  color: var(--md-text-primary);
  font-weight: 500;
}

.sprint-progress {
  background: var(--md-surface-variant);
  border-radius: var(--md-radius-medium);
  padding: var(--md-spacing-2);
}

.sprint-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--md-spacing-1);
  font-size: var(--md-body-2);
}

.sprint-progress-header span {
  color: var(--md-text-secondary);
}

.sprint-progress .progress-bar {
  height: 12px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.sprint-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--md-primary) 0%, var(--md-primary-light) 100%);
  border-radius: 6px;
  transition: width var(--md-transition-standard);
  position: relative;
  overflow: hidden;
}

.sprint-progress .progress-fill::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: shimmer 2s infinite;
}

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

.no-sprint-message {
  text-align: center;
  padding: var(--md-spacing-4);
}

.no-sprint-message h3 {
  font-size: var(--md-headline-6);
  font-weight: 400;
  color: var(--md-text-primary);
  margin-bottom: var(--md-spacing-1);
}

.no-sprint-message p {
  font-size: var(--md-body-1);
  color: var(--md-text-secondary);
}

.backlog-summary {
  margin-top: var(--md-spacing-3);
  padding-top: var(--md-spacing-3);
  border-top: 1px solid var(--md-divider);
}

.backlog-summary h4 {
  font-size: var(--md-subtitle-1);
  font-weight: 500;
  color: var(--md-text-primary);
  margin-bottom: var(--md-spacing-2);
}

.sprint-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--md-spacing-2);
  margin-top: var(--md-spacing-3);
}

.metric-card.mini {
  background: var(--md-surface);
  border-radius: var(--md-radius-medium);
  padding: var(--md-spacing-2);
  box-shadow: var(--md-elevation-1);
  display: flex;
  align-items: center;
  gap: var(--md-spacing-2);
  transition: all var(--md-transition-standard);
}

.metric-card.mini:hover {
  box-shadow: var(--md-elevation-3);
  transform: translateY(-1px);
}

.metric-card.mini i {
  font-size: 24px;
  color: var(--md-primary);
  opacity: 0.8;
}

.metric-card.mini .metric-content {
  flex: 1;
}

.metric-card.mini .metric-value {
  font-size: var(--md-headline-6);
  font-weight: 700;
  color: var(--md-text-primary);
  line-height: 1;
}

.metric-card.mini .metric-label {
  font-size: var(--md-caption);
  color: var(--md-text-secondary);
  margin-top: 2px;
}

.board-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  min-height: 600px;
}

.board-column {
  background: var(--md-surface);
  border-radius: var(--md-radius-medium);
  padding: var(--md-spacing-2);
  box-shadow: var(--md-elevation-1);
  transition: box-shadow var(--md-transition-standard);
}

.board-column:hover {
  box-shadow: var(--md-elevation-2);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--md-spacing-2);
  padding-bottom: var(--md-spacing-1);
  border-bottom: 1px solid var(--md-divider);
}

.column-header h3 {
  font-size: var(--md-subtitle-1);
  font-weight: 500;
  color: var(--md-text-primary);
  letter-spacing: 0.15px;
}

.story-count {
  background: var(--md-primary);
  color: var(--md-on-primary);
  border-radius: 12px;
  min-width: 24px;
  height: 24px;
  padding: 0 var(--md-spacing-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--md-caption);
  font-weight: 500;
}

.cards-container {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-1);
  padding: var(--md-spacing-1) 0;
}

.cards-container.drag-over {
  background-color: var(--md-hover-overlay);
  border-radius: var(--md-radius-small);
}

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--md-spacing-1);
  padding: var(--md-spacing-3);
  color: var(--md-text-secondary);
  font-size: var(--md-body-2);
}

.loading-card i {
  color: var(--md-primary);
}

/* Material Design Story Card */
.story-card {
  background: var(--md-surface);
  border-radius: var(--md-radius-small);
  padding: var(--md-spacing-2);
  cursor: pointer;
  transition: all var(--md-transition-standard);
  box-shadow: var(--md-elevation-1);
  position: relative;
  overflow: hidden;
  border-left: 4px solid transparent;
}

/* Priority indicator border */
.story-card[data-priority="critical"] {
  border-left-color: var(--priority-critical);
}

.story-card[data-priority="high"] {
  border-left-color: var(--priority-high);
}

.story-card[data-priority="medium"] {
  border-left-color: var(--priority-medium);
}

.story-card[data-priority="low"] {
  border-left-color: var(--priority-low);
}

.story-card:hover {
  box-shadow: var(--md-elevation-4);
  transform: translateY(-2px);
}

.story-card:active {
  box-shadow: var(--md-elevation-2);
  transform: translateY(0);
}

.story-card.dragging {
  opacity: 0.5;
  box-shadow: var(--md-elevation-8);
  transform: rotate(2deg);
}

.story-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--md-spacing-1);
}

.story-id {
  font-size: var(--md-caption);
  font-weight: 500;
  color: var(--md-text-secondary);
  letter-spacing: 0.4px;
}

.story-points {
  background: var(--md-primary-light);
  color: var(--md-primary-variant);
  border-radius: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--md-caption);
  font-weight: 600;
}

.story-title {
  font-size: var(--md-body-2);
  font-weight: 500;
  margin-bottom: var(--md-spacing-1);
  line-height: 1.43;
  color: var(--md-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-assignee {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-1);
  font-size: var(--md-caption);
  color: var(--md-text-secondary);
  margin-bottom: var(--md-spacing-1);
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: var(--md-caption);
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: var(--md-elevation-1);
}

/* Avatar color variations based on name */
.avatar[data-color="1"] { background: #f44336; }
.avatar[data-color="2"] { background: #e91e63; }
.avatar[data-color="3"] { background: #9c27b0; }
.avatar[data-color="4"] { background: #673ab7; }
.avatar[data-color="5"] { background: #3f51b5; }
.avatar[data-color="6"] { background: #2196f3; }
.avatar[data-color="7"] { background: #00bcd4; }
.avatar[data-color="8"] { background: #009688; }
.avatar[data-color="9"] { background: #4caf50; }
.avatar[data-color="10"] { background: #ff9800; }

.story-progress {
  margin-top: var(--md-spacing-1);
}

.progress-bar {
  background: var(--md-divider);
  border-radius: 2px;
  height: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background: var(--md-primary);
  height: 100%;
  transition: width var(--md-transition-standard);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

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

.story-tags {
  display: flex;
  gap: var(--md-spacing-1);
  margin-top: var(--md-spacing-1);
  flex-wrap: wrap;
}

.story-tag {
  background: var(--md-surface-variant);
  color: var(--md-text-secondary);
  font-size: var(--md-caption);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  letter-spacing: 0.25px;
  transition: all var(--md-transition-fade);
}

.story-tag:hover {
  background: var(--md-primary-light);
  color: var(--md-primary-variant);
}

/* Epic indicator */
.story-epic {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--md-spacing-1);
  font-size: var(--md-caption);
  color: var(--md-secondary);
}

.story-epic i {
  font-size: 10px;
}

.epic-id {
  font-weight: 500;
  letter-spacing: 0.25px;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: var(--md-spacing-6) var(--md-spacing-3);
  color: var(--md-text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  color: var(--md-divider);
  margin-bottom: var(--md-spacing-2);
}

.empty-state-title {
  font-size: var(--md-subtitle-1);
  font-weight: 500;
  color: var(--md-text-primary);
  margin-bottom: var(--md-spacing-1);
}

.empty-state-message {
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
}

/* Ripple effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
}

/* Story Detail Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.modal.show {
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--md-transition-fade);
}

.modal.show .modal-backdrop {
  opacity: 1;
}

.modal-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  transform-origin: center center;
  background: var(--md-surface);
  border-radius: var(--md-radius-large);
  box-shadow: var(--md-elevation-24);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: transform var(--md-transition-emphasized), opacity var(--md-transition-emphasized);
}

.modal.show .modal-container {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

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

.modal-title {
  font-size: var(--md-headline-5);
  font-weight: 400;
  color: var(--md-text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  padding: var(--md-spacing-1);
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-text-secondary);
  transition: all var(--md-transition-fade);
}

.modal-close:hover {
  background: var(--md-hover-overlay);
  color: var(--md-text-primary);
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--md-spacing-3);
}

/* Story Detail Sections */
.story-detail-section {
  margin-bottom: var(--md-spacing-3);
}

.story-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--md-spacing-3);
}

.story-detail-title {
  font-size: var(--md-headline-5);
  font-weight: 400;
  color: var(--md-text-primary);
  margin: 0 0 var(--md-spacing-1) 0;
}

.story-detail-meta {
  display: flex;
  gap: var(--md-spacing-2);
  align-items: center;
  color: var(--md-text-secondary);
  font-size: var(--md-body-2);
}

.story-detail-priority {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: var(--md-caption);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.story-detail-priority[data-priority="critical"] {
  background: rgba(183, 28, 28, 0.1);
  color: var(--priority-critical);
}

.story-detail-priority[data-priority="high"] {
  background: rgba(229, 57, 53, 0.1);
  color: var(--priority-high);
}

.story-detail-priority[data-priority="medium"] {
  background: rgba(251, 140, 0, 0.1);
  color: var(--priority-medium);
}

.story-detail-priority[data-priority="low"] {
  background: rgba(67, 160, 71, 0.1);
  color: var(--priority-low);
}

.story-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--md-spacing-3);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-1);
}

.detail-item label {
  font-size: var(--md-caption);
  font-weight: 500;
  color: var(--md-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.story-status-select {
  padding: var(--md-spacing-1) var(--md-spacing-2);
  border: 1px solid var(--md-outline);
  border-radius: var(--md-radius-small);
  background: var(--md-surface);
  font-size: var(--md-body-2);
  color: var(--md-text-primary);
  cursor: pointer;
  transition: all var(--md-transition-fade);
}

.story-status-select:hover {
  border-color: var(--md-primary);
}

.story-status-select:focus {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.assignee-selector {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-1);
}

.acceptance-criteria-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.acceptance-item {
  display: flex;
  align-items: flex-start;
  gap: var(--md-spacing-1);
  padding: var(--md-spacing-1) 0;
}

.acceptance-item input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
}

.progress-section {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-2);
}

.progress-bar.large {
  flex: 1;
  height: 8px;
}

.progress-text {
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
  min-width: 80px;
  text-align: right;
}

.time-tracking-grid {
  display: flex;
  gap: var(--md-spacing-4);
}

.time-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-item label {
  font-size: var(--md-caption);
  color: var(--md-text-secondary);
}

.time-item span {
  font-size: var(--md-subtitle-1);
  font-weight: 500;
  color: var(--md-text-primary);
}

.story-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-2);
}

.story-timeline .timeline-item {
  display: flex;
  align-items: flex-start;
  gap: var(--md-spacing-2);
}

.story-timeline .timeline-item i {
  color: var(--md-primary);
  margin-top: 2px;
}

.timestamp {
  font-size: var(--md-caption);
  color: var(--md-text-secondary);
  display: block;
}

.btn-icon {
  background: none;
  border: none;
  padding: var(--md-spacing-1);
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-text-secondary);
  transition: all var(--md-transition-fade);
}

.btn-icon:hover {
  background: var(--md-hover-overlay);
  color: var(--md-text-primary);
}

.loading-state,
.error-state {
  text-align: center;
  padding: var(--md-spacing-6);
  color: var(--md-text-secondary);
}

.loading-state i,
.error-state i {
  font-size: 48px;
  margin-bottom: var(--md-spacing-2);
  display: block;
}

.error-state {
  color: var(--md-error);
}

/* Sprint Analytics */
.sprint-analytics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

/* Security */
.security-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--background-color);
  border: 1px solid var(--border-color);
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.security-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.security-card.full-width {
  grid-column: 1 / -1;
}

.security-card h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.security-metrics {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.security-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--background-color);
  border-radius: var(--border-radius);
}

.security-metric .metric-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.security-metric .metric-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.alerts-list,
.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.approval-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-color);
}

.approval-item.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.approval-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.approval-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.approval-risk {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.approval-risk.low {
  background: #dcfce7;
  color: var(--success-color);
}

.approval-risk.medium {
  background: #fef3c7;
  color: var(--warning-color);
}

.approval-risk.high {
  background: #fee2e2;
  color: var(--error-color);
}

.approval-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.approval-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-approve {
  background: var(--success-color);
  color: white;
}

.btn-approve:hover {
  background: #047857;
}

.btn-deny {
  background: var(--error-color);
  color: white;
}

.btn-deny:hover {
  background: #b91c1c;
}

/* Errors */
.errors-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.error-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card h4 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-section {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.timeline-section h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.error-timeline {
  max-height: 400px;
  overflow-y: auto;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.timeline-item.loading {
  justify-content: center;
  color: var(--text-secondary);
}

.error-severity {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.error-severity.critical {
  background: var(--error-color);
}

.error-severity.high {
  background: #f59e0b;
}

.error-severity.medium {
  background: #6366f1;
}

.error-severity.low {
  background: var(--success-color);
}

.error-details {
  flex: 1;
}

.error-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

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

/* Utilities */
.icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--background-color);
  border-color: var(--primary-color);
}

.loading {
  opacity: 0.6;
}

.fa-spin {
  animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-header {
    padding: 1rem;
  }
  
  .dashboard-nav {
    padding: 0 1rem;
    overflow-x: auto;
  }
  
  .dashboard-main {
    padding: 1rem;
  }
  
  .board-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .performance-grid,
  .sprint-analytics {
    grid-template-columns: 1fr;
  }
  
  .errors-grid {
    grid-template-columns: 1fr;
  }
  
  .error-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Epic Visualization Styles */
.epic-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--md-spacing-2);
  margin-bottom: var(--md-spacing-4);
}

.epic-stats .stat-card {
  background: var(--md-surface);
  border-radius: var(--md-radius-large);
  padding: var(--md-spacing-3);
  box-shadow: var(--md-elevation-1);
  display: flex;
  align-items: center;
  gap: var(--md-spacing-2);
  transition: all var(--md-transition-standard);
}

.epic-stats .stat-card:hover {
  box-shadow: var(--md-elevation-4);
  transform: translateY(-2px);
}

.epic-stats .stat-icon {
  width: 48px;
  height: 48px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.epic-stats .stat-content {
  flex: 1;
}

.epic-stats .stat-value {
  font-size: var(--md-headline-5);
  font-weight: 700;
  color: var(--md-text-primary);
  line-height: 1.2;
}

.epic-stats .stat-label {
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
  margin-top: 4px;
}

/* Epic Cards Grid */
.epics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--md-spacing-3);
  margin-bottom: var(--md-spacing-4);
}

.epic-card {
  background: var(--md-surface);
  border-radius: var(--md-radius-large);
  padding: var(--md-spacing-3);
  box-shadow: var(--md-elevation-2);
  transition: all var(--md-transition-standard);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.epic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--md-primary);
}

.epic-card[data-status="planned"]::before {
  background: var(--md-info);
}

.epic-card[data-status="active"]::before {
  background: var(--md-success);
}

.epic-card[data-status="completed"]::before {
  background: var(--md-text-disabled);
}

.epic-card[data-status="cancelled"]::before {
  background: var(--md-error);
}

.epic-card:hover {
  box-shadow: var(--md-elevation-6);
  transform: translateY(-2px);
}

.epic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--md-spacing-2);
}

.epic-title {
  font-size: var(--md-headline-6);
  font-weight: 500;
  color: var(--md-text-primary);
  margin: 0;
  flex: 1;
}

.epic-priority {
  padding: 4px 12px;
  border-radius: var(--md-radius-extra-large);
  font-size: var(--md-caption);
  font-weight: 500;
  text-transform: uppercase;
}

.epic-priority[data-priority="critical"] {
  background: rgba(183, 28, 28, 0.1);
  color: var(--priority-critical);
}

.epic-priority[data-priority="high"] {
  background: rgba(229, 57, 53, 0.1);
  color: var(--priority-high);
}

.epic-priority[data-priority="medium"] {
  background: rgba(251, 140, 0, 0.1);
  color: var(--priority-medium);
}

.epic-priority[data-priority="low"] {
  background: rgba(67, 160, 71, 0.1);
  color: var(--priority-low);
}

.epic-description {
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
  margin-bottom: var(--md-spacing-2);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.epic-goals {
  margin-bottom: var(--md-spacing-2);
}

.epic-goal {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-1);
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
  margin-bottom: 4px;
}

.epic-goal i {
  color: var(--md-primary);
  font-size: 12px;
}

.epic-progress {
  margin-bottom: var(--md-spacing-2);
}

.epic-progress-bar {
  height: 8px;
  background: var(--md-surface-variant);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.epic-progress-fill {
  height: 100%;
  background: var(--md-primary);
  transition: width var(--md-transition-standard);
  border-radius: 4px;
}

.epic-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: var(--md-caption);
  color: var(--md-text-secondary);
}

.epic-stats-row {
  display: flex;
  justify-content: space-between;
  padding-top: var(--md-spacing-2);
  border-top: 1px solid var(--md-divider);
}

.epic-stat {
  text-align: center;
  flex: 1;
}

.epic-stat-value {
  font-size: var(--md-headline-6);
  font-weight: 500;
  color: var(--md-text-primary);
}

.epic-stat-label {
  font-size: var(--md-caption);
  color: var(--md-text-secondary);
  margin-top: 2px;
}

/* Epic Analytics */
.epic-analytics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--md-spacing-3);
  margin-top: var(--md-spacing-4);
}

/* Epic Detail Modal Enhancements */
.modal-large {
  max-width: 900px;
  width: 90%;
}

.epic-detail-header {
  margin-bottom: var(--md-spacing-3);
}

.epic-detail-title {
  font-size: var(--md-headline-4);
  font-weight: 400;
  margin-bottom: var(--md-spacing-1);
}

.epic-detail-meta {
  display: flex;
  gap: var(--md-spacing-3);
  flex-wrap: wrap;
  margin-bottom: var(--md-spacing-3);
}

.epic-detail-meta-item {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-1);
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
}

.epic-detail-meta-item i {
  color: var(--md-primary);
}

.epic-detail-section {
  margin-bottom: var(--md-spacing-4);
}

.epic-detail-section h3 {
  font-size: var(--md-headline-6);
  font-weight: 500;
  margin-bottom: var(--md-spacing-2);
  color: var(--md-text-primary);
}

.epic-stories-list {
  display: grid;
  gap: var(--md-spacing-1);
}

.epic-story-item {
  background: var(--md-surface-variant);
  border-radius: var(--md-radius-medium);
  padding: var(--md-spacing-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--md-transition-fade);
  cursor: pointer;
}

.epic-story-item:hover {
  background: var(--md-hover-overlay);
  transform: translateX(4px);
}

.epic-story-info {
  flex: 1;
}

.epic-story-title {
  font-size: var(--md-body-1);
  font-weight: 500;
  color: var(--md-text-primary);
  margin-bottom: 4px;
}

.epic-story-meta {
  display: flex;
  gap: var(--md-spacing-2);
  font-size: var(--md-caption);
  color: var(--md-text-secondary);
}

.epic-story-status {
  padding: 2px 8px;
  border-radius: var(--md-radius-small);
  font-size: var(--md-caption);
  font-weight: 500;
  text-transform: uppercase;
}

.epic-story-status[data-status="done"] {
  background: rgba(67, 160, 71, 0.1);
  color: var(--md-success);
}

.epic-story-status[data-status="in_progress"] {
  background: rgba(30, 136, 229, 0.1);
  color: var(--md-info);
}

.epic-story-status[data-status="todo"] {
  background: rgba(117, 117, 117, 0.1);
  color: var(--md-text-secondary);
}

/* Loading state for epics */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--md-spacing-8);
  color: var(--md-text-secondary);
}

.loading-state i {
  font-size: 32px;
  margin-bottom: var(--md-spacing-2);
}

/* Primary button styles */
.primary-btn {
  background: var(--md-primary);
  color: var(--md-on-primary);
  border: none;
  padding: var(--md-spacing-1) var(--md-spacing-2);
  border-radius: var(--md-radius-small);
  font-size: var(--md-button);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--md-spacing-1);
  transition: all var(--md-transition-standard);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.primary-btn:hover {
  background: var(--md-primary-variant);
  box-shadow: var(--md-elevation-2);
}

.primary-btn:active {
  box-shadow: var(--md-elevation-1);
  transform: scale(0.98);
}

/* Epic detail modal specific styles */
.epic-goals-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.epic-goals-list li {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-1);
  margin-bottom: var(--md-spacing-1);
  color: var(--md-text-primary);
}

.epic-progress-stats {
  display: flex;
  gap: var(--md-spacing-4);
  margin-bottom: var(--md-spacing-3);
}

.progress-stat {
  text-align: center;
  flex: 1;
}

.progress-value {
  font-size: var(--md-headline-4);
  font-weight: 700;
  color: var(--md-primary);
}

.progress-label {
  font-size: var(--md-body-2);
  color: var(--md-text-secondary);
  margin-top: 4px;
}

.epic-metadata {
  background: var(--md-surface-variant);
  border-radius: var(--md-radius-medium);
  padding: var(--md-spacing-3);
}

.metadata-item {
  margin-bottom: var(--md-spacing-2);
}

.metadata-item:last-child {
  margin-bottom: 0;
}

.metadata-item strong {
  color: var(--md-text-primary);
  font-weight: 500;
}