.ds-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  background: var(--ds-color-bg-deep);
  color: var(--ds-color-text);
  font-family: var(--ds-font-family);
}
.ds-app__main { min-width: 0; min-height: 100vh; }
.ds-sidebar {
  position: sticky; top: 0; z-index: 100; height: 100vh;
  padding: var(--ds-space-5) var(--ds-space-4);
  display: flex; flex-direction: column; overflow-y: auto;
  border-right: 1px solid var(--ds-color-border);
  background: linear-gradient(180deg, #0d1930 0%, #07111f 100%);
  box-shadow: 12px 0 35px rgba(0, 0, 0, .18);
}
.ds-sidebar__brand {
  min-height: 3.5rem; padding: 0 var(--ds-space-2) var(--ds-space-5);
  display: flex; align-items: center; gap: var(--ds-space-3);
  border-bottom: 1px solid var(--ds-color-border);
  color: var(--ds-color-text); text-decoration: none;
}
.ds-sidebar__logo {
  width: 2.5rem; height: 2.5rem; flex: 0 0 auto; display: block; object-fit: contain;
  border-radius: .75rem; background: white; box-shadow: 0 8px 20px rgba(239, 68, 68, .22);
}

/* Moduli MATEC HUB: aspetto e unità di misura condivisi */
.input-with-unit {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--ds-color-border, #334155);
  border-radius: .75rem;
  overflow: hidden;
  background: #07101f;
}
.input-with-unit:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
.input-with-unit > input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.input-with-unit > span {
  display: inline-flex;
  align-items: center;
  padding: 0 .85rem;
  border-left: 1px solid #334155;
  background: #111c30;
  color: #a8b6ca;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}
.ds-sidebar__brand-copy { min-width: 0; display: flex; flex-direction: column; }
.ds-sidebar__brand-copy strong { font-size: .95rem; }
.ds-sidebar__brand-copy small { margin-top: .1rem; color: var(--ds-color-text-muted); font-size: .68rem; }
.ds-sidebar__nav { flex: 1; display: flex; flex-direction: column; padding-top: var(--ds-space-4); }
.ds-sidebar__group { display: flex; flex-direction: column; gap: var(--ds-space-1); margin-bottom: var(--ds-space-5); }
.ds-sidebar__group--bottom { margin-top: auto; margin-bottom: 0; }
.ds-sidebar__group-title { padding: var(--ds-space-2) var(--ds-space-3); color: var(--ds-color-text-disabled); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ds-sidebar__nav a {
  min-height: 2.75rem; padding: 0 var(--ds-space-3); border: 1px solid transparent;
  border-radius: var(--ds-radius-control); display: flex; align-items: center; gap: var(--ds-space-3);
  color: var(--ds-color-text-secondary); text-decoration: none; font-size: var(--ds-font-size-sm); font-weight: 650;
  transition: color var(--ds-transition), background var(--ds-transition), border-color var(--ds-transition);
}
.ds-sidebar__nav a > span:first-child { width: 1.4rem; flex: 0 0 auto; color: #93c5fd; text-align: center; font-size: 1.05rem; }
.ds-sidebar__nav a:hover { border-color: var(--ds-color-border); background: rgba(255,255,255,.05); color: white; }
.ds-sidebar__nav a.active { border-color: rgba(59,130,246,.35); background: linear-gradient(135deg,rgba(37,99,235,.26),rgba(6,182,212,.12)); color: white; }
@media (max-width: 980px) {
  .ds-app { grid-template-columns: 5.25rem minmax(0, 1fr); }
  .ds-sidebar { padding-inline: .65rem; }
  .ds-sidebar__brand { justify-content: center; padding-inline: 0; }
  .ds-sidebar__brand-copy, .ds-sidebar__group-title, .ds-sidebar__nav a > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .ds-sidebar__nav a { justify-content: center; padding: 0; }
  .ds-sidebar__nav a > span:first-child { width: auto; }
}
@media (max-width: 520px) {
  .ds-app { grid-template-columns: 4.25rem minmax(0, 1fr); }
  .ds-sidebar { padding-inline: .4rem; }
  .ds-sidebar__logo { width: 2.25rem; height: 2.25rem; }
}
