/* Targeted phase/card polish loaded after the main stylesheet. */

#dashboardView .dev-dashboard-grid {
  grid-template-columns: 1fr !important;
  gap: 16px;
}

#dashboardView .pipeline-row,
#dashboardView .mini-kpi-row,
#dashboardView .dashboard-panel {
  grid-column: 1 / -1 !important;
}

#dashboardView .pipeline-row {
  gap: 12px;
}

#dashboardView .mini-kpi-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#dashboardView .pipeline-card,
#dashboardView .mini-kpi-card {
  min-height: 82px;
  padding: 14px 18px;
}

#dashboardView .pipeline-card strong,
#dashboardView .mini-kpi-card strong {
  font-size: 30px;
}

#dashboardView .dashboard-card-icon {
  right: 16px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  font-size: 21px;
}

#dashboardView .team-overview-scroll {
  overflow-x: auto;
}

.team-workload-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  min-width: min(760px, 100%);
}

.team-workload-column {
  min-width: 0;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfcff;
}

.team-workload-dev {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 9px;
  border-bottom: 1px solid #edf1f7;
}

.team-workload-dev .avatar.mini {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.team-workload-dev strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-workload-count {
  display: inline-grid;
  width: 30px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #e8efff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.team-workload-projects {
  display: grid;
  gap: 1px;
  padding: 6px;
}

.team-workload-project,
.team-workload-empty {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.team-workload-project:hover {
  background: #eef4ff;
}

.team-workload-project span {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-workload-project small,
.team-workload-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.avatar {
  overflow: hidden;
  background: #e8eef6 !important;
  color: #4b647a !important;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.has-image {
  background: #e8eef6 !important;
}

.dev-admin-main .avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 14px;
}

.owner-chip .avatar.mini,
.avatar.mini {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 10px;
}

#dashboardView .workload-phase-progress {
  gap: 3px;
  margin-top: 4px;
}

#dashboardView .workload-phase-progress i {
  height: 4px;
}

#dashboardView .workload-phase-progress i.workload-current {
  background: #dce6f2;
  animation: workloadBluePulse 3s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(69, 115, 210, 0.18), 0 0 14px rgba(69, 115, 210, 0.44);
}

#dashboardView .workload-phase-progress i.workload-current-other {
  background: var(--primary);
  opacity: 0.5;
}

#dashboardView .workload-phase-progress i.workload-upcoming {
  background: #f4d3d0;
  animation: workloadRedPulse 3s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(186, 26, 26, 0.16), 0 0 14px rgba(186, 26, 26, 0.38);
}

@keyframes workloadBluePulse {
  0%, 100% {
    background: #dce6f2;
    box-shadow: 0 0 0 1px rgba(69, 115, 210, 0.08), 0 0 4px rgba(69, 115, 210, 0.12);
  }
  50% {
    background: var(--primary);
    box-shadow: 0 0 0 2px rgba(69, 115, 210, 0.24), 0 0 18px rgba(69, 115, 210, 0.58);
  }
}

@keyframes workloadRedPulse {
  0%, 100% {
    background: #f4d3d0;
    box-shadow: 0 0 0 1px rgba(186, 26, 26, 0.08), 0 0 4px rgba(186, 26, 26, 0.12);
  }
  50% {
    background: #f06a5f;
    box-shadow: 0 0 0 2px rgba(186, 26, 26, 0.2), 0 0 18px rgba(186, 26, 26, 0.5);
  }
}

#projectsView .stitch-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 920px;
}

#projectsView .stitch-kpi-card {
  min-height: 104px;
  padding: 16px 18px;
}

#projectsView .stitch-kpi-card strong {
  font-size: 30px;
}

#projectsView .stitch-kpi-card > .material-symbols-outlined {
  width: 36px;
  height: 36px;
  font-size: 21px;
}

#projectsView .kpi-foot {
  margin-top: 8px;
  font-size: 11px;
}

.project-progress-rank {
  place-content: center;
  place-items: center;
  width: 74px;
  height: 74px;
  padding: 0;
}

.project-progress-rank span {
  display: none;
}

.project-progress-rank strong {
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

.project-table-meta {
  gap: 22px;
}

.project-table-meta > span {
  max-width: none;
}

.stitch-segment-progress i {
  position: relative;
  cursor: default;
}

.stitch-segment-progress i.active {
  background: #dce6f2;
  animation: phaseSegmentBluePulse 3.2s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(69, 115, 210, 0.22), 0 0 24px rgba(69, 115, 210, 0.52);
}

@keyframes phaseSegmentBluePulse {
  0%, 100% {
    background: #dce6f2;
    box-shadow: 0 0 0 1px rgba(69, 115, 210, 0.08), 0 0 6px rgba(69, 115, 210, 0.14);
  }
  50% {
    background: #4573d2;
    box-shadow: 0 0 0 3px rgba(69, 115, 210, 0.24), 0 0 34px rgba(69, 115, 210, 0.68);
  }
}

.stitch-segment-progress i[data-phase-tooltip]::after {
  content: attr(data-phase-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 50;
  width: max-content;
  max-width: min(300px, 72vw);
  padding: 9px 11px;
  border: 1px solid #c3c6d4;
  border-radius: 8px;
  background: #051d2e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: normal;
}

.stitch-segment-progress i[data-phase-tooltip]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.upcoming-phase-progress i.current {
  background: var(--primary);
  box-shadow: none;
}

.upcoming-phase-progress i.upcoming,
.stitch-segment-progress i.next-blink {
  background: #f7e3b0;
  animation: upcomingPhaseAmberPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(214, 158, 20, 0.18), 0 0 24px rgba(214, 158, 20, 0.45);
}

@keyframes upcomingPhaseAmberPulse {
  0%, 100% {
    background: #f7e3b0;
    box-shadow: 0 0 0 1px rgba(214, 158, 20, 0.1), 0 0 6px rgba(214, 158, 20, 0.16);
  }
  50% {
    background: #f2b53a;
    box-shadow: 0 0 0 3px rgba(214, 158, 20, 0.24), 0 0 34px rgba(214, 158, 20, 0.6);
  }
}

.your-eta-meta,
.your-eta-meta .material-symbols-outlined {
  color: var(--primary);
  font-weight: 900;
}

/* Next phase assigned to the current dev — amber/yellow accent */
.next-phase-meta,
.next-phase-meta .material-symbols-outlined {
  color: #b9831a;
  font-weight: 900;
}

.completed-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.completed-project-card .health-badge.done {
  background: #e6f4ec;
  color: #2f9e6f;
}

.view-hint {
  margin: 4px 0 14px;
  color: var(--muted, #6b7a90);
  font-size: 13px;
}

.current-phase-meta-blue,
.current-phase-meta-blue .material-symbols-outlined {
  color: var(--primary);
  font-weight: 900;
}

.phase-visual-card {
  gap: 20px;
}

.phase-visual-actions {
  justify-content: flex-end;
  order: -1;
  padding-top: 0;
  padding-bottom: 14px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.phase-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.phase-card-actions .ghost-button,
.phase-card-actions .primary-action {
  min-height: 36px;
}

.phase-visual-item.active .phase-visual-marker > div,
.phase-visual-item.active .phase-visual-content {
  animation: activePhaseGlow 3.2s ease-in-out infinite;
}

@keyframes activePhaseGlow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(31, 157, 107, 0.1);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(31, 157, 107, 0.18), 0 0 22px rgba(31, 157, 107, 0.18);
  }
}

dialog.dialog-center:has(.stitch-phase-manager) .stitch-phase-layout {
  display: block;
}

dialog.dialog-center:has(.stitch-phase-manager) .stitch-guidelines {
  display: none;
}

dialog.dialog-center:has(.stitch-phase-manager) .stitch-phase-sequence {
  overflow-x: visible;
}

dialog.dialog-center:has(.stitch-phase-manager) .stitch-phase-table {
  min-width: 0;
}

dialog.dialog-center:has(.stitch-phase-manager) .stitch-phase-table-head,
dialog.dialog-center:has(.stitch-phase-manager) .stitch-phase-row {
  grid-template-columns: 88px minmax(180px, 1fr) minmax(150px, 0.75fr) minmax(300px, 1fr) minmax(140px, 0.65fr) 44px;
}

.phase-setup-footer {
  justify-content: space-between;
  gap: 12px;
}

.phase-setup-footer .primary-action,
.phase-setup-footer .ghost-button {
  min-height: 40px;
}

.phase-autosave-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--muted, #6b7a90);
  font-size: 13px;
  font-weight: 600;
}

.phase-autosave-hint .material-symbols-outlined {
  font-size: 18px;
  color: #2f9e6f;
}

dialog.dialog-center:has(.stitch-phase-manager) .phase-setup-select {
  width: 100%;
}

dialog.dialog-center:has(.stitch-phase-manager) .phase-setup-select .custom-select-trigger {
  min-height: 44px;
  border-color: #c9d5e8;
  border-radius: 7px;
  box-shadow: 0 1px 0 rgba(5, 29, 46, 0.02);
}

.phase-setup-select .custom-select-option {
  justify-content: flex-start;
}

.tone-pending {
  background: #f3f6fa;
  color: #5f7589;
}

.calendar-card.team {
  border-color: #b0c6ff;
  background: #e8f0ff;
  color: var(--primary);
}

.calendar-card.high-level {
  border-color: #ffc0bc;
  background: #ffefed;
  color: #ba1a1a;
}

.brief-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brief-top-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.brief-pills-row .brief-pills {
  min-width: 0;
}

.brief-top-actions .ghost-button,
.brief-top-actions .primary-action {
  min-height: 38px;
}

.brief-top-actions .material-symbols-outlined {
  font-size: 18px;
}

.request-list,
.queue-list,
.ranked-list,
.project-table-card-list,
.project-board,
.project-board-group,
.project-board-group-body,
.request-card.stitch-triage-card,
.dev-request-card.stitch-triage-card,
.project-table-card {
  overflow: visible;
}

.request-card.stitch-triage-card:has(.custom-select.open),
.dev-request-card.stitch-triage-card:has(.custom-select.open),
.project-table-card:has(.custom-select.open),
.project-card:has(.custom-select.open),
.kanban-column:has(.custom-select.open),
.panel:has(.custom-select.open),
.brief:has(.custom-select.open) {
  position: relative;
  overflow: visible;
  z-index: 500;
}

.custom-select.open {
  z-index: 600;
}

dialog:has(.custom-select.open) .dialog-content {
  overflow: visible;
}

.custom-select-menu {
  position: absolute !important;
  left: 0 !important;
  top: calc(100% + 6px) !important;
  width: 100% !important;
  min-width: 100% !important;
  max-height: min(260px, 42vh) !important;
  z-index: 9999 !important;
}

.custom-select.open-up .custom-select-menu {
  top: auto !important;
  bottom: calc(100% + 6px) !important;
}

.brief,
.brief-header,
.request-field-controls,
.brief-field-controls,
.project-table-controls,
.stitch-card-controls {
  overflow: visible;
}

[data-custom-date] {
  padding-right: 40px !important;
  background-color: #f4f7fd !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23265ab7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E") !important;
  background-position: right 12px center !important;
  background-repeat: no-repeat !important;
  background-size: 18px 18px !important;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

[data-custom-date]::placeholder {
  color: #8ea0b8;
}

.custom-calendar-popover {
  position: fixed;
  z-index: 10000;
  width: 288px;
  padding: 12px;
  border: 1px solid #c9d5e8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(5, 29, 46, 0.18);
}

.custom-calendar-popover.hidden {
  display: none;
}

.custom-calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.custom-calendar-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.custom-calendar-head button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #f6f8fc;
  color: var(--primary);
}

.custom-calendar-weekdays,
.custom-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.custom-calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.custom-calendar-day {
  display: grid;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.custom-calendar-day:hover {
  background: #eef4ff;
  color: var(--primary);
}

.custom-calendar-day.muted {
  color: #a8b3c2;
}

.custom-calendar-day.selected {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(69, 115, 210, 0.26);
}

@media (max-width: 1080px) {
  #projectsView .stitch-kpi-grid {
    max-width: none;
  }

  .project-table-controls.request-field-controls.stitch-card-controls {
    grid-template-columns: 1fr;
  }

  .project-table-controls .request-field-actions {
    flex-wrap: wrap;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  #projectsView .stitch-kpi-grid {
    grid-template-columns: 1fr;
  }

  dialog.dialog-center:has(.stitch-phase-manager) .stitch-phase-row {
    grid-template-columns: 1fr;
  }

  .phase-visual-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
