/* Projects detail and template editor refinements. */
#projects-view .projects-detail .projects-stats-extras{display:none!important}

/* In project detail the overview stays operational: portfolio analytics belong
   to the global Statistics tab only. Keep workstreams dense on large screens. */
#projects-view .projects-detail .projects-workstreams{
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr))!important;
  gap:12px!important;
}
@media (min-width:1180px){
  #projects-view .projects-detail .projects-workstreams{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media (min-width:1460px){
  #projects-view .projects-detail .projects-workstreams{grid-template-columns:repeat(5,minmax(0,1fr))!important}
}
@media (min-width:1780px){
  #projects-view .projects-detail .projects-workstreams{grid-template-columns:repeat(6,minmax(0,1fr))!important}
}

#projects-dialog .task-v3-dialog--wide{
  width:min(1280px,calc(100vw - 32px))!important;
}
[data-template-editor-body] .projects-template-toolbar{
  margin:0 0 14px!important;
  padding:10px 12px!important;
  border:1px solid #dbe7f3!important;
  border-radius:12px!important;
  background:#f7faff!important;
}
[data-template-editor-body] .projects-template-table__wrap{
  overflow-x:hidden!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
}
[data-template-editor-body] .projects-template-tasks-20260911{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  border:0!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 thead{display:none!important}
[data-template-editor-body] .projects-template-tasks-20260911 tbody{
  display:grid!important;
  min-width:0!important;
  gap:16px!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 tr{
  position:relative!important;
  display:grid!important;
  width:100%!important;
  min-width:0!important;
  grid-template-columns:108px minmax(180px,.75fr) minmax(300px,1.35fr) minmax(290px,1fr)!important;
  grid-template-rows:auto auto auto!important;
  gap:12px 14px!important;
  padding:16px!important;
  overflow:hidden!important;
  border:1px solid #cfdeed!important;
  border-left:5px solid #0b7ff0!important;
  border-radius:16px!important;
  background:linear-gradient(135deg,#ffffff 0%,#ffffff 74%,#f7fbff 100%)!important;
  box-shadow:0 7px 22px rgba(14,33,102,.07)!important;
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 tr:hover{
  border-color:#a9c9ea!important;
  box-shadow:0 10px 28px rgba(14,33,102,.11)!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td{
  display:block!important;
  min-width:0!important;
  padding:0!important;
  overflow:visible!important;
  border:0!important;
  background:transparent!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td::before{
  display:block!important;
  margin:0 0 7px!important;
  color:#60758b!important;
  font-size:10px!important;
  font-weight:800!important;
  letter-spacing:.07em!important;
  line-height:1.2!important;
  text-transform:uppercase!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(1){
  display:flex!important;
  grid-column:1!important;
  grid-row:1 / 3!important;
  min-height:122px!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  padding:14px 10px!important;
  border:1px solid #bed9f4!important;
  border-radius:12px!important;
  background:linear-gradient(180deg,#eef7ff 0%,#f8fbff 100%)!important;
  text-align:center!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(1)::before{
  content:'Sequenza'!important;
  margin-bottom:9px!important;
  color:#3f6f9f!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(2){grid-column:2!important;grid-row:1!important}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(2)::before{content:'Riferimenti tecnici'!important}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(3){grid-column:3!important;grid-row:1!important}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(3)::before{content:'Contenuto task'!important}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(4){grid-column:4!important;grid-row:1!important}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(4)::before{content:'Macrosezione e assegnatari'!important}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(5){
  grid-column:2 / 4!important;
  grid-row:2!important;
  padding:12px!important;
  border:1px solid #e1e8f0!important;
  border-radius:11px!important;
  background:#fafbfd!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(5)::before{content:'Gerarchia e dipendenze'!important}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6){
  grid-column:4!important;
  grid-row:2!important;
  padding:12px!important;
  border:1px solid #cfe3f8!important;
  border-radius:11px!important;
  background:#f4f9ff!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6)::before{content:'Pianificazione e stato'!important}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(7){
  display:flex!important;
  grid-column:1 / -1!important;
  grid-row:3!important;
  align-items:center!important;
  justify-content:flex-end!important;
  padding:11px 0 0!important;
  border-top:1px solid #e7eef6!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(7)::before{
  content:'Azioni task'!important;
  margin:0 auto 0 0!important;
}
[data-template-editor-body] .projects-template-position{
  display:block!important;
  color:#0e2166!important;
  font-size:16px!important;
  font-weight:800!important;
  line-height:1.2!important;
}
[data-template-editor-body] .projects-template-position-note{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin-top:7px!important;
  padding:4px 8px!important;
  border-radius:999px!important;
  background:#ddecfb!important;
  color:#3d668d!important;
  font-size:10px!important;
  font-weight:700!important;
  line-height:1.2!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 :is(input,textarea,select){
  box-sizing:border-box!important;
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  border-color:#cfdbe8!important;
  background:#fff!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 :is(input,textarea,select):focus{
  border-color:#0b7ff0!important;
  outline:2px solid rgba(11,127,240,.13)!important;
  outline-offset:1px!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td :is(input,textarea,select)+:is(input,textarea,select){
  margin-top:8px!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(2) input{
  color:#53677b!important;
  font-size:12px!important;
  background:#f9fbfd!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(3) input[data-key="title"]{
  min-height:46px!important;
  color:#0e2166!important;
  font-size:15px!important;
  font-weight:800!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(3) textarea{
  min-height:94px!important;
  resize:vertical!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(4) input{
  min-height:43px!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6)>.projects-actions{
  display:grid!important;
  width:100%!important;
  min-width:0!important;
  grid-template-columns:76px 88px minmax(112px,1fr)!important;
  align-items:end!important;
  gap:9px!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6)>.projects-actions>label{
  display:grid!important;
  min-width:0!important;
  gap:6px!important;
  margin:0!important;
  overflow:visible!important;
}
[data-template-editor-body] .projects-template-control-label{
  color:#60758b!important;
  font-size:9px!important;
  font-weight:800!important;
  letter-spacing:.04em!important;
  line-height:1.2!important;
  text-transform:uppercase!important;
  white-space:nowrap!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6)>.projects-actions>label:nth-child(3) .projects-template-control-label{
  font-size:0!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6)>.projects-actions>label:nth-child(3) .projects-template-control-label::after{
  content:'Scadenza (+ giorni)'!important;
  font-size:9px!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 input[data-key="dueOffsetDays"]{
  min-width:112px!important;
  width:100%!important;
  padding-left:12px!important;
  padding-right:12px!important;
  font-variant-numeric:tabular-nums!important;
  font-weight:800!important;
  text-align:center!important;
}
[data-template-editor-body] .projects-template-enabled-toggle{
  box-sizing:border-box!important;
  display:flex!important;
  width:100%!important;
  max-width:100%!important;
  min-height:42px!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  margin-top:11px!important;
  padding:8px 11px!important;
  border:1px solid #b9e7ce!important;
  border-radius:10px!important;
  background:#f1fbf5!important;
  color:#157347!important;
  font-size:12px!important;
  font-weight:800!important;
  transition:background .15s ease,border-color .15s ease,color .15s ease!important;
}
[data-template-editor-body] .projects-template-enabled-toggle::before{
  content:'●'!important;
  color:#22a663!important;
  font-size:12px!important;
  line-height:1!important;
}
[data-template-editor-body] .projects-template-enabled-toggle span{margin-right:auto!important}
[data-template-editor-body] .projects-template-enabled-toggle input[type="checkbox"]{
  width:20px!important;
  min-width:20px!important;
  height:20px!important;
  margin:0!important;
  accent-color:#168a51!important;
}
[data-template-editor-body] .projects-template-enabled-toggle:has(input:not(:checked)){
  border-color:#d9e0e8!important;
  background:#f5f6f8!important;
  color:#667085!important;
}
[data-template-editor-body] .projects-template-enabled-toggle:has(input:not(:checked))::before{color:#98a2b3!important}
[data-template-editor-body] .projects-template-tasks-20260911 .projects-mini-actions{
  display:flex!important;
  width:auto!important;
  justify-content:flex-end!important;
  gap:8px!important;
  flex-wrap:wrap!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 .projects-mini-actions button{
  display:inline-flex!important;
  width:auto!important;
  min-width:86px!important;
  height:36px!important;
  min-height:36px!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  padding:7px 12px!important;
  border:1px solid #ccdae8!important;
  border-radius:9px!important;
  background:#fff!important;
  color:#315276!important;
  font-size:12px!important;
  font-weight:700!important;
  box-shadow:none!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 .projects-mini-actions [data-template-row-action="up"]::before{content:'↑'!important;font-size:15px!important}
[data-template-editor-body] .projects-template-tasks-20260911 .projects-mini-actions [data-template-row-action="down"]::before{content:'↓'!important;font-size:15px!important}
[data-template-editor-body] .projects-template-tasks-20260911 .projects-mini-actions [data-template-row-action="delete"]{
  margin-left:5px!important;
  border-color:#efb6b1!important;
  background:#fff6f5!important;
  color:#b42318!important;
}
[data-template-editor-body] .projects-template-tasks-20260911 .projects-mini-actions [data-template-row-action="delete"]::before{content:'×'!important;font-size:16px!important}

@media (max-width:1120px){
  [data-template-editor-body] .projects-template-tasks-20260911 tr{
    grid-template-columns:96px repeat(8,minmax(0,1fr))!important;
    grid-template-rows:auto auto auto auto!important;
  }
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(1){grid-column:1!important;grid-row:1 / 3!important}
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(2){grid-column:2 / 5!important;grid-row:1!important}
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(3){grid-column:5 / 10!important;grid-row:1!important}
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(4){grid-column:2 / 10!important;grid-row:2!important}
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(5){grid-column:1 / 6!important;grid-row:3!important}
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6){grid-column:6 / 10!important;grid-row:3!important}
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(7){grid-column:1 / 10!important;grid-row:4!important}
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6)>.projects-actions{
    grid-template-columns:70px 82px minmax(110px,1fr)!important;
  }
}

@media (max-width:760px){
  #projects-dialog .task-v3-dialog--wide{width:calc(100vw - 16px)!important}
  [data-template-editor-body] .projects-template-tasks-20260911 tr{
    grid-template-columns:1fr!important;
    grid-template-rows:auto!important;
    padding:12px!important;
  }
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(n){
    grid-column:1!important;
    grid-row:auto!important;
  }
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(1){
    min-height:0!important;
    align-items:flex-start!important;
    text-align:left!important;
  }
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6)>.projects-actions{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(6)>.projects-actions>label:nth-child(3){grid-column:1 / -1!important}
  [data-template-editor-body] .projects-template-tasks-20260911 input[data-key="dueOffsetDays"]{min-width:0!important}
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(7){
    align-items:stretch!important;
    flex-direction:column!important;
  }
  [data-template-editor-body] .projects-template-tasks-20260911 td:nth-child(7)::before{margin-bottom:8px!important}
  [data-template-editor-body] .projects-template-tasks-20260911 .projects-mini-actions{
    width:100%!important;
    justify-content:stretch!important;
  }
  [data-template-editor-body] .projects-template-tasks-20260911 .projects-mini-actions button{
    flex:1 1 0!important;
    min-width:0!important;
  }
}
