/* Sfera CRM · Progetti v2.34.0
   Flat statistics, aligned portfolio, independent KPIs, hierarchical templates,
   timeline insights. Colors from approved Sfera dashboard. */

/* Portfolio health: three values and icon on the SAME row. */
#projects-view .projects-shell:not(.projects-shell--detail) .projects-health-feature--compact {
  padding:20px 23px 19px!important;min-height:0!important;
}
#projects-view .projects-health-feature--compact .projects-health-feature__identity {
  display:grid!important;
  grid-template-columns:minmax(150px,.76fr) minmax(250px,1.65fr) 42px!important;
  align-items:center!important;gap:18px!important;min-height:126px!important;
}
#projects-view .projects-health-feature--compact .projects-health-feature__total {
  display:flex!important;flex-direction:column;align-items:flex-start;justify-content:center;
  min-width:0;padding-right:14px;
  border-right:1px solid #e8eef7;
}
#projects-view .projects-health-feature--compact .projects-health-feature__total>span {
  font:600 12px/1.35 "Open Sans",sans-serif;color:#6680a0;
}
#projects-view .projects-health-feature--compact .projects-health-feature__total>strong {
  margin:8px 0 3px;font:650 clamp(31px,3.2vw,46px)/1 Poppins,sans-serif;color:#0e2166;
}
#projects-view .projects-health-feature--compact .projects-health-feature__total>small {
  color:#8b9bb1;font:450 10px/1.3 "Open Sans",sans-serif;
}
#projects-view .projects-health-feature--compact .projects-health-feature__statuses {
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;min-width:0;
}
#projects-view .projects-health-feature--compact .projects-health-feature__status {
  display:flex;flex-direction:column;justify-content:center;gap:8px;
  min-width:0;min-height:108px!important;padding:14px 16px!important;
  border-radius:13px!important;
}
#projects-view .projects-health-feature--compact .projects-health-feature__status>span {
  white-space:nowrap;font-size:11px!important;
}
#projects-view .projects-health-feature--compact .projects-health-feature__status>strong {
  font:650 27px/1.1 Poppins,sans-serif!important;
}
#projects-view .projects-health-feature--compact .projects-feature-icon {
  position:static!important;align-self:start!important;justify-self:end!important;
  flex:0 0 40px!important;width:40px!important;height:40px!important;
  margin:0!important;transform:none!important;
  background:#0e2166!important;color:#fff!important;
}
#projects-view .projects-health-feature--compact .projects-health-feature__bottom {
  display:flex!important;align-items:center;gap:13px!important;
  margin:14px 0 0!important;padding-top:14px!important;
  border-top:1px solid #ebf0f7!important;
  font:600 10px/1.4 "Open Sans",sans-serif;color:#7189a6;
}
#projects-view .projects-health-feature--compact .projects-health-feature__bottom .projects-health-feature__track {
  flex:1 1 auto;margin:0!important;
}

/* All Statistics widgets are independent children of the page canvas.
   Remove the *parent* white shell, not its individual card surfaces. */
#projects-view .projects-shell:not(.projects-shell--detail):has(.projects-stats-overview){
  width:100%!important;max-width:none!important;
  padding:0 0 25px!important;
  border:0!important;border-radius:0!important;
  background:transparent!important;background-image:none!important;
  box-shadow:none!important;
}
#projects-view .projects-shell:not(.projects-shell--detail):has(.projects-stats-overview) [data-projects-content]{
  display:block!important;min-width:0;background:transparent!important;
  border:0!important;box-shadow:none!important;padding:0!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-overview,
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-grid{
  width:100%!important;max-width:none!important;
  padding:0!important;border:0!important;
  background:transparent!important;box-shadow:none!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-overview {
  margin-bottom:15px!important;gap:15px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-grid {
  margin-top:0!important;margin-bottom:0!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-widget{
  margin:0!important;min-width:0;
  border-radius:15px!important;overflow:hidden;
  background:#fff!important;
  box-shadow:0 6px 20px rgba(26,54,100,.05)!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-widget>.projects-stats-card-header {
  display:flex!important;align-items:center;justify-content:space-between;
  gap:13px;min-height:40px!important;margin:0 0 16px!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-widget>.projects-stats-card-header h2 {
  margin:0!important;color:#153b70!important;
  font:650 15px/1.35 Poppins,"Open Sans",sans-serif!important;
  letter-spacing:-.015em!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-overview .projects-stats-widget>strong{
  font-size:clamp(29px,2.5vw,40px)!important;line-height:1.12!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-hero>strong{
  font-size:clamp(31px,3vw,45px)!important;
}

/* Five independent Project detail KPI cards, one desktop row. */
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail{
  display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
  align-items:stretch!important;gap:12px!important;
  padding:0!important;margin:0 0 17px!important;
  background:transparent!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;overflow:visible!important;
}
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail>.projects-kpi,
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail>.projects-kpi:first-child,
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail>.projects-kpi:nth-child(n){
  display:flex!important;flex-direction:column!important;min-width:0!important;
  min-height:130px!important;margin:0!important;padding:17px 18px!important;
  border:1px solid #e3eaf5!important;border-radius:15px!important;
  background:#fff!important;box-shadow:0 6px 18px rgba(23,51,97,.046)!important;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease!important;
}
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail>.projects-kpi:hover{
  transform:translateY(-2px)!important;border-color:#ccdef4!important;
  box-shadow:0 10px 23px rgba(23,51,97,.067)!important;
}
#projects-view .projects-shell--detail .sfera-pd-kpi-heading{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  min-height:24px!important;margin:0 0 7px!important;padding:0!important;
  background:transparent!important;
}
#projects-view .projects-shell--detail .sfera-pd-kpi-heading>small {
  margin:0!important;color:#6e84a0;font:600 11px/1.3 "Open Sans",sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-kpi-heading>i{
  display:grid;place-items:center;flex:0 0 27px;width:27px;height:27px;
  border-radius:8px;background:#eef5ff;color:#2d72c3;font-style:normal;
}
#projects-view .projects-shell--detail .sfera-pd-kpi-heading svg{
  display:block;width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;
}
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail>.projects-kpi>strong{
  font:650 clamp(25px,2.55vw,35px)/1.15 Poppins,sans-serif!important;
  color:#0e2166;letter-spacing:-.035em;font-variant-numeric:tabular-nums;
}
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail>.projects-kpi>span{
  margin:6px 0 0!important;color:#8397ad;font:450 10.5px/1.45 "Open Sans",sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail .projects-kpi__progress-track{
  margin-top:auto!important;margin-bottom:0!important;
}
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail .projects-kpi--danger>strong{color:#b95566!important}
#projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail .projects-kpi--success:not(:first-child)>strong{color:#26886d!important}

/* Project identity: richer structured information, but no repeated task numbers. */
#projects-view .projects-shell--detail .projects-detail__top.sfera-pd-hero{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
  gap:18px 22px!important;align-items:center!important;min-height:0!important;
  padding:21px clamp(17px,2vw,28px)!important;
  border-radius:17px!important;background:#fff!important;
  border:1px solid #e1e9f5!important;
  box-shadow:0 5px 18px rgba(20,51,103,.045)!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__identity{
  display:block!important;width:100%!important;min-width:0;
}
#projects-view .projects-shell--detail .sfera-pd-hero__eyebrow{
  display:block;margin:0 0 6px!important;color:#6b93c0;
  font:650 9px/1.3 "Open Sans",sans-serif;letter-spacing:.095em;
}
#projects-view .projects-shell--detail .sfera-pd-hero__identity h1{
  max-width:100%;color:#0e2166!important;
  font:650 clamp(20px,2.1vw,29px)/1.22 Poppins,sans-serif!important;
  letter-spacing:-.032em!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__status{
  display:flex;flex-wrap:wrap;gap:7px!important;margin:9px 0 0!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__status .projects-badge{
  padding:5px 10px!important;border-radius:8px!important;
  font:600 10px/1.3 "Open Sans",sans-serif;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts{
  display:flex;align-items:flex-start;flex-wrap:wrap;gap:12px 0;
  margin-top:18px;padding-top:13px;border-top:1px solid #edf1f7;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts>div{
  display:grid;gap:3px;align-content:start;min-width:115px;max-width:34%;
  padding:0 17px;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts>div:first-child{padding-left:0}
#projects-view .projects-shell--detail .sfera-pd-hero__facts>div+div{
  border-left:1px solid #e7edf5;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts span{
  font:550 9.5px/1.3 "Open Sans",sans-serif;color:#8a9bb1;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts strong{
  color:#365b85;font:600 11px/1.4 "Open Sans",sans-serif;
  overflow-wrap:anywhere;
}
#projects-view .projects-shell--detail .sfera-pd-hero__identity .sfera-pd-header-controls{
  align-self:center;
}
#projects-view .projects-shell--detail .sfera-pd-direct-edit{
  color:#2465af!important;border-color:#d9e6f6!important;background:#f8fbff!important;
}

/* History: 3:1 split and a filter-aware sticky insights column. */
#projects-view .projects-shell--detail .sfera-pd-history-layout{
  display:grid;grid-template-columns:minmax(0,3fr) minmax(245px,1fr);
  align-items:start;gap:17px;margin:0;min-width:0;
}
#projects-view .projects-shell--detail .sfera-pd-history-layout>.sfera-pd-history-card{
  width:100%!important;max-width:none!important;min-width:0!important;
  margin:0!important;padding:14px 14px 20px!important;
  border:1px solid #e4eaf5!important;border-radius:16px!important;
  background:#f8faff!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-layout .sfera-pd-timeline{
  width:100%!important;max-width:none!important;
  min-width:0!important;grid-template-columns:minmax(0,1fr)!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights{
  position:sticky;top:16px;min-width:0;
  padding:19px 18px 16px;border:1px solid #e3ebf5;border-radius:16px;
  background:#fff;box-shadow:0 5px 20px rgba(22,51,94,.045);
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__header{
  display:flex;align-items:center;justify-content:space-between;gap:11px;
  margin:0 0 17px!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__header>div>span{
  color:#869ab0;font:600 9px/1.3 "Open Sans",sans-serif;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__header h2{
  margin:4px 0 0!important;color:#15396b!important;
  font:650 14px/1.25 Poppins,sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__header>i{
  display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;
  border-radius:10px;background:#0e2166;color:#fff;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__header>i svg{
  width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__metrics{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;
  padding:0 0 16px;border-bottom:1px solid #ecf1f7;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__metrics>div{
  display:grid;gap:4px;justify-items:start;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__metrics strong{
  color:#0e2166;font:650 21px/1.1 Poppins,sans-serif;
  font-variant-numeric:tabular-nums;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__metrics span{
  color:#8a9cb2;font:500 9.5px/1.35 "Open Sans",sans-serif;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section{
  display:grid;gap:11px;padding:17px 0 2px;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section+.sfera-pd-history-insights__section{
  border-top:1px solid #ecf1f7;margin-top:15px;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section-heading{
  display:flex;align-items:flex-start;justify-content:space-between;gap:9px;margin-bottom:3px;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section-heading h3{
  margin:0!important;color:#2c4d75;font:650 11px/1.3 Poppins,sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section-heading span{
  color:#94a3b6;font:500 9px/1.3 "Open Sans",sans-serif;white-space:nowrap;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor{
  display:grid;gap:7px;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor>div:first-child{
  display:flex;justify-content:space-between;gap:12px;
  color:#66809c;font:550 10.5px/1.3 "Open Sans",sans-serif;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor>div:first-child span{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor strong{
  color:#254c81;font:650 11px Poppins,sans-serif;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor>small{
  display:block;color:#91a2b7;font:450 9px/1.3 "Open Sans",sans-serif;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__track{
  height:6px;border-radius:99px;overflow:hidden;background:#eaf0f7;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__track i{
  display:block;width:var(--history-bar);height:100%;background:#4989dd;
  border-radius:inherit;transform-origin:left;animation:sfera-history-grow .75s cubic-bezier(.2,.8,.3,1) both;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__days{
  display:flex;align-items:end;justify-content:space-between;gap:6px;
  height:100px;padding:0 0 1px;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__days>div{
  display:flex;flex:1;flex-direction:column;align-items:center;justify-content:flex-end;
  min-width:0;height:100%;gap:5px;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__days strong{
  font:600 9px "Open Sans",sans-serif;color:#5678a4;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__days i{
  width:min(100%,22px);height:var(--history-height);
  min-height:3px;border-radius:6px 6px 2px 2px;background:#7aa9eb;
  transform-origin:bottom;animation:sfera-history-grow-y .7s cubic-bezier(.25,.75,.3,1) both;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__days small{
  color:#97a6b8;font:500 9px "Open Sans",sans-serif;white-space:nowrap;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__empty{
  margin:0;color:#8e9eb3;font:450 10px/1.45 "Open Sans",sans-serif;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__footnote{
  margin:16px 0 0;padding-top:12px;border-top:1px solid #eef2f7;
  color:#9daaba;font:450 9px/1.5 "Open Sans",sans-serif;
}
@keyframes sfera-history-grow {from{transform:scaleX(.02)}to{transform:scaleX(1)}}
@keyframes sfera-history-grow-y {from{transform:scaleY(.02)}to{transform:scaleY(1)}}

/* Template tabs span the entire editor width, with no dead space. */
#projects-dialog.projects-template-studio .projects-template-studio__tabs{
  display:grid!important;grid-template-columns:1fr 1fr!important;
  width:100%!important;max-width:none!important;
  min-height:55px!important;gap:5px!important;
  padding:5px!important;margin:0 0 17px!important;
}
#projects-dialog.projects-template-studio .projects-template-studio__tabs>button{
  width:100%!important;height:43px!important;min-height:43px!important;
  font-size:12px!important;
}

/* Template general settings are visible in ONE composed layout, not two panels. */
#projects-dialog.projects-template-studio .sfera-template-settings{
  min-width:0;border:1px solid #e2eaf5;border-radius:15px;
  background:#fff;padding:clamp(18px,2.2vw,28px);
  box-shadow:0 5px 20px rgba(23,52,99,.045);
}
#projects-dialog.projects-template-studio .sfera-template-settings__heading{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:15px;margin-bottom:22px;padding:0 0 16px;
  border-bottom:1px solid #e8eef7;background:#fff!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__heading h3{
  margin:0!important;font:650 17px/1.3 Poppins,sans-serif!important;color:#153869!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__heading p{
  margin:5px 0 0;color:#889ab1;font:450 11px/1.45 "Open Sans",sans-serif;
}
#projects-dialog.projects-template-studio .sfera-template-settings__count{
  align-self:center;flex:0 0 auto;
  padding:8px 11px;border-radius:10px;background:#edf5ff;
  color:#2868b0;font:600 10px "Open Sans",sans-serif;
}
#projects-dialog.projects-template-studio .sfera-template-settings__form{width:100%;min-width:0}
#projects-dialog.projects-template-studio .sfera-template-settings__grid{
  display:grid;grid-template-columns:minmax(0,1.5fr) minmax(180px,.56fr) minmax(190px,.75fr);
  gap:18px;align-items:start;
}
#projects-dialog.projects-template-studio .sfera-template-settings__description{
  grid-column:1/span 2;
}
#projects-dialog.projects-template-studio .sfera-template-settings__description textarea{
  min-height:115px!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__active{
  grid-column:3;align-self:end;min-height:68px;
}
#projects-dialog.projects-template-studio .sfera-template-settings__note{
  display:flex;align-items:center;gap:8px;
  margin:18px 0 0!important;padding:12px 0 0!important;
  border-top:1px solid #e9eef6;color:#7c93a9;
  font:500 10px/1.4 "Open Sans",sans-serif;
}
#projects-dialog.projects-template-studio .sfera-template-settings__note>svg{
  width:16px;height:16px;stroke:#258d6c;fill:none;stroke-width:2;
}

/* Replace the long flat task list with macrosection + parent/microtask tree. */
#projects-dialog.projects-template-studio .sfera-template-task-nav__list.sfera-template-tree{
  display:block!important;align-content:unset!important;
  gap:0!important;padding:0 6px 10px!important;
  margin:0 6px 8px!important;min-height:0!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__group{
  margin:0 0 9px!important;border:0!important;background:transparent!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__group-heading{
  display:flex!important;align-items:center!important;gap:8px!important;
  width:100%;min-height:38px!important;margin:0 0 3px!important;
  padding:8px 10px!important;text-align:left;
  border:0!important;border-radius:9px!important;
  background:#f4f8fd!important;color:#355b87!important;
  font:650 10.5px/1.3 Poppins,sans-serif!important;box-shadow:none!important;
  transition:background .15s ease!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__group-heading:hover{
  background:#eaf3ff!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__group-heading>svg{
  display:block;flex:0 0 15px;width:15px;height:15px;
  stroke:#5e86ba;fill:none;stroke-width:2;transition:transform .15s;
}
#projects-dialog.projects-template-studio .sfera-template-tree__group-heading[aria-expanded="false"]>svg{
  transform:rotate(-90deg);
}
#projects-dialog.projects-template-studio .sfera-template-tree__group-heading>span{
  flex:1;min-width:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;
}
#projects-dialog.projects-template-studio .sfera-template-tree__group-heading>small{
  padding:3px 6px;border-radius:6px;background:#e2edf9;
  color:#416b9a;font:650 9px Poppins,sans-serif;
}
#projects-dialog.projects-template-studio .sfera-template-tree__group-body[hidden],
#projects-dialog.projects-template-studio .sfera-template-tree__children[hidden]{
  display:none!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__node{
  min-width:0;margin:0;
}
#projects-dialog.projects-template-studio .sfera-template-tree__row{
  display:flex;align-items:center;gap:3px;
  padding-left:calc(7px * var(--tree-depth,0));
  border-radius:9px;
}
#projects-dialog.projects-template-studio .sfera-template-tree__toggle,
#projects-dialog.projects-template-studio .sfera-template-tree__spacer{
  display:grid;place-items:center;flex:0 0 25px;
  width:25px;height:34px;min-width:25px;min-height:34px;
  padding:0;margin:0;border:0;background:transparent;color:#6d8cae;
  border-radius:7px;box-shadow:none;
}
#projects-dialog.projects-template-studio .sfera-template-tree__toggle:hover{
  background:#eaf3ff;color:#1e65b8;
}
#projects-dialog.projects-template-studio .sfera-template-tree__toggle svg{
  width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;
  transition:transform .15s ease;
}
#projects-dialog.projects-template-studio .sfera-template-tree__toggle[aria-expanded="false"] svg{
  transform:rotate(-90deg);
}
#projects-dialog.projects-template-studio .sfera-template-tree__node .sfera-template-task-nav__item{
  display:flex!important;flex:1 1 auto;align-items:center!important;justify-content:space-between!important;
  gap:9px!important;min-width:0!important;min-height:48px!important;
  padding:8px 10px!important;
  border:1px solid transparent!important;border-radius:9px!important;
  background:transparent!important;text-align:left!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__node .sfera-template-task-nav__item.is-selected{
  border-color:#c9def7!important;background:#eaf4ff!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__node .sfera-template-task-nav__item:hover{
  background:#f3f8ff!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__node .sfera-template-task-nav__copy strong{
  font:600 10.5px/1.3 Poppins,sans-serif!important;
  white-space:normal!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__node .sfera-template-task-nav__copy small{
  font:450 9px/1.35 "Open Sans",sans-serif!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__node .sfera-template-task-nav__state{
  flex:0 0 7px;
}
#projects-dialog.projects-template-studio .sfera-template-tree__children{
  position:relative;padding:0 0 0 10px;margin:0 0 4px 12px;
  border-left:1px solid #dfeaf7;
}
#projects-dialog.projects-template-studio .sfera-template-tree__children .sfera-template-task-nav__item{
  min-height:41px!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__children .sfera-template-task-nav__copy strong{
  font-weight:500!important;
}

/* Chosen main task: editor + children summary. Chosen microtask: focused editor. */
#projects-dialog.projects-template-studio .sfera-template-editor__header,
#projects-dialog.projects-template-studio .sfera-template-editor>header.sfera-template-editor__header{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  background:#fff!important;background-image:none!important;
  border-bottom:1px solid #e8eef6!important;border-radius:15px 15px 0 0!important;
  color:#15386b!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__heading h3{
  color:#0e2166!important;
  font:650 18px/1.3 Poppins,sans-serif!important;
  overflow-wrap:anywhere;
}
#projects-dialog.projects-template-studio .sfera-template-editor__heading .sfera-template-label{
  color:#6d94bf!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__heading p{
  color:#879ab1!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__parent-link{
  display:inline!important;min-width:0!important;min-height:0!important;
  padding:0!important;margin:0!important;background:transparent!important;
  border:0!important;box-shadow:none!important;color:#216cb6!important;
  font:600 10.5px "Open Sans",sans-serif!important;text-decoration:underline;
  text-underline-offset:2px;
}
#projects-dialog.projects-template-studio .sfera-template-related{
  grid-column:1/-1;
}
#projects-dialog.projects-template-studio .sfera-template-related__list{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
}
#projects-dialog.projects-template-studio .sfera-template-related__list button{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-width:0;min-height:42px;padding:9px 11px;
  border:1px solid #e2eaf4;border-radius:10px;
  background:#f8faff;color:#2b5685;
  text-align:left;font:550 10.5px/1.3 "Open Sans",sans-serif;
  transition:background .14s,border-color .14s;
}
#projects-dialog.projects-template-studio .sfera-template-related__list button:hover{
  background:#eef6ff;border-color:#b9d7f6;
}
#projects-dialog.projects-template-studio .sfera-template-related__list button>span{
  display:flex;align-items:center;gap:8px;min-width:0;
  overflow-wrap:anywhere;
}
#projects-dialog.projects-template-studio .sfera-template-related__list svg{
  flex:0 0 15px;width:15px;height:15px;stroke:#2d7ccd;fill:none;stroke-width:1.8;
}
#projects-dialog.projects-template-studio .sfera-template-related__list button>svg{
  transform:rotate(-90deg);
}

/* Responsive: card row stays one row by deliberate horizontal scrolling when needed. */
@media(max-width:1250px){
  #projects-view .projects-health-feature--compact .projects-health-feature__identity{
    grid-template-columns:minmax(120px,.76fr) minmax(235px,1.65fr) 40px!important;
    gap:12px!important;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__facts>div{
    min-width:110px;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__grid{
    grid-template-columns:minmax(0,1fr) minmax(160px,.55fr);
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__mode{grid-column:2}
  #projects-dialog.projects-template-studio .sfera-template-settings__description{grid-column:1}
  #projects-dialog.projects-template-studio .sfera-template-settings__active{grid-column:2}
}
@media(max-width:1080px){
  #projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail{
    display:grid!important;grid-auto-flow:column!important;
    grid-template-columns:none!important;grid-auto-columns:minmax(174px,1fr)!important;
    overflow-x:auto!important;padding:0 0 8px!important;
    scroll-snap-type:x proximity;scrollbar-width:thin;
  }
  #projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail>.projects-kpi{
    scroll-snap-align:start;
  }
  #projects-view .projects-shell--detail .sfera-pd-history-layout{
    grid-template-columns:minmax(0,2fr) minmax(230px,1fr);
  }
}
@media(max-width:840px){
  #projects-view .projects-health-feature--compact .projects-health-feature__identity{
    grid-template-columns:minmax(0,1fr) 40px!important;
  }
  #projects-view .projects-health-feature--compact .projects-health-feature__total{
    grid-column:1;grid-row:1;padding:0;border:0;
  }
  #projects-view .projects-health-feature--compact .projects-feature-icon{
    grid-column:2;grid-row:1;
  }
  #projects-view .projects-health-feature--compact .projects-health-feature__statuses{
    grid-column:1/-1;grid-row:2;
  }
  #projects-view .projects-shell--detail .sfera-pd-history-layout{
    grid-template-columns:minmax(0,1fr);
  }
  #projects-view .projects-shell--detail .sfera-pd-history-insights{
    position:static;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__facts>div{
    max-width:none;min-width:calc(50% - 12px);
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__grid{
    grid-template-columns:minmax(0,1fr) minmax(150px,.65fr);
  }
}
@media(max-width:640px){
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-overview{
    gap:10px!important;
  }
  #projects-view .projects-shell--detail .projects-detail__top.sfera-pd-hero{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__facts{
    gap:10px 0;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__facts>div{
    flex:0 0 50%;min-width:0;padding:0 10px;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__facts>div:nth-child(odd){
    padding-left:0;border-left:0;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__grid{
    grid-template-columns:minmax(0,1fr);gap:14px;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__grid>*{
    grid-column:1!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__heading{
    flex-wrap:wrap;
  }
  #projects-dialog.projects-template-studio .sfera-template-related__list{
    grid-template-columns:minmax(0,1fr);
  }
  #projects-dialog.projects-template-studio .sfera-template-task-nav{
    max-height:330px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #projects-view .projects-shell--detail .sfera-pd-history-insights__days i,
  #projects-view .projects-shell--detail .sfera-pd-history-insights__track i,
  #projects-view .projects-shell--detail .sfera-pd-metrics.projects-kpis--detail>.projects-kpi,
  #projects-dialog.projects-template-studio .sfera-template-tree__toggle svg{
    animation:none!important;transition:none!important;
  }
}
