/* ==========================================================
   FCP 14.7.26 - Client modules + desktop task readability
   Scope: frontend app. No DB/API/endpoint changes.
   ========================================================== */

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

/* Hard safety: the old backend/admin form must never appear under the SaaS app
   unless opened explicitly with ?fcp_legacy=1 by an admin. */
.fcp-app-shell .fcp-app-legacy-content[hidden],
body.fcp-app-root-page .fcp-app-shell .fcp-app-legacy-content[hidden],
body:has(.fcp-app-shell) .fcp-app-legacy-content[hidden]{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  max-height:0!important;
  min-height:0!important;
  overflow:hidden!important;
  pointer-events:none!important;
}

/* Client modules panel */
body.fcp-app-root-page .fcp-record-detail-saas-14724 .fcp-client-modules-panel-14726,
.fcp-app-shell .fcp-record-detail-saas-14724 .fcp-client-modules-panel-14726{
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:18px!important;
  border-radius:24px!important;
  border:1px solid #e2e8f0!important;
  background:#fff!important;
  box-shadow:0 12px 30px rgba(15,23,42,.055)!important;
  overflow:hidden!important;
}
body.fcp-app-root-page .fcp-client-modules-panel-14726 > header,
.fcp-app-shell .fcp-client-modules-panel-14726 > header{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:14px!important;
  margin:0 0 16px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}
body.fcp-app-root-page .fcp-client-modules-panel-14726 > header h3,
.fcp-app-shell .fcp-client-modules-panel-14726 > header h3{
  margin:0!important;
  color:#0f172a!important;
  font-size:18px!important;
  line-height:1.15!important;
  font-weight:900!important;
  letter-spacing:-.02em!important;
}
body.fcp-app-root-page .fcp-client-modules-panel-14726 > header span,
.fcp-app-shell .fcp-client-modules-panel-14726 > header span{
  display:block!important;
  margin-top:4px!important;
  color:#64748b!important;
  font-size:13px!important;
  line-height:1.35!important;
  font-weight:700!important;
}
body.fcp-app-root-page .fcp-client-modules-panel-14726 > header a,
.fcp-app-shell .fcp-client-modules-panel-14726 > header a{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:38px!important;
  padding:0 13px!important;
  border-radius:12px!important;
  border:1px solid #bfdbfe!important;
  background:#eff6ff!important;
  color:#2563eb!important;
  text-decoration:none!important;
  font-size:12px!important;
  line-height:1!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
.fcp-client-modules-grid-14726{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
}
.fcp-client-module-card-14726{
  min-width:0!important;
  min-height:192px!important;
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  padding:14px!important;
  border-radius:18px!important;
  border:1px solid #e2e8f0!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%)!important;
  box-shadow:0 8px 22px rgba(15,23,42,.045)!important;
  overflow:hidden!important;
}
.fcp-client-module-card-14726 > header{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:10px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}
.fcp-client-module-card-14726 > header div{
  min-width:0!important;
}
.fcp-client-module-card-14726 > header span{
  display:block!important;
  margin:0 0 4px!important;
  color:#64748b!important;
  font-size:10px!important;
  line-height:1!important;
  font-weight:900!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
}
.fcp-client-module-card-14726 > header strong{
  display:block!important;
  color:#0f172a!important;
  font-size:14px!important;
  line-height:1.2!important;
  font-weight:900!important;
  letter-spacing:-.01em!important;
  overflow-wrap:anywhere!important;
}
.fcp-client-module-card-14726 > header em{
  flex:none!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:26px!important;
  padding:0 9px!important;
  border-radius:999px!important;
  background:#f1f5f9!important;
  color:#475569!important;
  font-size:10px!important;
  line-height:1!important;
  font-style:normal!important;
  font-weight:900!important;
  letter-spacing:.02em!important;
  text-transform:uppercase!important;
  white-space:nowrap!important;
}
.fcp-client-module-card-14726.is-ok > header em{background:#ecfdf5!important;color:#047857!important;border:1px solid #bbf7d0!important;}
.fcp-client-module-card-14726.is-warn > header em{background:#fffbeb!important;color:#b45309!important;border:1px solid #fde68a!important;}
.fcp-client-module-card-14726.is-danger > header em{background:#fef2f2!important;color:#dc2626!important;border:1px solid #fecaca!important;}
.fcp-client-module-card-14726.is-muted > header em{background:#f1f5f9!important;color:#64748b!important;border:1px solid #e2e8f0!important;}
.fcp-client-module-rows-14726{
  display:grid!important;
  gap:7px!important;
  min-width:0!important;
  flex:1!important;
}
.fcp-client-module-rows-14726 p{
  display:grid!important;
  grid-template-columns:minmax(84px,.7fr) minmax(0,1fr)!important;
  gap:8px!important;
  align-items:start!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  min-height:0!important;
}
.fcp-client-module-rows-14726 p span{
  color:#64748b!important;
  font-size:11px!important;
  line-height:1.25!important;
  font-weight:800!important;
}
.fcp-client-module-rows-14726 p strong{
  min-width:0!important;
  color:#0f172a!important;
  font-size:12px!important;
  line-height:1.25!important;
  font-weight:850!important;
  overflow-wrap:anywhere!important;
}
.fcp-client-module-card-14726 > a{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:max-content!important;
  max-width:100%!important;
  min-height:34px!important;
  padding:0 12px!important;
  border-radius:11px!important;
  border:1px solid #bfdbfe!important;
  background:#eff6ff!important;
  color:#2563eb!important;
  text-decoration:none!important;
  font-size:12px!important;
  line-height:1!important;
  font-weight:900!important;
  white-space:nowrap!important;
}

/* Desktop task readability hard reset */
@media (min-width:900px){
  .fcp-app-shell[data-active-tab="task"] .fcp-app-main{
    overflow-x:hidden!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-mobile-native-task,
  .fcp-app-shell[data-active-tab="task"] .fcp-app-task-page-14721{
    width:100%!important;
    max-width:1180px!important;
    margin-left:auto!important;
    margin-right:auto!important;
    min-width:0!important;
  }
  .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;
    display:grid!important;
    grid-template-columns:32px minmax(0,1fr) auto 44px!important;
    grid-template-rows:auto auto!important;
    grid-template-areas:
      "check meta badge more"
      "check main actions actions"!important;
    gap:8px 14px!important;
    align-items:center!important;
    min-height:104px!important;
    height:auto!important;
    padding:16px 18px!important;
    overflow:hidden!important;
    contain:none!important;
    border-radius:20px!important;
  }
  .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{
    display:contents!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-mobile-task-check,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-mobile-task-check{
    grid-area:check!important;
    align-self:center!important;
    justify-self:start!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    margin:0!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-time,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-time{
    grid-area:meta!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    align-self:end!important;
    min-width:0!important;
    min-height:18px!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-time span,
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-time strong,
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-time small,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-time span,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-time strong,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-time small{
    position:static!important;
    display:inline-block!important;
    margin:0!important;
    padding:0!important;
    font-size:12px!important;
    line-height:1.1!important;
    font-weight:850!important;
    color:#64748b!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-time strong,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-time strong{
    color:#0f172a!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-priority-badge,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-priority-badge{
    grid-area:badge!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    align-self:end!important;
    justify-self:end!important;
    margin:0!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-mobile-task-more,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-mobile-task-more{
    grid-area:more!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    align-self:center!important;
    justify-self:end!important;
    margin:0!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-main,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-main{
    grid-area:main!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    align-self:start!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    gap:4px!important;
    overflow:hidden!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-main strong,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-main strong{
    display:block!important;
    margin:0!important;
    color:#0f172a!important;
    font-size:17px!important;
    line-height:1.2!important;
    font-weight:900!important;
    letter-spacing:-.015em!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-main span,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-main span{
    display:block!important;
    margin:0!important;
    color:#475569!important;
    font-size:13px!important;
    line-height:1.3!important;
    font-weight:750!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-mobile-task-note-preview,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-mobile-task-note-preview{
    display:-webkit-box!important;
    -webkit-line-clamp:1!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
    margin:1px 0 0!important;
    color:#64748b!important;
    font-size:12px!important;
    line-height:1.35!important;
    font-weight:650!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-footer,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-footer{
    grid-area:actions!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    justify-self:end!important;
    align-self:start!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:8px!important;
    flex-wrap:nowrap!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-footer a,
  .fcp-app-shell[data-active-tab="task"] .fcp-task-card-saas .fcp-task-card-footer button,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-footer a,
  .fcp-app-shell .fcp-record-detail-saas-14724 .fcp-task-card-saas .fcp-task-card-footer button{
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
    padding:0 13px!important;
    border-radius:12px!important;
    font-size:13px!important;
    line-height:1!important;
    font-weight:900!important;
    white-space:nowrap!important;
  }
}

@media (min-width:1181px){
  .fcp-client-modules-grid-14726{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}

@media (min-width:700px) and (max-width:1180px){
  .fcp-client-modules-grid-14726{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media (max-width:699px){
  body.fcp-app-root-page .fcp-client-modules-panel-14726,
  .fcp-app-shell .fcp-client-modules-panel-14726{
    padding:14px!important;
    border-radius:20px!important;
  }
  body.fcp-app-root-page .fcp-client-modules-panel-14726 > header,
  .fcp-app-shell .fcp-client-modules-panel-14726 > header{
    flex-direction:column!important;
    align-items:stretch!important;
    gap:10px!important;
  }
  .fcp-client-modules-grid-14726{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .fcp-client-module-card-14726{
    min-height:0!important;
    padding:13px!important;
    border-radius:17px!important;
  }
  .fcp-client-module-rows-14726 p{
    grid-template-columns:minmax(76px,.6fr) minmax(0,1fr)!important;
  }
}
