/* ============================================
   PrimeNG 13 Grid System Compatibility
   ============================================
   Old PrimeNG 13 components use p-grid, p-col-*
   PrimeNG 17 removed this in favor of PrimeFlex
   This provides backward compatibility
   ============================================ */

/* ============================================
   PRIMEFLEX DISPLAY UTILITIES - CRITICAL
   ============================================ */

/* Display */
.p-d-none {
    display: none !important;
}

.p-d-inline {
    display: inline !important;
}

.p-d-inline-block {
    display: inline-block !important;
}

.p-d-block {
    display: block !important;
}

.p-d-flex {
    display: flex !important;
}

.p-d-inline-flex {
    display: inline-flex !important;
}

/* Flex Direction */
.p-flex-row {
    flex-direction: row !important;
}

.p-flex-row-reverse {
    flex-direction: row-reverse !important;
}

.p-flex-column {
    flex-direction: column !important;
}

.p-flex-column-reverse {
    flex-direction: column-reverse !important;
}

/* Flex Wrap */
.p-flex-wrap {
    flex-wrap: wrap !important;
}

.p-flex-nowrap {
    flex-wrap: nowrap !important;
}

.p-flex-wrap-reverse {
    flex-wrap: wrap-reverse !important;
}

/* Justify Content */
.p-jc-start {
    justify-content: flex-start !important;
}

.p-jc-end {
    justify-content: flex-end !important;
}

.p-jc-center {
    justify-content: center !important;
}

.p-jc-between {
    justify-content: space-between !important;
}

.p-jc-around {
    justify-content: space-around !important;
}

.p-jc-evenly {
    justify-content: space-evenly !important;
}

/* Align Items */
.p-ai-start {
    align-items: flex-start !important;
}

.p-ai-end {
    align-items: flex-end !important;
}

.p-ai-center {
    align-items: center !important;
}

.p-ai-baseline {
    align-items: baseline !important;
}

.p-ai-stretch {
    align-items: stretch !important;
}

/* Align Content */
.p-ac-start {
    align-content: flex-start !important;
}

.p-ac-end {
    align-content: flex-end !important;
}

.p-ac-center {
    align-content: center !important;
}

.p-ac-between {
    align-content: space-between !important;
}

.p-ac-around {
    align-content: space-around !important;
}

.p-ac-stretch {
    align-content: stretch !important;
}

/* Align Self */
.p-as-start {
    align-self: flex-start !important;
}

.p-as-end {
    align-self: flex-end !important;
}

.p-as-center {
    align-self: center !important;
}

.p-as-baseline {
    align-self: baseline !important;
}

.p-as-stretch {
    align-self: stretch !important;
}

/* Flex Grow & Shrink */
.p-flex-1 {
    flex: 1 1 0% !important;
}

.p-flex-auto {
    flex: 1 1 auto !important;
}

.p-flex-initial {
    flex: 0 1 auto !important;
}

.p-flex-none {
    flex: none !important;
}

/* Order */
.p-order-first {
    order: -1 !important;
}

.p-order-last {
    order: 9999 !important;
}

.p-order-none {
    order: 0 !important;
}

/* Responsive Display - Medium screens and up */
@media screen and (min-width: 768px) {
    .p-md-flex {
        display: flex !important;
    }
    
    .p-flex-md-row {
        flex-direction: row !important;
    }
    
    .p-flex-md-column {
        flex-direction: column !important;
    }
    
    .p-jc-md-start {
        justify-content: flex-start !important;
    }
    
    .p-jc-md-end {
        justify-content: flex-end !important;
    }
    
    .p-jc-md-center {
        justify-content: center !important;
    }
    
    .p-jc-md-between {
        justify-content: space-between !important;
    }
    
    .p-jc-md-around {
        justify-content: space-around !important;
    }
    
    .p-ai-md-start {
        align-items: flex-start !important;
    }
    
    .p-ai-md-end {
        align-items: flex-end !important;
    }
    
    .p-ai-md-center {
        align-items: center !important;
    }
}

/* ============================================
   PRIMEFLEX SPACING UTILITIES
   ============================================ */

/* Padding */
.p-p-0 {
    padding: 0 !important;
}

.p-p-1 {
    padding: 0.25rem !important;
}

.p-p-2 {
    padding: 0.5rem !important;
}

.p-p-3 {
    padding: 1rem !important;
}

.p-p-4 {
    padding: 1.5rem !important;
}

.p-p-5 {
    padding: 2rem !important;
}

.p-p-6 {
    padding: 3rem !important;
}

/* Padding Top */
.p-pt-0 {
    padding-top: 0 !important;
}

.p-pt-1 {
    padding-top: 0.25rem !important;
}

.p-pt-2 {
    padding-top: 0.5rem !important;
}

.p-pt-3 {
    padding-top: 1rem !important;
}

/* Padding Right */
.p-pr-0 {
    padding-right: 0 !important;
}

.p-pr-1 {
    padding-right: 0.25rem !important;
}

.p-pr-2 {
    padding-right: 0.5rem !important;
}

.p-pr-3 {
    padding-right: 1rem !important;
}

/* Padding Bottom */
.p-pb-0 {
    padding-bottom: 0 !important;
}

.p-pb-1 {
    padding-bottom: 0.25rem !important;
}

.p-pb-2 {
    padding-bottom: 0.5rem !important;
}

.p-pb-3 {
    padding-bottom: 1rem !important;
}

/* Padding Left */
.p-pl-0 {
    padding-left: 0 !important;
}

.p-pl-1 {
    padding-left: 0.25rem !important;
}

.p-pl-2 {
    padding-left: 0.5rem !important;
}

.p-pl-3 {
    padding-left: 1rem !important;
}

/* Margin */
.p-m-0 {
    margin: 0 !important;
}

.p-m-1 {
    margin: 0.25rem !important;
}

.p-m-2 {
    margin: 0.5rem !important;
}

.p-m-3 {
    margin: 1rem !important;
}

.p-m-4 {
    margin: 1.5rem !important;
}

.p-m-5 {
    margin: 2rem !important;
}

.p-m-6 {
    margin: 3rem !important;
}

.p-m-auto {
    margin: auto !important;
}

/* Margin Top */
.p-mt-0 {
    margin-top: 0 !important;
}

.p-mt-1 {
    margin-top: 0.25rem !important;
}

.p-mt-2 {
    margin-top: 0.5rem !important;
}

.p-mt-3 {
    margin-top: 1rem !important;
}

.p-mt-auto {
    margin-top: auto !important;
}

/* Margin Right */
.p-mr-0 {
    margin-right: 0 !important;
}

.p-mr-1 {
    margin-right: 0.25rem !important;
}

.p-mr-2 {
    margin-right: 0.5rem !important;
}

.p-mr-3 {
    margin-right: 1rem !important;
}

.p-mr-auto {
    margin-right: auto !important;
}

/* Margin Bottom */
.p-mb-0 {
    margin-bottom: 0 !important;
}

.p-mb-1 {
    margin-bottom: 0.25rem !important;
}

.p-mb-2 {
    margin-bottom: 0.5rem !important;
}

.p-mb-3 {
    margin-bottom: 1rem !important;
}

.p-mb-auto {
    margin-bottom: auto !important;
}

/* Margin Left */
.p-ml-0 {
    margin-left: 0 !important;
}

.p-ml-1 {
    margin-left: 0.25rem !important;
}

.p-ml-2 {
    margin-left: 0.5rem !important;
}

.p-ml-3 {
    margin-left: 1rem !important;
}

.p-ml-auto {
    margin-left: auto !important;
}

/* ============================================
   PRIMENG 13 GRID SYSTEM
   ============================================ */

/* Grid Container */
.p-grid {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
}

.p-grid > .p-col,
.p-grid > [class*="p-col-"] {
    box-sizing: border-box;
}

/* Nogutter */
.p-grid.p-nogutter {
    margin-right: 0;
    margin-left: 0;
    margin-top: 0;
}

.p-grid.p-nogutter > .p-col,
.p-grid.p-nogutter > [class*="p-col-"] {
    padding: 0;
}

/* Direction */
.p-dir-row {
    flex-direction: row;
}

.p-dir-rev {
    flex-direction: row-reverse;
}

.p-dir-col {
    flex-direction: column;
}

.p-dir-col-rev {
    flex-direction: column-reverse;
}

/* Justify Content */
.p-justify-start {
    justify-content: flex-start;
}

.p-justify-end {
    justify-content: flex-end;
}

.p-justify-center {
    justify-content: center;
}

.p-justify-between {
    justify-content: space-between;
}

.p-justify-around {
    justify-content: space-around;
}

.p-justify-even {
    justify-content: space-evenly;
}

/* Align Items */
.p-align-start {
    align-items: flex-start;
}

.p-align-end {
    align-items: flex-end;
}

.p-align-center {
    align-items: center;
}

.p-align-baseline {
    align-items: baseline;
}

.p-align-stretch {
    align-items: stretch;
}

/* Column Sizing - All 12 columns */
.p-col {
    flex-grow: 1;
    flex-basis: 0;
    padding: 0.5rem;
}

.p-col-1 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 8.3333%;
}

.p-col-2 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 16.6667%;
}

.p-col-3 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 25%;
}

.p-col-4 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 33.3333%;
}

.p-col-5 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 41.6667%;
}

.p-col-6 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 50%;
}

.p-col-7 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 58.3333%;
}

.p-col-8 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 66.6667%;
}

.p-col-9 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 75%;
}

.p-col-10 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 83.3333%;
}

.p-col-11 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 91.6667%;
}

.p-col-12 {
    flex: 0 0 auto;
    padding: 0.5rem;
    width: 100%;
}

/* Responsive - Small devices */
@media screen and (min-width: 576px) {
    .p-sm-1 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 8.3333%;
    }

    .p-sm-2 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 16.6667%;
    }

    .p-sm-3 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 25%;
    }

    .p-sm-4 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 33.3333%;
    }

    .p-sm-5 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 41.6667%;
    }

    .p-sm-6 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 50%;
    }

    .p-sm-7 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 58.3333%;
    }

    .p-sm-8 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 66.6667%;
    }

    .p-sm-9 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 75%;
    }

    .p-sm-10 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 83.3333%;
    }

    .p-sm-11 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 91.6667%;
    }

    .p-sm-12 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 100%;
    }
}

/* Responsive - Medium devices */
@media screen and (min-width: 768px) {
    .p-md-1 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 8.3333%;
    }

    .p-md-2 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 16.6667%;
    }

    .p-md-3 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 25%;
    }

    .p-md-4 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 33.3333%;
    }

    .p-md-5 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 41.6667%;
    }

    .p-md-6 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 50%;
    }

    .p-md-7 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 58.3333%;
    }

    .p-md-8 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 66.6667%;
    }

    .p-md-9 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 75%;
    }

    .p-md-10 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 83.3333%;
    }

    .p-md-11 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 91.6667%;
    }

    .p-md-12 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 100%;
    }
}

/* Responsive - Large devices */
@media screen and (min-width: 992px) {
    .p-lg-1 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 8.3333%;
    }

    .p-lg-2 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 16.6667%;
    }

    .p-lg-3 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 25%;
    }

    .p-lg-4 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 33.3333%;
    }

    .p-lg-5 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 41.6667%;
    }

    .p-lg-6 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 50%;
    }

    .p-lg-7 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 58.3333%;
    }

    .p-lg-8 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 66.6667%;
    }

    .p-lg-9 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 75%;
    }

    .p-lg-10 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 83.3333%;
    }

    .p-lg-11 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 91.6667%;
    }

    .p-lg-12 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 100%;
    }
}

/* Responsive - Extra large devices */
@media screen and (min-width: 1200px) {
    .p-xl-1 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 8.3333%;
    }

    .p-xl-2 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 16.6667%;
    }

    .p-xl-3 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 25%;
    }

    .p-xl-4 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 33.3333%;
    }

    .p-xl-5 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 41.6667%;
    }

    .p-xl-6 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 50%;
    }

    .p-xl-7 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 58.3333%;
    }

    .p-xl-8 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 66.6667%;
    }

    .p-xl-9 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 75%;
    }

    .p-xl-10 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 83.3333%;
    }

    .p-xl-11 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 91.6667%;
    }

    .p-xl-12 {
        flex: 0 0 auto;
        padding: 0.5rem;
        width: 100%;
    }
}

/* Fluid Form Layout */
.p-fluid .p-inputtext {
    width: 100%;
}

/* ============================================
   END OF GRID COMPATIBILITY
   ============================================ */
