/* V204 - Task management filter/topbar/footer layout
   UI-only. Keeps backend routes, query parameters and task workflow unchanged. */

.task-filter-shell{
  overflow:visible!important;
}

.task-filter-head{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:18px!important;
  flex-wrap:wrap!important;
}

.task-filter-actions-top{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:10px!important;
  margin-left:auto!important;
  flex-wrap:wrap!important;
}

.task-filter-actions-top .task-tool-btn,
.task-filter-actions-top .column-visible-btn,
.task-filter-actions-top .task-export-btn{
  min-height:42px!important;
  height:42px!important;
  border-radius:10px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  white-space:nowrap!important;
}

.task-filter-actions-top .column-toggle-wrap{
  position:relative!important;
  display:inline-flex!important;
}

.task-filter-actions-top .column-menu{
  top:calc(100% + 8px)!important;
  right:0!important;
  left:auto!important;
  z-index:1200!important;
}

.task-export-btn{
  border:1px solid #2f8f45!important;
  background:#2f963f!important;
  color:#ffffff!important;
  font-weight:700!important;
  padding:0 18px!important;
  box-shadow:0 6px 16px rgba(47,150,63,.18)!important;
}

.task-export-btn:hover{
  background:#287f36!important;
  color:#ffffff!important;
}

/* Remove the detached top pagination block after controls are moved to the filter header. */
.task-grid-toolbar{
  display:none!important;
}

/* Inline advanced filters, directly below the quick filter row. */
.task-advanced-inline{
  width:100%!important;
  max-height:0!important;
  opacity:0!important;
  overflow:hidden!important;
  margin-top:0!important;
  padding:0 14px!important;
  border-top:0 solid #e5e7eb!important;
  background:#f8fafc!important;
  transition:max-height .28s ease,opacity .2s ease,margin-top .2s ease,padding .2s ease,border-width .2s ease!important;
}

.task-advanced-inline.is-open{
  max-height:760px!important;
  opacity:1!important;
  margin-top:14px!important;
  padding:16px 14px 14px!important;
  border-top-width:1px!important;
}

.task-advanced-inline .advanced-filter-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(180px,1fr))!important;
  gap:14px!important;
  padding:0!important;
  margin:0!important;
}

.task-advanced-inline .field{
  min-width:0!important;
}

.task-advanced-inline .filter-actions{
  grid-column:1/-1!important;
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:10px!important;
  margin-top:2px!important;
}

.task-advanced-inline .filter-actions .btn.success{
  display:none!important;
}

.task-advanced-inline input,
.task-advanced-inline select{
  min-height:40px!important;
}

/* Pagination belongs to the footer only. */
.task-grid-card > .pager{
  margin:14px 0 0!important;
  padding:14px 4px 2px!important;
  border-top:1px solid #e5e7eb!important;
  display:grid!important;
  grid-template-columns:minmax(240px,1fr) auto auto!important;
  align-items:center!important;
  gap:14px!important;
  background:#ffffff!important;
}

.task-grid-card > .pager .pager-summary{
  color:#475569!important;
  font-size:13px!important;
  font-weight:600!important;
}

.task-grid-card > .pager .pager-size,
.task-grid-card > .pager .pager-actions{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}

.task-grid-card > .pager .pager-size select{
  width:92px!important;
  min-height:36px!important;
}

/* Stronger table header hierarchy. */
#taskDataGrid thead th{
  color:#111827!important;
  font-weight:700!important;
  font-size:11.5px!important;
  letter-spacing:.02em!important;
  background:#ffffff!important;
  border-bottom:1px solid #dfe5ec!important;
}

/* TASK returns to the original concatenated title, clamped to two lines. */
#taskDataGrid{
  table-layout:fixed!important;
}

#taskDataGrid th[data-col="task"],
#taskDataGrid td[data-col="task"]{
  width:360px!important;
  min-width:360px!important;
  max-width:360px!important;
  text-align:left!important;
}

#taskDataGrid .task-title-cell a{
  display:block!important;
  width:100%!important;
  color:#111827!important;
  text-decoration:none!important;
}

#taskDataGrid .task-title-main{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  overflow:hidden!important;
  white-space:normal!important;
  text-overflow:ellipsis!important;
  color:#111827!important;
  font-size:13px!important;
  font-weight:600!important;
  line-height:1.38!important;
  max-height:2.76em!important;
}

#taskDataGrid .task-title-phase{
  display:none!important;
}

#taskDataGrid th[data-col="contract"],
#taskDataGrid td[data-col="contract"]{
  width:104px!important;
  min-width:104px!important;
  max-width:104px!important;
  text-align:center!important;
  color:#111827!important;
  font-weight:600!important;
}

#taskDataGrid th[data-col="type"],
#taskDataGrid td[data-col="type"]{
  width:126px!important;
  min-width:126px!important;
  max-width:126px!important;
}

#taskDataGrid th[data-col="company"],
#taskDataGrid td[data-col="company"]{
  width:190px!important;
  min-width:190px!important;
  max-width:190px!important;
}

#taskDataGrid th[data-col="province_new"],
#taskDataGrid td[data-col="province_new"]{
  width:108px!important;
  min-width:108px!important;
  max-width:108px!important;
}

#taskDataGrid th[data-col="manager"],
#taskDataGrid td[data-col="manager"],
#taskDataGrid th[data-col="assignee"],
#taskDataGrid td[data-col="assignee"]{
  width:158px!important;
  min-width:158px!important;
  max-width:158px!important;
}

#taskDataGrid th[data-col="deployment"],
#taskDataGrid td[data-col="deployment"]{
  width:148px!important;
  min-width:148px!important;
  max-width:148px!important;
}

#taskDataGrid th[data-col="status"],
#taskDataGrid td[data-col="status"]{
  width:176px!important;
  min-width:176px!important;
  max-width:176px!important;
  text-align:center!important;
}

#taskDataGrid .status-badge{
  min-width:132px!important;
  max-width:164px!important;
  white-space:nowrap!important;
}

@media(max-width:1180px){
  .task-advanced-inline .advanced-filter-grid{
    grid-template-columns:repeat(2,minmax(180px,1fr))!important;
  }
  #taskDataGrid th[data-col="task"],
  #taskDataGrid td[data-col="task"]{
    width:330px!important;
    min-width:330px!important;
    max-width:330px!important;
  }
}

@media(max-width:760px){
  .task-filter-actions-top{
    width:100%!important;
    justify-content:flex-start!important;
  }
  .task-filter-actions-top .task-tool-btn,
  .task-filter-actions-top .column-visible-btn,
  .task-filter-actions-top .task-export-btn{
    flex:1 1 auto!important;
  }
  .task-advanced-inline .advanced-filter-grid{
    grid-template-columns:1fr!important;
  }
  .task-grid-card > .pager{
    grid-template-columns:1fr!important;
    justify-items:start!important;
  }
}
