#app {
    width: 100%;
    height: 100%;
}

/* the font of the theme also outside the Radzen components */
body {
    font-family: var(--rz-text-font-family);
}

/* dialogs and side dialogs: the theme 0.75 over the dark mask reads grey when the content sits on the glass,
   as in most modals (the notifications and quick actions are covered by white rows); still blurred */
:root {
    --rz-dialog-background-color: rgba(255, 255, 255, 0.88);
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--rz-link-color);
}

.rz-scheduler .rz-slot.drag-hover-active {
    background-color: rgba(84, 130, 218, 0.4) !important;
    background-image: none !important; /* covers the start/end of day shading gradient while dragging */
    outline: 2px dashed #5482DA !important;
    outline-offset: -2px;
}

.filled-icon {
    font-variation-settings: 'FILL' 1;
    font-size: 20px !important;
}

.rz-cell-data {
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

/* the rows open their detail: the hover colors are the ones of the theme */
.rz-grid-table tbody tr:hover td {
    cursor: pointer;
}

.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 {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMD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jEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 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;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.detail-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    width: 100%;
}

.detail-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2.5rem 3rem;
    border-radius: 12px;
    background: var(--rz-base-100);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    animation: fadeIn 0.25s ease-in;
}

.detail-loading-text {
    color: var(--rz-text-disabled-color);
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar: colonna flex, cosi' la versione dell'app resta in fondo, staccata dalle voci del menu */
.rz-sidebar.ifit-sidebar {
    display: flex;
    flex-direction: column;
}

    .rz-sidebar.ifit-sidebar > .rz-panel-menu {
        flex: 0 1 auto;
        min-height: 0;
    }

.sidebar-version {
    margin-top: auto;
    padding: 1rem 0.75rem 1.25rem;
    display: flex;
    justify-content: center;
}

.sidebar-version-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    background-color: var(--rz-base-100);
    border: 1px solid var(--rz-base-300);
    color: #000000;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    user-select: all;
}

    .sidebar-version-pill .rzi {
        font-size: 0.95rem;
        color: var(--rz-primary);
    }

/* ── Responsive toolbars (homepage, scheduler) ──
   .toolbar-wrap      buttons go to a new line instead of squeezing together
   .btn-icon-tablet   secondary buttons: icon only up to 1024px, the text stays in the title */
.toolbar-wrap {
    flex-wrap: wrap !important;
    row-gap: 0.5rem;
    column-gap: 0.5rem;
}

@media (max-width: 1024px) {
    .btn-icon-tablet .rz-button-text {
        display: none;
    }

    .btn-icon-tablet.rz-button .rz-button-box {
        gap: 0;
    }
}

/* touch devices: buttons big enough for a finger */
@media (pointer: coarse) {
    .toolbar-wrap .rz-button {
        min-height: 40px;
        min-width: 40px;
    }
}

/* price form fields without a price in the customer price scheme */
.price-missing {
    --rz-form-field-shadow: inset 0 0 0 1px var(--rz-warning);
    --rz-form-field-hover-shadow: inset 0 0 0 1px var(--rz-warning-dark);
    --rz-form-field-focus-shadow: inset 0 0 0 2px var(--rz-warning);
    --rz-form-field-label-color: var(--rz-warning-dark);
    --rz-form-field-label-focus-color: var(--rz-warning-dark);
}

/* vehicle history: the jobs without stock items */
.rz-data-row.vehicle-history-no-items > td {
    background-color: var(--rz-warning-lighter) !important;
}

/* ── Dialogs on tablet and phone ──────────────────────────────────────────
   Only up to 1024px: on PC the dialogs are unchanged. The width given to a dialog is kept,
   but never wider or higher than the screen; the content scrolls. */
@media (max-width: 1024px) {
    .rz-dialog:not(.rz-dialog-confirm):not(.rz-dialog-alert) {
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
    }

    /* the minimum width of the content of a dialog, set for the PC, would push it out of the screen */
    .rz-dialog .dialog-fluid {
        min-width: 0 !important;
    }
}

/* phone: almost the whole width, with a small margin */
@media (max-width: 600px) {
    .rz-dialog:not(.rz-dialog-confirm):not(.rz-dialog-alert) {
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
}

/* touch: a close button easier to tap */
@media (max-width: 1024px) and (pointer: coarse) {
    .rz-dialog-titlebar .rz-dialog-titlebar-close {
        width: 2.5rem;
        height: 2.5rem;
    }
}
