:root {
    --jp-font-sans: "Segoe UI Variable", "Segoe UI", "Bahnschrift", sans-serif;
    --jp-font-display: "Segoe UI Variable", "Segoe UI", "Bahnschrift", sans-serif;
    --jp-bg: #f3f6fb;
    --jp-surface: #ffffff;
    --jp-surface-muted: #f8fafc;
    --jp-surface-strong: #0f172a;
    --jp-border: #d9e2ec;
    --jp-border-strong: #b8c6d6;
    --jp-text: #172033;
    --jp-text-muted: #5f6b7a;
    --jp-primary: #0b5cab;
    --jp-primary-strong: #083b6f;
    --jp-primary-soft: #eaf2fb;
    --jp-success: #1f7a4d;
    --jp-warning: #b76e00;
    --jp-danger: #c13f3f;
    --jp-shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.06);
    --jp-shadow-md: 0 24px 60px rgba(15, 23, 42, 0.12);
    --jp-radius-sm: 12px;
    --jp-radius-md: 18px;
    --jp-radius-lg: 28px;
 }

 html,
 body {
    margin: 0;
    min-height: 100%;
    background: var(--jp-bg);
    color: var(--jp-text);
    font-family: var(--jp-font-sans);
 }

 body {
    line-height: 1.4;
 }

*, *::before, *::after {
    box-sizing: border-box;
 }

.ml-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--jp-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ml-nav-link .e-icons {
    font-size: 18px;
    color: var(--jp-text-muted);
}

.ml-nav-link:hover {
    background: var(--jp-surface-muted);
    border-color: rgba(184, 198, 214, 0.8);
}

.ml-nav-link.active {
    background: linear-gradient(135deg, rgba(11, 92, 171, 0.14), rgba(11, 92, 171, 0.04));
    border-color: rgba(11, 92, 171, 0.24);
    color: var(--jp-primary-strong);
}

.ml-nav-link.active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: var(--jp-primary);
}

.ml-nav-link.active .e-icons {
    color: var(--jp-primary);
}

h1:focus {
    outline: none;
}

#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;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

.tw-page {
    display: grid;
    gap: 24px;
}

.tw-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.tw-kicker,
.tw-card-kicker {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--jp-primary);
    font-weight: 700;
}

.tw-title {
    margin: 8px 0 0;
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-family: var(--jp-font-display);
    font-weight: 700;
    line-height: 1.2;
}

.tw-card-title {
    margin: 8px 0 0;
    font-size: clamp(1.2rem, 1.4vw, 1.65rem);
    font-family: var(--jp-font-display);
    font-weight: 700;
    line-height: 1.2;
}

.tw-copy {
    max-width: 72ch;
    margin: 10px 0 0;
    color: var(--jp-text-muted);
}

.tw-copy--muted {
    font-size: 0.85em;
    opacity: 0.85;
}

.tw-copy--error {
    margin: 6px 0 0;
    font-size: 0.85em;
    color: var(--jp-danger);
}

.tw-grid {
    display: grid;
    gap: 24px;
}

.tw-grid--two {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.jp-recon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.jp-recon--ok {
    color: #14532d;
    background: #dcfce7;
    border-color: #86efac;
}

.jp-recon--warning {
    color: #7c2d12;
    background: #ffedd5;
    border-color: #fdba74;
}

.jp-recon--pending,
.jp-recon--neutro {
    color: #374151;
    background: #f3f4f6;
    border-color: #d1d5db;
}

.jp-recon-dialog .e-dlg-content {
    padding-top: 10px;
}

.jp-recon-detail {
    display: grid;
    gap: 16px;
}

.jp-recon-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--jp-border);
    border-radius: 12px;
    background: var(--jp-surface-muted);
}

.jp-recon-section {
    display: grid;
    gap: 10px;
}

.jp-recon-section h4 {
    margin: 0;
    font-size: 15px;
}

.jp-anomalia-row {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--jp-border);
    border-radius: 10px;
    background: var(--jp-surface);
}

.jp-anomalia-row p {
    margin: 3px 0;
}

.jp-sev {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-top: 5px;
}

.jp-sev--alta {
    background: #dc2626;
}

.jp-sev--media {
    background: #f97316;
}

.jp-sev--bassa {
    background: #2563eb;
}

.jp-timbrature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jp-timbrature-list span {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid var(--jp-border);
    border-radius: 999px;
    font-size: 12px;
    background: var(--jp-surface-muted);
}

.jp-recon-form {
    padding: 14px;
    border: 1px solid rgba(11, 92, 171, 0.22);
    border-radius: 12px;
    background: var(--jp-primary-soft);
}

.jp-modal-spacer {
    flex: 1;
}

.tw-card,
.tw-subcard {
    background: var(--jp-surface);
    border: 1px solid rgba(184, 198, 214, 0.84);
    border-radius: 24px;
    box-shadow: var(--jp-shadow-sm);
}

.tw-card {
    padding: 24px;
}

.tw-card--wide {
    width: 100%;
}

.tw-subcard {
    padding: 18px;
    background: linear-gradient(180deg, rgba(234, 242, 251, 0.4), rgba(248, 250, 252, 0.9));
}

.tw-card-head,
.tw-subcard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.tw-subcard-head span,
.tw-table-meta,
.tw-inline-meta {
    color: var(--jp-text-muted);
    font-size: 13px;
}

.tw-form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tw-field--wide {
    grid-column: 1 / -1;
}

.tw-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    min-height: 44px;
}

.tw-radio {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: var(--jp-text);
    cursor: pointer;
}

.tw-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    border: 1px solid rgba(184, 198, 214, 0.9);
    accent-color: var(--jp-accent, #2d6cdf);
    cursor: pointer;
}

.tw-pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-x: auto;
    max-width: 100%;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f5f7fa;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.55;
    color: var(--jp-text);
}

.tw-page,
.tw-card {
    min-width: 0;
}

.tw-table {
    width: 100%;
    table-layout: fixed;
    word-break: break-word;
}

.tw-form-grid--event {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tw-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    align-items: end;
    padding-top: 12px;
}

.tw-field,
.tw-check {
    display: grid;
    gap: 8px;
}

.tw-field span,
.tw-check span {
    font-size: 13px;
    font-weight: 700;
    color: var(--jp-text-muted);
}

.tw-field input,
.tw-field select,
.tw-field textarea,
.tw-field .input-date {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(184, 198, 214, 0.9);
    background: #fff;
    color: var(--jp-text);
    font: inherit;
}

.tw-field--compact input {
    min-width: 88px;
}

.tw-check {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.tw-field-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.tw-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--jp-text-muted);
    cursor: pointer;
}

.tw-checkbox input[type="checkbox"] {
    min-height: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border-radius: 3px;
    border: 1px solid rgba(184, 198, 214, 0.9);
    accent-color: var(--jp-accent, #2563eb);
    flex-shrink: 0;
}

.tw-field-error {
    margin-top: 6px;
    font-size: 12px;
    color: #b91c1c;
}

.tw-actions,
.tw-actions-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.tw-btn,
.tw-link {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.tw-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--jp-primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(11, 92, 171, 0.18);
}

.tw-btn--ghost {
    background: rgba(11, 92, 171, 0.08);
    color: var(--jp-primary-strong);
    box-shadow: none;
}

.tw-link {
    background: transparent;
    color: var(--jp-primary);
    text-decoration: underline;
    padding: 0;
}

.tw-link--danger {
    color: var(--jp-danger);
}

.tw-cell-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.tw-cell-actions__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.tw-table-shell {
    overflow-x: auto;
    margin-top: 18px;
}

.tw-bulk-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin-top: 8px;
    background: rgba(234, 242, 251, 0.6);
    border: 1px solid rgba(184, 198, 214, 0.7);
    border-radius: 12px;
}

.tw-table {
    width: 100%;
    border-collapse: collapse;
}

.tw-table th,
.tw-table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(217, 226, 236, 0.84);
    vertical-align: top;
}

.tw-table th {
    font-size: 12px;
    color: var(--jp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tw-empty-row td {
    text-align: center;
    color: var(--jp-text-muted);
    font-style: italic;
}

.tw-alert {
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 600;
}

.tw-alert--success {
    background: rgba(31, 122, 77, 0.12);
    color: var(--jp-success);
}

.tw-alert--danger {
    background: rgba(193, 63, 63, 0.12);
    color: var(--jp-danger);
}

.tw-alert--warning {
    background: rgba(183, 110, 0, 0.14);
    color: var(--jp-warning);
}



/* ── Tab navigation ─────────────────────────────── */
.tw-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid rgba(184, 198, 214, 0.6);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tw-tab-item {
    border: 0;
    background: transparent;
    padding: 10px 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--jp-text-muted);
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.tw-tab-item:hover {
    color: var(--jp-primary);
}

.tw-tab-item--active {
    color: var(--jp-primary-strong);
    border-bottom-color: var(--jp-primary);
    background: rgba(11, 92, 171, 0.05);
}

/* ── Split layout (lista 38% + editor 62%) ─────── */
.tw-split {
    display: grid;
    grid-template-columns: 38% 1fr;
    gap: 24px;
    align-items: start;
}

.tw-split-list {
    min-width: 0;
}

.tw-split-editor {
    min-width: 0;
    background: var(--jp-surface);
    border: 1px solid rgba(184, 198, 214, 0.84);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--jp-shadow-sm);
}

.tw-split-placeholder {
    color: var(--jp-text-muted);
    font-size: 14px;
    padding: 32px 0;
    text-align: center;
}

/* ── Detail panel (pannello contestuale operatore) */
.tw-detail-panel {
    background: var(--jp-surface);
    border: 1px solid rgba(11, 92, 171, 0.22);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--jp-shadow-md);
    margin-top: 16px;
}

.tw-detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(184, 198, 214, 0.5);
}

.tw-detail-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.tw-row--selected td {
    background: rgba(11, 92, 171, 0.05);
}

.tw-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--jp-text-muted);
    margin: 20px 0 12px;
}

.tw-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 16px;
    background: var(--jp-surface-muted);
    border-radius: 14px;
    font-size: 14px;
    align-items: center;
}

.tw-summary-row strong {
    flex: 1;
}

.tw-assegnati-list {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.tw-assegnati-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(234, 242, 251, 0.6);
    border-radius: 10px;
    font-size: 13px;
}

.tw-assegnati-item .tw-table-meta {
    flex: 1;
}

@media (max-width: 720px) {
    .tw-card {
        padding: 18px;
    }

    .tw-page-head,
    .tw-card-head,
    .tw-subcard-head {
        flex-direction: column;
    }

    .tw-split {
        grid-template-columns: 1fr;
    }
}

/* ---------- Syncfusion modal shells (jp-modal-*) ---------- */
.jp-modal-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.jp-modal-header .tw-card-title {
    margin: 0;
    font-size: 18px;
}

.jp-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 14px;
    margin-top: 6px;
}

.jp-modal-grid--three {
    grid-template-columns: repeat(3, 1fr);
}

.jp-modal-grid--single {
    grid-template-columns: 1fr;
}

.jp-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.jp-field > label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--jp-text-muted, #6b7280);
}

.jp-field--inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.jp-field--full {
    grid-column: 1 / -1;
}

.jp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.jp-modal-section {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 14px;
    margin-top: 14px;
}

.jp-modal-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.jp-modal-section-head strong {
    font-size: 13px;
}

.jp-textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    background: #fff;
}

.jp-textarea:focus {
    outline: none;
    border-color: #0b5cab;
    box-shadow: 0 0 0 2px rgba(11, 92, 171, 0.2);
}

.tw-field--readonly {
    background: #f3f4f6;
    color: #374151;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 13px;
}

.jp-template-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.jp-template-card {
    padding: 12px;
    border: 1px solid rgba(11, 92, 171, 0.2);
    border-radius: 10px;
    background: rgba(234, 242, 251, 0.35);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
}

.jp-template-card:hover {
    border-color: var(--jp-primary-strong, #0b5cab);
    background: rgba(234, 242, 251, 0.7);
}

.jp-template-card--active {
    border-color: var(--jp-primary-strong, #0b5cab);
    background: rgba(11, 92, 171, 0.1);
}

.jp-template-card strong {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.jp-template-card span {
    font-size: 10px;
    color: var(--jp-text-muted, #6b7280);
    line-height: 1.3;
}

.jp-blocco-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.jp-blocco-row:last-child {
    border-bottom: none;
}

@media (max-width: 600px) {
    .jp-modal-grid,
    .jp-modal-grid--three {
        grid-template-columns: 1fr;
    }

    .jp-blocco-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- SfDateTimePicker readonly: bordo stabile (no flicker on hover) ---------- */
.jp-dt-locked.e-input-group,
.jp-dt-locked.e-input-group:not(.e-disabled):hover,
.jp-dt-locked.e-input-group:not(.e-disabled).e-input-focus,
.jp-dt-locked.e-input-group.e-control-wrapper,
.jp-dt-locked.e-input-group.e-control-wrapper:not(.e-disabled):hover,
.jp-dt-locked.e-input-group.e-control-wrapper:not(.e-disabled).e-input-focus {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
}

.jp-dt-locked.e-input-group input.e-input,
.jp-dt-locked.e-input-group input.e-input[readonly] {
    cursor: default;
    caret-color: transparent;
    background: transparent;
}

/* ---------- AssegnazioneTurnoModal specific ---------- */
.jp-badge-dipendente {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(234, 242, 251, 0.6);
    border-radius: 10px;
    margin-bottom: 14px;
}

.jp-badge-dipendente strong {
    display: block;
    font-size: 15px;
}

.jp-segmented {
    display: flex;
    gap: 8px;
}

.jp-segmented .e-btn {
    flex: 1;
}

.jp-inline-add {
    display: flex;
    gap: 8px;
    align-items: center;
}

.jp-inline-add > :first-child {
    flex: 1;
}

/* ---------- Regole nastro row (uguale spazio per evento e comportamento) ---------- */
.jp-regola-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.jp-regola-row:last-child {
    border-bottom: none;
}

@media (max-width: 600px) {
    .jp-regola-row {
        grid-template-columns: 1fr;
    }
}

/* ---------- Calendario mensile (vista griglia dipendenti x giorni) ---------- */

.jp-calmese-controls {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.jp-calmese-table {
    border-collapse: separate;
    border-spacing: 0;
    width: auto;
    min-width: 100%;
    table-layout: fixed;
}

.jp-calmese-table thead.jp-calmese-head th {
    position: sticky;
    top: 0;
    background: var(--jp-surface);
    z-index: 2;
    padding: 6px 4px;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid var(--jp-border);
}

.jp-calmese-table th.jp-calmese-dip-col,
.jp-calmese-table td.jp-calmese-dip-col {
    position: sticky;
    left: 0;
    background: var(--jp-surface);
    z-index: 1;
    min-width: 200px;
    max-width: 260px;
    text-align: left;
    padding: 10px 12px;
    border-right: 1px solid var(--jp-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jp-calmese-table thead th.jp-calmese-dip-col {
    z-index: 3;
}

.jp-calmese-day-col {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
}

.jp-calmese-day-num {
    font-weight: 700;
    color: var(--jp-text);
    line-height: 1.1;
}

.jp-calmese-day-dow {
    font-size: 10px;
    color: var(--jp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.jp-calmese-cell {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    line-height: 34px;
    font-weight: 600;
    font-size: 13px;
    color: var(--jp-text);
    border-right: 1px solid var(--jp-border);
    border-bottom: 1px solid var(--jp-border);
    position: relative;
}

.jp-calmese-cell--rosso {
    background: #fef2f2;
    color: #991b1b;
}

.jp-calmese-cell--clickable {
    cursor: pointer;
    transition: filter 0.12s ease;
}

.jp-calmese-cell--clickable:hover {
    filter: brightness(0.9);
}

.jp-calmese-cell--rosso .jp-calmese-day-num,
.jp-calmese-cell--rosso .jp-calmese-day-dow {
    color: #991b1b;
}

.jp-calmese-cell--riposo {
    background: #e2e8f0;
    color: #475569;
}

.jp-calmese-cell--evento {
    background: #ecfccb;
    color: #3f6212;
}

.jp-calmese-cell--eccezione {
    background: #fde68a;
    color: #92400e;
    font-weight: 600;
}

.jp-cell-evento-attivo {
    box-shadow: inset 0 0 0 2px rgba(11, 92, 171, 0.45);
}

/* Riconciliazione: stato OK / errori — selettori a doppia classe per battere
   .jp-turno-fascia-* (definite piu' avanti nel file) e qualsiasi sfondo turno.
   Obiettivo UX: a colpo d'occhio si vedono solo verde (ok) e rosso (errori). */
.jp-calmese-cell.jp-calmese-recon-ok {
    background: #16a34a;
    background-image: none;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px #15803d;
}

.jp-calmese-cell.jp-calmese-recon-warning {
    background: #dc2626;
    background-image: none;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px #991b1b;
}

.jp-calmese-recon-pending,
.jp-calmese-recon-neutro {
    background: #f1f5f9;
    color: #334155;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.jp-calmese-cell.jp-calmese-recon-warning::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1px #7f1d1d;
}

/* Card "Eventi del mese" sopra la griglia del calendario mensile */
.jp-eventi-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.jp-evento-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
    background: var(--jp-surface-muted);
    border-radius: 10px;
    border: 1px solid var(--jp-border);
}

.jp-evento-item strong {
    color: var(--jp-text);
}

/* Hint inline compatto per spiegare la differenza tra "Data inizio ciclo"
   e "Attiva dal" nel modale di assegnazione turno. Deliberatamente discreto:
   niente background, font piccolo, grigio muted. */
.jp-date-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 14px 0 12px 0;
    font-size: 12px;
    color: var(--jp-text-muted);
    line-height: 1.4;
}

.jp-date-hint .e-icons {
    font-size: 14px;
    margin-top: 1px;
    flex-shrink: 0;
}

.jp-date-hint strong {
    color: var(--jp-text);
    font-weight: 600;
}

/* Pill stato servizio sincronizzazione timbratore (global, non scoped —
   il componente ServizioImportPill è reso come child component e non
   riceve la scope-id del parent). */
.jp-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    user-select: none;
}

.jp-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.jp-pill--ok {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.jp-pill--ko {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.jp-pill--unknown {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
}

.jp-pill--info {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #bfdbfe;
}

.jp-cell-sospeso {
    background-image: repeating-linear-gradient(135deg, rgba(193, 63, 63, 0.18) 0 4px, transparent 4px 8px);
}

.jp-cell-override::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--jp-primary);
    box-shadow: 0 0 0 1px var(--jp-surface);
}

/* Warning: turno fisso (o override) su giorno di festa italiana.
   Bordo arancione spesso + triangolino in basso a sinistra, cosi' l'indicatore
   non collide con il pallino blu di jp-cell-override in alto a destra. */
.jp-cell-festa-warning {
    outline: 2px solid #f59e0b;
    outline-offset: -2px;
}

.jp-cell-festa-warning::before {
    content: "⚠";
    position: absolute;
    bottom: 1px;
    left: 2px;
    font-size: 9px;
    color: #b45309;
    line-height: 1;
}

/* 8 sfondi deterministici per TipoTurno — HSL con testo leggibile */
.jp-turno-bg-0 { background: hsl(210, 70%, 85%); color: #0b3a63; }
.jp-turno-bg-1 { background: hsl(145, 55%, 82%); color: #1f4d36; }
.jp-turno-bg-2 { background: hsl(40,  80%, 82%); color: #6b4a00; }
.jp-turno-bg-3 { background: hsl(280, 55%, 86%); color: #4a2567; }
.jp-turno-bg-4 { background: hsl(0,   65%, 86%); color: #6b1f1f; }
.jp-turno-bg-5 { background: hsl(185, 60%, 82%); color: #0c4a52; }
.jp-turno-bg-6 { background: hsl(95,  50%, 82%); color: #2e4a13; }
.jp-turno-bg-7 { background: hsl(325, 55%, 87%); color: #611a47; }

/* Sfondi per fascia oraria — coerenti con /mio-calendario */
.jp-turno-fascia-mattina    { background: hsl(40, 80%, 78%);  color: #5a3a00; }
.jp-turno-fascia-pomeriggio { background: hsl(15, 75%, 78%);  color: #6b1f0a; }
.jp-turno-fascia-notte      { background: hsl(240, 45%, 38%); color: #ffffff; }
.jp-turno-fascia-default    { background: hsl(210, 70%, 85%); color: #0b3a63; }

/* ==========================================================
   Reconnect modal (Blazor Server circuit lost)
   Regole globali: il dialog deve essere leggibile anche se
   gli asset scoped non vengono più serviti.
   ========================================================== */

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}

#components-reconnect-modal {
    width: min(420px, calc(100vw - 32px));
    margin: auto;
    padding: 28px;
    border: 1px solid var(--jp-border-strong, #b8c6d6);
    border-radius: 20px;
    background: var(--jp-surface, #ffffff);
    color: var(--jp-text, #172033);
    font-family: var(--jp-font-sans, "Segoe UI", sans-serif);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

#components-reconnect-modal::backdrop {
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

#components-reconnect-modal .components-reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#components-reconnect-modal p {
    margin: 0;
    text-align: center;
    font-size: 15px;
    line-height: 1.55;
    color: var(--jp-text, #172033);
}

#components-reconnect-modal button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    background: var(--jp-primary, #0b5cab);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

#components-reconnect-modal button:hover {
    background: var(--jp-primary-strong, #083b6f);
}

#components-reconnect-modal button:active {
    transform: translateY(1px);
}

#components-reconnect-modal .components-rejoining-animation {
    position: relative;
    width: 64px;
    height: 64px;
}

#components-reconnect-modal .components-rejoining-animation div {
    position: absolute;
    border: 3px solid var(--jp-primary, #0b5cab);
    opacity: 1;
    border-radius: 50%;
    animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

#components-reconnect-modal .components-rejoining-animation div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes components-rejoining-animation {
    0%   { top: 32px; left: 32px; width: 0;    height: 0;    opacity: 0; }
    4.9% { top: 32px; left: 32px; width: 0;    height: 0;    opacity: 0; }
    5%   { top: 32px; left: 32px; width: 0;    height: 0;    opacity: 1; }
    100% { top: 0;    left: 0;    width: 64px; height: 64px; opacity: 0; }
}

/* Badge versione (jpre-2026-5): vigente / pianificata sulle card di TurniCicliPage. */
.tw-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 999px;
    vertical-align: middle;
}
.tw-badge-vigente {
    background: #dcfce7;
    color: #166534;
}
.tw-badge-planned {
    background: #fef3c7;
    color: #92400e;
    cursor: help;
}
.tw-text-danger { color: #b91c1c; }
.jp-conferma-versione { display: flex; flex-direction: column; gap: 12px; }
.jp-conferma-versione .tw-alert { margin: 0; }
.jp-impatto-list { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.jp-impatto-altri { color: #64748b; font-style: italic; }
