:root {
    --sv-primary: #119ca6;
    --sv-primary-dark: #0d7780;
    --sv-accent: #c80064;
    --sv-success: #2fbf71;
    --sv-danger: #e11d48;
    --sv-warning: #f59e0b;
    --sv-focus: rgba(17, 156, 166, 0.18);
    --sv-accent-soft: rgba(200, 0, 100, 0.12);
    --sv-bg: #eef4f7;
    --sv-surface: rgba(255, 255, 255, 0.94);
    --sv-ink: #102033;
    --sv-muted: #64748b;
    --sv-border: rgba(15, 23, 42, 0.10);
    --sv-shadow: 0 18px 55px rgba(15, 23, 42, 0.14);
    --sv-shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.10);
    --sv-radius: 28px;
}

body.sv-app.sv-legacy-page {
    display: block;
    min-width: 0;
    height: auto;
    padding: clamp(10px, 2vw, 22px);
    overflow-x: hidden;
    user-select: auto;
}

.sv-legacy-page .space {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 1180px);
    min-height: 76px;
    margin: 0 auto 14px;
    padding: 9px 15px;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    box-shadow: var(--sv-shadow-soft);
    backdrop-filter: blur(15px);
    text-align: left !important;
}

.sv-legacy-wide .space {
    width: min(100%, 1560px);
}

.sv-legacy-page .space::after {
    content: "Centro Spazio Vitale";
    color: var(--sv-primary-dark);
    font-size: clamp(.92rem, 2vw, 1.12rem);
    font-weight: 900;
    letter-spacing: .02em;
}

.sv-legacy-page .space img {
    width: 58px !important;
    height: 58px !important;
    padding: 4px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(15,23,42,.12);
}

.sv-legacy-page #settingcontainer,
.sv-legacy-page .containerlogin {
    width: min(100%, 1180px);
    min-height: 0;
    height: auto;
    margin: 0 auto 28px;
    padding: clamp(15px, 2.6vw, 28px);
    overflow-x: auto;
    color: var(--sv-ink);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: var(--sv-radius);
    background: var(--sv-surface);
    box-shadow: var(--sv-shadow);
}

.sv-legacy-wide #settingcontainer {
    width: min(100%, 1560px);
    max-width: none;
}

.sv-legacy-page #settingcontainer.scroll {
    overflow: auto;
}

.sv-legacy-page #settingcontainer > .row:first-child,
.sv-legacy-page #settingcontainer > .text-left:first-child {
    margin-bottom: 10px;
}

.sv-legacy-page .row > [class*="col-"] {
    min-width: 0;
}

.sv-legacy-page h1,
.sv-legacy-page h2,
.sv-legacy-page h3,
.sv-legacy-page h4,
.sv-legacy-page h5 {
    color: var(--sv-ink) !important;
    text-shadow: none;
}

.sv-legacy-page h1 {
    margin: 8px 0 18px;
    font-size: clamp(1.45rem, 4vw, 2.25rem);
    font-weight: 900;
    line-height: 1.12;
}

.sv-legacy-page h2 {
    margin: 22px 0 10px;
    font-size: clamp(1.15rem, 3vw, 1.55rem);
    font-weight: 850;
}

.sv-legacy-page h3,
.sv-legacy-page h4 {
    font-weight: 800;
}

.sv-legacy-page hr {
    margin: 18px 0;
    border-color: var(--sv-border);
}

.sv-legacy-page .btn,
.sv-legacy-page button:not(.close) {
    min-height: 44px;
    margin: 4px 2px;
    padding: 9px 16px;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 7px 18px rgba(15,23,42,.10);
    font-weight: 850;
    line-height: 1.25;
    white-space: normal;
    transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.sv-legacy-page .btn:hover,
.sv-legacy-page button:not(.close):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15,23,42,.14);
}

.sv-legacy-page .btn-primary,
.sv-legacy-page button.btn-primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark));
}

.sv-legacy-page .btn-warning,
.sv-legacy-page button.btn-warning {
    color: #3f2a00;
    border-color: transparent;
    background: linear-gradient(135deg, #fbbf24, var(--sv-warning));
}

.sv-legacy-page .btn-danger,
.sv-legacy-page button.btn-danger {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #fb7185, var(--sv-danger));
}

.sv-legacy-page .btn-success,
.sv-legacy-page button.btn-success {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #34d399, #15803d);
}

.sv-legacy-page .btn-secondary,
.sv-legacy-page button.btn-secondary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #64748b, #334155);
}

.sv-legacy-page .form-control,
.sv-legacy-page .form-control2,
.sv-legacy-page .form-control3,
.sv-legacy-page .form-control4,
.sv-legacy-page .form-control5,
.sv-legacy-page .form-control6,
.sv-legacy-page select,
.sv-legacy-page textarea,
.sv-legacy-page input[type="text"],
.sv-legacy-page input[type="date"],
.sv-legacy-page input[type="number"],
.sv-legacy-page input[type="password"],
.sv-legacy-page input[type="search"] {
    min-height: 46px;
    margin-top: 4px;
    margin-bottom: 8px;
    padding: 10px 13px;
    color: var(--sv-ink);
    border: 2px solid var(--sv-border);
    border-radius: 14px;
    background-color: #fff;
    box-shadow: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.sv-legacy-page textarea.form-control,
.sv-legacy-page textarea {
    min-height: 118px;
    line-height: 1.55;
    resize: vertical;
}

.sv-legacy-page select:not([multiple]) {
    padding-right: 40px;
    cursor: pointer;
}

.sv-legacy-page .form-control:focus,
.sv-legacy-page .form-control2:focus,
.sv-legacy-page .form-control3:focus,
.sv-legacy-page .form-control4:focus,
.sv-legacy-page .form-control5:focus,
.sv-legacy-page .form-control6:focus,
.sv-legacy-page select:focus,
.sv-legacy-page textarea:focus,
.sv-legacy-page input:focus {
    border-color: var(--sv-primary);
    outline: 0;
    box-shadow: 0 0 0 5px var(--sv-focus);
}

.sv-legacy-page input[type="checkbox"],
.sv-legacy-page input[type="radio"] {
    width: 20px;
    height: 20px;
    min-height: 0;
    margin: 3px 7px 3px 2px;
    accent-color: var(--sv-primary);
    vertical-align: middle;
}

.sv-legacy-page label {
    color: var(--sv-ink);
    font-weight: 700;
}

.sv-legacy-page .table-responsive,
.sv-legacy-page .table-responsive-sm {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    -webkit-overflow-scrolling: touch;
}

.sv-legacy-page table.table {
    width: 100%;
    margin: 12px 0 20px;
    color: var(--sv-ink);
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 9px 25px rgba(15,23,42,.08);
}

.sv-legacy-wide table.table {
    min-width: 720px;
}

.sv-legacy-page table.table th,
.sv-legacy-page table.table td {
    padding: 12px 13px;
    border: 0;
    border-right: 1px solid var(--sv-border);
    border-bottom: 1px solid var(--sv-border);
    border-radius: 0;
    text-align: left;
    vertical-align: middle;
}

.sv-legacy-page table.table tr > :last-child {
    border-right: 0;
}

.sv-legacy-page table.table tbody tr:last-child > td {
    border-bottom: 0;
}

.sv-legacy-page table.table thead th,
.sv-legacy-page table.table thead td,
.sv-legacy-page table.table tr.tablecolor > th,
.sv-legacy-page table.table tr.tablecolor > td,
.sv-legacy-page table.table tr#header > th,
.sv-legacy-page table.table tr#header > td {
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary-dark), var(--sv-primary));
    font-weight: 850;
}

.sv-legacy-page table.table tbody tr:hover > td {
    background-color: rgba(17,156,166,.07);
}

.sv-legacy-page table.table a:not(.btn) {
    color: var(--sv-primary-dark);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.sv-legacy-page .card,
.sv-legacy-page .collapse.show,
.sv-legacy-page .collapsing {
    border: 1px solid var(--sv-border);
    border-radius: 18px;
    background: rgba(255,255,255,.82);
}

.sv-legacy-page .collapse.show,
.sv-legacy-page .collapsing {
    margin: 7px 0 12px;
    padding: 13px;
}

.sv-legacy-page .modal-content {
    overflow: hidden;
    color: var(--sv-ink);
    border: 0;
    border-radius: 22px;
    box-shadow: var(--sv-shadow);
}

.sv-legacy-page .modal-header,
.sv-legacy-page .modal-footer {
    border-color: var(--sv-border);
}

.sv-legacy-page [style*="color: #FFF"],
.sv-legacy-page [style*="color: #fff"],
.sv-legacy-page [style*="color:white"],
.sv-legacy-page [style*="color: white"] {
    color: var(--sv-ink) !important;
}

.sv-legacy-page .col-12.text-left[style*="color"] {
    margin: 6px 0;
    padding: 15px;
    border: 1px solid var(--sv-border);
    border-radius: 18px;
    background: rgba(17,156,166,.07);
}

.sv-legacy-login .space,
.sv-legacy-login #settingcontainer,
.sv-legacy-login .containerlogin,
.sv-legacy-form .space,
.sv-legacy-form #settingcontainer {
    width: min(100%, 980px);
}

.sv-legacy-login .containerlogin {
    max-width: 560px;
    padding: clamp(20px, 5vw, 42px);
}

.sv-legacy-login .container > .row > .col-12[style] {
    color: #fff;
    border: 0 !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark)) !important;
    box-shadow: var(--sv-shadow-soft);
}

.sv-legacy-login .container > .row > .col-12[style] h1 {
    color: #fff !important;
}

body.sv-app.sv-signature-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: clamp(10px, 3vw, 28px);
    overflow: hidden;
    user-select: none;
}

.sv-signature-page .signature-pad {
    width: min(100%, 900px);
    height: min(100%, 650px);
    max-width: none;
    max-height: none;
    padding: clamp(10px, 2vw, 18px);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 26px;
    box-shadow: var(--sv-shadow);
}

.sv-signature-page .signature-pad--body {
    overflow: hidden;
    border: 2px dashed rgba(17,156,166,.32);
    border-radius: 18px;
    background: #fff;
}

.sv-signature-page .signature-pad--footer {
    color: var(--sv-muted);
    font-size: .84rem;
    font-weight: 800;
}

.sv-signature-page .signature-pad--actions .button {
    min-height: 44px;
    padding: 9px 16px;
    color: var(--sv-ink);
    border: 1px solid var(--sv-border);
    border-radius: 999px;
    background: #fff;
    font-weight: 850;
}

.sv-signature-page .signature-pad--actions .save {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark));
}

@media (max-width: 767.98px) {
    body.sv-app.sv-legacy-page {
        padding: 8px;
    }

    .sv-legacy-page .space {
        min-height: 62px;
        margin-bottom: 8px;
        padding: 7px 10px;
        border-radius: 19px;
    }

    .sv-legacy-page .space img {
        width: 46px !important;
        height: 46px !important;
        border-radius: 14px;
    }

    .sv-legacy-page #settingcontainer,
    .sv-legacy-page .containerlogin {
        margin-bottom: 12px;
        padding: 13px;
        border-radius: 20px;
    }

    .sv-legacy-page #settingcontainer > .row:first-child > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: left !important;
    }

    .sv-legacy-page .form-control,
    .sv-legacy-page .form-control2,
    .sv-legacy-page .form-control3,
    .sv-legacy-page .form-control4,
    .sv-legacy-page .form-control5,
    .sv-legacy-page .form-control6,
    .sv-legacy-page select,
    .sv-legacy-page textarea,
    .sv-legacy-page input[type="text"],
    .sv-legacy-page input[type="date"],
    .sv-legacy-page input[type="number"],
    .sv-legacy-page input[type="password"],
    .sv-legacy-page input[type="search"] {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
        font-size: 16px;
    }

    .sv-legacy-page table.table {
        min-width: 640px;
        font-size: .83rem;
    }

    .sv-legacy-page .row > [class*="col-"]:has(> table.table),
    .sv-legacy-page .row > [class*="col-"]:has(> .table-responsive),
    .sv-legacy-page .row > [class*="col-"]:has(> .table-responsive-sm) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sv-legacy-wide .row > [class*="col-"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sv-legacy-page table.table th,
    .sv-legacy-page table.table td {
        padding: 10px;
    }

    .sv-legacy-page .btn,
    .sv-legacy-page button:not(.close) {
        min-height: 44px;
        padding: 9px 13px;
    }

    body.sv-app.sv-signature-page {
        padding: 8px;
    }

    .sv-signature-page .signature-pad {
        height: 100%;
        padding: 9px;
        border-radius: 18px;
    }

    .sv-signature-page .signature-pad--actions {
        gap: 7px;
    }

    .sv-signature-page .signature-pad--actions .column {
        display: flex;
        flex: 1 1 auto;
        gap: 6px;
        padding: 0;
    }

    .sv-signature-page .signature-pad--actions .button {
        width: auto;
        flex: 1 1 auto;
        margin: 0;
    }
}

body.sv-app {
    min-height: 100vh;
    margin: 0;
    color: var(--sv-ink);
    background:
        radial-gradient(circle at top left, rgba(17, 156, 166, 0.18), transparent 34rem),
        radial-gradient(circle at 90% 10%, rgba(200, 0, 100, 0.12), transparent 28rem),
        linear-gradient(135deg, #f7fbfc 0%, var(--sv-bg) 52%, #e3edf1 100%);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.sv-site-pioppo {
    --sv-primary: #1597ad;
    --sv-primary-dark: #0f6172;
    --sv-accent: #65c7d7;
    --sv-location-soft: rgba(21, 151, 173, 0.14);
    --sv-location-strong: #0f6172;
    --sv-focus: rgba(21, 151, 173, 0.18);
    --sv-accent-soft: rgba(101, 199, 215, 0.18);
    background:
        radial-gradient(circle at 8% 8%, rgba(101, 199, 215, 0.26), transparent 31rem),
        radial-gradient(circle at 90% 14%, rgba(21, 151, 173, 0.18), transparent 30rem),
        linear-gradient(135deg, #f4fcff 0%, #e7f6f9 52%, #d8eef3 100%);
}

body.sv-site-lampedusa {
    --sv-primary: #0f7fc0;
    --sv-primary-dark: #075985;
    --sv-accent: #f5b642;
    --sv-location-soft: rgba(15, 127, 192, 0.14);
    --sv-location-strong: #075985;
    --sv-focus: rgba(15, 127, 192, 0.18);
    --sv-accent-soft: rgba(245, 182, 66, 0.20);
    background:
        radial-gradient(circle at 8% 8%, rgba(245, 182, 66, 0.24), transparent 30rem),
        radial-gradient(circle at 90% 14%, rgba(15, 127, 192, 0.20), transparent 32rem),
        linear-gradient(135deg, #f5fbff 0%, #e7f4fb 52%, #d7ebf7 100%);
}

.sv-page {
    width: min(100% - 32px, 1180px);
    margin: 0 auto;
    padding: 18px 0 34px;
}

.sv-topbar {
    position: sticky;
    top: 8px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(16px);
    box-shadow: var(--sv-shadow-soft);
}

.sv-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sv-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--sv-shadow-soft);
}

.sv-brand-kicker {
    margin: 0;
    color: var(--sv-primary-dark);
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sv-brand-title {
    margin: 2px 0 0;
    color: var(--sv-ink);
    font-size: clamp(1.18rem, 2vw, 1.75rem);
    font-weight: 900;
    line-height: 1.05;
    text-shadow: none;
}

.sv-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.sv-user-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 7px;
    border: 1px solid var(--sv-border);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}

.sv-user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-accent));
    font-size: 0.95rem;
    font-weight: 900;
}

.sv-user-meta {
    display: grid;
    min-width: 0;
    line-height: 1.05;
}

.sv-user-meta strong {
    max-width: 190px;
    overflow: hidden;
    color: var(--sv-ink);
    font-size: 0.92rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sv-user-meta small {
    color: var(--sv-muted);
    font-size: 0.75rem;
    font-weight: 750;
}

.sv-logout-button,
.sv-structure-switch {
    border: 0;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.sv-logout-button {
    padding: 10px 14px;
    color: #fff;
    background: #111827;
}

.sv-structure-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 13px 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark));
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.sv-logout-button:hover,
.sv-structure-switch:hover {
    transform: translateY(-2px);
    opacity: 0.94;
}

.sv-location-banner {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: clamp(18px, 3vw, 26px);
    border: 2px solid var(--sv-primary);
    border-radius: var(--sv-radius);
    background: linear-gradient(135deg, var(--sv-location-soft), rgba(255,255,255,0.82));
    box-shadow: var(--sv-shadow);
}

.sv-location-banner::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 10px;
    background: linear-gradient(180deg, var(--sv-primary), var(--sv-accent));
}

.sv-location-mark {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-accent));
    box-shadow: var(--sv-shadow-soft);
    font-size: 2.15rem;
}

.sv-location-copy p,
.sv-location-copy h2,
.sv-location-copy span {
    margin: 0;
}

.sv-location-copy p {
    color: var(--sv-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.sv-location-copy h2 {
    color: var(--sv-location-strong);
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    font-weight: 950;
    line-height: 0.95;
    text-shadow: none;
}

.sv-location-copy span {
    display: block;
    margin-top: 8px;
    color: var(--sv-muted);
    font-weight: 800;
}

.sv-location-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.sv-location-stats span {
    min-width: 96px;
    padding: 11px 13px;
    border: 1px solid var(--sv-border);
    border-radius: 18px;
    background: rgba(255,255,255,0.76);
    color: var(--sv-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
}

.sv-location-stats strong {
    display: block;
    color: var(--sv-ink);
    font-size: 1.35rem;
    line-height: 1;
}

.sv-panel {
    margin-bottom: 18px;
    padding: clamp(18px, 3vw, 24px);
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius);
    background: var(--sv-surface);
    box-shadow: var(--sv-shadow-soft);
    backdrop-filter: blur(12px);
}

.sv-step-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark));
    font-size: 0.75rem;
    font-weight: 950;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sv-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.sv-panel-head-compact {
    margin-bottom: 12px;
}

.sv-panel-title {
    margin: 0;
    color: var(--sv-ink);
    font-size: clamp(1.32rem, 2.3vw, 1.95rem);
    font-weight: 950;
    letter-spacing: -0.02em;
    text-shadow: none;
}

.sv-panel-description {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--sv-muted);
    font-size: 1rem;
}

.sv-search-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.sv-search-field {
    position: relative;
}

.sv-search-field::before {
    content: "⌕";
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    color: var(--sv-muted);
    font-size: 1.35rem;
    font-weight: 900;
    pointer-events: none;
}

.sv-search-field .form-control {
    width: 100%;
    min-height: 62px;
    margin: 0;
    padding: 0.95rem 3.1rem 0.95rem 3.15rem;
    border: 2px solid var(--sv-border);
    border-radius: 20px;
    color: var(--sv-ink);
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    font-size: 1.06rem;
    font-weight: 750;
}

.sv-search-field .form-control:focus {
    border-color: var(--sv-primary);
    box-shadow: 0 0 0 5px var(--sv-focus);
    outline: none;
}

.sv-clear-search {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    color: var(--sv-muted);
    background: #eef2f7;
    font-size: 1.35rem;
    font-weight: 900;
}

.sv-clear-search:hover {
    color: #fff;
    background: var(--sv-danger);
}

.sv-search-filters {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--sv-border);
    border-radius: 999px;
    background: #fff;
}

.sv-search-filters button {
    border: 0;
    border-radius: 999px;
    padding: 10px 12px;
    color: var(--sv-muted);
    background: transparent;
    font-size: 0.86rem;
    font-weight: 900;
    white-space: nowrap;
}

.sv-search-filters button.is-active {
    color: #fff;
    background: var(--sv-primary-dark);
}

.sv-search-status {
    margin: 12px 0 0;
    color: var(--sv-muted);
    font-weight: 800;
}

.sv-search-card.is-loading .sv-search-status::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 999px;
    vertical-align: -2px;
    animation: sv-spin 850ms linear infinite;
}

@keyframes sv-spin { to { transform: rotate(360deg); } }

.sv-patient-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
}

.sv-patient-card {
    cursor: pointer;
    border: 1px solid var(--sv-border);
    border-left: 7px solid var(--sv-success);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.sv-patient-card:hover,
.sv-patient-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15,23,42,0.13);
}

.sv-patient-card.is-dimesso {
    border-left-color: var(--sv-danger);
    background: linear-gradient(90deg, rgba(225,29,72,0.06), #fff 24%);
}

.sv-patient-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 15px;
}

.sv-patient-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sv-patient-title-row h3 {
    margin: 0;
    color: var(--sv-ink);
    font-size: 1.14rem;
    font-weight: 950;
}

.sv-patient-code {
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--sv-primary-dark);
    background: var(--sv-location-soft);
    font-size: 0.78rem;
    font-weight: 950;
}

.sv-patient-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.sv-status-badge,
.sv-structure-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 950;
}

.sv-status-badge.is-attivo {
    color: #05603a;
    background: rgba(47,191,113,0.14);
}

.sv-status-badge.is-attivo::before { content: "●"; }

.sv-status-badge.is-dimesso {
    color: #991b1b;
    background: rgba(225,29,72,0.14);
}

.sv-status-badge.is-dimesso::before { content: "●"; }

.sv-structure-badge.is-current {
    color: var(--sv-primary-dark);
    background: var(--sv-location-soft);
}

.sv-structure-badge.is-other {
    color: #92400e;
    background: rgba(245,158,11,0.16);
}

.sv-open-patient {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark));
    font-weight: 950;
    box-shadow: 0 8px 18px rgba(15,23,42,0.14);
}

.sv-patient-details {
    display: grid;
    grid-template-columns: minmax(160px, 0.55fr) minmax(180px, 1fr);
    gap: 10px;
    padding: 0 15px 15px;
}

.sv-patient-data {
    padding: 12px;
    border: 1px solid var(--sv-border);
    border-radius: 16px;
    background: #f8fafc;
}

.sv-patient-data span {
    display: block;
    margin-bottom: 4px;
    color: var(--sv-muted);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sv-patient-data strong,
.sv-patient-data a {
    color: var(--sv-ink);
    font-size: 0.95rem;
    font-weight: 900;
    text-decoration: none;
}

.sv-patient-data.is-phone {
    background: #fff;
}

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

.sv-actions-priority {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.sv-action-section-title {
    margin: 22px 0 12px;
    color: var(--sv-muted);
    font-size: 0.82rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sv-actions-grid .btnadmin,
.sv-actions-grid .btn-primary {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 148px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: transparent;
    box-shadow: none;
}

.sv-action-card {
    position: relative;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 148px;
    padding: 16px;
    text-align: left;
    color: var(--sv-ink) !important;
    border: 1px solid var(--sv-border) !important;
    border-radius: 24px !important;
    background: #fff !important;
    box-shadow: var(--sv-shadow-soft);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.sv-action-card::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -34px;
    width: 96px;
    height: 96px;
    border-radius: 999px;
    background: var(--sv-location-soft);
    transition: transform 180ms ease, background 180ms ease;
}

.sv-action-card:hover,
.sv-action-card:focus {
    transform: translateY(-3px);
    border-color: var(--sv-primary) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.sv-action-card:hover::after,
.sv-action-card:focus::after {
    transform: scale(1.18);
}

.sv-action-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.sv-action-icon {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
    border-radius: 16px;
    color: var(--sv-primary-dark);
    background: var(--sv-location-soft);
    font-size: 1.24rem;
    font-weight: 950;
}

.sv-action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--sv-muted);
    font-weight: 950;
    line-height: 1;
}

.sv-action-badge.is-danger {
    color: #fff;
    background: var(--sv-danger);
}

.sv-action-badge.is-success {
    color: #fff;
    background: var(--sv-success);
}

.sv-action-body {
    position: relative;
    z-index: 1;
}

.sv-action-title {
    display: block;
    color: var(--sv-ink);
    font-size: 1rem;
    font-weight: 950;
    line-height: 1.08;
}

.sv-action-text {
    display: block;
    margin-top: 7px;
    color: var(--sv-muted);
    font-size: 0.8rem;
    font-weight: 750;
    line-height: 1.22;
}

.sv-action-card.is-primary {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark)) !important;
}

.sv-action-card.is-primary .sv-action-title,
.sv-action-card.is-primary .sv-action-text {
    color: #fff;
}

.sv-action-card.is-primary .sv-action-icon {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.sv-action-card.is-accent .sv-action-icon {
    color: var(--sv-accent);
    background: var(--sv-accent-soft);
}

.sv-footer-note {
    margin: 18px 0 0;
    color: var(--sv-muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 900px) {
    .sv-page {
        width: min(100% - 22px, 760px);
        padding-top: 10px;
    }

    .sv-topbar {
        position: static;
        align-items: stretch;
        flex-direction: column;
        border-radius: 28px;
    }

    .sv-top-actions {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }

    .sv-user-box,
    .sv-structure-switch {
        width: 100%;
        justify-content: center;
    }

    .sv-location-banner {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .sv-location-stats {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .sv-location-stats span {
        flex: 1 1 120px;
    }

    .sv-search-layout {
        grid-template-columns: 1fr;
    }

    .sv-search-filters {
        width: 100%;
        justify-content: space-between;
        border-radius: 18px;
    }

    .sv-search-filters button {
        flex: 1;
    }

    .sv-actions-grid,
    .sv-actions-priority {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 560px) {
    .sv-page {
        width: min(100% - 16px, 460px);
    }

    .sv-brand-title {
        font-size: 1.22rem;
    }

    .sv-logo {
        width: 52px;
        height: 52px;
    }

    .sv-user-box {
        border-radius: 22px;
        flex-wrap: wrap;
    }

    .sv-user-meta {
        flex: 1 1 140px;
    }

    .sv-logout-button {
        flex: 1 1 100%;
    }

    .sv-location-banner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .sv-location-mark {
        margin: 0 auto;
    }

    .sv-location-copy h2 {
        font-size: 2.6rem;
    }

    .sv-panel {
        padding: 16px;
        border-radius: 22px;
    }

    .sv-panel-head {
        display: block;
    }

    .sv-search-field .form-control {
        min-height: 58px;
        font-size: 0.96rem;
    }

    .sv-patient-main {
        display: block;
    }

    .sv-open-patient {
        width: 100%;
        margin-top: 14px;
    }

    .sv-patient-details {
        grid-template-columns: 1fr;
    }

    .sv-actions-grid,
    .sv-actions-priority {
        grid-template-columns: 1fr;
    }

    .sv-action-card,
    .sv-actions-grid .btnadmin,
    .sv-actions-grid .btn-primary {
        min-height: 118px;
    }
}

.sv-search-filters {
    flex-wrap: wrap;
}

.sv-search-filters button {
    min-height: 38px;
}

.sv-patient-code {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.sv-patient-code strong {
    color: var(--sv-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sv-patient-code em {
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--sv-primary-dark);
    background: var(--sv-location-soft);
    font-style: normal;
    font-weight: 950;
}

.sv-tipo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 950;
    line-height: 1;
}

.sv-tipo-badge.is-ambulatorio {
    color: #075985;
    background: rgba(14, 165, 233, 0.14);
}

.sv-tipo-badge.is-domiciliare {
    color: #92400e;
    background: rgba(245, 158, 11, 0.16);
}

.sv-tipo-badge.is-non-indicato {
    color: var(--sv-muted);
    background: #f1f5f9;
}

.sv-actions-grid {
    gap: 18px;
}

.sv-actions-grid .btnadmin,
.sv-actions-grid .btn-primary {
    min-height: 156px;
}

.sv-action-card {
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 156px;
    padding: 18px 16px;
    text-align: center;
    border-radius: 28px !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96)) !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

.sv-action-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 5px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, var(--sv-primary), var(--sv-accent));
}

.sv-action-card::after {
    right: 50%;
    bottom: -58px;
    width: 132px;
    height: 132px;
    transform: translateX(50%);
    opacity: 0.72;
}

.sv-action-card:hover,
.sv-action-card:focus {
    transform: translateY(-5px) scale(1.01);
}

.sv-action-card:hover::after,
.sv-action-card:focus::after {
    transform: translateX(50%) scale(1.16);
}

.sv-action-top {
    justify-content: center;
    align-items: center;
}

.sv-action-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 20px;
    font-size: 1.35rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55), 0 10px 22px rgba(15,23,42,0.10);
}

.sv-action-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    min-width: 38px;
    height: 34px;
    border: 3px solid #fff;
    box-shadow: 0 10px 20px rgba(15,23,42,0.16);
}

.sv-action-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
}

.sv-action-title {
    max-width: 100%;
    font-size: 1.05rem;
    line-height: 1.12;
    text-align: center;
}

.sv-action-text {
    max-width: 18rem;
    min-height: 2.05em;
    margin: 8px auto 0;
    font-size: 0.82rem;
    line-height: 1.22;
    text-align: center;
}

.sv-action-card.is-primary {
    background:
        radial-gradient(circle at 50% 118%, rgba(255,255,255,0.22), transparent 70px),
        linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark)) !important;
}

.sv-action-card.is-primary::before {
    background: rgba(255,255,255,0.76);
}

.sv-action-card.is-accent {
    border-color: rgba(200, 0, 100, 0.18) !important;
}

body.sv-site-pioppo .sv-location-banner {
    border-width: 3px;
    box-shadow: 0 18px 55px rgba(15, 97, 114, 0.20);
}

body.sv-site-lampedusa .sv-location-banner {
    border-width: 3px;
    box-shadow: 0 18px 55px rgba(7, 89, 133, 0.20);
}

@media (max-width: 900px) {
    .sv-search-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sv-search-filters button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .sv-search-filters {
        grid-template-columns: 1fr;
    }

    .sv-action-card,
    .sv-actions-grid .btnadmin,
    .sv-actions-grid .btn-primary {
        min-height: 136px;
    }
}


.sv-ops-panel {
    margin-bottom: 18px;
    padding: clamp(18px, 3vw, 24px);
    border: 1px solid rgba(255,255,255,0.78);
    border-radius: var(--sv-radius);
    background: rgba(255,255,255,0.88);
    box-shadow: var(--sv-shadow-soft);
}

.sv-ops-head {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
}

.sv-ops-head h2 {
    margin: 0;
    color: var(--sv-ink);
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    font-weight: 950;
    text-shadow: none;
}

.sv-ops-head p {
    margin: 0;
    color: var(--sv-muted);
    font-weight: 700;
}

.sv-ops-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.sv-kpi-card {
    position: relative;
    overflow: hidden;
    display: grid;
    min-height: 138px;
    padding: 18px;
    border: 1px solid var(--sv-border);
    border-radius: 24px;
    background: #fff;
    color: var(--sv-ink);
    text-align: left;
    box-shadow: 0 12px 30px rgba(15,23,42,0.08);
    transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.sv-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: var(--sv-primary);
}

.sv-kpi-card:hover,
.sv-kpi-card:focus {
    transform: translateY(-3px);
    border-color: rgba(15,23,42,0.18);
    box-shadow: 0 18px 38px rgba(15,23,42,0.14);
}

.sv-kpi-card.is-good::before { background: var(--sv-success); }
.sv-kpi-card.is-watch::before { background: var(--sv-warning); }
.sv-kpi-card.is-urgent::before { background: var(--sv-danger); }

.sv-kpi-label {
    color: var(--sv-muted);
    font-size: 0.76rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sv-kpi-card strong {
    margin-top: 6px;
    color: var(--sv-ink);
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    font-weight: 950;
    line-height: 1;
}

.sv-kpi-card small {
    align-self: end;
    color: var(--sv-muted);
    font-size: 0.88rem;
    font-weight: 760;
    line-height: 1.25;
}

.sv-mini-bars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.sv-mini-bars > div {
    display: grid;
    grid-template-columns: auto auto minmax(80px, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--sv-border);
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
}

.sv-mini-bars span {
    color: var(--sv-muted);
    font-weight: 950;
}

.sv-mini-bars strong {
    color: var(--sv-primary-dark);
    font-weight: 950;
}

.sv-mini-bars i {
    overflow: hidden;
    height: 10px;
    border-radius: 999px;
    background: rgba(15,23,42,0.08);
}

.sv-mini-bars b {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--sv-primary), var(--sv-accent));
}

@media screen and (max-width: 920px) {
    .sv-ops-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 640px) {
    .sv-ops-grid,
    .sv-mini-bars {
        grid-template-columns: 1fr;
    }

    .sv-kpi-card {
        min-height: 116px;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.sv-app button,
.sv-app input {
    font-family: inherit;
}

.sv-app button {
    touch-action: manipulation;
}

.sv-app img {
    max-width: 100%;
}

.sv-location-copy span,
.sv-footer-note {
    display: none;
}

.sv-panel-head .sv-panel-description:empty,
.sv-ops-head p:empty {
    display: none;
}

.sv-topbar,
.sv-panel,
.sv-ops-panel,
.sv-location-banner,
.sv-action-card,
.sv-kpi-card,
.sv-patient-card {
    max-width: 100%;
}

@media (max-width: 1180px) {
    .sv-page {
        width: min(100% - 24px, 980px);
    }

    .sv-actions-priority,
    .sv-actions-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sv-search-layout {
        grid-template-columns: 1fr;
    }

    .sv-search-filters {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        border-radius: 20px;
    }

    .sv-search-filters button {
        min-width: 0;
        white-space: normal;
        line-height: 1.15;
    }
}

@media (max-width: 820px) {
    .sv-page {
        width: min(100% - 18px, 720px);
    }

    .sv-topbar {
        position: static;
        display: grid;
        grid-template-columns: 1fr;
        border-radius: 26px;
    }

    .sv-brand {
        justify-content: center;
        text-align: center;
    }

    .sv-top-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .sv-user-box {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        width: 100%;
        border-radius: 24px;
    }

    .sv-structure-switch {
        width: 100%;
        justify-content: center;
        min-height: 50px;
    }

    .sv-location-banner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .sv-location-mark {
        margin: 0 auto;
    }

    .sv-location-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .sv-location-stats span {
        min-width: 0;
    }

    .sv-ops-grid,
    .sv-actions-priority,
    .sv-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sv-search-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sv-patient-main {
        display: grid;
        grid-template-columns: 1fr;
    }

    .sv-open-patient {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .sv-page {
        width: min(100% - 12px, 440px);
        padding: 8px 0 22px;
    }

    .sv-topbar,
    .sv-location-banner,
    .sv-panel,
    .sv-ops-panel {
        border-radius: 20px;
    }

    .sv-brand {
        align-items: center;
        gap: 9px;
        text-align: left;
    }

    .sv-brand-kicker {
        display: none;
    }

    .sv-brand-title {
        font-size: 1.12rem;
    }

    .sv-logo {
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }

    .sv-user-box {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
    }

    .sv-logout-button {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 44px;
    }

    .sv-location-copy h2 {
        font-size: clamp(2.05rem, 12vw, 3rem);
    }

    .sv-location-stats,
    .sv-ops-grid,
    .sv-mini-bars,
    .sv-actions-priority,
    .sv-actions-grid,
    .sv-patient-details {
        grid-template-columns: 1fr;
    }

    .sv-search-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 5px;
        border-radius: 16px;
    }

    .sv-search-filters button {
        min-height: 44px;
        padding: 9px 7px;
        font-size: 0.8rem;
    }

    .sv-search-field .form-control {
        min-height: 54px;
        padding-right: 2.9rem;
        font-size: 0.95rem;
    }

    .sv-patient-title-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .sv-patient-code,
    .sv-patient-badges,
    .sv-patient-data strong,
    .sv-patient-data a {
        overflow-wrap: anywhere;
    }

    .sv-action-card,
    .sv-actions-grid .btnadmin,
    .sv-actions-grid .btn-primary {
        min-height: 112px;
    }

    .sv-action-card {
        padding: 15px;
        border-radius: 20px !important;
    }

    .sv-action-text {
        min-height: 0;
    }
}

@media (max-width: 380px) {
    .sv-search-filters {
        grid-template-columns: 1fr;
    }

    .sv-location-stats span,
    .sv-kpi-card {
        padding: 13px;
    }
}

@media (hover: none) {
    .sv-action-card:hover,
    .sv-action-card:focus,
    .sv-kpi-card:hover,
    .sv-kpi-card:focus,
    .sv-patient-card:hover,
    .sv-patient-card:focus-within {
        transform: none;
    }
}


/* Dashboard compatta: ricerca e azioni subito visibili */
.sv-dashboard-start {
    margin-bottom: 18px;
    padding: clamp(12px, 2vw, 18px);
    border: 1px solid rgba(255,255,255,0.78);
    border-radius: 26px;
    background: rgba(255,255,255,0.88);
    box-shadow: var(--sv-shadow-soft);
    backdrop-filter: blur(14px);
}

.sv-start-summary {
    display: grid;
    grid-template-columns: minmax(210px, auto) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.sv-start-location {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 12px;
    border: 2px solid var(--sv-primary);
    border-radius: 22px;
    background: linear-gradient(135deg, var(--sv-location-soft), rgba(255,255,255,0.86));
}

.sv-location-mark-compact {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    font-size: 1.55rem;
}

.sv-start-kicker {
    margin: 0;
    color: var(--sv-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sv-start-location h2 {
    margin: 0;
    color: var(--sv-location-strong);
    font-size: clamp(1.45rem, 3vw, 2.4rem);
    font-weight: 950;
    line-height: 1;
    text-shadow: none;
}

.sv-start-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.sv-start-stats span,
.sv-start-stats button {
    min-height: 48px;
    padding: 7px 10px;
    border: 1px solid var(--sv-border);
    border-radius: 16px;
    color: var(--sv-muted);
    background: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    text-align: center;
    box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

.sv-start-stats button {
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.sv-start-stats button:hover,
.sv-start-stats button:focus {
    transform: translateY(-2px);
    border-color: var(--sv-primary);
    box-shadow: 0 12px 24px rgba(15,23,42,0.12);
    outline: none;
}

.sv-start-stats strong {
    display: block;
    color: var(--sv-ink);
    font-size: 1.24rem;
    line-height: 1.05;
    font-weight: 950;
}

.sv-start-stats .is-watch strong,
.sv-start-stats .is-watch {
    color: #92400e;
}

.sv-start-stats .is-urgent strong,
.sv-start-stats .is-urgent {
    color: #991b1b;
}

.sv-start-stats .is-good strong,
.sv-start-stats .is-good {
    color: #05603a;
}

.sv-start-workspace {
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(460px, 1.35fr);
    gap: 12px;
    align-items: start;
}

.sv-start-search,
.sv-start-actions {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--sv-border);
    border-radius: 22px;
    background: rgba(255,255,255,0.94);
    box-shadow: 0 10px 24px rgba(15,23,42,0.07);
}

.sv-search-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.sv-search-title-row strong {
    color: var(--sv-ink);
    font-size: 1rem;
    font-weight: 950;
    line-height: 1.1;
    text-shadow: none;
}

.sv-search-title-row small {
    color: var(--sv-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
}

.sv-dashboard-start .sv-search-field .form-control {
    min-height: 50px;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    border-radius: 16px;
    font-size: 0.98rem;
}

.sv-search-filters-compact {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    margin-top: 8px;
    border-radius: 16px;
}

.sv-search-filters-compact button {
    min-width: 0;
    padding: 8px 7px;
    font-size: 0.76rem;
    line-height: 1.1;
    white-space: normal;
}

.sv-dashboard-start .sv-search-status {
    min-height: 1.2em;
    margin: 8px 0 0;
    font-size: 0.82rem;
}

.sv-fast-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.sv-fast-actions-admin {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sv-fast-actions-terapista {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sv-fast-actions-grid .sv-action-card,
.sv-fast-actions-grid .btnadmin,
.sv-fast-actions-grid .btn-primary {
    min-height: 76px;
    height: auto;
    margin: 0;
    padding: 9px;
    border-radius: 18px !important;
}

.sv-fast-actions-grid .sv-action-card {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: initial;
    gap: 9px;
    text-align: left;
    box-shadow: 0 10px 22px rgba(15,23,42,0.08);
}

.sv-fast-actions-grid .sv-action-card::before {
    left: 14px;
    right: 14px;
    height: 3px;
}

.sv-fast-actions-grid .sv-action-card::after {
    width: 78px;
    height: 78px;
    right: -34px;
    bottom: -36px;
    transform: none;
}

.sv-fast-actions-grid .sv-action-card:hover::after,
.sv-fast-actions-grid .sv-action-card:focus::after {
    transform: scale(1.12);
}

.sv-fast-actions-grid .sv-action-top {
    width: auto;
    justify-content: flex-start;
}

.sv-fast-actions-grid .sv-action-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 15px;
    font-size: 1.05rem;
}

.sv-fast-actions-grid .sv-action-badge {
    top: 6px;
    right: 6px;
    min-width: 30px;
    height: 26px;
    padding: 0 7px;
    border-width: 2px;
    font-size: 0.78rem;
}

.sv-fast-actions-grid .sv-action-body {
    align-items: flex-start;
    min-height: 0;
}

.sv-fast-actions-grid .sv-action-title {
    font-size: 0.92rem;
    line-height: 1.05;
    text-align: left;
}

.sv-fast-actions-grid .sv-action-text {
    min-height: 0;
    margin: 4px 0 0;
    font-size: 0.72rem;
    line-height: 1.1;
    text-align: left;
}

.sv-dashboard-start .sv-patient-results {
    max-height: min(52vh, 520px);
    overflow: auto;
    padding-right: 2px;
}

.sv-dashboard-start .sv-patient-card {
    border-radius: 16px;
}

.sv-dashboard-start .sv-patient-main {
    padding: 11px;
}

.sv-dashboard-start .sv-patient-details {
    grid-template-columns: 1fr 1fr;
    padding: 0 11px 11px;
}

@media (max-width: 1100px) {
    .sv-start-workspace {
        grid-template-columns: 1fr;
    }

    .sv-fast-actions-grid,
    .sv-fast-actions-admin,
    .sv-fast-actions-terapista {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .sv-start-summary {
        grid-template-columns: 1fr;
    }

    .sv-start-stats {
        justify-content: stretch;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sv-start-stats span,
    .sv-start-stats button {
        min-width: 0;
    }

    .sv-fast-actions-grid,
    .sv-fast-actions-admin,
    .sv-fast-actions-terapista {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .sv-dashboard-start {
        padding: 10px;
        border-radius: 20px;
    }

    .sv-start-location {
        border-radius: 18px;
    }

    .sv-location-mark-compact {
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }

    .sv-start-location h2 {
        font-size: 1.45rem;
    }

    .sv-start-search,
    .sv-start-actions {
        padding: 10px;
        border-radius: 18px;
    }

    .sv-search-title-row {
        display: grid;
        gap: 2px;
    }

    .sv-search-title-row small {
        text-align: left;
    }

    .sv-search-filters-compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sv-fast-actions-grid,
    .sv-fast-actions-admin,
    .sv-fast-actions-terapista {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .sv-fast-actions-grid .sv-action-card,
    .sv-fast-actions-grid .btnadmin,
    .sv-fast-actions-grid .btn-primary {
        min-height: 68px;
    }

    .sv-fast-actions-grid .sv-action-card {
        gap: 7px;
        padding: 8px;
    }

    .sv-fast-actions-grid .sv-action-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 13px;
        font-size: 0.95rem;
    }

    .sv-dashboard-start .sv-patient-details {
        grid-template-columns: 1fr;
    }
}


/* Fix mobile strumenti flottanti: scompaiono scorrendo verso il basso e lasciano spazio ai contenuti finali */
@media(max-width: 820px) {
	.sv-page { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
	.sv-floating-tools { transition: transform 240ms ease, opacity 180ms ease; will-change: transform, opacity; }
	body.sv-floating-tools-hidden:not(.sv-panel-open) .sv-floating-tools { transform: translateY(calc(100% + 22px)) !important; opacity: 0; pointer-events: none; }
}

/* Flussi operativi: form, scadenze e editor clinico */
.sv-brand-link,
.sv-brand-link:hover,
.sv-brand-link:focus {
    color: inherit;
    text-decoration: none;
}

.sv-home-button {
    color: #fff !important;
    text-decoration: none !important;
}

.sv-workflow-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius);
    background: linear-gradient(135deg, var(--sv-location-soft, rgba(17, 156, 166, .12)), rgba(255, 255, 255, .96) 68%);
    box-shadow: var(--sv-shadow-soft);
}

.sv-workflow-hero h1 {
    margin: 3px 0 0;
    color: var(--sv-location-strong, var(--sv-primary-dark));
    font-size: clamp(1.85rem, 4vw, 3.35rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -.035em;
    text-shadow: none;
}

.sv-workflow-hero p {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--sv-muted);
    font-weight: 750;
}

.sv-rule-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.sv-rule-chips span {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 6px 10px;
    border: 1px solid rgba(17, 156, 166, .18);
    border-radius: 999px;
    color: var(--sv-primary-dark);
    background: rgba(255, 255, 255, .76);
    font-size: .75rem;
    font-weight: 900;
}

.sv-workflow-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    border-radius: 25px;
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-accent));
    box-shadow: var(--sv-shadow-soft);
    font-size: 2rem;
    font-weight: 950;
}

.sv-patient-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.sv-action-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.sv-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sv-pill-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 15px;
    border: 0;
    border-radius: 999px;
    color: var(--sv-ink);
    background: #fff;
    font: inherit;
    font-weight: 950;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
    cursor: pointer;
    transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.sv-pill-button:hover,
.sv-pill-button:focus {
    color: var(--sv-ink);
    text-decoration: none;
    transform: translateY(-2px);
    opacity: .96;
    box-shadow: 0 15px 30px rgba(15, 23, 42, .18);
}

.sv-pill-button.is-warning {
    color: #111827;
    background: #fbbf24;
}

.sv-pill-button.is-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark));
}

.sv-pill-button.is-success {
    color: #fff;
    background: var(--sv-success);
}

.sv-pill-button.is-danger {
    color: #fff;
    background: var(--sv-danger);
}

.sv-pill-button.is-primary:hover,
.sv-pill-button.is-primary:focus,
.sv-pill-button.is-success:hover,
.sv-pill-button.is-success:focus,
.sv-pill-button.is-danger:hover,
.sv-pill-button.is-danger:focus {
    color: #fff;
}

.sv-form-shell {
    display: grid;
    gap: 16px;
    padding: clamp(12px, 2vw, 20px);
    border: 1px solid rgba(255, 255, 255, .84);
    border-radius: 30px;
    background: rgba(255, 255, 255, .72);
    box-shadow: var(--sv-shadow);
}

.sv-form-section {
    display: grid;
    gap: 14px;
    padding: clamp(14px, 2vw, 20px);
    border: 1px solid var(--sv-border);
    border-radius: 25px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .07);
}

.sv-form-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.sv-form-section-head h2 {
    margin: 2px 0 0;
    color: var(--sv-ink);
    font-size: clamp(1.15rem, 2vw, 1.42rem);
    font-weight: 950;
    letter-spacing: -.02em;
    text-shadow: none;
}

.sv-step-label {
    color: var(--sv-primary-dark);
    font-size: .74rem;
    font-weight: 950;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.sv-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.sv-form-grid.is-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sv-form-grid.is-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sv-field {
    display: grid;
    gap: 7px;
    align-content: start;
    min-width: 0;
}

.sv-field.is-wide {
    grid-column: 1 / -1;
}

.sv-field label {
    margin: 0;
    color: var(--sv-ink);
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.sv-field input,
.sv-field select,
.sv-field textarea {
    display: block;
    width: 100%;
    min-height: 49px;
    margin: 0;
    padding: 0 13px;
    border: 2px solid var(--sv-border);
    border-radius: 17px;
    background: #f8fafc;
    color: var(--sv-ink);
    font: inherit;
    font-size: .96rem;
    font-weight: 750;
    outline: none;
    box-shadow: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.sv-field select {
    padding-right: 38px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #334155 50%),
        linear-gradient(135deg, #334155 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 21px,
        calc(100% - 14px) 21px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.sv-field textarea {
    min-height: 96px;
    padding: 12px 13px;
    line-height: 1.55;
    resize: vertical;
}

.sv-field input[type="file"] {
    height: auto;
    padding: 10px;
    background: #fff;
}

.sv-field input:focus,
.sv-field select:focus,
.sv-field textarea:focus {
    border-color: var(--sv-primary);
    background-color: #fff;
    box-shadow: 0 0 0 5px var(--sv-focus);
}

.sv-field-note {
    margin: 0;
    color: var(--sv-muted);
    font-size: .82rem;
    font-weight: 750;
}

.sv-coherence {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(245, 158, 11, .34);
    border-radius: 18px;
    background: rgba(245, 158, 11, .1);
    color: #7c2d12;
    font-size: .86rem;
    font-weight: 900;
    line-height: 1.3;
}

.sv-coherence.is-visible {
    display: flex;
}

.sv-coherence-dot {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: #111827;
    background: var(--sv-warning);
    font-weight: 950;
}

.sv-form-section.is-coherence-warning {
    border-color: rgba(245, 158, 11, .48);
    background: linear-gradient(135deg, rgba(245, 158, 11, .08), rgba(255, 255, 255, .92));
}

.sv-field.is-coherence-warning input,
.sv-field.is-coherence-warning select {
    border-color: var(--sv-warning);
    background-color: #fffbeb;
}

.sv-form-subpanel {
    display: grid;
    gap: 13px;
    padding: 14px;
    border: 1px solid rgba(17, 156, 166, .18);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(17, 156, 166, .055), rgba(255, 255, 255, .94));
}

.sv-form-savebar {
    position: sticky;
    bottom: 14px;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 23px;
    background: rgba(255, 255, 255, .93);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 42px rgba(15, 23, 42, .16);
}

.sv-form-savebar .btn,
.sv-form-savebar .sv-pill-button {
    min-width: 190px;
    min-height: 50px;
    border-radius: 999px;
    font-weight: 950;
}

.sv-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.sv-summary-card {
    display: grid;
    gap: 5px;
    min-height: 104px;
    padding: 16px;
    border: 1px solid var(--sv-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--sv-shadow-soft);
}

.sv-summary-card strong {
    color: var(--sv-primary-dark);
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    font-weight: 950;
    line-height: 1;
}

.sv-summary-card span {
    color: var(--sv-muted);
    font-size: .82rem;
    font-weight: 900;
}

.sv-deadline-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--sv-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, .86);
}

.sv-deadline-toolbar input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 2px solid var(--sv-border);
    border-radius: 16px;
    background: #fff;
    color: var(--sv-ink);
    font: inherit;
    font-weight: 800;
    outline: none;
}

.sv-deadline-toolbar input:focus {
    border-color: var(--sv-primary);
    box-shadow: 0 0 0 5px var(--sv-focus);
}

.sv-deadline-groups {
    display: grid;
    gap: 15px;
}

.sv-deadline-user {
    overflow: hidden;
    border: 1px solid var(--sv-border);
    border-radius: 26px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--sv-shadow-soft);
}

.sv-deadline-user-head {
    padding: 0;
    border-bottom: 1px solid var(--sv-border);
    background: linear-gradient(135deg, var(--sv-location-soft, rgba(17, 156, 166, .1)), #fff 74%);
}

.sv-deadline-user-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 15px 17px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.sv-deadline-user-toggle:focus-visible {
    outline: 3px solid var(--sv-primary);
    outline-offset: -3px;
}

.sv-deadline-user-name {
    display: block;
    margin: 0;
    color: var(--sv-ink);
    font-size: 1.16rem;
    font-weight: 950;
    text-shadow: none;
}

.sv-deadline-toggle-side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.sv-deadline-chevron {
    color: var(--sv-muted);
    font-size: 1.4rem;
    font-weight: 950;
    line-height: 1;
    transition: transform 160ms ease;
}

.sv-deadline-user.is-collapsed .sv-deadline-chevron {
    transform: rotate(-90deg);
}

.sv-deadline-user.is-collapsed .sv-deadline-user-head {
    border-bottom-color: transparent;
}

.sv-deadline-user-meta,
.sv-deadline-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 7px;
}

.sv-deadline-count {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 999px;
    color: #fff;
    background: var(--sv-danger);
    font-weight: 950;
}

.sv-deadline-list {
    display: grid;
    gap: 10px;
    padding: 13px;
}

.sv-deadline-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--sv-border);
    border-radius: 18px;
    background: #fff;
}

.sv-deadline-item h3 {
    margin: 0;
    color: var(--sv-ink);
    font-size: 1rem;
    font-weight: 950;
    text-shadow: none;
}

.sv-deadline-item p {
    margin: 5px 0 0;
    color: var(--sv-muted);
    font-size: .88rem;
    font-weight: 750;
}

.sv-deadline-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 13px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--sv-primary), var(--sv-primary-dark));
    font-weight: 950;
    text-decoration: none;
}

.sv-deadline-open:hover,
.sv-deadline-open:focus {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.sv-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr);
    gap: 16px;
    align-items: start;
}

.sv-previous-review {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid rgba(17, 156, 166, .24);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(17, 156, 166, .09), rgba(255, 255, 255, .98) 48%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

.sv-previous-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sv-previous-review-head h2 {
    margin: 3px 0 0;
    color: var(--sv-ink);
    font-size: 1.2rem;
    font-weight: 950;
}

.sv-previous-review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 12px;
}

.sv-previous-summary,
.sv-previous-prompt {
    padding: 14px;
    border-radius: 18px;
}

.sv-previous-summary {
    border: 1px solid var(--sv-border);
    background: rgba(255, 255, 255, .88);
}

.sv-previous-summary h3 {
    margin: 0 0 7px;
    color: var(--sv-ink);
    font-size: .91rem;
    font-weight: 950;
}

.sv-previous-summary-details summary {
    display: grid;
    gap: 5px;
    cursor: pointer;
    list-style-position: inside;
}

.sv-previous-summary-details summary > span {
    color: var(--sv-primary-dark);
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.sv-previous-summary-details summary > em {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(71, 85, 105, .58);
    font-size: .84rem;
    font-style: normal;
    font-weight: 760;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
    mask-image: linear-gradient(90deg, #000 82%, transparent);
}

.sv-previous-summary-details[open] summary > em {
    display: none;
}

.sv-previous-summary-content {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--sv-border);
}

.sv-previous-summary-content > p {
    margin: 0;
    color: #334155;
    font-size: .88rem;
    font-weight: 730;
    line-height: 1.58;
}

.sv-previous-context-group {
    display: grid;
    gap: 7px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid var(--sv-border);
}

.sv-previous-context-group > strong {
    color: var(--sv-primary-dark);
    font-size: .7rem;
    font-weight: 950;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.sv-previous-context-group ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sv-previous-context-group li {
    display: grid;
    gap: 3px;
    padding-left: 10px;
    border-left: 3px solid rgba(17, 156, 166, .24);
    color: #475569;
    font-size: .8rem;
    font-weight: 720;
    line-height: 1.45;
}

.sv-previous-context-group time,
.sv-context-source {
    color: var(--sv-primary-dark);
    font-size: .68rem;
    font-weight: 950;
}

.sv-previous-context-group.is-interdisciplinary li {
    border-left-color: rgba(245, 158, 11, .42);
}

.sv-previous-summary > p,
.sv-previous-prompt p {
    margin: 0;
    color: #334155;
    font-size: .88rem;
    font-weight: 730;
    line-height: 1.58;
}

.sv-generated-draft {
    margin-top: 9px;
}

.sv-generated-draft + .sv-generated-draft {
    padding-top: 9px;
    border-top: 1px solid rgba(255, 193, 7, .28);
}

.sv-generated-draft summary {
    cursor: pointer;
    color: #55430a;
    font-size: .88rem;
    font-weight: 950;
}

.sv-generated-draft > div {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 193, 7, .3);
    border-radius: 14px;
    background: rgba(255, 255, 255, .82);
    color: #3f3a28;
    font-size: .85rem;
    font-weight: 760;
    line-height: 1.58;
}

.sv-generated-draft .sv-pill-button {
    width: 100%;
    margin-top: 10px;
}

.sv-previous-goals {
    display: grid;
    gap: 4px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid var(--sv-border);
}

.sv-previous-goals strong,
.sv-previous-prompt > span {
    color: var(--sv-primary-dark);
    font-size: .7rem;
    font-weight: 950;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.sv-previous-goals span {
    color: #475569;
    font-size: .84rem;
    font-weight: 760;
    line-height: 1.5;
}

.sv-previous-prompt {
    border: 1px solid rgba(255, 193, 7, .42);
    background: linear-gradient(145deg, rgba(255, 193, 7, .17), rgba(255, 255, 255, .94));
}

.sv-previous-prompt p {
    margin-top: 7px;
    color: #55430a;
    font-weight: 850;
}

.sv-previous-details {
    border-top: 1px solid rgba(17, 156, 166, .18);
    padding-top: 11px;
}

.sv-previous-details summary {
    width: max-content;
    max-width: 100%;
    cursor: pointer;
    color: var(--sv-primary-dark);
    font-size: .8rem;
    font-weight: 900;
}

.sv-previous-details > div {
    margin-top: 10px;
    padding: 13px;
    border-radius: 15px;
    background: rgba(255, 255, 255, .78);
    color: #475569;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.56;
}

.sv-editor-main,
.sv-writing-assist {
    display: grid;
    gap: 14px;
}

.sv-editor-main .sv-field textarea {
    min-height: 220px;
    font-size: 1rem;
}

.sv-draft-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(17, 156, 166, .22);
    border-radius: 18px;
    background: rgba(17, 156, 166, .075);
    color: #0f5f67;
    font-size: .86rem;
    font-weight: 850;
}

.sv-draft-bar button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 8px 11px;
    color: var(--sv-danger);
    background: #fff;
    font-weight: 950;
}

.sv-completion-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.sv-completion-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 8px;
    min-height: 55px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 15px;
    text-align: left;
}

.sv-completion-row strong {
    color: var(--sv-ink);
    font-size: .82rem;
    font-weight: 950;
}

.sv-completion-row em {
    grid-column: 2;
    color: #475569;
    font-size: .72rem;
    font-style: normal;
    font-weight: 850;
}

.sv-completion-dot {
    grid-row: 1 / 3;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .62);
}

.sv-completion-row.is-empty {
    border-color: rgba(225, 29, 72, .25);
    background: rgba(225, 29, 72, .075);
}

.sv-completion-row.is-empty .sv-completion-dot {
    background: var(--sv-danger);
}

.sv-completion-row.is-warning {
    border-color: rgba(245, 158, 11, .34);
    background: rgba(245, 158, 11, .1);
}

.sv-completion-row.is-warning .sv-completion-dot {
    background: var(--sv-warning);
}

.sv-completion-row.is-complete {
    border-color: rgba(47, 191, 113, .34);
    background: rgba(47, 191, 113, .1);
}

.sv-completion-row.is-complete .sv-completion-dot {
    background: var(--sv-success);
}

.sv-inline-incomplete {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    margin-left: 7px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #7c2d12;
    background: #fde68a;
    font-size: .64rem;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: middle;
}

.sv-inline-incomplete[hidden] {
    display: none !important;
}

.sv-inline-incomplete.is-goals {
    color: #881337;
    background: #fecdd3;
}

.sv-field textarea.is-guided-incomplete {
    border-color: #f59e0b !important;
    background: linear-gradient(135deg, #fff9df, #fffdf5) !important;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, .14) !important;
}

.sv-field #obiettivi.is-guided-incomplete {
    border-color: #e11d48 !important;
    background: linear-gradient(135deg, #fff1f4, #fffafa) !important;
    box-shadow: 0 0 0 5px rgba(225, 29, 72, .11) !important;
}

.sv-assist-card {
    padding: 15px;
    border: 1px solid var(--sv-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

.sv-assist-card h2 {
    margin: 0;
    color: var(--sv-ink);
    font-size: 1.02rem;
    font-weight: 950;
    text-shadow: none;
}

.sv-assist-card p {
    margin: 7px 0 0;
    color: var(--sv-muted);
    font-size: .84rem;
    font-weight: 750;
}

.sv-assist-heading,
.sv-spelling-issue-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sv-assist-count {
    display: grid;
    place-items: center;
    min-width: 31px;
    height: 31px;
    padding: 0 8px;
    border-radius: 999px;
    color: #fff;
    background: var(--sv-danger);
    font-size: .8rem;
    font-weight: 950;
}

.sv-context-badge {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #0f5f67;
    background: rgba(17, 156, 166, .1);
    font-size: .68rem;
    font-weight: 950;
    white-space: nowrap;
}

.sv-assist-status {
    margin-top: 8px;
    color: var(--sv-muted);
    font-size: .83rem;
    font-weight: 850;
}

.sv-spelling-issues {
    display: grid;
    gap: 9px;
    margin-top: 11px;
}

.sv-spelling-issue {
    padding: 10px;
    border: 1px solid rgba(231, 76, 60, .2);
    border-radius: 14px;
    background: rgba(231, 76, 60, .045);
}

.sv-spelling-issue-head strong {
    color: var(--sv-danger);
    font-size: .94rem;
    font-weight: 950;
}

.sv-spelling-word {
    display: grid;
    gap: 2px;
}

.sv-spelling-word small {
    color: var(--sv-muted);
    font-size: .67rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sv-spelling-ignore {
    border: 0;
    background: transparent;
    color: var(--sv-muted);
    font-size: .76rem;
    font-weight: 900;
}

.sv-spelling-replacements {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.sv-spelling-replacements button {
    border: 1px solid rgba(17, 156, 166, .22);
    border-radius: 999px;
    padding: 6px 9px;
    background: #fff;
    color: var(--sv-primary-dark);
    font-size: .78rem;
    font-weight: 900;
}

.sv-spelling-replacements span {
    color: var(--sv-muted);
    font-size: .76rem;
    font-weight: 800;
}

.sv-form-savebar > .btn:only-child {
    margin-left: auto;
}

.sv-suggestion-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.sv-suggestion-list li {
    padding: 10px 11px;
    border-left: 4px solid var(--sv-primary);
    border-radius: 12px;
    background: #f4fafb;
    color: #334155;
    font-size: .85rem;
    font-weight: 800;
}

.sv-assignment-list {
    display: grid;
    gap: 10px;
}

.sv-assignment-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--sv-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.sv-assignment-card.is-assigned {
    border-color: rgba(47, 191, 113, .42);
    background: linear-gradient(135deg, rgba(47, 191, 113, .09), #fff 68%);
}

.sv-assignment-card h3 {
    margin: 0;
    color: var(--sv-ink);
    font-size: 1rem;
    font-weight: 950;
    text-shadow: none;
}

.sv-assignment-card p {
    margin: 6px 0 0;
    color: var(--sv-muted);
    font-size: .82rem;
    font-weight: 800;
}

.sv-assignment-toggle {
    min-width: 112px;
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--sv-success);
    font-weight: 950;
}

.sv-assignment-card.is-assigned .sv-assignment-toggle {
    background: var(--sv-danger);
}

.sv-assignment-toggle:disabled {
    opacity: .58;
}

.sv-assignment-feedback {
    min-height: 24px;
    margin: 0 0 10px;
    color: var(--sv-muted);
    font-size: .86rem;
    font-weight: 850;
}

.sv-assignment-feedback.is-error {
    color: var(--sv-danger);
}

.sv-clear-symbol {
    display: none;
}

@media (max-width: 980px) {
    .sv-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sv-form-grid.is-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sv-editor-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .sv-workflow-hero {
        align-items: flex-start;
    }

    .sv-form-grid,
    .sv-form-grid.is-three,
    .sv-form-grid.is-four,
    .sv-deadline-toolbar,
    .sv-deadline-item,
    .sv-assignment-card {
        grid-template-columns: 1fr;
    }

    .sv-form-savebar {
        bottom: 10px;
    }

    .sv-form-savebar .btn,
    .sv-form-savebar .sv-pill-button,
    .sv-deadline-open,
    .sv-assignment-toggle {
        width: 100%;
    }

    .sv-action-toolbar,
    .sv-inline-actions {
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .sv-workflow-hero {
        display: grid;
        grid-template-columns: 1fr;
        text-align: center;
        border-radius: 23px;
    }

    .sv-workflow-mark {
        grid-row: 1;
        width: 60px;
        height: 60px;
        margin: 0 auto;
        border-radius: 20px;
        font-size: 1.55rem;
    }

    .sv-form-shell {
        padding: 9px;
        border-radius: 22px;
    }

    .sv-form-section {
        padding: 13px;
        border-radius: 20px;
    }

    .sv-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .sv-summary-card {
        min-height: 88px;
        padding: 12px;
        border-radius: 18px;
    }

    .sv-deadline-user-head,
    .sv-draft-bar,
    .sv-form-savebar {
        align-items: stretch;
        flex-direction: column;
    }

    .sv-previous-review {
        padding: 13px;
        border-radius: 20px;
    }

    .sv-previous-review-grid {
        grid-template-columns: 1fr;
    }

    .sv-completion-panel {
        grid-template-columns: 1fr;
    }

    .sv-previous-review-head {
        align-items: flex-start;
    }

    .sv-openuser-page .sv-openuser-back {
        margin: 4px 0 10px;
    }

    .sv-openuser-page .sv-openuser-back .sv-pill-button {
        min-height: 44px;
        padding: 9px 17px;
    }

    .sv-openuser-page .sv-openuser-hero {
        gap: 8px;
        padding: 15px;
        text-align: left;
    }

    .sv-openuser-page .sv-openuser-hero .sv-workflow-mark {
        display: none;
    }

    .sv-openuser-page .sv-openuser-hero h1 {
        font-size: 1.35rem;
    }

    .sv-openuser-page .sv-openuser-hero p {
        margin-top: 6px;
        font-size: .79rem;
        line-height: 1.42;
    }

    .sv-openuser-page .sv-rule-chips {
        gap: 5px;
        margin-top: 8px;
    }

    .sv-openuser-page .sv-rule-chips span {
        min-height: 28px;
        padding: 5px 8px;
        font-size: .68rem;
    }

    .sv-openuser-page .sv-summary-grid {
        margin-bottom: 10px;
    }

    .sv-openuser-page .sv-summary-card {
        min-height: 72px;
        padding: 10px 11px;
    }

    .sv-openuser-page .sv-summary-card strong {
        font-size: 1.5rem;
    }

    .sv-openuser-page .sv-summary-card span {
        font-size: .73rem;
        line-height: 1.2;
    }

    .sv-openuser-page .sv-deadline-toolbar {
        position: sticky;
        top: 6px;
        z-index: 15;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 7px;
        margin-bottom: 10px;
        padding: 7px;
        border-radius: 17px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .1);
    }

    .sv-openuser-page .sv-deadline-toolbar input {
        min-height: 44px;
        padding: 0 11px;
        border-radius: 13px;
        font-size: .86rem;
    }

    .sv-openuser-page .sv-deadline-toolbar .sv-pill-button {
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
    }

    .sv-openuser-page .sv-clear-label {
        display: none;
    }

    .sv-openuser-page .sv-clear-symbol {
        display: inline;
        font-size: 1.35rem;
        line-height: 1;
    }

    .sv-openuser-page .sv-deadline-groups {
        gap: 9px;
    }

    .sv-openuser-page .sv-deadline-user {
        border-radius: 18px;
    }

    .sv-openuser-page .sv-deadline-user-toggle {
        padding: 11px 12px;
    }

    .sv-openuser-page .sv-deadline-user-name {
        font-size: 1rem;
    }

    .sv-openuser-page .sv-deadline-user-meta {
        margin-top: 5px;
    }

    .sv-openuser-page .sv-deadline-user-meta .sv-patient-code {
        display: none;
    }

    .sv-openuser-page .sv-deadline-count {
        min-width: 37px;
        height: 37px;
        padding: 0 8px;
    }

    .sv-openuser-page .sv-deadline-list {
        gap: 0;
        padding: 0;
    }

    .sv-openuser-page .sv-deadline-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 11px 12px;
        border: 0;
        border-top: 1px solid var(--sv-border);
        border-radius: 0;
    }

    .sv-openuser-page .sv-deadline-item:first-child {
        border-top: 0;
    }

    .sv-openuser-page .sv-deadline-item h3 {
        font-size: .94rem;
    }

    .sv-openuser-page .sv-deadline-item p {
        margin-top: 3px;
        font-size: .78rem;
    }

    .sv-openuser-page .sv-deadline-item-meta {
        gap: 5px;
        margin-top: 5px;
    }

    .sv-openuser-page .sv-deadline-open {
        width: auto;
        min-width: 58px;
        min-height: 40px;
        padding: 8px 10px;
        font-size: .82rem;
    }
}
