/* Overlay Dialog */
body:not(.page-admin) .ui-widget-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer !important;
  z-index: 9999 !important;
}

/* Dialog responsive e centrato */
body:not(.page-admin) .ui-dialog {
  position: fixed !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  top: 0% !important;
  left: 0% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
  background: none !important;
  border: none !important;

  .ui-dialog-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    width: var(--var-width, 1200px);
    height: var(--var-height, 800px);
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0.5rem;

    /* Barra del titolo + pulsante di chiusura */
    .ui-dialog-titlebar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      min-height: 0;
      padding: 0.5rem 1rem;

      &::before {
        display: none !important;
      }

      /* Titolo */
      .ui-dialog-title {
        flex: 1 1 auto;
        width: auto;
        white-space: wrap;
        margin: 0;
        overflow: auto;
      }

      /* Pulsante di chiusura */
      .ui-dialog-titlebar-close {
        position: relative;
        right: unset;
        top: unset;
        margin: 0;
      }
    }

    /* Contenuto */
    .ui-dialog-content {
      width: 100% !important;
      height: 100% !important;
      padding: 0.5rem !important;
      max-width: unset !important;
      max-height: unset !important;
      overflow: hidden auto !important;
    }
  }
}
