@charset "UTF-8";


@import url('https://fonts.googleapis.com/css2?family=Rethink+Sans:ital,wght@0,500;0,600;0,700;1,400&display=swap');

/*Variabili*/
:root {
    --main: #254563;
    --secondary: #0070C0;
    --warning: #FF0000;
    --success: #00B050;
    --waiting: #e39a1a;
    --info: #00B0F0;
    --backgroud_light: #f8f7f6;

}

.event-stripes {
    border-radius: 3px 3px 0 0;
    height: 8px;
    margin-bottom: 2px;
}

.event {
    margin: 2px 0;
    border-radius: 4px;
    overflow: hidden;
}

.event-text a {
    font-size: 12px;
    padding: 2px 4px;
    display: block;
    text-decoration: none;
    color: #000;
}


html {
    font-size: 13px;
}

body {
    padding: 0;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    font-family: 'Rethink Sans', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

th .form-control {
    padding: 0.25rem !important
}


#wrapper {
    position: relative;
    width: 100%;
    padding: 0 4%;
    /*min-height: 600px;*/
    min-height: 75vh;
    margin: 0 auto;
    overflow: hidden;
    z-index: 1;
    margin-top: 20px;
}

.header_nav {
    padding: 0.5rem 4%;
    margin-bottom: 2rem
}

.myresponsive {
    position: relative;
    float: left;
    width: 100%;
    padding: 0 4%;
    margin: 0 auto;
}

.link {
    color: blue !important;
    text-decoration: underline !important;
    cursor: pointer
}

/*Ui Dialog*/
/*min-width:42.85rem !important;*/
.ui-dialog {
    position: fixed !important;
    font-family: inherit !important;
    z-index: 1000 !important
}

.ui-widget {
    font-family: inherit !important
}

.ui-dialog :focus {
    outline: -webkit-focus-ring-color auto 0px !important;
}

.ui-dialog .ui-dialog-titlebar-close {
    background-color: var(--main)
}

.bi-eye-slash {
    width: 16px;
    height: 16px;
}


.account-wall {
    margin-top: 10px;
    padding: 40px 0px 20px 0px;
    background-color: #f7f7f7;
    -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
    -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}

.form-signin {
    max-width: 330px;
    padding: 15px;
    margin: 0 auto;
}

.form-signin .form-signin-heading,
.form-signin .checkbox {
    margin-bottom: 10px;
}

.form-signin .checkbox {
    font-weight: normal;
}

.form-signin .form-control {
    position: relative;
    font-size: 16px;
    height: auto;
    padding: 10px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.form-signin .form-control:focus {
    z-index: 2;
}

.form-signin input[type="text"] {
    margin-bottom: -1px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.form-signin input[type="password"] {
    margin-bottom: 10px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.page-link {
    height: 100%;
}

/*OVERLAY*/
#blocca_schermo {
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: rgba(1, 1, 1, 0.7);
    display: none;
    z-index: 110;
}

#loading {
    position: fixed;
    width: 5.71rem;
    height: 5.71rem;
    left: 50%;
    top: 50%;
    margin-left: -2.85rem;
    margin-top: -2.85rem;
    border-radius: 10px;
    z-index: 111;
    color: #fff;
    background: url('../images/icons/loader.gif') no-repeat;
    background-size: cover;
    display: none
}

#blocca_schermo h6 {
    position: relative;
    width: 300px;
    height: 300px;
    left: 50%;
    top: 50%;
    margin-left: -150px;
    margin-top: 60px;
    color: #fff !important;
    text-align: center
}

.pointer {
    cursor: pointer !important
}


.chat_box1 {
    width: 90%;
    margin-left: 10%;
    padding: 0.25rem 1rem;
    border-radius: 10px;
    border: 1px dotted #cacaca;
    background-color: var(--main);
    color: #fff
}

.chat_box2 {
    width: 90%;
    margin-right: 10%;
    padding: 0.25rem 1rem;
    border-radius: 10px;
    border: 1px dotted #cacaca;
    background-color: #fff;
    color: #000
}

.chat_input_text {
    width: 100%;
}


.danger-badge {
    background-color: red;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-block;
}

.warning-badge {
    background-color: orange;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-block;
}

.success-badge {
    background-color: green;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-block;
}

table td {
    vertical-align: middle;
}

.sub_parent_track td:first-child {
    padding-left: 2%;
}

.td-flex {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

tr .riduci-lunghezza {
    width: 0%;
    /* white-space: nowrap; */
}

.modal-backdrop.show {
    display: none !important;
}

.modal.fade.show {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog.modal-dialog-centered {
    width: fit-content;
}

/* Posiziona i sotto-menu a destra */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
    position: absolute;
}

/* Mostra il sotto-menu al passaggio del mouse o clic */
.dropdown-submenu:hover>.dropdown-menu {
    display: block;
}

.nav-item .nav-link:first-child {
    padding-left: 5px !important;
}


.nav-link.active {
    background-color: transparent !important;
    color: #0d6efd !important;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-none-custom {
    width: 50px !important;
    background-color: white !important;
    border-right: 1px solid #edeaea;
}

.d-none-custom * {
    display: none !important;
}

.button-hide-show {
    display: none;
}

.d-none-custom .button-hide-show {
    display: flex !important;
    position: fixed;
    top: 10px;
    height: 25px;
    width: 25px;
    align-items: center;
}

.bi-star-fill,
.bi-star {
    color: #ffd250;
}

.filler {
    width: 100%;
    height: 19.5px;
}



/********************** CONTAINERS (SCOPED)   *********************/
.cr {
    /* variabili SOLO per i container */
    --bg: #f7f9fc;
    --panel: #fff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e5e7eb;
    --accent: #2563eb;
    --ok: #16a34a;
    --warn: #ca8a04;
    --crit: #dc2626;
    --card-w: 280px;
    --card-h: 440px;
    --radius: 16px;
    --gap: 16px;
    --shadow: 0 6px 24px rgba(2, 6, 23, .06);

    /* layout: sempre a destra della sidebar/header */
    position: relative;
    margin-top: 20px;
    margin-left: var(--sidebar-w, 260px);
    margin-right: 2%;
    width: calc(100% - (var(--sidebar-w, 260px) + 2%));
}

/* reset locale, NON globale */
.cr :where(*) {
    box-sizing: border-box;
}

/* slider */
.cr .slider {
    position: relative;
    margin-top: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.cr .viewport {
    overflow-x: auto;
    /* Abilita lo scroll orizzontale */
    scroll-snap-type: x mandatory;
    /* Effetto calamita */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Scrolling fluido su iOS */
}

/* Nasconde la scrollbar per un look più pulito */
.cr .viewport::-webkit-scrollbar {
    display: none;
}

.cr .viewport {
    scrollbar-width: none;
}

.cr .track {
    display: flex;
    gap: var(--gap);
    padding: 6px 2px 12px;
}

.cr .arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: none;
    /* Nascoste di default (per mobile) */
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    color: #334155;
    cursor: pointer;
}

.cr .arrow:hover {
    background: #f1f5f9;
}

.cr .arrow.left {
    left: 8px;
}

.cr .arrow.right {
    right: 8px;
}

/* card */
.cr .card {
    flex: 0 0 var(--card-w);
    height: var(--card-h);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-snap-align: center;
    /* Allinea le card durante lo swipe */
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.cr .card:hover {
    transform: translateY(-2px);
    transition: transform 120ms ease;
}

.cr .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cr .title {
    margin: 0;
    font-weight: 800;
}

.cr .updated {
    font-size: 12px;
    color: var(--muted);
}

.cr .percent {
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    font-size: 26px;
    cursor: pointer;
}

.cr .percent.ok {
    color: var(--ok);
}

.cr .percent.warn {
    color: var(--warn);
}

.cr .percent.crit {
    color: var(--crit);
}

.cr .tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cr .tag {
    font-size: 12px;
    color: var(--muted);
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.cr .tag.button {
    cursor: pointer;
    user-select: none;
}

.cr .tag.button:hover {
    background: #e2e8f0;
}

.cr .delta {
    font-weight: 700;
}

/* SVG “container” */
.cr .cr-gauge {
    position: relative;
    flex: 1;
    background: #f8fafc;
    border-radius: 14px;
    display: grid;
    place-items: center;
}

.cr .cr-svg {
    width: 100%;
    height: 100%;
}

.cr .cr-shape {
    stroke: #d6dbe3;
    stroke-width: 2;
    fill: #fbfdff;
}

.cr .cr-tick line {
    stroke: #e5eaf0;
}

.cr .cr-tick text {
    fill: #94a3b8;
    font-size: 10px;
}

.cr .lvl-eff {
    shape-rendering: geometricPrecision;
}

.cr .lvl-theo {
    opacity: .25;
}

.cr .theo-marker {
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 5 4;
}

/* modal del modulo */
.cr .modal {
    position: fixed;
    inset: 0;
    display: none;
}

.cr .modal.show {
    display: block;
}

.cr .modal .backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px);
}

.cr .modal .panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100% - 32px));
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px;
    max-height: 80vh;
    overflow: auto;
}

.cr .modal h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.cr .modal .muted {
    color: var(--muted);
    font-size: .9rem;
    margin: 0 0 10px;
}

.cr .close {
    border: none;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
}

.cr .section {
    margin-top: 12px;
}

.cr .section h3 {
    margin: .2rem 0 .4rem;
    font-size: .95rem;
}

.cr .list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: grid;
    gap: 8px;
}

.cr .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.cr .bar {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    flex: 1;
    margin: 0 10px;
}

.cr .bar>span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #60a5fa);
}

.cr .pill {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/********************** CONTAINERS (SCOPED) *********************/
.cr {
    /* variabili SOLO per i container */
    --bg: #f7f9fc;
    --panel: #fff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e5e7eb;
    --accent: #2563eb;
    --ok: #16a34a;
    --warn: #ca8a04;
    --crit: #dc2626;
    --card-w: 280px;
    --card-h: 440px;
    --radius: 16px;
    --gap: 16px;
    --shadow: 0 6px 24px rgba(2, 6, 23, .06);

    /* layout: sempre a destra della sidebar/header */
    position: relative;
    margin-top: 20px;
    margin-left: var(--sidebar-w, 260px);
    margin-right: 2%;
    width: calc(100% - (var(--sidebar-w, 260px) + 2%));
}

/* reset locale, NON globale */
.cr :where(*) {
    box-sizing: border-box;
}

/* slider - ora funge da contenitore per la griglia */
.cr .slider {
    position: relative;
    margin-top: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.cr .viewport {
    overflow: visible;
    /* Disabilitiamo lo scroll orizzontale */
}

/*
 * GRIGLIA RESPONSIVE (Mobile First)
 * Inizia con 1 colonna e si adatta a schermi più grandi
 */
.cr .track {
    display: grid;
    grid-template-columns: 1fr;
    /* Base per mobile: 1 colonna */
    gap: var(--gap);
    justify-items: center;
    /* Centra le card all'interno delle colonne */
}

.cr .arrow {
    display: none;
    /* Le frecce non servono in una griglia */
}

/* card */
.cr .card {
    width: min(var(--card-w), 100%);
    /* Usa la larghezza fissa, ma si adatta per non uscire dallo schermo */
    height: var(--card-h);
    /* Usa l'altezza fissa */
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.cr .card:hover {
    transform: translateY(-2px);
    transition: transform 120ms ease;
}

.cr .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cr .title {
    margin: 0;
    font-weight: 800;
}

.cr .updated {
    font-size: 12px;
    color: var(--muted);
}

.cr .percent {
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    font-size: 26px;
    cursor: pointer;
}

.cr .percent.ok {
    color: var(--ok);
}

.cr .percent.warn {
    color: var(--warn);
}

.cr .percent.crit {
    color: var(--crit);
}

.cr .tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cr .tag {
    font-size: 12px;
    color: var(--muted);
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.cr .tag.button {
    cursor: pointer;
    user-select: none;
}

.cr .tag.button:hover {
    background: #e2e8f0;
}

.cr .delta {
    font-weight: 700;
}

/* SVG “container” (invariato) */
.cr .cr-gauge {
    position: relative;
    flex: 1;
    background: #f8fafc;
    border-radius: 14px;
    display: grid;
    place-items: center;
}

.cr .cr-svg {
    width: 100%;
    height: 100%;
}

/* ... (le altre regole SVG rimangono invariate) ... */
.cr .cr-shape {
    stroke: #d6dbe3;
    stroke-width: 2;
    fill: #fbfdff
}

.cr .cr-tick line {
    stroke: #e5eaf0
}

.cr .cr-tick text {
    fill: #94a3b8;
    font-size: 10px
}

.cr .lvl-eff {
    shape-rendering: geometricPrecision
}

.cr .lvl-theo {
    opacity: .25
}

.cr .theo-marker {
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 5 4
}


/* modal del modulo (invariato) */
.cr .modal {
    position: fixed;
    inset: 0;
    display: none;
}

/* ... (le altre regole del modale rimangono invariate) ... */
.cr .modal.show {
    display: block
}

.cr .modal .backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px)
}

.cr .modal .panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100% - 32px));
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px;
    max-height: 80vh;
    overflow: auto
}

.cr .modal h2 {
    margin: 0 0 4px;
    font-size: 1.05rem
}

.cr .modal .muted {
    color: var(--muted);
    font-size: .9rem;
    margin: 0 0 10px
}

.cr .close {
    border: none;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer
}

.cr .section {
    margin-top: 12px
}

.cr .section h3 {
    margin: .2rem 0 .4rem;
    font-size: .95rem
}

.cr .list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: grid;
    gap: 8px
}

.cr .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff
}

.cr .bar {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    flex: 1;
    margin: 0 10px
}

.cr .bar>span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #60a5fa)
}

.cr .pill {
    font-variant-numeric: tabular-nums;
    font-weight: 700
}


/* ========================================================= */
/* ===== MEDIA QUERIES PER LA GRIGLIA RESPONSIVE  ====== */
/* ========================================================= */

/* STILI PER TABLET (da 768px in su) */
@media (min-width: 768px) {
    .cr .track {
        grid-template-columns: repeat(2, 1fr);
        /* 2 colonne */
    }
}

/* STILI PER DESKTOP (da 1200px in su) */
@media (min-width: 1200px) {
    .cr .track {
        grid-template-columns: repeat(3, 1fr);
        /* 3 colonne */
    }
}

/* Adattamento quando la sidebar laterale scompare */
@media (max-width: 992px) {
    .cr {
        margin-left: 0;
        width: 100%;
        padding: 0 1rem;
        /* Aggiunge un po' di spazio laterale */
        box-sizing: border-box;
    }
}

/* === CARDS PIÙ PICCOLE === */
.cr .card {
    width: 100%;
    padding: 8px;
    min-height: 210px;
    gap: 8px;
}

.cr .title {
    font-size: .85rem;
}

.cr .updated {
    font-size: 10px;
}

.cr .percent {
    font-size: 16px;
}

.cr .tag {
    font-size: 10px;
    padding: 2px 6px;
}

/* Gauge compatto */
.cr .cr-gauge {
    height: 100px;
    min-height: 100px;
}

.cr .cr-svg {
    width: 100%;
    height: 100%;
}

.cr .cr-tick text {
    font-size: 8px;
}

.cr .cr-tick line {
    stroke-width: 1;
}

.cr .cr-shape {
    stroke-width: 1.5;
}

/* Niente frecce/scroll orizzontale */
.slider .viewport {
    overflow: visible !important;
}

.slider .arrow {
    display: none !important;
}




.annualbar {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1rem
}

.annualbar-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem
}

.annualbar h1 {
    font-size: 1.25rem;
    margin: 0
}

.annualbar .muted {
    opacity: .75
}

.annualbar-gauge .track {
    position: relative;
    height: 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .08);
    overflow: hidden
}

.annualbar-gauge .bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%
}

.annualbar-gauge .bar.eff {
    background: var(--ok, #16a34a)
}

.annualbar-gauge .bar.theo {
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .0) 0 6px, rgba(255, 255, 255, .35) 6px 12px),
        var(--warn, #ca8a04);
    opacity: .85
}

.annualbar-gauge .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-top: .35rem;
    font-size: .95rem
}





/* Contenitore generale del calendario */
#modalCalendario .modal-body {
    max-height: 800px;
    overflow: auto;
    
}

/* Card mese */
.calendar-month.card {
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .04);
}

.calendar-month .card-header {
    background: #f8fafc;
    font-weight: 600;
    text-align: center;
    border-bottom: 0;
}

.calendar-month .table {
    table-layout: fixed;
    margin: 0;
}

.calendar-month th,
.calendar-month td {
    text-align: center;
    vertical-align: middle;
    padding: .3rem;
    font-size: .85rem;
}

/* Giorno */
.cal-day {
    width: 2.2rem;
    height: 2.2rem;
    line-height: 2.2rem;
    margin: 0 auto;
    border-radius: .5rem;
    display: block;
    user-select: none;
}

.cal-day.selectable {
    cursor: pointer;
}

.cal-day.selectable:hover {
    background: #e2e8f0;
}

.cal-day.disabled {
    color: #cbd5e1;
}

.cal-day.selected {
    background: #0d6efd;
    color: #fff;
}

/* Badge prezzo (se vuoi mostrarlo per ogni giorno in futuro) */
/* badge del prezzo sotto al numero del giorno */
.price-badge {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.flatpickr-day {
    position: relative;
    /* necessario per absolute children */
    overflow: visible;
    /* il badge può uscire leggermente */
}

.color-dot {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    /* diametro del cerchio colorato */
    height: 28px;
    border-radius: 50%;
    z-index: 0;
    /* dietro al numero */
}

#pix {



    border-radius: 10px;
}


/***************************************************/

/* Modal calendario più grande su desktop (senza cambiare stile) */
@media (min-width: 992px){
  #modalCalendario .modal-dialog{
    max-width: min(1280px, 96vw); /* allarga la finestra */
    width: auto;
  }
}

/* Usa quasi tutta l'altezza dello schermo e rendi la body scrollabile */
#modalCalendario .modal-dialog { height: calc(100vh - 2rem); } /* margine respirabile */
#modalCalendario .modal-content{ height: 100%; width: 100%; }
#modalCalendario .modal-body{
  flex: 1 1 auto;               /* occupa lo spazio disponibile */
  min-height: 1000;                 /* fix flex overflow */
  max-height: none;              /* lascia al flex la gestione */
  overflow: auto;                /* scroll solo nel corpo */
  -webkit-overflow-scrolling: touch;
}


/* (facoltativo) Giorni un filo più grandi per click comodo su tutti i device */
.flatpickr-day{ border-radius: 12px !important; }
@media (max-width: 575.98px){
  .flatpickr-day{ width:56px !important; height:56px !important; line-height:56px !important; font-size:18px !important; }
}
@media (min-width: 576px) and (max-width: 991.98px){
  .flatpickr-day{ width:52px !important; height:52px !important; line-height:52px !important; font-size:16px !important; }
}
@media (min-width: 992px){
  .flatpickr-day{ width:58px !important; height:58px !important; line-height:58px !important; font-size:18px !important; }
}



/* Dimensione input */
.flatpickr-input {
  height: 38px;          /* altezza campo */
  font-size: 14px;       /* testo */
  padding: 4px 10px;     /* spazio interno */
  width: 12ch;           /* abbastanza per gg/mm/aaaa */
  box-sizing: border-box;
}

/* Scala calendario */
.flatpickr-calendar {
  transform: scale(1.8);       /* default = medio */
  transform-origin: top left;  /* mantiene posizione rispetto input */
  padding: 30px;
}



/***************************************************/











.content {
    display: none;
    padding-bottom: 50px;
}

.navbar-brand img {
    height: 70px;
    border-radius: 8px;
}

/* Stile per l'icona del carrello */
.cart-icon {
    font-size: 1.5rem;
    /* Dimensione dell'icona */
    color: #212529;
    /* Colore scuro per l'icona */
}

.cart-icon .badge {
    font-size: 0.65rem;
    /* Dimensione del testo nel badge */
}


@media (max-width: 768px) {
    .text-content {
        left: 5%;
        width: 90%;
    }

    .intro-text {
        font-size: 1.8rem;
    }

    .alt-font {
        font-size: 3rem;
        margin-top: -5px;
    }

    .intro-subtext {
        font-size: 1rem;
        padding-left: 25px;
    }

    .intro-subtext::before {
        width: 4px;
    }

    .service-card {
        margin-bottom: 30px;
    }
}


/**************************************



/* ============================================= */
/* === CSS PER TABELLE RESPONSIVE "STACKING" === */
/* ============================================= */

@media (max-width: 767.98px) {
    /* Nasconde l'intestazione originale della tabella su mobile */
    .table-responsive-stack thead {
        display: none;
    }

    /* Trasforma le righe e le celle per impilarle */
    .table-responsive-stack tr {
        display: block;
        margin-bottom: 1.5rem; /* Aumenta lo spazio tra le "card" */
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 0.5rem;
    }

    .table-responsive-stack td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.75rem 0.5rem; /* Più spazio verticale */
        border-bottom: 1px solid #f1f1f1;
        /* Rimuoviamo il bordo di default della tabella */
        border-top: none; 
    }

    .table-responsive-stack td:last-child {
        border-bottom: none;
    }

    /* La magia: crea l'etichetta usando l'attributo data-label */
    .table-responsive-stack td::before {
        content: attr(data-label); /* Legge il valore da data-label */
        font-weight: bold;
        text-align: left;
        padding-right: 1rem;
        color: #343a40; /* Dà più risalto all'etichetta */
    }
    
    /* Stili specifici per l'input di quantità */
    .table-responsive-stack td[data-label="Quantità"] input {
        max-width: 100px; /* Limita la larghezza dell'input */
    }
}

/*****************************CAMIONISTI MOBILE ***************************************\

/* Stili per i risultati di ricerca su mobile */
.search-results-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1rem;
}

.result-item {
    display: grid;
    grid-template-columns: 1fr auto; /* Colonna principale flessibile, icona a larghezza fissa */
    align-items: center;
    width: 100%;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.result-item:hover {
    background-color: #f8f9fa;
}

.result-item .item-title {
    font-weight: 600;
    grid-column: 1 / 2; /* Occupa la prima colonna */
}

.result-item .item-code {
    font-size: 14px;
    color: #6c757d;
    grid-column: 1 / 2; /* Occupa la prima colonna, sotto al titolo */
    grid-row: 2 / 3;
}

.result-item .item-add-icon {
    grid-column: 2 / 3; /* Occupa la seconda colonna */
    grid-row: 1 / 3;    /* Si estende su entrambe le righe */
    font-size: 28px;
    font-weight: bold;
    color: var(--success, #00B050);
    justify-self: end; /* Allinea a destra */
}







/******************************************************************\

/* ===== MOBILE: usabilità “a prova di camionista” ===== */
@media (max-width: 575.98px){

  /* container scroll più permissivo */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* tabella “safe” */
  .table-mobile-safe {
    font-size: 18px;               /* testo grande */
  }

  .table-mobile-safe thead th {
    position: sticky; top: 0;
    background: #fff; z-index: 2;
    font-weight: 700;
    font-size: 18px;
  }

  .table-mobile-safe th,
  .table-mobile-safe td {
    padding: 14px 12px !important; /* celle più grandi */
    vertical-align: middle;
  }

  /* colonna Prezzo allineata bene e leggibile */
  .table-mobile-safe td.text-end,
  .table-mobile-safe th.text-end {
    font-variant-numeric: tabular-nums;
    letter-spacing: .2px;
  }

  /* pulsante “+” più grande e comodo al tocco */
  .table-mobile-safe .btn-add-mobile {
    min-width: 48px; min-height: 48px;
    width: 48px; height: 48px;
    padding: 0 !important;
    font-size: 22px !important;
    line-height: 1 !important;
    border-radius: 999px !important;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* spazio tra righe per non “ammucchiare” */
  .table-mobile-safe tbody tr + tr td {
    border-top-width: 10px; /* effetto “card” distanziante */
    border-top-color: transparent;
  }

  /* tap feedback */
  .table-mobile-safe tbody tr:active {
    filter: brightness(0.98);
  }
}

/* Desktop/Tablet: mantieni aspetto standard */
@media (min-width: 576px){
  .table-mobile-safe .btn-add-mobile{
    padding: .25rem .5rem; font-size: .875rem; border-radius: .2rem;
    width:auto; height:auto; min-width:unset; min-height:unset;
  }
}


/* Centra il calendario nel modal e lasciagli spazio */
#modalCalendario .modal-body{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  overflow:auto;
}

/* Allarga il contenitore calendar */
#modalCalendario #calendar{
  width: 100%;
  display:flex;
  justify-content:center;
}

/* ==== FLATPICKR GIGANTE (senza rompere i click) ==== */
/* Browser Chromium/WebKit (Chrome, Edge, Safari): usa zoom */
#modalCalendario #calendar .flatpickr-calendar{
  zoom: 2.2; /* aumenta/diminuisci: 1.8–2.6 */
}

/* Firefox fallback */
@supports not (zoom: 1) {
  #modalCalendario #calendar .flatpickr-calendar{
    transform: scale(2.0);              /* fattore simile allo zoom */
    transform-origin: top center;
  }
  /* riserva spazio per l’elemento scalato, così non “spinge” lo scroll */
  #modalCalendario .modal-body{
    padding: 20px;
  }
}

/* ---- CALENDARIO GRANDE ---- */
#calendar-wrap{ width:100%; max-width:none; }

#calendar-wrap .fc-toolbar-title{ font-size:1.8rem; font-weight:800; }

/* celle molto alte */
.fc-daygrid-day-frame{ position:relative; min-height:170px; }
.fc-theme-standard td, .fc-theme-standard th{ border-color:#e9ecef; }

/* header giorni (lun, mar, …) più grande */
.fc .fc-col-header-cell-cushion{ padding:.6rem 0; font-size:1.1rem; font-weight:700; }

/* numero del giorno grande e centrato */
.fc .fc-daygrid-day-top{ justify-content:center; }
.fc-daygrid-day-number{
  display:block; width:100%; text-align:center;
  font-size:1.6rem; font-weight:900; padding:.5rem 0 .25rem 0;
}

/* prezzo più grande e ben leggibile */
.price-badge{
  position:absolute; left:50%; bottom:10px; transform:translateX(-50%);
  font-size:1.25rem; padding:.4rem .65rem; border-radius:.65rem;
  background:rgba(255,255,255,.92); box-shadow:0 1px 3px rgba(0,0,0,.1);
  pointer-events:none; white-space:nowrap;
}

/* selezione evidente */
.fc-daygrid-day.fc-day-selected .fc-daygrid-day-frame{
  outline:4px solid #0d6efd; outline-offset:-4px; border-radius:.7rem;
}

/* mobile: fullscreen e comunque grande */
@media (max-width: 576px){
  .fc-daygrid-day-frame{ min-height:140px; }
  .fc-daygrid-day-number{ font-size:1.8rem; }
  .price-badge{ font-size:1.35rem; }
}

/* Forza layout a COLONNA: calInfo va sempre sotto, mai a lato */
#calendar-wrap.calendar-stack{
  display:grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  align-items: stretch;
  width:100%;
  max-width:none;
}

/* Il calendario occupa tutta la riga */
#calendar-wrap.calendar-stack #calendar,
#calendar-wrap.calendar-stack .fc{
  width:100% !important;
  min-width:0;
}

/* La toolbar prende tutta la larghezza e va a capo se serve */
#calendar-wrap .fc-header-toolbar{
  width:100%;
  flex-wrap: wrap;
  gap:.5rem;
}

/* Messaggio SEMPRE sotto, a tutta larghezza, senza float */
#calInfo{
  grid-row: 2;
  display:block !important;
  width:100% !important;
  clear: both;
  float:none;
  margin-top:.75rem;
  font-size:1rem;
}

/* --- MOBILE E TABLET --- */
@media (max-width: 768px){
  /* fullscreen già attivo con modal-fullscreen-md-down:
     riduciamo padding per dare tutto lo spazio al calendario */
  #modalCalendario .modal-body{ padding: .5rem .5rem; }

  /* titolo e pulsanti comodi ma non invadenti */
  #calendar-wrap .fc-toolbar-title{ font-size:1.4rem; }
  #calendar-wrap .fc-button{ padding:.35rem .6rem; font-size:.95rem; }

  /* celle proporzionate allo schermo:
     clamp(min, ideale, max) = tra 110px e 160px, preferendo ~14vh */
  .fc-daygrid-day-frame{ min-height: clamp(110px, 14vh, 160px); }

  /* intestazione dei giorni (lun, mar, …) un filo più grande */
  .fc .fc-col-header-cell-cushion{ padding:.5rem 0; font-size:1.05rem; font-weight:700; }

  /* numero del giorno e prezzo ben visibili */
  .fc-daygrid-day-number{ font-size: clamp(1.2rem, 3.8vw, 1.6rem); font-weight: 800; }
  .price-badge{
    font-size: clamp(1.05rem, 3.6vw, 1.25rem);
    padding:.34rem .55rem;
    bottom: 10px;
  }
}

/* --- TELEFONI PICCOLI (<400px) --- */
@media (max-width: 600px){
  #calendar-wrap .fc-toolbar-title{ font-size:1.2rem; }
  .fc-daygrid-day-frame{ min-height: clamp(100px, 16vh, 150px); }
  .fc-daygrid-day-number{ font-size: clamp(1.15rem, 4.2vw, 1.35rem); }
  .price-badge{ font-size: clamp(0.7rem, 4vw, 0.8rem); }
}




/* Desktop: mostra tabella, nasconde la cella mobile */
#righe_ordine .mobile-card{ display:none; }

/* --- MOBILE: mostra solo la card cliccabile, font più grande e leggibile --- */
@media (max-width: 576px){
  /* nascondi celle tabellari classiche */
  #righe_ordine thead{ display:none; }
  #righe_ordine tbody tr td{ display:none; border:0 !important; padding:0 !important; }

  /* mostra solo la cella mobile */
  #righe_ordine tbody tr td.mobile-card{ display:block; }

  /* contenitore <details> */
  .riga-mobile{
    display:block;
    border:1px solid #e9ecef;
    border-radius:.6rem;
    background:#fff;
    overflow:hidden;
  }
  .riga-mobile[open]{
    border-color:#d0d7de;
    box-shadow:0 1px 2px rgba(0,0,0,.05);
  }

  /* barra riassuntiva: Prodotto | Prezzo */
  .riga-mobile > summary{
    list-style:none;
    cursor:pointer;
    display:grid;
    grid-template-columns: 1fr auto; /* nome | prezzo */
    align-items:center;
    gap:.75rem;
    padding:1rem 1.1rem;       /* più respiro */
    font-size:1.08rem;         /* più grande */
    line-height:1.35;
    font-weight:600;
  }
  .riga-mobile > summary::-webkit-details-marker{ display:none; }

  /* Nome prodotto ellissato, prezzo a destra */
  .riga-mobile .mprod{
    min-width:0;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-weight:700;           /* evidenzia nome */
  }
  .riga-mobile .mprice{
    font-variant-numeric: tabular-nums;
    font-size:1.12rem;
    font-weight:700;
  }

  /* contenuto card */
  .riga-mobile .mcard{
    padding:1rem 1.1rem 1.1rem 1.1rem;
    border-top:1px solid #f0f2f4;
    display:grid;
    gap:.65rem;                /* più spazio tra righe */
    background:#fafbfc;
    font-size:1.04rem;
    line-height:1.4;
  }

  /* righe Etichetta | Valore */
  .riga-mobile .mrow{
    display:grid;
    grid-template-columns: 10.5rem 1fr; /* etichetta un po' più larga */
    gap:.45rem .9rem;
    align-items:center;
  }
  .riga-mobile .mrow > span{
    opacity:.9;
    font-weight:600;
  }
  .riga-mobile .mrow strong{
    justify-self:end;
    font-weight:700;
  }
  .riga-mobile .mrow .mdesc{
    white-space:normal;
    line-height:1.3;
    opacity:.95;
  }

  /* Input e pulsante comodi al tocco */
  .riga-mobile input[type="number"]{
    width:100%;
    height:40px;
    padding:.4rem .6rem;
    text-align:right;
    font-size:1.05rem;
  }
  .riga-mobile .remove-riga{
    width:100%;
    height:42px;
    font-size:1.05rem;
    margin-top:.35rem;
  }
}







 /* Progress bar annua (minimal CSS) */
        :root {
            --ok: #16a34a;
            --warn: #ca8a04;
            --crit: #dc2626;
        }

        .annual-wrap {
            padding: 14px 16px;
            margin: 10px 16px 0;
            border: 1px solid rgba(0, 0, 0, .06);
            border-radius: 10px;
            background: #fff;
            box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
        }

        .annual-top {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            gap: 12px;
        }

        .annual-top .title {
            font-weight: 600;
            font-size: 15px;
        }

        .annual-top .meta {
            font-size: 13px;
            color: #64748b;
            white-space: nowrap;
        }

        .annual-bar {
            height: 14px;
            border-radius: 999px;
            background: #f1f5f9;
            overflow: hidden;
        }

        .annual-fill {
            height: 100%;
            width: 0;
            background: var(--ok);
        }

        .annual-fill.warn {
            background: var(--warn);
        }

        .annual-fill.crit {
            background: var(--crit);
        }

        .annual-sub {
            margin-top: 6px;
            color: #475569;
            font-size: 12px;
        }




.annual-top {
  /* 1. Allinea gli elementi principali (titolo e meta) sulla stessa riga */
  display: flex;
  justify-content: space-between; /* Spinge titolo e meta ai lati opposti */
  align-items: center; /* Li allinea verticalmente al centro */
  width: 100%;
}

.title {
  /* 2. Fa in modo che anche il titolo usi Flexbox per i suoi contenuti interni */
  display: flex;
  align-items: center; /* Allinea "Totale..." e "Aggiornato..." sulla stessa linea */
  flex-grow: 1; /* Permette al div del titolo di occupare lo spazio disponibile */
}

.update-status {
  /* 3. Questa è la parte chiave: */
  flex-grow: 1; /* L'elemento si prende tutto lo spazio extra rimanente... */
  text-align: center; /* ...e centra il suo testo al suo interno. */
  
  /* Stile per renderlo visibile */
  color: #0d6efd; /* Un blu più vibrante */
  font-size: 0.9em;
  font-weight: 500; /* Un grassetto meno pesante */
}

.meta {
  /* Forza il blocco 'meta' a non restringersi */
  flex-shrink: 0; 
  padding-left: 1rem; /* Aggiunge un po' di spazio per non attaccarsi */
}


.card .btn-edit{
    border:0;background:transparent;cursor:pointer;margin-left:6px;font-size:14px;opacity:.75
  }
  .card .btn-edit:hover{opacity:1}





   /* HEADER CARD: titolo a sinistra, valore a destra */
        .card .card-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: .5rem
        }

        .card .titlewrap {
            flex: 1;
            min-width: 0
        }

        .card .actions {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: .5rem
        }

        /* Pill kg e badge % */
        .card .kgpill {
            font-size: .85rem;
            padding: .2rem .45rem;
            border-radius: .5rem;
            background: rgba(0, 0, 0, .06)
        }

        .card .percent {
            color: #fff;
            border-radius: .5rem;
            padding: .2rem .45rem;
            font-weight: 600;
            min-width: 3.2rem;
            text-align: center
        }

        :root {
            --ok: #16a34a;
            --warn: #ca8a04;
            --crit: #dc2626
        }

        .percent.ok {
            background: var(--ok)
        }

        .percent.warn {
            background: var(--warn)
        }

        .percent.crit {
            background: var(--crit)
        }

        /* Pulsante ghost (niente verde!) */
        .card .btn-edit {
            border: 0;
            background: transparent;
            cursor: pointer;
            font-size: 14px;
            line-height: 1;
            padding: .25rem .5rem;
            border-radius: .5rem;
            opacity: .85;
            display: inline-flex;
            align-items: center;
            gap: .25rem
        }

        .card .btn-edit:hover {
            opacity: 1;
            background: rgba(0, 0, 0, .06)
        }

        @media (max-width:576px) {
            .card .btn-edit .lbl {
                display: none
            }
        }

        /* Mini spinner testuale nelle tabelle "Oggi" */
        .muted {
            opacity: .7
        }

        /* Per i caret ▸/▾ nelle tabelle collapse */
        .prev-row {
            cursor: pointer
        }

        .prev-row [data-caret] {
            display: inline-block;
            width: 1rem;
            text-align: center
        }


        /* Header del calendario */
        .date-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: .5rem;
            padding: .5rem 0;
            margin: .25rem 0 .5rem 0;
            border-bottom: 1px dashed rgba(0, 0, 0, .1)
        }

        .date-header .current-date {
            font-weight: 600;
            opacity: .9
        }



        #btnPlanimetria{margin-left:auto}



        .cr-modal{position:fixed; inset:0; display:none; z-index:1050;}
.cr-modal.show{display:block;}
.cr-modal .backdrop{position:absolute; inset:0; background:rgba(0,0,0,.5);}
.cr-modal .panel{
  position:relative; margin:5vh auto; background:#fff; color:#111;
  max-width:1000px; border-radius:8px; padding:16px;
  max-height:90vh; overflow:auto; box-shadow:0 10px 30px rgba(0,0,0,.2);
}




/****************************************************************************************************/

  .category-selector-card {
            border: none;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
            text-align: center;
            cursor: pointer;
            padding: 40px;
            user-select: none;
        }

        .category-selector-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        }

        .category-selector-card i {
            font-size: 50px;
            color: #F1C40F;
            margin-bottom: 20px;
        }

        .category-selector-card .card-title {
            font-size: 1.5rem;
            font-weight: bold;
            margin-bottom: 15px;
        }

        .products-container {
            padding: 1.5rem;
            border: 1px solid #dee2e6;
            border-radius: 15px;
            margin-top: -10px;
            background-color: #fff;
        }

        .product-card {
            border: 1px solid #dee2e6;
            border-radius: 0.375rem;
            padding: 1rem;
            cursor: pointer;
            transition: all 0.2s ease-in-out;
            height: 100%;
            display: flex;
            flex-direction: column;
            background-color: #fff;
        }

        .product-card:hover {
            border-color: #0d6efd;
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
            transform: translateY(-4px);
        }

        .product-card-title {
            font-weight: 600;
            margin-bottom: 0.5rem;
            flex-grow: 1;
            color: #212529;
        }

        .product-card-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.9em;
            color: #6c757d;
            border-top: 1px solid #e9ecef;
            padding-top: 0.75rem;
            margin-top: 0.75rem;
        }

        .product-card .price {
            font-weight: 700;
            color: #000;
            background-color: #e9f5ff;
            padding: 0.2rem 0.5rem;
            border-radius: 5px;
        }

        .calendar-stack .price-badge {
            display: block;
            text-align: center;
            font-size: 0.8em;
            font-weight: 500;
        }

        #calendar .fc-day-selected {
            background-color: rgba(13, 110, 253, 0.25) !important;
        }

        input[readonly] {
            background-color: #e9ecef;
            cursor: not-allowed;
        }

/*HOVER FOTO CARD*/

        .product-preview-popup {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: #fff;
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    border-radius: 8px;
    padding: 8px;
    max-width: 240px;
    max-height: 240px;
    display: none;
}

.product-preview-popup img {
    max-width: 220px;
    max-height: 220px;
    object-fit: contain;
    display: block;
}
