:root {
    --pg-dark: #003f42;
    --pg-dark-2: #003236;
    --pg-orange: #f28a18;
    --pg-bg: #f7f5ef;
    --pg-card: #ffffff;
    --pg-text: #10251d;
    --pg-muted: #65736d;
    --pg-border: rgba(16, 37, 29, 0.12);
    --pg-shadow: 0 16px 38px rgba(0, 0, 0, 0.075);

    --pg-sidebar-width: 226px;
    --pg-main-padding-x: 22px;
    --pg-main-padding-y: 22px;
    --pg-card-radius: 20px;
    --pg-card-padding: 18px;
    --pg-field-radius: 12px;
    --pg-field-height: 42px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--pg-bg);
    color: var(--pg-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.42;
    overflow-x: hidden;
}


[id] {
    scroll-margin-top: 86px;
}

@media (max-width: 1180px), (pointer: coarse) and (max-width: 1368px) {
    [id] {
        scroll-margin-top: 76px;
    }
}

@media (max-width: 430px) {
    [id] {
        scroll-margin-top: 66px;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.pg-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(242,138,24,0.20), transparent 34%),
        linear-gradient(135deg, var(--pg-dark), #10251d);
}

.pg-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--pg-shadow);
}

.pg-auth-card-wide {
    max-width: 520px;
}

.pg-auth-links {
    margin-top: 14px;
    text-align: center;
    color: var(--pg-muted);
    font-size: 0.92rem;
}

.pg-auth-links a {
    color: var(--pg-orange);
    font-weight: 850;
}

.pg-auth-links a:hover {
    text-decoration: underline;
}

.pg-auth-note {
    margin: 16px 0 0;
    padding: 12px 13px;
    border-radius: 14px;
    background: rgba(16, 37, 29, 0.045);
    border: 1px solid var(--pg-border);
    color: var(--pg-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.pg-button-secondary {
    background: #fff;
    color: var(--pg-dark);
    border: 1px solid var(--pg-border);
    box-shadow: none;
}

.pg-button-secondary:hover {
    background: rgba(16, 37, 29, 0.045);
}

.pg-logo-text {
    font-size: 1.95rem;
    font-weight: 950;
    letter-spacing: -0.055em;
    color: var(--pg-dark);
    margin-bottom: 6px;
    line-height: 1;
}

.pg-logo-text span {
    color: var(--pg-orange);
}

.pg-subtitle {
    color: var(--pg-muted);
    margin: 0 0 22px;
    line-height: 1.5;
}

.pg-form-group {
    margin-bottom: 13px;
}

.pg-form-group label {
    display: block;
    font-weight: 750;
    margin-bottom: 6px;
    font-size: 0.92rem;
}

.pg-input {
    width: 100%;
    min-height: var(--pg-field-height);
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-field-radius);
    padding: 10px 13px;
    font-size: 0.96rem;
    outline: none;
    background: #fff;
}

.pg-input:focus {
    border-color: var(--pg-orange);
    box-shadow: 0 0 0 4px rgba(242, 138, 24, 0.13);
}

.pg-password-wrap {
    position: relative;
    width: 100%;
}

.pg-password-wrap .pg-input {
    padding-right: 48px;
}

.pg-password-toggle {
    position: absolute;
    top: 50%;
    right: 11px;
    transform: translateY(-50%);
    width: 31px;
    height: 31px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--pg-muted);
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.pg-password-toggle:hover {
    background: rgba(16, 37, 29, 0.06);
    color: var(--pg-dark);
}

.pg-password-toggle:focus-visible {
    outline: 2px solid var(--pg-orange);
    outline-offset: 2px;
}

.pg-password-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pg-password-toggle .pg-eye-off {
    display: none;
}

.pg-password-toggle.is-visible .pg-eye-on {
    display: none;
}

.pg-password-toggle.is-visible .pg-eye-off {
    display: block;
}

.pg-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 850;
    font-size: 0.96rem;
    cursor: pointer;
    color: #fff;
    background: var(--pg-orange);
    box-shadow: 0 12px 22px rgba(242,138,24,0.24);
}

.pg-button:hover {
    filter: brightness(0.98);
}

.pg-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.pg-alert {
    padding: 12px 14px;
    border-radius: 13px;
    margin-bottom: 16px;
    font-weight: 650;
    line-height: 1.42;
}

.pg-alert-error {
    background: #fff0f0;
    color: #9b1c1c;
    border: 1px solid #ffd0d0;
}

.pg-alert-ok {
    background: #effaf3;
    color: #166534;
    border: 1px solid #bdecc9;
}


.pg-smart-toast {
    position: fixed;
    z-index: 10020;
    top: 18px;
    left: calc(var(--pg-sidebar-width) + 22px);
    right: 22px;
    max-width: 760px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 13px 14px;
    border-radius: 17px;
    border: 1px solid rgba(16, 37, 29, 0.12);
    background: #ffffff;
    color: var(--pg-text);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.pg-smart-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pg-smart-toast-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    flex: 0 0 auto;
}

.pg-smart-toast-text {
    min-width: 0;
    font-size: 0.95rem;
    line-height: 1.34;
    font-weight: 750;
}

.pg-smart-toast-close {
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(16, 37, 29, 0.08);
    color: inherit;
    font-size: 0;
    line-height: 0;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
    vertical-align: middle;
}

.pg-smart-toast-close::before {
    content: "×";
    display: block;
    font-size: 1.18rem;
    line-height: 1;
    transform: translateY(-1px);
}

.pg-smart-toast-ok,
.pg-smart-toast-success {
    border-color: #bdecc9;
    background: #effaf3;
    color: #166534;
}

.pg-smart-toast-ok .pg-smart-toast-icon,
.pg-smart-toast-success .pg-smart-toast-icon {
    background: #166534;
    color: #fff;
}

.pg-smart-toast-error,
.pg-smart-toast-danger {
    border-color: #ffd0d0;
    background: #fff0f0;
    color: #9b1c1c;
}

.pg-smart-toast-error .pg-smart-toast-icon,
.pg-smart-toast-danger .pg-smart-toast-icon {
    background: #9b1c1c;
    color: #fff;
}

.pg-smart-toast-warn,
.pg-smart-toast-warning {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.pg-smart-toast-warn .pg-smart-toast-icon,
.pg-smart-toast-warning .pg-smart-toast-icon {
    background: #c2410c;
    color: #fff;
}

.pg-toast-source-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.pg-pwa-install {
    position: fixed;
    z-index: 10010;
    right: 18px;
    bottom: 18px;
    display: none;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: min(420px, calc(100vw - 36px));
    padding: 12px;
    border: 1px solid rgba(0, 63, 66, 0.14);
    border-radius: 18px;
    background: #fff;
    color: var(--pg-text);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
}

.pg-pwa-install.is-visible {
    display: grid;
}

.pg-pwa-install-logo {
    width: 46px;
    height: 46px;
    display: block;
    border-radius: 13px;
    object-fit: cover;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(0, 63, 66, 0.16);
}

.pg-pwa-install-text {
    min-width: 0;
}

.pg-pwa-install-title {
    color: var(--pg-dark);
    font-size: 0.94rem;
    line-height: 1.15;
    font-weight: 900;
}

.pg-pwa-install-subtitle {
    margin-top: 2px;
    color: var(--pg-muted);
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 720;
}

.pg-pwa-install-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.pg-pwa-install-button,
.pg-pwa-dismiss-button {
    min-height: 36px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
}

.pg-pwa-install-button {
    padding: 8px 12px;
    background: var(--pg-dark);
    color: #fff;
}

.pg-pwa-dismiss-button {
    width: 36px;
    padding: 0;
    background: rgba(16, 37, 29, 0.08);
    color: var(--pg-muted);
}

.pg-pwa-guide-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10030;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 32, 34, 0.46);
}

.pg-pwa-guide-backdrop.is-visible {
    display: flex;
}

.pg-pwa-guide-modal {
    width: min(420px, 100%);
    border-radius: 22px;
    background: #fff;
    color: var(--pg-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
    overflow: hidden;
}

.pg-pwa-guide-head {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 18px 18px 12px;
}

.pg-pwa-guide-head img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 8px 18px rgba(0, 63, 66, 0.16);
}

.pg-pwa-guide-title {
    margin: 0;
    color: var(--pg-dark);
    font-size: 1.08rem;
    line-height: 1.16;
    font-weight: 950;
}

.pg-pwa-guide-body {
    padding: 0 18px 18px;
    color: var(--pg-muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.pg-pwa-guide-body strong {
    color: var(--pg-dark);
}

.pg-pwa-guide-actions {
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px 18px;
    background: #f8faf8;
    border-top: 1px solid var(--pg-border);
}

.pg-pwa-guide-close {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    padding: 9px 16px;
    background: var(--pg-dark);
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.pg-pwa-network {
    position: fixed;
    z-index: 10011;
    left: 50%;
    bottom: 16px;
    display: none;
    transform: translateX(-50%);
    min-height: 34px;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(154, 52, 18, 0.24);
    background: #fff7ed;
    color: #9a3412;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    font-size: 0.82rem;
    font-weight: 900;
}

.pg-pwa-network.is-offline {
    display: inline-flex;
}

@media (max-width: 1180px), (pointer: coarse) and (max-width: 1368px) {
    .pg-smart-toast {
        left: 12px;
        right: 12px;
        top: 74px;
        max-width: none;
        border-radius: 15px;
        padding: 12px 12px;
    }

    .pg-pwa-install {
        left: 12px;
        right: 12px;
        top: calc(env(safe-area-inset-top, 0px) + 12px);
        bottom: auto;
        width: auto;
    }
}

@media (max-width: 430px) {
    .pg-smart-toast {
        top: 62px;
        left: 9px;
        right: 9px;
        gap: 8px;
    }

    .pg-smart-toast-text {
        font-size: 0.9rem;
    }

    .pg-pwa-install {
        left: 9px;
        right: 9px;
        top: calc(env(safe-area-inset-top, 0px) + 9px);
        bottom: auto;
        width: auto;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px;
        border-radius: 16px;
    }

    .pg-pwa-install-logo {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .pg-pwa-install-subtitle {
        font-size: 0.74rem;
    }

    .pg-pwa-network {
        bottom: 9px;
        max-width: calc(100vw - 18px);
    }
}

.pg-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--pg-sidebar-width) minmax(0, 1fr);
}

.pg-sidebar {
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.10), transparent 30%),
        linear-gradient(180deg, var(--pg-dark), #10251d);
    color: #fff;
    padding: 10px 10px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.pg-sidebar-logo {
    font-size: 1.34rem;
    font-weight: 950;
    letter-spacing: -0.055em;
    margin-bottom: 2px;
    line-height: 1;
}

.pg-sidebar-logo span {
    color: var(--pg-orange);
}

.pg-sidebar-company {
    margin-bottom: 10px;
    line-height: 1.13;
}

.pg-sidebar-company-name {
    display: block;
    color: rgba(255,255,255,0.74);
    font-size: 0.81rem;
    font-weight: 720;
}

.pg-sidebar-user-name {
    display: block;
    margin-top: 3px;
    color: #fff;
    font-size: 0.89rem;
    font-weight: 900;
    letter-spacing: -0.015em;
}

.pg-sidebar-user-role {
    display: block;
    margin-top: 0;
    color: rgba(255,255,255,0.68);
    font-size: 0.63rem;
    font-weight: 850;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.pg-menu {
    display: grid;
    gap: 2px;
}

.pg-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 31px;
    padding: 5px 8px;
    border-radius: 10px;
    color: rgba(255,255,255,0.88);
    font-weight: 760;
    font-size: 0.86rem;
    line-height: 1.12;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.pg-menu a:hover {
    background: rgba(255,255,255,0.10);
    color: #fff;
    transform: translateX(2px);
}

.pg-menu a.active {
    background: rgba(255,255,255,0.16);
    color: #fff;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.06),
        0 10px 24px rgba(0,0,0,0.08);
}

.pg-menu-icon {
    width: 16px;
    height: 16px;
    min-width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    opacity: 0.96;
}

.pg-menu-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pg-menu-label {
    display: block;
    min-width: 0;
}

.pg-menu-install {
    display: none !important;
    background: rgba(242, 138, 24, 0.10);
    border: 1px solid rgba(242, 138, 24, 0.18);
}

.pg-menu-install:hover {
    background: rgba(242, 138, 24, 0.18) !important;
    color: #fff;
}

@media (max-width: 1180px), (pointer: coarse) and (max-width: 1368px) {
    .pg-menu-install {
        display: flex !important;
    }
}

.pg-menu-logout {
    margin-top: 3px;
}

.pg-menu-logout:hover {
    background: rgba(242, 138, 24, 0.16) !important;
    color: #fff;
}

.pg-main {
    min-width: 0;
    width: 100%;
    max-width: 1540px;
    padding: var(--pg-main-padding-y) var(--pg-main-padding-x);
    margin: 0 auto;
}

.pg-demo-banner {
    margin: 0 0 18px;
    padding: 13px 16px;
    border-radius: 18px;
    border: 1px solid rgba(242, 138, 24, 0.32);
    background: linear-gradient(135deg, rgba(242, 138, 24, 0.17), rgba(255,255,255,0.92));
    color: #663900;
    box-shadow: 0 10px 24px rgba(0,0,0,0.045);
    font-size: 0.92rem;
    line-height: 1.45;
}

.pg-demo-banner strong {
    display: inline-block;
    margin-right: 6px;
    color: #9a4f00;
    font-weight: 950;
}

.pg-demo-banner code {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(102,57,0,0.12);
    color: #663900;
    font-size: 0.86em;
}

.pg-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.pg-topbar-text {
    min-width: 0;
}

.pg-topbar-help {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 999px;
    background: #fff;
    color: var(--pg-dark);
    border: 1px solid rgba(16, 37, 29, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.045);
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.pg-topbar-help:hover {
    transform: translateY(-1px);
    border-color: rgba(242, 138, 24, 0.36);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.07);
}

.pg-topbar-help .pg-menu-icon {
    width: 17px;
    height: 17px;
    min-width: 17px;
}

.pg-topbar-help .pg-menu-icon svg {
    width: 17px;
    height: 17px;
}

.pg-page-title {
    margin: 0;
    font-size: clamp(1.7rem, 2.4vw, 2.25rem);
    line-height: 1.05;
    letter-spacing: -0.055em;
    color: var(--pg-dark);
}

.pg-page-subtitle {
    margin: 6px 0 0;
    color: var(--pg-muted);
    font-size: 0.96rem;
}

@media (max-width: 720px) {
    .pg-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .pg-topbar-help {
        width: 100%;
    }
}

.pg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.pg-card {
    background: var(--pg-card);
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-card-radius);
    padding: var(--pg-card-padding);
    box-shadow: 0 10px 26px rgba(0,0,0,0.042);
}

.pg-card h3 {
    margin: 0 0 7px;
    color: var(--pg-dark);
    letter-spacing: -0.035em;
    line-height: 1.18;
    font-size: 1.15rem;
}

.pg-card p {
    margin: 0;
    color: var(--pg-muted);
    line-height: 1.45;
}

.pg-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(242,138,24,0.12);
    color: #a85505;
    padding: 5px 9px;
    font-size: 0.78rem;
    font-weight: 850;
    margin-bottom: 10px;
    line-height: 1.2;
}

.pg-welcome {
    grid-column: 1 / -1;
    background:
        radial-gradient(circle at right top, rgba(242,138,24,0.22), transparent 28%),
        linear-gradient(135deg, var(--pg-dark), #10251d);
    color: #fff;
}

.pg-welcome h2 {
    margin: 0 0 8px;
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    letter-spacing: -0.055em;
    line-height: 1.08;
}

.pg-welcome p {
    color: rgba(255,255,255,0.80);
    max-width: 820px;
}

.pg-module-placeholder {
    grid-column: 1 / -1;
}


/*
|--------------------------------------------------------------------------
| DASHBOARD OPERATIVA
|--------------------------------------------------------------------------
*/

.pg-dashboard {
    display: grid;
    gap: 16px;
}

.pg-subscription-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(420px, 0.75fr);
    gap: 14px;
    align-items: stretch;
    background:
        radial-gradient(circle at right top, rgba(242,138,24,0.22), transparent 32%),
        linear-gradient(135deg, var(--pg-dark), #10251d);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 24px;
    padding: 20px;
    color: #fff;
    box-shadow: 0 18px 40px rgba(0,0,0,0.11);
    overflow: hidden;
}

.pg-subscription-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.13);
    color: rgba(255,255,255,0.88);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.pg-subscription-title {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.04;
    letter-spacing: -0.06em;
}

.pg-subscription-text {
    margin: 9px 0 0;
    color: rgba(255,255,255,0.78);
    max-width: 760px;
    line-height: 1.48;
}

.pg-subscription-data {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    align-content: stretch;
}

.pg-subscription-item {
    min-width: 0;
    border-radius: 18px;
    padding: 13px;
    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.13);
    backdrop-filter: blur(6px);
}

.pg-subscription-item span {
    display: block;
    color: rgba(255,255,255,0.68);
    font-size: 0.76rem;
    font-weight: 850;
    margin-bottom: 6px;
}

.pg-subscription-item strong {
    display: block;
    color: #fff;
    font-size: 1rem;
    line-height: 1.14;
    word-break: break-word;
}

.pg-subscription-status {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.8rem !important;
    color: #fff !important;
    background: rgba(34,197,94,0.28);
    border: 1px solid rgba(187,247,208,0.28);
}

.pg-subscription-status.warning {
    background: rgba(242,138,24,0.30);
    border-color: rgba(253,186,116,0.35);
}

.pg-subscription-status.danger {
    background: rgba(239,68,68,0.30);
    border-color: rgba(254,202,202,0.35);
}

.pg-dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.pg-kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--pg-border);
    border-radius: 22px;
    padding: 17px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.042);
}

.pg-kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
    background: var(--pg-dark);
    box-shadow: 0 12px 22px rgba(0,63,66,0.16);
}

.pg-kpi-icon.orange {
    background: var(--pg-orange);
    box-shadow: 0 12px 22px rgba(242,138,24,0.20);
}

.pg-kpi-icon svg {
    width: 23px;
    height: 23px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pg-kpi-body {
    min-width: 0;
}

.pg-kpi-label {
    display: block;
    color: var(--pg-muted);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 3px;
}

.pg-kpi-number {
    display: block;
    color: var(--pg-dark);
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    line-height: 1.02;
    font-weight: 950;
    letter-spacing: -0.055em;
}

.pg-kpi-note {
    display: block;
    margin-top: 5px;
    color: var(--pg-muted);
    font-size: 0.8rem;
    line-height: 1.22;
}

.pg-dashboard-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.88fr) minmax(0, 1.12fr);
    gap: 14px;
    align-items: start;
}

.pg-dashboard-stack {
    display: grid;
    gap: 14px;
}

.pg-dashboard-panel {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--pg-border);
    border-radius: 22px;
    padding: 17px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.042);
}

.pg-dashboard-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.pg-dashboard-panel h2 {
    margin: 0;
    color: var(--pg-dark);
    font-size: 1.15rem;
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.pg-dashboard-panel-subtitle {
    margin: 4px 0 0;
    color: var(--pg-muted);
    font-size: 0.84rem;
}

.pg-dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pg-orange);
    font-size: 0.84rem;
    font-weight: 900;
    white-space: nowrap;
}

.pg-dashboard-list {
    display: grid;
    gap: 8px;
}

.pg-dashboard-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid rgba(16,37,29,0.08);
}

.pg-dashboard-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.pg-dashboard-row-main {
    min-width: 0;
}

.pg-dashboard-row-title {
    display: block;
    color: var(--pg-text);
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-dashboard-row-meta {
    display: block;
    margin-top: 4px;
    color: var(--pg-muted);
    font-size: 0.82rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-dashboard-row-side {
    text-align: right;
    display: grid;
    gap: 6px;
    justify-items: end;
}

.pg-dashboard-date {
    color: var(--pg-text);
    font-size: 0.84rem;
    font-weight: 850;
    white-space: nowrap;
}

.pg-dashboard-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.74rem;
    line-height: 1.08;
    font-weight: 900;
    white-space: nowrap;
    background: rgba(0,63,66,0.08);
    color: var(--pg-dark);
}

.pg-dashboard-status.done {
    background: rgba(34,197,94,0.12);
    color: #166534;
}

.pg-dashboard-status.progress {
    background: rgba(242,138,24,0.13);
    color: #a85505;
}

.pg-dashboard-status.urgent {
    background: rgba(239,68,68,0.12);
    color: #991b1b;
}

.pg-dashboard-status.draft {
    background: rgba(100,116,139,0.12);
    color: #475569;
}

.pg-dashboard-status.cancelled {
    background: rgba(15,23,42,0.08);
    color: #475569;
}

.pg-dashboard-empty {
    border-radius: 16px;
    padding: 14px;
    background: rgba(16,37,29,0.04);
    border: 1px dashed rgba(16,37,29,0.14);
    color: var(--pg-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.pg-chart-area {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(0,63,66,0.035), rgba(242,138,24,0.035));
    border: 1px solid rgba(16,37,29,0.07);
    padding: 8px 8px 2px;
}

.pg-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

.pg-chart-grid-line {
    stroke: rgba(16,37,29,0.10);
    stroke-width: 1;
}

.pg-chart-line {
    fill: none;
    stroke: var(--pg-dark);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pg-chart-dot {
    fill: #fff;
    stroke: var(--pg-dark);
    stroke-width: 3;
}

.pg-chart-dot.current {
    fill: var(--pg-orange);
    stroke: var(--pg-orange);
}

.pg-chart-label {
    fill: var(--pg-muted);
    font-size: 13px;
    font-weight: 800;
}

.pg-chart-value {
    fill: var(--pg-dark);
    font-size: 12px;
    font-weight: 900;
}

.pg-chart-empty-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    text-align: center;
    color: var(--pg-muted);
    font-weight: 750;
    background: rgba(255,255,255,0.62);
}

.pg-dashboard-bottom {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 14px;
}

.pg-calendar-box {
    min-width: 0;
}

.pg-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--pg-dark);
    font-weight: 950;
}

.pg-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.pg-calendar-weekday {
    text-align: center;
    color: var(--pg-muted);
    font-size: 0.75rem;
    font-weight: 900;
    padding: 4px 0;
}

.pg-calendar-day {
    position: relative;
    min-height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pg-text);
    font-size: 0.84rem;
    font-weight: 850;
    background: rgba(16,37,29,0.035);
}

.pg-calendar-day.empty {
    background: transparent;
}

.pg-calendar-day.today {
    background: var(--pg-dark);
    color: #fff;
}

.pg-calendar-day.has-event::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: var(--pg-orange);
}

.pg-report-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(16,37,29,0.08);
}

.pg-report-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.pg-report-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(0,63,66,0.08);
    color: var(--pg-dark);
}

.pg-report-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pg-report-body {
    min-width: 0;
}

.pg-report-title {
    display: block;
    color: var(--pg-text);
    font-weight: 900;
    line-height: 1.18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-report-meta {
    display: block;
    margin-top: 4px;
    color: var(--pg-muted);
    font-size: 0.81rem;
    line-height: 1.25;
}

@media (max-width: 1180px) {
    .pg-subscription-panel,
    .pg-dashboard-layout,
    .pg-dashboard-bottom {
        grid-template-columns: 1fr;
    }

    .pg-subscription-data,
    .pg-dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .pg-subscription-panel {
        padding: 17px;
        border-radius: 22px;
    }

    .pg-subscription-data,
    .pg-dashboard-kpis {
        grid-template-columns: 1fr;
    }

    .pg-kpi-card {
        padding: 15px;
    }

    .pg-dashboard-panel-header,
    .pg-dashboard-row {
        grid-template-columns: 1fr;
    }

    .pg-dashboard-panel-header {
        display: grid;
    }

    .pg-dashboard-row-side {
        text-align: left;
        justify-items: start;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .pg-dashboard-row-title,
    .pg-dashboard-row-meta,
    .pg-report-title {
        white-space: normal;
    }
}

/* Dashboard più compatta - PestGeN 2.0 */
.pg-main:has(.pg-dashboard) {
    padding-top: 16px;
    padding-bottom: 16px;
}

.pg-main:has(.pg-dashboard) .pg-topbar {
    margin-bottom: 14px;
}

.pg-main:has(.pg-dashboard) .pg-page-title {
    font-size: clamp(1.48rem, 2.1vw, 1.95rem);
}

.pg-main:has(.pg-dashboard) .pg-page-subtitle {
    margin-top: 3px;
    font-size: 0.91rem;
}

.pg-dashboard {
    gap: 12px;
}

.pg-subscription-panel {
    grid-template-columns: minmax(0, 1.35fr) minmax(390px, 0.65fr);
    gap: 10px;
    border-radius: 20px;
    padding: 14px 16px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}

.pg-subscription-kicker {
    padding: 4px 9px;
    font-size: 0.70rem;
    margin-bottom: 7px;
}

.pg-subscription-title {
    font-size: clamp(1.35rem, 2.35vw, 1.78rem);
}

.pg-subscription-text {
    margin-top: 5px;
    font-size: 0.90rem;
    line-height: 1.34;
}

.pg-subscription-data {
    gap: 8px;
}

.pg-subscription-item {
    border-radius: 15px;
    padding: 10px 11px;
}

.pg-subscription-item span {
    font-size: 0.70rem;
    margin-bottom: 4px;
}

.pg-subscription-item strong {
    font-size: 0.92rem;
    line-height: 1.12;
}

.pg-subscription-status {
    min-height: 24px;
    padding: 4px 9px;
    font-size: 0.73rem !important;
}

.pg-dashboard-kpis {
    gap: 10px;
}

.pg-kpi-card {
    gap: 10px;
    border-radius: 18px;
    padding: 12px 14px;
}

.pg-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    box-shadow: 0 8px 16px rgba(0,63,66,0.14);
}

.pg-kpi-icon.orange {
    box-shadow: 0 8px 16px rgba(242,138,24,0.18);
}

.pg-kpi-icon svg {
    width: 20px;
    height: 20px;
}

.pg-kpi-label {
    font-size: 0.76rem;
    font-weight: 850;
}

.pg-kpi-number {
    font-size: clamp(1.42rem, 2.45vw, 1.82rem);
}

.pg-kpi-note {
    margin-top: 3px;
    font-size: 0.76rem;
}

.pg-dashboard-layout {
    grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.18fr);
    gap: 12px;
}

.pg-dashboard-stack,
.pg-dashboard-bottom {
    gap: 12px;
}

.pg-dashboard-panel {
    border-radius: 18px;
    padding: 13px 14px;
}

.pg-dashboard-panel-header {
    margin-bottom: 9px;
}

.pg-dashboard-panel h2 {
    font-size: 1.04rem;
    line-height: 1.12;
}

.pg-dashboard-panel-subtitle,
.pg-dashboard-link {
    font-size: 0.78rem;
}

.pg-dashboard-panel-subtitle {
    margin-top: 2px;
}

.pg-dashboard-list {
    gap: 5px;
}

.pg-dashboard-row {
    gap: 9px;
    padding: 7px 0;
}

.pg-dashboard-row-title {
    font-size: 0.91rem;
    line-height: 1.16;
}

.pg-dashboard-row-meta {
    margin-top: 2px;
    font-size: 0.76rem;
}

.pg-dashboard-row-side {
    gap: 4px;
}

.pg-dashboard-date {
    font-size: 0.78rem;
}

.pg-dashboard-status {
    padding: 3px 7px;
    font-size: 0.70rem;
}

.pg-dashboard-empty {
    border-radius: 14px;
    padding: 11px;
    font-size: 0.84rem;
    line-height: 1.34;
}

.pg-chart-area {
    border-radius: 15px;
    padding: 6px 8px 0;
}

.pg-chart-line {
    stroke-width: 3.4;
}

.pg-chart-label {
    font-size: 12px;
}

.pg-chart-value {
    font-size: 11px;
}

.pg-dashboard-bottom {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

.pg-calendar-header {
    margin-bottom: 6px;
}

.pg-calendar-grid {
    gap: 4px;
}

.pg-calendar-weekday {
    padding: 2px 0;
    font-size: 0.68rem;
}

.pg-calendar-day {
    min-height: 27px;
    border-radius: 10px;
    font-size: 0.76rem;
}

.pg-calendar-day.has-event::after {
    bottom: 3px;
    width: 4px;
    height: 4px;
}

.pg-report-row {
    gap: 8px;
    padding: 7px 0;
}

.pg-report-icon {
    width: 29px;
    height: 29px;
    border-radius: 9px;
}

.pg-report-icon svg {
    width: 17px;
    height: 17px;
}

.pg-report-title {
    font-size: 0.88rem;
    line-height: 1.14;
}

.pg-report-meta {
    margin-top: 2px;
    font-size: 0.74rem;
}

@media (max-width: 720px) {
    .pg-main:has(.pg-dashboard) {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .pg-subscription-panel {
        padding: 14px;
        border-radius: 18px;
    }

    .pg-kpi-card {
        padding: 12px;
    }
}

/* Correzione responsive dashboard mobile/tablet - PestGeN 2.0
   Questo blocco deve stare DOPO la versione compatta della dashboard,
   altrimenti le griglie desktop sovrascrivono i media query precedenti. */
@media (max-width: 1180px) {
    .pg-main:has(.pg-dashboard) .pg-subscription-panel,
    .pg-main:has(.pg-dashboard) .pg-dashboard-layout,
    .pg-main:has(.pg-dashboard) .pg-dashboard-bottom {
        grid-template-columns: minmax(0, 1fr);
    }

    .pg-main:has(.pg-dashboard) .pg-subscription-data,
    .pg-main:has(.pg-dashboard) .pg-dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .pg-main:has(.pg-dashboard) {
        padding-left: 18px;
        padding-right: 18px;
    }

    .pg-main:has(.pg-dashboard) .pg-page-title {
        font-size: 1.72rem;
        line-height: 1.06;
    }

    .pg-main:has(.pg-dashboard) .pg-page-subtitle {
        font-size: 0.95rem;
        line-height: 1.42;
    }

    .pg-main:has(.pg-dashboard) .pg-subscription-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 16px;
        overflow: hidden;
    }

    .pg-main:has(.pg-dashboard) .pg-subscription-data,
    .pg-main:has(.pg-dashboard) .pg-dashboard-kpis {
        grid-template-columns: minmax(0, 1fr);
    }

    .pg-main:has(.pg-dashboard) .pg-subscription-title {
        font-size: 1.42rem;
        line-height: 1.08;
    }

    .pg-main:has(.pg-dashboard) .pg-subscription-text {
        font-size: 0.93rem;
        line-height: 1.45;
    }

    .pg-main:has(.pg-dashboard) .pg-subscription-item {
        width: 100%;
        min-width: 0;
    }

    .pg-main:has(.pg-dashboard) .pg-kpi-card {
        width: 100%;
        min-width: 0;
    }

    .pg-main:has(.pg-dashboard) .pg-dashboard-panel-header,
    .pg-main:has(.pg-dashboard) .pg-dashboard-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .pg-main:has(.pg-dashboard) .pg-dashboard-bottom,
    .pg-main:has(.pg-dashboard) .pg-dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 430px) {
    .pg-main:has(.pg-dashboard) {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pg-main:has(.pg-dashboard) .pg-subscription-panel,
    .pg-main:has(.pg-dashboard) .pg-dashboard-panel,
    .pg-main:has(.pg-dashboard) .pg-kpi-card {
        border-radius: 16px;
    }
}

.pg-account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 16px;
    align-items: start;
}

.pg-account-card {
    background: var(--pg-card);
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-card-radius);
    padding: 20px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.042);
}

.pg-account-card + .pg-account-card {
    margin-top: 16px;
}

.pg-account-card h2 {
    margin: 0 0 6px;
    color: var(--pg-dark);
    letter-spacing: -0.04em;
    line-height: 1.15;
    font-size: 1.35rem;
}

.pg-account-card p {
    margin: 0;
    color: var(--pg-muted);
    line-height: 1.45;
}

.pg-account-form {
    margin-top: 18px;
}

.pg-account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pg-account-grid .pg-form-group-wide {
    grid-column: 1 / -1;
}

.pg-help {
    display: block;
    color: var(--pg-muted);
    margin-top: 5px;
    font-size: 0.82rem;
    line-height: 1.35;
}

.pg-account-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pg-account-actions .pg-button {
    width: auto;
    min-width: 190px;
}

.pg-account-summary {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.pg-account-summary-row {
    border: 1px solid var(--pg-border);
    border-radius: 15px;
    padding: 12px 13px;
    background: rgba(16, 37, 29, 0.025);
}

.pg-account-summary-row span {
    display: block;
    color: var(--pg-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
}

.pg-account-summary-row strong {
    display: block;
    color: var(--pg-text);
    line-height: 1.25;
    word-break: break-word;
}

/*
|--------------------------------------------------------------------------
| COMPATTAZIONE GENERALE MODULI
|--------------------------------------------------------------------------
| Queste regole sono più specifiche rispetto ai CSS dei singoli moduli,
| quindi aiutano a mantenere tutto più compatto senza dover modificare
| ogni file modulo.
|--------------------------------------------------------------------------
*/

.pg-main .pg-table-card,
.pg-main .pg-form-card,
.pg-main .pg-detail-card {
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.04);
}

.pg-main .pg-form-card {
    padding: 18px;
}

.pg-main .pg-form-section-title {
    margin-bottom: 14px;
    font-size: 1.22rem;
    line-height: 1.15;
}

.pg-main .pg-form-grid {
    gap: 12px;
}

.pg-main .pg-form-group {
    margin-bottom: 10px;
}

.pg-main .pg-form-group label {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.pg-main .pg-input,
.pg-main .pg-input-select {
    min-height: 40px;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.94rem;
}

.pg-main .pg-password-wrap .pg-input {
    padding-right: 48px;
}

.pg-main textarea.pg-input,
.pg-main .pg-input-textarea {
    min-height: 105px;
}

.pg-main .pg-help {
    margin-top: 4px;
    font-size: 0.81rem;
    line-height: 1.35;
}

.pg-main .pg-actions {
    margin-top: 18px;
    gap: 8px;
}

.pg-main .pg-button-secondary {
    border-radius: 13px;
    padding: 10px 14px;
    min-height: 40px;
    font-size: 0.92rem;
}

.pg-main .pg-button-small {
    padding: 8px 11px;
    min-height: 36px;
    border-radius: 11px;
    font-size: 0.86rem;
}

.pg-main .pg-status,
.pg-main .pg-code,
.pg-main .pg-alert-threshold {
    padding: 5px 9px;
    font-size: 0.76rem;
}

.pg-main .pg-table {
    font-size: 0.93rem;
}

.pg-main .pg-table th {
    padding: 10px 9px;
    font-size: 0.78rem;
}

.pg-main .pg-table td {
    padding: 11px 9px;
}

.pg-main .pg-muted {
    line-height: 1.38;
}

.pg-main .pg-side-summary {
    gap: 10px;
}

.pg-main .pg-side-line {
    padding: 11px 12px;
    border-radius: 14px;
}

.pg-main .pg-side-line span {
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.pg-main .pg-customers-toolbar,
.pg-main .pg-types-toolbar,
.pg-main .pg-sites-toolbar {
    margin-bottom: 14px;
    gap: 10px;
}

.pg-main .pg-customers-search,
.pg-main .pg-types-search,
.pg-main .pg-sites-search {
    gap: 8px;
}

.pg-main .pg-customer-form-layout,
.pg-main .pg-type-form-layout,
.pg-main .pg-site-form-layout,
.pg-main .pg-detail-layout {
    grid-template-columns: minmax(0, 2fr) 320px;
    gap: 16px;
}

.pg-main .pg-detail-title {
    font-size: 1.45rem;
}

.pg-main .pg-detail-meta {
    gap: 10px;
    margin-top: 14px;
}

.pg-main .pg-detail-box {
    padding: 12px;
    border-radius: 15px;
}

.pg-main .pg-point-form {
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
}

@media (max-width: 1280px) {
    :root {
        --pg-sidebar-width: 214px;
        --pg-main-padding-x: 20px;
        --pg-main-padding-y: 22px;
    }

    body {
        font-size: 14.5px;
    }

    .pg-sidebar {
        padding: 10px 10px;
    }

    .pg-menu a {
        padding: 5px 8px;
    }

    .pg-main .pg-customer-form-layout,
    .pg-main .pg-type-form-layout,
    .pg-main .pg-site-form-layout,
    .pg-main .pg-detail-layout {
        grid-template-columns: minmax(0, 2fr) 300px;
    }
}

@media (max-width: 980px) {
    :root {
        --pg-main-padding-x: 18px;
        --pg-main-padding-y: 18px;
    }

    .pg-shell {
        grid-template-columns: 1fr;
    }

    .pg-sidebar {
        position: relative;
        height: auto;
        padding: 14px;
    }

    .pg-sidebar-company {
        margin-bottom: 12px;
    }

    .pg-menu {
        grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
        gap: 5px;
    }

    .pg-menu a {
        min-height: 32px;
    }

    .pg-main {
        max-width: none;
    }

    .pg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pg-welcome,
    .pg-module-placeholder {
        grid-column: 1 / -1;
    }

    .pg-topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 18px;
    }

    .pg-main .pg-customer-form-layout,
    .pg-main .pg-type-form-layout,
    .pg-main .pg-site-form-layout,
    .pg-main .pg-detail-layout,
    .pg-account-layout {
        grid-template-columns: 1fr;
    }

    .pg-main .pg-input,
    .pg-main .pg-input-select {
        min-height: 44px;
        padding: 11px 13px;
        font-size: 1rem;
    }

    .pg-main .pg-password-wrap .pg-input {
        padding-right: 48px;
    }

    .pg-main .pg-button-secondary,
    .pg-main .pg-button {
        min-height: 44px;
    }
}

@media (max-width: 720px) {
    .pg-grid {
        grid-template-columns: 1fr;
    }

    .pg-auth-card {
        padding: 26px;
    }

    .pg-main .pg-table-card,
    .pg-main .pg-form-card,
    .pg-main .pg-detail-card {
        padding: 15px;
        border-radius: 18px;
    }

    .pg-main .pg-form-grid,
    .pg-main .pg-detail-meta,
    .pg-account-grid {
        grid-template-columns: 1fr;
    }

    .pg-account-grid .pg-form-group-wide {
        grid-column: auto;
    }

    .pg-account-actions .pg-button {
        width: 100%;
    }

    .pg-main .pg-actions .pg-button,
    .pg-main .pg-actions .pg-button-secondary {
        width: 100%;
    }

    .pg-main .pg-customers-search .pg-input,
    .pg-main .pg-customers-search select,
    .pg-main .pg-types-search .pg-input,
    .pg-main .pg-types-search select,
    .pg-main .pg-sites-search .pg-input,
    .pg-main .pg-sites-search select {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 520px) {
    :root {
        --pg-main-padding-x: 14px;
        --pg-main-padding-y: 14px;
    }

    .pg-sidebar {
        padding: 13px 12px;
    }

    .pg-menu {
        grid-template-columns: 1fr;
    }

    .pg-page-title {
        font-size: 1.6rem;
    }

    .pg-page-subtitle {
        font-size: 0.92rem;
    }
}

@media (pointer: coarse) {
    .pg-button,
    .pg-main .pg-button-secondary,
    .pg-main .pg-input,
    .pg-main .pg-input-select {
        min-height: 44px;
    }

    .pg-password-toggle {
        width: 36px;
        height: 36px;
        right: 8px;
    }
}

/*
|--------------------------------------------------------------------------
| MENU TABLET / SMARTPHONE
|--------------------------------------------------------------------------
| Su tablet stretti e smartphone la sidebar diventa un menu hamburger off-canvas da destra.
| Desktop e tablet larghi mantengono il menu laterale fisso.
*/

.pg-mobile-header,
.pg-sidebar-overlay,
.pg-sidebar-close {
    display: none;
}

.pg-mobile-header {
    color: #fff;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.11), transparent 34%),
        linear-gradient(135deg, var(--pg-dark), #10251d);
    box-shadow: 0 14px 28px rgba(0,0,0,0.13);
}

.pg-mobile-brand {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.08;
}

.pg-mobile-logo {
    font-size: 1.38rem;
    font-weight: 950;
    letter-spacing: -0.055em;
    color: #fff;
}

.pg-mobile-logo span {
    color: var(--pg-orange);
}

.pg-mobile-company {
    display: block;
    margin-top: 2px;
    max-width: 72vw;
    color: rgba(255,255,255,0.78);
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-mobile-menu-button,
.pg-sidebar-close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 13px;
    background: rgba(255,255,255,0.10);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.16s ease, transform 0.16s ease;
}

.pg-mobile-menu-button:hover,
.pg-sidebar-close:hover {
    background: rgba(255,255,255,0.16);
}

.pg-mobile-menu-button:active,
.pg-sidebar-close:active {
    transform: scale(0.97);
}

.pg-mobile-menu-button svg,
.pg-sidebar-close svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1180px), (pointer: coarse) and (max-width: 1368px) {
    body.pg-menu-open {
        overflow: hidden;
    }

    .pg-shell {
        display: block;
        min-height: 100vh;
    }

    .pg-mobile-header {
        position: sticky;
        top: 0;
        z-index: 80;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 58px;
        padding: 8px 13px;
        gap: 12px;
    }

    .pg-mobile-menu-button {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .pg-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(7, 18, 15, 0.56);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    .pg-sidebar-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .pg-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        z-index: 100;
        width: min(84vw, 314px);
        max-width: 314px;
        height: 100vh;
        height: 100dvh;
        padding: 16px 14px 20px;
        transform: translateX(106%);
        transition: transform 0.22s ease;
        box-shadow: -20px 0 44px rgba(0,0,0,0.26);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pg-sidebar.is-open {
        transform: translateX(0);
    }

    .pg-sidebar-close {
        position: absolute;
        top: 13px;
        right: 12px;
        display: inline-flex;
    }

    .pg-sidebar-logo {
        padding-right: 52px;
        margin-bottom: 3px;
        font-size: 1.48rem;
    }

    .pg-sidebar-company {
        padding-right: 52px;
        margin-bottom: 18px;
    }

    .pg-sidebar-company-name {
        font-size: 0.82rem;
    }

    .pg-sidebar-user-name {
        font-size: 0.92rem;
    }

    .pg-sidebar-user-role {
        font-size: 0.64rem;
    }

    .pg-menu {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .pg-menu a {
        min-height: 42px;
        padding: 9px 10px;
        border-radius: 13px;
        gap: 10px;
        font-size: 0.94rem;
        line-height: 1.12;
    }

    .pg-menu a:hover {
        transform: none;
    }

    .pg-menu a.active {
        background: rgba(255,255,255,0.15);
    }

    .pg-menu-icon {
        width: 20px;
        height: 20px;
        min-width: 22px;
    }

    .pg-menu-icon svg {
        width: 20px;
        height: 20px;
    }

    .pg-menu-logout {
        margin-top: 8px;
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.12);
        border-radius: 0;
    }

    .pg-menu-logout:hover {
        border-radius: 13px;
    }

    .pg-main {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 16px 14px 24px;
    }

    .pg-topbar {
        margin-bottom: 15px;
    }

    .pg-page-title {
        font-size: 1.48rem;
        line-height: 1.08;
    }

    .pg-page-subtitle {
        margin-top: 5px;
        font-size: 0.92rem;
    }
}

@media (max-width: 430px) {
    .pg-mobile-header {
        min-height: 52px;
        padding: 7px 11px;
    }

    .pg-mobile-logo {
        font-size: 1.15rem;
    }

    .pg-mobile-company {
        margin-top: 1px;
        font-size: 0.68rem;
    }

    .pg-mobile-menu-button {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .pg-sidebar {
        width: 86vw;
        padding: 15px 13px 18px;
    }

    .pg-menu a {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 0.92rem;
    }
}


/* Logo PestGeN ufficiale: resta indipendente dai dati aziendali del cliente.
   Logo rettangolare fisso, indipendente dai dati aziendali del cliente. */
img.pg-logo-text,
img.pg-sidebar-logo,
img.pg-mobile-logo {
    display: block;
    width: 90px !important;
    max-width: 90px !important;
    height: auto !important;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
}

img.pg-logo-text {
    margin: 0 0 10px;
}

img.pg-sidebar-logo {
    margin: 0 0 8px;
}

img.pg-mobile-logo {
    margin: 0;
}

@media (max-width: 1180px), (pointer: coarse) and (max-width: 1368px) {
    img.pg-sidebar-logo,
    img.pg-mobile-logo {
        width: 90px !important;
        max-width: 90px !important;
        padding-right: 0;
    }

    img.pg-sidebar-logo {
        margin-bottom: 8px;
    }
}

@media (max-width: 430px) {
    img.pg-logo-text,
    img.pg-sidebar-logo,
    img.pg-mobile-logo {
        width: 90px !important;
        max-width: 90px !important;
        border-radius: 6px;
    }
}

/* PWA: logo visibile rettangolare e popup automatico nascosto su desktop. */
.pg-pwa-install {
    grid-template-columns: 90px minmax(0, 1fr) auto;
}

.pg-pwa-install-logo {
    width: 90px !important;
    max-width: 90px !important;
    height: auto !important;
    border-radius: 6px !important;
    object-fit: contain !important;
    box-shadow: none !important;
}

.pg-pwa-guide-head img {
    width: 90px !important;
    max-width: 90px !important;
    height: auto !important;
    border-radius: 6px !important;
    object-fit: contain !important;
    box-shadow: none !important;
}

@media (min-width: 1181px) and (pointer: fine) {
    .pg-pwa-install,
    .pg-pwa-install.is-visible {
        display: none !important;
    }
}

@media (max-width: 430px) {
    .pg-pwa-install {
        grid-template-columns: 90px minmax(0, 1fr) auto;
    }

    .pg-pwa-install-logo,
    .pg-pwa-guide-head img {
        width: 90px !important;
        max-width: 90px !important;
        height: auto !important;
        border-radius: 6px !important;
    }
}

