﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: none !important;
    height: 100%;
    overflow-x: hidden;
}

input.custom-checkbox {
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #092651 !important;
    border-radius: 4px !important;
    position: relative !important;
    cursor: pointer !important;
    margin-top: 7px !important;
}

    input.custom-checkbox:checked {
        background-color: #092651 !important;
        border-color: #092651 !important;
    }

        input.custom-checkbox:checked::after {
            content: "✔" !important;
            color: white !important;
            font-size: 14px !important;
            position: absolute !important;
            top: 0 !important;
            left: 3px !important;
        }

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.rz-fileupload-row > div:nth-child(3) {
    display: none !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,...) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.color-blu-scuro-dc5 {
    color: #092651
}

.background-blu-scuro-dc5 {
    background-color: #092651
}

.color-blu-chiaro-dc5 {
    color: #1cbcf1
}

.background-blu-chiaro-dc5 {
    background-color: #1cbcf1
}

.rz-cell-data {
    color: #092651 !important;
}

td {
    border: none !important;
}

.rz-pager-element {
    border-radius: 50% !important;
    color: #092651 !important;
}

.rz-state-active {
    background-color: #1cbcf1 !important;
}

/* GLOBAL DIALOG STYLES (influiscono su tutti i breakpoint) */
.rz-dialog {
    position: relative !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
    background: #092651 !important;
    color: white !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 80vw !important;
    max-width: 1200px !important;
}

.rz-dialog-titlebar {
    background: #1cbcf1 !important;
    color: white !important;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.8rem 1rem;
    border-bottom: none !important;
}

.rz-dialog-actions {
    background: #2a2a3b !important;
    padding: 1rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

    .rz-dialog-actions .rz-button {
        border-radius: 8px !important;
        padding: 0.5rem 1.2rem !important;
    }

.rz-dialog-content {
    padding: 1.5rem !important;
    overflow-y: auto !important;
    flex: 1;
}

/* FIX PER SCHERMI MEDI E GRANDI */
@media (min-width: 769px) {
    .rz-dialog-wrapper {
        position: fixed !important;
        inset: 0;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(0,0,0,0.35) !important;
        overflow: auto !important;
        height: 100vh !important;
        z-index: 2000 !important;
    }

    .rz-dialog {
        max-height: 90vh !important;
    }

    .rz-dialog-content {
        /* se serve: limitiamo anche lo scroll interno */
        max-height: calc(90vh - /* header + footer altezza stimata */ 7rem) !important;
    }
}
/* INTERMEDIO – da 641px a 768px */
@media (min-width: 641px) and (max-width: 768px) {
    .rz-dialog-wrapper {
        position: fixed !important;
        inset: 0;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(0,0,0,0.35) !important;
        overflow: auto !important;
        height: 100vh !important;
        z-index: 2000 !important;
    }

    .rz-dialog {
        width: 90vw !important; /* magari un po’ più stretto rispetto desktop */
        max-width: 700px !important;
        max-height: 85vh !important;
    }

    .rz-dialog-content {
        max-height: calc(85vh - 7rem) !important;
        overflow-y: auto !important;
    }
}
/* MOBILE (già funzionante) – manteniamo quello che hai */
@media (max-width: 768px) {
    .rz-dialog-wrapper {
        align-items: flex-start !important;
    }

    .rz-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: auto !important;
        max-height: 100dvh !important;
        border-radius: 12px !important;
        margin: 0 !important;
    }

    .rz-dialog-titlebar {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .rz-dialog-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
    }

    .rz-dialog-content {
        max-height: calc(100dvh - 7rem) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Altri stili non modificati seguono … */
:root {
    --rz-grid-border-radius: 30px !important;
    --rz-grid-background-color: #f5f7fa !important;
}

.rz-data-grid {
    border-radius: 30px !important;
    overflow: hidden !important;
    background: var(--rz-grid-background-color) !important;
}

main {
    color: #e0e0e0 !important;
    background-color: #0064ab !important;
}

.page-title {
    color: white;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 1.8rem;
}

.eventi-container {
    padding: 2rem !important;
    /*max-width: 1200px !important;*/
    margin: auto !important;
}

.title-row {
    display: flex;
    justify-content: space-between;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    padding: 8px 6px;
    font-size: 0.95rem;
    outline: none;
    min-width: 120px;
}

    .search-input::placeholder {
        color: rgba(255,255,255,0.4);
    }

.search-clear {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
}

    .search-clear:hover {
        background: rgba(255,255,255,0.02);
        color: var(--text);
    }

.page-size-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    font-size: 0.95rem;
    color: #e6f7ff;
}

    .page-size-wrap span {
        font-weight: 600;
    }

.page-size-select {
    background-color: #222a39;
    color: #e6f7ff;
    border: 1px solid #1cbcf1;
    border-radius: 8px;
    padding: 4px 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
}

    .page-size-select:hover {
        background-color: #1a2333;
        border-color: #00e5ff;
    }

    .page-size-select:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.3);
    }

.btn {
    border-radius: 8px;
    padding: 8px 14px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-buttons {
    display: flex;
    gap: 8px;
    justify-content: end;
}

.delete-btn {
    background-color: #dc2626;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 6px 12px rgba(28,188,241,0.15);
}

    .delete-btn i {
        font-size: 1rem;
    }

    .delete-btn:hover:not(:disabled) {
        background-color: #b91c1c;
        transform: translateY(-2px);
        box-shadow: 0 6px 14px rgba(220, 38, 38, 0.35);
    }

    .delete-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        box-shadow: none;
    }

@media (max-width: 640px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .toolbar-buttons {
        justify-content: flex-end;
        display: flex;
        width: 100%;
    }

    .delete-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 1rem;
        border-radius: 10px;
    }
}

.nuovo-evento-btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    background-color: #1cbcf1;
    color: white;
    box-shadow: 0 6px 12px rgba(28,188,241,0.15);
}

.header-container {
    background-color: #092651 !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    border-radius: 30px !important;
    margin-bottom: 10px !important;
}

.custom-button.rz-button.rz-variant-text {
    background-color: transparent !important;
    color: #092651 !important;
}

    .custom-button.rz-button.rz-variant-text:hover,
    .custom-button.rz-button.rz-variant-text:focus {
        background-color: transparent !important;
        box-shadow: none !important;
        color: #092651 !important;
    }

.custom-button .rz-button-icon {
    color: #092651 !important;
    fill: #092651 !important;
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.03));
    padding: 8px;
    border-radius: 999px;
    width: 100%;
    max-width: 520px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.02);
}

    .search-wrap:focus-within {
        border-color: var(--accent);
        box-shadow: 0 6px 18px rgba(28,188,241,0.08);
    }

.divider {
    border: 0;
    height: 1px;
    background-color: rgba(255,255,255,0.4);
    margin: 10px 0 20px 0;
}

.rz-dialog-title, .rz-dialog-side-title {
    color: white !important
}

div.rz-dialog.rz-open {
    width: 80vw !important;
    max-width: 1200px !important;
    max-height: 900px !important;
}

div.rz-dialog-content {
    height: 100% !important;
    overflow: auto;
}

/* Solo mobile */
@media (max-width: 768px) {

    div.rz-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: auto !important;
        max-height: 100dvh !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        margin: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    div.rz-dialog {
        overflow: hidden !important;
    }

    div.rz-dialog-titlebar {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    div.rz-dialog-buttons {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding-top: .5rem !important;
        padding-bottom: .5rem !important;
        margin-top: 0 !important;
        background: inherit;
        backdrop-filter: inherit;
        -webkit-backdrop-filter: inherit;
    }

    div.rz-dialog-content {
        max-height: calc(100dvh - 7rem) !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: auto;
        max-width: 100%;
    }

    .rz-dialog-content {
        overflow-y: auto !important;
        overflow-x: auto !important;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .IconNav {
        font-size: 30px !important;
        padding-right: 0.3em !important;
    }
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.badge-success {
    background-color: #28a745;
}

.badge-warning {
    background-color: #ffc107;
    color: #111;
}

.badge-purple {
    background-color: #6f42c1;
}

.badge-info {
    background-color: #17a2b8
}

.badge-secondary {
    background-color: #6c757d;
}

.row-detail {
    margin: 10px 0 0 40px;
}

.row-detail-meta {
    display: grid;
    grid-template-columns: 0.6fr 0.3fr 1fr;
    gap: .25rem .75rem;
    padding: .5rem .75rem;
    background: #fff;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    margin-bottom: .75rem;
}

.meta-item {
    display: flex;
    gap: .5rem;
}

.meta-label {
    font-weight: 600;
    color: #092651;
    white-space: nowrap;
}

.meta-value {
    white-space: pre-wrap;
    color: #333;
}

/**/
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px 20px;
}

.row-2 {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px 20px;
}

.row-3 {
    display: grid;
    gap: 16px 20px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-column: 1 / -1;
}

@media (max-width: 992px) {
    .row-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .row-3 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 820px) {
    .row-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.col-span-2 {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed #e5e7eb;
}

@media (max-width: 760px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-form {
        min-width: 100%;
    }
}

.hint {
    color: #6b7280;
    font-size: .85rem;
}

.glass-page {
    min-height: 100vh;
    padding: 12px;
    background: radial-gradient(1100px 700px at 20% -10%, #143261 20%, transparent 60%), radial-gradient(900px 600px at 120% 110%, #0e2446 25%, transparent 60%), linear-gradient(180deg, #0b1f3a 0%, #0b1f3a 100%);
}

/* card vetrate più “forti” */
.glass-card {
    position: relative;
    background: rgba(16, 41, 78, 0.18);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.18);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    color: #fff;
}

    .glass-card.soft {
        background: rgba(16, 41, 78, 0.14);
    }

    /* riflesso lieve sul bordo alto per effetto vetro */
    .glass-card::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0) 40%);
        pointer-events: none;
    }

    /* card esterna a tutta altezza */
    .glass-card.tall {
        min-height: calc(100vh - 24px); /* 24 = padding della pagina * 2 */
        display: flex;
        flex-direction: column;
    }

/* griglia 50/50 che riempie l’altezza della card */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

    .two-col.grow {
        flex: 1;
    }
/* spinge la griglia a riempire la tall card */
.kpi-col {
    display: grid;
    gap: 12px;
}

.chart-col {
    display: flex;
}

.glass-card.fill {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* tipografia KPI */
.kpi-title {
    font-size: .95rem;
    opacity: .9;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.kpi-green {
    color: #24d17e;
}

.kpi-red {
    color: #ff5c5c;
}

.kpi-badge {
    font-size: .8rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: .5rem;
}

.badge-green {
    background: rgba(36,209,126,.15);
    color: #24d17e;
}

.badge-red {
    background: rgba(255,92,92,.15);
    color: #ff5c5c;
}

.chart-title {
    font-size: .95rem;
    opacity: .95;
    margin-bottom: 8px;
}

/* fallback per browser senza backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-card, .glass-card.soft {
        background: rgba(16, 41, 78, 0.65);
    }
}

/* mobile: impila tutto */
@media (max-width: 900px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}


.validation-message {
    position: static !important;
    display: block !important;
    width: 100% !important;
}


/*Customizzazione modal per conferma approvazione budget*/

.confirm-budget-dialog div.rz-dialog.rz-open,
.confirm-budget-dialog div.rz-dialog {
    width: 520px !important;
    max-width: 520px !important;
}

@media (max-width: 600px) {
    .confirm-budget-dialog div.rz-dialog.rz-open,
    .confirm-budget-dialog div.rz-dialog {
        width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
    }
}

/* Compattazione contenuti */
.confirm-budget-dialog .rz-dialog-content {
    padding: 16px 18px !important;
}

.confirm-budget-dialog .rz-dialog-footer,
.confirm-budget-dialog .rz-dialog-buttonpane {
    padding: 12px 18px !important;
    display: flex !important;
    gap: 12px !important;
    justify-content: flex-end !important;
}

    .confirm-budget-dialog .rz-dialog-footer .rz-button,
    .confirm-budget-dialog .rz-dialog-buttonpane .rz-button {
        width: auto !important;
        min-width: 120px !important;
    }


/*Customizzazione label messaggio errore comune per p.IVA e CF*/
/* messaggio unico centrato */
.piva-cf-message .validation-message {
    display: block;
    text-align: center;
    margin-top: 0.25rem;
}

/* label rosse */
.piva-cf-invalid-label {
    color: #dc3545 !important;
}

.piva-cf-invalid-input {
    border: 1px solid #dc3545 !important;
    box-shadow: none !important;
}
