/* Dashboard Modern Styling - Handover Report Theme */
body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: #2b2e33;
  color: #e4e4e4;
}

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
  height: calc(100vh - 40px);
  box-sizing: border-box;
  position: relative;
}

/* Animated background pattern */
.dashboard-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(89, 188, 194, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(96, 165, 250, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
  animation: backgroundPulse 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes backgroundPulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

.main-tiles, .secondary-tiles {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.tile {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 25px;
  flex: 1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-height: 220px;
  min-width: 300px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(89, 188, 194, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: tileEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes tileEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Staggered entrance animations */
.main-tiles .tile:nth-child(1) { animation-delay: 0.1s; }
.main-tiles .tile:nth-child(2) { animation-delay: 0.2s; }
.main-tiles .tile:nth-child(3) { animation-delay: 0.3s; }
.secondary-tiles .tile:nth-child(1) { animation-delay: 0.4s; }
.secondary-tiles .tile:nth-child(2) { animation-delay: 0.5s; }

.tile-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease-in-out;
  opacity: 1;
  padding: 20px;
  box-sizing: border-box;
}

/* Animated shine effect on tiles */
.tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  pointer-events: none;
}

.tile:hover::before {
  left: 100%;
}

.tile:hover, .tile.focused {
  transform: translateY(-12px) scale(1.08);
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(89, 188, 194, 0.4),
    0 0 30px rgba(96, 165, 250, 0.3),
    0 0 60px rgba(34, 197, 94, 0.1);
  border-color: rgba(89, 188, 194, 0.6);
  z-index: 10;
}

.tile:focus {
  outline: 2px solid rgba(96, 165, 250, 0.5);
  outline-offset: 2px;
}

.tile::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #60a5fa, #34d399, #f59e0b, #ef4444);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2;
}

.tile:hover::after {
  opacity: 0.8;
}

.wide {
  flex: 2;
  min-width: 450px;
}

.full-width {
  width: 100%;
}

/* Modern Typography - Handover Report Theme */
.tile h3 {
  margin: 0 0 15px 0;
  font-size: 1.5em;
  font-weight: 700;
  color: #f1f5f9;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 3;
}

.tile p {
  font-size: 2.5em;
  font-weight: 800;
  margin: 15px 0;
  background: linear-gradient(135deg, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
  position: relative;
  z-index: 3;
}

.tile small {
  font-size: 1em;
  opacity: 0.8;
  color: #cbd5e1;
  font-weight: 500;
  position: relative;
  z-index: 3;
}

/* Modern Stat Rows */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9em;
  padding: 6px 8px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 4px;
  border: 1px solid rgba(89, 188, 194, 0.1);
  transition: all 0.3s ease;
  position: relative;
  z-index: 3;
  margin-left: 50px; /* Increased left margin to clear navigation arrows */
  margin-right: 50px; /* Increased right margin to clear navigation arrows */
  max-width: calc(100% - 100px); /* Adjusted for new margins */
  height: 32px;
  width: calc(100% - 100px); /* Ensure full width utilization */
}

/* Scrollable content container for tiles with many items */
.tile-content.scrollable {
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(89, 188, 194, 0.3) rgba(30, 41, 59, 0.3);
}

.tile-content.scrollable::-webkit-scrollbar {
  width: 6px;
}

.tile-content.scrollable::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.3);
  border-radius: 3px;
}

.tile-content.scrollable::-webkit-scrollbar-thumb {
  background: rgba(89, 188, 194, 0.3);
  border-radius: 3px;
}

.tile-content.scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.5);
}

.stat-row:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(89, 188, 194, 0.3);
  transform: translateX(3px); /* Reduced from 5px */
}

.stat-row span:first-child {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.stat-row span:last-child {
  color: #60a5fa;
  font-weight: 700;
  font-size: 0.9em;
  margin-left: 6px;
  flex-shrink: 0;
  line-height: 1.2;
}

.tile-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

/* Modern Navigation Arrows */
.nav-arrow {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(51, 65, 85, 0.8) 100%);
  backdrop-filter: blur(10px);
  color: rgba(203, 213, 225, 0.7);
  padding: 15px 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  height: 100%;
  display: flex;
  align-items: center;
  border: 1px solid rgba(89, 188, 194, 0.2);
  font-size: 1.2em;
  font-weight: 600;
}

.nav-arrow:hover {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
  color: #ffffff;
  transform: scale(1.05);
  border-color: rgba(89, 188, 194, 0.5);
  box-shadow: 0 0 15px rgba(96, 165, 250, 0.3);
}

.nav-arrow.left {
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
}

.nav-arrow.right {
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
}

/* Modern Monthly Stats Tile */
.monthly-tile {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(89, 188, 194, 0.3);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 0;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  position: relative;
  height: auto;
  overflow: hidden;
  animation: tileSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tileSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.monthly-tile h3 {
  padding: 25px 30px 15px;
  margin: 0;
  background: linear-gradient(135deg, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.8em;
  font-weight: 800;
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
  position: relative;
}

.monthly-tile small {
  display: block;
  padding: 5px 30px 20px;
  margin: 0;
  opacity: 0.8;
  font-size: 1em;
  color: #cbd5e1;
  font-weight: 500;
  position: relative;
}

/* Header divider line */
.monthly-tile small::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 30px;
  right: 30px;
  height: 2px;
  background: linear-gradient(90deg, #60a5fa, #34d399, #f59e0b, #ef4444);
  opacity: 0.6;
}

.monthly-stats-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 25px 40px;
  position: relative;
  margin-top: 10px;
  gap: 20px;
}

/* Enhanced Monthly Stats Dividers */
.monthly-stats-container::before {
  content: '';
  position: absolute;
  top: 25px;
  bottom: 25px;
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(89, 188, 194, 0.6), transparent);
  opacity: 0.8;
}

.monthly-stats-container::after {
  content: '';
  position: absolute;
  left: 40px;
  right: 40px;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(89, 188, 194, 0.6), transparent);
  opacity: 0.8;
}

.monthly-stats-quarter {
  text-align: center;
  padding: 20px;
  position: relative;
  background: rgba(30, 41, 59, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(89, 188, 194, 0.1);
  transition: all 0.3s ease;
  animation: quarterEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: scale(0.9);
}

.monthly-stats-quarter:nth-child(1) { animation-delay: 0.6s; }
.monthly-stats-quarter:nth-child(2) { animation-delay: 0.7s; }
.monthly-stats-quarter:nth-child(3) { animation-delay: 0.8s; }
.monthly-stats-quarter:nth-child(4) { animation-delay: 0.9s; }

@keyframes quarterEntrance {
  0% {
    opacity: 0;
    transform: scale(0.9) rotate(-5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.monthly-stats-quarter:hover {
  background: rgba(51, 65, 85, 0.5);
  border-color: rgba(89, 188, 194, 0.3);
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(96, 165, 250, 0.2);
}

.monthly-stats-quarter h4 {
  margin: 0 0 15px 0;
  font-size: 1.6em;
  font-weight: 700;
  color: #60a5fa;
  text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.monthly-stats-comparison {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1em;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
}

.monthly-stats-comparison div {
  font-weight: 600;
  color: #cbd5e1;
}

.monthly-stats-comparison div:first-child {
  color: #94a3b8;
  font-size: 0.9em;
}

.monthly-stats-difference {
  font-size: 1.4em;
  font-weight: 800;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
  min-width: 60px;
  text-align: center;
}

.monthly-stats-difference.positive {
  color: #4caf50;
}

.monthly-stats-difference.negative {
  color: #ff6b6b;
}

.monthly-tile .tile-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  height: auto;
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.tile-loading {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 25%, rgba(51, 65, 85, 0.8) 50%, rgba(30, 41, 59, 0.8) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Enhanced Positive/Negative indicators */
.monthly-stats-difference.positive {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.monthly-stats-difference.negative {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Pulse animation for key metrics */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.05);
  }
  50% {
    box-shadow:
      0 8px 32px rgba(96, 165, 250, 0.2),
      0 0 0 1px rgba(89, 188, 194, 0.2),
      0 0 20px rgba(96, 165, 250, 0.1);
  }
}

.tile:nth-child(1) {
  animation: tileEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards,
             pulseGlow 3s ease-in-out 1.5s infinite;
}

/* Mobile Responsiveness */
@media (max-width: 1200px) {
  .main-tiles, .secondary-tiles {
    flex-direction: column;
    gap: 15px;
  }

  .tile, .wide {
    min-width: 100%;
    min-height: 180px;
  }

  .monthly-stats-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .monthly-stats-container::before {
    display: none;
  }

  .monthly-stats-container::after {
    left: 20px;
    right: 20px;
  }

  .dashboard-container {
    padding: 15px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .tile h3 {
    font-size: 1.2em;
  }

  .tile p {
    font-size: 2em;
  }

  .monthly-tile h3 {
    font-size: 1.4em;
    padding: 20px;
  }

  .monthly-stats-quarter {
    padding: 15px;
  }

  .monthly-stats-comparison {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

.table-container {
  overflow-y: auto;
  max-height: calc(100vh - 40px);
}

.tile-content:not(:first-child) {
  /* Let JavaScript handle visibility with display property */
  /* opacity: 0; */
  /* pointer-events: none; */
}

.tile-content.active {
  opacity: 1 !important;
  pointer-events: auto;
}


/* Mini Charts and Visualizations */
.mini-chart {
  display: flex;
  align-items: end;
  justify-content: space-around;
  height: 80px;
  margin: 15px 0;
}

.chart-bar {
  width: 20px;
  border-radius: 3px 3px 0 0;
  animation: barGrow 0.8s ease-out forwards;
  opacity: 0;
  transform: scaleY(0);
}

.chart-bar:nth-child(1) { animation-delay: 0.1s; }
.chart-bar:nth-child(2) { animation-delay: 0.3s; }
.chart-bar:nth-child(3) { animation-delay: 0.5s; }
.chart-bar:nth-child(4) { animation-delay: 0.7s; }

@keyframes barGrow {
  0% {
    opacity: 0;
    transform: scaleY(0);
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

.activity-pie-chart {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 20px auto;
  border-radius: 50%;
  animation: pieRotate 1s ease-out;
}

@keyframes pieRotate {
  0% { transform: rotate(-180deg); }
  100% { transform: rotate(0deg); }
}

.pie-segment {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: segmentFade 0.6s ease-out forwards;
}

.pie-segment:nth-child(1) { animation-delay: 0.1s; }
.pie-segment:nth-child(2) { animation-delay: 0.3s; }
.pie-segment:nth-child(3) { animation-delay: 0.5s; }
.pie-segment:nth-child(4) { animation-delay: 0.7s; }

@keyframes segmentFade {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Equipment Bars */
.equipment-bars {
  margin: 15px 0;
}

.equipment-bar {
  margin-bottom: 12px;
}

.bar-label {
  font-size: 0.85em;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.bar-container {
  height: 8px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  animation: fillBar 1.2s ease-out;
}

.equipment-bar:nth-child(1) .bar-fill { animation-delay: 0.2s; }
.equipment-bar:nth-child(2) .bar-fill { animation-delay: 0.4s; }
.equipment-bar:nth-child(3) .bar-fill { animation-delay: 0.6s; }

@keyframes fillBar {
  0% { width: 0%; }
  100% { width: var(--final-width); }
}

.bar-value {
  font-size: 0.8em;
  color: #60a5fa;
  text-align: right;
}

/* Maturity Progress */
.maturity-progress {
  margin: 15px 0;
}

.progress-item {
  margin-bottom: 15px;
}

.progress-label {
  font-size: 0.85em;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.progress-bar {
  height: 10px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-fill {
  height: 100%;
  border-radius: 5px;
  animation: fillProgress 1.5s ease-out;
}

.progress-item:nth-child(1) .progress-fill { animation-delay: 0.2s; }
.progress-item:nth-child(2) .progress-fill { animation-delay: 0.4s; }
.progress-item:nth-child(3) .progress-fill { animation-delay: 0.6s; }
.progress-item:nth-child(4) .progress-fill { animation-delay: 0.8s; }

@keyframes fillProgress {
  0% { width: 0%; }
  100% { width: var(--final-width); }
}

.progress-percent {
  font-size: 0.8em;
  color: #34d399;
  text-align: right;
}

/* Analytics Grid */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.analytic-item {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(89, 188, 194, 0.2);
  transition: all 0.3s ease;
}

.analytic-item:hover {
  background: rgba(51, 65, 85, 0.8);
  transform: translateY(-2px);
  border-color: rgba(89, 188, 194, 0.4);
}

.analytic-value {
  font-size: 1.5em;
  font-weight: 800;
  color: #60a5fa;
  margin-bottom: 5px;
}

.analytic-label {
  font-size: 0.9em;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 3px;
}

.analytic-desc {
  font-size: 0.75em;
  color: #94a3b8;
  opacity: 0.8;
}

/* Distribution Visualization */
.distribution-viz {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
}

.viz-circle {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.3);
  animation: circleRotate 2s ease-in-out infinite;
}

@keyframes circleRotate {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg); }
}

.circle-segment {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: segmentPulse 1.5s ease-in-out infinite;
}

.circle-segment.large { clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 50%); }
.circle-segment.medium { clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%); }
.circle-segment.small { clip-path: polygon(50% 50%, 50% 100%, 0% 100%, 0% 50%); }
.circle-segment.tiny { clip-path: polygon(50% 50%, 0% 50%, 0% 0%, 50% 0%); }

@keyframes segmentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.viz-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  color: #cbd5e1;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Insights Grid */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.insight-card {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  border: 1px solid rgba(89, 188, 194, 0.2);
  transition: all 0.3s ease;
  animation: insightFadeIn 0.6s ease-out forwards;
  opacity: 0;
}

.insight-card:nth-child(1) { animation-delay: 0.1s; }
.insight-card:nth-child(2) { animation-delay: 0.2s; }
.insight-card:nth-child(3) { animation-delay: 0.3s; }
.insight-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes insightFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.insight-card:hover {
  background: rgba(51, 65, 85, 0.8);
  transform: translateY(-3px);
  border-color: rgba(89, 188, 194, 0.4);
  box-shadow: 0 8px 25px rgba(96, 165, 250, 0.2);
}

.insight-icon {
  font-size: 1.5em;
  margin-bottom: 8px;
}

.insight-metric {
  font-size: 1.4em;
  font-weight: 800;
  color: #60a5fa;
  margin-bottom: 5px;
}

.insight-label {
  font-size: 0.85em;
  font-weight: 600;
  color: #cbd5e1;
}

/* Activity Flow */
.activity-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 10px;
}

.flow-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 2px solid;
  transition: all 0.3s ease;
  min-width: 80px;
}

.flow-stage.completed {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.flow-stage.in-progress {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.flow-stage.pending {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.stage-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9em;
  color: white;
}

.flow-stage.completed .stage-circle { background: #22c55e; }
.flow-stage.in-progress .stage-circle { background: #f59e0b; }
.flow-stage.pending .stage-circle { background: #ef4444; }

.stage-label {
  font-size: 0.8em;
  font-weight: 600;
  color: #cbd5e1;
  text-align: center;
}

.stage-count {
  font-size: 0.9em;
  font-weight: 700;
  color: #60a5fa;
}

.flow-arrow {
  font-size: 1.2em;
  color: rgba(89, 188, 194, 0.6);
  font-weight: 700;
}

/* Health Dashboard */
.health-dashboard {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  align-items: center;
}

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

.metric-circle {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
}

.circle-fill {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
}

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

.center-value {
  font-size: 1em;
  font-weight: 800;
  color: #22c55e;
  line-height: 1;
}

.center-label {
  font-size: 0.6em;
  color: #cbd5e1;
  font-weight: 600;
  margin-top: 2px;
}

.metric-label {
  font-size: 0.85em;
  font-weight: 600;
  color: #cbd5e1;
}

.health-indicators {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.indicator-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8em;
  color: #cbd5e1;
}

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

/* Timeline Visualization */
.timeline-viz {
  position: relative;
  margin-top: 20px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  opacity: 0;
  animation: timelineSlideIn 0.8s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.3s; }
.timeline-item:nth-child(3) { animation-delay: 0.5s; }
.timeline-item:nth-child(4) { animation-delay: 0.7s; }

@keyframes timelineSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.timeline-connector {
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: -16px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(89, 188, 194, 0.6), rgba(89, 188, 194, 0.3));
  z-index: -1;
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-size: 0.9em;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 3px;
}

.timeline-desc {
  font-size: 0.8em;
  color: #94a3b8;
}

/* Modal Styles */
.dashboard-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dashboard-modal-overlay.active {
  opacity: 1;
}

.dashboard-modal {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(89, 188, 194, 0.3);
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.dashboard-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid rgba(89, 188, 194, 0.2);
}

.dashboard-modal-header h2 {
  margin: 0;
  color: #f1f5f9;
  font-size: 1.5em;
  font-weight: 700;
}

.dashboard-modal-close {
  font-size: 28px;
  color: #cbd5e1;
  cursor: pointer;
  transition: color 0.3s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.dashboard-modal-close:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.dashboard-modal-content {
  padding: 30px;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(89, 188, 194, 0.3) rgba(30, 41, 59, 0.3);
}

.dashboard-modal-content::-webkit-scrollbar {
  width: 6px;
}

.dashboard-modal-content::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.3);
  border-radius: 3px;
}

.dashboard-modal-content::-webkit-scrollbar-thumb {
  background: rgba(89, 188, 194, 0.3);
  border-radius: 3px;
}

.dashboard-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.5);
}

/* Modal Content Styles */
.modal-expanded-content {
  color: #e4e4e4;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.modal-stat-card {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(89, 188, 194, 0.2);
}

.modal-stat-card h3 {
  margin: 0 0 15px 0;
  color: #f1f5f9;
  font-size: 1.2em;
}

.modal-chart-placeholder {
  text-align: center;
  padding: 30px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  margin: 15px 0;
}

.chart-icon {
  font-size: 3em;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.modal-btn.primary {
  background: linear-gradient(135deg, #60a5fa, #34d399);
  color: white;
}

.modal-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(96, 165, 250, 0.3);
}

.modal-btn.secondary {
  background: rgba(51, 65, 85, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(89, 188, 194, 0.3);
}

.modal-btn.secondary:hover {
  background: rgba(71, 85, 105, 0.9);
  border-color: rgba(96, 165, 250, 0.5);
}

.trend-indicator {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
}

.trend-indicator.positive {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.trend-indicator.negative {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

