:root { --mud-palette-primary: #1565c0; }
body { margin: 0; font-family: Roboto, Helvetica, Arial, sans-serif; }

.app-shell-drawer-container {
  min-height: calc(100vh - 64px);
}

.app-shell-drawer-container > .mud-drawer {
  width: 250px;
  min-width: 250px;
  flex: 0 0 250px;
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .app-shell-drawer-container > .mud-drawer {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }
}

.app-shell-drawer-container,
.app-shell-drawer-container .mud-main-content,
.app-shell-content {
  min-width: 0;
}

.app-shell-drawer-container .mud-main-content,
.mud-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.app-shell-drawer-container .mud-main-content {
  flex: 1 1 auto;
}

.app-shell-content {
  min-width: 0;
  min-height: calc(100vh - 64px);
  padding: 24px;
}

.brand-toggle {
  height: 42px;
  width: 42px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.brand-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}

.brand-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.brand-toggle__icon {
  width: 26px;
  height: 26px;
  display: block;
}

/* Force Font Awesome icons for MudBlazor buttons when set with fa- classes */
.mud-icon, .mud-icon-root, .mud-icon-button .mud-icon {
  font-family: "Font Awesome 6 Free", "Material Icons", sans-serif !important;
}

.mud-icon.fa-solid,
.mud-icon.fa-regular,
.mud-icon.fa-brands {
  font-family: "Font Awesome 6 Free", sans-serif !important;
}

.desktop-view { display: block; }
.mobile-view { display: none; }
@media (max-width: 960px) {
  .desktop-view { display: none; }
  .mobile-view { display: block; }
}

.attivita-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 12px;
}

.attivita-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(21, 101, 192, 0.10), transparent 35%),
    linear-gradient(135deg, #ffffff, #f7fbff);
  border: 1px solid rgba(21, 101, 192, 0.10);
}

.attivita-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attivita-hero__subtitle {
  max-width: 720px;
  color: rgba(0, 0, 0, 0.60);
}

.attivita-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.attivita-stats {
  margin-top: 0;
}

.attivita-stat {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

.attivita-stat--danger {
  background: linear-gradient(180deg, #fff7f7, #ffffff);
}

.attivita-stat--warning {
  background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.attivita-stat--info {
  background: linear-gradient(180deg, #f5faff, #ffffff);
}

.attivita-controls {
  padding: 20px;
  border-radius: 18px;
}

.attivita-controls__top {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-end;
}

.attivita-search {
  flex: 1 1 520px;
}

.attivita-controls__buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.attivita-chipbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.attivita-controls__filters {
  margin-top: 8px;
}

.attivita-table-wrap {
  border-radius: 18px;
}

@media (max-width: 960px) {
  .attivita-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .attivita-controls__top {
    flex-direction: column;
    align-items: stretch;
  }

  .attivita-controls__buttons {
    justify-content: flex-end;
  }
}

.cliente-form-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 12px;
}

.cliente-form-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(21, 101, 192, 0.10), transparent 36%),
    linear-gradient(135deg, #ffffff, #f7fbff);
  border: 1px solid rgba(21, 101, 192, 0.10);
}

.cliente-form-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cliente-form-hero__subtitle {
  max-width: 760px;
  color: rgba(0, 0, 0, 0.62);
}

.cliente-form-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cliente-form-card {
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, #ffffff, #fcfdff);
}

.cliente-form-section-note {
  color: rgba(0, 0, 0, 0.60);
  margin-top: 4px;
}

.cliente-form-section-icon {
  color: var(--mud-palette-primary);
  width: 18px;
  text-align: center;
}

.cliente-form-aside {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f5faff, #ffffff);
  border: 1px solid rgba(21, 101, 192, 0.10);
}

.cliente-sedi-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.cliente-sede-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(21, 101, 192, 0.10);
  background: #f9fbfe;
}

.cliente-sede-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cliente-sedi-empty {
  margin-top: 18px;
  padding: 18px;
  border-radius: 16px;
  background: #f7f8fa;
  border: 1px dashed rgba(0, 0, 0, 0.12);
}

.cliente-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.cliente-detail-note-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(21, 101, 192, 0.10);
  background: linear-gradient(180deg, #f9fbfe, #ffffff);
}

.cliente-defunti-shell {
  border-radius: 18px;
}

.cliente-defunti-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.cliente-defunti-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cliente-defunti-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cliente-defunto-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(21, 101, 192, 0.10);
  background: linear-gradient(180deg, #f9fbfe, #ffffff);
}

.cliente-defunto-card__head,
.cliente-defunto-card__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cliente-defunto-card__identity {
  min-width: 0;
}

.cliente-defunto-card__view {
  flex: 0 0 auto;
  min-width: 42px;
}

.cliente-defunto-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cliente-defunto-card__toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.cliente-defunto-card__toggle-row {
  padding: 4px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.cliente-defunto-card__actions {
  margin-top: 14px;
  align-items: stretch;
}

.cliente-defunto-card__actions .mud-button-root {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
}

.cliente-detail-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.cliente-detail-actions .mud-button-root {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 700;
}

@media (max-width: 960px) {
  .cliente-form-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .cliente-sede-card__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .cliente-defunti-toolbar,
  .cliente-defunto-card__head,
  .cliente-defunto-card__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .cliente-defunti-toolbar__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .cliente-defunto-card {
    padding: 14px;
  }

  .cliente-defunto-card__head {
    align-items: flex-start;
  }

  .cliente-defunto-card__view {
    align-self: flex-end;
    margin-top: -6px;
  }

  .cliente-defunto-card__meta .mud-chip {
    margin: 0;
  }

  .cliente-defunto-card__actions {
    width: 100%;
  }

  .cliente-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cliente-detail-actions .mud-button-root {
    width: 100%;
    min-height: 46px;
    padding-inline: 12px;
    font-size: 0.82rem;
  }
}

.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Roboto", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(198, 214, 255, 0.24), transparent 22%),
    radial-gradient(circle at 85% 18%, rgba(177, 207, 199, 0.20), transparent 24%),
    radial-gradient(circle at 18% 88%, rgba(220, 228, 242, 0.18), transparent 22%),
    linear-gradient(135deg, #fbfcfe, #f3f6fb 52%, #f7faf8);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.login-stage {
  width: 100%;
  max-width: 1220px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
  gap: 24px;
  align-items: stretch;
}

.login-showcase,
.login-panel {
  position: relative;
  overflow: hidden;
}

.login-panel {
  width: 100%;
  max-width: none;
  padding: 36px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.login-showcase {
  padding: 42px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top left, rgba(191, 219, 254, 0.24), transparent 24%),
    radial-gradient(circle at bottom right, rgba(167, 243, 208, 0.16), transparent 24%),
    linear-gradient(150deg, #0f172a, #13233d 44%, #1d4ed8 100%);
  color: #f8fbff;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.24);
}

.login-showcase::before,
.login-showcase::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.login-showcase::before {
  width: 280px;
  height: 280px;
  top: -90px;
  right: -60px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 66%);
}

.login-showcase::after {
  width: 240px;
  height: 240px;
  left: -80px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(251,191,36,0.18), transparent 64%);
}

.login-showcase__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.login-showcase__mark {
  margin-top: 28px;
}

.login-showcase__mark img {
  width: 64px;
  height: 64px;
  display: block;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-showcase h1 {
  margin: 28px 0 0;
  max-width: 680px;
  font-size: clamp(34px, 4.5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.login-showcase__lead {
  max-width: 600px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 18px;
  line-height: 1.75;
}

.login-showcase__feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 34px;
  max-width: 640px;
}

.login-showcase-feature {
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.login-showcase-feature:first-child {
  padding-top: 0;
}

.login-showcase-feature:last-child {
  border-bottom: 0;
}

.login-showcase-feature__eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.login-showcase-feature strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  line-height: 1.35;
}

.login-showcase__footer {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.login-showcase__signature {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-showcase__signature-note {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 14px;
}

.login-panel__brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-panel__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(219, 234, 254, 0.32), transparent 30%),
    radial-gradient(circle at bottom right, rgba(209, 250, 229, 0.22), transparent 28%),
    linear-gradient(135deg, #ffffff, #f5f9ff);
  border: 1px solid rgba(191, 219, 254, 0.22);
}

.login-panel__logo {
  width: min(100%, 360px);
  height: auto;
  display: block;
}

.login-panel__brand h1 {
  margin: 2px 0 4px;
  font-size: 34px;
  line-height: 1.1;
  color: #0f172a;
}

.login-panel__brand h2 {
  margin: 2px 0 4px;
  font-size: 32px;
  line-height: 1.08;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.login-panel__brand p {
  margin: 0;
  color: rgba(15, 23, 42, 0.62);
  font-size: 15px;
  line-height: 1.6;
}

.login-panel__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563eb;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.login-field input {
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.86);
  font-size: 15px;
}

.login-field input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.login-submit {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.login-submit:hover {
  filter: brightness(1.03);
}

.login-error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(211, 47, 47, 0.08);
  color: #b71c1c;
  border: 1px solid rgba(211, 47, 47, 0.18);
}

.login-help {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.58);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .login-shell {
    padding: 18px;
  }

  .login-stage {
    display: block;
    max-width: 520px;
  }

  .login-showcase {
    display: none;
  }

  .login-panel {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .login-panel__brand h1,
  .login-panel__brand h2 {
    font-size: 29px;
  }
}

@media (max-width: 1100px) {
  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-showcase {
    padding: 30px 24px;
  }
}

.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.dashboard-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
}

.dashboard-greeting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.dashboard-greeting__eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 8px;
}

.dashboard-greeting__subtitle {
  margin-top: 6px;
  color: rgba(0,0,0,0.58);
}

.dashboard-greeting__pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.14);
  color: #0f172a;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 22px;
  padding: 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(124, 77, 255, 0.22), transparent 26%),
    radial-gradient(circle at bottom right, rgba(0, 188, 212, 0.18), transparent 24%),
    linear-gradient(135deg, #10162f, #172554 48%, #1d4ed8);
  color: #fff;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.24);
}

.dashboard-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-hero__eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.dashboard-hero__subtitle {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.dashboard-btn-icon {
  margin-right: 8px;
}

.dashboard-hero__spotlight {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.dashboard-spotlight__panel {
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
}

.dashboard-spotlight__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-spotlight__kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.dashboard-spotlight__headline {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.dashboard-spotlight__total {
  min-width: 128px;
  border: 0;
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}

.dashboard-spotlight__total span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.dashboard-spotlight__total strong {
  font-size: 42px;
  line-height: 1;
  color: #fff;
}

.dashboard-spotlight__total:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.18);
}

.dashboard-spotlight__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-badge-card {
  border: 0;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  cursor: pointer;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-spotlight__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-spotlight__legend-item {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.10);
}

.dashboard-spotlight__legend-item--warning {
  color: #fda4af;
}

.dashboard-spotlight__legend-item--info {
  color: #7dd3fc;
}

.dashboard-spotlight__legend-item--success {
  color: #6ee7b7;
}

.dashboard-badge-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-badge-card span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.70);
}

.dashboard-badge-card strong {
  font-size: 34px;
  line-height: 1;
  color: #fff;
  flex: 0 0 auto;
}

.dashboard-badge-card small {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.45;
}

.dashboard-badge-card--warm { background: rgba(251, 191, 36, 0.16); }
.dashboard-badge-card--cool { background: rgba(56, 189, 248, 0.16); }
.dashboard-badge-card--mint { background: rgba(52, 211, 153, 0.16); }

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metric-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  width: 100%;
  border: 0;
  gap: 14px;
  padding: 20px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.12);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  align-items: center;
  justify-items: start;
}

.metric-card:hover,
.dashboard-badge-card:hover,
.dashboard-focus-card__item:hover,
.dashboard-bars__row:hover,
.dashboard-mini-list__item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.18);
}

.metric-card__media {
  width: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-self: center;
}

.metric-card__icon {
  height: 52px;
  width: 52px;
  min-width: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  align-self: center;
}

.metric-card--violet .metric-card__icon { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.metric-card--amber .metric-card__icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.metric-card--cyan .metric-card__icon { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.metric-card--emerald .metric-card__icon { background: linear-gradient(135deg, #059669, #34d399); }

.metric-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.metric-card__label {
  font-size: 13px;
  color: rgba(0,0,0,0.52);
}

.metric-card__value {
  font-size: 34px;
  line-height: 1.05;
}

.metric-card__note {
  font-size: 13px;
  color: rgba(0,0,0,0.52);
}

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.dashboard-main__primary,
.dashboard-main__aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-panel {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.10);
}

.dashboard-mini-list__item--accent {
  background: linear-gradient(180deg, #f8faff, #ffffff);
  border: 1px solid rgba(37, 99, 235, 0.10);
}

.dashboard-panel--dark {
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 24%),
    linear-gradient(160deg, #111827, #0f172a 55%, #111827);
}

.dashboard-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-panel__head--light .mud-typography,
.dashboard-panel--dark .mud-typography {
  color: inherit;
}

.dashboard-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-timeline__item {
  width: 100%;
  border: 0;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 110px;
  gap: 14px;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  background: #f8fbff;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-timeline__item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(59, 130, 246, 0.12);
}

.dashboard-timeline__item--danger { background: rgba(254, 226, 226, 0.72); }
.dashboard-timeline__item--warning { background: rgba(254, 243, 199, 0.74); }
.dashboard-timeline__item--normal { background: rgba(239, 246, 255, 0.96); }

.dashboard-timeline__date span,
.dashboard-timeline__meta,
.dashboard-timeline__desc,
.dashboard-timeline__status {
  font-size: 13px;
  color: rgba(0,0,0,0.56);
}

.dashboard-timeline__date strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  color: #111827;
}

.dashboard-timeline__title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.dashboard-timeline__desc {
  margin-top: 5px;
}

.dashboard-timeline__status {
  align-self: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  font-weight: 700;
}

.dashboard-timeline__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
}

.dashboard-timeline__done {
  height: 38px;
  width: 38px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(34, 197, 94, 0.24);
}

.dashboard-grid-two {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-mini-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-mini-list__item {
  display: flex;
  width: 100%;
  border: 0;
  background: transparent;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.dashboard-mini-list__item strong {
  display: block;
  margin-bottom: 4px;
}

.dashboard-mini-list__item div:last-child,
.dashboard-mini-list__item > span,
.dashboard-mini-list__item div > div {
  color: rgba(0,0,0,0.58);
}

.dashboard-mini-list__item--danger strong {
  color: #b91c1c;
}

.dashboard-focus-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.dashboard-focus-card--single {
  margin-bottom: 14px;
}

.dashboard-focus-card__item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.10);
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
}

.dashboard-focus-card__item:disabled {
  opacity: 0.65;
  cursor: default;
}

.dashboard-focus-card__item--static {
  cursor: default;
}

.dashboard-focus-card__meta {
  margin-top: 8px;
  color: rgba(255,255,255,0.74);
  font-size: 14px;
}

.dashboard-focus-card__item span {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-focus-card__item strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
}

.dashboard-action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-bars__row {
  display: grid;
  width: 100%;
  border: 0;
  background: transparent;
  grid-template-columns: 56px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.dashboard-bars__label,
.dashboard-bars__value {
  font-size: 13px;
  color: rgba(0,0,0,0.62);
}

.dashboard-bars__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.20);
  overflow: hidden;
}

.dashboard-bars__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #38bdf8);
}

.dashboard-empty {
  padding: 28px;
  border-radius: 18px;
  background: #f7f8fa;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  color: rgba(0,0,0,0.58);
  text-align: center;
}

.dashboard-empty--compact {
  padding: 16px;
}

@media (max-width: 1280px) {
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .dashboard-greeting {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .dashboard-hero__spotlight {
    width: 100%;
  }

  .dashboard-spotlight__header {
    flex-direction: column;
  }

  .dashboard-spotlight__total {
    width: 100%;
  }

  .dashboard-spotlight__grid {
    width: 100%;
  }

  .dashboard-metrics,
  .dashboard-grid-two {
    grid-template-columns: 1fr;
  }

  .dashboard-timeline__item {
    grid-template-columns: 1fr;
  }

  .dashboard-timeline__status {
    justify-self: start;
  }
}

@media (max-width: 768px) {
  .app-shell-content {
    padding: 16px;
  }

  .mud-drawer {
    width: min(88vw, 320px);
  }

  .app-shell-appbar {
    padding-inline: 10px;
  }

  .app-shell-appbar .mud-chip {
    display: none;
  }

  .app-shell-appbar .mud-button-root,
  .app-shell-appbar .mud-icon-button {
    min-width: 40px;
  }

  .app-shell-appbar .mud-button-root {
    padding-inline: 10px;
  }

  .attivita-hero,
  .agenda-hero,
  .planning-hero,
  .cliente-form-hero,
  .dashboard-panel,
  .dashboard-hero,
  .login-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .attivita-hero__actions,
  .agenda-hero__actions,
  .planning-hero__actions,
  .cliente-form-hero__actions,
  .dashboard-hero__actions {
    width: 100%;
  }

  .attivita-hero__actions > *,
  .agenda-hero__actions > *,
  .planning-hero__actions > *,
  .cliente-form-hero__actions > *,
  .dashboard-hero__actions > * {
    width: 100%;
  }

  .attivita-controls,
  .agenda-toolbar,
  .planning-toolbar,
  .agenda-backlog,
  .planning-backlog {
    padding: 16px;
    border-radius: 18px;
  }

  .attivita-controls__buttons,
  .agenda-period-nav,
  .agenda-switches,
  .planning-toolbar,
  .dashboard-greeting__pill {
    width: 100%;
  }

  .attivita-controls__buttons {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .agenda-period-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .agenda-period-nav .mud-button-root,
  .agenda-period-nav .mud-typography {
    justify-self: stretch;
    text-align: center;
  }

  .agenda-switches {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .dashboard-greeting__pill {
    justify-content: center;
  }

  .dashboard-hero__copy .mud-typography-h3 {
    font-size: 2rem;
    line-height: 1.05;
  }

  .dashboard-spotlight__ring {
    height: 152px;
    width: 152px;
  }

  .dashboard-badge-card strong {
    font-size: 24px;
  }

  .metric-card {
    padding: 16px;
    border-radius: 18px;
  }

  .metric-card__value {
    font-size: 28px;
  }

  .dashboard-timeline__item {
    padding: 14px;
    gap: 10px;
  }

  .dashboard-timeline__actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .attivita-table-wrap,
  .agenda-calendar-shell,
  .planning-grid-shell,
  .report-preview-surface {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mud-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mud-dialog {
    margin: 12px;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 540px) {
  .app-shell-content {
    padding: 12px;
  }

  .app-shell-appbar .mud-typography {
    font-size: 1rem;
  }

  .app-shell-appbar .mud-button-root {
    padding-inline: 8px;
  }

  .app-shell-appbar .mud-button-root .mud-button-label {
    font-size: 0.875rem;
  }

  .app-shell-appbar .brand-toggle {
    height: 38px;
    width: 38px;
    border-radius: 12px;
  }

  .dashboard-hero__copy .mud-typography-h3,
  .attivita-hero .mud-typography-h4,
  .agenda-hero .mud-typography-h4,
  .cliente-form-hero .mud-typography-h4,
  .planning-hero .mud-typography-h4 {
    font-size: 1.75rem;
  }

  .dashboard-greeting .mud-typography-h4 {
    font-size: 1.7rem;
  }

  .dashboard-panel,
  .dashboard-hero,
  .attivita-hero,
  .agenda-hero,
  .planning-hero,
  .cliente-form-card,
  .cliente-form-aside,
  .agenda-backlog,
  .planning-backlog {
    padding: 16px;
    border-radius: 18px;
  }

  .dashboard-timeline__date strong {
    font-size: 16px;
  }

  .dashboard-timeline__done {
    height: 34px;
    width: 34px;
  }

  .mud-button-root {
    min-height: 42px;
  }
}

.agenda-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 12px;
}

.agenda-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.agenda-layout__main {
  min-width: 0;
}

.agenda-hero,
.agenda-toolbar,
.agenda-stat,
.agenda-week-column,
.agenda-month-cell,
.agenda-card,
.agenda-empty {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.agenda-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 32%),
    linear-gradient(135deg, #ffffff, #f7fcfb);
}

.agenda-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agenda-hero__subtitle {
  max-width: 760px;
  color: rgba(0, 0, 0, 0.62);
}

.agenda-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.agenda-toolbar {
  padding: 20px;
}

.agenda-toolbar__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.agenda-view-switch,
.agenda-period-nav,
.agenda-switches {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agenda-period-nav {
  justify-content: center;
}

.agenda-toolbar__filters {
  margin-top: 10px;
}

.agenda-stat {
  padding: 18px 20px;
}

.agenda-stat--primary {
  background: linear-gradient(180deg, #f1f8ff, #ffffff);
}

.agenda-stat--warning {
  background: linear-gradient(180deg, #fff7ea, #ffffff);
}

.agenda-stat--success {
  background: linear-gradient(180deg, #effcf5, #ffffff);
}

.agenda-empty {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.agenda-empty--compact {
  min-height: auto;
  padding: 18px;
}

.agenda-empty--notice {
  min-height: auto;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.attivita-inline-field {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.attivita-inline-field__control {
  flex: 1 1 auto;
}

.attivita-inline-field__action {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.agenda-month-cell {
  padding: 14px;
}

.agenda-month-cell__header {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0 0 12px;
  cursor: pointer;
}

.agenda-month-cell__header span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0, 0, 0, 0.5);
}

.agenda-month-cell__header strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
}

.agenda-month-cell__items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agenda-mini-card,
.agenda-month-pill,
.agenda-month-more {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
}

.agenda-mini-card {
  padding: 12px;
  background: #f8fbff;
}

.agenda-mini-card__time,
.agenda-mini-card__meta {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.56);
}

.agenda-mini-card__title {
  margin: 6px 0 4px;
  font-weight: 700;
  color: #0f172a;
}

.agenda-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.agenda-month-cell {
  min-height: 170px;
}

.agenda-month-cell--muted {
  opacity: 0.62;
}

.agenda-month-pill {
  padding: 9px 10px;
  background: #f8fbff;
  font-size: 13px;
}

.agenda-month-more {
  padding: 8px 10px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.agenda-item--planned {
  background: linear-gradient(180deg, #f4faff, #ffffff);
}

.agenda-item--today {
  background: linear-gradient(180deg, #fff8e8, #ffffff);
}

.agenda-item--overdue {
  background: linear-gradient(180deg, #fff1f2, #ffffff);
}

.agenda-item--done {
  background: linear-gradient(180deg, #eefbf3, #ffffff);
}

.agenda-calendar-shell {
  overflow: hidden;
  padding: 0;
}

.agenda-calendar {
  background: #fff;
}

.agenda-calendar__header-row,
.agenda-calendar__all-day,
.agenda-calendar__body {
  display: grid;
}

.agenda-calendar__header-row {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-calendar__header-row--week {
  grid-template-columns: 84px repeat(7, minmax(0, 1fr));
}

.agenda-calendar--day .agenda-calendar__header-row {
  grid-template-columns: 84px minmax(0, 1fr);
}

.agenda-calendar__corner {
  background: #fff;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-calendar__day-header {
  border: 0;
  background: #fff;
  padding: 14px 12px;
  text-align: left;
  cursor: pointer;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-calendar__day-header:last-child {
  border-right: 0;
}

.agenda-calendar__day-header span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0, 0, 0, 0.5);
}

.agenda-calendar__day-header strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  color: #0f172a;
}

.agenda-calendar__all-day {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-calendar__all-day--week {
  grid-template-columns: 84px repeat(7, minmax(0, 1fr));
}

.agenda-calendar--day .agenda-calendar__all-day {
  grid-template-columns: 84px minmax(0, 1fr);
}

.agenda-calendar__all-day-label {
  padding: 12px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.54);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: #fafbfd;
}

.agenda-calendar__all-day-track {
  min-height: 76px;
  padding: 12px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agenda-calendar__all-day-track:last-child {
  border-right: 0;
}

.agenda-calendar__body--week {
  grid-template-columns: 84px repeat(7, minmax(0, 1fr));
}

.agenda-calendar--day .agenda-calendar__body {
  grid-template-columns: 84px minmax(0, 1fr);
}

.agenda-calendar__time {
  min-height: 92px;
  padding: 12px 12px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.48);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #fafbfd;
}

.agenda-calendar__cell {
  min-height: 92px;
  padding: 12px 10px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.62), rgba(255, 255, 255, 0.96));
}

.agenda-calendar__cell--single {
  min-height: 104px;
}

.agenda-event {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
  padding: 10px 12px;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agenda-event__time,
.agenda-event__meta {
  display: block;
  font-size: 11px;
  color: rgba(15, 23, 42, 0.62);
  line-height: 1.3;
}

.agenda-event__type {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--agenda-type-color, #3b82f6);
}

.agenda-event__title {
  display: block;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.agenda-timeline {
  display: grid;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-timeline--day {
  grid-template-columns: 84px minmax(0, 1fr);
}

.agenda-timeline--week {
  grid-template-columns: 84px minmax(0, 1fr);
}

.agenda-timeline__times {
  position: relative;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: #fafbfd;
}

.agenda-timeline__time {
  height: 72px;
  padding: 10px 12px 0;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.48);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-timeline__week-columns {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-timeline__day-column {
  position: relative;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.62), rgba(255, 255, 255, 0.96));
}

.agenda-timeline__day-column:last-child {
  border-right: 0;
}

.agenda-timeline__slot {
  height: 72px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-event--timed {
  position: absolute;
  z-index: 2;
  overflow: hidden;
}

.agenda-event--base.agenda-item--planned {
  background: linear-gradient(135deg, #e8f1ff, #f8fbff);
  border-left: 4px solid var(--agenda-type-color, #3b82f6);
}

.agenda-event--base.agenda-item--today {
  background: linear-gradient(135deg, #fff4d9, #fffaf0);
  border-left: 4px solid var(--agenda-type-color, #f59e0b);
}

.agenda-event--base.agenda-item--overdue {
  background: linear-gradient(135deg, #ffe4e6, #fff5f5);
  border-left: 4px solid var(--agenda-type-color, #ef4444);
}

.agenda-event--base.agenda-item--done {
  background: linear-gradient(135deg, #ddfbea, #f2fcf6);
  border-left: 4px solid var(--agenda-type-color, #22c55e);
}

.agenda-backlog {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  position: sticky;
  top: 16px;
}

.agenda-backlog__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.agenda-backlog__list,
.agenda-backlog-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.agenda-recurrence-panel {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.agenda-recurrence-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.agenda-recurrence-card {
  width: 100%;
  border: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  text-align: left;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border: 1px solid rgba(37, 99, 235, 0.10);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.agenda-recurrence-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.agenda-recurrence-card__date span,
.agenda-recurrence-card__meta {
  font-size: 13px;
  color: rgba(15, 23, 42, 0.62);
}

.agenda-recurrence-card__date strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  color: #0f172a;
}

.agenda-recurrence-card__title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.agenda-recurrence-card__tag {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.agenda-backlog__item,
.agenda-backlog-card {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.10);
}

.agenda-backlog__item {
  cursor: pointer;
}

.agenda-backlog__item strong,
.agenda-backlog-card .mud-typography-subtitle2 {
  display: block;
  margin: 4px 0 6px;
}

.agenda-backlog__item span {
  display: block;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.66);
}

.planning-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.planning-hero,
.planning-toolbar,
.planning-backlog,
.planning-grid-shell {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.planning-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.planning-hero__subtitle {
  color: rgba(0, 0, 0, 0.62);
  max-width: 760px;
}

.planning-hero__actions,
.planning-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.planning-toolbar {
  justify-content: space-between;
  padding: 14px 18px;
}

.planning-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.planning-backlog {
  padding: 18px;
  min-height: 280px;
}

.planning-backlog--active {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.planning-backlog__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.planning-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.10);
  cursor: grab;
}

.planning-card:active {
  cursor: grabbing;
}

.planning-card strong {
  display: block;
  margin: 4px 0 6px;
}

.planning-card span {
  display: block;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.68);
}

.planning-card__type {
  font-size: 10px !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2563eb !important;
}

.planning-card--scheduled {
  margin-top: 8px;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.planning-grid-shell {
  overflow: hidden;
}

.planning-grid {
  display: flex;
  flex-direction: column;
}

.planning-grid__header,
.planning-grid__all-day,
.planning-grid__body {
  display: grid;
}

.planning-grid__header {
  grid-template-columns: 84px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.planning-grid__corner,
.planning-grid__label,
.planning-grid__time {
  background: #fafbfd;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.planning-grid__day {
  padding: 14px 12px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.planning-grid__day span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0, 0, 0, 0.5);
}

.planning-grid__day strong {
  display: block;
  margin-top: 4px;
}

.planning-grid__all-day {
  grid-template-columns: 84px repeat(7, minmax(0, 1fr));
}

.planning-grid__label {
  padding: 12px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.54);
}

.planning-grid__all-day-slot,
.planning-grid__slot {
  min-height: 90px;
  padding: 8px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.62), rgba(255, 255, 255, 0.96));
}

.planning-grid__body {
  grid-template-columns: 84px repeat(7, minmax(0, 1fr));
}

.planning-grid__time {
  min-height: 90px;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.48);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.tipo-attivita-color-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
}

.tipo-attivita-color-label input {
  width: 52px;
  height: 36px;
  border: 0;
  background: transparent;
  padding: 0;
}

.tipo-attivita-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tipo-attivita-color-preview {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

@media (max-width: 1200px) {
  .agenda-layout {
    grid-template-columns: 1fr;
  }

  .planning-layout {
    grid-template-columns: 1fr;
  }

  .agenda-month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .agenda-hero,
  .agenda-toolbar__row,
  .planning-hero,
  .planning-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .agenda-month-grid {
    grid-template-columns: 1fr;
  }

  .agenda-calendar-shell {
    overflow-x: auto;
  }

  .planning-grid-shell {
    overflow-x: auto;
  }

  .agenda-calendar {
    min-width: 900px;
  }

  .planning-grid {
    min-width: 980px;
  }

  .agenda-calendar__all-day-track {
    padding: 10px 8px;
  }

  .agenda-event {
    padding: 9px 10px;
  }

  .agenda-event--timed {
    min-width: 0;
  }

  .agenda-panel-head,
  .agenda-recurrence-card {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .agenda-recurrence-card {
    align-items: flex-start;
  }

  .agenda-recurrence-card__tag {
    margin-top: 6px;
  }
}

.report-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-preview-toolbar {
  break-inside: avoid;
}

.report-preview-surface {
  overflow-x: auto;
  background: #ffffff !important;
  color: #1f2933 !important;
}

.report-preview-document {
  background: #ffffff;
  color: #1f2933;
  border-radius: 8px;
}

.report-preview-document table,
.report-preview-document th,
.report-preview-document td,
.report-preview-document div,
.report-preview-document span,
.report-preview-document p,
.report-preview-document strong,
.report-preview-document h1,
.report-preview-document h2,
.report-preview-document h3 {
  color: inherit;
}

.app-theme-dark .report-preview-surface {
  background: #ffffff !important;
  color: #1f2933 !important;
}

.app-theme-dark .report-preview-document,
.app-theme-dark .report-preview-document .print-shell,
.app-theme-dark .report-preview-document .delivery-table-wrap,
.app-theme-dark .report-preview-document .delivery-table,
.app-theme-dark .report-preview-document .delivery-header {
  background: #ffffff !important;
  color: #1f2933 !important;
}

.report-designer-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #bfdbfe;
  background: #f8fbff;
  border-radius: 12px;
}

.report-designer-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.report-designer-toolbar .gjs-pn-btn {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  width: 42px;
  height: 42px;
}

.report-designer-canvas {
  border: 1px solid #dbeafe;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

@media print {
  .report-preview-toolbar,
  .mud-appbar,
  .mud-drawer {
    display: none !important;
  }

  .app-shell-drawer-container,
  .mud-main-content,
  .app-shell-content {
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }

  .report-preview-surface {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
}

.app-theme-dark .mud-paper:not(.report-preview-toolbar):not(.report-preview-surface),
.app-theme-dark .attivita-hero,
.app-theme-dark .attivita-controls,
.app-theme-dark .attivita-stat,
.app-theme-dark .attivita-table-wrap,
.app-theme-dark .cliente-form-hero,
.app-theme-dark .cliente-form-card,
.app-theme-dark .cliente-form-aside,
.app-theme-dark .cliente-sede-card,
.app-theme-dark .agenda-hero,
.app-theme-dark .agenda-toolbar,
.app-theme-dark .agenda-stat,
.app-theme-dark .agenda-week-column,
.app-theme-dark .agenda-month-cell,
.app-theme-dark .agenda-card,
.app-theme-dark .agenda-empty,
.app-theme-dark .agenda-backlog,
.app-theme-dark .planning-hero,
.app-theme-dark .planning-toolbar,
.app-theme-dark .planning-backlog,
.app-theme-dark .planning-grid-shell,
.app-theme-dark .dashboard-panel,
.app-theme-dark .metric-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(17, 24, 39, 0.98));
  border-color: rgba(148, 163, 184, 0.16);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.app-theme-dark .mud-table,
.app-theme-dark .mud-table-container,
.app-theme-dark .mud-table-root,
.app-theme-dark .mud-input-control > .mud-input-control-input-container,
.app-theme-dark .mud-select,
.app-theme-dark .mud-popover,
.app-theme-dark .mud-menu,
.app-theme-dark .mud-dialog,
.app-theme-dark .mud-chip {
  color: rgba(255, 255, 255, 0.9);
}

.app-theme-dark .attivita-hero,
.app-theme-dark .cliente-form-hero,
.app-theme-dark .agenda-hero,
.app-theme-dark .planning-hero {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.98));
}

.app-theme-dark .mud-typography,
.app-theme-dark .mud-input-label,
.app-theme-dark .mud-switch-label,
.app-theme-dark .mud-select-input,
.app-theme-dark .mud-input > input,
.app-theme-dark .mud-input-slot,
.app-theme-dark .attivita-hero__subtitle,
.app-theme-dark .cliente-form-hero__subtitle,
.app-theme-dark .agenda-hero__subtitle,
.app-theme-dark .planning-hero__subtitle,
.app-theme-dark .dashboard-greeting__subtitle,
.app-theme-dark .metric-card__label,
.app-theme-dark .metric-card__note,
.app-theme-dark .dashboard-mini-list__item div:last-child,
.app-theme-dark .dashboard-mini-list__item > span,
.app-theme-dark .dashboard-mini-list__item div > div,
.app-theme-dark .dashboard-bars__label,
.app-theme-dark .dashboard-bars__value,
.app-theme-dark .agenda-mini-card__time,
.app-theme-dark .agenda-mini-card__meta,
.app-theme-dark .planning-card span,
.app-theme-dark .agenda-backlog__item span {
  color: rgba(255, 255, 255, 0.68);
}

.app-theme-dark .dashboard-timeline__item,
.app-theme-dark .agenda-mini-card,
.app-theme-dark .agenda-month-pill,
.app-theme-dark .agenda-backlog__item,
.app-theme-dark .agenda-backlog-card,
.app-theme-dark .planning-card,
.app-theme-dark .dashboard-empty,
.app-theme-dark .cliente-sedi-empty,
.app-theme-dark .cliente-detail-note-card,
.app-theme-dark .cliente-defunto-card {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.14);
  color: rgba(255, 255, 255, 0.9);
}

.app-theme-dark .dashboard-timeline__item--danger {
  background: linear-gradient(180deg, rgba(69, 18, 27, 0.92), rgba(31, 41, 55, 0.96));
}

.app-theme-dark .dashboard-timeline__item--warning {
  background: linear-gradient(180deg, rgba(71, 44, 12, 0.92), rgba(31, 41, 55, 0.96));
}

.app-theme-dark .dashboard-timeline__item--normal {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
}

.app-theme-dark .mud-th,
.app-theme-dark .mud-td,
.app-theme-dark .dashboard-timeline__title,
.app-theme-dark .dashboard-mini-list__item strong,
.app-theme-dark .agenda-mini-card__title,
.app-theme-dark .agenda-month-cell__header strong,
.app-theme-dark .planning-card strong {
  color: rgba(255, 255, 255, 0.94);
}

.app-theme-dark .dashboard-timeline__date strong,
.app-theme-dark .agenda-calendar__day-header strong,
.app-theme-dark .planning-grid__day strong {
  color: rgba(255, 255, 255, 0.92);
}

.app-theme-dark .dashboard-timeline__date span,
.app-theme-dark .dashboard-timeline__meta,
.app-theme-dark .dashboard-timeline__desc {
  color: rgba(226, 232, 240, 0.78);
}

.app-theme-dark .dashboard-timeline__status {
  background: rgba(15, 23, 42, 0.78);
  color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.app-theme-dark .dashboard-timeline__done {
  box-shadow: 0 10px 18px rgba(34, 197, 94, 0.22);
}

.app-theme-dark .mud-table-root,
.app-theme-dark .mud-table-container,
.app-theme-dark .agenda-calendar,
.app-theme-dark .planning-grid {
  background: transparent;
}

.app-theme-dark .mud-table-head,
.app-theme-dark .mud-table-body,
.app-theme-dark .mud-table-foot,
.app-theme-dark .agenda-calendar__corner,
.app-theme-dark .agenda-calendar__day-header,
.app-theme-dark .agenda-calendar__all-day-label,
.app-theme-dark .agenda-calendar__time,
.app-theme-dark .agenda-timeline__times,
.app-theme-dark .agenda-timeline__time,
.app-theme-dark .planning-grid__corner,
.app-theme-dark .planning-grid__label,
.app-theme-dark .planning-grid__time,
.app-theme-dark .planning-grid__day {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.12);
  color: rgba(255, 255, 255, 0.72);
}

.app-theme-dark .mud-input-outlined-border,
.app-theme-dark .agenda-calendar__cell,
.app-theme-dark .agenda-calendar__all-day-track,
.app-theme-dark .agenda-timeline__day-column,
.app-theme-dark .planning-grid__all-day-slot,
.app-theme-dark .planning-grid__slot {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(17, 24, 39, 0.92));
  border-color: rgba(148, 163, 184, 0.12);
}

.app-theme-dark .agenda-month-more {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}
