/* Dashboard Page Styles */

.dashboard-page {
  max-width: 1400px;
}

/* Dashboard status in controls */
.dashboard-status {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1rem;
}

.dashboard-status.busy {
  color: var(--accent-strong);
  font-weight: 600;
}

.dashboard-status.error {
  color: var(--high);
  font-weight: 600;
}

.dashboard-status.success {
  color: var(--low);
  font-weight: 600;
}

/* Dashboard content area */
.dashboard-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 64px;
  animation: float-in 0.8s ease 0.1s both;
}

/* Loading state */
.dashboard-status-loading {
  background: var(--surface-strong);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.dashboard-status-loading[hidden] {
  display: none;
}

/* Dashboard summary section */
.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.dashboard-summary-card {
  background: var(--surface-strong);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  animation: card-in 0.5s ease both;
}

.dashboard-summary-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-summary-card:nth-child(2) { animation-delay: 0.15s; }
.dashboard-summary-card:nth-child(3) { animation-delay: 0.2s; }
.dashboard-summary-card:nth-child(4) { animation-delay: 0.25s; }

.dashboard-summary-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

.dashboard-summary-value {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.dashboard-summary-value.accent {
  color: var(--accent-strong);
}

.dashboard-summary-value.low {
  color: var(--low);
}

.dashboard-summary-value.medium {
  color: var(--medium);
}

.dashboard-summary-value.high {
  color: var(--high);
}

/* Dashboard sections */
.dashboard-section {
  background: var(--surface-strong);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-section-title {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}

/* Time range selector */
.dashboard-time-range-select {
  padding: 6px 12px;
  padding-right: 28px;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.dashboard-time-range-select:hover {
  background-color: var(--surface);
  border-color: var(--muted);
}

.dashboard-time-range-select:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* Dashboard charts container */
.dashboard-chart {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.dashboard-chart canvas {
  max-width: 100%;
  height: 300px !important;
}

/* Dashboard progress bars */
.dashboard-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dashboard-progress-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.dashboard-progress-count {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.dashboard-progress-bar {
  height: 8px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
}

.dashboard-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Stage type color indicator (reused from layout.css pattern) */
.dashboard-stage-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Board group for "All Boards" view */
.dashboard-board-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.dashboard-board-group:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.dashboard-board-group-title {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

/* Stages list */
.dashboard-stages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Stage item with progress bar wrapper */
.dashboard-stage-item-with-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.dashboard-stage-item-with-progress:hover {
  background: var(--surface);
}

/* Individual stage item (inside wrapper) */
.dashboard-stage-item-with-progress .dashboard-stage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

/* Standalone stage item (without progress bar) */
.dashboard-stages-list > .dashboard-stage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.dashboard-stages-list > .dashboard-stage-item:hover {
  background: var(--surface);
}

/* Stage progress bar row */
.dashboard-stage-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 22px; /* Align with stage name (indicator width + gap) */
}

.dashboard-stage-progress .dashboard-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}

.dashboard-stage-progress .dashboard-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.dashboard-progress-percent {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
}

.dashboard-stage-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-stage-count {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-strong);
  min-width: 24px;
  text-align: right;
}

/* Empty inline state */
.dashboard-empty-inline {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* Empty state */
.dashboard-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* Toggle switch */
.dashboard-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.dashboard-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dashboard-toggle-slider {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  background: var(--surface-alt);
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.dashboard-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--ink);
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease;
}

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

.dashboard-toggle input:checked + .dashboard-toggle-slider::after {
  transform: translateX(18px);
  background: white;
}

.dashboard-toggle input:focus + .dashboard-toggle-slider {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.dashboard-toggle-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  min-width: 36px;
}

/* Card type breakdown section */
.dashboard-type-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  animation: float-in 0.3s ease both;
}

.dashboard-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-alt);
  border-radius: 12px;
  flex: 1;
  min-width: 140px;
  transition: background 0.2s ease;
}

.dashboard-type-item:hover {
  background: var(--surface);
}

.dashboard-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 1rem;
  flex-shrink: 0;
}

.dashboard-type-icon.epic {
  background: rgba(139, 92, 246, 0.15);
  color: #8B5CF6;
}

.dashboard-type-icon.user-story {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
}

.dashboard-type-icon.task {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.dashboard-type-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

.dashboard-type-count {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

/* Boards Overview section */
.dashboard-boards-overview {
  animation: float-in 0.5s ease both;
}

.dashboard-board-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.dashboard-board-card {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  animation: card-in 0.4s ease both;
  border: 1px solid transparent;
}

.dashboard-board-card:hover {
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-strong);
}

.dashboard-board-card:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.dashboard-board-card:active {
  transform: translateY(0);
}

.dashboard-board-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dashboard-board-card-name {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-board-card-count {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1;
}

.dashboard-board-card-bar {
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}

.dashboard-board-card-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Responsive adjustments */
@media (max-width: 720px) {
  .dashboard-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-summary-value {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .dashboard-summary {
    grid-template-columns: 1fr;
  }
}
