/* ==========================================================
   FCP 14.7.27 - Task card overlap fix + app layout safety
   Scope: frontend app only. No DB/API endpoint changes.
   ========================================================== */

.fcp-app-shell,
.fcp-app-shell *{
  box-sizing:border-box!important;
}

/* Task cards: one single final layout used on Dashboard + Task + client detail.
   This intentionally overrides older mobile/desktop layers that positioned pieces absolutely. */
.fcp-app-shell .fcp-task-card-saas,
.fcp-app-shell .fcp-mobile-task-card.fcp-task-card-saas,
.fcp-app-shell .fcp-dashboard-shell .fcp-task-card-saas,
.fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas,
.fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas{
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  float:none!important;
  clear:both!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:
    "top top"
    "main actions"!important;
  gap:10px 16px!important;
  align-items:start!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  margin:0 0 12px!important;
  padding:16px 18px!important;
  overflow:hidden!important;
  contain:none!important;
  border:1px solid #E2E8F0!important;
  border-radius:20px!important;
  background:#FFFFFF!important;
  box-shadow:0 10px 26px rgba(15,23,42,.045)!important;
}

.fcp-app-shell .fcp-task-card-saas *{
  max-width:100%!important;
}

.fcp-app-shell .fcp-task-card-saas .fcp-task-card-top,
.fcp-app-shell .fcp-dashboard-shell .fcp-task-card-saas .fcp-task-card-top,
.fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-top,
.fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-top{
  grid-area:top!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  display:grid!important;
  grid-template-columns:28px minmax(0,1fr) auto 42px!important;
  gap:10px!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  overflow:visible!important;
}

.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-check,
.fcp-app-shell .fcp-task-card-saas .fcp-waste-complete-button-14714{
  grid-column:1!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  align-self:center!important;
  justify-self:start!important;
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  min-height:28px!important;
  max-width:28px!important;
  max-height:28px!important;
  margin:0!important;
  padding:0!important;
  border:2px solid #CBD5E1!important;
  border-radius:10px!important;
  background:#fff!important;
  box-shadow:none!important;
  appearance:none!important;
  -webkit-appearance:none!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
}
.fcp-app-shell .fcp-task-card-saas.is-done .fcp-mobile-task-check,
.fcp-app-shell .fcp-task-card-saas[data-task-status="done"] .fcp-mobile-task-check{
  border-color:#16A34A!important;
  background:#16A34A!important;
}
.fcp-app-shell .fcp-task-card-saas.is-done .fcp-mobile-task-check::after,
.fcp-app-shell .fcp-task-card-saas[data-task-status="done"] .fcp-mobile-task-check::after{
  content:"✓"!important;
  color:#fff!important;
  font-size:15px!important;
  line-height:1!important;
  font-weight:900!important;
}

.fcp-app-shell .fcp-task-card-saas .fcp-task-card-time{
  grid-column:2!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:5px 7px!important;
  min-width:0!important;
  width:100%!important;
  min-height:0!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  white-space:normal!important;
  color:#64748B!important;
  text-align:left!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-time span,
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-time strong,
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-time small{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  display:inline!important;
  width:auto!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  color:#64748B!important;
  font-size:12px!important;
  line-height:1.2!important;
  font-weight:750!important;
  white-space:nowrap!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-time strong{
  color:#0F172A!important;
  font-weight:900!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-time small::before{
  content:"· "!important;
}

.fcp-app-shell .fcp-task-card-saas .fcp-task-priority-badge{
  grid-column:3!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  justify-self:end!important;
  align-self:center!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:28px!important;
  min-height:28px!important;
  max-height:28px!important;
  min-width:0!important;
  width:auto!important;
  margin:0!important;
  padding:0 10px!important;
  border:0!important;
  border-radius:999px!important;
  background:#F1F5F9!important;
  color:#334155!important;
  box-shadow:none!important;
  font-size:10px!important;
  line-height:1!important;
  font-style:normal!important;
  font-weight:900!important;
  letter-spacing:.03em!important;
  text-transform:uppercase!important;
  white-space:nowrap!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-priority-badge.prio-high,
.fcp-app-shell .fcp-task-card-saas .fcp-task-priority-badge.prio-urgent{background:#FEF2F2!important;color:#DC2626!important;}
.fcp-app-shell .fcp-task-card-saas .fcp-task-priority-badge.prio-medium{background:#FFFBEB!important;color:#B45309!important;}
.fcp-app-shell .fcp-task-card-saas .fcp-task-priority-badge.prio-low{background:#ECFDF5!important;color:#047857!important;}

.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-more{
  grid-column:4!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  justify-self:end!important;
  align-self:center!important;
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  max-width:42px!important;
  max-height:42px!important;
  margin:0!important;
  padding:0!important;
  border:1px solid #E2E8F0!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#334155!important;
  box-shadow:0 6px 16px rgba(15,23,42,.045)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:16px!important;
  line-height:1!important;
  font-weight:900!important;
  letter-spacing:.03em!important;
  cursor:pointer!important;
  z-index:2!important;
}

.fcp-app-shell .fcp-task-card-saas .fcp-task-card-main,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-body{
  grid-area:main!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  display:grid!important;
  gap:4px!important;
  align-self:start!important;
  justify-self:stretch!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  margin:0!important;
  padding:0 0 0 38px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:hidden!important;
  text-align:left!important;
  cursor:pointer!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-main strong,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-body strong{
  position:static!important;
  display:block!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  color:#0F172A!important;
  font-size:17px!important;
  line-height:1.22!important;
  font-weight:900!important;
  letter-spacing:-.015em!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-main span,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-body span{
  position:static!important;
  display:block!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  color:#475569!important;
  font-size:13px!important;
  line-height:1.35!important;
  font-weight:750!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-note-preview,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-origin-14719,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-body small{
  position:static!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  width:100%!important;
  min-width:0!important;
  margin:1px 0 0!important;
  padding:0!important;
  color:#64748B!important;
  font-size:12px!important;
  line-height:1.35!important;
  font-weight:650!important;
  white-space:normal!important;
  overflow:hidden!important;
}

.fcp-app-shell .fcp-task-card-saas .fcp-task-card-footer,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-actions-14720{
  grid-area:actions!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  align-self:start!important;
  justify-self:end!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  width:auto!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-footer a,
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-footer button,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-actions-14720 a,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-actions-14720 button{
  position:static!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  min-width:0!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  margin:0!important;
  padding:0 14px!important;
  border-radius:12px!important;
  border:1px solid #CBD5E1!important;
  background:#fff!important;
  color:#0F172A!important;
  text-decoration:none!important;
  font-size:13px!important;
  line-height:1!important;
  font-weight:900!important;
  white-space:nowrap!important;
  box-shadow:none!important;
  cursor:pointer!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-footer .fcp-task-action-primary,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-actions-14720 a{
  border-color:#BFDBFE!important;
  background:#EFF6FF!important;
  color:#2563EB!important;
}
.fcp-app-shell .fcp-task-card-saas .fcp-task-card-footer .fcp-task-action-secondary,
.fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-actions-14720 button{
  border-color:#E2E8F0!important;
  background:#fff!important;
  color:#0F172A!important;
}

.fcp-app-shell .fcp-dashboard-shell .fcp-task-list-section-saas,
.fcp-app-shell .fcp-task-list-section-saas{
  width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}
.fcp-app-shell .fcp-dashboard-shell .fcp-task-list-saas,
.fcp-app-shell .fcp-task-list-saas,
.fcp-app-shell .fcp-mobile-task-bucket-list{
  display:grid!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
}

@media (max-width:699px){
  .fcp-app-shell .fcp-task-card-saas,
  .fcp-app-shell .fcp-mobile-task-card.fcp-task-card-saas{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:
      "top"
      "main"
      "actions"!important;
    gap:10px!important;
    padding:14px!important;
    border-radius:18px!important;
  }
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-top{
    grid-template-columns:28px minmax(0,1fr) auto 42px!important;
    gap:9px!important;
  }
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-time{
    display:grid!important;
    grid-template-columns:auto auto!important;
    justify-content:start!important;
    gap:3px 7px!important;
  }
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-time small{
    grid-column:1 / -1!important;
  }
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-time small::before{content:""!important;}
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-main,
  .fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-body{
    padding-left:0!important;
  }
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-main strong,
  .fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-body strong{
    white-space:normal!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
  }
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-footer,
  .fcp-app-shell .fcp-task-card-saas .fcp-mobile-task-actions-14720{
    justify-self:stretch!important;
    justify-content:flex-start!important;
    width:100%!important;
  }
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-footer a,
  .fcp-app-shell .fcp-task-card-saas .fcp-task-card-footer button{
    min-height:40px!important;
    height:40px!important;
  }
}

@media (min-width:1180px){
  .fcp-app-shell .fcp-dashboard-shell .fcp-task-card-saas,
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas{
    padding:17px 20px!important;
  }
}
