:root {
    --rv-surface: #ffffff;
    --rv-surface-soft: #f4f7f8;
    --rv-border: #dce3e7;
    --rv-shadow: 0 7px 22px rgba(38, 50, 56, .11);
    --rv-radius: 17px;
}

html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body { font-size: 16px; }
main img { max-width: 100%; height: auto; }
main.container > .container { max-width: 100%; padding-left: 0; padding-right: 0; }

.rv-page-title,
main h1:first-child {
    font-weight: 800;
    letter-spacing: -.02em;
}

.card, .card-main, .table-card, .card-capo,
.content-card, .section-card {
    background: var(--rv-surface);
    border: 1px solid rgba(220, 227, 231, .7) !important;
    border-radius: var(--rv-radius) !important;
    box-shadow: var(--rv-shadow) !important;
}

.card-main, .content-card, .section-card { padding: clamp(15px, 3vw, 28px); }
.card-capo { background: #fff; border-left: 5px solid var(--rv-green) !important; }

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 650;
    white-space: normal;
}
.btn img { flex: 0 0 auto; object-fit: contain; }
.btn-group, .action-group, .azioni, .d-flex { min-width: 0; }
.form-control, .form-select, textarea, input, select { max-width: 100%; }
.form-label { margin-bottom: .4rem; }
.table-responsive { border-radius: 14px; }
.table { margin-bottom: 0; vertical-align: middle; }
.table th { white-space: normal; }
.alert { overflow-wrap: anywhere; }

@media (max-width: 767.98px) {
    body { font-size: 15px; }
    main.container { width: 100%; padding-left: 10px; padding-right: 10px; }
    main h1, main h1:first-child { font-size: clamp(1.5rem, 7vw, 1.9rem); }
    main h2 { font-size: 1.35rem; }
    main h3, main h4 { font-size: 1.1rem; }
    main [style*="width:"] { max-width: 100% !important; }
    .card, .card-main, .table-card, .content-card, .section-card { border-radius: 15px !important; }
    .card-body, .card-main, .content-card, .section-card { padding: 15px !important; }
    .row { --bs-gutter-x: 1rem; }
    .btn { min-height: 48px; }
    .btn-sm { min-height: 42px; }
    .d-flex { flex-wrap: wrap; }
    .d-flex > .btn, .d-flex > form { max-width: 100%; }
    .input-group { flex-wrap: nowrap; max-width: 100%; }
    .input-group > .form-control, .input-group > .form-select { min-width: 0; }
    .modal-dialog { margin: 10px; max-width: calc(100% - 20px); }

    /* Le tabelle operative diventano schede: nessuno scorrimento laterale. */
    .table-responsive { overflow-x: visible !important; }
    table.rv-mobile-cards { display: block; width: 100%; background: transparent; }
    table.rv-mobile-cards thead { display: none; }
    table.rv-mobile-cards tbody { display: grid; gap: 12px; width: 100%; }
    table.rv-mobile-cards tr {
        display: block;
        width: 100%;
        padding: 12px 13px;
        background: #fff;
        border: 1px solid var(--rv-border);
        border-left: 5px solid var(--rv-green);
        border-radius: 14px;
        box-shadow: 0 4px 13px rgba(38, 50, 56, .09);
    }
    table.rv-mobile-cards td {
        display: grid;
        grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
        align-items: center;
        gap: 9px;
        width: 100% !important;
        max-width: 100%;
        min-height: 38px;
        padding: 7px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid #edf1f3 !important;
        text-align: right !important;
        overflow-wrap: anywhere;
    }
    table.rv-mobile-cards td:last-child { border-bottom: 0 !important; }
    table.rv-mobile-cards td::before {
        content: attr(data-label);
        color: #60717b;
        font-size: .79rem;
        font-weight: 800;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: .02em;
    }
    table.rv-mobile-cards td[data-label="Azioni"],
    table.rv-mobile-cards td[data-label="Azione"] {
        grid-template-columns: 1fr;
        text-align: left !important;
        padding-top: 11px !important;
    }
    table.rv-mobile-cards td[data-label="Azioni"]::before,
    table.rv-mobile-cards td[data-label="Azione"]::before { margin-bottom: 3px; }
    table.rv-mobile-cards td .d-flex,
    table.rv-mobile-cards td .btn-group {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px !important;
        width: 100%;
    }
    table.rv-mobile-cards td .btn,
    table.rv-mobile-cards td form,
    table.rv-mobile-cards td form .btn { width: 100%; margin: 0 !important; }
    table.rv-mobile-cards td[colspan] { display: block; text-align: center !important; }
    table.rv-mobile-cards td[colspan]::before { display: none; }
}

@media (max-width: 390px) {
    .mobile-bottom-nav a { font-size: .64rem; }
    .mobile-bottom-nav img { width: 25px; height: 25px; }
    table.rv-mobile-cards td { grid-template-columns: minmax(80px, 35%) minmax(0, 1fr); }
}

@media print {
    .mobile-bottom-nav, .calculator-fab { display: none !important; }
}


/* ==========================================================
   V7.13 STEP 23 — UI UNIFICATA
   Migliora leggibilità e coerenza senza cambiare i flussi.
   ========================================================== */
:root {
    --rv-green: #73e600;
    --rv-green-dark: #4da800;
    --rv-ink: #263238;
    --rv-muted: #667780;
    --rv-bg: #f3f6f7;
    --rv-border-strong: #cfd9de;
    --rv-shadow-soft: 0 4px 14px rgba(38,50,56,.08);
    --rv-shadow-lift: 0 10px 28px rgba(38,50,56,.13);
}
body { background: var(--rv-bg); }
main.container { padding-bottom: 28px; }

/* Titoli: stessa gerarchia visiva in tutte le schermate */
main h1, main h2 { color: var(--rv-ink); letter-spacing: -.025em; }
main h1 img, main h2 img { filter: drop-shadow(0 3px 5px rgba(38,50,56,.12)); }
main h4, main h5 { letter-spacing: -.01em; }
.section-title { color:#52636c; font-weight:800; letter-spacing:.015em; }

/* Navbar più pulita e stato corrente riconoscibile */
.rv-navbar { box-shadow: 0 4px 16px rgba(24,36,42,.22) !important; }
.rv-navbar .nav-link { border:1px solid transparent; }
.rv-navbar .nav-link.rv-active {
    color: var(--rv-green) !important;
    background: rgba(255,255,255,.10);
    border-color: rgba(115,230,0,.28);
}
.rv-navbar .nav-link img { filter: drop-shadow(0 2px 3px rgba(0,0,0,.16)); }

/* Ricerca globale: deve sembrare un comando principale, non un campo casuale */
.rv-global-search { max-width: 980px; margin-left:auto; margin-right:auto; }
.rv-global-search .input-group {
    background:#fff; border:1px solid var(--rv-border-strong); border-radius:15px;
    box-shadow: var(--rv-shadow-soft); overflow:hidden;
}
.rv-global-search .input-group-text,
.rv-global-search .form-control,
.rv-global-search .btn { border:0 !important; min-height:50px; }
.rv-global-search .form-control { box-shadow:none !important; }
.rv-global-search .btn { border-radius:0 !important; padding-inline:22px; }

/* Card e sezioni */
.card, .card-main, .table-card, .card-capo, .content-card, .section-card {
    box-shadow: var(--rv-shadow-soft) !important;
}
.card:hover { border-color: rgba(115,230,0,.22) !important; }
.card-header { border-bottom-color:#e8edef; font-weight:750; }
.card-capo { position:relative; overflow:hidden; }
.card-capo::before {
    content:""; position:absolute; left:0; top:0; bottom:0; width:5px; background:var(--rv-green);
}

/* Form: focus chiaro per l'uso al banco */
.form-label { color:#3f5059; font-weight:700; }
.form-control, .form-select {
    border:1px solid #cfd8dc !important; background-color:#fff;
    box-shadow:0 1px 2px rgba(38,50,56,.04) !important;
    transition:border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--rv-green-dark) !important;
    box-shadow:0 0 0 .22rem rgba(115,230,0,.16) !important;
}
.form-text { color:#74848c; }

/* Pulsanti: gerarchia e feedback uniformi */
.btn { box-shadow:0 2px 5px rgba(38,50,56,.08); transition:transform .12s ease, box-shadow .12s ease; }
.btn:hover { box-shadow:0 5px 12px rgba(38,50,56,.13); transform:translateY(-1px); }
.btn:active { transform:translateY(0); box-shadow:0 1px 3px rgba(38,50,56,.10); }
.btn-success { font-weight:750; }
.btn-outline-secondary { background:#fff; }

/* Tabelle desktop più leggibili */
.table:not(.table-borderless) > thead > tr > th {
    padding-top:.85rem; padding-bottom:.85rem; font-size:.82rem;
    text-transform:uppercase; letter-spacing:.035em;
}
.table > tbody > tr > td { padding-top:.8rem; padding-bottom:.8rem; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: rgba(115,230,0,.07); }
.table-dark { --bs-table-bg:#34444c; --bs-table-border-color:#455860; }

/* Badge: meno “pillole casuali”, più indicatori di stato */
.badge { padding:.48em .7em; letter-spacing:.01em; }
.badge.bg-light { background:#f4f6f7 !important; }

/* Alert */
.alert { border-radius:14px; }
.alert-danger { background:#fff2f3; }
.alert-warning { background:#fff9e8; }
.alert-success { background:#f1faec; }

/* Dashboard: tile più moderne mantenendo i colori esistenti */
.btn-round { border:1px solid rgba(38,50,56,.08) !important; overflow:hidden; }
.btn-round::after {
    content:""; position:absolute; inset:auto 0 0; height:5px;
    background:linear-gradient(90deg,var(--rv-green-dark),var(--rv-green)); opacity:.65;
}
.btn-round .badge-count { min-width:36px; min-height:36px; display:grid; place-items:center; }

/* Modali */
.modal-content { border-radius:18px !important; overflow:hidden; }
.modal-header { background:#f8fafb; }

/* Focus da tastiera / accessibilità */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline:3px solid rgba(115,230,0,.55); outline-offset:2px;
}

@media (max-width: 991.98px) {
    .rv-navbar .nav-link.rv-active { border-left:4px solid var(--rv-green); padding-left:10px !important; }
    .mobile-bottom-nav a.rv-active { color:var(--rv-green); background:rgba(115,230,0,.10); }
}

@media (max-width: 767.98px) {
    main.container { padding-left:12px; padding-right:12px; }
    .rv-global-search { position:sticky; top:67px; z-index:1020; margin-bottom:12px !important; }
    .rv-global-search .input-group { box-shadow:0 5px 15px rgba(38,50,56,.13); }
    .rv-global-search .input-group-text { display:none; }
    .rv-global-search .btn { padding-inline:15px; }
    .card-main, .content-card, .section-card { padding:16px !important; }
    .btn:hover { transform:none; }
    .btn-round::after { height:4px; }
    table.rv-mobile-cards tr { box-shadow:var(--rv-shadow-soft); }
    table.rv-mobile-cards td::before { color:#53666f; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}


/* ==========================================================
   V7.14.4 · POLISH GRAFICO GENERALE
   Solo presentazione: nessuna logica applicativa.
   ========================================================== */
:root {
    --rv-green: #73e600;
    --rv-green-dark: #4da800;
    --rv-ink: #223038;
    --rv-muted: #68777f;
    --rv-bg: #f2f5f6;
    --rv-surface: #ffffff;
    --rv-border: #dbe3e6;
    --rv-radius: 18px;
    --rv-shadow: 0 8px 26px rgba(34, 48, 56, .09);
    --rv-shadow-hover: 0 12px 32px rgba(34, 48, 56, .14);
}

body {
    background:
      radial-gradient(circle at 12% -10%, rgba(115,230,0,.10), transparent 28rem),
      linear-gradient(180deg, #f8fafb 0, var(--rv-bg) 42%, #eef2f3 100%) !important;
    color: var(--rv-ink);
}

/* Barra superiore più ordinata e meno pesante */
.rv-navbar {
    background: linear-gradient(105deg, #202c32 0%, #33454e 68%, #3c5059 100%) !important;
    border-bottom: 3px solid var(--rv-green) !important;
    box-shadow: 0 7px 22px rgba(26,38,44,.18) !important;
}
.rv-navbar .nav-link { border: 1px solid transparent; }
.rv-navbar .nav-link:hover,
.rv-navbar .nav-link.rv-active {
    background: rgba(255,255,255,.10) !important;
    border-color: rgba(255,255,255,.08);
    color: #fff !important;
}
.rv-navbar .nav-link.rv-active { box-shadow: inset 0 -3px 0 var(--rv-green); }

/* Ricerca globale: diventa una vera barra strumenti */
.rv-global-search {
    position: relative;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}
.rv-global-search .input-group {
    background: #fff;
    padding: 5px;
    border: 1px solid var(--rv-border);
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(34,48,56,.08);
}
.rv-global-search .input-group-text,
.rv-global-search .form-control,
.rv-global-search .btn { border: 0 !important; }
.rv-global-search .form-control { box-shadow: none !important; }
.rv-global-search .btn { border-radius: 11px !important; padding-inline: 20px; }

/* Titoli e sezioni */
.section-title, .rv-page-title, main h1:first-child {
    color: var(--rv-ink);
    letter-spacing: -.025em;
}
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1.8rem 0 .85rem;
    font-weight: 800;
}
.section-title::before {
    content: "";
    width: 7px;
    height: 25px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--rv-green);
    box-shadow: 0 0 0 4px rgba(115,230,0,.12);
}

/* Card con gerarchia più netta */
.card, .card-main, .table-card, .card-capo, .content-card, .section-card {
    border: 1px solid rgba(219,227,230,.92) !important;
    border-radius: var(--rv-radius) !important;
    box-shadow: var(--rv-shadow) !important;
}
.card { overflow: hidden; }
.card-header {
    border-bottom: 1px solid rgba(219,227,230,.85);
    padding: .9rem 1.15rem;
}
.card-body { padding: 1.15rem; }
.card-capo { border-left: 6px solid var(--rv-green) !important; }

/* Pulsanti: più POS, meno Bootstrap standard */
.btn {
    border-radius: 11px !important;
    font-weight: 700 !important;
    letter-spacing: .005em;
    box-shadow: 0 2px 6px rgba(34,48,56,.07);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(34,48,56,.12); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-success { background-color: #55b800; border-color: #55b800; }
.btn-outline-success { color: #3c8500; border-color: #63bd20; }
.btn-outline-success:hover { background:#55b800; border-color:#55b800; color:#fff; }

/* Dashboard: i contatori sembrano pannelli operativi */
main .row.g-2.text-center .btn,
main .row.g-3.text-center .btn {
    background: rgba(255,255,255,.92);
    min-height: 86px;
    padding: 13px 10px !important;
    border-width: 1px;
}
main .row.g-2.text-center .btn strong,
main .row.g-3.text-center .btn strong {
    line-height: 1;
    margin-bottom: 7px;
    letter-spacing: -.04em;
}
main .row.g-2.text-center .btn.active,
main .row.g-3.text-center .btn.active {
    box-shadow: 0 0 0 3px rgba(115,230,0,.18), var(--rv-shadow-hover) !important;
}

/* Tabelle più leggibili al banco */
.table-responsive {
    border: 1px solid var(--rv-border);
    background: #fff;
    border-radius: 14px !important;
}
.table > :not(caption) > * > * { padding: .72rem .78rem; }
.table thead th {
    background: #edf2f4;
    color: #425159;
    border-bottom: 1px solid #d7e0e4;
    font-size: .79rem;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.table tbody tr { transition: background .12s ease; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: rgba(115,230,0,.065); }
.table a { font-weight: 700; text-underline-offset: 2px; }

/* Form: campi più facili da individuare */
.form-label { color:#46565e; font-weight:700; }
.form-control, .form-select, textarea {
    border: 1px solid #cfd9dd !important;
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(34,48,56,.025);
}
.form-control:focus, .form-select:focus, textarea:focus {
    border-color: #70cf24 !important;
    box-shadow: 0 0 0 .22rem rgba(115,230,0,.15) !important;
}

/* Badge e avvisi */
.badge { border-radius: 999px; padding: .42em .68em; font-weight: 750; }
.alert { border-radius: 14px; }
.alert-success { background:#eff9e8; border-color:#cde9ba; color:#2d6411; }
.alert-warning { background:#fff8e7; border-color:#f3dfaa; color:#765b14; }
.alert-danger { background:#fff0f1; border-color:#efc4c8; color:#8a2730; }
.alert-info { background:#edf7fb; border-color:#c8e5ef; color:#285f73; }

/* Dettaglio ordine: azioni e capi più separati visivamente */
.card-capo + .card-capo { margin-top: 1rem; }
.card-capo .badge { vertical-align: middle; }
details {
    border-radius: 12px;
    background: #f7f9fa;
    border: 1px solid #e1e7e9;
    padding: .6rem .75rem;
}
details > summary { cursor: pointer; font-weight: 750; color: #46565e; }
details[open] > summary { margin-bottom: .65rem; }

/* Mobile/tablet: priorità alla leggibilità e ai tocchi */
@media (max-width: 991.98px) {
    .rv-global-search { position: sticky; top: 70px; z-index: 1015; }
    .rv-global-search .input-group { box-shadow: 0 7px 18px rgba(34,48,56,.13); }
    .section-title { font-size: 1.18rem; margin-top: 1.35rem; }
    main .row.g-2.text-center .btn,
    main .row.g-3.text-center .btn { min-height: 82px; }
}

@media (max-width: 767.98px) {
    body { background: #f3f6f7 !important; }
    main.container { padding-left: 9px !important; padding-right: 9px !important; }
    .rv-global-search { top: 67px; margin-bottom: 11px !important; }
    .rv-global-search .input-group { border-radius: 13px; padding: 3px; }
    .rv-global-search .input-group-text { display:none; }
    .rv-global-search .btn { padding-inline: 13px; }
    .card-body { padding: 13px !important; }
    .section-title::before { height: 21px; width: 6px; }
    .btn { min-height: 47px; }
    .btn-sm { min-height: 40px; }
    main .row.g-2.text-center .btn,
    main .row.g-3.text-center .btn { min-height: 78px; font-size:.86rem; }
    main .row.g-2.text-center .btn strong,
    main .row.g-3.text-center .btn strong { font-size:1.55rem !important; }
    .mobile-bottom-nav { backdrop-filter: blur(10px); background: rgba(32,44,50,.97) !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}

/* ============================================================
   V7.14.5 - RESTYLING MIRATO DOPO VERIFICA SU SCHERMATE REALI
   Dashboard più compatta + dettaglio ordine più operativo
   ============================================================ */

/* Dashboard: meno spazio vuoto e titolo più compatto */
.dashboard-title { margin: .4rem 0 1.4rem !important; font-size: 2rem !important; }
.dashboard-title img { width: 112px !important; max-height: 82px; object-fit: contain; }
.dashboard-title + .card { margin-top: 0 !important; }

/* Le vecchie bolle diventano card operative compatte */
.btn-round {
    width: 100% !important;
    height: 112px !important;
    min-height: 112px;
    border-radius: 18px !important;
    padding: 12px 14px !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 12px;
    text-decoration: none !important;
    box-shadow: 0 4px 13px rgba(34,48,56,.13) !important;
    border: 1px solid rgba(73,91,99,.12) !important;
    overflow: hidden;
}
.btn-round:hover { transform: translateY(-2px) !important; box-shadow: 0 8px 18px rgba(34,48,56,.17) !important; }
.btn-round .tile-icon,
.btn-round .tile-icon-large {
    width: 58px !important;
    height: 58px !important;
    max-height: 58px !important;
    object-fit: contain;
    margin: 0 !important;
    flex: 0 0 58px;
}
.btn-round .badge-count {
    top: 8px !important;
    right: 9px !important;
    min-width: 31px;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7px !important;
    border: 1px solid #dce4e7;
}

/* Dashboard: titoli sezione allineati e griglia più densa */
.dashboard-title ~ .section-title,
h4.section-title {
    text-align: left !important;
    margin: 1.55rem 0 .75rem !important;
    font-size: 1.14rem !important;
}
.dashboard-title ~ .row.justify-content-center,
.container.text-center > .row.justify-content-center {
    row-gap: 12px;
}
.container.text-center > .row.justify-content-center > [class*="col-"] { margin-bottom: 0 !important; }

/* Centro attenzione: più simile a una barra di controllo */
.card.border-danger > .card-header { padding: .72rem 1rem; }
.card.border-danger .row.g-2.text-center .btn { min-height: 68px !important; padding: 9px 10px !important; }
.card.border-danger .row.g-2.text-center .btn strong { font-size: 1.35rem !important; margin-bottom: 4px; }

/* Posizione capi: compatta, il numero resta protagonista */
#posizione-capi { scroll-margin-top: 120px; }
.section-title + .card .row.g-2.text-center .btn { min-height: 72px !important; padding: 9px !important; }
.section-title + .card .row.g-2.text-center .btn strong { font-size: 1.45rem !important; }

/* Dettaglio ordine: barra azioni e tabella */
.rv-order-actions { position: sticky; top: 74px; z-index: 1005; backdrop-filter: blur(8px); }
.rv-order-table tbody > tr:not(.rv-history-row) > td { vertical-align: middle; }
.rv-order-table tbody > tr:not(.rv-history-row) { border-left: 4px solid transparent; }
.rv-order-table tbody > tr:not(.rv-history-row):hover { border-left-color: var(--rv-green); }
.rv-order-table .badge { white-space: normal; line-height: 1.15; }
.rv-order-table td:first-child { font-weight: 750; font-size: .98rem; }
.rv-order-table td:last-child .btn { min-width: 44px; }
.rv-order-table .btn-sm { padding: .42rem .62rem; }

/* Storico: meno dominante rispetto al lavoro corrente */
.rv-history-card { border-color: #dfe6e9 !important; }
.rv-history-card .table { font-size: .9rem; }
.rv-history-card .table td { padding-top: .55rem; padding-bottom: .55rem; }
.rv-history-card .table tbody tr:nth-child(n+11) { opacity: .86; }

@media (min-width: 992px) {
    /* Le colonne Bootstrap esistenti diventano una griglia più sfruttabile */
    .container.text-center > .row.justify-content-center > .col-md-2,
    .container.text-center > .row.justify-content-center > .col-md-3 {
        width: 20%;
        flex: 0 0 20%;
        max-width: 20%;
    }
}

@media (max-width: 991.98px) {
    .dashboard-title img { width: 76px !important; }
    .btn-round { height: 100px !important; min-height: 100px; }
    .btn-round .tile-icon, .btn-round .tile-icon-large { width: 48px !important; height: 48px !important; flex-basis: 48px; }
    .rv-order-actions { position: static; backdrop-filter: none; }
}

@media (max-width: 575.98px) {
    .dashboard-title { font-size: 1.55rem !important; justify-content: flex-start !important; }
    .dashboard-title img { width: 62px !important; }
    .btn-round { height: 92px !important; min-height: 92px; border-radius: 14px !important; font-size: .82rem !important; }
    .btn-round .tile-icon, .btn-round .tile-icon-large { width: 42px !important; height: 42px !important; flex-basis: 42px; }
    .rv-order-table { min-width: 760px; }
}

/* ============================================================
   V7.14.6 - RIFINITURA DASHBOARD
   Codice colore coerente + zeri attenuati + flussi compatti
   ============================================================ */
.rv-dashboard .rv-zero {
    background: #f4f6f7 !important;
    border-color: #dce3e6 !important;
    color: #77858c !important;
    box-shadow: none !important;
    filter: saturate(.25);
    opacity: .76;
}
.rv-dashboard .rv-zero:hover { opacity: 1; filter: saturate(.55); }
.rv-dashboard .rv-zero .badge-count { color:#6f7d84 !important; background:#fff !important; }
.rv-attention-item.rv-zero { border:1px solid #d8e0e3 !important; }

/* Semantica colori: blu=lavorazione, giallo=rientrato/CQ, verde=pronto, grigio=consegnato */
.rv-stage-working { background:#cfe9f8 !important; color:#163d55 !important; }
.rv-stage-returned { background:#fff0a8 !important; color:#5e4a00 !important; }
.rv-stage-ready { background:#baf2bf !important; color:#174d1c !important; }
.rv-stage-done { background:#d7dcdf !important; color:#48545a !important; }

.rv-external-flow {
    display:grid; grid-template-columns:150px 1fr; gap:14px; align-items:stretch;
    padding:12px; border:1px solid #dce4e7; border-radius:16px; background:#fff;
    box-shadow:0 4px 14px rgba(34,48,56,.08);
}
.rv-flow-label { display:flex; align-items:center; justify-content:center; gap:9px; border-right:1px solid #e1e7e9; font-size:.92rem; }
.rv-flow-label img { width:46px; height:46px; object-fit:contain; }
.rv-flow-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.rv-flow-grid .btn-round, .rv-company-grid .btn-round { height:86px !important; min-height:86px !important; font-size:.86rem; }
.rv-flow-grid .btn-round .tile-icon, .rv-flow-grid .btn-round .tile-icon-large,
.rv-company-grid .btn-round .tile-icon { width:42px !important; height:42px !important; flex-basis:42px; }

.rv-pulisecco-assign { border:1px solid #efd889 !important; overflow:hidden; }
.rv-pulisecco-assign.rv-zero { opacity:1; filter:none; }
.rv-pulisecco-assign.rv-zero .card-header { background:#f5f6f7 !important; color:#6e7a80; border-bottom:0; padding:.58rem .85rem; }
.rv-pulisecco-assign.rv-zero .card-body { display:none; }
.rv-pulisecco-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:1.5rem; }
.rv-pulisecco-company { background:#fff; border:1px solid #dce4e7; border-radius:16px; padding:12px; box-shadow:0 4px 14px rgba(34,48,56,.08); }
.rv-company-title { text-align:left; padding:2px 4px 10px; font-size:1rem; color:#34454d; }
.rv-company-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }

@media (max-width: 991.98px) {
  .rv-external-flow { grid-template-columns:1fr; }
  .rv-flow-label { justify-content:flex-start; border-right:0; border-bottom:1px solid #e1e7e9; padding-bottom:8px; }
  .rv-pulisecco-grid { grid-template-columns:1fr; }
}
@media (max-width: 575.98px) {
  .rv-flow-grid, .rv-company-grid { grid-template-columns:1fr 1fr; }
  .rv-flow-grid .btn-round, .rv-company-grid .btn-round { height:80px !important; min-height:80px !important; }
}

/* === V7.14.7 · Nuovo Ordine + Dettaglio Ordine === */
.rv-new-order-page, .rv-order-detail-page { max-width: 1120px; }
.rv-new-order-title { margin-top: .25rem; }
.rv-new-order-title img { width: 54px !important; }
.rv-new-order-page .card-main { padding: 22px 24px; }
.rv-order-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.rv-order-steps span { display:flex; align-items:center; justify-content:center; gap:8px; min-height:42px; border:1px solid #d8e0e5; border-radius:10px; background:#f7f9fa; color:#66727a; font-weight:700; font-size:.88rem; }
.rv-order-steps span b { width:25px; height:25px; border-radius:50%; display:inline-grid; place-items:center; background:#dfe5e8; color:#34424a; }
.rv-order-steps span.active { border-color:#73e600; background:#f5ffed; color:#24321d; }
.rv-order-steps span.active b { background:#73e600; color:#142000; }
.rv-section-title { display:flex; align-items:center; gap:4px; font-size:1.1rem; margin-top:.1rem; }
.rv-section-title img { width:32px !important; }
.rv-garment-card { border:1px solid #dbe4e8; border-left:5px solid #73e600; background:#fff; box-shadow:0 3px 12px rgba(24,39,47,.08) !important; }
.rv-primary-field-label { font-size:1rem; }
.rv-primary-field { min-height:48px; font-size:1.05rem; border:2px solid #b9c7ce !important; }
.rv-primary-field:focus { border-color:#73e600 !important; box-shadow:0 0 0 .2rem rgba(115,230,0,.12) !important; }
.rv-new-order-page .form-label { margin-bottom:.35rem; }
.rv-new-order-page .form-control, .rv-new-order-page .form-select { box-shadow:none; min-height:42px; }
.rv-new-order-page .form-text { font-size:.78rem; }
.rv-add-garment { box-shadow:none !important; }
.rv-final-actions { position:sticky; bottom:10px; z-index:10; background:rgba(255,255,255,.94); border:1px solid #dfe6e9; border-radius:12px; padding:10px; backdrop-filter:blur(5px); }
.rv-final-actions #btnCreaOrdine { min-width:190px; background:#55b900; border-color:#55b900; }

.rv-order-heading { display:flex; align-items:center; gap:8px; font-size:1.55rem; }
.rv-order-heading img { width:48px !important; }
.rv-order-detail-page .card-main, .rv-order-detail-page .card { border:1px solid #dfe6e9; box-shadow:0 4px 14px rgba(24,39,47,.08) !important; }
.rv-order-actions .btn { min-height:42px; display:inline-flex; align-items:center; }
.rv-items-card { padding:16px !important; }
.rv-card-heading { display:flex; justify-content:space-between; align-items:center; font-weight:800; font-size:1.05rem; margin-bottom:10px; padding:0 2px; }
.rv-order-table thead th { font-size:.76rem; letter-spacing:.02em; background:#edf2f4 !important; color:#26343b !important; border-bottom:1px solid #cbd6db; }
.rv-order-table td { vertical-align:middle; padding:.72rem .55rem; }
.rv-item-name { font-size:.96rem; }
.rv-item-row { background:#fff !important; }
.rv-item-row:hover { background:#f8fff3 !important; }
.rv-item-delivered { opacity:.62; background:#f3f5f5 !important; }
.rv-item-delivered:hover { opacity:.82; }
.rv-order-table .badge { border-radius:999px; padding:.42em .7em; }
.rv-order-table .btn-outline-primary { border-radius:8px; }
.rv-action-icon { width:42px !important; height:42px !important; box-shadow:0 2px 7px rgba(0,0,0,.16) !important; }
.rv-action-icon img { width:22px !important; }
.capo-timeline > summary { background:#f6f8f9; border:1px solid #dce4e7; border-radius:9px; padding:8px 10px; }
.rv-history-card { padding:16px !important; }
.rv-history-card table { font-size:.86rem; }

@media (max-width: 767px) {
  .rv-order-steps { grid-template-columns:1fr; }
  .rv-order-steps span { justify-content:flex-start; padding-left:12px; min-height:36px; }
  .rv-new-order-page .card-main { padding:14px; }
  .rv-final-actions { position:static; }
  .rv-final-actions .btn { width:100%; margin:.25rem 0 !important; }
  .rv-order-heading { font-size:1.25rem; align-items:flex-start; }
  .rv-order-actions { display:grid !important; grid-template-columns:1fr 1fr; }
  .rv-order-actions .btn, .rv-order-actions .dropdown, .rv-order-actions .dropdown .btn { width:100%; }
  .rv-items-card { padding:10px !important; }
}


/* === V7.14.8 · Rifinitura Ordini === */
.rv-order-steps span.complete { border-color:#9bdc63; background:#f4faef; color:#49603a; }
.rv-order-steps span.complete b { font-size:0; background:#55b900; color:#fff; }
.rv-order-steps span.complete b::after { content:"✓"; font-size:.9rem; font-weight:900; }
#risultatiClienti:empty { display:none !important; margin:0 !important; padding:0 !important; border:0 !important; }
.rv-item-active { box-shadow: inset 5px 0 0 #73e600; }
.rv-item-active .rv-item-name { color:#172c0f; }
.rv-item-ready { background:#f3ffea !important; }
.rv-item-ready td { border-top-color:#b9e899 !important; border-bottom-color:#b9e899 !important; }
.rv-item-ready .badge.bg-secondary { background:#3f9f22 !important; color:#fff !important; font-size:.78rem; padding:.5em .8em; }
.rv-item-delivered { box-shadow:none !important; }
.rv-action-icon { position:relative; }
.tooltip { font-size:.78rem; }
@media (max-width:767px){ .rv-item-active { box-shadow: inset 4px 0 0 #73e600; } }

/* ==========================================================
   V7.19.6.12 - MOBILE FIRST COMPLETO
   Obiettivo: uso a 360-430px in verticale senza sovrapposizioni.
   ========================================================== */
@media (max-width: 767.98px) {
  html, body { max-width:100%; overflow-x:hidden; }
  body { padding-bottom:76px; }
  main.container, main.container-fluid { width:100%; max-width:100%; padding-left:10px!important; padding-right:10px!important; }
  h1 { font-size:1.55rem; } h2 { font-size:1.35rem; } h3 { font-size:1.18rem; }
  .card, .section-card, .content-card, .table-card { max-width:100%; overflow:hidden; }
  .card-body { padding:12px; }
  .row { --bs-gutter-x:.65rem; }
  .row > [class*="col-"] { min-width:0; }
  .btn, button, a.btn { white-space:normal; overflow-wrap:anywhere; line-height:1.15; min-height:42px; }
  .btn-group, .btn-group-vertical { width:100%; flex-wrap:wrap; gap:6px; }
  .btn-group > .btn { flex:1 1 46%; border-radius:.375rem!important; }
  .d-flex { min-width:0; }
  .d-flex.gap-2, .d-flex.gap-3 { flex-wrap:wrap; }
  .d-flex.gap-2 > .btn, .d-flex.gap-3 > .btn { flex:1 1 140px; }
  input, select, textarea, .form-control, .form-select { max-width:100%; min-width:0; font-size:16px!important; }
  .input-group { flex-wrap:nowrap; max-width:100%; }
  .input-group > .form-control, .input-group > .form-select { min-width:0; }
  .rv-global-search { top:58px; }
  .rv-global-search .form-control { min-width:0; }
  .rv-global-search .btn { flex:0 0 auto; padding-inline:12px; }

  /* Tabelle operative: mantieni tutte le colonne accessibili senza allargare la pagina. */
  .table-responsive { width:100%; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:10px; }
  table.table { margin-bottom:0; font-size:.86rem; }
  table.table th, table.table td { padding:.55rem .45rem; vertical-align:middle; overflow-wrap:anywhere; }
  table.table .btn { min-height:34px; padding:.35rem .5rem; font-size:.8rem; }

  /* Dashboard/tile: due colonne, una sola sui telefoni molto stretti. */
  .dashboard-grid, .tiles-grid, .quick-grid, .status-grid, .reparti-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px!important; }
  .btn-round { min-width:0!important; min-height:86px!important; padding:10px 7px!important; }
  .btn-round .badge-count { min-width:30px; min-height:30px; }

  /* Modali e pannelli devono stare nello schermo verticale. */
  .modal-dialog { margin:.5rem; max-width:calc(100% - 1rem); }
  .modal-body { max-height:72vh; overflow-y:auto; }
  .offcanvas { max-width:88vw; }
  footer { padding-bottom:10px; }
  .calculator-fab { bottom:82px!important; right:12px!important; }
}
@media (max-width: 390px) {
  .dashboard-grid, .tiles-grid, .quick-grid, .status-grid, .reparti-grid { grid-template-columns:1fr!important; }
  .btn-group > .btn { flex-basis:100%; }
  .rv-global-search .btn { font-size:.82rem; }
}

/* ============================================================
   V7.21.0 - Nuova interfaccia gestionale / shell desktop
   Sidebar coerente, area lavoro ampia, mobile invariato.
   ============================================================ */
:root{
  --rv-shell-navy:#17324d;
  --rv-shell-navy-2:#214765;
  --rv-shell-blue:#1677e8;
  --rv-shell-bg:#f3f6f8;
  --rv-shell-border:#dbe4ea;
}
body{background:var(--rv-shell-bg);}
.rv-nav-glyph{display:inline-flex;width:34px;height:34px;align-items:center;justify-content:center;border-radius:9px;background:rgba(255,255,255,.10);font-size:1.05rem;flex:0 0 34px;}
@media (min-width: 992px){
  body{padding-left:248px;}
  .rv-navbar{
    position:fixed!important;left:0;top:0;bottom:0;width:248px;height:100vh;
    z-index:1040;margin:0!important;padding:0!important;border:0!important;
    border-right:1px solid rgba(255,255,255,.08)!important;
    background:linear-gradient(180deg,var(--rv-shell-navy),#10283d 72%,#0d2234)!important;
    box-shadow:8px 0 28px rgba(22,45,66,.12)!important;overflow-y:auto;
  }
  .rv-navbar .container-fluid{display:flex!important;flex-direction:column!important;align-items:stretch!important;padding:18px 12px!important;min-height:100%;}
  .rv-brand{display:flex!important;flex-direction:column;align-items:flex-start!important;gap:8px;color:#fff!important;font-size:1.03rem!important;line-height:1.2;margin:0 5px 20px!important;padding:0 4px 18px!important;border-bottom:1px solid rgba(255,255,255,.15);white-space:normal!important;}
  .rv-brand img{width:54px!important;height:54px!important;object-fit:contain!important;}
  .rv-navbar .navbar-collapse{display:block!important;width:100%;flex:1!important;}
  .rv-navbar .navbar-nav{display:flex!important;flex-direction:column!important;align-items:stretch!important;width:100%;gap:4px;margin:0!important;}
  .rv-navbar .nav-item{width:100%;margin:0!important;}
  .rv-navbar .nav-link{width:100%;min-height:47px;padding:7px 10px!important;border-radius:10px!important;color:#eaf2f8!important;display:flex!important;align-items:center!important;gap:10px!important;font-size:.91rem;line-height:1.15;}
  .rv-navbar .nav-link img{width:31px!important;height:31px!important;object-fit:contain!important;flex:0 0 31px;filter:drop-shadow(0 1px 1px rgba(0,0,0,.15));}
  .rv-navbar .nav-link:hover{background:rgba(255,255,255,.09)!important;color:#fff!important;transform:none!important;}
  .rv-navbar .nav-link.active{background:linear-gradient(90deg,#1478e8,#2493f2)!important;color:#fff!important;box-shadow:0 5px 15px rgba(0,93,190,.26);}
  .rv-navbar .nav-item.text-white{margin-top:auto!important;padding:16px 10px 8px!important;border-top:1px solid rgba(255,255,255,.14);text-align:left!important;}
  .rv-navbar form .btn{width:100%;margin-top:5px;}
  main.container{max-width:none!important;width:100%!important;padding:22px 28px 40px!important;margin:0!important;}
  .rv-global-search{position:sticky;top:0;z-index:1020;background:rgba(243,246,248,.94);backdrop-filter:blur(8px);padding:8px 0 12px;margin-top:-8px!important;}
  .rv-global-search .input-group{max-width:980px;margin:0 auto;box-shadow:0 3px 14px rgba(24,49,72,.08);border-radius:12px;overflow:hidden;}
  .card,.rv-card{border-color:var(--rv-shell-border)!important;box-shadow:0 4px 16px rgba(25,54,78,.07)!important;border-radius:14px!important;}
}
@media (min-width: 992px) and (max-width: 1180px){
  body{padding-left:220px}.rv-navbar{width:220px}.rv-navbar .nav-link{font-size:.84rem;padding-left:8px!important;padding-right:8px!important}main.container{padding-left:18px!important;padding-right:18px!important}
}
@media (max-width: 991.98px){
  body{padding-left:0!important;}
  .rv-nav-glyph{width:28px;height:28px;flex-basis:28px;}
}


/* ============================================================
   V7.21.3 - Sidebar più visibile + icone sempre presenti
   ============================================================ */
:root{--rv-sidebar-width:268px;}
.rv-nav-glyph{
  display:inline-flex;
  width:36px;
  height:36px;
  align-items:center;
  justify-content:center;
  border-radius:11px;
  background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.08));
  border:1px solid rgba(255,255,255,.12);
  color:#ffffff;
  font-size:1.02rem;
  font-weight:800;
  line-height:1;
  flex:0 0 36px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 2px 6px rgba(0,0,0,.12);
}
@media (min-width: 992px){
  body{padding-left:var(--rv-sidebar-width);}
  .rv-navbar{
    width:var(--rv-sidebar-width);
    background:linear-gradient(180deg,#17324d 0%,#10283d 56%,#0b1f31 100%)!important;
    box-shadow:10px 0 34px rgba(14,33,49,.22)!important;
  }
  .rv-navbar .container-fluid{padding:16px 14px 18px!important;}
  .rv-brand{font-size:1.08rem!important;padding-bottom:16px!important;margin-bottom:18px!important;}
  .rv-brand img{width:58px!important;height:58px!important;}
  .rv-navbar .navbar-nav{gap:6px!important;}
  .rv-navbar .nav-link,
  .rv-navbar .nav-link.rv-active,
  .rv-navbar .nav-link.active{
    width:100%;
    min-height:52px;
    padding:9px 12px!important;
    font-size:.98rem;
    font-weight:750;
    letter-spacing:.01em;
  }
  .rv-navbar .nav-link:hover,
  .rv-navbar .nav-link.rv-active,
  .rv-navbar .nav-link.active{
    background:linear-gradient(90deg,rgba(28,135,239,.95),rgba(23,113,223,.95))!important;
    color:#fff!important;
    border-color:rgba(255,255,255,.12)!important;
    box-shadow:0 8px 20px rgba(0,79,163,.28)!important;
  }
  .rv-navbar .nav-link:hover .rv-nav-glyph,
  .rv-navbar .nav-link.rv-active .rv-nav-glyph,
  .rv-navbar .nav-link.active .rv-nav-glyph{
    background:rgba(255,255,255,.18);
    border-color:rgba(255,255,255,.16);
  }
  .rv-navbar .nav-item.text-white{
    margin-top:auto!important;
    padding:18px 12px 10px!important;
    border-top:1px solid rgba(255,255,255,.16);
    background:rgba(255,255,255,.03);
    border-radius:12px;
  }
  .rv-navbar form .btn{
    min-height:44px;
    font-size:.94rem;
    border-radius:11px;
    border-width:1.5px;
  }
  main.container{padding:22px 30px 42px!important;}
}
@media (min-width: 992px) and (max-width: 1180px){
  body{padding-left:240px;}
  .rv-navbar{width:240px;}
  .rv-navbar .nav-link{font-size:.92rem;}
}


/* V7.21.4 - icone SVG sidebar e maggiore leggibilità */
.rv-menu-icon{width:28px;height:28px;flex:0 0 28px;color:#fff;display:block;}
@media(min-width:992px){
  body{padding-left:282px;}
  .rv-navbar{width:282px!important;}
  .rv-navbar .container-fluid{padding:18px 16px 20px!important;}
  .rv-brand{font-size:1.12rem!important;font-weight:850!important;}
  .rv-brand img{width:62px!important;height:62px!important;}
  .rv-navbar .nav-link{min-height:54px!important;padding:10px 13px!important;font-size:1rem!important;font-weight:800!important;color:#f6fbff!important;}
  .rv-navbar .nav-link .rv-menu-icon{width:29px;height:29px;flex-basis:29px;filter:drop-shadow(0 2px 3px rgba(0,0,0,.18));}
  .rv-navbar .nav-link:hover,.rv-navbar .nav-link.rv-active,.rv-navbar .nav-link.active{background:linear-gradient(90deg,#1b84ee,#146bd4)!important;color:#fff!important;border-left:4px solid #73e600!important;padding-left:9px!important;}
  .rv-navbar .nav-item.text-white{font-size:.9rem!important;}
  main.container{padding-left:34px!important;padding-right:34px!important;}
}
@media(min-width:992px) and (max-width:1180px){body{padding-left:252px}.rv-navbar{width:252px!important}.rv-navbar .nav-link{font-size:.94rem!important}}


/* ============================================================
   V7.21.11 - Consolidamento grafico finale shell gestionale
   ============================================================ */
:root{
  --rv-ui-blue:#1769d2;
  --rv-ui-blue-dark:#0f4f9f;
  --rv-ui-green:#63c900;
  --rv-ui-bg:#f4f7fa;
  --rv-ui-border:#dbe5ec;
  --rv-ui-ink:#17324d;
  --rv-ui-muted:#6c7f91;
}
body{background:linear-gradient(180deg,#f7f9fb 0%,#f1f5f8 100%)!important;color:var(--rv-ui-ink)}
main.container{min-height:calc(100vh - 90px)}
.rv-global-search{max-width:none!important;margin-bottom:18px!important}
.rv-global-search .input-group{max-width:1080px!important;margin:0 auto;border:1px solid #d7e1e9!important;border-radius:14px!important;background:#fff!important;box-shadow:0 5px 18px rgba(24,49,72,.08)!important}
.rv-global-search .form-control{font-size:.98rem;padding-left:14px}
.rv-global-search .btn{background:#20364b!important;border-color:#20364b!important;min-width:92px}
.rv-message{border-radius:13px!important;box-shadow:0 4px 14px rgba(24,49,72,.08)!important}
.card,.card-main,.table-card,.content-card,.section-card,.rv-card{border-color:var(--rv-ui-border)!important;box-shadow:0 4px 16px rgba(24,49,72,.07)!important}
.card-header{background:#fbfdff;border-bottom:1px solid #e4ebf0!important}
.table thead th{color:#36526c;background:#f4f7f9!important}
.table tbody tr:hover{background:#f8fbff}
.btn-primary{background:#1769d2;border-color:#1769d2}.btn-primary:hover{background:#0f59bb;border-color:#0f59bb}
.btn-success{background:#58b900;border-color:#58b900}.btn-success:hover{background:#499b00;border-color:#499b00}
.btn-outline-primary{color:#1769d2;border-color:#a8c9eb}.btn-outline-primary:hover{background:#1769d2;border-color:#1769d2;color:#fff}
.btn-outline-secondary{border-color:#c9d5dd;color:#4f6577}.btn-outline-secondary:hover{background:#eef3f6;color:#253b4d;border-color:#b7c6d0}
.badge{font-weight:750}
.form-control,.form-select{border-color:#ccd8e1!important;background:#fff!important}.form-control:focus,.form-select:focus{border-color:#6aa7df!important;box-shadow:0 0 0 .2rem rgba(23,105,210,.12)!important}
.calculator-fab{border:1px solid #dce5ec!important;box-shadow:0 8px 24px rgba(24,49,72,.18)!important}
footer{background:#edf2f5!important;color:#5e7182!important;border-top:1px solid #dbe4ea!important}
@media(min-width:992px){
  .rv-navbar{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.25) transparent}
  .rv-navbar::-webkit-scrollbar{width:6px}.rv-navbar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.22);border-radius:10px}
  .rv-navbar .nav-link{position:relative}
  .rv-navbar .nav-link.rv-active::after,.rv-navbar .nav-link.active::after{content:"";position:absolute;right:8px;width:7px;height:7px;border-radius:50%;background:#d9ff9a;box-shadow:0 0 0 3px rgba(217,255,154,.13)}
  .rv-navbar .nav-item.text-white strong{font-size:.96rem}.rv-navbar .nav-item.text-white span{font-size:.82rem}
}
@media(max-width:991.98px){
  .mobile-bottom-nav{background:rgba(20,43,63,.98)!important;border-top:2px solid #1769d2!important;box-shadow:0 -6px 20px rgba(24,49,72,.2)!important}
  .mobile-bottom-nav .rv-mobile-nav-item{min-height:58px!important}
  .mobile-bottom-nav .rv-mobile-nav-item:active{background:rgba(23,105,210,.22)!important}
  .rv-mobile-offcanvas .offcanvas-header{border-bottom-color:#1769d2!important;background:#f7fafc}
  .rv-mobile-menu-list a{border-color:#dce5ec!important;box-shadow:0 2px 8px rgba(24,49,72,.04)}
  .rv-mobile-menu-list a:active{background:#eef6ff!important;border-color:#9bc6ef!important}
}


/* ============================================================
   V7.22.0 - Collaudo responsive e coerenza finale
   ============================================================ */
html,body{overflow-x:hidden!important}
main.container,main.container-fluid{max-width:100%!important}
main *{min-width:0}
.rv-page-toolbar,.action-toolbar,.toolbar,.page-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.rv-page-toolbar>.btn,.action-toolbar>.btn,.toolbar>.btn,.page-actions>.btn{flex:0 1 auto}
@media(max-width:991.98px){
  body{padding-left:0!important;padding-bottom:calc(74px + env(safe-area-inset-bottom))!important}
  main.container{padding-left:12px!important;padding-right:12px!important;padding-bottom:28px!important}
  .rv-global-search{position:sticky!important;top:0!important;z-index:1015!important;padding:8px 0!important;background:rgba(244,247,250,.96)!important;backdrop-filter:blur(8px)}
  .rv-global-search .input-group{max-width:100%!important}
  .rv-global-search .form-control{font-size:.94rem!important}
  .rv-global-search .btn{min-width:76px!important;padding-inline:12px!important}
  .card,.card-main,.table-card,.content-card,.section-card,.rv-card{border-radius:14px!important}
  .btn{white-space:normal!important;line-height:1.2!important}
  .btn-group,.btn-toolbar{display:flex!important;flex-wrap:wrap!important;gap:7px!important}
  .btn-group>.btn{border-radius:10px!important;margin:0!important;flex:1 1 150px!important}
  .row>[class*="col-"]{min-width:0}
  .input-group{max-width:100%!important}
  .form-control,.form-select,textarea{font-size:16px!important}
  .modal-dialog{max-width:calc(100vw - 20px)!important;margin:10px!important}
  .offcanvas{max-width:92vw!important}
}
@media(max-width:575.98px){
  main.container{padding-left:8px!important;padding-right:8px!important}
  h1,.h1{font-size:1.55rem!important}h2,.h2{font-size:1.28rem!important}
  .rv-page-toolbar,.action-toolbar,.toolbar,.page-actions{display:grid!important;grid-template-columns:1fr!important;width:100%}
  .rv-page-toolbar>.btn,.action-toolbar>.btn,.toolbar>.btn,.page-actions>.btn,.rv-page-toolbar>form,.action-toolbar>form,.toolbar>form,.page-actions>form{width:100%!important}
  .d-flex.gap-2>.btn,.d-flex.gap-3>.btn{flex:1 1 150px}
  .table-responsive{width:100%!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
  table.table{min-width:0!important}
  .mobile-bottom-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important;padding-left:4px!important;padding-right:4px!important}
  .mobile-bottom-nav .rv-mobile-nav-item{overflow:hidden!important}
  .mobile-bottom-nav .rv-mobile-nav-item span:last-child{font-size:.64rem!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .calculator-fab{right:10px!important;bottom:calc(82px + env(safe-area-inset-bottom))!important}
}
@media(max-width:380px){
  .mobile-bottom-nav .rv-mobile-nav-item span:last-child{font-size:.58rem!important}
  .rv-global-search .btn{min-width:64px!important;font-size:.78rem!important}
}


/* ============================================================
   V7.22.1 - Rifiniture usabilità, touch e accessibilità
   ============================================================ */
:root{
  --rv-focus:#1769d2;
  --rv-touch:44px;
}
a,button,.btn,.nav-link,.form-control,.form-select{scroll-margin-top:86px}
a:focus-visible,button:focus-visible,.btn:focus-visible,.nav-link:focus-visible,
input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid rgba(23,105,210,.38)!important;
  outline-offset:2px!important;
  box-shadow:0 0 0 3px rgba(23,105,210,.11)!important;
}
button,.btn,.nav-link,.rv-mobile-menu-list a{min-height:var(--rv-touch)}
.btn-sm{min-height:38px}
.btn-close{min-height:auto}
input[type="checkbox"],input[type="radio"]{min-width:18px;min-height:18px}
.form-check{min-height:32px;display:flex;align-items:center;gap:7px}
.form-check-input{margin-top:0}
.table td,.table th{vertical-align:middle}
.table td .btn{margin-block:2px}
.text-muted,.rv-muted,.conv-muted,.rv-system-muted{color:#64798b!important}
.alert a{font-weight:750}
.badge{white-space:normal;text-align:center}
.card,.rv-card,.conv-panel,.rv-system-panel{contain:paint}

@media (min-width:992px){
  .table-responsive{overflow-x:auto}
  .table th,.table td{padding-left:.72rem;padding-right:.72rem}
  .rv-navbar .nav-link{transition:background-color .14s ease,box-shadow .14s ease,border-color .14s ease!important}
}

@media (max-width:767.98px){
  label,.form-label{font-size:.94rem}
  .form-text,.small,small{line-height:1.35}
  .btn{padding:.62rem .75rem}
  .btn-sm{padding:.48rem .62rem}
  .card-body{overflow-wrap:anywhere}
  .dropdown-menu{max-width:calc(100vw - 24px);white-space:normal}
  .dropdown-item{white-space:normal;min-height:42px;display:flex;align-items:center}
  .modal-footer{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .modal-footer .btn{width:100%!important;margin:0!important}
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
    scroll-behavior:auto!important;
  }
}

@media print{
  body{background:#fff!important}
  .rv-navbar,.mobile-bottom-nav,.calculator-fab,.rv-global-search,footer{display:none!important}
  main.container{padding:0!important;margin:0!important;max-width:100%!important}
  .card,.rv-card,.conv-panel,.rv-system-panel{box-shadow:none!important;break-inside:avoid}
  .btn{display:none!important}
}


/* ============================================================
   V7.22.2 - Coerenza visiva finale e densità operativa
   ============================================================ */
:root{
  --rv-section-gap:16px;
  --rv-card-radius:15px;
  --rv-control-radius:10px;
}

/* Spaziature più coerenti tra sezioni operative */
main.container > * + *{margin-top:var(--rv-section-gap)}
.card,.rv-card,.conv-panel,.rv-system-panel{
  border-radius:var(--rv-card-radius)!important;
}
.card-header,.conv-section-head,.rv-system-panel-head{
  min-height:54px;
}
.card-header h1,.card-header h2,.card-header h3,
.conv-section-head h1,.conv-section-head h2,.conv-section-head h3,
.rv-system-panel-head h1,.rv-system-panel-head h2,.rv-system-panel-head h3{
  margin-bottom:0;
}

/* Barre azioni più leggibili */
.action-bar,.actions-bar,.toolbar,.btn-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.action-bar .btn,.actions-bar .btn,.toolbar .btn,.btn-toolbar .btn{
  margin:0!important;
}

/* Form più ordinati */
.form-control,.form-select,.input-group-text,.btn{
  border-radius:var(--rv-control-radius);
}
.input-group>.form-control:not(:first-child),
.input-group>.form-select:not(:first-child){border-top-left-radius:0!important;border-bottom-left-radius:0!important}
.input-group>.form-control:not(:last-child),
.input-group>.form-select:not(:last-child){border-top-right-radius:0!important;border-bottom-right-radius:0!important}

/* Tabelle desktop: intestazioni e righe più leggibili */
@media (min-width:768px){
  .table thead th{
    position:relative;
    background:#f4f7f9;
    color:#415a70;
    font-weight:800;
  }
  .table tbody tr{transition:background-color .12s ease}
  .table tbody tr:hover{background:#f8fbfd}
}

/* Badge di stato più consistenti */
.badge{
  min-height:26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1.1;
}

/* Riduce l'effetto "pagina vuota" su monitor grandi */
@media (min-width:1280px){
  main.container{max-width:1600px!important}
  .card-body,.conv-section-body,.rv-system-panel-body{padding:18px 20px}
}

/* Smartphone verticale: priorità alla leggibilità */
@media (max-width:575.98px){
  main.container{padding-left:8px!important;padding-right:8px!important}
  .card,.rv-card,.conv-panel,.rv-system-panel{border-radius:13px!important}
  .card-header,.conv-section-head,.rv-system-panel-head{padding:12px!important;min-height:auto}
  .card-body,.conv-section-body,.rv-system-panel-body{padding:12px!important}
  .action-bar,.actions-bar,.toolbar,.btn-toolbar{display:grid!important;grid-template-columns:1fr!important;width:100%}
  .action-bar .btn,.actions-bar .btn,.toolbar .btn,.btn-toolbar .btn{width:100%!important}
  .input-group{width:100%}
  .form-control,.form-select{font-size:16px!important} /* evita zoom automatico su mobile */
}

/* Stati disabilitati più chiari */
.btn:disabled,.btn.disabled,
.form-control:disabled,.form-select:disabled{
  opacity:.62;
  cursor:not-allowed;
}

/* Link dentro card più leggibili */
.card a:not(.btn),.conv-panel a:not(.btn),.rv-system-panel a:not(.btn){
  text-underline-offset:2px;
}

/* Uniformità visiva degli elementi secondari */
hr{
  border-color:#e2e9ee;
  opacity:1;
}
code{
  color:#315b80;
  background:#f3f7fa;
  padding:.12rem .32rem;
  border-radius:5px;
}


/* ============================================================
   V7.22.3 - Navigazione e mobile finale
   ============================================================ */

/* Sidebar desktop: scorrimento discreto e voce attiva sempre ben leggibile */
@media (min-width:992px){
  .rv-navbar{
    scrollbar-width:thin;
    scrollbar-color:rgba(255,255,255,.22) transparent;
  }
  .rv-navbar::-webkit-scrollbar{width:7px}
  .rv-navbar::-webkit-scrollbar-track{background:transparent}
  .rv-navbar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:999px}
  .rv-navbar .nav-link.rv-active,
  .rv-navbar .nav-link.active{
    position:relative;
  }
  .rv-navbar .nav-link.rv-active::before,
  .rv-navbar .nav-link.active::before{
    content:"";
    position:absolute;
    left:0;
    top:8px;
    bottom:8px;
    width:4px;
    border-radius:999px;
    background:#9cff45;
  }
}

/* Ricerca globale più stabile durante lo scorrimento */
.rv-global-search{
  isolation:isolate;
}
.rv-global-search .input-group{
  min-width:0;
}
.rv-global-search .form-control{
  min-width:0;
}

/* Pannelli e intestazioni: niente sovrapposizioni con contenuti flottanti */
.card,.rv-card,.conv-panel,.rv-system-panel,
.card-header,.conv-section-head,.rv-system-panel-head{
  position:relative;
}
.dropdown-menu{
  z-index:1090;
}

/* Smartphone/tablet: navigazione inferiore e offcanvas più robusti */
@media (max-width:991.98px){
  body{
    padding-bottom:calc(82px + env(safe-area-inset-bottom))!important;
  }
  .mobile-bottom-nav{
    min-height:72px;
    padding-bottom:calc(6px + env(safe-area-inset-bottom))!important;
  }
  .mobile-bottom-nav .rv-mobile-nav-item{
    min-height:58px;
    gap:3px;
  }
  .mobile-bottom-nav .rv-mobile-nav-item span:last-child{
    line-height:1.1;
  }
  .rv-mobile-offcanvas{
    width:min(92vw,380px)!important;
  }
  .rv-mobile-offcanvas .offcanvas-body{
    padding-bottom:calc(20px + env(safe-area-inset-bottom));
  }
  .rv-mobile-menu-list a{
    min-height:54px;
    padding:11px 13px;
  }
}

/* Telefoni stretti: riduce ulteriormente rischi di sovrapposizione */
@media (max-width:430px){
  .mobile-bottom-nav{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  .mobile-bottom-nav .rv-mobile-nav-item{
    padding-left:2px!important;
    padding-right:2px!important;
  }
  .mobile-bottom-nav .rv-mobile-nav-item span:last-child{
    font-size:.62rem!important;
  }
  .rv-global-search .btn{
    padding-inline:10px!important;
    font-size:.8rem!important;
  }
}

/* Elementi lunghi: testo sempre contenuto nello spazio disponibile */
.card,.rv-card,.conv-panel,.rv-system-panel,
.card-body,.conv-section-body,.rv-system-panel-body,
td,th,.btn,.badge,.nav-link{
  overflow-wrap:anywhere;
}

/* Azioni distruttive e conferme più riconoscibili */
.btn-danger,.btn-outline-danger{
  font-weight:800;
}
.btn-success,.btn-primary{
  font-weight:750;
}

/* Migliora leggibilità durante uso touch */
@media (hover:none){
  .btn:hover,.card:hover,.conv-action:hover,.conv-order-card:hover{
    transform:none!important;
  }
}

/* Evita salti visivi durante caricamento immagini/icona */
img{
  image-rendering:auto;
}


/* ============================================================
   V7.22.4 - Stabilità grafica e compatibilità browser
   ============================================================ */

/* Evita variazioni di larghezza quando compare/scompare la scrollbar */
html{
  scrollbar-gutter:stable;
}

/* Mantiene contenuti e card sempre dentro l'area disponibile */
main.container,
.card,
.rv-card,
.conv-panel,
.rv-system-panel,
.card-body,
.conv-section-body,
.rv-system-panel-body{
  min-width:0;
}

/* Tabelle: testi e pulsanti non forzano la pagina oltre viewport */
.table{
  width:100%;
  table-layout:auto;
}
.table td,
.table th{
  max-width:420px;
}
.table td > *,
.table th > *{
  max-width:100%;
}

/* Campi lunghi e URL/token */
code,
pre,
.rv-codebox,
.form-control,
.form-select,
textarea{
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Impedisce che immagini e QR alterino il layout */
img,
svg,
canvas{
  max-width:100%;
}
svg{
  flex-shrink:0;
}

/* Migliore allineamento pulsanti con icona */
.btn > svg,
.btn > img,
.nav-link > svg,
.nav-link > img{
  flex:0 0 auto;
}

/* Card cliccabili: tutta la superficie è coerente */
a.card,
a.rv-card,
a.conv-order-card,
a.conv-company-card{
  text-decoration:none;
}

/* Desktop compatti: sidebar leggibile anche con altezza ridotta */
@media (min-width:992px) and (max-height:760px){
  .rv-navbar .container-fluid{padding-top:10px!important;padding-bottom:10px!important}
  .rv-brand{margin-bottom:10px!important;padding-bottom:10px!important}
  .rv-brand img{width:48px!important;height:48px!important}
  .rv-navbar .navbar-nav{gap:3px!important}
  .rv-navbar .nav-link{min-height:44px!important;padding-top:6px!important;padding-bottom:6px!important}
  .rv-navbar .nav-item.text-white{padding-top:10px!important}
}

/* Tablet orizzontale: evita elementi troppo grandi */
@media (min-width:768px) and (max-width:1199.98px){
  main.container{
    padding-left:16px!important;
    padding-right:16px!important;
  }
  .btn-lg{
    font-size:1rem;
    min-height:46px;
  }
}

/* Mobile: tabelle/card e form senza overflow */
@media (max-width:767.98px){
  .table-responsive{
    max-width:100%;
  }
  .table-responsive table{
    max-width:100%;
  }
  .row > *{
    min-width:0;
  }
  .form-control,
  .form-select,
  textarea{
    width:100%;
  }
  .d-flex > .form-control,
  .d-flex > .form-select{
    flex:1 1 180px;
  }
}

/* Migliora compatibilità browser meno recenti */
@supports not (scrollbar-gutter:stable){
  html{overflow-y:scroll}
}

/* Riduce artefatti da sticky/fixed su browser mobile */
@supports (-webkit-touch-callout:none){
  .mobile-bottom-nav{
    transform:translateZ(0);
  }
  .rv-global-search{
    -webkit-backdrop-filter:blur(8px);
  }
}

/* Stampa: evita taglio di righe e titoli */
@media print{
  h1,h2,h3,h4,h5,h6{break-after:avoid}
  table,tr,.card,.rv-card,.conv-panel,.rv-system-panel{break-inside:avoid}
}


/* ============================================================
   V7.22.5 - Rifinitura finale componenti operativi
   ============================================================ */

/* Pulsanti principali: gerarchia più leggibile */
.btn-primary,.btn-success,.btn-warning,.btn-danger{
  border-width:1px;
}
.btn-outline-primary,.btn-outline-success,.btn-outline-warning,
.btn-outline-danger,.btn-outline-secondary{
  background:#fff;
}

/* Intestazioni pagine più coerenti */
main h1:first-of-type{
  margin-bottom:.35rem;
}
main h1 + .text-muted,
main h1 + p,
main .page-subtitle{
  margin-top:0;
  color:#687d8e!important;
}

/* Card operative: hover solo desktop */
@media (hover:hover) and (pointer:fine){
  .card:hover,.rv-card:hover,.conv-panel:hover,.rv-system-panel:hover{
    box-shadow:0 7px 20px rgba(27,58,87,.10)!important;
  }
}

/* Tabelle: azioni sempre raggruppate e leggibili */
.table td:last-child .btn,
.table td[data-label="Azioni"] .btn,
.table td[data-label="Azione"] .btn{
  margin-right:4px;
  margin-bottom:4px;
}
.table td:last-child form{
  display:inline-block;
}

/* Form: etichette, help text e campi obbligatori */
.form-label{
  font-weight:750;
}
.form-text{
  font-size:.84rem;
  line-height:1.35;
}
.required-field::after,
.form-label.required::after{
  content:" *";
  color:#d83a4a;
}

/* Stati e feedback */
.alert{
  border-width:1px!important;
}
.alert-success{border-color:#bfe4cf!important}
.alert-warning{border-color:#ead69a!important}
.alert-danger{border-color:#edc2c7!important}
.alert-info{border-color:#bdd7ec!important}

/* Modali più ordinate */
.modal-header{
  min-height:58px;
}
.modal-title{
  font-weight:800;
}
.modal-footer{
  border-top-color:#e3eaf0;
}

/* Empty state più chiari */
.empty-state,
.conv-empty{
  color:#6e8293;
  text-align:center;
}
.empty-state{
  padding:28px 18px;
  border:1px dashed #cedae3;
  border-radius:13px;
  background:#f9fbfc;
}

/* Desktop: allineamento comandi in testata */
@media (min-width:768px){
  .page-header,
  .section-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    flex-wrap:wrap;
  }
}

/* Mobile: priorità ai contenuti e pulsanti pieni */
@media (max-width:575.98px){
  .page-header,
  .section-header{
    display:block;
  }
  .page-header .btn,
  .section-header .btn{
    width:100%;
    margin-top:8px;
  }
  .table td:last-child form{
    display:block;
    width:100%;
  }
  .table td:last-child .btn,
  .table td[data-label="Azioni"] .btn,
  .table td[data-label="Azione"] .btn{
    width:100%;
    margin-right:0;
  }
  .toast-container{
    left:8px!important;
    right:8px!important;
    width:auto!important;
  }
}

/* Focus sugli elementi interattivi nelle card */
.card a:focus-visible,
.card button:focus-visible,
.conv-panel a:focus-visible,
.rv-system-panel a:focus-visible{
  position:relative;
  z-index:2;
}


/* ============================================================
   V7.22.6 - Stati, notifiche e messaggi operativi
   ============================================================ */

/* Badge/stati Bootstrap resi più coerenti */
.badge.bg-success,.badge.text-bg-success{
  background:#e6f6ed!important;
  color:#157347!important;
  border:1px solid #bfe4cf;
}
.badge.bg-warning,.badge.text-bg-warning{
  background:#fff4d7!important;
  color:#7a5a00!important;
  border:1px solid #ead69a;
}
.badge.bg-danger,.badge.text-bg-danger{
  background:#fdebed!important;
  color:#b02a37!important;
  border:1px solid #edc2c7;
}
.badge.bg-primary,.badge.text-bg-primary{
  background:#eaf3ff!important;
  color:#145da0!important;
  border:1px solid #c9def4;
}
.badge.bg-secondary,.badge.text-bg-secondary,
.badge.bg-light,.badge.text-bg-light{
  background:#eef3f6!important;
  color:#52697d!important;
  border:1px solid #d8e1e7;
}

/* Messaggi Django più leggibili e non invasivi */
.rv-message{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px 42px 12px 14px;
  border-radius:13px!important;
  line-height:1.4;
}
.rv-message .btn-close{
  position:absolute;
  right:12px;
  top:12px;
}
.rv-message strong{
  font-weight:800;
}

/* Toast e notifiche */
.toast{
  border:1px solid #dbe4ea;
  border-radius:13px;
  box-shadow:0 8px 24px rgba(27,58,87,.14);
}
.toast-header{
  background:#f7fafc;
  border-bottom-color:#e2e9ee;
}

/* Indicatori numerici */
.badge-count{
  display:inline-grid!important;
  place-items:center;
  min-width:32px;
  height:32px;
  padding:0 8px!important;
  border-radius:999px!important;
  font-size:.82rem;
  font-weight:900;
}

/* Stati ordine e segnali operativi più leggibili */
.status-ready,.stato-pronto{
  color:#157347!important;
  background:#e9f8ef!important;
}
.status-warning,.stato-attenzione{
  color:#805d00!important;
  background:#fff6dd!important;
}
.status-danger,.stato-ritardo{
  color:#ad2c39!important;
  background:#fdecef!important;
}

/* Notifiche in sidebar/mobile */
.rv-mobile-menu-badge,
.rv-navbar .badge.rounded-pill{
  min-width:22px;
  height:22px;
  padding:0 6px!important;
  display:inline-grid;
  place-items:center;
  font-size:.72rem;
  font-weight:900;
  line-height:1;
}

/* Migliore leggibilità su smartphone */
@media (max-width:575.98px){
  .rv-message{
    font-size:.9rem;
    padding:11px 38px 11px 12px;
  }
  .badge{
    font-size:.76rem;
  }
  .badge-count{
    min-width:28px;
    height:28px;
  }
}

/* Modalità contrasto aumentato del sistema operativo */
@media (prefers-contrast: more){
  .card,.rv-card,.conv-panel,.rv-system-panel{
    border-color:#aebec9!important;
  }
  .form-control,.form-select{
    border-color:#9fb0bb!important;
  }
  .btn-outline-secondary{
    border-color:#6c7f8d!important;
    color:#334e5d!important;
  }
}


/* ============================================================
   V7.22.7 - Tipografia, leggibilità e coerenza finale
   ============================================================ */

body{
  line-height:1.45;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

main h1,
main h2,
main h3,
main h4{
  line-height:1.15;
}

main h1{
  font-size:clamp(1.7rem,2.4vw,2.25rem);
}
main h2{
  font-size:clamp(1.25rem,1.8vw,1.55rem);
}
main h3{
  font-size:clamp(1.05rem,1.45vw,1.25rem);
}

p,
li,
td,
th,
.form-control,
.form-select,
.btn{
  letter-spacing:.005em;
}

/* Migliore distinzione tra testo principale e secondario */
small,
.small,
.text-muted,
.rv-muted,
.conv-muted,
.rv-system-muted{
  color:#667b8c!important;
}

strong,
.fw-bold,
.fw-semibold{
  color:inherit;
}

/* Link testuali più leggibili senza sembrare pulsanti */
main a:not(.btn):not(.nav-link):not(.conv-action):not(.conv-order-card):not(.conv-company-card){
  text-decoration-thickness:1px;
  text-underline-offset:2px;
}

/* Campi dati e numeri: allineamento più stabile */
.text-end,
.table .text-end,
input[type="number"]{
  font-variant-numeric:tabular-nums;
}

/* Migliora lettura dei codici ordine, date e prezzi */
code,
.monospace,
.order-code,
.price,
.amount{
  font-variant-numeric:tabular-nums;
}

/* Tabelle: righe meno dense ma ancora operative */
@media (min-width:768px){
  .table > :not(caption) > * > *{
    padding-top:.72rem;
    padding-bottom:.72rem;
  }
}

/* Smartphone: evita testo troppo piccolo */
@media (max-width:575.98px){
  body{
    font-size:15.5px;
  }
  main h1{
    font-size:1.58rem;
  }
  main h2{
    font-size:1.28rem;
  }
  .form-label{
    font-size:.95rem;
  }
  .btn{
    font-size:.93rem;
  }
  .small,
  small{
    font-size:.82rem;
  }
}

/* Monitor grandi: evita righe troppo lunghe nei testi descrittivi */
@media (min-width:1200px){
  .lead,
  .page-subtitle,
  .rv-system-subtitle,
  .conv-subtitle{
    max-width:78ch;
  }
}

/* Titoli dentro card e pannelli */
.card-title,
.conv-section-head h2,
.rv-system-panel-head h2{
  font-weight:850;
}

/* Migliore coerenza visiva di prezzi/importi */
.price,
.amount,
.conv-price{
  font-weight:850;
  white-space:nowrap;
}

/* Placeholder più leggibili ma secondari */
::placeholder{
  color:#8797a4!important;
  opacity:1!important;
}

/* Selezione testo più coerente col nuovo tema */
::selection{
  background:#d9ecff;
  color:#17324d;
}


/* ============================================================
   V7.22.8 - Rifinitura finale menu, card e comandi
   ============================================================ */

/* Sidebar: ritmo verticale e icone più coerenti */
@media (min-width:992px){
  .rv-navbar .nav-link{
    gap:11px!important;
  }
  .rv-navbar .nav-link .rv-nav-glyph,
  .rv-navbar .nav-link img{
    margin-right:1px;
  }
  .rv-navbar .nav-link span:not(.rv-nav-glyph){
    min-width:0;
  }
}

/* Card: intestazioni e contenuti più uniformi */
.card-header,
.conv-section-head,
.rv-system-panel-head{
  background:linear-gradient(180deg,#fbfdff,#f7fafc);
}
.card-body,
.conv-section-body,
.rv-system-panel-body{
  line-height:1.42;
}

/* Gruppi di pulsanti: distanze uniformi */
.d-flex.gap-2,
.d-flex.gap-3,
.btn-group,
.action-bar,
.actions-bar,
.toolbar{
  row-gap:8px!important;
}

/* Pulsanti icona / azioni brevi */
.btn-icon,
.icon-btn{
  width:42px;
  min-width:42px;
  height:42px;
  min-height:42px;
  padding:0!important;
  display:inline-grid!important;
  place-items:center!important;
  border-radius:10px!important;
}

/* Elementi selezionati */
.list-group-item.active,
.nav-pills .nav-link.active,
.nav-tabs .nav-link.active{
  background:#1769d2!important;
  border-color:#1769d2!important;
  color:#fff!important;
}

/* Tabs */
.nav-tabs{
  border-bottom-color:#dbe4ea;
}
.nav-tabs .nav-link{
  border-radius:10px 10px 0 0;
  font-weight:700;
  color:#50677d;
}
.nav-tabs .nav-link:hover{
  border-color:#e2e9ee #e2e9ee #dbe4ea;
}

/* Select e input con icone più stabili */
.input-group-text{
  background:#f7fafc;
  color:#52697d;
  font-weight:700;
}

/* Checkbox e switch */
.form-switch .form-check-input{
  width:2.4em;
  height:1.25em;
}
.form-switch .form-check-input:checked{
  background-color:#1769d2;
  border-color:#1769d2;
}

/* Divider e separatori */
.section-divider,
hr{
  margin:1.2rem 0;
}

/* Smartphone: card e pulsanti più ariosi ma compatti */
@media (max-width:575.98px){
  .card-header,
  .conv-section-head,
  .rv-system-panel-head{
    gap:8px;
  }
  .btn-icon,
  .icon-btn{
    width:46px;
    min-width:46px;
    height:46px;
    min-height:46px;
  }
  .nav-tabs{
    overflow-x:auto;
    flex-wrap:nowrap;
    scrollbar-width:none;
  }
  .nav-tabs::-webkit-scrollbar{display:none}
  .nav-tabs .nav-link{
    white-space:nowrap;
  }
}

/* Migliora contrasto delle righe selezionate/attive */
.table-active,
.table > tbody > tr.table-active > *{
  background:#eef6ff!important;
}

/* Elementi cliccabili con focus/hover coerente */
a.card,
a.conv-order-card,
a.conv-company-card,
button.card{
  transition:box-shadow .14s ease,border-color .14s ease,background-color .14s ease;
}

/* Evita layout irregolari con contenuti corti/lunghi */
.card,
.conv-panel,
.rv-system-panel{
  min-height:0;
}


/* ============================================================
   V7.22.9 - Uniformità finale responsive e microinterazioni
   ============================================================ */

/* Microinterazioni leggere e coerenti */
.btn,
.nav-link,
.card,
.rv-card,
.conv-action,
.conv-order-card,
.conv-company-card{
  transition:
    background-color .14s ease,
    border-color .14s ease,
    box-shadow .14s ease,
    color .14s ease,
    transform .14s ease;
}

/* Evita animazioni superflue sui dispositivi touch */
@media (hover:none){
  .btn,
  .nav-link,
  .card,
  .rv-card,
  .conv-action,
  .conv-order-card,
  .conv-company-card{
    transition:none!important;
  }
}

/* Allineamento generale intestazioni + azioni */
.page-header,
.section-header,
.conv-hero,
.rv-system-hero{
  min-width:0;
}
.page-header > *,
.section-header > *,
.conv-hero > *,
.rv-system-hero > *{
  min-width:0;
}

/* Titoli lunghi sempre leggibili */
h1,h2,h3,h4,h5,h6,
.card-title,
.conv-title,
.rv-system-title{
  overflow-wrap:anywhere;
}

/* Pulsanti con testo lungo */
.btn{
  text-align:center;
  line-height:1.2;
}

/* Form orizzontali più stabili */
.form-inline,
.inline-form{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:end;
}
.form-inline > *,
.inline-form > *{
  min-width:0;
}

/* Migliore resa degli stati selezionati */
.form-select:focus,
.form-control:focus{
  position:relative;
  z-index:2;
}

/* Card elenco: altezza visiva coerente */
.equal-card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:14px;
}
.equal-card-grid > *{
  height:100%;
}

/* Desktop: densità equilibrata */
@media (min-width:1200px){
  .btn{
    min-height:40px;
  }
  .card-body,
  .conv-section-body,
  .rv-system-panel-body{
    padding-top:17px;
    padding-bottom:17px;
  }
}

/* Tablet */
@media (min-width:768px) and (max-width:991.98px){
  .equal-card-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .btn-toolbar,
  .action-bar,
  .actions-bar{
    width:100%;
  }
}

/* Smartphone verticale */
@media (max-width:575.98px){
  .equal-card-grid{
    grid-template-columns:1fr;
  }

  .form-inline,
  .inline-form{
    display:grid;
    grid-template-columns:1fr;
    width:100%;
  }

  .form-inline > *,
  .inline-form > *{
    width:100%!important;
  }

  .btn-group{
    display:grid!important;
    grid-template-columns:1fr!important;
    width:100%;
  }

  .btn-group > .btn{
    width:100%;
    border-radius:10px!important;
    margin:0!important;
  }

  .input-group > .btn{
    min-width:auto;
  }
}

/* Telefoni molto stretti */
@media (max-width:360px){
  body{
    font-size:15px;
  }

  .mobile-bottom-nav .rv-mobile-nav-item span:last-child{
    font-size:.58rem!important;
  }

  .btn{
    font-size:.9rem;
  }

  .rv-brand{
    font-size:.84rem!important;
  }
}

/* Coerenza focus/hover menu laterale */
@media (min-width:992px){
  .rv-navbar .nav-link:focus-visible{
    outline:2px solid rgba(156,255,69,.65)!important;
    outline-offset:2px!important;
  }
}

/* Stampa: mantiene solo il contenuto utile */
@media print{
  .page-header .btn,
  .section-header .btn,
  .conv-hero .btn,
  .rv-system-hero .btn{
    display:none!important;
  }
}


/* ============================================================
   V7.22.10 - Rifiniture finali UI e robustezza operativa
   ============================================================ */

/* Mantiene leggibili le intestazioni nelle tabelle lunghe */
@media (min-width:768px){
  .table-responsive thead th{
    position:sticky;
    top:0;
    z-index:2;
  }
}

/* Evita che pulsanti disabilitati sembrino ancora cliccabili */
.btn:disabled,
.btn.disabled{
  box-shadow:none!important;
  transform:none!important;
  pointer-events:none;
}

/* Campi readonly più distinguibili */
.form-control[readonly],
.form-select[disabled],
.form-control:disabled{
  background:#f3f6f8!important;
  color:#687d8e!important;
}

/* Evidenzia righe con stato o attenzione senza eccesso di colore */
tr.table-warning > *,
tr.table-danger > *,
tr.table-success > *{
  border-top-color:transparent!important;
  border-bottom-color:transparent!important;
}

/* Contenitori azioni: niente sovrapposizioni */
.card-actions,
.row-actions,
.order-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  min-width:0;
}
.card-actions > *,
.row-actions > *,
.order-actions > *{
  min-width:0;
}

/* Link di ritorno e azioni secondarie più coerenti */
.back-link,
.secondary-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-weight:700;
  color:#52697d;
}
.back-link:hover,
.secondary-link:hover{
  color:#1769d2;
}

/* Piccoli separatori di stato */
.status-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  display:inline-block;
  flex:0 0 9px;
  background:#8a9baa;
}
.status-dot.ok{background:#22a866}
.status-dot.warn{background:#f59f00}
.status-dot.danger{background:#d94343}
.status-dot.info{background:#1769d2}

/* Smartphone: barre azioni completamente verticali quando necessario */
@media (max-width:575.98px){
  .card-actions,
  .row-actions,
  .order-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    width:100%;
  }
  .card-actions .btn,
  .row-actions .btn,
  .order-actions .btn,
  .card-actions form,
  .row-actions form,
  .order-actions form{
    width:100%!important;
  }

  .table-responsive thead th{
    position:static;
  }
}

/* Monitor grandi: migliore centratura dei contenuti troppo larghi */
@media (min-width:1600px){
  main.container > .rv-system-page,
  main.container > .conv-page,
  main.container > .content-wrapper{
    max-width:1580px;
    margin-left:auto;
    margin-right:auto;
  }
}

/* Elementi caricamento */
[aria-busy="true"]{
  cursor:progress!important;
}
button[aria-busy="true"]{
  opacity:.72;
}

/* Migliore leggibilità di date e numeri */
time,
.date,
.datetime,
.number,
.quantity{
  font-variant-numeric:tabular-nums;
}

/* Protegge da overflow causati da stringhe tecniche */
[data-token],
[data-code],
[data-url]{
  overflow-wrap:anywhere;
  word-break:break-word;
}


/* ============================================================
   V7.22.11 - Consolidamento finale layout e usabilità
   ============================================================ */

/* Contenuti principali più stabili */
main.container{
  min-height:calc(100vh - 90px);
}

/* Card, pannelli e sezioni con spaziature coerenti */
.card,
.rv-card,
.conv-panel,
.rv-system-panel,
.section-card,
.content-card{
  overflow:visible;
}

/* Evita che menu a tendina vengano tagliati dalle card */
.card:has(.dropdown-menu),
.rv-card:has(.dropdown-menu),
.conv-panel:has(.dropdown-menu),
.rv-system-panel:has(.dropdown-menu){
  overflow:visible!important;
}

/* Tabelle operative: ultima rifinitura */
.table-responsive{
  background:#fff;
}
.table thead th{
  vertical-align:middle;
}
.table tbody td{
  vertical-align:middle;
}
.table tbody tr:last-child td{
  border-bottom-width:0;
}

/* Pulsanti azione compatti */
.btn-action{
  min-width:40px;
  min-height:40px;
  padding:.45rem .6rem;
}

/* Migliore resa dei gruppi di comandi */
.actions-inline{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.actions-inline form{
  margin:0;
}

/* Form: righe e campi più uniformi */
.form-row-clean{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:12px;
}
.form-row-clean > *{
  min-width:0;
}

/* Smartphone: blocchi operativi sempre a tutta larghezza */
@media (max-width:767.98px){
  .actions-inline{
    display:grid;
    grid-template-columns:1fr;
    width:100%;
  }

  .actions-inline > *,
  .actions-inline form,
  .actions-inline .btn{
    width:100%!important;
  }

  .form-row-clean{
    grid-template-columns:1fr;
  }

  .card,
  .rv-card,
  .conv-panel,
  .rv-system-panel,
  .section-card,
  .content-card{
    overflow:visible;
  }
}

/* Tablet: due colonne quando possibile */
@media (min-width:768px) and (max-width:1199.98px){
  .form-row-clean{
    grid-template-columns:repeat(6,minmax(0,1fr));
  }
}

/* Stato focus più chiaro anche sui link testuali */
main a:not(.btn):focus-visible{
  border-radius:4px;
}

/* Riduce elementi visivamente troppo pesanti */
.shadow,
.shadow-sm,
.shadow-lg{
  box-shadow:0 4px 16px rgba(27,58,87,.09)!important;
}

/* Divider coerenti */
.border-top,
.border-bottom{
  border-color:#e2e9ee!important;
}

/* Placeholder di caricamento o contenuto vuoto */
.placeholder,
.placeholder-glow .placeholder{
  border-radius:6px;
}

/* Ultima protezione anti-overflow globale */
body,
main,
.container,
.container-fluid,
.row,
[class*="col-"]{
  min-width:0;
}

pre{
  white-space:pre-wrap;
  max-width:100%;
}

/* Stampa: nasconde elementi puramente operativi */
@media print{
  .no-print,
  .actions-inline,
  .btn-action,
  .dropdown,
  .dropdown-menu{
    display:none!important;
  }
}


/* ============================================================
   V7.22.12 - Chiusura restyling: mobile landscape e accessibilità
   ============================================================ */

/* Area di lavoro più stabile in modalità app/PWA */
body{
  min-height:100dvh;
}
main.container{
  min-height:calc(100dvh - 90px);
}

/* Supporto safe-area su dispositivi mobili */
@media (max-width:991.98px){
  main.container{
    padding-left:max(10px, env(safe-area-inset-left))!important;
    padding-right:max(10px, env(safe-area-inset-right))!important;
  }
  .mobile-bottom-nav{
    padding-left:max(5px, env(safe-area-inset-left))!important;
    padding-right:max(5px, env(safe-area-inset-right))!important;
  }
}

/* Smartphone in orizzontale: riduce ingombri senza perdere funzioni */
@media (max-width:991.98px) and (orientation:landscape) and (max-height:520px){
  body{
    padding-bottom:66px!important;
  }
  .rv-navbar{
    position:relative!important;
  }
  .mobile-bottom-nav{
    min-height:58px!important;
  }
  .mobile-bottom-nav .rv-mobile-nav-item{
    min-height:48px!important;
  }
  .calculator-fab{
    width:50px!important;
    height:50px!important;
    bottom:70px!important;
  }
  .modal-body{
    max-height:64vh!important;
  }
}

/* Elementi non interattivi non devono sembrare cliccabili */
.card:not(a):not(button),
.conv-panel,
.rv-system-panel{
  cursor:default;
}

/* Migliore leggibilità dei link operativi */
a.btn,
button.btn{
  text-decoration:none!important;
}

/* Disabilitati/readonly coerenti anche su browser mobile */
[aria-disabled="true"],
.disabled{
  cursor:not-allowed!important;
}

/* Migliore navigazione da tastiera */
.skip-link{
  position:fixed;
  left:12px;
  top:10px;
  z-index:2000;
  transform:translateY(-160%);
  background:#17324d;
  color:#fff;
  padding:10px 14px;
  border-radius:9px;
  font-weight:800;
  text-decoration:none;
}
.skip-link:focus{
  transform:translateY(0);
}

/* Evita tagli su descrizioni lunghe e note */
.description,
.notes,
.note,
.help-text{
  white-space:normal;
  overflow-wrap:anywhere;
}

/* Migliora resa di liste e dettagli */
dl.row dt{
  color:#50677d;
  font-weight:800;
}
dl.row dd{
  overflow-wrap:anywhere;
}

/* Ultima rifinitura dei pannelli su schermi piccoli */
@media (max-width:575.98px){
  .card,
  .rv-card,
  .conv-panel,
  .rv-system-panel{
    box-shadow:0 3px 12px rgba(27,58,87,.07)!important;
  }

  .card-header,
  .conv-section-head,
  .rv-system-panel-head{
    background:#fbfdff!important;
  }

  .mobile-bottom-nav{
    box-shadow:0 -4px 16px rgba(0,0,0,.18)!important;
  }
}

/* Modalità stampa finale */
@media print{
  body{
    min-height:auto!important;
  }
  main.container{
    min-height:auto!important;
  }
  a[href]::after{
    content:none!important;
  }
}

/* Migliore compatibilità con browser che non supportano dvh */
@supports not (height:100dvh){
  body{min-height:100vh}
  main.container{min-height:calc(100vh - 90px)}
}
