:root {
    /* Variabili colore tema chiaro */
    --background: hsl(206, 22%, 99%);
    --foreground: hsl(215, 25%, 27%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(215, 25%, 27%);
    --border: hsl(214, 20%, 90%);
    --muted-foreground: hsl(215, 10%, 55%);
    --primary: hsl(206, 100%, 50%);
    --success: hsl(142, 69%, 58%);
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.label-usernamelabel {
    font-size: 24px;
}

html, body {
    margin: 0;
    padding: 0;
}

.scontrino-100 {
    font-family: monospace;
    font-size: 11px;
    /*width: 280px;*/
    width: 100%;
    margin: 0 auto;
    padding: 8px;
    border: 1px dashed #ccc;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.scontrino {
    font-family: monospace;
    font-size: 11px;
    /*width: 280px;*/
    width: 325px;
    margin: 0 auto;
    padding: 8px;
    border: 1px dashed #ccc;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.scontrino-comet {
    font-family: monospace;
    font-size: 11px;
    width: 320px;
    margin: 0 auto;
    padding: 8px;
    border: 1px dashed #ccc;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.scontrino-header,
.scontrino-footer {
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.4;
}

.scontrino-data {
    font-size: 1.3em;
    font-weight: bold;
    display: block;
    margin: 6px 0;
    letter-spacing: 0.5px;
}

.scontrino-prezzo {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
    display: block;
    margin: 5px 0;
}

.scontrino-body {
    margin-bottom: 10px;
    line-height: 1.4;
}

    .scontrino-body p {
        text-align: center;
    }


.scontrino-header strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}


.scontrino-body p {
    margin: 4px 0;
}

.righe-scontrino {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 12px;
}

    .righe-scontrino thead tr {
        border-bottom: 1px dashed #000;
    }

    .righe-scontrino th,
    .righe-scontrino td {
        padding: 2px 4px;
        text-align: left;
        vertical-align: top;
    }

        .righe-scontrino td:last-child {
            text-align: right;
            white-space: nowrap;
        }

        .righe-scontrino th.iva-col {
            white-space: nowrap;
        }

/*comet*/

.righe-scontrino-comet {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin: 8px 0;
    font-size: 12px;
    table-layout: fixed;
}

    .righe-scontrino-comet thead tr {
        border-bottom: 1px dashed #000;
    }

    .righe-scontrino-comet th,
    .righe-scontrino-comet td {
        padding: 2px 4px;
        vertical-align: top;
        overflow-wrap: break-word;
        word-break: break-word;
    }

        .righe-scontrino-comet th:first-child,
        .righe-scontrino-comet td:first-child {
            width: 65%;
            text-align: left !important;
        }

        .righe-scontrino-comet th:nth-child(2),
        .righe-scontrino-comet td:nth-child(2) {
            width: 10%;
            text-align: left;
        }

        .righe-scontrino-comet th:last-child,
        .righe-scontrino-comet td:last-child {
            width: 25%;
            text-align: right;
            white-space: nowrap;
        }

/*        .righe-scontrino-comet td:last-child {
            text-align: right;
            white-space: nowrap;
        }*/

.totale-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.totale-riga {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 18px;
    padding: 8px 0;
}

.totale-riga-small {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
}

.codicefiscale-big {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 14px;
    padding: 8px 0;
}

.totale-iva {
    display: flex;
    justify-content: space-between;
    width: 100%;
    text-transform: uppercase;
    margin-right: 8px;
}

.totale-iva-small {
    display: flex;
    justify-content: space-between;
    width: 100%;
    text-transform: uppercase;
}

.scontrino-socio {
    font-weight: bold;
    font-size: 15px;
}

/*.cassa-tufano {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 18px;
    padding: 8px 0;
    width: 100%;
}*/


.receipt-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.04);
}

.receipt-header {
    background: #f1f3f5;
    font-weight: 600;
    padding: .75rem 1rem;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.receipt-body {
    padding: 1rem 1.25rem;
}

    .receipt-body .row + .row {
        margin-top: .5rem;
    }

.receipt-total {
    text-align: right;
    padding: .75rem 1.25rem;
    /*border-top: 1px dashed #dee2e6;*/
    font-size: 1.25rem;
    font-weight: 700;
}

.receipt-actions {
    text-align: right;
    padding: .5rem 1.25rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem
}

.font-bold {
    font-weight: 700
}

.text-foreground {
    color: hsl(var(--foreground))
}

.text-muted-foreground {
    color: hsl(var(--muted-foreground));
}

.mt-1 {
    margin-top: 0.25rem; /* 4px */
}

/* Griglia che contiene i tile */
.tile-grid {
    display: flex; /* o grid, ma meglio flex se affiancati */
    gap: 1rem;
    margin-left: auto; /* spinge tutto a destra */
}

/* Per schermi piccoli → tile in colonna */
@media (max-width: 640px) {
    .tile-grid {
        grid-template-columns: 1fr;
    }
}

/* Tile base */
.tile {
    background-color: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 1px 2px hsl(var(--foreground) / 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Contenuto testuale (titolo + numero) */
.tile-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* testo allineato a sinistra */
}

/* Titolo piccolo */
.tile p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* Numero principale */
.tile h3 {
    font-size: 1.875rem; /* ~text-3xl */
    font-weight: 700;
    margin-top: 0.25rem; /* mt-1 */
    margin-bottom: 0;
}

/* Icona cerchio */
.tile-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tile-icon.primary {
        background-color: hsl(206, 100%, 50%, 0.1);
        color: var(--primary);
    }

    .tile-icon.success {
        background-color: hsl(142, 69%, 58%, 0.1);
        color: var(--success);
    }

.garanzia-box {
    background-color: #f8f9fa; /* grigino chiaro neutro */
    border: 1px solid #dee2e6; /* bordo sottile */
    border-radius: 6px;
    padding: 12px 15px;
    margin-top: 10px;
}

.garanzia-titolo {
    font-weight: 600;
    font-size: 1.05em;
    color: #0d6efd; /* blu bootstrap */
    margin-bottom: 6px;
}

.garanzia-testo {
    font-size: 1em;
    color: #212529; /* testo standard bootstrap */
}

.garanzia-valore {
    background-color: #e9f7ef; /* verdino chiaro */
    color: #0f5132; /* verde bootstrap text-success */
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.modal-backdrop{
    z-index: 100 !important;
}

#searchModal{
    z-index: 101 !important;
}

#floatingButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
    z-index: 1000;
}

#floatingButton:hover {
    background-color: #0056b3;
}

/* Sfondo scuro del modale */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

/* Contenuto del modale */
.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
}

/* Pulsante di chiusura */
.close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}
/* ==== Scheda prodotto (namespace: sp-) ==== */
.scheda-prodotto .card {
    border-radius: .8rem;
}

/* Box neutro con bordo/shadow leggero */
.sp-box {
    border: 1px solid rgba(0,0,0,.06);
    border-radius: .8rem;
    background: #fff;
    box-shadow: 0 .25rem .9rem rgba(0,0,0,.04);
}

/* Colonna immagine sticky */
.sp-image-wrap {
    position: sticky;
    top: 1rem;
}

/* Contenitore immagine */
.sp-image-container {
    border-radius: .8rem;
    padding: .75rem;
    background: #fff;
    border: 1px dashed rgba(0,0,0,.1);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Immagine principale */
.sp-image {
    max-height: 300px;
    width: auto;
    border-radius: .5rem;
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.06);
}

/* Placeholder immagine centrato */
.sp-placeholder {
    width: 100%;
    height: 100%;
    min-height: 280px;
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    background: radial-gradient(ellipse at top, #f8fafc, transparent 60%), radial-gradient(ellipse at bottom, #f3f4f6, transparent 60%);
}

.sp-placeholder-icon {
    font-size: 2rem;
    line-height: 1;
}

/* Spaziature verticali tra le card a destra */
.sp-col-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Titolo sezione */
.sp-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: .5rem;
}

/* Pill garanzia */
.garanzia-valore {
    background: #e7f6ec;
    color: #146c43;
    padding: .15rem .45rem;
    border-radius: .35rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Azioni (bottone allineato a destra) */
.sp-actions {
    display: flex;
    justify-content: flex-end;
}

/* Tabella dettagli nel modal */
.sp-table th {
    background: #f8f9fa;
    width: 25%;
}

/* ——— separatori più evidenti ——— */

/* Box neutro con bordo SOLIDO e sfondo chiaro */
.sp-section {
    border: 1px solid rgba(0,0,0,.12);
    border-radius: .8rem;
    background: #fbfbfc;
}

/* Contenitore immagine con bordo solido (niente tratteggio) */
.sp-image-container {
    border: 1px solid rgba(0,0,0,.12);
    border-radius: .8rem;
    padding: .75rem;
    background: #fff;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Immagine */
.sp-image {
    max-height: 300px;
    width: auto;
    border-radius: .5rem;
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.06);
}

/* Placeholder centrato */
.sp-placeholder {
    width: 100%;
    height: 100%;
    min-height: 280px;
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    background: radial-gradient(ellipse at top, #f8fafc, transparent 60%), radial-gradient(ellipse at bottom, #f3f4f6, transparent 60%);
}

.sp-placeholder-icon {
    font-size: 2rem;
    line-height: 1;
}

/* Stack destro */
.sp-col-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Titolo sezione */
.sp-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: .5rem;
}

/* Pill garanzia */
.garanzia-valore {
    background: #e7f6ec;
    color: #146c43;
    padding: .15rem .45rem;
    border-radius: .35rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Toolbar bottone visivamente separata dalla scheda info */
.sp-toolbar {
    border-top: 1px solid rgba(0,0,0,.12);
    background: #f7f7f8;
    padding: .75rem;
    border-bottom-left-radius: .8rem;
    border-bottom-right-radius: .8rem;
    display: flex;
    justify-content: flex-end;
}

/* Corpo della scheda info (arrotondamenti senza confliggere con toolbar) */
.sp-info-body {
    padding: 1rem;
    border-top-left-radius: .8rem;
    border-top-right-radius: .8rem;
}

/* Sticky colonna immagine */
.sp-image-wrap {
    position: sticky;
    top: 1rem;
}

.sp-right-panel.sp-section {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.sp-subsection {
    padding: 1rem;
}

.sp-subsection + .sp-subsection {
    border-top: 1px solid rgba(0,0,0,.12);
}

.sp-toolbar {
    border-top: 1px solid rgba(0,0,0,.12);
    background: #f7f7f8;
    padding: .75rem;
    display: flex;
    justify-content: flex-end;
}

@media (min-width: 992px) {
    .sp-col-divider {
        border-left: 1px solid rgba(0,0,0,.12);
        padding-left: 0.5rem;
    }
}

.sp-info-inline {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* colonna testo che si espande */
.sp-info-col {
    flex: 1 1 auto;
    min-width: 0;
}

/* toolbar inline (senza bordo/sfondo) */
.sp-toolbar-inline {
    padding: 0;
    border: 0;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}
.close:hover {
    color: black;
}

/*Modal di dettaglio prodotto*/

.sp-modal .modal-xxl {
    --bs-modal-width: min(1400px, 96vw);
}


.sp-modal .modal-dialog {
    /* usa direttamente max-width, è chiarissimo e batte l'XL */
    max-width: min(1400px, 96vw) !important;
}

.sp-modal .modal-content {
    width: auto !important; /* annulla il 90% */
    max-width: none !important; /* annulla i 400px */
    margin: !important; /* niente 10% dall’alto */
}

.sp-modal .modal-body {
    max-height: 80vh;
    overflow: auto;
}


/* Contenitore tile generico */
.tile {
    display: flex;
    align-items: center;
    background: var(--tblr-body-bg, var(--bs-body-bg));
    border: 1px solid var(--tblr-border-color, var(--bs-border-color));
    border-radius: .75rem;
}

/* Variante compatta pensata per mobile */
.tile-compact {
    padding: .65rem .8rem;
    gap: .5rem;
}

/* Icona circolare coerente con lo stile esistente */
.tile-ic {
    width: clamp(30px, 8vw, 38px);
    height: clamp(30px, 8vw, 38px);
    display: grid;
    place-items: center;
    border-radius: 999px;
    opacity: .95;
}

    .tile-ic i {
        font-size: clamp(14px, 5vw, 18px);
        line-height: 1;
    }

/* Testi */
.tile-content {
    line-height: 1.1;
}

.tile-label {
    font-size: clamp(.78rem, 2.8vw, .9rem);
    color: var(--tblr-muted, var(--bs-secondary-color));
}

.tile-value {
    font-weight: 700;
    font-size: clamp(.95rem, 4.4vw, 1.2rem); /* prima era più grande */
    white-space: nowrap; /* evita che € o cifre vadano a capo */
    line-height: 1.1;
}

    /* se separi il simbolo, rendilo leggermente più piccolo */
    .tile-value .currency {
        font-size: .9em; /* 10% più piccolo del numero */
        margin-right: .15em; /* piccolo spazio tra € e cifra */
    }

/* Da md in su: un po' più aria */
@media (min-width: 768px) {
    .tile-compact {
        padding: .8rem 1rem;
        gap: .6rem;
    }

    .tile-ic {
        width: 40px;
        height: 40px;
    }

        .tile-ic i {
            font-size: 20px;
        }

    .tile-value {
        font-size: 1.4rem;
    }
}

.icon-circle {
    width: clamp(34px, 7vw, 40px);
    height: clamp(34px, 7vw, 40px);
    display: grid;
    place-items: center;
    border-radius: 999px;
}

    .icon-circle i {
        font-size: clamp(16px, 4.5vw, 20px);
    }

/* tipografia fluida e compatta */
.receipt-title {
    font-size: clamp(1.05rem, 4.5vw, 1.4rem);
    line-height: 1.1;
}

.receipt-number {
    font-size: clamp(.95rem, 4vw, 1.15rem);
    line-height: 1.1;
}

.receipt-datetime {
    white-space: nowrap;
}
/* evita che € o i numeri vadano a capo: qui per data/ora */

@media (min-width: 768px) {
    .receipt-datetime {
        white-space: normal;
    }
    /* su desktop può andare su due righe se serve */
}