/* Sfera CRM | Progetti landing v2.30.1
   Restyles the project directory only. Project details and forms are untouched.
   Colors follow the approved Sfera dashboard; no new palette or data contracts. */
#signed-in.app-shell .app-topbar .sfera-projects-topbar__search > .sr-only {
  display:none!important; /* input already has its own accessible aria-label */
}
#signed-in.app-shell .app-topbar .sfera-projects-topbar__search {
  max-width:min(370px,34vw);
}
#signed-in.app-shell .app-topbar .sfera-projects-topbar__search input[type="search"] {
  flex:1 1 auto;min-width:0!important;text-overflow:ellipsis;
}

#projects-view .projects-shell:not(.projects-shell--detail) {
  padding:13px clamp(12px,1.65vw,24px) 26px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs {
  display:inline-flex!important;align-items:center!important;gap:3px!important;
  width:max-content;max-width:100%;min-height:0!important;
  padding:4px!important;margin:0 0 14px!important;
  border:1px solid #e2eaf5!important;border-radius:12px!important;
  background:#edf2f9!important;box-shadow:none!important;
  overflow-x:auto;scrollbar-width:none;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs::-webkit-scrollbar {display:none}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button {
  display:inline-flex!important;align-items:center;gap:7px!important;
  flex:0 0 auto!important;min-width:0!important;min-height:36px!important;
  padding:8px 16px!important;margin:0!important;
  border:0!important;border-radius:9px!important;background:transparent!important;
  box-shadow:none!important;color:#657a9b!important;
  font:600 12px/1.25 Poppins,"Open Sans",sans-serif!important;
  white-space:nowrap;transition:background .16s ease,color .16s ease,box-shadow .16s ease!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button[hidden] {
  display:none!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button::after {
  content:none!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button:hover {
  color:#0e2166!important;background:rgba(255,255,255,.65)!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button[aria-selected="true"] {
  background:#fff!important;color:#0e2166!important;
  box-shadow:0 2px 7px rgba(20,48,91,.09)!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button:focus-visible {
  outline:2px solid #0b7ff0!important;outline-offset:-2px;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button > svg {
  width:16px!important;height:16px!important;flex-basis:16px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs .admin-restricted-key {
  display:none!important; /* admin-only views already enforce access and visibility */
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-state:empty {
  display:none!important;
}

/* A single compact metric rail replaces six tall cards in a large white box. */
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview {
  display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:0!important;margin:0 0 16px!important;padding:0!important;
  border:1px solid #e3ebf5!important;border-radius:15px!important;
  background:#fff!important;box-shadow:0 5px 20px rgba(18,49,97,.045)!important;
  overflow:hidden;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi {
  display:flex!important;flex-direction:column!important;justify-content:flex-start!important;
  grid-column:auto!important;min-width:0!important;min-height:0!important;
  padding:12px 14px 13px!important;margin:0!important;
  border:0!important;border-right:1px solid #edf1f7!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;transform:none!important;
  overflow:visible;transition:background-color .17s ease!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi:last-child {
  border-right:0!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi:hover {
  background:#f7faff!important;transform:none!important;box-shadow:none!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi__top {
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  min-width:0;gap:7px!important;margin:0 0 5px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi__top small {
  display:block!important;min-width:0;margin:0!important;
  color:#6b7e9b!important;font:600 11px/1.3 "Open Sans",sans-serif!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi__symbol {
  display:grid;place-items:center;flex:0 0 25px!important;
  width:25px!important;min-width:25px!important;height:25px!important;
  border-radius:8px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi__symbol svg {
  width:13px!important;height:13px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi strong {
  display:block!important;margin:0!important;
  font:650 clamp(24px,1.9vw,30px)/1.15 Poppins,"Open Sans",sans-serif!important;
  font-variant-numeric:tabular-nums!important;letter-spacing:-.025em;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi > span {
  display:block!important;margin:3px 0 0!important;
  color:#8493a8!important;font:450 10px/1.35 "Open Sans",sans-serif!important;
  overflow-wrap:break-word;
}

/* Filters and table belong together, rather than sitting below oversized cards. */
#projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar--portfolio {
  display:flex!important;align-items:center!important;flex-wrap:wrap!important;
  gap:8px 10px!important;padding:0 0 11px!important;margin:0 0 10px!important;
  border:0!important;border-bottom:1px solid #e5ecf5!important;
  background:transparent!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar__intro {
  min-width:160px;margin-right:auto;gap:1px;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar__intro strong {
  font-size:14px!important;line-height:1.3!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar--portfolio select,
#projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar--portfolio [data-project-action="rebuild"] {
  min-height:35px!important;height:35px!important;font-size:11px!important;
  border-radius:9px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar--portfolio select {
  min-width:146px!important;width:auto!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar--portfolio :is(select,button):focus-visible {
  outline:2px solid #0b7ff0!important;outline-offset:2px;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-table-wrap {
  border-radius:12px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-table thead th {
  padding:11px 12px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-table td {
  padding:11px 12px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-project-identity__mark {
  width:31px;height:31px;flex-basis:31px;border-radius:9px;font-size:13px;
}

/* Statistics and template views share the navigation/rail density, not identical cards. */
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stats-grid--showcase {
  gap:13px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-stat-panel {
  padding:18px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-template-card--showcase {
  min-height:0!important;
}

@media(max-width:1320px) {
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi:nth-child(3n) {
    border-right:0!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi:nth-child(-n+3) {
    border-bottom:1px solid #edf1f7!important;
  }
}
@media(max-width:900px) {
  #projects-view .projects-shell:not(.projects-shell--detail) {padding:12px 10px 22px!important}
  #signed-in.app-shell .app-topbar .sfera-projects-topbar__search {
    max-width:min(270px,30vw);
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi {
    padding:12px!important;
  }
}
@media(max-width:780px) {
  /* Search is a full-width popover on phones, not the desktop compact field. */
  #signed-in.app-shell .app-topbar .sfera-projects-topbar__search {
    max-width:none;
  }
}
@media(max-width:680px) {
  #projects-view .projects-shell:not(.projects-shell--detail) {
    padding:10px 0 20px!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs {
    display:flex!important;width:100%;box-sizing:border-box;
    margin-bottom:11px!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button {
    justify-content:center!important;flex:1 1 0!important;
    padding:8px 7px!important;min-height:37px!important;font-size:10.5px!important;
    gap:5px!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button > svg {
    width:14px!important;height:14px!important;flex-basis:14px!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    margin-bottom:12px!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi {
    padding:10px 11px 11px!important;min-height:92px!important;
    border-right:1px solid #edf1f7!important;border-bottom:1px solid #edf1f7!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi:nth-child(2n) {
    border-right:0!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi:nth-last-child(-n+2) {
    border-bottom:0!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi strong {
    font-size:25px!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar__intro {
    flex:1 1 100%;margin:0 0 2px;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar--portfolio select {
    min-width:0!important;flex:1 1 120px;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-toolbar--portfolio [data-project-action="rebuild"] {
    flex:0 1 auto;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-table tbody td {
    padding:0!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-template-card--showcase {
    min-height:0!important;
  }
}
@media(max-width:420px) {
  #projects-view .projects-shell:not(.projects-shell--detail) > .projects-tabs button {
    font-size:10px!important;padding:8px 5px!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi__top small {
    font-size:10px!important;
  }
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview .projects-kpi__symbol {
    width:22px!important;min-width:22px!important;height:22px!important;flex-basis:22px!important;
  }
}
@media(prefers-reduced-motion:reduce) {
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-tabs button,
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-kpis--overview > .projects-kpi {
    transition:none!important;
  }
}
